From 343b781e74b3063c8403195ef4e50654c70296c8 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Sat, 23 Jul 2016 18:40:17 -0400 Subject: [PATCH] Implement cast_not_standing and fix Cazic Touch No idea why this spell field does this, but that's what the client is doing with it ... --- common/shareddb.cpp | 1 + common/spdat.cpp | 2 +- common/spdat.h | 2 +- zone/attack.cpp | 5 ++++- zone/spell_effects.cpp | 3 ++- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index f35967d50..c9213f3a2 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -1688,6 +1688,7 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) { sp[tempid].pvpresistcalc=atoi(row[178]); sp[tempid].pvpresistcap=atoi(row[179]); sp[tempid].spell_category=atoi(row[180]); + sp[tempid].cast_not_standing = atoi(row[184]) != 0; sp[tempid].can_mgb=atoi(row[185]); sp[tempid].dispel_flag = atoi(row[186]); sp[tempid].MinResist = atoi(row[189]); diff --git a/common/spdat.cpp b/common/spdat.cpp index 2b6630dfa..572df1afb 100644 --- a/common/spdat.cpp +++ b/common/spdat.cpp @@ -1116,7 +1116,7 @@ bool IsCastWhileInvis(uint16 spell_id) if (!IsValidSpell(spell_id)) return false; const auto &spell = spells[spell_id]; - if (spell.sneak) + if (spell.sneak || spell.cast_not_standing) return true; return false; } diff --git a/common/spdat.h b/common/spdat.h index e236d8fbe..b06c50293 100644 --- a/common/spdat.h +++ b/common/spdat.h @@ -736,7 +736,7 @@ struct SPDat_Spell_Struct /* 181 */ //int pvp_duration; // buffdurationformula for PvP -- PVP_DURATION /* 182 */ //int pvp_duration_cap; // buffduration for PvP -- PVP_DURATION_CAP /* 183 */ //int pcnpc_only_flag; // valid values are 0, 1, and 2 -- PCNPC_ONLY_FLAG -/* 184 */ //bool cast_not_standing; // this is checked in the client's EQ_Spell::IsCastWhileInvisSpell, this also blocks SE_InterruptCasting from affecting this spell -- CAST_NOT_STANDING +/* 184 */ bool cast_not_standing; // this is checked in the client's EQ_Spell::IsCastWhileInvisSpell, this also blocks SE_InterruptCasting from affecting this spell -- CAST_NOT_STANDING /* 185 */ bool can_mgb; // 0=no, -1 or 1 = yes -- CAN_MGB /* 186 */ int dispel_flag; // -- NO_DISPELL /* 187 */ //int npc_category; // -- NPC_MEM_CATEGORY diff --git a/zone/attack.cpp b/zone/attack.cpp index 2f3eb26aa..1c7796f42 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -3027,11 +3027,14 @@ bool Mob::CheckDoubleAttack() void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, const EQEmu::skills::SkillType skill_used, bool &avoidable, const int8 buffslot, const bool iBuffTic, int special) { // This method is called with skill_used=ABJURE for Damage Shield damage. bool FromDamageShield = (skill_used == EQEmu::skills::SkillAbjuration); + bool ignore_invul = false; + if (IsValidSpell(spell_id)) + ignore_invul = spell_id == 982 || spells[spell_id].cast_not_standing; // cazic touch Log.Out(Logs::Detail, Logs::Combat, "Applying damage %d done by %s with skill %d and spell %d, avoidable? %s, is %sa buff tic in slot %d", damage, attacker?attacker->GetName():"NOBODY", skill_used, spell_id, avoidable?"yes":"no", iBuffTic?"":"not ", buffslot); - if (GetInvul() || DivineAura()) { + if (!ignore_invul && (GetInvul() || DivineAura())) { Log.Out(Logs::Detail, Logs::Combat, "Avoiding %d damage due to invulnerability.", damage); damage = -5; } diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 8ad235915..45225421b 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -3660,7 +3660,8 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster) } case SE_InterruptCasting: { if (IsCasting()) { - if (zone->random.Roll(spells[buff.spellid].base[i])) { + const auto &spell = spells[casting_spell_id]; + if (!spell.cast_not_standing && zone->random.Roll(spells[buff.spellid].base[i])) { InterruptSpell(); } }