Advertisement
Guest User

Untitled

a guest
Sep 5th, 2021
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 21.80 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     1000
  31. #define need_gold_2     2000
  32. #define need_gold_3     3000
  33. #define need_gold_4     4000
  34. #define need_gold_5     5000
  35. #define need_gold_6     6000
  36. #define need_gold_7     7000
  37. #define need_gold_8     8000
  38. #define need_gold_9     9000
  39. #define need_gold_10    10000
  40. #define need_gold_11    11000
  41. #define need_gold_12    12000
  42. #define need_gold_13    13000
  43. #define need_gold_14    14000
  44. #define need_gold_15    15000
  45. #define need_gold_16    20000
  46.  
  47. /*****************************
  48. * Set requirements level for title
  49. */
  50. #define need_level_1    10
  51. #define need_level_2    15
  52. #define need_level_3    20
  53. #define need_level_4    30
  54. #define need_level_5    40
  55. #define need_level_6    50
  56. #define need_level_7    70
  57. #define need_level_8    90
  58. #define need_level_9    110
  59. #define need_level_10   130
  60. #define need_level_11   150
  61. #define need_level_12   170
  62. #define need_level_13   190
  63. #define need_level_14   210
  64. #define need_level_15   230
  65. #define need_level_16   250
  66.  
  67. /*****************************
  68. * Set requirements level for playTime on character
  69. */
  70. #define need_minutes_1  500
  71. #define need_minutes_2  550
  72. #define need_minutes_3  600
  73. #define need_minutes_4  650
  74. #define need_minutes_5  700
  75. #define need_minutes_6  750
  76. #define need_minutes_7  800
  77. #define need_minutes_8  850
  78. #define need_minutes_9  900
  79. #define need_minutes_10 1000
  80. #define need_minutes_11 1100
  81. #define need_minutes_12 1200
  82. #define need_minutes_13 1300
  83. #define need_minutes_14 1400
  84. #define need_minutes_15 1500
  85. #define need_minutes_16 1650   
  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[] = {2, 2, 2};
  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[] = {600, 601, 602};
  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, 2000};
  121. int pTitleBonus_2[] = {POINT_ATTBONUS_HUMAN, 10};
  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.                                     "[Σύστημα Τίτλων] Χρειάζεστε τουλάχιστον %u yang γι'αυτόν τον τίτλο!",
  131.                                     "[Σύστημα Τίτλων] Πρέπει να είστε ελάχιστο επίπεδο %u γι'αυτόν τον τίτλο!",
  132.                                     "[Σύστημα Τίτλων] Απαιτούμενα λεπτά παιχνιδιού: %u"};                           
  133. const char* title_translate[] = {
  134.                                     "[Σύστημα Τίτλων] Χρειάζεται να περιμενέτε %u ώρες ώστε να μπορείτε να αγοράσετε ξανά ένα φίλτρο!",
  135.                                     "[Σύστημα Τίτλων] Δεν έχετε αρκετά νομίσματα γι'αυτόν τον τίτλο!",
  136.                                     "[Σύστημα Τίτλων] The bonus premium received the title disappeared !",
  137.                                     "[Σύστημα Τίτλων] Ο τίτλος σας διαγράφτηκε!, Λάβατε πίσω x1 μαγικό κίτρινο φίλτρο!",
  138.                                     "[Σύστημα Τίτλων] Ο τίτλος σας διαγράφτηκε!, Λάβατε πίσω x1 μαγικό ροζ φίλτρο!",                        
  139.                                     "[Σύστημα Τίτλων] Ο τίτλος σας διαγράφτηκε!, Λάβατε πίσω x1 μαγικό άσπρο φίλτρο!",
  140.                                     "[Σύστημα Τίτλων] Δεν έχετε στη κατοχή σας ένα τίτλο premium ώστε να κάνετε μετατροπή!",
  141.                                     "[Σύστημα Τίτλων] Έχετε ήδη ένα τίτλο premium. Δε μπορείτε να το κάνετε αυτό!",
  142.                                     "[Σύστημα Τίτλων] Έχετε ήδη αυτόν τον τίτλο!",
  143.                                     "[Σύστημα Τίτλων] Πρέπει να έχετε x1 μαγικό κίτρινο φίλτρο!",
  144.                                     "[Σύστημα Τίτλων] Πρέπει να έχετε x1 μαγικό ροζ φίλτρο!",
  145.                                     "[Σύστημα Τίτλων] Πρέπει να έχετε x1 μαγικό άσπρο φίλτρο!",
  146.                                     "[Σύστημα Τίτλων] Ο τίτλος σας διαγράφτηκε!"};                       
  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.             {
  169.                 ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[6]);
  170.                 return false;
  171.             }
  172.             break;
  173.         case 18:   
  174.             if (ch->FindAffect(get_affect_premium[1]))
  175.             {
  176.                 ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[2]);      
  177.                 ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[4]);
  178.                 ch->RemoveAffect(get_affect_premium[1]);   
  179.                 ch->UpdateTitle(- ch->GetRealTitle());
  180.                 ch->AutoGiveItem(sPotionVnum[1]);  
  181.             }
  182.             else if (!ch->FindAffect(get_affect_premium[0])){
  183.                 ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[6]);
  184.                 return false;
  185.             }
  186.             break;
  187.         case 19:   
  188.             if (ch->FindAffect(get_affect_premium[2]))
  189.             {
  190.                 ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[2]);      
  191.                 ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[5]);
  192.                 ch->RemoveAffect(get_affect_premium[2]);   
  193.                 ch->UpdateTitle(- ch->GetRealTitle());
  194.                 ch->AutoGiveItem(sPotionVnum[2]);  
  195.             }
  196.             else if (!ch->FindAffect(get_affect_premium[0])){
  197.                 ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[6]);
  198.                 return false;
  199.             }
  200.             break;
  201.     }
  202.     return true;
  203. }
  204.  
  205.  
  206. void TitleManager::BuyPotion(LPCHARACTER ch, const char* mPotion)
  207. {
  208.     if (NULL == ch)
  209.         return;
  210.  
  211.     if (!ch->IsPC())
  212.         return;
  213.  
  214.     if (!*mPotion)
  215.     {  
  216.         return;
  217.     }
  218. /****************
  219. * Argument first
  220. */
  221.     if (!strcmp(mPotion, "buy_potion_1"))
  222.     {  
  223.         std::auto_ptr<SQLMsg> pMsg(DBManager::instance().DirectQuery("SELECT coins FROM account.account WHERE id = %u", ch->GetDesc()->GetAccountTable().id));
  224.         quest::PC* pPC = quest::CQuestManager::instance().GetPC(ch->GetPlayerID());
  225.         if (pMsg->Get()->uiNumRows == x[0])return;
  226.             MYSQL_ROW row = mysql_fetch_row(pMsg->Get()->pSQLResult);
  227.             str_to_number(x[0], row[0]);
  228.     #ifdef ENABLE_CHECK_TIME_POTIONS       
  229.         int szTime = pPC->GetFlag(sPotionFlag[0]);
  230.         if (get_global_time() - szTime < sPotionTime[0] * 60 * 60) 
  231.         {  
  232.             ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[0], sPotionTime[2]);  
  233.             return;
  234.         }      
  235.     #endif 
  236.         if (x[0] < sPotionPrice[0])
  237.         {
  238.             ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[1]);  
  239.             return;
  240.         }
  241.         else
  242.         {
  243.             ch->AutoGiveItem(sPotionVnum[0]);
  244.             DBManager::instance().DirectQuery("UPDATE account.account SET coins = coins - %u WHERE id = %u", sPotionPrice[0], ch->GetDesc()->GetAccountTable().id);
  245.         #ifdef ENABLE_CHECK_TIME_POTIONS
  246.             pPC->SetFlag(sPotionFlag[0], get_global_time());
  247.         #endif
  248.  
  249.         #ifdef ENABLE_GIVE_JCOINS
  250.             DBManager::instance().DirectQuery("UPDATE account.account SET jcoins = jcoins + %u WHERE id = %u", sPotionPrice[0], ch->GetDesc()->GetAccountTable().id);
  251.         #endif
  252.         }
  253.     }
  254. //}    
  255. /****************
  256. * Argument two
  257. */
  258.     if (!strcmp(mPotion, "buy_potion_2"))
  259.     {
  260.         std::auto_ptr<SQLMsg> pMsg(DBManager::instance().DirectQuery("SELECT coins FROM account.account WHERE id = %u", ch->GetDesc()->GetAccountTable().id));
  261.         quest::PC* pPC = quest::CQuestManager::instance().GetPC(ch->GetPlayerID());
  262.         if (pMsg->Get()->uiNumRows == x[1]) return;
  263.             MYSQL_ROW row = mysql_fetch_row(pMsg->Get()->pSQLResult);
  264.             str_to_number(x[1], row[0]);
  265.     #ifdef ENABLE_CHECK_TIME_POTIONS       
  266.         int szTime = pPC->GetFlag(sPotionFlag[0]);
  267.         if (get_global_time() - szTime < sPotionTime[0] * 60 * 60) 
  268.         {  
  269.             ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[0], sPotionTime[2]);  
  270.             return;
  271.         }      
  272.     #endif 
  273.         if (x[1] < sPotionPrice[1])
  274.         {
  275.             ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[1]);  
  276.             return;
  277.         }
  278.         else
  279.         {
  280.             ch->AutoGiveItem(sPotionVnum[1]);
  281.             DBManager::instance().DirectQuery("UPDATE account.account SET coins = coins - %u WHERE id = %u", sPotionPrice[1], ch->GetDesc()->GetAccountTable().id);
  282.         #ifdef ENABLE_CHECK_TIME_POTIONS
  283.             pPC->SetFlag(sPotionFlag[1], get_global_time());
  284.         #endif
  285.  
  286.         #ifdef ENABLE_GIVE_JCOINS
  287.             DBManager::instance().DirectQuery("UPDATE account.account SET jcoins = jcoins + %u WHERE id = %u", sPotionPrice[1], ch->GetDesc()->GetAccountTable().id);
  288.         #endif
  289.         }
  290.     }
  291. //}
  292. /****************
  293. * Argument three
  294. */
  295.     if (!strcmp(mPotion, "buy_potion_3"))
  296.     {
  297.         std::auto_ptr<SQLMsg> pMsg(DBManager::instance().DirectQuery("SELECT coins FROM account.account WHERE id = %u", ch->GetDesc()->GetAccountTable().id));
  298.         quest::PC* pPC = quest::CQuestManager::instance().GetPC(ch->GetPlayerID());
  299.         if (pMsg->Get()->uiNumRows == x[2]) return;
  300.             MYSQL_ROW row = mysql_fetch_row(pMsg->Get()->pSQLResult);
  301.             str_to_number(x[2], row[0]);
  302.     #ifdef ENABLE_CHECK_TIME_POTIONS
  303.         int szTime = pPC->GetFlag(sPotionFlag[0]);
  304.         if (get_global_time() - szTime < sPotionTime[0] * 60 * 60)
  305.         {  
  306.             ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[0], sPotionTime[2]);
  307.             return;
  308.         }
  309.     #endif
  310.         if (x[2] < sPotionPrice[2])
  311.         {
  312.             ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[1]);
  313.             return;
  314.         }
  315.         else
  316.         {
  317.             ch->AutoGiveItem(sPotionVnum[2]);
  318.             DBManager::instance().DirectQuery("UPDATE account.account SET coins = coins - %u WHERE id = %u", sPotionPrice[2], ch->GetDesc()->GetAccountTable().id);
  319.         #ifdef ENABLE_CHECK_TIME_POTIONS
  320.             pPC->SetFlag(sPotionFlag[0], get_global_time());
  321.         #endif
  322.  
  323.         #ifdef ENABLE_GIVE_JCOINS
  324.             DBManager::instance().DirectQuery("UPDATE account.account SET jcoins = jcoins + %u WHERE id = %u", sPotionPrice[2], ch->GetDesc()->GetAccountTable().id);
  325.         #endif
  326.         }
  327.     }
  328. }
  329.  
  330. static bool GetPlayTime(LPCHARACTER ch, int sTime)
  331. {
  332.     if (NULL == ch)
  333.         return false;
  334.  
  335.     if (!ch->IsPC())
  336.         return false;
  337.  
  338.     if (ch->GetRealPoint(POINT_PLAYTIME) < sTime)
  339.     {
  340.         switch (sTime)
  341.         {
  342.             case need_minutes_1:        case need_minutes_2:    case need_minutes_3:    case need_minutes_4:
  343.             case need_minutes_5:        case need_minutes_6:    case need_minutes_7:    case need_minutes_8:
  344.             case need_minutes_9:        case need_minutes_10:   case need_minutes_11:   case need_minutes_12:
  345.             case need_minutes_13:       case need_minutes_14:   case need_minutes_15:   case need_minutes_16:
  346.                 ch->ChatPacket(CHAT_TYPE_NOTICE, requirements[2], sTime);
  347.                 return false;  
  348.         }
  349.     }
  350.     return true;
  351. }
  352.  
  353. static bool GetLevel(LPCHARACTER ch, int sLevel)
  354. {
  355.     if (NULL == ch)
  356.         return false;
  357.  
  358.     if (!ch->IsPC())
  359.         return false;
  360.    
  361.     if (ch->GetLevel() < sLevel)
  362.     {
  363.         switch (sLevel)
  364.         {
  365.             case need_level_1:      case need_level_2:  case need_level_3:  case need_level_4:
  366.             case need_level_5:      case need_level_6:  case need_level_7:  case need_level_8:
  367.             case need_level_9:      case need_level_10: case need_level_11: case need_level_12:
  368.             case need_level_13:     case need_level_14: case need_level_15: case need_level_16:
  369.                 ch->ChatPacket(CHAT_TYPE_NOTICE, requirements[1], sLevel);
  370.                 return false;
  371.         }
  372.     }
  373.     return true;
  374. }
  375.  
  376. static bool GetMoney(LPCHARACTER ch, int sGold)
  377. {
  378.     if (NULL == ch)
  379.         return false;
  380.  
  381.     if (!ch->IsPC())
  382.         return false;
  383.    
  384.     if (ch->GetGold() < sGold)
  385.     {
  386.         switch (sGold)
  387.         {
  388.             case need_gold_1:   case need_gold_2:   case need_gold_3:   case need_gold_4:
  389.             case need_gold_5:   case need_gold_6:   case need_gold_7:   case need_gold_8:
  390.             case need_gold_9:   case need_gold_10:  case need_gold_11:  case need_gold_12:
  391.             case need_gold_13:  case need_gold_14:  case need_gold_15:  case need_gold_16:
  392.                 ch->ChatPacket(CHAT_TYPE_NOTICE, requirements[0], sGold);
  393.                 return false;
  394.         }
  395.     }
  396.     return true;
  397. }
  398.  
  399. static bool GetTitlePremium(LPCHARACTER ch)
  400. {
  401.     if (NULL == ch)
  402.         return false;
  403.  
  404.     if (!ch->IsPC())
  405.         return false;
  406.    
  407.     switch (ch->GetRealTitle())
  408.     {
  409.         case 17:
  410.         case 18:
  411.         case 19:
  412.             ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[7]);
  413.             return false;
  414.     }
  415.     return true;
  416. }
  417.  
  418. static bool GetTitleActual(LPCHARACTER ch, int arg1)
  419. {
  420.     if (NULL == ch)
  421.         return false;
  422.  
  423.     if (!ch->IsPC())
  424.         return false;
  425.    
  426.     if (ch->GetRealTitle() == arg1)
  427.     {
  428.         switch (arg1)
  429.         {
  430.             case 1:     case 2:     case 3:     case 4:
  431.             case 5:     case 6:     case 7:     case 8:
  432.             case 9:     case 10:    case 11:    case 12:   
  433.             case 13:    case 14:    case 15:    case 16:   
  434.             case 17:    case 18:    case 19:           
  435.                 ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[8]);
  436.                 return false;
  437.         }
  438.     }
  439.     return true;
  440. }
  441.  
  442. void TitleManager::UpdateTitle(LPCHARACTER ch, int changeTitle, int changeMoney)
  443. {
  444.     if (changeTitle > 0 && changeMoney > 0)
  445.     {
  446.         ch->UpdateTitle(changeTitle - ch->GetTitle());
  447.         ch->PointChange(POINT_GOLD, - changeMoney);
  448.     }
  449.     else if (changeTitle > 0 && changeMoney < 1)
  450.     {
  451.         ch->UpdateTitle(changeTitle - ch->GetTitle());
  452.     }
  453. }
  454.  
  455. void TitleManager::SetAffect(LPCHARACTER ch, const char* valueAffect)
  456. {
  457.     if (NULL == ch)
  458.         return;
  459.  
  460.     if (!ch->IsPC())
  461.         return;
  462. /****************
  463. * [Premium Title I]
  464. */             
  465.     if (!strcmp(valueAffect, "send_premium_1"))
  466.     {
  467.         if (ch->CountSpecifyItem(sPotionVnum[0]))
  468.         {  
  469.             ch->AddAffect(get_affect_premium[0], pTitleBonus_1[0], pTitleBonus_1[1], 0, sTimeDuratingBonus[0], 0, true);
  470.             ch->RemoveSpecifyItem(sPotionVnum[0], 1);  
  471.             UpdateTitle(ch, sTitle[17], 0);
  472.         }
  473.         else
  474.         {
  475.             ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[9]);
  476.             return;
  477.         }
  478.     }
  479. /****************
  480. * [Premium Title II]
  481. */     
  482.     if (!strcmp(valueAffect, "send_premium_2"))
  483.     {
  484.         if (ch->CountSpecifyItem(sPotionVnum[1]))
  485.         {      
  486.             ch->AddAffect(get_affect_premium[1], pTitleBonus_2[0], pTitleBonus_2[1], 0, sTimeDuratingBonus[0], 0, true);
  487.             ch->RemoveSpecifyItem(sPotionVnum[1], 1);  
  488.             UpdateTitle(ch, sTitle[18], 0);
  489.         }
  490.         else
  491.         {
  492.             ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[10]);
  493.             return;
  494.         }
  495.     }
  496. /****************
  497. * [Premium Title III]
  498. */     
  499.     if (!strcmp(valueAffect, "send_premium_3"))
  500.     {
  501.         if (ch->CountSpecifyItem(sPotionVnum[2]))
  502.         {      
  503.                 ch->AddAffect(get_affect_premium[2], pTitleBonus_3[0], pTitleBonus_3[1], 0, sTimeDuratingBonus[0], 0, true);
  504.                 ch->RemoveSpecifyItem(sPotionVnum[2], 1);  
  505.                 UpdateTitle(ch, sTitle[19], 0);
  506.         }
  507.         else
  508.         {
  509.             ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[11]);
  510.             return;
  511.         }
  512.     }
  513. }
  514.  
  515. bool TitleManager::SetTitle(LPCHARACTER ch, const char* pTitle)
  516. {
  517.     if (NULL == ch)
  518.         return false;
  519.  
  520.     if (!ch->IsPC())
  521.         return false;
  522.  
  523.     if (!*pTitle)
  524.     {
  525.         ch->ChatPacket(CHAT_TYPE_INFO, "TitleManager::SetTitle: no title");
  526.         return false;
  527.     }
  528. /****************
  529. * Title  free
  530. */
  531.     if (!strcmp(pTitle, "disable")  && (GetTitleActual(ch, sTitle[17]) == true) && (GetTitleActual(ch, sTitle[18]) == true) && (GetTitleActual(ch, sTitle[19]) == true))   
  532.     {      
  533.         ch->UpdateTitle(- ch->GetTitle()); 
  534.         ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[12]);
  535.     }
  536.    
  537.     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)) 
  538.     {  
  539.             UpdateTitle(ch, sTitle[1], need_gold_1);
  540.     }
  541.    
  542.     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)) 
  543.     {
  544.             UpdateTitle(ch, sTitle[2], need_gold_2);
  545.     }  
  546.    
  547.     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)) 
  548.     {      
  549.             UpdateTitle(ch, sTitle[3], need_gold_3);
  550.     }  
  551.    
  552.     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)) 
  553.     {
  554.             UpdateTitle(ch, sTitle[4], need_gold_4);
  555.     }  
  556.    
  557.     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)) 
  558.     {
  559.             UpdateTitle(ch, sTitle[5], need_gold_5);
  560.     }  
  561.    
  562.     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)) 
  563.     {
  564.             UpdateTitle(ch, sTitle[6], need_gold_6);
  565.     }
  566.    
  567.     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)) 
  568.     {
  569.             UpdateTitle(ch, sTitle[7], need_gold_7);
  570.     }  
  571.    
  572.     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)) 
  573.     {
  574.             UpdateTitle(ch, sTitle[8], need_gold_8);
  575.     }
  576.    
  577.     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)) 
  578.     {
  579.             UpdateTitle(ch, sTitle[9], need_gold_9);
  580.     }  
  581.    
  582.     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))
  583.     {
  584.             UpdateTitle(ch, sTitle[10], need_gold_10);
  585.     }
  586.    
  587.     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))
  588.     {
  589.             UpdateTitle(ch, sTitle[11], need_gold_11);
  590.     }  
  591.    
  592.     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))
  593.     {
  594.             UpdateTitle(ch, sTitle[12], need_gold_12);
  595.     }
  596.    
  597.     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))
  598.     {
  599.             UpdateTitle(ch, sTitle[13], need_gold_13);
  600.     }  
  601.    
  602.     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))
  603.     {
  604.             UpdateTitle(ch, sTitle[14], need_gold_14);
  605.     }  
  606.    
  607.     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))
  608.     {
  609.             UpdateTitle(ch, sTitle[15], need_gold_15);
  610.     }  
  611.    
  612.     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))
  613.     {
  614.             UpdateTitle(ch, sTitle[16], need_gold_16);
  615.     }
  616. /****************
  617. * Title  premium
  618. */
  619.     if (!strcmp(pTitle, "title17") && (GetTitlePremium(ch) == true))
  620.     {
  621.             SetAffect(ch, "send_premium_1");
  622.     }  
  623.    
  624.     if (!strcmp(pTitle, "title18") && (GetTitlePremium(ch) == true))   
  625.     {
  626.             SetAffect(ch, "send_premium_2");
  627.     }  
  628.    
  629.     if (!strcmp(pTitle, "title19") && (GetTitlePremium(ch) == true))   
  630.     {
  631.             SetAffect(ch, "send_premium_3");
  632.     }
  633.    
  634.     return true;
  635. }
  636.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement