slp13at420

Grumboz_VIP_Engine

Mar 13th, 2016
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 48.81 KB | None | 0 0
  1. diff --git a/src/server/database/Database/Implementation/LoginDatabase.cpp b/src/server/database/Database/Implementation/LoginDatabase.cpp
  2. index 2749c08..234c43f 100644
  3. --- a/src/server/database/Database/Implementation/LoginDatabase.cpp
  4. +++ b/src/server/database/Database/Implementation/LoginDatabase.cpp
  5. @@ -117,4 +117,9 @@ void LoginDatabaseConnection::DoPrepareStatements()
  6.      PrepareStatement(LOGIN_DEL_RBAC_ACCOUNT_PERMISSION, "DELETE FROM rbac_account_permissions WHERE accountId = ? AND permissionId = ? AND (realmId = ? OR realmId = -1)", CONNECTION_ASYNC);
  7.      PrepareStatement(LOGIN_INS_ACCOUNT_MUTE, "INSERT INTO account_muted VALUES (?, UNIX_TIMESTAMP(), ?, ?, ?)", CONNECTION_ASYNC);
  8.      PrepareStatement(LOGIN_SEL_ACCOUNT_MUTE_INFO, "SELECT mutedate, mutetime, mutereason, mutedby FROM account_muted WHERE guid = ? ORDER BY mutedate ASC", CONNECTION_SYNCH);
  9. +
  10. +   PrepareStatement(LOGIN_LOAD_VIP, "SELECT vip, mg, votes FROM account WHERE id = ?", CONNECTION_SYNCH);
  11. +   PrepareStatement(LOGIN_SET_VIP, "UPDATE account SET `vip`=? WHERE `id`=?", CONNECTION_ASYNC);
  12. +   PrepareStatement(LOGIN_SET_MG, "UPDATE account SET `mg`=? WHERE `id`=?", CONNECTION_ASYNC);
  13. +   PrepareStatement(LOGIN_SET_VOTES, "UPDATE account SET `votes`=? WHERE `id`=?", CONNECTION_ASYNC);
  14.  }
  15. diff --git a/src/server/database/Database/Implementation/LoginDatabase.h b/src/server/database/Database/Implementation/LoginDatabase.h
  16. index a3789fa..c54411b 100644
  17. --- a/src/server/database/Database/Implementation/LoginDatabase.h
  18. +++ b/src/server/database/Database/Implementation/LoginDatabase.h
  19. @@ -113,7 +113,13 @@ enum LoginDatabaseStatements
  20.  
  21.      LOGIN_INS_ACCOUNT_MUTE,
  22.      LOGIN_SEL_ACCOUNT_MUTE_INFO,
  23. -    MAX_LOGINDATABASE_STATEMENTS
  24. +
  25. +   LOGIN_LOAD_VIP,
  26. +   LOGIN_SET_VIP,
  27. +   LOGIN_SET_MG,
  28. +   LOGIN_SET_VOTES,
  29. +  
  30. +   MAX_LOGINDATABASE_STATEMENTS
  31.  };
  32.  
  33.  class LoginDatabaseConnection : public MySQLConnection
  34.  
  35. diff --git a/src/server/database/Database/Implementation/WorldDatabase.cpp b/src/server/database/Database/Implementation/WorldDatabase.cpp
  36. index 7a183d5..bbac223 100644
  37. --- a/src/server/database/Database/Implementation/WorldDatabase.cpp
  38. +++ b/src/server/database/Database/Implementation/WorldDatabase.cpp
  39. @@ -91,4 +91,8 @@ void WorldDatabaseConnection::DoPrepareStatements()
  40.      PrepareStatement(WORLD_DEL_DISABLES, "DELETE FROM disables WHERE entry = ? AND sourceType = ?", CONNECTION_ASYNC);
  41.      PrepareStatement(WORLD_UPD_CREATURE_ZONE_AREA_DATA, "UPDATE creature SET zoneId = ?, areaId = ? WHERE guid = ?", CONNECTION_ASYNC);
  42.      PrepareStatement(WORLD_UPD_GAMEOBJECT_ZONE_AREA_DATA, "UPDATE gameobject SET zoneId = ?, areaId = ? WHERE guid = ?", CONNECTION_ASYNC);
  43. +
  44. +   PrepareStatement(WORLD_SET_CREATURE_VIP, "UPDATE creature_template SET `vip`=? WHERE `entry`=?", CONNECTION_ASYNC);
  45. +   PrepareStatement(WORLD_SET_CREATURE_MG, "UPDATE creature_template SET `mg`=? WHERE `entry`=?", CONNECTION_ASYNC);
  46. +   PrepareStatement(WORLD_SET_ITEM_VIP, "UPDATE item_template SET `vip`=? WHERE `entry`=?", CONNECTION_ASYNC);
  47.  }
  48. diff --git a/src/server/database/Database/Implementation/WorldDatabase.h b/src/server/database/Database/Implementation/WorldDatabase.h
  49. index 6ac4ce5..96327e4 100644
  50. --- a/src/server/database/Database/Implementation/WorldDatabase.h
  51. +++ b/src/server/database/Database/Implementation/WorldDatabase.h
  52. @@ -100,7 +100,11 @@ enum WorldDatabaseStatements
  53.      WORLD_UPD_CREATURE_ZONE_AREA_DATA,
  54.      WORLD_UPD_GAMEOBJECT_ZONE_AREA_DATA,
  55.  
  56. -    MAX_WORLDDATABASE_STATEMENTS
  57. +   WORLD_SET_CREATURE_VIP,
  58. +   WORLD_SET_CREATURE_MG,
  59. +   WORLD_SET_ITEM_VIP,
  60. +  
  61. +   MAX_WORLDDATABASE_STATEMENTS
  62.  };
  63.  
  64.  class WorldDatabaseConnection : public MySQLConnection
  65.  
  66. diff --git a/src/server/game/Entities/Player/Grumboz_VIP_Core.cpp b/src/server/game/Entities/Player/Grumboz_VIP_Core.cpp
  67. new file mode 100644
  68. index 0000000..47018b0
  69. --- /dev/null
  70. +++ b/src/server/game/Entities/Player/Grumboz_VIP_Core.cpp
  71. @@ -0,0 +1,1040 @@
  72. +// Vip core engine
  73. +// By slp13at420 of EmuDevs.com
  74. +
  75. +#include "AccountMgr.h"
  76. +#include "chat.h"
  77. +#include "Config.h"
  78. +#include "Group.h"
  79. +#include "Grumboz_VIP_Core.h"
  80. +#include "Language.h"
  81. +#include "ObjectMgr.h"
  82. +#include "player.h"
  83. +#include "RBAC.h"
  84. +#include "ScriptedGossip.h"
  85. +#include "ScriptMgr.h"
  86. +#include <unordered_map>
  87. +#include "World.h"
  88. +
  89. +// color definitions since i hate yellow..
  90. +std::string green = "|cff00cc00";
  91. +std::string red = "|cffFF0000";
  92. +std::string white = "|cffFFFFFF";
  93. +std::string blue = "|cff3333FF";
  94. +std::string black = "|cff000000";
  95. +
  96. +float ver = 2.05f;
  97. +
  98. +uint8 VIP_MAX;
  99. +uint8 VIP_LEVEL_BONUS;
  100. +uint8 VIP_TP_BONUS;
  101. +uint32 VIP_STONE_ID;
  102. +uint32 VIP_COIN_ID;
  103. +uint32 VIP_MG_ID;
  104. +uint32 VIP_VOTE_COUNT;
  105. +float VIP_OFFSET;
  106. +bool VIP_VOTE_ENABLE;
  107. +bool VIP_LEVEL_BONUS_ENABLE;
  108. +std::string VIP_COIN_NAME;
  109. +
  110. +std::unordered_map<uint32, VipElements> Vip;
  111. +std::unordered_map<uint32, ItemVIP> ItemVip;
  112. +std::unordered_map<uint8, VipMallGPS> MALL;
  113. +std::unordered_map<uint8, VipHomeGPS> HOME;
  114. +std::unordered_map<uint32, VipHearthStoneGPS> HearthStone;
  115. +std::unordered_map<uint32, CreatureVIP>CKR;
  116. +
  117. +VIP::VIP() { }
  118. +
  119. +VIP::~VIP()
  120. +{
  121. +}
  122. +
  123. +std::string ConvertNumberToString(uint64 numberX)
  124. +{
  125. +   auto number = numberX;
  126. +   std::stringstream convert;
  127. +   std::string number32_to_string;
  128. +   convert << number;
  129. +   number32_to_string = convert.str();
  130. +
  131. +   return number32_to_string;
  132. +};
  133. +
  134. +void AnnounceLoggingToWorld(Player* player, uint8 type)
  135. +{
  136. +   std::string pName = player->GetName();
  137. +   uint32 acct_id = player->GetSession()->GetAccountId();
  138. +   uint8 PlayerLogInVip = VIP::GetPlayerVIP(acct_id);
  139. +
  140. +   SessionMap sessions = sWorld->GetAllSessions(); // GetPlayersInWorld
  141. +
  142. +   for (SessionMap::iterator itr = sessions.begin(); itr != sessions.end(); ++itr)
  143. +   {
  144. +       if (!itr->second)
  145. +           continue;
  146. +
  147. +       uint8 ItrVip = VIP::GetPlayerVIP(itr->second->GetAccountId());
  148. +
  149. +       if (PlayerLogInVip <= ItrVip) // if target is same as or higher. won't announce to lower vip's.
  150. +       {
  151. +           std::string msg = "[" + green + "VIP" + ConvertNumberToString(PlayerLogInVip) + "|r]:";
  152. +           msg = msg + pName + green + " has logged";
  153. +
  154. +           if (type == 0) { msg = msg + " out.|r"; };
  155. +           if (type == 1) { msg = msg + " in.|r"; };
  156. +
  157. +           ChatHandler(itr->second->GetPlayer()->GetSession()).PSendSysMessage(msg.c_str());
  158. +       }
  159. +   }
  160. +};
  161. +
  162. +class VIP_Load_Conf : public WorldScript
  163. +{
  164. +public: VIP_Load_Conf() : WorldScript("VIP_Load_Conf"){ };
  165. +
  166. +   virtual void OnConfigLoad(bool /*reload*/)
  167. +   {
  168. +       TC_LOG_INFO("server.loading", "___________________________________");
  169. +       TC_LOG_INFO("server.loading", "| Grumbo'z  VIP  Engine : Loading |");
  170. +       TC_LOG_INFO("server.loading", "|__________By_Slp13at420__________|");
  171. +       TC_LOG_INFO("server.loading", "|__________of_EmuDev.com__________|");
  172. +       TC_LOG_INFO("server.loading", "|-                               -|");
  173. +       TC_LOG_INFO("server.loading", "|____________Ver:%.2f_____________|", ver);
  174. +
  175. +       QueryResult VIPItemQery = WorldDatabase.Query("SELECT entry, vip FROM item_template;");
  176. +
  177. +       if (VIPItemQery)
  178. +       {
  179. +           do
  180. +           {
  181. +               Field* fields = VIPItemQery->Fetch();
  182. +               uint32 item_id = fields[0].GetUInt32();
  183. +               uint32 vip = fields[1].GetUInt8();
  184. +
  185. +               ItemVIP& data1 = ItemVip[item_id];
  186. +               // Save the DB values to the MyData object
  187. +               data1.item_id = item_id;
  188. +               data1.vip = vip;
  189. +
  190. +           } while(VIPItemQery->NextRow());
  191. +       }
  192. +      
  193. +       QueryResult VIPCreatureQery = WorldDatabase.Query("SELECT entry, vip, mg FROM creature_template;");
  194. +
  195. +       if (VIPCreatureQery)
  196. +       {
  197. +           do
  198. +           {
  199. +               Field* fields = VIPCreatureQery->Fetch();
  200. +               uint32 entry_id = fields[0].GetUInt32();
  201. +               uint32 vip = fields[1].GetUInt8();
  202. +               uint32 mg = fields[2].GetUInt32();
  203. +
  204. +               CreatureVIP& data2 = CKR[entry_id];
  205. +               // Save the DB values to the MyData object
  206. +               data2.vip = vip;
  207. +               data2.mg = mg;
  208. +
  209. +           } while (VIPCreatureQery->NextRow());
  210. +       }
  211. +      
  212. +       QueryResult gpsQery = WorldDatabase.Query("SELECT * FROM hearthstone;");
  213. +
  214. +       if (gpsQery)
  215. +       {
  216. +           do
  217. +           {
  218. +               // unpacks the results of `result` into fields and appoint data to variable.
  219. +               Field* fields = gpsQery->Fetch();
  220. +               uint32 guid = fields[0].GetUInt32();
  221. +               uint32 map_id = fields[1].GetUInt32();
  222. +               float x = fields[2].GetFloat();
  223. +               float y = fields[3].GetFloat();
  224. +               float z = fields[4].GetFloat();
  225. +               float o = fields[5].GetFloat();
  226. +
  227. +               VipHearthStoneGPS& data3 = HearthStone[guid];
  228. +               // Save the DB values to the MyData object
  229. +               data3.guid = guid;
  230. +               data3.map_id = map_id;
  231. +               data3.x = x;
  232. +               data3.y = y;
  233. +               data3.z = z;
  234. +               data3.o = o;
  235. +
  236. +           } while (gpsQery->NextRow());
  237. +       }
  238. +
  239. +       VipMallGPS& data4 = MALL[0];
  240. +       // Save the DB values to the MyData object
  241. +       data4.map_id = 530;
  242. +       data4.x = -1800.3104f;
  243. +       data4.y = 5315.0424f;
  244. +       data4.z = -12.4276f;
  245. +       data4.o = 2.1062f;
  246. +
  247. +       VipMallGPS& data5 = MALL[1]; // like Lua table VIP[acctId].vip
  248. +       // Save the DB values to the MyData object
  249. +       data5.map_id = 530;
  250. +       data5.x = -1921.8005f;
  251. +       data5.y = 5546.6264f;
  252. +       data5.z = -12.4278f;
  253. +       data5.o = 5.2321f;
  254. +
  255. +       VipHomeGPS& data6 = HOME[0]; // like Lua table VIP[acctId].vip
  256. +       // Save the DB values to the MyData object
  257. +       data6.map_id = 0;
  258. +       data6.x = -4906.3911f;
  259. +       data6.y = -970.9063f;
  260. +       data6.z = 501.4540f;
  261. +       data6.o = 2.3338f;
  262. +
  263. +       VipHomeGPS& data7 = HOME[1]; // like Lua table VIP[acctId].vip
  264. +       // Save the DB values to the MyData object
  265. +       data7.map_id = 1;
  266. +       data7.x = 1604.4882f;
  267. +       data7.y = -4394.3603f;
  268. +       data7.z = 9.9671f;
  269. +       data7.o = 3.5517f;
  270. +
  271. +       TC_LOG_INFO("server.loading", "___________________________________");
  272. +       TC_LOG_INFO("server.loading", "|   VIP Teleport GPS's : Loaded   |");
  273. +
  274. +       VIP_MAX                 = sConfigMgr->GetIntDefault("VIP.MAX", 6);
  275. +       VIP_OFFSET              = sConfigMgr->GetFloatDefault("VIP.OFFSET", 0.05f);
  276. +       VIP_VOTE_ENABLE         = sConfigMgr->GetBoolDefault("VIP.VOTE_ENABLE", true);
  277. +       VIP_VOTE_COUNT          = sConfigMgr->GetIntDefault("VIP.VOTE_COUNT", 125);
  278. +       VIP_COIN_ID             = sConfigMgr->GetIntDefault("VIP.COIN", 63020);
  279. +       VIP_STONE_ID            = sConfigMgr->GetIntDefault("VIP.STONE", 63021);
  280. +       VIP_MG_ID               = sConfigMgr->GetIntDefault("VIP.MAGIC_GOLD", 44209);
  281. +       VIP_TP_BONUS            = sConfigMgr->GetIntDefault("VIP.TP_BONUS", 14);
  282. +       VIP_LEVEL_BONUS_ENABLE  = sConfigMgr->GetBoolDefault("VIP.LEVEL_BONUS_ENABLE", true);
  283. +       VIP_LEVEL_BONUS         = sConfigMgr->GetIntDefault("VIP.LEVEL_BONUS", 1);
  284. +
  285. +       TC_LOG_INFO("server.loading", "___________________________________");
  286. +       TC_LOG_INFO("server.loading", "|  VIP MAX_VIP : %u", VIP_MAX);
  287. +
  288. +       if (VIP_VOTE_ENABLE)
  289. +       {
  290. +           TC_LOG_INFO("server.loading", "___________________________________");
  291. +           TC_LOG_INFO("server.loading", "|  VIP VOTES : ENABLED            |");
  292. +       };
  293. +
  294. +       TC_LOG_INFO("server.loading", "___________________________________");
  295. +       TC_LOG_INFO("server.loading", "|  VIP TP BONUS:%u", VIP_TP_BONUS);
  296. +
  297. +       if (VIP_LEVEL_BONUS_ENABLE)
  298. +       {
  299. +           TC_LOG_INFO("server.loading", "___________________________________");
  300. +           TC_LOG_INFO("server.loading", "|  VIP LEVEL BONUS : ENABLED      |");
  301. +           TC_LOG_INFO("server.loading", "|  VIP LEVEL BONUS:%u", VIP_LEVEL_BONUS);
  302. +       };
  303. +
  304. +       if (!sObjectMgr->GetItemTemplate(VIP_COIN_ID)){ TC_LOG_INFO("server.loading", "! VIP COIN %u MISSING FROM DB ! SERVER CRASHING !", VIP_COIN_ID); };
  305. +
  306. +       VIP_COIN_NAME           = sObjectMgr->GetItemTemplate(VIP_COIN_ID)->Name1;
  307. +
  308. +       TC_LOG_INFO("server.loading", "___________________________________");
  309. +       TC_LOG_INFO("server.loading", "|  VIP Config  : Loaded           |");
  310. +       TC_LOG_INFO("server.loading", "| Grumbo'z  VIP Engine  : Loaded  |");
  311. +       TC_LOG_INFO("server.loading", "|_________________________________|");
  312. +   };
  313. +
  314. +};
  315. +
  316. +uint8 VIP::GetVIPMAX()
  317. +{
  318. +   return VIP_MAX;
  319. +};
  320. +
  321. +bool VIP::GetVIPVOTE_ENABLE()
  322. +{
  323. +   return VIP_VOTE_ENABLE;
  324. +}
  325. +
  326. +uint32 VIP::GetVIPVOTECOUNT()
  327. +{
  328. +   return VIP_VOTE_COUNT;
  329. +};
  330. +
  331. +uint32 VIP::GetVIPCOINID()
  332. +{
  333. +   return VIP_COIN_ID;
  334. +};
  335. +
  336. +uint32 VIP::GetVIPSTONEID()
  337. +{
  338. +   return VIP_STONE_ID;
  339. +};
  340. +
  341. +uint32 VIP::GetVIPMGID()
  342. +{
  343. +   return VIP_MG_ID;
  344. +};
  345. +
  346. +float VIP::GetVIPOFFSET()
  347. +{
  348. +   return VIP_OFFSET;
  349. +};
  350. +
  351. +uint8 VIP::GetTALENTBONUS()
  352. +{
  353. +   return VIP_TP_BONUS;
  354. +};
  355. +
  356. +bool VIP::GetLEVELBONUS_ENABLE()
  357. +{
  358. +   return VIP_LEVEL_BONUS_ENABLE;
  359. +};
  360. +
  361. +uint8 VIP::GetLEVELBONUS()
  362. +{
  363. +   return VIP_LEVEL_BONUS;
  364. +};
  365. +
  366. +void VIP::SetHearthStone(uint32 guid, uint32 map_id, float x, float y, float z, float o)
  367. +{
  368. +   WorldDatabase.PExecute("UPDATE `hearthstone` SET `map_id`='%u', `x`='%f', `y`='%f', `z`='%f', `o`='%f' WHERE guid=%u;", map_id, x, y, z, o, guid);
  369. +
  370. +   VipHearthStoneGPS& data = HearthStone[guid];
  371. +   // Save the DB values to the MyData object
  372. +   data.guid = guid;
  373. +   data.map_id = map_id;
  374. +   data.x = x;
  375. +   data.y = y;
  376. +   data.z = z;
  377. +   data.o = o;
  378. +}
  379. +
  380. +void VIP::SetPlayerVIP(uint32 acct_id, uint8 pvip)
  381. +{ // you must update votes first for the dead mans check
  382. +
  383. +   if (VIP_VOTE_ENABLE)
  384. +   {
  385. +       uint32 pvotes = Vip[acct_id].votes;
  386. +
  387. +       pvip = uint8(pvotes / VIP_VOTE_COUNT); // dead mans check auto-calibrater
  388. +
  389. +       if (pvotes < VIP_VOTE_COUNT)
  390. +       {
  391. +           pvip = 1;
  392. +       }
  393. +
  394. +       if (pvotes >(VIP_VOTE_COUNT * VIP_MAX))
  395. +       {
  396. +           pvip = VIP_MAX;
  397. +       }
  398. +   }
  399. +
  400. +   Vip[acct_id].vip = pvip;
  401. +  
  402. +   PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SET_VIP);
  403. +   stmt->setUInt8(0, pvip);
  404. +   stmt->setUInt32(1, acct_id);
  405. +   LoginDatabase.Execute(stmt);
  406. +};
  407. +
  408. +void VIP::SetPlayerMG(uint32 acct_id, uint32 pmg)
  409. +{
  410. +   PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SET_MG);
  411. +   stmt->setUInt32(0, pmg);
  412. +   stmt->setUInt32(1, acct_id);
  413. +   LoginDatabase.Execute(stmt);
  414. +
  415. +   Vip[acct_id].mg = pmg;
  416. +};
  417. +
  418. +void VIP::SetPlayerVOTES(uint32 acct_id, uint32 pvotes)
  419. +{
  420. +   PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SET_VOTES);
  421. +   stmt->setUInt32(0, pvotes);
  422. +   stmt->setUInt32(1, acct_id);
  423. +   LoginDatabase.Execute(stmt);
  424. +
  425. +   Vip[acct_id].votes = pvotes;
  426. +};
  427. +
  428. +uint8 VIP::GetPlayerVIP(uint32 acct_id)
  429. +{
  430. +   return Vip[acct_id].vip;
  431. +};
  432. +
  433. +uint32 VIP::GetPlayerMG(uint32 acct_id)
  434. +{
  435. +   return Vip[acct_id].mg;
  436. +};
  437. +
  438. +uint32 VIP::GetPlayerVOTES(uint32 acct_id)
  439. +{
  440. +   return Vip[acct_id].votes;
  441. +};
  442. +
  443. +uint8 VIP::GetItemVIP(uint32 item_id)
  444. +{
  445. +   return ItemVip[item_id].vip;
  446. +};
  447. +
  448. +void VIP::SetItemVIP(uint32 item_id, uint8 item_vip)
  449. +{
  450. +   if (item_vip < 1) { item_vip = 1; };
  451. +   if (item_vip > VIP_MAX) { item_vip = VIP_MAX; };
  452. +
  453. +   PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SET_ITEM_VIP);
  454. +   stmt->setUInt8(0, item_vip);
  455. +   stmt->setUInt32(1, item_id);
  456. +   WorldDatabase.Execute(stmt);
  457. +
  458. +   ItemVip[item_id].vip = item_vip;
  459. +};
  460. +
  461. +uint8 VIP::GetCreatureVIP(uint32 creature_id)
  462. +{
  463. +   return CKR[creature_id].vip;
  464. +};
  465. +
  466. +uint32 VIP::GetCreatureMG(uint32 creature_id)
  467. +{
  468. +   return CKR[creature_id].mg;
  469. +};
  470. +
  471. +void VIP::SetCreatureVIP(uint32 creature_id, uint8 creature_vip)
  472. +{
  473. +   if (creature_vip < 1) { creature_vip = 1; };
  474. +   if (creature_vip > VIP_MAX) { creature_vip = VIP_MAX; };
  475. +
  476. +   PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SET_CREATURE_VIP);
  477. +   stmt->setUInt8(0, creature_vip);
  478. +   stmt->setUInt32(1, creature_id);
  479. +   WorldDatabase.Execute(stmt);
  480. +
  481. +   CKR[creature_id].vip = creature_vip;
  482. +};
  483. +
  484. +void VIP::SetCreatureMG(uint32 creature_id, uint8 creature_mg)
  485. +{
  486. +   PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SET_CREATURE_MG);
  487. +   stmt->setUInt8(0, creature_mg);
  488. +   stmt->setUInt32(1, creature_id);
  489. +   WorldDatabase.Execute(stmt);
  490. +
  491. +   CKR[creature_id].mg = creature_mg;
  492. +};
  493. +
  494. +class Grumboz_VIP_Account_Engine : public AccountScript
  495. +{
  496. +public: Grumboz_VIP_Account_Engine() : AccountScript("Grumboz_VIP_Account_Engine"){ };
  497. +
  498. +       virtual void OnAccountLogout(uint32 accountId)
  499. +       {
  500. +           TC_LOG_INFO("server.loading", "ACCOUNT::LOGOUT ID:%u VIP:%u", accountId, Vip[accountId].vip);
  501. +
  502. +           Vip.erase(accountId);
  503. +       };
  504. +
  505. +       virtual void OnAccountLogin(uint32 accountId)
  506. +       {
  507. +           if (accountId > 0)
  508. +           {
  509. +               PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_LOAD_VIP);
  510. +               stmt->setUInt32(0, accountId);
  511. +               PreparedQueryResult result = LoginDatabase.Query(stmt);
  512. +
  513. +               if (!result)
  514. +               {
  515. +                   TC_LOG_INFO("server.loading", "XX ERROR Loading a VIP table ID %u XX", accountId);
  516. +               };
  517. +
  518. +               if (result)
  519. +               {
  520. +                   // unpacks the results of `result` into fields and appoint data to variable.
  521. +                   Field* fields = result->Fetch();
  522. +                   uint8 pvip = fields[0].GetUInt8();
  523. +                   uint32 pmg = fields[1].GetUInt32();
  524. +                   uint32 pvotes = fields[2].GetUInt32();
  525. +
  526. +                   VipElements& data = Vip[accountId]; // like Lua table VIP[acctId].vip
  527. +                   // Save the DB values to the MyData object
  528. +                   data.vip = pvip;
  529. +                   data.mg = pmg;
  530. +                   data.votes = pvotes;
  531. +
  532. +                   VIP::SetPlayerVIP(accountId, pvip);
  533. +
  534. +                   TC_LOG_INFO("server.loading", "ACCOUNT::LOGIN ID:%u VIP:%u", accountId, Vip[accountId].vip);
  535. +               }
  536. +           }
  537. +       }
  538. +};
  539. +
  540. +class Grumboz_VIP_Player_Engine : public PlayerScript
  541. +{
  542. +public: Grumboz_VIP_Player_Engine() : PlayerScript("Grumboz_VIP_Player_Engine"){ };
  543. +
  544. +   virtual void OnLogout(Player* player)
  545. +   {
  546. +       AnnounceLoggingToWorld(player, 0);
  547. +   };
  548. +
  549. +   virtual void OnLogin(Player* player, bool firstLogin)
  550. +   {
  551. +       AnnounceLoggingToWorld(player, 1);
  552. +
  553. +       uint32 guid = player->GetGUID();
  554. +       uint32 acct_id = player->GetSession()->GetAccountId();
  555. +       uint8 Pvip = VIP::GetPlayerVIP(acct_id);
  556. +       bool lvl_enable = VIP::GetLEVELBONUS_ENABLE();
  557. +       uint8 xtra_levels = VIP::GetLEVELBONUS();
  558. +       uint8 Plvl = player->getLevel();
  559. +       uint8 max_level = sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL);
  560. +
  561. +       uint8 VIP_level_cap = (max_level + (xtra_levels * Pvip)) - xtra_levels; // has to compensate for base VIP 1
  562. +
  563. +       ChatHandler(player->GetSession()).PSendSysMessage("Welcome %s, you are VIP %u.", player->GetName().c_str(), Vip[acct_id].vip);
  564. +       ChatHandler(player->GetSession()).PSendSysMessage("%stype `.vip` for a list of VIP commands.", green.c_str());
  565. +
  566. +       if (HearthStone[guid].guid != guid)
  567. +       {
  568. +           WorldDatabase.PExecute("REPLACE INTO hearthstone SET `guid`='%u';", guid);
  569. +
  570. +           VIP::SetHearthStone(guid, player->GetMapId(), player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation());
  571. +       }
  572. +
  573. +       if (Plvl != VIP_level_cap)
  574. +       {
  575. +           if (lvl_enable)
  576. +           {
  577. +               player->SetLevel(VIP_level_cap);
  578. +           }
  579. +       }
  580. +   };
  581. +
  582. +   virtual void OnCreatureKill(Player* player, Creature* creature)
  583. +   {
  584. +       uint32 itemId = VIP::GetVIPMGID();
  585. +       uint32 creatureId = creature->GetEntry();
  586. +       uint8 cVip = urand(1, VIP::GetCreatureVIP(creatureId));
  587. +       uint32 cMg = VIP::GetCreatureMG(creatureId);
  588. +
  589. +       if (cMg > 0)
  590. +       {
  591. +           if (player->GetGroup())
  592. +           {
  593. +               Group* group = player->GetGroup();
  594. +
  595. +               Group::MemberSlotList const &members = group->GetMemberSlots();
  596. +
  597. +               for (Group::MemberSlotList::const_iterator itr = members.begin(); itr != members.end(); ++itr)
  598. +               {
  599. +                   Group::MemberSlot const &slot = *itr;
  600. +                   Player* player = ObjectAccessor::FindPlayer((*itr).guid);
  601. +
  602. +                   if (player && player->GetSession())
  603. +                   {
  604. +                       uint32 accountId = player->GetSession()->GetAccountId();
  605. +                       uint32 MG = VIP::GetPlayerMG(accountId);
  606. +                       uint8 pVip = VIP::GetPlayerVIP(accountId);
  607. +
  608. +                       uint32 reward = (cMg * cVip) * pVip;
  609. +
  610. +                       ChatHandler(player->GetSession()).PSendSysMessage("+%u", reward);
  611. +                       if (!player->AddItem(itemId, reward))
  612. +                       {
  613. +                           VIP::SetPlayerMG(accountId, MG + reward);
  614. +
  615. +                           ChatHandler(player->GetSession()).PSendSysMessage("Banked.");
  616. +                       }
  617. +                   }
  618. +               }
  619. +           }
  620. +           else
  621. +           {
  622. +               uint32 accountId = player->GetSession()->GetAccountId();
  623. +               uint32 MG = VIP::GetPlayerMG(accountId);
  624. +               uint8 pVip = VIP::GetPlayerVIP(accountId);
  625. +
  626. +               uint32 reward = (cMg * cVip) * pVip;
  627. +
  628. +               if (!player->AddItem(itemId, reward))
  629. +               {
  630. +                   VIP::SetPlayerMG(accountId, MG + reward);
  631. +
  632. +                   ChatHandler(player->GetSession()).PSendSysMessage("+%u Banked.", reward);
  633. +               }
  634. +           }
  635. +       }
  636. +   };
  637. +};
  638. +
  639. +class VIP_commands : public CommandScript
  640. +{
  641. +public:
  642. +   VIP_commands() : CommandScript("VIP_commands") { }
  643. +
  644. +   std::vector<ChatCommand> GetCommands() const
  645. +   {
  646. +       static std::vector<ChatCommand> vipCommandChangeTable =
  647. +       {
  648. +           { "race", rbac::RBAC_IN_GRANTED_LIST, true, &HandleChangeRaceCommand, "allows the player to change there race during next login." },
  649. +           { "faction", rbac::RBAC_IN_GRANTED_LIST, true, &HandleChangeFactionCommand, "allows the player to change there faction during next login." },
  650. +           { "custom", rbac::RBAC_IN_GRANTED_LIST, true, &HandleCustomizeCommand, "allows the player to re-costumize there character during next login." },
  651. +       };
  652. +
  653. +       static std::vector<ChatCommand> vipCommandSetTable =
  654. +       {
  655. +           { "hearthstone", rbac::RBAC_IN_GRANTED_LIST, true, &HandleVipSetHearthstoneCommand, "stores players current gps to VIP hearthstone command." },
  656. +       };
  657. +
  658. +       std::string repair_info = "repairs all the players items. Requires the player to possess a " + VIP_COIN_NAME + ".";
  659. +
  660. +       static std::vector<ChatCommand> vipCommandTable =
  661. +       {
  662. +           { "mall",       rbac::RBAC_IN_GRANTED_LIST, true, &HandleVipMallCommand, "Teleports the player to a VIP mall." },
  663. +           { "home",       rbac::RBAC_IN_GRANTED_LIST, true, &HandleHomeCommand, "Teleports the player to there faction home mall." },
  664. +           { "hearthstone",rbac::RBAC_IN_GRANTED_LIST, true, &HandleHearthStoneCommand, "Teleports a player to there custom pre-set location." },
  665. +           { "repair",     rbac::RBAC_IN_GRANTED_LIST, true, &HandleRepairCommand, repair_info },
  666. +           { "set",        rbac::RBAC_IN_GRANTED_LIST, true, NULL, "Player customizable commands.", vipCommandSetTable },
  667. +           { "change",     rbac::RBAC_IN_GRANTED_LIST, true, NULL, "Character customizing commands.", vipCommandChangeTable },
  668. +       };
  669. +
  670. +       static std::vector<ChatCommand> commandTable =
  671. +       {
  672. +           { "vip", rbac::RBAC_IN_GRANTED_LIST, true, NULL, "custom VIP commands by Grumbo. Some commands may require player has an item.", vipCommandTable },
  673. +       };
  674. +       return commandTable;
  675. +   }
  676. +
  677. +   static bool HandleVipMallCommand(ChatHandler* handler, const char* args)
  678. +   {
  679. +
  680. +       Player* player = handler->GetSession()->GetPlayer();
  681. +
  682. +       auto team_id = player->GetTeamId();
  683. +
  684. +       if (player->IsInCombat())
  685. +       {
  686. +           handler->SendSysMessage(LANG_YOU_IN_COMBAT);
  687. +           handler->SetSentErrorMessage(true);
  688. +           return false;
  689. +       }
  690. +
  691. +       // stop flight if need
  692. +       if (player->IsInFlight())
  693. +       {
  694. +           player->GetMotionMaster()->MovementExpired();
  695. +           player->CleanupAfterTaxiFlight();
  696. +       }
  697. +       // save only in non-flight case
  698. +       else
  699. +           player->SaveRecallPosition();
  700. +
  701. +       player->TeleportTo(MALL[team_id].map_id, MALL[team_id].x, MALL[team_id].y, MALL[team_id].z, MALL[team_id].o);
  702. +       return true;
  703. +   }
  704. +
  705. +   static bool HandleChangeRaceCommand(ChatHandler* handler, const char* args)
  706. +   {
  707. +       Player* player = handler->GetSession()->GetPlayer();
  708. +       player->SetAtLoginFlag(AT_LOGIN_CHANGE_RACE);
  709. +       handler->PSendSysMessage("Relog to change race of your character.");
  710. +       return true;
  711. +   }
  712. +
  713. +   static bool HandleChangeFactionCommand(ChatHandler* handler, const char* args)
  714. +   {
  715. +       Player* player = handler->GetSession()->GetPlayer();
  716. +       player->SetAtLoginFlag(AT_LOGIN_CHANGE_FACTION);
  717. +       handler->PSendSysMessage("Relog to change faction of your character.");
  718. +       return true;
  719. +   }
  720. +
  721. +   static bool HandleCustomizeCommand(ChatHandler* handler, const char* args)
  722. +   {
  723. +       Player* player = handler->GetSession()->GetPlayer();
  724. +       player->SetAtLoginFlag(AT_LOGIN_CUSTOMIZE);
  725. +       handler->PSendSysMessage("Relog to customize your character.");
  726. +       return true;
  727. +   }
  728. +
  729. +   static bool HandleHomeCommand(ChatHandler* handler, const char* args)
  730. +   {
  731. +
  732. +       Player* player = handler->GetSession()->GetPlayer();
  733. +
  734. +       auto team_id = player->GetTeamId();
  735. +
  736. +       if (player->IsInCombat())
  737. +       {
  738. +           handler->SendSysMessage(LANG_YOU_IN_COMBAT);
  739. +           handler->SetSentErrorMessage(true);
  740. +           return false;
  741. +       }
  742. +
  743. +       // stop flight if need
  744. +       if (player->IsInFlight())
  745. +       {
  746. +           player->GetMotionMaster()->MovementExpired();
  747. +           player->CleanupAfterTaxiFlight();
  748. +       }
  749. +       // save only in non-flight case
  750. +       else
  751. +           player->SaveRecallPosition();
  752. +
  753. +       player->TeleportTo(HOME[team_id].map_id, HOME[team_id].x, HOME[team_id].y, HOME[team_id].z, HOME[team_id].o);
  754. +       return true;
  755. +   }
  756. +
  757. +   static bool HandleRepairCommand(ChatHandler* handler, const char* args)
  758. +   {
  759. +       Player* player = handler->GetSession()->GetPlayer();
  760. +
  761. +       if (!player->HasItemCount(VIP_COIN_ID, 1, false))
  762. +       {
  763. +           handler->PSendSysMessage("You must have a %s to use this command.", VIP_COIN_NAME.c_str());
  764. +           return false;
  765. +       }
  766. +
  767. +       if (player->HasItemCount(VIP_COIN_ID, 1, false))
  768. +       {
  769. +           player->DurabilityRepairAll(0, 0, false);
  770. +           handler->PSendSysMessage("Done.");
  771. +           return true;
  772. +       }
  773. +       return true;
  774. +   }
  775. +
  776. +   static bool HandleVipSetHearthstoneCommand(ChatHandler* handler, const char* args)
  777. +   {
  778. +
  779. +       Player* player = handler->GetSession()->GetPlayer();
  780. +
  781. +       auto team_id = player->GetTeamId();
  782. +
  783. +       if (player->IsInCombat())
  784. +       {
  785. +           handler->SendSysMessage(LANG_YOU_IN_COMBAT);
  786. +           handler->SetSentErrorMessage(true);
  787. +           return false;
  788. +       }
  789. +
  790. +       // stop flight if need
  791. +       if (player->IsInFlight())
  792. +       {
  793. +           player->GetMotionMaster()->MovementExpired();
  794. +           player->CleanupAfterTaxiFlight();
  795. +       }
  796. +       // save only in non-flight case
  797. +       else
  798. +           player->SaveRecallPosition();
  799. +
  800. +       VIP::SetHearthStone(player->GetGUID(), player->GetMapId(), player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation());
  801. +       handler->PSendSysMessage("%s, your location has been stored.", player->GetName().c_str());
  802. +       return true;
  803. +   }
  804. +
  805. +   static bool HandleHearthStoneCommand(ChatHandler* handler, const char* args)
  806. +   {
  807. +
  808. +       Player* player = handler->GetSession()->GetPlayer();
  809. +
  810. +       uint32 guid = player->GetGUID();
  811. +
  812. +       if (player->IsInCombat())
  813. +       {
  814. +           handler->SendSysMessage(LANG_YOU_IN_COMBAT);
  815. +           handler->SetSentErrorMessage(true);
  816. +           return false;
  817. +       }
  818. +
  819. +       // stop flight if need
  820. +       if (player->IsInFlight())
  821. +       {
  822. +           player->GetMotionMaster()->MovementExpired();
  823. +           player->CleanupAfterTaxiFlight();
  824. +       }
  825. +
  826. +       if (HearthStone[guid].guid != guid)
  827. +       {
  828. +           WorldDatabase.PExecute("REPLACE INTO hearthstone SET `guid`='%u';", guid);
  829. +
  830. +           VIP::SetHearthStone(guid, player->GetMapId(), player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation());
  831. +
  832. +           handler->PSendSysMessage("You must store a location first to be able to use this command.");
  833. +           handler->PSendSysMessage("Default location is your current location.");
  834. +           return false;
  835. +       }
  836. +
  837. +       if (HearthStone[guid].guid == guid)
  838. +       {
  839. +           // save only in non-flight case and a location is stored
  840. +           player->SaveRecallPosition();
  841. +
  842. +           player->TeleportTo(HearthStone[guid].map_id, HearthStone[guid].x, HearthStone[guid].y, HearthStone[guid].z, HearthStone[guid].o);
  843. +           return true;
  844. +       }
  845. +       return true;
  846. +   }
  847. +};
  848. +
  849. +class VIP_Coin_Script : public ItemScript
  850. +{
  851. +public: VIP_Coin_Script() : ItemScript("VIP_Coin_Script"){ };
  852. +
  853. +
  854. +       virtual bool OnUse(Player* player, Item* item, SpellCastTargets const& targets)
  855. +       {
  856. +           uint32 acct_id = player->GetSession()->GetAccountId();
  857. +           uint8 pVip = VIP::GetPlayerVIP(acct_id);
  858. +           uint32 pMg = VIP::GetPlayerMG(acct_id);
  859. +           uint32 pVotes = VIP::GetPlayerVOTES(acct_id);
  860. +           std::string Votes_Required_Ann;
  861. +           bool voting = VIP::GetVIPVOTE_ENABLE();
  862. +
  863. +           ChatHandler(player->GetSession()).PSendSysMessage("%s**********************************", green.c_str());
  864. +           ChatHandler(player->GetSession()).PSendSysMessage("%sYou are VIP:%s%u%s of %s%u.", green.c_str(), white.c_str(), pVip, green.c_str(), white.c_str(), VIP_MAX);
  865. +           ChatHandler(player->GetSession()).PSendSysMessage("%sYou have %s%u %smg's", green.c_str(), white.c_str(), pMg, green.c_str());
  866. +
  867. +           if (pVotes <= 10){ ChatHandler(player->GetSession()).PSendSysMessage("%sYou have Voted %s%u%s time's.", green.c_str(), white.c_str(), pVotes, green.c_str()); };
  868. +           if (pVotes > 10){ ChatHandler(player->GetSession()).PSendSysMessage("%sThank you for voting %s%u%s time's.", green.c_str(), white.c_str(), pVotes, green.c_str()); };
  869. +
  870. +           ChatHandler(player->GetSession()).PSendSysMessage("%sYou recieve a %s%u%s %sstat increase.", green.c_str(), white.c_str(), uint8(VIP_OFFSET * 100)*pVip, "%", green.c_str());
  871. +
  872. +           if (voting)
  873. +           {
  874. +               if (pVip < VIP_MAX)
  875. +               {
  876. +                   uint32 Votes_Required = ((pVip + 1) * VIP_VOTE_COUNT) - pVotes;
  877. +
  878. +                   ChatHandler(player->GetSession()).PSendSysMessage("%sYou need %s%u%s more votes to reach the next VIP rank:%s%u%s.", green.c_str(), white.c_str(), Votes_Required, green.c_str(), white.c_str(), (pVip + 1), green.c_str());
  879. +
  880. +                   ChatHandler(player->GetSession()).PSendSysMessage("%s**********************************", green.c_str());
  881. +
  882. +                   return true;
  883. +               }
  884. +           }
  885. +           ChatHandler(player->GetSession()).PSendSysMessage("%s**********************************", green.c_str());
  886. +           return true;
  887. +       }
  888. +};
  889. +
  890. +void RemoveItem(uint32 id, Player* player)
  891. +{
  892. +   player->DestroyItemCount(uint32(id), 1, true);
  893. +
  894. +   ChatHandler(player->GetSession()).PSendSysMessage("%s+1 VIP.", green.c_str());
  895. +};
  896. +
  897. +class VIP_Stone_Script : public ItemScript
  898. +{
  899. +public: VIP_Stone_Script() : ItemScript("VIP_Stone_Script"){ };
  900. +
  901. +
  902. +       virtual bool OnUse(Player* player, Item* item, SpellCastTargets const& targets)
  903. +       {
  904. +           uint32 acct_id = player->GetSession()->GetAccountId();
  905. +           uint8 pVip = VIP::GetPlayerVIP(acct_id);
  906. +           uint32 pMg = VIP::GetPlayerMG(acct_id);
  907. +           uint32 pVotes = VIP::GetPlayerVOTES(acct_id);
  908. +
  909. +           if (pVip >= VIP_MAX)
  910. +           {
  911. +               ChatHandler(player->GetSession()).PSendSysMessage("%sYou are allready the maximum VIP rank:%s%u.", red.c_str(), white.c_str(), VIP_MAX);
  912. +
  913. +           }
  914. +
  915. +           if (pVip < VIP_MAX)
  916. +           {
  917. +               VIP::SetPlayerVOTES(acct_id, pVotes + VIP_VOTE_COUNT); // must be first for the dead mans check
  918. +
  919. +               VIP::SetPlayerVIP(acct_id, pVip + 1);
  920. +
  921. +               RemoveItem(VIP_COIN_ID, player);
  922. +
  923. +               return true;
  924. +           }
  925. +           return true;
  926. +       }
  927. +};
  928. +
  929. +class VIP_MG_BANKER : public CreatureScript
  930. +{
  931. +public: VIP_MG_BANKER() : CreatureScript("VIP_MG_BANKER"){ }
  932. +
  933. +       bool OnGossipHello(Player* player, Creature* creature)
  934. +       {
  935. +
  936. +           uint32 accountId = player->GetSession()->GetAccountId();
  937. +           uint8 pVIP = VIP::GetPlayerVIP(accountId);
  938. +           uint32 MG = VIP::GetPlayerMG(accountId);
  939. +           uint32 itemId = VIP::GetVIPMGID();
  940. +           uint32 pMg = player->GetItemCount(itemId);
  941. +           uint32 pVotes = VIP::GetPlayerVOTES(accountId);
  942. +           std::string itemName = sObjectMgr->GetItemTemplate(itemId)->Name1;
  943. +           std::string currency_inBank;
  944. +           std::string deposit_amt;
  945. +
  946. +           if (pMg == 1){ deposit_amt = "Total:" + ConvertNumberToString(pMg) + " " + itemName; };
  947. +           if (pMg == 0 || pMg > 1){ deposit_amt = "Total:" + ConvertNumberToString(pMg) + " " + itemName + "'s"; };
  948. +
  949. +           std::string withdraw10 = "Withdraw 10 " + itemName + "'s. Fee:0 " + itemName + "'s.";
  950. +           std::string withdraw100 = "Withdraw 100 " + itemName + "'s. Fee:1 " + itemName + ".";
  951. +           std::string withdraw1000 = "Withdraw 1,000 " + itemName + "'s. Fee:10 " + itemName + "'s.";
  952. +           std::string withdraw10000 = "Withdraw 10,000 " + itemName + "'s. Fee:100 " + itemName + "'s.";
  953. +           std::string withdraw100000 = "Withdraw 100,000 " + itemName + "'s. Fee:1,000 " + itemName + "'s.";
  954. +
  955. +           if (MG == 1)
  956. +               currency_inBank = "Balance:" + ConvertNumberToString(MG) + " " + itemName;
  957. +           else
  958. +           {
  959. +               currency_inBank = "Balance:" + ConvertNumberToString(MG) + " " + itemName + "'s.";
  960. +           };
  961. +
  962. +           std::string current_VOTES = "Votes:" + ConvertNumberToString(pVotes);
  963. +           std::string current_VIP = "VIP:" + ConvertNumberToString(pVIP);
  964. +
  965. +           if (pMg > 0)
  966. +           {
  967. +               player->ADD_GOSSIP_ITEM(10, "-----------------------", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2000);
  968. +               player->ADD_GOSSIP_ITEM(10, "-Deposit-", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2000);
  969. +               player->ADD_GOSSIP_ITEM(10, "-----------------------", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2000);
  970. +               player->ADD_GOSSIP_ITEM(10, "Deposit all my custom currency.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2001);
  971. +               player->ADD_GOSSIP_ITEM(10, deposit_amt.c_str(), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2001);
  972. +               player->ADD_GOSSIP_ITEM(10, "-----------------------", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2000);
  973. +           }
  974. +
  975. +           if (MG >= 10)
  976. +           {
  977. +               player->ADD_GOSSIP_ITEM(10, "-----------------------", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2000);
  978. +               player->ADD_GOSSIP_ITEM(10, "-WithDrawl-", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2000);
  979. +               player->ADD_GOSSIP_ITEM(10, "-----------------------", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2000);
  980. +               player->ADD_GOSSIP_ITEM(10, withdraw10.c_str(), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2002);
  981. +
  982. +               if (MG >= 101){ player->ADD_GOSSIP_ITEM(10, withdraw100.c_str(), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2003); };
  983. +               if (MG >= 1010){ player->ADD_GOSSIP_ITEM(10, withdraw1000.c_str(), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2004); };
  984. +               if (MG >= 10100){ player->ADD_GOSSIP_ITEM(10, withdraw10000.c_str(), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2005); };
  985. +               if (MG >= 101000){ player->ADD_GOSSIP_ITEM(10, withdraw100000.c_str(), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2006); };
  986. +           }
  987. +
  988. +           player->ADD_GOSSIP_ITEM(10, "-----------------------", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2000);
  989. +           player->ADD_GOSSIP_ITEM(10, "-----------------------", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2000);
  990. +           player->ADD_GOSSIP_ITEM(10, "-Bank Balance-", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2000);
  991. +           player->ADD_GOSSIP_ITEM(10, currency_inBank.c_str(), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2000);
  992. +           player->ADD_GOSSIP_ITEM(10, current_VOTES.c_str(), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2000);
  993. +           player->ADD_GOSSIP_ITEM(10, current_VIP.c_str(), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2000);
  994. +           player->ADD_GOSSIP_ITEM(10, "-----------------------", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2000);
  995. +
  996. +           player->SEND_GOSSIP_MENU(1, creature->GetGUID());
  997. +
  998. +           return true;
  999. +       };
  1000. +
  1001. +       bool OnGossipSelect(Player* player, Creature* creature, uint32 /* sender */, uint32 actions)
  1002. +       {
  1003. +           TC_LOG_INFO("server.loading", "MG_BANKER::OnSelect :%u", actions);
  1004. +
  1005. +           uint32 accountId = player->GetSession()->GetAccountId();
  1006. +           uint8 pVIP = VIP::GetPlayerVIP(accountId);
  1007. +           uint32 MG = VIP::GetPlayerMG(accountId);
  1008. +           uint32 itemId = VIP::GetVIPMGID();
  1009. +           uint32 pMg = player->GetItemCount(itemId);
  1010. +           uint32 pVotes = VIP::GetPlayerVOTES(accountId);
  1011. +
  1012. +           switch (actions)
  1013. +           {
  1014. +           case GOSSIP_ACTION_INFO_DEF + 2000: // loopbacks
  1015. +
  1016. +               player->PlayerTalkClass->ClearMenus();
  1017. +               player->CLOSE_GOSSIP_MENU();
  1018. +
  1019. +               OnGossipHello(player, creature);
  1020. +               break;
  1021. +
  1022. +           case GOSSIP_ACTION_INFO_DEF + 2001: // Deposit all
  1023. +
  1024. +               player->DestroyItemCount(itemId, pMg, true);
  1025. +
  1026. +               if (player->GetItemCount(itemId) == 0)
  1027. +               {
  1028. +                   VIP::SetPlayerMG(accountId, MG + pMg);
  1029. +
  1030. +               };
  1031. +
  1032. +               player->PlayerTalkClass->ClearMenus();
  1033. +               player->CLOSE_GOSSIP_MENU();
  1034. +
  1035. +               OnGossipHello(player, creature);
  1036. +               break;
  1037. +
  1038. +           case GOSSIP_ACTION_INFO_DEF + 2002: // Withdraw 10
  1039. +
  1040. +               player->PlayerTalkClass->ClearMenus();
  1041. +
  1042. +               if (player->AddItem(itemId, 10))
  1043. +               {
  1044. +                   VIP::SetPlayerMG(accountId, MG - 10);
  1045. +                   player->CLOSE_GOSSIP_MENU();
  1046. +               }
  1047. +               break;
  1048. +
  1049. +           case GOSSIP_ACTION_INFO_DEF + 2003: // Withdraw 100
  1050. +
  1051. +               player->PlayerTalkClass->ClearMenus();
  1052. +
  1053. +               if (player->AddItem(itemId, 100))
  1054. +               {
  1055. +                   VIP::SetPlayerMG(accountId, MG - 101);
  1056. +                   player->CLOSE_GOSSIP_MENU();
  1057. +               }
  1058. +
  1059. +               OnGossipHello(player, creature);
  1060. +               break;
  1061. +
  1062. +           case GOSSIP_ACTION_INFO_DEF + 2004: // Withdraw 1,000
  1063. +               player->PlayerTalkClass->ClearMenus();
  1064. +
  1065. +               if (player->AddItem(itemId, 1000))
  1066. +               {
  1067. +                   VIP::SetPlayerMG(accountId, MG - 1010);
  1068. +                   player->CLOSE_GOSSIP_MENU();
  1069. +               }
  1070. +
  1071. +               OnGossipHello(player, creature);
  1072. +               break;
  1073. +
  1074. +           case GOSSIP_ACTION_INFO_DEF + 2005: // Withdraw 10,000
  1075. +               player->PlayerTalkClass->ClearMenus();
  1076. +
  1077. +               if (player->AddItem(itemId, 10000))
  1078. +               {
  1079. +                   VIP::SetPlayerMG(accountId, MG - 10100);
  1080. +                   player->CLOSE_GOSSIP_MENU();
  1081. +               }
  1082. +
  1083. +               OnGossipHello(player, creature);
  1084. +               break;
  1085. +
  1086. +           case GOSSIP_ACTION_INFO_DEF + 2006: // Withdraw 100,000
  1087. +               player->PlayerTalkClass->ClearMenus();
  1088. +
  1089. +               if (player->AddItem(itemId, 100000))
  1090. +               {
  1091. +                   VIP::SetPlayerMG(accountId, MG - 101000);
  1092. +                   player->CLOSE_GOSSIP_MENU();
  1093. +               }
  1094. +
  1095. +               OnGossipHello(player, creature);
  1096. +               break;
  1097. +           }
  1098. +           return true;
  1099. +       };
  1100. +};
  1101. +
  1102. +void AddSC_Grumboz_VIP_Core()
  1103. +{
  1104. +   new VIP_Load_Conf;
  1105. +   new Grumboz_VIP_Account_Engine;
  1106. +   new Grumboz_VIP_Player_Engine;
  1107. +   new VIP_commands;
  1108. +   new VIP_Coin_Script;
  1109. +   new VIP_Stone_Script;
  1110. +   new VIP_MG_BANKER;
  1111. +}
  1112. diff --git a/src/server/game/Entities/Player/Grumboz_VIP_Core.h b/src/server/game/Entities/Player/Grumboz_VIP_Core.h
  1113. new file mode 100644
  1114. index 0000000..03555a3
  1115. --- /dev/null
  1116. +++ b/src/server/game/Entities/Player/Grumboz_VIP_Core.h
  1117. @@ -0,0 +1,92 @@
  1118. +
  1119. +#ifndef GRUMBOZ_VIP_CORE_H
  1120. +#define GRUMBOZ_VIP_CORE_H
  1121. +
  1122. +struct VipElements
  1123. +{
  1124. +   uint8 vip;
  1125. +   uint32 mg;
  1126. +   uint32 votes;
  1127. +};
  1128. +
  1129. +struct ItemVIP
  1130. +{
  1131. +   uint32 item_id;
  1132. +   uint8 vip;
  1133. +};
  1134. +
  1135. +struct CreatureVIP
  1136. +{
  1137. +   uint8 vip;
  1138. +   uint8 mg;
  1139. +};
  1140. +
  1141. +struct VipMallGPS
  1142. +{
  1143. +   uint32 map_id;
  1144. +   float x;
  1145. +   float y;
  1146. +   float z;
  1147. +   float o;
  1148. +};
  1149. +
  1150. +struct VipHomeGPS
  1151. +{
  1152. +   uint32 map_id;
  1153. +   float x;
  1154. +   float y;
  1155. +   float z;
  1156. +   float o;
  1157. +};
  1158. +
  1159. +struct VipHearthStoneGPS
  1160. +{
  1161. +   uint32 guid;
  1162. +   uint32 map_id;
  1163. +   float x;
  1164. +   float y;
  1165. +   float z;
  1166. +   float o;
  1167. +};
  1168. +
  1169. +class VIP
  1170. +{
  1171. +
  1172. +public:
  1173. +   VIP();
  1174. +   ~VIP();
  1175. +
  1176. +   // Getterz
  1177. +   static uint8 GetVIPMAX();
  1178. +   static bool GetVIPVOTE_ENABLE();
  1179. +   static uint32 GetVIPVOTECOUNT();
  1180. +   static uint32 GetVIPCOINID();
  1181. +   static uint32 GetVIPSTONEID();
  1182. +   static uint32 GetVIPMGID();
  1183. +   static float GetVIPOFFSET();
  1184. +   static uint8 GetTALENTBONUS();
  1185. +   static bool GetLEVELBONUS_ENABLE();
  1186. +   static uint8 GetLEVELBONUS();
  1187. +
  1188. +   static uint8 GetPlayerVIP(uint32 acct_id);
  1189. +   static uint32 GetPlayerMG(uint32 acct_id);
  1190. +   static uint32 GetPlayerVOTES(uint32 acct_id);
  1191. +   static uint8 GetItemVIP(uint32 item_id);
  1192. +   static uint8 GetCreatureVIP(uint32 creature_id);
  1193. +   static uint32 GetCreatureMG(uint32 creature_id);
  1194. +
  1195. +   // Setterz
  1196. +   static void SetPlayerVIP(uint32 acct_id, uint8 pvip);
  1197. +   static void SetPlayerMG(uint32 acct_id, uint32 pmg);
  1198. +   static void SetPlayerVOTES(uint32 acct_id, uint32 pvotes);
  1199. +   static void SetHearthStone(uint32 guid, uint32 map_id, float x, float y, float z, float o);
  1200. +   static void SetItemVIP(uint32 item_id, uint8 item_vip);
  1201. +   static void SetCreatureVIP(uint32 creature_id, uint8 creature_vip);
  1202. +   static void SetCreatureMG(uint32 creature_id, uint8 creature_mg);
  1203. +
  1204. +private:
  1205. +   // tools
  1206. +   void RemoveItem(uint32 id, Player* player);
  1207. +};
  1208. +
  1209. +#endif // GRUMBOZ_GUILD_WARZ_H_INCLUDED
  1210. diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp
  1211. index a8e13a9..a4a1239 100644
  1212. --- a/src/server/game/Entities/Unit/StatSystem.cpp
  1213. +++ b/src/server/game/Entities/Unit/StatSystem.cpp
  1214. @@ -20,10 +20,12 @@
  1215.  #include "Player.h"
  1216.  #include "Pet.h"
  1217.  #include "Creature.h"
  1218. +#include "Grumboz_VIP_Core.h"
  1219.  #include "SharedDefines.h"
  1220.  #include "SpellAuras.h"
  1221.  #include "SpellAuraEffects.h"
  1222.  #include "World.h"
  1223. +#include "WorldSession.h"
  1224.  
  1225.  inline bool _ModifyUInt32(bool apply, uint32& baseValue, int32& amount)
  1226.  {
  1227. @@ -242,7 +244,12 @@ void Player::UpdateResistances(uint32 school)
  1228.  
  1229.  void Player::UpdateArmor()
  1230.  {
  1231. -    UnitMods unitMod = UNIT_MOD_ARMOR;
  1232. +   float VIP_OFFSET = VIP::GetVIPOFFSET();
  1233. +   uint32 acctId = GetSession()->GetAccountId();
  1234. +   uint8 Pvip = VIP::GetPlayerVIP(acctId);
  1235. +   float MOD = (Pvip * VIP_OFFSET);
  1236. +  
  1237. +   UnitMods unitMod = UNIT_MOD_ARMOR;
  1238.  
  1239.      float value = GetModifierValue(unitMod, BASE_VALUE);    // base armor (from items)
  1240.      value *= GetModifierValue(unitMod, BASE_PCT);           // armor percent from items
  1241. @@ -259,7 +266,10 @@ void Player::UpdateArmor()
  1242.  
  1243.      value *= GetModifierValue(unitMod, TOTAL_PCT);
  1244.  
  1245. -    SetArmor(int32(value));
  1246. +   uint32 THP = (uint32)value * MOD;
  1247. +   int32 HPMOD = (int32)value + THP;
  1248. +
  1249. +   SetArmor(int32(HPMOD));
  1250.  
  1251.      Pet* pet = GetPet();
  1252.      if (pet)
  1253. @@ -289,14 +299,22 @@ float Player::GetManaBonusFromIntellect()
  1254.  
  1255.  void Player::UpdateMaxHealth()
  1256.  {
  1257. -    UnitMods unitMod = UNIT_MOD_HEALTH;
  1258. +   float VIP_OFFSET = VIP::GetVIPOFFSET();
  1259. +   uint32 acctId = GetSession()->GetAccountId();
  1260. +   uint8 Pvip = VIP::GetPlayerVIP(acctId);
  1261. +   float MOD = (Pvip * VIP_OFFSET);
  1262.  
  1263. -    float value = GetModifierValue(unitMod, BASE_VALUE) + GetCreateHealth();
  1264. -    value *= GetModifierValue(unitMod, BASE_PCT);
  1265. -    value += GetModifierValue(unitMod, TOTAL_VALUE) + GetHealthBonusFromStamina();
  1266. -    value *= GetModifierValue(unitMod, TOTAL_PCT);
  1267. +   UnitMods unitMod = UNIT_MOD_HEALTH;
  1268.  
  1269. -    SetMaxHealth((uint32)value);
  1270. +   float value = GetModifierValue(unitMod, BASE_VALUE) + GetCreateHealth();
  1271. +   value *= GetModifierValue(unitMod, BASE_PCT);
  1272. +   value += GetModifierValue(unitMod, TOTAL_VALUE) + GetHealthBonusFromStamina();
  1273. +   value *= GetModifierValue(unitMod, TOTAL_PCT);
  1274. +
  1275. +   float THP = (uint32)value * MOD;
  1276. +   float HPMOD = (uint32)value + THP;
  1277. +
  1278. +   SetMaxHealth(uint32(HPMOD));
  1279.  }
  1280.  
  1281.  void Player::UpdateMaxPower(Powers power)
  1282. @@ -514,7 +532,12 @@ void Player::UpdateShieldBlockValue()
  1283.  
  1284.  void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, float& minDamage, float& maxDamage)
  1285.  {
  1286. -    UnitMods unitMod;
  1287. +   float VIP_OFFSET = VIP::GetVIPOFFSET();
  1288. +   uint32 acctId = GetSession()->GetAccountId();
  1289. +   uint8 Pvip = VIP::GetPlayerVIP(acctId);
  1290. +   float MOD = (Pvip * VIP_OFFSET);
  1291. +  
  1292. +   UnitMods unitMod;
  1293.  
  1294.      switch (attType)
  1295.      {
  1296. @@ -537,8 +560,8 @@ void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bo
  1297.      float totalValue = GetModifierValue(unitMod, TOTAL_VALUE);
  1298.      float totalPct   = addTotalPct ? GetModifierValue(unitMod, TOTAL_PCT) : 1.0f;
  1299.  
  1300. -    float weaponMinDamage = GetWeaponDamageRange(attType, MINDAMAGE);
  1301. -    float weaponMaxDamage = GetWeaponDamageRange(attType, MAXDAMAGE);
  1302. +   float weaponMinDamage = GetWeaponDamageRange(attType, MINDAMAGE) + (GetWeaponDamageRange(attType, MINDAMAGE) / MOD);
  1303. +   float weaponMaxDamage = GetWeaponDamageRange(attType, MAXDAMAGE) + (GetWeaponDamageRange(attType, MAXDAMAGE) / MOD);
  1304.  
  1305.      if (IsInFeralForm()) // check if player is druid and in cat or bear forms
  1306.      {
  1307. diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp
  1308. index a8e13a9..a4a1239 100644
  1309. --- a/src/server/game/Entities/Unit/StatSystem.cpp
  1310. +++ b/src/server/game/Entities/Unit/StatSystem.cpp
  1311. @@ -20,10 +20,12 @@
  1312.  #include "Player.h"
  1313.  #include "Pet.h"
  1314.  #include "Creature.h"
  1315. +#include "Grumboz_VIP_Core.h"
  1316.  #include "SharedDefines.h"
  1317.  #include "SpellAuras.h"
  1318.  #include "SpellAuraEffects.h"
  1319.  #include "World.h"
  1320. +#include "WorldSession.h"
  1321.  
  1322.  inline bool _ModifyUInt32(bool apply, uint32& baseValue, int32& amount)
  1323.  {
  1324. @@ -242,7 +244,12 @@ void Player::UpdateResistances(uint32 school)
  1325.  
  1326.  void Player::UpdateArmor()
  1327.  {
  1328. -    UnitMods unitMod = UNIT_MOD_ARMOR;
  1329. +   float VIP_OFFSET = VIP::GetVIPOFFSET();
  1330. +   uint32 acctId = GetSession()->GetAccountId();
  1331. +   uint8 Pvip = VIP::GetPlayerVIP(acctId);
  1332. +   float MOD = (Pvip * VIP_OFFSET);
  1333. +  
  1334. +   UnitMods unitMod = UNIT_MOD_ARMOR;
  1335.  
  1336.      float value = GetModifierValue(unitMod, BASE_VALUE);    // base armor (from items)
  1337.      value *= GetModifierValue(unitMod, BASE_PCT);           // armor percent from items
  1338. @@ -259,7 +266,10 @@ void Player::UpdateArmor()
  1339.  
  1340.      value *= GetModifierValue(unitMod, TOTAL_PCT);
  1341.  
  1342. -    SetArmor(int32(value));
  1343. +   uint32 THP = (uint32)value * MOD;
  1344. +   int32 HPMOD = (int32)value + THP;
  1345. +
  1346. +   SetArmor(int32(HPMOD));
  1347.  
  1348.      Pet* pet = GetPet();
  1349.      if (pet)
  1350. @@ -289,14 +299,22 @@ float Player::GetManaBonusFromIntellect()
  1351.  
  1352.  void Player::UpdateMaxHealth()
  1353.  {
  1354. -    UnitMods unitMod = UNIT_MOD_HEALTH;
  1355. +   float VIP_OFFSET = VIP::GetVIPOFFSET();
  1356. +   uint32 acctId = GetSession()->GetAccountId();
  1357. +   uint8 Pvip = VIP::GetPlayerVIP(acctId);
  1358. +   float MOD = (Pvip * VIP_OFFSET);
  1359.  
  1360. -    float value = GetModifierValue(unitMod, BASE_VALUE) + GetCreateHealth();
  1361. -    value *= GetModifierValue(unitMod, BASE_PCT);
  1362. -    value += GetModifierValue(unitMod, TOTAL_VALUE) + GetHealthBonusFromStamina();
  1363. -    value *= GetModifierValue(unitMod, TOTAL_PCT);
  1364. +   UnitMods unitMod = UNIT_MOD_HEALTH;
  1365.  
  1366. -    SetMaxHealth((uint32)value);
  1367. +   float value = GetModifierValue(unitMod, BASE_VALUE) + GetCreateHealth();
  1368. +   value *= GetModifierValue(unitMod, BASE_PCT);
  1369. +   value += GetModifierValue(unitMod, TOTAL_VALUE) + GetHealthBonusFromStamina();
  1370. +   value *= GetModifierValue(unitMod, TOTAL_PCT);
  1371. +
  1372. +   float THP = (uint32)value * MOD;
  1373. +   float HPMOD = (uint32)value + THP;
  1374. +
  1375. +   SetMaxHealth(uint32(HPMOD));
  1376.  }
  1377.  
  1378.  void Player::UpdateMaxPower(Powers power)
  1379. @@ -514,7 +532,12 @@ void Player::UpdateShieldBlockValue()
  1380.  
  1381.  void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, float& minDamage, float& maxDamage)
  1382.  {
  1383. -    UnitMods unitMod;
  1384. +   float VIP_OFFSET = VIP::GetVIPOFFSET();
  1385. +   uint32 acctId = GetSession()->GetAccountId();
  1386. +   uint8 Pvip = VIP::GetPlayerVIP(acctId);
  1387. +   float MOD = (Pvip * VIP_OFFSET);
  1388. +  
  1389. +   UnitMods unitMod;
  1390.  
  1391.      switch (attType)
  1392.      {
  1393. @@ -537,8 +560,8 @@ void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bo
  1394.      float totalValue = GetModifierValue(unitMod, TOTAL_VALUE);
  1395.      float totalPct   = addTotalPct ? GetModifierValue(unitMod, TOTAL_PCT) : 1.0f;
  1396.  
  1397. -    float weaponMinDamage = GetWeaponDamageRange(attType, MINDAMAGE);
  1398. -    float weaponMaxDamage = GetWeaponDamageRange(attType, MAXDAMAGE);
  1399. +   float weaponMinDamage = GetWeaponDamageRange(attType, MINDAMAGE) + (GetWeaponDamageRange(attType, MINDAMAGE) / MOD);
  1400. +   float weaponMaxDamage = GetWeaponDamageRange(attType, MAXDAMAGE) + (GetWeaponDamageRange(attType, MAXDAMAGE) / MOD);
  1401.  
  1402.      if (IsInFeralForm()) // check if player is druid and in cat or bear forms
  1403.      {
  1404. diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp
  1405. index 2922e4e..879de78 100644
  1406. --- a/src/server/game/Scripting/ScriptLoader.cpp
  1407. +++ b/src/server/game/Scripting/ScriptLoader.cpp
  1408. @@ -1409,13 +1409,13 @@ void AddBattlegroundScripts()
  1409.  
  1410.  #ifdef SCRIPTS
  1411.  /* This is where custom scripts' loading functions should be declared. */
  1412. -
  1413. +void AddSC_Grumboz_VIP_Core();
  1414.  #endif
  1415.  
  1416.  void AddCustomScripts()
  1417.  {
  1418.  #ifdef SCRIPTS
  1419.      /* This is where custom scripts should be added. */
  1420. -
  1421. +   AddSC_Grumboz_VIP_Core();
  1422.  #endif
  1423.  }
  1424. diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist
  1425. index 5026721..0ba5cdc 100644
  1426. --- a/src/server/worldserver/worldserver.conf.dist
  1427. +++ b/src/server/worldserver/worldserver.conf.dist
  1428. @@ -3553,3 +3553,92 @@ PacketSpoof.BanDuration = 86400
  1429.  
  1430.  #
  1431.  ###################################################################################################
  1432. +
  1433. +###################################################################################################
  1434. +# Grumbo'z VIP System
  1435. +#
  1436. +# These settings provide a flexibility to the system.
  1437. +#
  1438. +#  
  1439. +#  VIP.MAX
  1440. +#      Description: Max VIP Level for VIP System. max Uint32 value.
  1441. +#      Default:     6
  1442. +#
  1443. +
  1444. +VIP.MAX = 6
  1445. +
  1446. +#  VIP.OFFSET
  1447. +#      Description: float multiplier for each vip rank.
  1448. +#      this is used for stat mod's. i.e. mod = VIP rank * offset.
  1449. +#      Default:     0.05f 5% muliplier used per VIP rank
  1450. +#
  1451. +
  1452. +VIP.OFFSET = 0.05
  1453. +
  1454. +#  VIP.VOTE.ENABE
  1455. +#      Description: Votes can earn higher vip ranks.
  1456. +#      Default: 1 . 0 off // 1 on.
  1457. +#
  1458. +
  1459. +VIP.VOTE_ENABLE = 1
  1460. +
  1461. +#
  1462. +#  VIP.VOTE.COUNT
  1463. +#      Description: how many Votes to earn each level of VIP.
  1464. +#      Default: 125 votes per.
  1465. +#
  1466. +
  1467. +VIP.VOTE_COUNT = 125
  1468. +
  1469. +#
  1470. +#  VIP.COIN
  1471. +#      Description: an item that is clickable to show a players VIP stats
  1472. +#      Default: 63020
  1473. +#
  1474. +
  1475. +
  1476. +VIP.COIN = 63020
  1477. +
  1478. +#
  1479. +#  VIP.STONE
  1480. +#      Description: an item that is clickable and will increase a players VIP level.
  1481. +#      Default: 63021
  1482. +#
  1483. +
  1484. +VIP.STONE =  63021
  1485. +
  1486. +#
  1487. +#  VIP.MAGIC.GOLD
  1488. +#      Description: just Global custom currency id that can be accessed
  1489. +#      by another character via the VIP banker deposit/withdrawal
  1490. +#      Default: 44209
  1491. +#
  1492. +
  1493. +VIP.MAGIC_GOLD = 44209
  1494. +
  1495. +#
  1496. +#  VIP.TP.BONUS
  1497. +#      Description: how many extra TP's to award per VIP level.
  1498. +#      Default: 14 per VIP level.
  1499. +#
  1500. +
  1501. +VIP.TP_BONUS = 14
  1502. +
  1503. +#  VIP.LEVEL_BONUS_ENABE
  1504. +#      Description: players can reach higher levels per VIP..
  1505. +#      Default: 1 . 0 off // 1 on.
  1506. +#
  1507. +
  1508. +VIP.LEVEL_BONUS_ENABLE = 1
  1509. +
  1510. +#
  1511. +#
  1512. +#  VIP.LEVEL_BONUS
  1513. +#      Description: how many extra level's a player can gain  per VIP level.
  1514. +#      Default: 1
  1515. +#
  1516. +
  1517. +VIP.LEVEL_BONUS = 1
  1518. +
  1519. +#
  1520. +###################################################################################################
  1521. -- 3.3.5
Add Comment
Please, Sign In to add comment