Skip to content

Commit

Permalink
Added Focus Skill
Browse files Browse the repository at this point in the history
Added Focus Skill to Stam Regain and Mana Regan.
  • Loading branch information
DragonSlayer62 committed Apr 19, 2024
1 parent 0ae55f8 commit d4b3d75
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
3 changes: 3 additions & 0 deletions source/Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
4/18/2024 - Dragon Slayer
Added Focus Skill to Stam Regain and Mana Regan.

4/06/2024 - Dragon Slayer
Fixed Runebook Cooldown:
The Runebook now uses GetCurrentClock() instead of a timer, ensuring accurate checks for a 7-second delay using the system clock of the server.
Expand Down
19 changes: 17 additions & 2 deletions source/uox3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,14 @@ auto GenericCheck( CSocket *mSock, CChar& mChar, bool checkFieldEffects, bool do
{
if(( mChar.GetRegen( 1 ) + ( c * cwmWorldState->ServerData()->SystemTimer( tSERVER_STAMINAREGEN ) * 1000 )) <= cwmWorldState->GetUICurrentTime() && mChar.GetStamina() <= maxStam )
{
mChar.IncStamina( 1 );
double FocusBonus = 0;
if(cwmWorldState->ServerData()->ExpansionCoreShardEra() == ER_AOS)
{
Skills->CheckSkill(( &mChar ), FOCUS, 0, 1000 ); // Check FOCUS for skill gain AOS
FocusBonus = ( 0.1 * mChar.GetSkill( FOCUS ) / 10); // Bonus for focus
}

mChar.IncStamina( 1 + FocusBonus );

if( mChar.GetStamina() >= maxStam )
{
Expand All @@ -1328,8 +1335,16 @@ auto GenericCheck( CSocket *mSock, CChar& mChar, bool checkFieldEffects, bool do
{
if( mChar.GetRegen( 2 ) + ( c * cwmWorldState->ServerData()->SystemTimer( tSERVER_MANAREGEN ) * 1000 ) <= cwmWorldState->GetUICurrentTime() && mChar.GetMana() <= maxMana )
{
double FocusBonus = 0;
if(cwmWorldState->ServerData()->ExpansionCoreShardEra() == ER_AOS)
{
Skills->CheckSkill(( &mChar ), FOCUS, 0, 1000 ); // Check FOCUS for skill gain AOS
double focus = mChar.GetSkill( FOCUS ); // Bonus for focus
double focusBonus = focus / 200;
}

Skills->CheckSkill(( &mChar ), MEDITATION, 0, 1000 ); // Check Meditation for skill gain ala OSI
mChar.IncMana( 1 ); // Gain a mana point
mChar.IncMana( 1 + FocusBonus ); // Gain a mana point
if( mChar.GetMana() == maxMana )
{
if( mChar.IsMeditating() )
Expand Down

0 comments on commit d4b3d75

Please sign in to comment.