Advertisement
Rochet2

Set

Sep 10th, 2012
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.08 KB | None | 0 0
  1. std::set<uint64> test;
  2.  
  3. class creation_event_2 : public CreatureScript
  4. {
  5. public:
  6.     creation_event_2() : CreatureScript("creation_event_2") { }
  7.  
  8.     struct creation_event_2AI : public ScriptedAI
  9.     {
  10.         creation_event_2AI(Creature * pCreature) : ScriptedAI(pCreature){}
  11.  
  12.         void MoveInLineOfSight(Unit * player)
  13.         {
  14.             if(!player || !player->isAlive() || player->GetTypeId() != TYPEID_PLAYER || player->HasAura(44795))
  15.                 return;
  16.  
  17.             if(me->IsWithinDistInMap(player, 10.0f))
  18.             {
  19.                 if(me->GetDistance(player) <= 10.0f)
  20.                 {
  21.                     if(test.find(player->GetGUID()) == test.end())
  22.                     test.insert(player->GetGUID());
  23.                     me->HandleEmoteCommand(EMOTE_ONESHOT_CHEER);
  24.                     me->MonsterSay("Woohoo! Another survivor! At this rate we might have enough to gather an army!", LANG_UNIVERSAL, NULL);
  25.                 }
  26.  
  27.             }
  28.         }
  29.     }
  30. };
  31.  
  32. CreatureAI * GetAI(Creature * c) const
  33. {
  34.     return new creation_event_2AI(c);
  35. }
  36. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement