Advertisement
Guest User

Untitled

a guest
Jan 30th, 2015
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.73 KB | None | 0 0
  1.  
  2. class npc_hot_on_the_trail_credit : public CreatureScript
  3. {
  4. public:
  5.     npc_hot_on_the_trail_credit() : CreatureScript("npc_hot_on_the_trail_credit") { }
  6.  
  7.     struct npc_hot_on_the_trail_creditAI : public ScriptedAI
  8.     {
  9.         npc_hot_on_the_trail_creditAI(Creature* creature) : ScriptedAI(creature) { }
  10.  
  11.  
  12.         void GetKillCreditBank()
  13.         {
  14.             me->SummonCreature(38335, me->GetPostionX() + 2.0f, me->GetPositionY(), me->GetPositionZ());
  15.             float radius = 5.0f;
  16.             std::list<Player*> players;
  17.             Trinity::AnyPlayerInObjectRangeCheck checker(me, radius);
  18.             Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(me, players, checker);
  19.             me->VisitNearbyWorldObject(radius, searcher);
  20.  
  21.             for (std::list<Player*>::const_iterator itr = players.begin(); itr != players.end(); ++itr)
  22.                 if ((*itr)->GetQuestStatus(QUEST_HOT_ON_THE_TRAIL_ALIANCE) == QUEST_STATUS_INCOMPLETE)
  23.                     (*itr)->KilledMonsterCredit(38340,0);
  24.         }
  25.         void GetKillCreditAH(){}
  26.         void GetKillCreditBarber(){}
  27.  
  28.  
  29.         void MoveInLineOfSight(Unit* who) override
  30.         {
  31.             ScriptedAI::MoveInLineOfSight(who);
  32.  
  33.             if (who->GetTypeId() == TYPEID_PLAYER && me->IsFriendlyTo(who) && me->IsWithinDistInMap(who, 5.0f))
  34.             {
  35.                 me->MonsterSay("Mam te", 0, 0);
  36.                 who->MonsterSay("Jsem odhalen", 0, 0);
  37.  
  38.                 switch (me->GetEntry())
  39.                 {
  40.                     case 29093:
  41.                         GetKillCreditBank();
  42.                         break;
  43.                     //Banka
  44.                     case 38340:
  45.                         GetKillCreditBank();
  46.                         break;
  47.                     //Aukce
  48.                     case 38341:
  49.                         GetKillCreditAH();
  50.                         break;
  51.                     //Holičství
  52.                     case 38342:
  53.                         GetKillCreditBarber();
  54.                         break;
  55.  
  56.                 }
  57.             }
  58.         }
  59.  
  60.        
  61.     };
  62.  
  63.     CreatureAI* GetAI(Creature* creature) const override
  64.     {
  65.         return new npc_hot_on_the_trail_creditAI(creature);
  66.     }
  67. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement