Log in

View Full Version : COMMITTED: SE_EndurancePool


Caryatis
07-16-2010, 01:48 AM
Pretty simple effect, increases or decreases the endurance pool, Spirit of Determination (http://lucy.allakhazam.com/spell.html?id=19427&source=Live).

client mobs.cpp
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...

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.

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;
}
-
}