From 2c8ed1074a904d157c4112a6dc5ea25a71f54ec2 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 31 Dec 2018 23:19:48 -0600 Subject: [PATCH] Fix bots build --- zone/bot.cpp | 26 +++++++++++++------------- zone/inventory.cpp | 2 +- zone/mob_appearance.cpp | 4 ++++ zone/npc.cpp | 2 +- zone/perl_mob.cpp | 2 +- 5 files changed, 20 insertions(+), 16 deletions(-) diff --git a/zone/bot.cpp b/zone/bot.cpp index f78363649..5876ebed3 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -89,7 +89,7 @@ Bot::Bot(NPCType npcTypeData, Client* botOwner) : NPC(&npcTypeData, nullptr, glm GenerateAppearance(); GenerateBaseStats(); // Calculate HitPoints Last As It Uses Base Stats - cur_hp = GenerateBaseHitPoints(); + current_hp = GenerateBaseHitPoints(); current_mana = GenerateBaseManaPoints(); cur_end = CalcBaseEndurance(); hp_regen = CalcHPRegen(); @@ -137,7 +137,7 @@ Bot::Bot(uint32 botID, uint32 botOwnerCharacterID, uint32 botSpellsID, double to _baseATK = npcTypeData.ATK; _baseRace = npcTypeData.race; _baseGender = npcTypeData.gender; - cur_hp = npcTypeData.cur_hp; + current_hp = npcTypeData.current_hp; current_mana = npcTypeData.Mana; RestRegenHP = 0; RestRegenMana = 0; @@ -209,10 +209,10 @@ Bot::Bot(uint32 botID, uint32 botOwnerCharacterID, uint32 botSpellsID, double to hp_regen = CalcHPRegen(); mana_regen = CalcManaRegen(); end_regen = CalcEnduranceRegen(); - if(cur_hp > max_hp) - cur_hp = max_hp; + if(current_hp > max_hp) + current_hp = max_hp; - if(cur_hp <= 0) { + if(current_hp <= 0) { SetHP(max_hp/5); SetMana(0); BuffFadeAll(); @@ -336,7 +336,7 @@ NPCType Bot::FillNPCTypeStruct(uint32 botSpellsID, std::string botName, std::str BotNPCType.drakkin_heritage = drakkinHeritage; BotNPCType.drakkin_tattoo = drakkinTattoo; BotNPCType.drakkin_details = drakkinDetails; - BotNPCType.cur_hp = hp; + BotNPCType.current_hp = hp; BotNPCType.Mana = mana; BotNPCType.MR = mr; BotNPCType.CR = cr; @@ -386,7 +386,7 @@ NPCType Bot::CreateDefaultNPCTypeStructForBot(std::string botName, std::string b Result.maxlevel = botLevel; Result.size = 6.0; Result.npc_id = 0; - Result.cur_hp = 0; + Result.current_hp = 0; Result.drakkin_details = 0; Result.drakkin_heritage = 0; Result.drakkin_tattoo = 0; @@ -5147,7 +5147,7 @@ int Bot::GetHandToHandDamage(void) { // everyone uses this in the revamp! int skill = GetSkill(EQEmu::skills::SkillHandtoHand); int epic = 0; - if (CastToNPC()->GetEquipment(EQEmu::textures::armorHands) == 10652 && GetLevel() > 46) + if (CastToNPC()->GetEquippedItemFromTextureSlot(EQEmu::textures::armorHands) == 10652 && GetLevel() > 46) epic = 280; if (epic > skill) skill = epic; @@ -5169,7 +5169,7 @@ int Bot::GetHandToHandDamage(void) { 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, // 31-40 10, 11, 11, 11, 11, 11, 11, 12, 12}; // 41-49 if (GetClass() == MONK) { - if (CastToNPC()->GetEquipment(EQEmu::textures::armorHands) == 10652 && GetLevel() > 50) + if (CastToNPC()->GetEquippedItemFromTextureSlot(EQEmu::textures::armorHands) == 10652 && GetLevel() > 50) return 9; if (level > 62) return 15; @@ -7159,14 +7159,14 @@ int32 Bot::CalcMaxHP() { bot_hp += GroupLeadershipAAHealthEnhancement(); bot_hp += (bot_hp * ((spellbonuses.MaxHPChange + itembonuses.MaxHPChange) / 10000.0f)); max_hp = bot_hp; - if (cur_hp > max_hp) - cur_hp = max_hp; + if (current_hp > max_hp) + current_hp = max_hp; int hp_perc_cap = spellbonuses.HPPercCap[0]; if(hp_perc_cap) { int curHP_cap = ((max_hp * hp_perc_cap) / 100); - if (cur_hp > curHP_cap || (spellbonuses.HPPercCap[1] && cur_hp > spellbonuses.HPPercCap[1])) - cur_hp = curHP_cap; + if (current_hp > curHP_cap || (spellbonuses.HPPercCap[1] && current_hp > spellbonuses.HPPercCap[1])) + current_hp = curHP_cap; } return max_hp; } diff --git a/zone/inventory.cpp b/zone/inventory.cpp index 7e9f2d9a1..3ceefc33b 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -2887,7 +2887,7 @@ int32 Client::GetEquipmentMaterial(uint8 material_slot) { const ItemData *item; - item = database.GetItem(GetEquipment(material_slot)); + item = database.GetItem(GetEquippedItemFromTextureSlot(material_slot)); if(item != 0) { return item->Material; diff --git a/zone/mob_appearance.cpp b/zone/mob_appearance.cpp index 85894994b..fe4e07eee 100644 --- a/zone/mob_appearance.cpp +++ b/zone/mob_appearance.cpp @@ -28,6 +28,10 @@ #include "quest_parser_collection.h" #include "zonedb.h" +#ifdef BOTS +#include "bot.h" +#endif + /** * Stores internal representation of mob texture by material slot * diff --git a/zone/npc.cpp b/zone/npc.cpp index 6f047169a..01339fde9 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -1058,7 +1058,7 @@ NPC * NPC::SpawnNodeNPC(std::string name, std::string last_name, const glm::vec4 sprintf(npc_type->name, "%s", name.c_str()); sprintf(npc_type->lastname, "%s", last_name.c_str()); - npc_type->current_hp = 4000000; + npc_type->current_hp = 4000000; npc_type->max_hp = 4000000; npc_type->race = 2254; npc_type->gender = 2; diff --git a/zone/perl_mob.cpp b/zone/perl_mob.cpp index b9884b2a0..268c5a60f 100644 --- a/zone/perl_mob.cpp +++ b/zone/perl_mob.cpp @@ -624,7 +624,7 @@ XS(XS_Mob_GetEquipment); /* prototype to pass -Wmissing-prototypes */ XS(XS_Mob_GetEquipment) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::GetEquipment(THIS, uint8 material_slot)"); + Perl_croak(aTHX_ "Usage: Mob::GetEquippedItemFromTextureSlot(THIS, uint8 material_slot)"); { Mob *THIS; int32 RETVAL;