Advertisement
Dinoza

ANTIKILLER SYSTEM

Aug 17th, 2012
478
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.30 KB | None | 0 0
  1. diff -r b1dd4984a709 -r 3d55d9aa1fa9 src/server/game/Miscellaneous/Language.h
  2. --- a/src/server/game/Miscellaneous/Language.h  Thu Jul 05 11:43:26 2012 +0300
  3. +++ b/src/server/game/Miscellaneous/Language.h  Fri Aug 17 17:00:39 2012 +0300
  4. @@ -1098,6 +1098,8 @@
  5.     LANG_VIP_ARENA_ERROR                = 11010,
  6.     LANG_VIP_INCORRECT_VALUE            = 11011,
  7.     LANG_VIP_FROST_ERROR                = 11012,
  8. +  
  9. +   LANG_ANTIKILLER_SYSTEM              = 11013,
  10.  
  11.      // NOT RESERVED IDS                   12000-1999999999
  12.      // `db_script_string` table index     2000000000-2000009999 (MIN_DB_SCRIPT_STRING_ID-MAX_DB_SCRIPT_STRING_ID)
  13. diff -r b1dd4984a709 -r 3d55d9aa1fa9 src/server/game/Scripting/ScriptLoader.cpp
  14. --- a/src/server/game/Scripting/ScriptLoader.cpp    Thu Jul 05 11:43:26 2012 +0300
  15. +++ b/src/server/game/Scripting/ScriptLoader.cpp    Fri Aug 17 17:00:39 2012 +0300
  16. @@ -1251,6 +1251,7 @@
  17.  
  18.    void AddSC_arena_spectator_script();
  19.    void AddSC_transmogrify_script();
  20. +  void AddSC_antikiller_system();
  21.  
  22.  #endif
  23.  
  24. @@ -1261,6 +1262,7 @@
  25.    
  26.     AddSC_transmogrify_script();
  27.     AddSC_arena_spectator_script();
  28. +   AddSC_antikiller_system();
  29.  
  30.  #endif
  31.  }
  32. diff -r b1dd4984a709 -r 3d55d9aa1fa9 src/server/game/World/World.cpp
  33. --- a/src/server/game/World/World.cpp   Thu Jul 05 11:43:26 2012 +0300
  34. +++ b/src/server/game/World/World.cpp   Fri Aug 17 17:00:39 2012 +0300
  35. @@ -1224,6 +1224,11 @@
  36.      m_int_configs[CONFIG_DB_PING_INTERVAL] = ConfigMgr::GetIntDefault("MaxPingTime", 30);
  37.     m_int_configs[CONFIG_DUEL_RESET_COOLDOWN] = ConfigMgr::GetIntDefault("DuelResetCooldown", 1);
  38.    
  39. +   //Antikiller System
  40. +   m_bool_configs[CONFIG_ANTIKILLER_ENABLED] = ConfigMgr::GetBoolDefault("Antikiller.System.Enbled", true);
  41. +   m_int_configs[CONFIG_ANTIKILLER_LEVEL] = ConfigMgr::GetIntDefault("Antikiller.System.Level", 5);
  42. +   m_int_configs[CONFIG_ANTIKILLER_AURA] = ConfigMgr::GetIntDefault("Antikiller.System.Aura", 15007); 
  43. +  
  44.      // damage checker  
  45.      m_int_configs[CONFIG_DAMAGE_CHECKER_MAX_DAMAGE] = ConfigMgr::GetIntDefault("DamageChecker.MaxDamage", 50000);  
  46.      m_int_configs[CONFIG_DAMAGE_CHECKER_IMMUNE_MIN_GM_LEVEL] = ConfigMgr::GetIntDefault("DamageChecker.ImmuneMinGMLevel", 1);  
  47. diff -r b1dd4984a709 -r 3d55d9aa1fa9 src/server/game/World/World.h
  48. --- a/src/server/game/World/World.h Thu Jul 05 11:43:26 2012 +0300
  49. +++ b/src/server/game/World/World.h Fri Aug 17 17:00:39 2012 +0300
  50. @@ -177,7 +177,8 @@
  51.     CONFIG_VIP_HOME_COMMAND,
  52.     CONFIG_VIP_CAPITAL_COMMAND,
  53.     CONFIG_VIP_EXCHANGE_ARENA_COMMAND,
  54. -   CONFIG_VIP_EXCHANGE_FROST_COMMAND, 
  55. +   CONFIG_VIP_EXCHANGE_FROST_COMMAND,
  56. +    CONFIG_ANTIKILLER_ENABLED,
  57.      BOOL_CONFIG_VALUE_COUNT
  58.  };
  59.  
  60. @@ -355,6 +356,8 @@
  61.      CONFIG_DAMAGE_CHECKER_BAN_VALUE,
  62.      CONFIG_DUEL_RESET_COOLDOWN,   
  63.     CONFIG_BALANCE_MINIMUM,
  64. +   CONFIG_ANTIKILLER_LEVEL,
  65. +   CONFIG_ANTIKILLER_AURA,
  66.      INT_CONFIG_VALUE_COUNT
  67.  };
  68.  
  69. diff -r b1dd4984a709 -r 3d55d9aa1fa9 src/server/scripts/Custom/CMakeLists.txt
  70. --- a/src/server/scripts/Custom/CMakeLists.txt  Thu Jul 05 11:43:26 2012 +0300
  71. +++ b/src/server/scripts/Custom/CMakeLists.txt  Fri Aug 17 17:00:39 2012 +0300
  72. @@ -12,6 +12,7 @@
  73.    ${scripts_STAT_SRCS}
  74.    Custom/npc_transmogrify.cpp
  75.    Custom/arena_spectator.cpp
  76. +  Custom/antikiller_system.cpp
  77.  )
  78.  
  79.  message("  -> Prepared: Custom")
  80. diff -r b1dd4984a709 -r 3d55d9aa1fa9 src/server/scripts/Custom/antikiller_system.cpp
  81. --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
  82. +++ b/src/server/scripts/Custom/antikiller_system.cpp   Fri Aug 17 17:00:39 2012 +0300
  83. @@ -0,0 +1,29 @@
  84. +#include "ScriptPCH.h"
  85. +
  86. +class antikiller_system : public PlayerScript
  87. +{
  88. +public:
  89. +   antikiller_system() : PlayerScript("antikiller_system") { }
  90. +
  91. +   void OnPVPKill(Player* killer, Player* killed)
  92. +   {
  93. +       std::string NameKiller = killer->GetName();
  94. +       std::string NameKilled = killed->GetName();
  95. +
  96. +       if (sWorld->getBoolConfig(CONFIG_ANTIKILLER_ENABLED))
  97. +       {
  98. +           if (killer->getLevel() - sWorld->getIntConfig(CONFIG_ANTIKILLER_LEVEL) > killed->getLevel())
  99. +           {
  100. +               sWorld->SendWorldText(LANG_ANTIKILLER_SYSTEM, NameKilled.c_str(), NameKiller.c_str());
  101. +               killer->AddAura(sWorld->getIntConfig(CONFIG_ANTIKILLER_AURA), killer);
  102. +               killed->ResurrectPlayer(100, false);
  103. +               killer->Kill(killer);
  104. +           }
  105. +       }
  106. +   }
  107. +};
  108. +
  109. +void AddSC_antikiller_system()
  110. +{
  111. +   new antikiller_system();
  112. +}
  113. \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement