Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class mob_frost_sphere_fallen : public CreatureScript
- {
- public:
- mob_frost_sphere_fallen() : CreatureScript("mob_frost_sphere_fallen")
- {
- }
- CreatureAI* GetAI(Creature* creature) const
- {
- return new mob_frost_sphere_fallenAI(creature);
- };
- struct mob_frost_sphere_fallenAI : public ScriptedAI
- {
- mob_frost_sphere_fallenAI(Creature* creature) : _summonerGuid(0), ScriptedAI(creature)
- {
- }
- void Reset()
- {
- _summonerGuid = 0;
- me->SetReactState(REACT_PASSIVE);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- DoCast(SPELL_PERMAFROST_MODEL);
- DoCast(SPELL_PERMAFROST_VISUAL);
- DoCast(SPELL_PERMAFROST);
- //me->SetObjectScale(2.0f);
- me->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.0f);
- }
- void DamageTaken(Unit* who, uint32& damage)
- {
- damage = 0;
- }
- // Called when NPC_FROST_SPHERE summons this creature
- void JustSummoned(Creature* summoner)
- {
- if (summoner && summoner->GetEntry() == NPC_FROST_SPHERE)
- _summonerGuid = summoner->GetGUID();
- }
- // Called when NPC_SPIKE hits this creature
- void SummonedCreatureDespawn(Creature* despawner)
- {
- if(despawner && despawner->GetEntry() == NPC_SPIKE)
- {
- me->DespawnOrUnsummon(3 * IN_MILLISECONDS);
- if(Creature *fallenSummoner = ObjectAccessor::GetObjectInWorld(_summonerGuid, (Creature *)NULL))
- fallenSummoner->DespawnOrUnsummon(3 * IN_MILLISECONDS);
- }
- }
- private:
- uint64 _summonerGuid;
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement