Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 58220, 58243, 58244
- struct npc_windward_hatchling : public ScriptedAI
- {
- npc_windward_hatchling(Creature* creature) : ScriptedAI(creature) { }
- void Reset() override { }
- void SpellHit(Unit* caster, SpellInfo const* spell) override
- {
- auto player = caster->ToPlayer();
- if (spell->Id == SPELL_SILKEN_ROPE && player && player->GetQuestStatus(QUEST_EMPTY_NESTS) == QUEST_STATUS_INCOMPLETE)
- {
- if (auto summon = player->SummonCreature(NPC_WINDWARD_HATCHLING, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 300000))
- {
- summon->SetOwnerGUID(player->GetGUID());
- summon->SetDisplayId(me->GetDisplayId());
- summon->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, M_PI);
- summon->CastSpell(player, SPELL_ROPE_BEAM, true);
- summon->ClearUnitState(UNIT_STATE_CASTING); // Allows move
- me->DespawnOrUnsummon();
- }
- }
- }
- };
- // 58275
- struct npc_windward_nest_trigger : public ScriptedAI
- {
- npc_windward_nest_trigger(Creature* creature) : ScriptedAI(creature) { me->SetReactState(REACT_AGGRESSIVE); }
- void Reset() override { }
- void MoveInLineOfSight(Unit* who) override
- {
- if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == NPC_WINDWARD_HATCHLING)
- {
- if (who->GetDistance(me) > 5.0f)
- return;
- if (auto owner = who->GetCharmerOrOwnerPlayerOrPlayerItself())
- {
- owner->KilledMonsterCredit(58246);
- who->RemoveAurasDueToSpell(SPELL_ROPE_BEAM);
- who->GetMotionMaster()->MoveFollow(me, 0, 0);
- who->ToCreature()->SetOwnerGUID(0);
- who->ToCreature()->DespawnOrUnsummon(1000);
- }
- }
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement