[Spells] Update SPA 101 SE_CompleteHeal (#1544)

Fixed buff stacking issue
This commit is contained in:
KayenEQ 2021-09-19 16:16:21 -04:00 committed by GitHub
parent 442850aebb
commit 46edd56acc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 23 deletions

View File

@ -3671,6 +3671,10 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
new_bonus->ZoneSuspendMinion = effect_value; new_bonus->ZoneSuspendMinion = effect_value;
break; break;
case SE_CompleteHeal:
new_bonus->CompleteHealBuffBlocker = true;
break;
//Special custom cases for loading effects on to NPC from 'npc_spels_effects' table //Special custom cases for loading effects on to NPC from 'npc_spels_effects' table
if (IsAISpellEffect) { if (IsAISpellEffect) {

View File

@ -554,6 +554,7 @@ struct StatBonuses {
int32 ItemEnduranceRegenCap; // modify endurance regen cap int32 ItemEnduranceRegenCap; // modify endurance regen cap
int32 WeaponStance[WEAPON_STANCE_TYPE_MAX +1];// base = trigger spell id, base2 = 0 is 2h, 1 is shield, 2 is dual wield, [0]spid 2h, [1]spid shield, [2]spid DW int32 WeaponStance[WEAPON_STANCE_TYPE_MAX +1];// base = trigger spell id, base2 = 0 is 2h, 1 is shield, 2 is dual wield, [0]spid 2h, [1]spid shield, [2]spid DW
bool ZoneSuspendMinion; // base 1 allows suspended minions to zone bool ZoneSuspendMinion; // base 1 allows suspended minions to zone
bool CompleteHealBuffBlocker; // Use in SPA 101 to prevent recast of complete heal from this effect till blocker buff is removed.
// AAs // AAs
uint16 SecondaryForte; // allow a second skill to be specialized with a cap of this value. uint16 SecondaryForte; // allow a second skill to be specialized with a cap of this value.

View File

@ -343,31 +343,13 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
#ifdef SPELL_EFFECT_SPAM #ifdef SPELL_EFFECT_SPAM
snprintf(effect_desc, _EDLEN, "Complete Heal"); snprintf(effect_desc, _EDLEN, "Complete Heal");
#endif #endif
//make sure they are not allready affected by this... int val = 7500 * effect_value;
//I think that is the point of making this a buff. if (caster) {
//this is in the wrong spot, it should be in the immune
//section so the buff timer does not get refreshed!
int i;
bool inuse = false;
int buff_count = GetMaxTotalSlots();
for(i = 0; i < buff_count; i++) {
if(buffs[i].spellid == spell_id && i != buffslot) {
Message(0, "You must wait before you can be affected by this spell again.");
inuse = true;
break;
}
}
if(inuse)
break;
int32 val = 0;
val = 7500 * effect_value;
if (caster)
val = caster->GetActSpellHealing(spell_id, val, this); val = caster->GetActSpellHealing(spell_id, val, this);
}
if (val > 0) if (val > 0) {
HealDamage(val, caster); HealDamage(val, caster);
}
break; break;
} }

View File

@ -2931,6 +2931,11 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2,
LogSpells("Check Stacking on old [{}] ([{}]) @ lvl [{}] (by [{}]) vs. new [{}] ([{}]) @ lvl [{}] (by [{}])", sp1.name, spellid1, caster_level1, (caster1==nullptr)?"Nobody":caster1->GetName(), sp2.name, spellid2, caster_level2, (caster2==nullptr)?"Nobody":caster2->GetName()); LogSpells("Check Stacking on old [{}] ([{}]) @ lvl [{}] (by [{}]) vs. new [{}] ([{}]) @ lvl [{}] (by [{}])", sp1.name, spellid1, caster_level1, (caster1==nullptr)?"Nobody":caster1->GetName(), sp2.name, spellid2, caster_level2, (caster2==nullptr)?"Nobody":caster2->GetName());
if (spellbonuses.CompleteHealBuffBlocker && IsEffectInSpell(spellid2, SE_CompleteHeal)) {
Message(0, "You must wait before you can be affected by this spell again.");
return -1;
}
if (spellid1 == spellid2 ) { if (spellid1 == spellid2 ) {
if (!IsStackableDot(spellid1) && !IsEffectInSpell(spellid1, SE_ManaBurn)) { // mana burn spells we need to use the stacking command blocks live actually checks those first, we should probably rework to that too if (!IsStackableDot(spellid1) && !IsEffectInSpell(spellid1, SE_ManaBurn)) { // mana burn spells we need to use the stacking command blocks live actually checks those first, we should probably rework to that too
if (caster_level1 > caster_level2) { // cur buff higher level than new if (caster_level1 > caster_level2) { // cur buff higher level than new