diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/server/game/Spells/SpellMgr.cpp | 3 | ||||
-rwxr-xr-x | src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp | 183 |
2 files changed, 101 insertions, 85 deletions
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index f718b118ad7..81807e63fb1 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3422,6 +3422,9 @@ void SpellMgr::LoadDbcDataCorrections() case 71159: // Awaken Plagued Zombies spellInfo->DurationIndex = 21; break; + case 70530: // Volatile Ooze Beam Protection (Professor Putricide) + spellInfo->Effect[0] = SPELL_EFFECT_APPLY_AURA; // for an unknown reason this was SPELL_EFFECT_APPLY_AREA_AURA_RAID + break; // THIS IS HERE BECAUSE COOLDOWN ON CREATURE PROCS IS NOT IMPLEMENTED case 71604: // Mutated Strength (Professor Putricide) case 72673: // Mutated Strength (Professor Putricide) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index a9ba0baa86f..04396275e0a 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -185,12 +185,15 @@ class AbominationDespawner if (Vehicle* veh = summon->GetVehicleKit()) veh->RemoveAllPassengers(); // also despawns the vehicle + // Found unit is Mutated Abomination, remove it return true; } + // Found unit is not Mutated Abomintaion, leave it return false; } + // No unit found, remove from SummonList return true; } @@ -198,6 +201,19 @@ class AbominationDespawner Unit* _owner; }; +struct RotfaceHeightCheck +{ + RotfaceHeightCheck(Creature* rotface) : _rotface(rotface) { } + + bool operator()(Creature* stalker) const + { + return stalker->GetPositionZ() < _rotface->GetPositionZ() + 5.0f; + } + +private: + Creature* _rotface; +}; + class boss_professor_putricide : public CreatureScript { public: @@ -246,7 +262,7 @@ class boss_professor_putricide : public CreatureScript events.Reset(); events.ScheduleEvent(EVENT_BERSERK, 600000); events.ScheduleEvent(EVENT_SLIME_PUDDLE, 10000); - events.ScheduleEvent(EVENT_UNSTABLE_EXPERIMENT, urand(25000, 30000)); + events.ScheduleEvent(EVENT_UNSTABLE_EXPERIMENT, urand(30000, 35000)); if (IsHeroic()) events.ScheduleEvent(EVENT_UNBOUND_PLAGUE, 20000); @@ -295,18 +311,16 @@ class boss_professor_putricide : public CreatureScript // no possible aura seen in sniff adding the aurastate summon->ModifyAuraState(AURA_STATE_UNKNOWN22, true); summon->CastSpell(summon, SPELL_GASEOUS_BLOAT_PROC, true); - summon->CastCustomSpell(SPELL_GASEOUS_BLOAT, SPELLVALUE_AURA_STACK, 10, summon, false); summon->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true); summon->SetReactState(REACT_PASSIVE); - return; + break; case NPC_VOLATILE_OOZE: // no possible aura seen in sniff adding the aurastate summon->ModifyAuraState(AURA_STATE_UNKNOWN19, true); summon->CastSpell(summon, SPELL_OOZE_ERUPTION_SEARCH_PERIODIC, true); - summon->CastSpell(summon, SPELL_VOLATILE_OOZE_ADHESIVE, false); summon->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true); summon->SetReactState(REACT_PASSIVE); - return; + break; case NPC_CHOKING_GAS_BOMB: summon->CastSpell(summon, SPELL_CHOKING_GAS_BOMB_PERIODIC, true); summon->CastSpell(summon, SPELL_CHOKING_GAS_EXPLOSION_TRIGGER, true); @@ -428,7 +442,8 @@ class boss_professor_putricide : public CreatureScript if (Creature* rotface = Unit::GetCreature(*me, instance->GetData64(DATA_ROTFACE))) { std::list<Creature*> list; - GetCreatureListWithEntryInGrid(list, rotface, NPC_PUDDLE_STALKER, 36.0f); + GetCreatureListWithEntryInGrid(list, rotface, NPC_PUDDLE_STALKER, 50.0f); + list.remove_if(RotfaceHeightCheck(rotface)); if (list.size() > 4) { list.sort(Trinity::ObjectDistanceOrderPred(rotface)); @@ -510,7 +525,6 @@ class boss_professor_putricide : public CreatureScript SetPhase(PHASE_COMBAT_3); events.ScheduleEvent(EVENT_MUTATED_PLAGUE, 25000); events.CancelEvent(EVENT_UNSTABLE_EXPERIMENT); - summons.remove_if(AbominationDespawner(me)); break; default: break; @@ -643,7 +657,7 @@ class boss_professor_putricide : public CreatureScript case EVENT_UNBOUND_PLAGUE: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, NonTankTargetSelector(me))) { - me->CastCustomSpell(SPELL_UNBOUND_PLAGUE, SPELLVALUE_BASE_POINT0, 775, target); + DoCast(target, SPELL_UNBOUND_PLAGUE); DoCast(target, SPELL_UNBOUND_PLAGUE_SEARCHER); } events.ScheduleEvent(EVENT_UNBOUND_PLAGUE, 90000); @@ -668,6 +682,7 @@ class boss_professor_putricide : public CreatureScript me->SetFacingToObject(face); me->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL); Talk(SAY_TRANSFORM_2); + summons.remove_if(AbominationDespawner(me)); events.ScheduleEvent(EVENT_RESUME_ATTACK, 8500, 0, PHASE_COMBAT_3); break; default: @@ -702,57 +717,78 @@ class boss_professor_putricide : public CreatureScript } }; -class npc_volatile_ooze : public CreatureScript +class npc_putricide_oozeAI : public ScriptedAI { public: - npc_volatile_ooze() : CreatureScript("npc_volatile_ooze") { } + npc_putricide_oozeAI(Creature* creature, uint32 hitTargetSpellId) : ScriptedAI(creature), + _newTargetSelectTimer(0), _hitTargetSpellId(hitTargetSpellId) + { + } - struct npc_putricide_oozeAI : public ScriptedAI + void SpellHitTarget(Unit* /*target*/, SpellInfo const* spell) { - npc_putricide_oozeAI(Creature* creature) : ScriptedAI(creature) - { - _newTargetSelectTimer = 0; - } + if (!_newTargetSelectTimer && spell->Id == sSpellMgr->GetSpellIdForDifficulty(_hitTargetSpellId, me)) + _newTargetSelectTimer = 1000; + } - void SpellHitTarget(Unit* /*target*/, SpellInfo const* spell) - { - if (!_newTargetSelectTimer && spell->Id == sSpellMgr->GetSpellIdForDifficulty(SPELL_OOZE_ERUPTION, me)) - _newTargetSelectTimer = 1000; - } + void SpellHit(Unit* /*caster*/, SpellInfo const* spell) + { + if (spell->Id == SPELL_TEAR_GAS_CREATURE) + _newTargetSelectTimer = 1000; + } + + void UpdateAI(uint32 const diff) + { + if (!UpdateVictim() && !_newTargetSelectTimer) + return; + + if (!_newTargetSelectTimer && !me->IsNonMeleeSpellCasted(false, false, true, false, true)) + _newTargetSelectTimer = 1000; + + DoMeleeAttackIfReady(); - void SpellHit(Unit* /*caster*/, SpellInfo const* spell) + if (!_newTargetSelectTimer) + return; + + if (me->HasAura(SPELL_TEAR_GAS_CREATURE)) + return; + + if (_newTargetSelectTimer <= diff) { - if (spell->Id == SPELL_TEAR_GAS_CREATURE) - _newTargetSelectTimer = 1000; + _newTargetSelectTimer = 0; + CastMainSpell(); } + else + _newTargetSelectTimer -= diff; + } - void UpdateAI(uint32 const diff) - { - if (!UpdateVictim() && !_newTargetSelectTimer) - return; + virtual void CastMainSpell() = 0; - if (!_newTargetSelectTimer) - return; + private: + uint32 _hitTargetSpellId; + uint32 _newTargetSelectTimer; +}; - if (me->HasAura(SPELL_TEAR_GAS_CREATURE)) - return; +class npc_volatile_ooze : public CreatureScript +{ + public: + npc_volatile_ooze() : CreatureScript("npc_volatile_ooze") { } - if (_newTargetSelectTimer <= diff) - { - _newTargetSelectTimer = 0; - me->CastSpell(me, SPELL_VOLATILE_OOZE_ADHESIVE, false); - } - else - _newTargetSelectTimer -= diff; + struct npc_volatile_oozeAI : public npc_putricide_oozeAI + { + npc_volatile_oozeAI(Creature* creature) : npc_putricide_oozeAI(creature, SPELL_OOZE_ERUPTION) + { } - private: - uint32 _newTargetSelectTimer; + void CastMainSpell() + { + me->CastSpell(me, SPELL_VOLATILE_OOZE_ADHESIVE, false); + } }; CreatureAI* GetAI(Creature* creature) const { - return GetIcecrownCitadelAI<npc_putricide_oozeAI>(creature); + return GetIcecrownCitadelAI<npc_volatile_oozeAI>(creature); } }; @@ -761,45 +797,16 @@ class npc_gas_cloud : public CreatureScript public: npc_gas_cloud() : CreatureScript("npc_gas_cloud") { } - struct npc_gas_cloudAI : public ScriptedAI + struct npc_gas_cloudAI : public npc_putricide_oozeAI { - npc_gas_cloudAI(Creature* creature) : ScriptedAI(creature) + npc_gas_cloudAI(Creature* creature) : npc_putricide_oozeAI(creature, SPELL_EXPUNGED_GAS) { _newTargetSelectTimer = 0; } - void SpellHitTarget(Unit* /*target*/, SpellInfo const* spell) - { - if (!_newTargetSelectTimer && spell->Id == sSpellMgr->GetSpellIdForDifficulty(SPELL_EXPUNGED_GAS, me)) - _newTargetSelectTimer = 1000; - } - - void SpellHit(Unit* /*caster*/, SpellInfo const* spell) + void CastMainSpell() { - if (spell->Id == SPELL_TEAR_GAS_CREATURE) - _newTargetSelectTimer = 1000; - } - - void UpdateAI(uint32 const diff) - { - if (!UpdateVictim() && !_newTargetSelectTimer) - return; - - DoMeleeAttackIfReady(); - - if (!_newTargetSelectTimer) - return; - - if (me->HasAura(SPELL_TEAR_GAS_CREATURE)) - return; - - if (_newTargetSelectTimer <= diff) - { - _newTargetSelectTimer = 0; - me->CastCustomSpell(SPELL_GASEOUS_BLOAT, SPELLVALUE_AURA_STACK, 10, me, false); - } - else - _newTargetSelectTimer -= diff; + me->CastCustomSpell(SPELL_GASEOUS_BLOAT, SPELLVALUE_AURA_STACK, 10, me, false); } private: @@ -900,23 +907,12 @@ class spell_putricide_ooze_channel : public SpellScriptLoader GetCaster()->AddThreat(GetHitUnit(), 500000000.0f); // value seen in sniff } - // temporary, until SelectTarget are not called on empty lists - void CheckTarget() - { - if (_target) - return; - - FinishCast(SPELL_FAILED_NO_VALID_TARGETS); - GetCaster()->ToCreature()->DespawnOrUnsummon(1); // despawn next update - } - void Register() { OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_putricide_ooze_channel_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_putricide_ooze_channel_SpellScript::SetTarget, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_putricide_ooze_channel_SpellScript::SetTarget, EFFECT_2, TARGET_UNIT_SRC_AREA_ENEMY); AfterHit += SpellHitFn(spell_putricide_ooze_channel_SpellScript::StartAttack); - OnCast += SpellCastFn(spell_putricide_ooze_channel_SpellScript::CheckTarget); } WorldObject* _target; @@ -1125,6 +1121,21 @@ class spell_putricide_unbound_plague : public SpellScriptLoader return true; } + SpellCastResult CheckCast() + { + if (AuraEffect const* eff = GetCaster()->GetAuraEffect(SPELL_UNBOUND_PLAGUE_SEARCHER, EFFECT_0)) + if (eff->GetTickNumber() < 2) + return SPELL_FAILED_DONT_REPORT; + + return SPELL_CAST_OK; + } + + void FilterTargets(std::list<WorldObject*>& targets) + { + targets.remove_if(Trinity::UnitAuraCheck(true, sSpellMgr->GetSpellIdForDifficulty(SPELL_UNBOUND_PLAGUE, GetCaster()))); + Trinity::Containers::RandomResizeList(targets, 1); + } + void HandleScript(SpellEffIndex /*effIndex*/) { if (!GetHitUnit()) @@ -1159,6 +1170,8 @@ class spell_putricide_unbound_plague : public SpellScriptLoader void Register() { + OnCheckCast += SpellCheckCastFn(spell_putricide_unbound_plague_SpellScript::CheckCast); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_putricide_unbound_plague_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); OnEffectHitTarget += SpellEffectFn(spell_putricide_unbound_plague_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } }; |