From 8688e9c9fa5d1f270c4c8509d78e3dc3201c94cb Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Sat, 27 Nov 2021 12:11:23 -0500 Subject: [PATCH] [Spells] Eye of Zomm will now despawn and stack properly (#1849) * [Spells] Eye of Zomm stop chain spawning No more chain spawning. * [Spells] Eye of Zomm stop chain spawning * [Spells] Eye of Zomm update --- common/spdat.h | 1 + zone/client.h | 1 + zone/npc.h | 1 + zone/spell_effects.cpp | 12 ++++++++++-- zone/spells.cpp | 9 ++++++++- 5 files changed, 21 insertions(+), 3 deletions(-) diff --git a/common/spdat.h b/common/spdat.h index e77dcf521..058fe64b5 100644 --- a/common/spdat.h +++ b/common/spdat.h @@ -162,6 +162,7 @@ #define SPELL_RESURRECTION_SICKNESS3 37624 #define SPELL_PACT_OF_HATE_RECOURSE 40375 #define SPELL_INCENDIARY_OOZE_BUFF 32513 +#define SPELL_EYE_OF_ZOMM 323 //spellgroup ids #define SPELLGROUP_FRENZIED_BURNOUT 2754 diff --git a/zone/client.h b/zone/client.h index b8592d1eb..2f0120331 100644 --- a/zone/client.h +++ b/zone/client.h @@ -848,6 +848,7 @@ public: void SummonHorse(uint16 spell_id); void SetHorseId(uint16 horseid_in); inline void SetControlledMobId(uint16 mob_id_in) { controlled_mob_id = mob_id_in; } + uint16 GetControlledMobId() const{ return controlled_mob_id; } uint16 GetHorseId() const { return horseId; } bool CanMedOnHorse(); diff --git a/zone/npc.h b/zone/npc.h index df9159f0b..da59ad591 100644 --- a/zone/npc.h +++ b/zone/npc.h @@ -300,6 +300,7 @@ public: void PickPocket(Client* thief); void Disarm(Client* client, int chance); void StartSwarmTimer(uint32 duration) { swarm_timer.Start(duration); } + void DisableSwarmTimer() { swarm_timer.Disable(); } void AddLootDrop( const EQ::ItemData *item2, diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index ce93666f7..a141c6a53 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -4440,9 +4440,17 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses) case SE_EyeOfZomm: { if (IsClient()) - { - CastToClient()->SetControlledMobId(0); + { + NPC* tmp_eye_of_zomm = entity_list.GetNPCByID(CastToClient()->GetControlledMobId()); + //On live there is about a 6 second delay before it despawns once new one spawns. + if (tmp_eye_of_zomm) { + tmp_eye_of_zomm->GetSwarmInfo()->duration->Disable(); + tmp_eye_of_zomm->GetSwarmInfo()->duration->Start(6000); + tmp_eye_of_zomm->DisableSwarmTimer(); + tmp_eye_of_zomm->StartSwarmTimer(6000); } + CastToClient()->SetControlledMobId(0); + } } case SE_Weapon_Stance: diff --git a/zone/spells.cpp b/zone/spells.cpp index e5581d7af..ef4c9e910 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -221,8 +221,9 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot, return(false); } - if (spellbonuses.NegateIfCombat) + if (spellbonuses.NegateIfCombat) { BuffFadeByEffect(SE_NegateIfCombat); + } if (IsClient() && IsHarmonySpell(spell_id) && !HarmonySpellLevelCheck(spell_id, entity_list.GetMobID(target_id))) { InterruptSpell(SPELL_NO_EFFECT, 0x121, spell_id); @@ -3019,6 +3020,12 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, } if (spellid1 == spellid2 ) { + + if (spellid1 == SPELL_EYE_OF_ZOMM && spellid2 == SPELL_EYE_OF_ZOMM) {//only the original Eye of Zomm spell will not take hold if affect is already on you, other versions client fades the buff as soon as cast. + MessageString(Chat::Red, SPELL_NO_HOLD); + return -1; + } + 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 (IsEffectInSpell(spellid1, SE_ImprovedTaunt)) {