Advertisement
EmuDevs

EmuDevs - TrinityCore PlayerScript PlayerKilled CreatureKill

Jul 16th, 2013
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. /*
  2.     EmuDevs
  3.     http://emudevs.com
  4.  
  5.     Tutorial
  6. */
  7.  
  8. class npc_tutorial_playerscript : public PlayerScript
  9. {
  10. public:
  11.     npc_tutorial_playerscript() : PlayerScript("npc_tutorial_playerscript") { }
  12.  
  13.     void OnCreatureKill(Player* killer, Creature* killed)
  14.     {
  15.         if (killed->IsDungeonBoss())
  16.         {
  17.             if (!killer->HasAura(30000))
  18.                 killer->AddAura(30000, killer);
  19.             else
  20.                 killer->CastSpell(killer, 12000);
  21.         }
  22.     }
  23.  
  24.     void OnPlayerKilledByCreature(Creature* killer, Player* killed)
  25.     {
  26.         if (killer->IsDungeonBoss())
  27.             killed->ResurrectPlayer(1.0f, false);
  28.     }
  29. };
  30.  
  31. void AddSC_tutorial_playerscript()
  32. {
  33.     new npc_tutorial_playerscript;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement