Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Position cauldronMobsPositions[3] =
- {
- // Spawn
- {6813.22f, 1584.97f, 389.03f, 0.0f},
- {6812.64f, 1557.85f, 389.03f, 0.0f},
- {6811.49f, 1612.89f, 389.03f, 0.0f}
- };
- enum eNeutralizePlague
- {
- CREDIT_PLAGUE_CAULDRON_NEUTRALIZED = 31767,
- NPC_LIVING_PLAGUE = 32181,
- NPC_RAMPAGING_GHOUL = 32178,
- NPC_PLAGUE_DRENCHED_GHOULD = 32176,
- };
- class spell_q_neutralize_plague : public SpellScriptLoader
- {
- public:
- spell_q_neutralize_plague() : SpellScriptLoader("spell_q_neutralize_plague") { }
- class spell_q_neutralize_plague_AuraScript : public AuraScript
- {
- PrepareAuraScript(spell_q_neutralize_plague_AuraScript)
- void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
- {
- if (Unit* pCaster = GetCaster())
- {
- switch (urand(0, 3))
- {
- case 0:
- for (uint8 i = 0 ; i < 8 ; i++)
- if (Creature* pMob = pCaster->SummonCreature(NPC_LIVING_PLAGUE, cauldronMobsPositions[urand(0, 2)], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))
- pMob->AI()->AttackStart(pCaster);
- break;
- case 1:
- for (uint8 i = 0 ; i < 2 ; i++)
- if (Creature* pMob = pCaster->SummonCreature(NPC_RAMPAGING_GHOUL, cauldronMobsPositions[urand(0, 2)], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))
- pMob->AI()->AttackStart(pCaster);
- break;
- case 2:
- if (Creature* pMob = pCaster->SummonCreature(NPC_PLAGUE_DRENCHED_GHOULD, cauldronMobsPositions[urand(0, 2)], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))
- pMob->AI()->AttackStart(pCaster);
- break;
- case 3:
- for (uint8 i = 0 ; i < 4 ; i++)
- if (Creature* pMob = pCaster->SummonCreature(NPC_LIVING_PLAGUE, cauldronMobsPositions[urand(0, 2)], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))
- pMob->AI()->AttackStart(pCaster);
- if (Creature* pMob = pCaster->SummonCreature(NPC_RAMPAGING_GHOUL, cauldronMobsPositions[urand(0, 2)], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))
- pMob->AI()->AttackStart(pCaster);
- break;
- }
- }
- }
- void Register()
- {
- OnEffectApply += AuraEffectApplyFn(spell_q_neutralize_plague_AuraScript::ApplyEffect, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
- }
- };
- AuraScript* GetAuraScript() const
- {
- return new spell_q_neutralize_plague_AuraScript();
- }
- };
- class spell_q_neutralizing_doze_applied : public SpellScriptLoader
- {
- public:
- spell_q_neutralizing_doze_applied() : SpellScriptLoader("spell_q_neutralizing_doze_applied") { }
- class spell_q_neutralizing_doze_applied_SpellScript : public SpellScript
- {
- public:
- PrepareSpellScript(spell_q_neutralizing_doze_applied_SpellScript)
- bool Validate(SpellEntry const * /*spellEntry*/)
- {
- return true;
- }
- void HandleDummy(SpellEffIndex /*effIndex*/)
- {
- if (Unit* pCaster = GetCaster())
- if (pCaster->GetTypeId() == TYPEID_PLAYER)
- pCaster->ToPlayer()->KilledMonsterCredit(CREDIT_PLAGUE_CAULDRON_NEUTRALIZED, 0);
- }
- void Register()
- {
- OnEffect += SpellEffectFn(spell_q_neutralizing_doze_applied_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
- }
- };
- SpellScript* GetSpellScript() const
- {
- return new spell_q_neutralizing_doze_applied_SpellScript();
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement