EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Server Code Submissions (https://www.eqemulator.org/forums/forumdisplay.php?f=669)
-   -   COMMITTED: SE_EndurancePool (https://www.eqemulator.org/forums/showthread.php?t=31675)

Caryatis 07-16-2010 01:48 AM

COMMITTED: SE_EndurancePool
 
Pretty simple effect, increases or decreases the endurance pool, Spirit of Determination.

client mobs.cpp
Code:

Index: client_mods.cpp
===================================================================
--- client_mods.cpp        (revision 1604)
+++ client_mods.cpp        (working copy)
@@ -1773,9 +1773,26 @@
 void Client::CalcMaxEndurance()
 {
        max_end = CalcBaseEndurance() + spellbonuses.Endurance + itembonuses.Endurance;
+       
+        int slot = GetBuffSlotFromType(SE_EndurancePool);
+        if(slot >= 0)
+        {
+                for(int i = 0; i < EFFECT_COUNT; i++)
+                {
+                        if (spells[buffs[slot].spellid].effectid[i] == SE_EndurancePool)
+                        {
+                                max_end += spells[buffs[slot].spellid].base[i];
+                        }
+                }
+        }
+       
        if (cur_end > max_end) {
                cur_end = max_end;
        }
+        if (max_end < 0) {
+                max_end = 0;
+        }
+       
 }
 
 sint32 Client::CalcBaseEndurance()


Caryatis 07-16-2010 07:58 PM

forgot the requisite spell effects change...

Code:

Index: spell_effects.cpp
===================================================================
--- spell_effects.cpp        (revision 1604)
+++ spell_effects.cpp        (working copy)
@@ -2812,6 +2812,7 @@
                        case SE_LimitCastTime:
                        case SE_NoCombatSkills:
                        case SE_TriggerOnCast:
+                        case SE_EndurancePool:
                        {
                                break;
                        }


Caryatis 11-04-2010 07:39 PM

Updated like the previous effect so that it uses the bonuses system so multiple spells will stack.

Code:

Index: bonuses.cpp
===================================================================
--- bonuses.cpp        (revision 1713)
+++ bonuses.cpp        (working copy)
@@ -1206,7 +1206,12 @@
                                        newbon->Accuracy = effect_value;
                                break;
                        }
-
+                        case SE_EndurancePool:
+                        {
+                                newbon->Endurance += effect_value;
+                                break;
+                        }
                }
        }
Index: client_mods.cpp
===================================================================
--- client_mods.cpp        (revision 1713)
+++ client_mods.cpp        (working copy)
@@ -1790,25 +1790,12 @@
 {
        max_end = CalcBaseEndurance() + spellbonuses.Endurance + itembonuses.Endurance;
       
-        int slot = GetBuffSlotFromType(SE_EndurancePool);
-        if(slot >= 0)
-        {
-                for(int i = 0; i < EFFECT_COUNT; i++)
-                {
-                        if (spells[buffs[slot].spellid].effectid[i] == SE_EndurancePool)
-                        {
-                                max_end += spells[buffs[slot].spellid].base[i];
-                        }
-                }
-        }
-       
        if (cur_end > max_end) {
                cur_end = max_end;
        }
        if (max_end < 0) {
                max_end = 0;
        }
-       
 }



All times are GMT -4. The time now is 07:55 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.