Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class npc_hot_on_the_trail_credit : public CreatureScript
- {
- public:
- npc_hot_on_the_trail_credit() : CreatureScript("npc_hot_on_the_trail_credit") { }
- struct npc_hot_on_the_trail_creditAI : public ScriptedAI
- {
- npc_hot_on_the_trail_creditAI(Creature* creature) : ScriptedAI(creature) { }
- void GetKillCreditBank()
- {
- me->SummonCreature(38335, me->GetPostionX() + 2.0f, me->GetPositionY(), me->GetPositionZ());
- float radius = 5.0f;
- std::list<Player*> players;
- Trinity::AnyPlayerInObjectRangeCheck checker(me, radius);
- Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(me, players, checker);
- me->VisitNearbyWorldObject(radius, searcher);
- for (std::list<Player*>::const_iterator itr = players.begin(); itr != players.end(); ++itr)
- if ((*itr)->GetQuestStatus(QUEST_HOT_ON_THE_TRAIL_ALIANCE) == QUEST_STATUS_INCOMPLETE)
- (*itr)->KilledMonsterCredit(38340,0);
- }
- void GetKillCreditAH(){}
- void GetKillCreditBarber(){}
- void MoveInLineOfSight(Unit* who) override
- {
- ScriptedAI::MoveInLineOfSight(who);
- if (who->GetTypeId() == TYPEID_PLAYER && me->IsFriendlyTo(who) && me->IsWithinDistInMap(who, 5.0f))
- {
- me->MonsterSay("Mam te", 0, 0);
- who->MonsterSay("Jsem odhalen", 0, 0);
- switch (me->GetEntry())
- {
- case 29093:
- GetKillCreditBank();
- break;
- //Banka
- case 38340:
- GetKillCreditBank();
- break;
- //Aukce
- case 38341:
- GetKillCreditAH();
- break;
- //Holičství
- case 38342:
- GetKillCreditBarber();
- break;
- }
- }
- }
- };
- CreatureAI* GetAI(Creature* creature) const override
- {
- return new npc_hot_on_the_trail_creditAI(creature);
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement