Advertisement
Emulation

Untitled

Sep 25th, 2013
408
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.91 KB | None | 0 0
  1. #include "ScriptPCH.h"
  2.  
  3. uint32 auras[] = { 48162, 48074, 48170, 43223, 36880, 467, 48469 };
  4.  
  5. #define DISTANCE 4.0f
  6.  
  7. #define RANDOM_1 "There we go; all patched up."
  8. #define RANDOM_2 "Better be glad you got here in time. That looks infected."
  9. #define RANDOM_3 "Next time, I'm gonna charge you."
  10. #define RANDOM_4 "How about we stop putting ourselves in danger? I don't have infinite mana you know?"
  11.  
  12. class the_doctor() : public CreatureScript
  13. {
  14. public:
  15.     the_doctor() : CreatureScript("the_doctor") { }
  16.    
  17.         struct the_doctorAI : public ScriptedAI
  18.         {
  19.             the_doctorAI(Creature* creature) : ScriptedAI(creature){}
  20.            
  21.             void MoveInLineOfSight(Unit* player)
  22.             {
  23.                 if(!player || !player->IsAlive())
  24.                     return;
  25.                    
  26.                     if(me->IsWithinDistInMap(player, DISTANCE))
  27.                         {
  28.                             if(me->GetDistance(player) <= DISTANCE)
  29.                         {
  30.                        
  31.                             switch (urand(1, 4))
  32.                             {
  33.                     case 1:
  34.                         me->MonsterSay(RANDOM_1, LANG_UNIVERSAL, player->GetGUID());
  35.                         player->CastSpell(player, 17683, true);
  36.                         for(int i = 0; i < 7; i++)
  37.                             player->AddAura(auras[i], player);
  38.                     break;
  39.                     case 2:
  40.                         me->MonsterSay(RANDOM_2, LANG_UNIVERSAL, player->GetGUID());
  41.                         player->CastSpell(player, 17683, true);
  42.                         for(int i = 0; i < 7; i++)
  43.                             player->AddAura(auras[i], player);
  44.                     break;
  45.                     case 3:
  46.                         me->MonsterSay(RANDOM_3, LANG_UNIVERSAL, player->GetGUID());
  47.                         player->CastSpell(player, 17683, true);
  48.                         for(int i = 0; i < 7; i++)
  49.                             player->AddAura(auras[i], player);
  50.                     break;
  51.                     case 4:
  52.                         me->MonsterSay(RANDOM_4, LANG_UNIVERSAL, player->GetGUID());
  53.                         player->CastSpell(player, 17683, true);
  54.                         for(int i = 0; i < 7; i++)
  55.                             player->AddAura(auras[i], player);
  56.                     break;
  57.                 }
  58.             }
  59.         }
  60.     }
  61. };
  62.  
  63. CreatureAI * GetAI(Creature * creature) const
  64. {
  65.     return new the_doctor(creature);
  66. }
  67. };
  68.  
  69. void AddSC_the_doctor()
  70. {
  71.     new the_doctor();
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement