Dinoza

ANTIKILLER SYSTEM + BGCHECK

Sep 12th, 2012
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.89 KB | None | 0 0
  1. #include "ScriptPCH.h"
  2.  
  3. class antikiller_system : public PlayerScript
  4. {
  5. public:
  6.   antikiller_system() : PlayerScript("antikiller_system") { }
  7.  
  8.   void OnPVPKill(Player* killer, Player* killed)
  9.   {
  10.       if(killer->InBattleground() || killed->InBattleground())
  11.            return;
  12.  
  13.    std::string NameKiller = killer->GetName();
  14.    std::string NameKilled = killed->GetName();
  15.  
  16.    if (sWorld->getBoolConfig(CONFIG_ANTIKILLER_ENABLED))
  17.    {
  18.     if (killer->getLevel() - sWorld->getIntConfig(CONFIG_ANTIKILLER_LEVEL) > killed->getLevel())
  19.     {
  20.      sWorld->SendWorldText(LANG_ANTIKILLER_SYSTEM, NameKilled.c_str(), NameKiller.c_str());
  21.      killer->AddAura(sWorld->getIntConfig(CONFIG_ANTIKILLER_AURA), killer);
  22.      killed->ResurrectPlayer(100, false);
  23.      killer->Kill(killer);
  24.     }
  25.    }
  26.   }
  27. };
  28.  
  29. void AddSC_antikiller_system()
  30. {
  31.   new antikiller_system();
  32. }
Advertisement
Add Comment
Please, Sign In to add comment