Advertisement
Rochet2

Untitled

Dec 26th, 2012
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class npc_tournament_training_dummy : public CreatureScript
  2. {
  3. public:
  4.     npc_tournament_training_dummy(): CreatureScript("npc_tournament_training_dummy"){}
  5.  
  6.     struct npc_tournament_training_dummyAI : Scripted_NoMovementAI
  7.     {
  8.         npc_tournament_training_dummyAI(Creature* creature) : Scripted_NoMovementAI(creature) {}
  9.  
  10.         void Reset()
  11.         {
  12.             me->SetControlled(true, UNIT_STATE_STUNNED);
  13.             me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);                
  14.         }
  15.  
  16.         void EnterEvadeMode()
  17.         {
  18.             if (!_EnterEvadeMode())
  19.                 return;
  20.  
  21.             Reset();
  22.         }
  23.  
  24.         void SpellHit(Unit* caster, SpellInfo const* spell)
  25.         {
  26.             if(caster->GetTypeId() != TYPEID_PLAYER)
  27.                 return;
  28.             Player* player = caster->ToPlayer();
  29.             switch (spell->Id)
  30.             {
  31.             case 2098:      //rogue - evicerate
  32.             case 5143:      //mage - arcane missles
  33.             case 348:       //warlock - immolate
  34.             case 100:       //warrior - charge
  35.             case 56641:     //hunter - steady shoot
  36.             case 589:       //priest - Shadow Word: Pain
  37.                 player->KilledMonsterCredit(44175, 0);
  38.                 break;
  39.             }
  40.         }
  41.     };
  42.  
  43.     CreatureAI* GetAI(Creature* creature) const
  44.     {
  45.         return new npc_tournament_training_dummyAI(creature);
  46.     }
  47. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement