Advertisement
Guest User

Untitled

a guest
Apr 18th, 2022
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.91 KB | None | 0 0
  1. /*********************************************************************
  2. * date : 2016.07.16
  3. * file : title.cpp
  4. * author : VegaS
  5. * description :
  6. */
  7. #include "stdafx.h"
  8. #include "constants.h"
  9. #include "utils.h"
  10. #include "desc.h"
  11. #include "char.h"
  12. #include "db.h"
  13. #include "config.h"
  14. #include "title.h"
  15. #include "affect.h"
  16. #include "item.h"
  17. #include "questmanager.h"
  18. /*********************************************************************
  19. */
  20. TitleManager::TitleManager()
  21. {
  22. }
  23.  
  24. TitleManager::~TitleManager()
  25. {
  26. }
  27. /*****************************
  28. * Set requirements gold(yang) for title
  29. */
  30. #define need_gold_1 500000
  31. #define need_gold_2 800000
  32. #define need_gold_3 1500000
  33. #define need_gold_4 1800000
  34. #define need_gold_5 2500000
  35. #define need_gold_6 3000000
  36. #define need_gold_7 4000000
  37. #define need_gold_8 5000000
  38. #define need_gold_9 10000000
  39. #define need_gold_10 15000000
  40. #define need_gold_11 25000000
  41. #define need_gold_12 50000000
  42. #define need_gold_13 75000000
  43. #define need_gold_14 100000000
  44. #define need_gold_15 150000000
  45. #define need_gold_16 300000000
  46.  
  47. /*****************************
  48. * Set requirements level for title
  49. */
  50. #define need_level_1 7
  51. #define need_level_2 14
  52. #define need_level_3 21
  53. #define need_level_4 28
  54. #define need_level_5 35
  55. #define need_level_6 42
  56. #define need_level_7 49
  57. #define need_level_8 56
  58. #define need_level_9 63
  59. #define need_level_10 70
  60. #define need_level_11 77
  61. #define need_level_12 84
  62. #define need_level_13 91
  63. #define need_level_14 98
  64. #define need_level_15 100
  65. #define need_level_16 103
  66.  
  67. /*****************************
  68. * Set requirements level for playTime on character
  69. */
  70. #define need_minutes_1 5
  71. #define need_minutes_2 15
  72. #define need_minutes_3 40
  73. #define need_minutes_4 50
  74. #define need_minutes_5 60
  75. #define need_minutes_6 75
  76. #define need_minutes_7 90
  77. #define need_minutes_8 110
  78. #define need_minutes_9 130
  79. #define need_minutes_10 150
  80. #define need_minutes_11 170
  81. #define need_minutes_12 200
  82. #define need_minutes_13 500
  83. #define need_minutes_14 700
  84. #define need_minutes_15 1200
  85. #define need_minutes_16 1500
  86. #include <boost/unordered_map.hpp>
  87. #include "../../common/stl.h"
  88. /****************************************************************************************************************************************************************************************
  89. * Get enable options
  90. */
  91. #define ENABLE_CHECK_TIME_POTIONS // If you want to make enable check for buy potions with time
  92. //#define ENABLE_GIVE_JCOINS // Enable to give you jcoins loadead from account.account(jcoins [row]) example: if u buy a potion yeelow cost 50coins, when you buy give make: -50 coins and give +50 jcoins
  93.  
  94. int sTitle[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}; // Do not change anything here
  95.  
  96. int x[] = {0, 0, 0}; // Do not change anything here
  97. /****************
  98. * Get type affect on title premium loaded from affect.h ( not change this )
  99. */
  100. int get_affect_premium[] = {PRESTIGE_AFFECT_1, PRESTIGE_AFFECT_2, PRESTIGE_AFFECT_3};
  101.  
  102. /****************
  103. * Settings how hours you need to wait for can buy again potion on shopping-area
  104. */
  105. int sPotionTime[] = {12, 12, 12};
  106. /****************
  107. * ItemVnum for potions to check if u have for attached title premium 1/2/3
  108. */
  109. int sPotionVnum[] = {55001, 55002, 55003};
  110. /****************
  111. * Price potions in coins value loaded from account.account for potion yellow/pink/white
  112. */
  113. int sPotionPrice[] = {50, 100, 150};
  114.  
  115. int sTimeDuratingBonus[] = {60*60*24*365};
  116. /****************
  117. * Table with bonus name affect ( if u want to change bonus you can find in enum EPointTypes on char.h other bonus type )
  118. * If u want you can put automatically value from bonus like - POINTS_ATTBONUS_MONSTER = 63 and , 20 is value for bonus monster apply
  119. */
  120. int pTitleBonus_1[] = {POINT_MAX_HP, 3000};
  121. int pTitleBonus_2[] = {POINT_ATTBONUS_MONSTER, 20};
  122. int pTitleBonus_3[] = {POINT_CRITICAL_PCT, 15};
  123.  
  124. const char* sPotionFlag[] = {"title.getTimePotions_1", "title.getTimePotions_2", "title.getTimePotions_3"}; // Do not change anything here
  125.  
  126. /****************
  127. * Settings for translate
  128. */
  129. const char* requirements[] = {
  130. "[Title System] You must have at least %u yang for this title!",
  131. "[Title System] You must have a minimum level of %u for this title!",
  132. "[Title System] You must have minutes played on character: %u"};
  133. const char* title_translate[] = {
  134. "[Title System] You need to wait %u hour for can buy again a potion!",
  135. "[Title System] You do not have enough coins in your account dragon! Please charge it!",
  136. "[Title System] The bonus premium received the title disappeared !",
  137. "[Title System] Your title has been removed!, received x1 Yellow Potion Enchanted!",
  138. "[Title System] Your title has been removed!, received x1 Pink Potion Enchanted!",
  139. "[Title System] Your title has been removed!, received x1 White Potion Enchanted!",
  140. "[Title System] You do not have a premium title for transforms!",
  141. "[Title System] You have a title premium attached, you cannot make that!",
  142. "[Title System] Already you have this title!",
  143. "[Title System] You must have a x1 Yellow Potion Enchanted!",
  144. "[Title System] You must have a x1 Pink Potion Enchanted!",
  145. "[Title System] You must have a x1 White Potion Enchanted!",
  146. "[Title System] Your title has been removed !"};
  147.  
  148. bool TitleManager::TransformTitle(LPCHARACTER ch)
  149. {
  150. if (NULL == ch)
  151. return false;
  152.  
  153. if (!ch->IsPC())
  154. return false;
  155.  
  156. switch (ch->GetRealTitle())
  157. {
  158. case 17:
  159. if (ch->FindAffect(get_affect_premium[0]))
  160. {
  161. ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[2]);
  162. ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[3]);
  163. ch->RemoveAffect(get_affect_premium[0]);
  164. ch->UpdateTitle(- ch->GetRealTitle());
  165. ch->AutoGiveItem(sPotionVnum[0]);
  166. }
  167. else if (!ch->FindAffect(get_affect_premium[0])){
  168. return false; ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[6]);}
  169. break;
  170. case 18:
  171. if (ch->FindAffect(get_affect_premium[1]))
  172. {
  173. ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[2]);
  174. ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[4]);
  175. ch->RemoveAffect(get_affect_premium[1]);
  176. ch->UpdateTitle(- ch->GetRealTitle());
  177. ch->AutoGiveItem(sPotionVnum[1]);
  178. }
  179. else if (!ch->FindAffect(get_affect_premium[0])){
  180. return false; ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[6]);}
  181. break;
  182. case 19:
  183. if (ch->FindAffect(get_affect_premium[2]))
  184. {
  185. ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[2]);
  186. ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[5]);
  187. ch->RemoveAffect(get_affect_premium[2]);
  188. ch->UpdateTitle(- ch->GetRealTitle());
  189. ch->AutoGiveItem(sPotionVnum[2]);
  190. }
  191. else if (!ch->FindAffect(get_affect_premium[0])){
  192. return false; ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[6]);}
  193. break;
  194. }
  195. }
  196.  
  197. void TitleManager::BuyPotion(LPCHARACTER ch, const char* mPotion)
  198. {
  199. if (NULL == ch)
  200. return;
  201.  
  202. if (!ch->IsPC())
  203. return;
  204.  
  205. if (!*mPotion)
  206. {
  207. return;
  208. }
  209. /****************
  210. * Argument first
  211. */
  212. if (!strcmp(mPotion, "buy_potion_1"))
  213. {
  214. std::unique_ptr<SQLMsg> pMsg(DBManager::instance().DirectQuery("SELECT coins FROM account.account WHERE id = %u", ch->GetDesc()->GetAccountTable().id));
  215. quest::PC* pPC = quest::CQuestManager::instance().GetPC(ch->GetPlayerID());
  216. if (pMsg->Get()->uiNumRows == x[0]) return;
  217. MYSQL_ROW row = mysql_fetch_row(pMsg->Get()->pSQLResult);
  218. str_to_number(x[0], row[0]);
  219. #ifdef ENABLE_CHECK_TIME_POTIONS
  220. int szTime = pPC->GetFlag(sPotionFlag[0]);
  221. if (get_global_time() - szTime < sPotionTime[0] * 60 * 60)
  222. {
  223. ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[0], sPotionTime[2]); return;
  224. }
  225. #endif
  226. if (x[0] < sPotionPrice[0]) {
  227. ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[1]); return; }
  228. else
  229. ch->AutoGiveItem(sPotionVnum[0]);
  230. DBManager::instance().DirectQuery("UPDATE account.account SET coins = coins - %u WHERE id = %u", sPotionPrice[0], ch->GetDesc()->GetAccountTable().id);
  231. #ifdef ENABLE_CHECK_TIME_POTIONS
  232. pPC->SetFlag(sPotionFlag[0], get_global_time());
  233. #endif
  234.  
  235. #ifdef ENABLE_GIVE_JCOINS
  236. DBManager::instance().DirectQuery("UPDATE account.account SET jcoins = jcoins + %u WHERE id = %u", sPotionPrice[0], ch->GetDesc()->GetAccountTable().id);
  237. #endif
  238. }
  239. //}
  240. /****************
  241. * Argument two
  242. */
  243. if (!strcmp(mPotion, "buy_potion_2"))
  244. {
  245. std::unique_ptr<SQLMsg> pMsg(DBManager::instance().DirectQuery("SELECT coins FROM account.account WHERE id = %u", ch->GetDesc()->GetAccountTable().id));
  246. quest::PC* pPC = quest::CQuestManager::instance().GetPC(ch->GetPlayerID());
  247. if (pMsg->Get()->uiNumRows == x[1]) return;
  248. MYSQL_ROW row = mysql_fetch_row(pMsg->Get()->pSQLResult);
  249. str_to_number(x[1], row[0]);
  250. #ifdef ENABLE_CHECK_TIME_POTIONS
  251. int szTime = pPC->GetFlag(sPotionFlag[0]);
  252. if (get_global_time() - szTime < sPotionTime[0] * 60 * 60)
  253. {
  254. ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[0], sPotionTime[2]); return;
  255. }
  256. #endif
  257. if (x[1] < sPotionPrice[1]) {
  258. ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[1]); return; }
  259. else
  260. ch->AutoGiveItem(sPotionVnum[1]);
  261. DBManager::instance().DirectQuery("UPDATE account.account SET coins = coins - %u WHERE id = %u", sPotionPrice[1], ch->GetDesc()->GetAccountTable().id);
  262. #ifdef ENABLE_CHECK_TIME_POTIONS
  263. pPC->SetFlag(sPotionFlag[1], get_global_time());
  264. #endif
  265.  
  266. #ifdef ENABLE_GIVE_JCOINS
  267. DBManager::instance().DirectQuery("UPDATE account.account SET jcoins = jcoins + %u WHERE id = %u", sPotionPrice[1], ch->GetDesc()->GetAccountTable().id);
  268. #endif
  269. }
  270. //}
  271. /****************
  272. * Argument three
  273. */
  274. if (!strcmp(mPotion, "buy_potion_3"))
  275. {
  276. std::unique_ptr<SQLMsg> pMsg(DBManager::instance().DirectQuery("SELECT coins FROM account.account WHERE id = %u", ch->GetDesc()->GetAccountTable().id));
  277. quest::PC* pPC = quest::CQuestManager::instance().GetPC(ch->GetPlayerID());
  278. if (pMsg->Get()->uiNumRows == x[2]) return;
  279. MYSQL_ROW row = mysql_fetch_row(pMsg->Get()->pSQLResult);
  280. str_to_number(x[2], row[0]);
  281. #ifdef ENABLE_CHECK_TIME_POTIONS
  282. int szTime = pPC->GetFlag(sPotionFlag[0]);
  283. if (get_global_time() - szTime < sPotionTime[0] * 60 * 60)
  284. {
  285. ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[0], sPotionTime[2]); return;
  286. }
  287. #endif
  288. if (x[2] < sPotionPrice[2]) {
  289. ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[1]); return; }
  290. else
  291. ch->AutoGiveItem(sPotionVnum[2]);
  292. DBManager::instance().DirectQuery("UPDATE account.account SET coins = coins - %u WHERE id = %u", sPotionPrice[2], ch->GetDesc()->GetAccountTable().id);
  293. #ifdef ENABLE_CHECK_TIME_POTIONS
  294. pPC->SetFlag(sPotionFlag[0], get_global_time());
  295. #endif
  296.  
  297. #ifdef ENABLE_GIVE_JCOINS
  298. DBManager::instance().DirectQuery("UPDATE account.account SET jcoins = jcoins + %u WHERE id = %u", sPotionPrice[2], ch->GetDesc()->GetAccountTable().id);
  299. #endif
  300. }
  301. }
  302.  
  303. static bool GetPlayTime(LPCHARACTER ch, int sTime)
  304. {
  305. if (NULL == ch)
  306. return false;
  307.  
  308. if (!ch->IsPC())
  309. return false;
  310.  
  311. if (ch->GetRealPoint(POINT_PLAYTIME) < sTime)
  312. {
  313. switch (sTime)
  314. {
  315. case need_minutes_1: case need_minutes_2: case need_minutes_3: case need_minutes_4:
  316. case need_minutes_5: case need_minutes_6: case need_minutes_7: case need_minutes_8:
  317. case need_minutes_9: case need_minutes_10: case need_minutes_11: case need_minutes_12:
  318. case need_minutes_13: case need_minutes_14: case need_minutes_15: case need_minutes_16:
  319. ch->ChatPacket(CHAT_TYPE_NOTICE, requirements[2], sTime);
  320. return false;
  321. }
  322. }
  323. return true;
  324. }
  325.  
  326. static bool GetLevel(LPCHARACTER ch, int sLevel)
  327. {
  328. if (NULL == ch)
  329. return false;
  330.  
  331. if (!ch->IsPC())
  332. return false;
  333.  
  334. if (ch->GetLevel() < sLevel)
  335. {
  336. switch (sLevel)
  337. {
  338. case need_level_1: case need_level_2: case need_level_3: case need_level_4:
  339. case need_level_5: case need_level_6: case need_level_7: case need_level_8:
  340. case need_level_9: case need_level_10: case need_level_11: case need_level_12:
  341. case need_level_13: case need_level_14: case need_level_15: case need_level_16:
  342. ch->ChatPacket(CHAT_TYPE_NOTICE, requirements[1], sLevel);
  343. return false;
  344. }
  345. }
  346. return true;
  347. }
  348.  
  349. static bool GetMoney(LPCHARACTER ch, int sGold)
  350. {
  351. if (NULL == ch)
  352. return false;
  353.  
  354. if (!ch->IsPC())
  355. return false;
  356.  
  357. if (ch->GetGold() < sGold)
  358. {
  359. switch (sGold)
  360. {
  361. case need_gold_1: case need_gold_2: case need_gold_3: case need_gold_4:
  362. case need_gold_5: case need_gold_6: case need_gold_7: case need_gold_8:
  363. case need_gold_9: case need_gold_10: case need_gold_11: case need_gold_12:
  364. case need_gold_13: case need_gold_14: case need_gold_15: case need_gold_16:
  365. ch->ChatPacket(CHAT_TYPE_NOTICE, requirements[0], sGold);
  366. return false;
  367. }
  368. }
  369. return true;
  370. }
  371.  
  372. static bool GetTitlePremium(LPCHARACTER ch)
  373. {
  374. if (NULL == ch)
  375. return false;
  376.  
  377. if (!ch->IsPC())
  378. return false;
  379.  
  380. switch (ch->GetRealTitle())
  381. {
  382. case 17:
  383. case 18:
  384. case 19:
  385. ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[7]);
  386. return false;
  387. }
  388. return true;
  389. }
  390.  
  391. static bool GetTitleActual(LPCHARACTER ch, int arg1)
  392. {
  393. if (NULL == ch)
  394. return false;
  395.  
  396. if (!ch->IsPC())
  397. return false;
  398.  
  399. if (ch->GetRealTitle() == arg1)
  400. {
  401. switch (arg1)
  402. {
  403. case 1: case 2: case 3: case 4:
  404. case 5: case 6: case 7: case 8:
  405. case 9: case 10: case 11: case 12:
  406. case 13: case 14: case 15: case 16:
  407. case 17: case 18: case 19:
  408. ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[8]);
  409. return false;
  410. }
  411. }
  412. return true;
  413. }
  414.  
  415. bool TitleManager::UpdateTitle(LPCHARACTER ch, int changeTitle, int changeMoney)
  416. {
  417. if (changeTitle > 0 && changeMoney > 0)
  418. {
  419. ch->UpdateTitle(changeTitle - ch->GetTitle());
  420. ch->PointChange(POINT_GOLD, - changeMoney);
  421. }
  422. else if (changeTitle > 0 && changeMoney < 1)
  423. {
  424. ch->UpdateTitle(changeTitle - ch->GetTitle());
  425. }
  426. }
  427.  
  428. void TitleManager::SetAffect(LPCHARACTER ch, const char* valueAffect)
  429. {
  430. if (NULL == ch)
  431. return;
  432.  
  433. if (!ch->IsPC())
  434. return;
  435. /****************
  436. * [Premium Title I]
  437. */
  438. if (!strcmp(valueAffect, "send_premium_1"))
  439. {
  440. if (ch->CountSpecifyItem(sPotionVnum[0]))
  441. {
  442. ch->AddAffect(get_affect_premium[0], pTitleBonus_1[0], pTitleBonus_1[1], 0, sTimeDuratingBonus[0], 0, true);
  443. ch->RemoveSpecifyItem(sPotionVnum[0], 1);
  444. UpdateTitle(ch, sTitle[17], 0);
  445. }
  446. else
  447. ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[9]);
  448. return;
  449. }
  450. /****************
  451. * [Premium Title II]
  452. */
  453. if (!strcmp(valueAffect, "send_premium_2"))
  454. {
  455. if (ch->CountSpecifyItem(sPotionVnum[1]))
  456. {
  457. ch->AddAffect(get_affect_premium[1], pTitleBonus_2[0], pTitleBonus_2[1], 0, sTimeDuratingBonus[0], 0, true);
  458. ch->RemoveSpecifyItem(sPotionVnum[1], 1);
  459. UpdateTitle(ch, sTitle[18], 0);
  460. }
  461. else
  462. ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[10]);
  463. return;
  464. }
  465. /****************
  466. * [Premium Title III]
  467. */
  468. if (!strcmp(valueAffect, "send_premium_3"))
  469. {
  470. if (ch->CountSpecifyItem(sPotionVnum[2]))
  471. {
  472. ch->AddAffect(get_affect_premium[2], pTitleBonus_3[0], pTitleBonus_3[1], 0, sTimeDuratingBonus[0], 0, true);
  473. ch->RemoveSpecifyItem(sPotionVnum[2], 1);
  474. UpdateTitle(ch, sTitle[19], 0);
  475. }
  476. else
  477. ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[11]);
  478. return;
  479. }
  480. }
  481. bool TitleManager::SetTitle(LPCHARACTER ch, const char* pTitle)
  482. {
  483. if (NULL == ch)
  484. return false;
  485.  
  486. if (!ch->IsPC())
  487. return false;
  488.  
  489. if (!*pTitle)
  490. {
  491. return false;
  492. }
  493. /****************
  494. * Title free
  495. */
  496. if (!strcmp(pTitle, "disable") && (GetTitleActual(ch, sTitle[17]) == true) && (GetTitleActual(ch, sTitle[18]) == true) && (GetTitleActual(ch, sTitle[19]) == true))
  497. {
  498. ch->UpdateTitle(- ch->GetTitle());
  499. ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[12]);
  500. }
  501.  
  502. if (!strcmp(pTitle, "title1") && (GetLevel(ch, need_level_1) == true) && (GetPlayTime(ch, need_minutes_1) == true) && (GetMoney(ch, need_gold_1) == true) && (GetTitlePremium(ch) == true) && (GetTitleActual(ch, sTitle[1]) == true))
  503. {
  504. UpdateTitle(ch, sTitle[1], need_gold_1);
  505. }
  506.  
  507. if (!strcmp(pTitle, "title2") && (GetLevel(ch, need_level_2) == true) && (GetPlayTime(ch, need_minutes_2) == true) && (GetMoney(ch, need_gold_2) == true) && (GetTitlePremium(ch) == true) && (GetTitleActual(ch, sTitle[2]) == true))
  508. {
  509. UpdateTitle(ch, sTitle[2], need_gold_2);
  510. }
  511.  
  512. if (!strcmp(pTitle, "title3") && (GetLevel(ch, need_level_3) == true) && (GetPlayTime(ch, need_minutes_3) == true) && (GetMoney(ch, need_gold_3) == true) && (GetTitlePremium(ch) == true) && (GetTitleActual(ch, sTitle[3]) == true))
  513. {
  514. UpdateTitle(ch, sTitle[3], need_gold_3);
  515. }
  516.  
  517. if (!strcmp(pTitle, "title4") && (GetLevel(ch, need_level_4) == true) && (GetPlayTime(ch, need_minutes_4) == true) && (GetMoney(ch, need_gold_4) == true) && (GetTitlePremium(ch) == true) && (GetTitleActual(ch, sTitle[4]) == true))
  518. {
  519. UpdateTitle(ch, sTitle[4], need_gold_4);
  520. }
  521.  
  522. if (!strcmp(pTitle, "title5") && (GetLevel(ch, need_level_5) == true) && (GetPlayTime(ch, need_minutes_5) == true) && (GetMoney(ch, need_gold_5) == true) && (GetTitlePremium(ch) == true) && (GetTitleActual(ch, sTitle[5]) == true))
  523. {
  524. UpdateTitle(ch, sTitle[5], need_gold_5);
  525. }
  526.  
  527. if (!strcmp(pTitle, "title6") && (GetLevel(ch, need_level_6) == true) && (GetPlayTime(ch, need_minutes_6) == true) && (GetMoney(ch, need_gold_6) == true) && (GetTitlePremium(ch) == true) && (GetTitleActual(ch, sTitle[6]) == true))
  528. {
  529. UpdateTitle(ch, sTitle[6], need_gold_6);
  530. }
  531.  
  532. if (!strcmp(pTitle, "title7") && (GetLevel(ch, need_level_7) == true) && (GetPlayTime(ch, need_minutes_7) == true) && (GetMoney(ch, need_gold_7) == true) && (GetTitlePremium(ch) == true) && (GetTitleActual(ch, sTitle[7]) == true))
  533. {
  534. UpdateTitle(ch, sTitle[7], need_gold_7);
  535. }
  536.  
  537. if (!strcmp(pTitle, "title8") && (GetLevel(ch, need_level_8) == true) && (GetPlayTime(ch, need_minutes_8) == true) && (GetMoney(ch, need_gold_8) == true) && (GetTitlePremium(ch) == true) && (GetTitleActual(ch, sTitle[8]) == true))
  538. {
  539. UpdateTitle(ch, sTitle[8], need_gold_8);
  540. }
  541.  
  542. if (!strcmp(pTitle, "title9") && (GetLevel(ch, need_level_9) == true) && (GetPlayTime(ch, need_minutes_9) == true) && (GetMoney(ch, need_gold_9) == true) && (GetTitlePremium(ch) == true) && (GetTitleActual(ch, sTitle[9]) == true))
  543. {
  544. UpdateTitle(ch, sTitle[9], need_gold_9);
  545. }
  546.  
  547. if (!strcmp(pTitle, "title10") && (GetLevel(ch, need_level_10) == true) && (GetPlayTime(ch, need_minutes_10) == true) && (GetMoney(ch, need_gold_10) == true) && (GetTitlePremium(ch) == true) && (GetTitleActual(ch, sTitle[10]) == true))
  548. {
  549. UpdateTitle(ch, sTitle[10], need_gold_10);
  550. }
  551.  
  552. if (!strcmp(pTitle, "title11") && (GetLevel(ch, need_level_11) == true) && (GetPlayTime(ch, need_minutes_11) == true) && (GetMoney(ch, need_gold_11) == true) && (GetTitlePremium(ch) == true) && (GetTitleActual(ch, sTitle[11]) == true))
  553. {
  554. UpdateTitle(ch, sTitle[11], need_gold_11);
  555. }
  556.  
  557. if (!strcmp(pTitle, "title12") && (GetLevel(ch, need_level_12) == true) && (GetPlayTime(ch, need_minutes_12) == true) && (GetMoney(ch, need_gold_12) == true) && (GetTitlePremium(ch) == true) && (GetTitleActual(ch, sTitle[12]) == true))
  558. {
  559. UpdateTitle(ch, sTitle[12], need_gold_12);
  560. }
  561.  
  562. if (!strcmp(pTitle, "title13") && (GetLevel(ch, need_level_13) == true) && (GetPlayTime(ch, need_minutes_13) == true) && (GetMoney(ch, need_gold_13) == true) && (GetTitlePremium(ch) == true) && (GetTitleActual(ch, sTitle[13]) == true))
  563. {
  564. UpdateTitle(ch, sTitle[13], need_gold_13);
  565. }
  566.  
  567. if (!strcmp(pTitle, "title14") && (GetLevel(ch, need_level_14) == true) && (GetPlayTime(ch, need_minutes_14) == true) && (GetMoney(ch, need_gold_14) == true) && (GetTitlePremium(ch) == true) && (GetTitleActual(ch, sTitle[14]) == true))
  568. {
  569. UpdateTitle(ch, sTitle[14], need_gold_14);
  570. }
  571.  
  572. if (!strcmp(pTitle, "title15") && (GetLevel(ch, need_level_15) == true) && (GetPlayTime(ch, need_minutes_15) == true) && (GetMoney(ch, need_gold_15) == true) && (GetTitlePremium(ch) == true) && (GetTitleActual(ch, sTitle[15]) == true))
  573. {
  574. UpdateTitle(ch, sTitle[15], need_gold_15);
  575. }
  576.  
  577. if (!strcmp(pTitle, "title16") && (GetLevel(ch, need_level_16) == true) && (GetPlayTime(ch, need_minutes_16) == true) && (GetMoney(ch, need_gold_16) == true) && (GetTitlePremium(ch) == true) && (GetTitleActual(ch, sTitle[16]) == true))
  578. {
  579. UpdateTitle(ch, sTitle[16], need_gold_16);
  580. }
  581. /****************
  582. * Title premium
  583. */
  584. if (!strcmp(pTitle, "title17") && (GetTitlePremium(ch) == true))
  585. {
  586. SetAffect(ch, "send_premium_1");
  587. }
  588.  
  589. if (!strcmp(pTitle, "title18") && (GetTitlePremium(ch) == true))
  590. {
  591. SetAffect(ch, "send_premium_2");
  592. }
  593.  
  594. if (!strcmp(pTitle, "title19") && (GetTitlePremium(ch) == true))
  595. {
  596. SetAffect(ch, "send_premium_3");
  597. }
  598. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement