This is how it works:
- Calliav spell line absorbs a specific number of melee and spell damage
- I verified with my wizard that each melee/damage spell decrements the counter while absorbing the blow.
- When the counter gets down to 0 the spell fades.
Here's the code:
Code:
Index: zone/attack.cpp
===================================================================
--- zone/attack.cpp (revision 1120)
+++ zone/attack.cpp (working copy)
@@ -2766,8 +2766,19 @@
}
sint32 Mob::ReduceDamage(sint32 damage){
+ int slot = GetBuffSlotFromType(SE_NegateAttacks);
+
+ if(damage > 0 && slot >= 0 && this->buffs[slot].melee_rune > 0){
+ this->buffs[slot].melee_rune--;
+ if(buffs[slot].melee_rune == 0){
+ BuffFadeBySlot(slot);
+ SetHasRune((GetBuffSlotFromType(SE_NegateAttacks) >= 0) || (GetBuffSlotFromType(SE_Rune) >= 0));
+ }
+ return -6;
+ }
+
if(damage > 0 && HasRune()) {
- int slot = GetBuffSlotFromType(SE_Rune);
+ slot = GetBuffSlotFromType(SE_Rune);
while(slot >= 0) {
int16 melee_rune_left = this->buffs[slot].melee_rune;
@@ -2796,8 +2807,18 @@
}
sint32 Mob::ReduceMagicalDamage(sint32 damage) {
+ int slot = GetBuffSlotFromType(SE_NegateAttacks);
+
+ if(damage > 0 && slot >= 0 && this->buffs[slot].melee_rune > 0){
+ this->buffs[slot].melee_rune--; // arbitrarily using melee_rune to count both melee and spell attacks
+ if(buffs[slot].melee_rune == 0){
+ BuffFadeBySlot(slot);
+ SetHasSpellRune((GetBuffSlotFromType(SE_NegateAttacks) >= 0) || (GetBuffSlotFromType(SE_AbsorbMagicAtt) >= 0));
+ }
+ return -6;
+ }
if(damage > 0 && HasSpellRune()) {
- int slot = GetBuffSlotFromType(SE_AbsorbMagicAtt);
+ slot = GetBuffSlotFromType(SE_AbsorbMagicAtt);
while(slot >= 0) {
int16 magic_rune_left = this->buffs[slot].magic_rune;
Index: zone/spell_effects.cpp
===================================================================
--- zone/spell_effects.cpp (revision 1120)
+++ zone/spell_effects.cpp (working copy)
@@ -1488,7 +1488,16 @@
AddProcToWeapon(procid, false, spells[spell_id].base2[i]+100);
break;
}
-
+ case SE_NegateAttacks:
+ {
+#ifdef SPELL_EFFECT_SPAM
+ snprintf(effect_desc, _EDLEN, "Melee Negate Attack Rune: %+i", effect_value);
+#endif
+ buffs[buffslot].melee_rune = effect_value;
+ SetHasRune(true);
+ SetHasSpellRune(true);
+ break;
+ }
case SE_AppraiseLDonChest:
{
if(IsNPC())
Discussion thread:
http://www.eqemulator.net/forums/showthread.php?t=30221