Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class npc_throw_quel_delar : public CreatureScript // Frostmourne Altar Bunny (Quel'Delar) entry 37704
- {
- public:
- npc_throw_quel_delar()
- : CreatureScript("npc_throw_quel_delar")
- {
- }
- struct npc_throw_quel_delarAI : public ScriptedAI
- {
- npc_throw_quel_delarAI(Creature* c) : ScriptedAI(c)
- {
- m_pInstance = (InstanceScript*)c->GetInstanceScript();
- }
- InstanceScript* m_pInstance;
- // Called when hit by a spell
- void SpellHit(Unit* caster, SpellInfo const* spell)
- {
- if ( caster->GetTypeId() == TYPEID_PLAYER && spell->Id == 70698 )
- DoCast(SPELL_BOESES_QUELDELAR_SUMMON);
- }
- //Called at World update tick
- void UpdateAI (uint32 const diff)
- {
- Map::PlayerList const &players = m_pInstance->instance->GetPlayers();
- for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
- {
- Player* player = itr->getSource();
- if ( player->isAlive() && me->IsWithinDistInMap(player, 10.0) )
- if ( player->HasAura(70013) && ( player->ToPlayer()->IsActiveQuest(24480) || player->ToPlayer()->IsActiveQuest(24561) ) )
- {
- player->RemoveAura(70013);
- player->CastSpell(me, 70698, false);
- }
- }
- }
- };
Add Comment
Please, Sign In to add comment