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 ...
This commit is contained in:
Michael Cook (mackal) 2016-07-23 18:40:17 -04:00
parent f428a8a56a
commit 343b781e74
5 changed files with 9 additions and 4 deletions

View File

@ -1688,6 +1688,7 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) {
sp[tempid].pvpresistcalc=atoi(row[178]); sp[tempid].pvpresistcalc=atoi(row[178]);
sp[tempid].pvpresistcap=atoi(row[179]); sp[tempid].pvpresistcap=atoi(row[179]);
sp[tempid].spell_category=atoi(row[180]); 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].can_mgb=atoi(row[185]);
sp[tempid].dispel_flag = atoi(row[186]); sp[tempid].dispel_flag = atoi(row[186]);
sp[tempid].MinResist = atoi(row[189]); sp[tempid].MinResist = atoi(row[189]);

View File

@ -1116,7 +1116,7 @@ bool IsCastWhileInvis(uint16 spell_id)
if (!IsValidSpell(spell_id)) if (!IsValidSpell(spell_id))
return false; return false;
const auto &spell = spells[spell_id]; const auto &spell = spells[spell_id];
if (spell.sneak) if (spell.sneak || spell.cast_not_standing)
return true; return true;
return false; return false;
} }

View File

@ -736,7 +736,7 @@ struct SPDat_Spell_Struct
/* 181 */ //int pvp_duration; // buffdurationformula for PvP -- PVP_DURATION /* 181 */ //int pvp_duration; // buffdurationformula for PvP -- PVP_DURATION
/* 182 */ //int pvp_duration_cap; // buffduration for PvP -- PVP_DURATION_CAP /* 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 /* 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 /* 185 */ bool can_mgb; // 0=no, -1 or 1 = yes -- CAN_MGB
/* 186 */ int dispel_flag; // -- NO_DISPELL /* 186 */ int dispel_flag; // -- NO_DISPELL
/* 187 */ //int npc_category; // -- NPC_MEM_CATEGORY /* 187 */ //int npc_category; // -- NPC_MEM_CATEGORY

View File

@ -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) { 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. // This method is called with skill_used=ABJURE for Damage Shield damage.
bool FromDamageShield = (skill_used == EQEmu::skills::SkillAbjuration); 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", 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); 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); Log.Out(Logs::Detail, Logs::Combat, "Avoiding %d damage due to invulnerability.", damage);
damage = -5; damage = -5;
} }

View File

@ -3660,7 +3660,8 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster)
} }
case SE_InterruptCasting: { case SE_InterruptCasting: {
if (IsCasting()) { 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(); InterruptSpell();
} }
} }