Bot.cpp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680
  1. #include "Bot.h"
  2. #include "BotBrain.h"
  3. #include "../Trade.h"
  4. #include "../../common/Log.h"
  5. #include "../WorldDatabase.h"
  6. #include "../classes.h"
  7. #include "../SpellProcess.h"
  8. extern WorldDatabase database;
  9. extern MasterSpellList master_spell_list;
  10. extern World world;
  11. extern Classes classes;
  12. Bot::Bot() : NPC() {
  13. SetBrain(new BotBrain(this));
  14. BotID = 0;
  15. ShowHelm = true;
  16. ShowCloak = true;
  17. CanTaunt = false;
  18. combat_target = 0;
  19. main_tank = 0;
  20. //AddPrimaryEntityCommand("hail", 10000, "hail", "", 0, 0);
  21. AddSecondaryEntityCommand("invite bot", 10000, "invite", "", 0, 0);
  22. AddSecondaryEntityCommand("bot inventory", 10000, "bot inv list", "", 0, 0);
  23. InfoStruct* info = GetInfoStruct();
  24. info->str_base = 50;
  25. info->sta_base = 20;
  26. info->wis_base = 20;
  27. info->intel_base = 20;
  28. info->agi_base = 20;
  29. }
  30. Bot::~Bot() {
  31. }
  32. void Bot::GiveItem(int32 item_id) {
  33. Item* master_item = master_item_list.GetItem(item_id);
  34. Item* item = 0;
  35. if (master_item)
  36. item = new Item(master_item);
  37. if (item) {
  38. int8 slot = GetEquipmentList()->GetFreeSlot(item);
  39. if (slot != 255) {
  40. GetEquipmentList()->AddItem(slot, item);
  41. SetEquipment(item, slot);
  42. database.SaveBotItem(BotID, item_id, slot);
  43. if (slot == 0) {
  44. ChangePrimaryWeapon();
  45. if (IsBot())
  46. LogWrite(PLAYER__ERROR, 0, "Bot", "Changing bot primary weapon.");
  47. }
  48. CalculateBonuses();
  49. }
  50. }
  51. }
  52. void Bot::RemoveItem(Item* item) {
  53. int8 slot = GetEquipmentList()->GetSlotByItem(item);
  54. if (slot != 255) {
  55. GetEquipmentList()->RemoveItem(slot, true);
  56. SetEquipment(0, slot);
  57. }
  58. }
  59. void Bot::TradeItemAdded(Item* item) {
  60. int8 slot = GetEquipmentList()->GetFreeSlot(item);
  61. if (slot == 255 && item->slot_data.size() > 0) {
  62. slot = item->slot_data[0];
  63. AddItemToTrade(slot);
  64. }
  65. }
  66. void Bot::AddItemToTrade(int8 slot) {
  67. Item* item = GetEquipmentList()->GetItem(slot);
  68. if (trading_slots.count(slot) == 0 && item && trade) {
  69. trade->AddItemToTrade(this, item, 1, 255);
  70. trading_slots.insert(slot);
  71. }
  72. }
  73. bool Bot::CheckTradeItems(map<int8, TradeItemInfo>* list) {
  74. if (!list) {
  75. LogWrite(PLAYER__ERROR, 0, "Bot", "CheckTradeItems did not recieve a valid list of items");
  76. return false;
  77. }
  78. bool ret = true;
  79. map<int8, TradeItemInfo>::iterator itr;
  80. for (itr = list->begin(); itr != list->end(); itr++) {
  81. Item* item = itr->second.item;
  82. if (item) {
  83. if (!CanEquipItem(item)) {
  84. // No slots means not equipable so reject the trade
  85. ret = false;
  86. break;
  87. }
  88. }
  89. }
  90. return ret;
  91. }
  92. void Bot::FinishTrade() {
  93. trading_slots.clear();
  94. }
  95. bool Bot::CanEquipItem(Item* item) {
  96. if (item) {
  97. if (item->IsArmor() || item->IsWeapon() || item->IsFood() || item->IsRanged() || item->IsShield() || item->IsBauble() || item->IsAmmo() || item->IsThrown()) {
  98. int16 override_level = item->GetOverrideLevel(GetAdventureClass(), GetTradeskillClass());
  99. if (override_level > 0 && override_level <= GetLevel()) {
  100. LogWrite(PLAYER__ERROR, 0, "Bot", "Passed in override_level check");
  101. return true;
  102. }
  103. if (item->CheckClass(GetAdventureClass(), GetTradeskillClass()))
  104. if (item->CheckLevel(GetAdventureClass(), GetTradeskillClass(), GetLevel())) {
  105. LogWrite(PLAYER__ERROR, 0, "Bot", "Passed in normal check");
  106. return true;
  107. }
  108. }
  109. }
  110. return false;
  111. }
  112. void Bot::MessageGroup(string msg) {
  113. GroupMemberInfo* gmi = GetGroupMemberInfo();
  114. if (gmi)
  115. world.GetGroupManager()->GroupChatMessage(gmi->group_id, this, msg.c_str());
  116. }
  117. void Bot::GetNewSpells() {
  118. vector<Spell*> spells;
  119. vector<Spell*>* spells1 = master_spell_list.GetSpellListByAdventureClass(GetAdventureClass(), GetLevel(), 1);
  120. vector<Spell*>* spells2 = master_spell_list.GetSpellListByAdventureClass(classes.GetBaseClass(GetAdventureClass()), GetLevel(), 1);
  121. vector<Spell*>* spells3 = master_spell_list.GetSpellListByAdventureClass(classes.GetSecondaryBaseClass(GetAdventureClass()), GetLevel(), 1);
  122. spells.insert(spells.end(), spells1->begin(), spells1->end());
  123. spells.insert(spells.end(), spells2->begin(), spells2->end());
  124. spells.insert(spells.end(), spells3->begin(), spells3->end());
  125. vector<Spell*>::iterator itr;
  126. map<int32, int8>* spell_list = 0;
  127. for (itr = spells.begin(); itr != spells.end(); itr++) {
  128. switch ((*itr)->GetSpellData()->spell_type) {
  129. case SPELL_TYPE_DD:
  130. spell_list = &dd_spells;
  131. break;
  132. case SPELL_TYPE_DOT:
  133. spell_list = &dot_spells;
  134. break;
  135. case SPELL_TYPE_HEAL:
  136. spell_list = &heal_spells;
  137. break;
  138. case SPELL_TYPE_HOT_WARD:
  139. spell_list = &hot_ward_spells;
  140. break;
  141. case SPELL_TYPE_DEBUFF:
  142. spell_list = &debuff_spells;
  143. break;
  144. case SPELL_TYPE_BUFF:
  145. spell_list = &buff_spells;
  146. break;
  147. case SPELL_TYPE_COMBATBUFF:
  148. spell_list = &combat_buff_spells;
  149. break;
  150. case SPELL_TYPE_TAUNT:
  151. spell_list = &taunt_spells;
  152. break;
  153. case SPELL_TYPE_DETAUNT:
  154. spell_list = &detaunt_spells;
  155. break;
  156. case SPELL_TYPE_REZ:
  157. LogWrite(PLAYER__ERROR, 0, "Bot", "Adding rez spell.");
  158. spell_list = &rez_spells;
  159. break;
  160. case SPELL_TYPE_CURE:
  161. spell_list = &cure_spells;
  162. break;
  163. default:
  164. spell_list = 0;
  165. break;
  166. }
  167. if (spell_list && spell_list->count((*itr)->GetSpellID()) == 0)
  168. (*spell_list)[(*itr)->GetSpellID()] = 1;
  169. }
  170. safe_delete(spells1);
  171. safe_delete(spells2);
  172. safe_delete(spells3);
  173. }
  174. Entity* Bot::GetCombatTarget() {
  175. Spawn* target = GetZone()->GetSpawnByID(combat_target);
  176. if (target && target->IsEntity())
  177. return (Entity*)target;
  178. combat_target = 0;
  179. return 0;
  180. }
  181. Spell* Bot::SelectSpellToCast(float distance) {
  182. Spell* spell = 0;
  183. map<int32, int8>::iterator itr;
  184. // Heal
  185. spell = GetHealSpell();
  186. if (spell)
  187. return spell;
  188. // Taunt
  189. spell = GetTauntSpell();
  190. if (spell)
  191. return spell;
  192. // Detaunt
  193. spell = GetDetauntSpell();
  194. if (spell)
  195. return spell;
  196. // Hot/Ward
  197. spell = GetHoTWardSpell();
  198. if (spell)
  199. return spell;
  200. // Debuff
  201. spell = GetDebuffSpell();
  202. if (spell)
  203. return spell;
  204. // Combat Buff
  205. spell = GetCombatBuffSpell();
  206. if (spell)
  207. return spell;
  208. // DoT
  209. spell = GetDoTSpell();
  210. if (spell)
  211. return spell;
  212. // DD
  213. spell = GetDDSpell();
  214. if (spell)
  215. return spell;
  216. return 0;
  217. }
  218. void Bot::SetRecast(Spell* spell, int32 time) {
  219. recast_times[spell->GetSpellID()] = time;
  220. }
  221. bool Bot::IsSpellReady(Spell* spell) {
  222. if (recast_times.count(spell->GetSpellID()) > 0) {
  223. if (recast_times[spell->GetSpellID()] > Timer::GetCurrentTime2())
  224. return false;
  225. }
  226. return true;
  227. }
  228. Spell* Bot::GetDDSpell() {
  229. if (dd_spells.size() == 0)
  230. return 0;
  231. Spell* spell = 0;
  232. map<int32, int8>::iterator itr;
  233. for (itr = dd_spells.begin(); itr != dd_spells.end(); itr++) {
  234. spell = master_spell_list.GetSpell(itr->first, itr->second);
  235. if (spell && IsSpellReady(spell)) {
  236. return spell;
  237. }
  238. }
  239. return 0;
  240. }
  241. Spell* Bot::GetHealSpell() {
  242. if (heal_spells.size() == 0)
  243. return 0;
  244. // Get an available heal spell
  245. Spell* spell = 0;
  246. map<int32, int8>::iterator itr;
  247. for (itr = heal_spells.begin(); itr != heal_spells.end(); itr++) {
  248. spell = master_spell_list.GetSpell(itr->first, itr->second);
  249. if (spell && IsSpellReady(spell)) {
  250. break;
  251. }
  252. }
  253. // No heal available, return out
  254. if (!spell)
  255. return 0;
  256. // There was a heal spell so find a group member that needs healing
  257. int8 threshold = GetHealThreshold();
  258. GroupMemberInfo* gmi = GetGroupMemberInfo();
  259. deque<GroupMemberInfo*>* members = world.GetGroupManager()->GetGroupMembers(gmi->group_id);
  260. for (int8 i = 0; i < members->size(); i++) {
  261. Entity* member = members->at(i)->member;
  262. if (!member->Alive())
  263. continue;
  264. int8 percent = (int8)(((float)member->GetHP() / member->GetTotalHP()) * 100);
  265. if (percent <= threshold) {
  266. if (spell) {
  267. SetTarget(member);
  268. return spell;
  269. }
  270. }
  271. }
  272. return 0;
  273. }
  274. Spell* Bot::GetTauntSpell() {
  275. if (taunt_spells.size() == 0)
  276. return 0;
  277. // If not the main tank and taunts are turned off return out
  278. if (main_tank != this && !CanTaunt)
  279. return 0;
  280. Spell* spell = 0;
  281. map<int32, int8>::iterator itr;
  282. for (itr = taunt_spells.begin(); itr != taunt_spells.end(); itr++) {
  283. spell = master_spell_list.GetSpell(itr->first, itr->second);
  284. if (spell && IsSpellReady(spell)) {
  285. return spell;
  286. }
  287. }
  288. return 0;
  289. }
  290. Spell* Bot::GetDetauntSpell() {
  291. if (detaunt_spells.size() == 0)
  292. return 0;
  293. if (!GetTarget() || !GetTarget()->IsNPC())
  294. return 0;
  295. NPC* target = (NPC*)GetTarget();
  296. Entity* hated = target->Brain()->GetMostHated();
  297. if (hated == this) {
  298. Spell* spell = 0;
  299. map<int32, int8>::iterator itr;
  300. for (itr = detaunt_spells.begin(); itr != detaunt_spells.end(); itr++) {
  301. spell = master_spell_list.GetSpell(itr->first, itr->second);
  302. if (spell && IsSpellReady(spell)) {
  303. return spell;
  304. }
  305. }
  306. }
  307. return 0;
  308. }
  309. Spell* Bot::GetHoTWardSpell() {
  310. if (hot_ward_spells.size() == 0)
  311. return 0;
  312. // Get an available spell
  313. Spell* spell = 0;
  314. map<int32, int8>::iterator itr;
  315. for (itr = hot_ward_spells.begin(); itr != hot_ward_spells.end(); itr++) {
  316. spell = master_spell_list.GetSpell(itr->first, itr->second);
  317. if (spell && IsSpellReady(spell)) {
  318. break;
  319. }
  320. }
  321. // No spell available, return out
  322. if (!spell)
  323. return 0;
  324. // There was a spell so find a group member that needs healing
  325. int8 threshold = GetHealThreshold();
  326. GroupMemberInfo* gmi = GetGroupMemberInfo();
  327. deque<GroupMemberInfo*>* members = world.GetGroupManager()->GetGroupMembers(gmi->group_id);
  328. for (int8 i = 0; i < members->size(); i++) {
  329. Entity* member = members->at(i)->member;
  330. int8 percent = 0;
  331. if (member->GetHP() > 0)
  332. percent = (int8)(((float)member->GetHP() / member->GetTotalHP()) * 100);
  333. if (percent <= 99 && percent > threshold) {
  334. if (spell) {
  335. SetTarget(member);
  336. return spell;
  337. }
  338. }
  339. }
  340. return 0;
  341. }
  342. Spell* Bot::GetDebuffSpell() {
  343. if (debuff_spells.size() == 0)
  344. return 0;
  345. Spell* spell = 0;
  346. map<int32, int8>::iterator itr;
  347. for (itr = debuff_spells.begin(); itr != debuff_spells.end(); itr++) {
  348. spell = master_spell_list.GetSpell(itr->first, itr->second);
  349. if (spell && IsSpellReady(spell)) {
  350. // If target already has this effect on them then continue to the next spell
  351. if (((Entity*)GetTarget())->GetSpellEffect(itr->first))
  352. continue;
  353. return spell;
  354. }
  355. }
  356. return 0;
  357. }
  358. Spell* Bot::GetCombatBuffSpell() {
  359. return 0;
  360. }
  361. Spell* Bot::GetDoTSpell() {
  362. if (dot_spells.size() == 0)
  363. return 0;
  364. Spell* spell = 0;
  365. map<int32, int8>::iterator itr;
  366. for (itr = dot_spells.begin(); itr != dot_spells.end(); itr++) {
  367. spell = master_spell_list.GetSpell(itr->first, itr->second);
  368. if (spell && IsSpellReady(spell)) {
  369. // If target already has this effect on them then continue to the next spell
  370. if (((Entity*)GetTarget())->GetSpellEffect(itr->first))
  371. continue;
  372. return spell;
  373. }
  374. }
  375. return 0;
  376. }
  377. Spell* Bot::GetBuffSpell() {
  378. if (buff_spells.size() == 0)
  379. return 0;
  380. Spell* spell = 0;
  381. Entity* target = 0;
  382. map<int32, int8>::iterator itr;
  383. for (itr = buff_spells.begin(); itr != buff_spells.end(); itr++) {
  384. spell = master_spell_list.GetSpell(itr->first, itr->second);
  385. if (spell && IsSpellReady(spell)) {
  386. target = 0;
  387. if (spell->GetSpellData()->target_type == SPELL_TARGET_SELF)
  388. target = this;
  389. if (spell->GetSpellData()->target_type == SPELL_TARGET_GROUP_AE)
  390. target = this;
  391. if (spell->GetSpellData()->target_type == SPELL_TARGET_ENEMY && spell->GetSpellData()->friendly_spell == 1)
  392. target = (main_tank != NULL) ? main_tank : GetOwner();
  393. if (!target)
  394. continue;
  395. if (!target->Alive())
  396. continue;
  397. // If target already has this effect on them then continue to the next spell
  398. if (target->GetSpellEffect(itr->first))
  399. continue;
  400. SetTarget(target);
  401. return spell;
  402. }
  403. }
  404. return 0;
  405. }
  406. Spell* Bot::GetRezSpell() {
  407. if (rez_spells.size() == 0)
  408. return 0;
  409. GroupMemberInfo* gmi = GetGroupMemberInfo();
  410. if (!gmi)
  411. return 0;
  412. Entity* target = 0;
  413. deque<GroupMemberInfo*>* members = world.GetGroupManager()->GetGroupMembers(gmi->group_id);
  414. for (int8 i = 0; i < members->size(); i++) {
  415. Entity* member = members->at(i)->member;
  416. if (member && !member->Alive() && member->IsPlayer()) {
  417. PendingResurrection* rez = members->at(i)->client->GetCurrentRez();
  418. if (rez->active)
  419. continue;
  420. target = member;
  421. break;
  422. }
  423. }
  424. if (!target)
  425. return 0;
  426. Spell* spell = 0;
  427. map<int32, int8>::iterator itr;
  428. for (itr = rez_spells.begin(); itr != rez_spells.end(); itr++) {
  429. spell = master_spell_list.GetSpell(itr->first, itr->second);
  430. if (spell && IsSpellReady(spell)) {
  431. SetTarget(target);
  432. return spell;
  433. }
  434. }
  435. return 0;
  436. }
  437. Spell* Bot::GetCureSpell() {
  438. return 0;
  439. }
  440. int8 Bot::GetHealThreshold() {
  441. int8 ret = 0;
  442. switch (GetAdventureClass()) {
  443. case PRIEST:
  444. case CLERIC:
  445. case TEMPLAR:
  446. case INQUISITOR:
  447. case DRUID:
  448. case WARDEN:
  449. case FURY:
  450. case SHAMAN:
  451. case MYSTIC:
  452. case DEFILER:
  453. ret = 70;
  454. break;
  455. default:
  456. ret = 30;
  457. break;
  458. }
  459. return ret;
  460. }
  461. bool Bot::ShouldMelee() {
  462. bool ret = true;
  463. switch (GetAdventureClass()) {
  464. case PRIEST:
  465. case CLERIC:
  466. case TEMPLAR:
  467. case INQUISITOR:
  468. case DRUID:
  469. case WARDEN:
  470. case FURY:
  471. case SHAMAN:
  472. case MYSTIC:
  473. case DEFILER:
  474. case MAGE:
  475. case SORCERER:
  476. case WIZARD:
  477. case WARLOCK:
  478. case ENCHANTER:
  479. case ILLUSIONIST:
  480. case COERCER:
  481. case SUMMONER:
  482. case CONJUROR:
  483. case NECROMANCER:
  484. ret = false;
  485. break;
  486. default:
  487. ret = true;
  488. break;
  489. }
  490. if (GetTarget() == GetOwner())
  491. ret = false;
  492. return ret;
  493. }
  494. void Bot::Camp() {
  495. // Copy from COMMAND_GROUP_LEAVE
  496. GroupMemberInfo* gmi = GetGroupMemberInfo();
  497. if (gmi) {
  498. int32 group_id = gmi->group_id;
  499. world.GetGroupManager()->RemoveGroupMember(group_id, this);
  500. if (!world.GetGroupManager()->IsGroupIDValid(group_id)) {
  501. // leader->Message(CHANNEL_COLOR_GROUP, "%s has left the group.", client->GetPlayer()->GetName());
  502. }
  503. else {
  504. world.GetGroupManager()->GroupMessage(group_id, "%s has left the group.", GetName());
  505. }
  506. }
  507. GetZone()->PlayAnimation(this, 538);
  508. SetVisualState(540);
  509. GetZone()->Despawn(this, 5000);
  510. if (!GetOwner())
  511. return;
  512. Client* client = GetZone()->GetClientBySpawn(GetOwner());
  513. if (client)
  514. client->GetPlayer()->SpawnedBots.erase(BotIndex);
  515. }
  516. void Bot::ChangeLevel(int16 old_level, int16 new_level) {
  517. if (new_level < 1)
  518. return;
  519. if (GetLevel() != new_level) {
  520. SetLevel(new_level);
  521. if (GetGroupMemberInfo()) {
  522. UpdateGroupMemberInfo();
  523. world.GetGroupManager()->SendGroupUpdate(GetGroupMemberInfo()->group_id);
  524. }
  525. }
  526. if (GetPet()) {
  527. NPC* pet = (NPC*)GetPet();
  528. if (pet->GetMaxPetLevel() == 0 || new_level <= pet->GetMaxPetLevel()) {
  529. pet->SetLevel(new_level);
  530. GetZone()->PlayAnimation(pet, 1753);
  531. }
  532. }
  533. // level up animation
  534. GetZone()->PlayAnimation(this, 1753);
  535. //player->GetSkills()->IncreaseAllSkillCaps(5 * (new_level - old_level));
  536. GetNewSpells();
  537. //SendNewSpells(player->GetAdventureClass());
  538. //SendNewSpells(classes.GetBaseClass(player->GetAdventureClass()));
  539. //SendNewSpells(classes.GetSecondaryBaseClass(player->GetAdventureClass()));
  540. ChangePrimaryWeapon();
  541. ChangeSecondaryWeapon();
  542. ChangeRangedWeapon();
  543. GetInfoStruct()->level = new_level;
  544. // GetPlayer()->SetLevel(new_level);
  545. LogWrite(MISC__TODO, 1, "TODO", "Get new HP/POWER/stat based on default values from DB\n\t(%s, function: %s, line #: %i)", __FILE__, __FUNCTION__, __LINE__);
  546. SetTotalHPBase(new_level*new_level * 2 + 40);
  547. SetTotalPowerBase((sint32)(new_level*new_level*2.1 + 45));
  548. CalculateBonuses();
  549. SetHP(GetTotalHP());
  550. SetPower(GetTotalPower());
  551. GetInfoStruct()->agi_base = new_level * 2 + 15;
  552. GetInfoStruct()->intel_base = new_level * 2 + 15;
  553. GetInfoStruct()->wis_base = new_level * 2 + 15;
  554. GetInfoStruct()->str_base = new_level * 2 + 15;
  555. GetInfoStruct()->sta_base = new_level * 2 + 15;
  556. GetInfoStruct()->cold_base = (int16)(new_level*1.5 + 10);
  557. GetInfoStruct()->heat_base = (int16)(new_level*1.5 + 10);
  558. GetInfoStruct()->disease_base = (int16)(new_level*1.5 + 10);
  559. GetInfoStruct()->mental_base = (int16)(new_level*1.5 + 10);
  560. GetInfoStruct()->magic_base = (int16)(new_level*1.5 + 10);
  561. GetInfoStruct()->divine_base = (int16)(new_level*1.5 + 10);
  562. GetInfoStruct()->poison_base = (int16)(new_level*1.5 + 10);
  563. SetHPRegen((int)(new_level*.75) + (int)(new_level / 10) + 3);
  564. SetPowerRegen(new_level + (int)(new_level / 10) + 4);
  565. GetInfoStruct()->poison_base = (int16)(new_level*1.5 + 10);
  566. /*UpdateTimeStampFlag(LEVEL_UPDATE_FLAG);
  567. GetPlayer()->SetCharSheetChanged(true);
  568. Message(CHANNEL_COLOR_EXP, "You are now level %i!", new_level);
  569. LogWrite(WORLD__DEBUG, 0, "World", "Player: %s leveled from %u to %u", GetPlayer()->GetName(), old_level, new_level);
  570. GetPlayer()->GetSkills()->SetSkillCapsByType(1, 5 * new_level);
  571. GetPlayer()->GetSkills()->SetSkillCapsByType(3, 5 * new_level);
  572. GetPlayer()->GetSkills()->SetSkillCapsByType(6, 5 * new_level);
  573. GetPlayer()->GetSkills()->SetSkillCapsByType(13, 5 * new_level);
  574. */
  575. }