diff --git a/zone/bot.cpp b/zone/bot.cpp index c27ae20ce..4d3c0e75e 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -67,6 +67,7 @@ Bot::Bot(NPCType npcTypeData, Client* botOwner) : NPC(&npcTypeData, nullptr, glm SetHealRotationTimer(0); SetNumHealRotationMembers(0); SetBardUseOutOfCombatSongs(GetClass() == BARD); + SetShowHelm(true); CalcChanceToCast(); rest_timer.Disable(); @@ -4126,7 +4127,7 @@ void Bot::Spawn(Client* botCharacterOwner, std::string* errorMessage) { uint8 materialFromSlot = 0xFF; for(int i = EmuConstants::EQUIPMENT_BEGIN; i <= EmuConstants::EQUIPMENT_END; ++i) { itemID = GetBotItemBySlot(i); - if(itemID != 0) { + if(itemID != 0) { materialFromSlot = Inventory::CalcMaterialFromSlot(i); if(materialFromSlot != 0xFF) this->SendWearChange(materialFromSlot); @@ -4359,7 +4360,7 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) { ns->spawn.is_npc = 0; // 0=no, 1=yes ns->spawn.is_pet = 0; ns->spawn.guildrank = 0; - ns->spawn.showhelm = 1; + ns->spawn.showhelm = GetShowHelm(); ns->spawn.flymode = 0; ns->spawn.size = 0; ns->spawn.NPC = 0; // 0=player,1=npc,2=pc corpse,3=npc corpse @@ -4367,7 +4368,7 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) { UpdateActiveLight(); ns->spawn.light = m_Light.Type.Active; - ns->spawn.helm = helmtexture; //0xFF; + ns->spawn.helm = (GetShowHelm() ? helmtexture : 0); //0xFF; ns->spawn.equip_chest2 = texture; //0xFF; const Item_Struct* item = 0; @@ -11428,7 +11429,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { if (!results.Success()) return; - for (int i = 0; i < 7; i++) { + for (int i = 0; i < 7; i++) { uint8 slotmaterial = Inventory::CalcMaterialFromSlot((uint8)slots[i]); c->GetTarget()->CastToBot()->SendWearChange(slotmaterial); } @@ -15616,6 +15617,32 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { } return; } + + if(!strcasecmp(sep->arg[1], "showhelm")) { + bool showhelm = true; + if (sep->arg[2]) { + if (!strcasecmp(sep->arg[2], "on")) + showhelm = true; + else if (!strcasecmp(sep->arg[2], "off")) + showhelm = false; + else { + c->Message(0, "Usage #bot showhelm [on|off]"); + return; + } + + Mob *target = c->GetTarget(); + if (target && target->IsBot() && (c == target->GetOwner()->CastToClient())) { + Bot* b = target->CastToBot(); + if (b) { + b->SetShowHelm(showhelm); + c->Message(0, "Your bot will %s show their helmet.", (showhelm ? "now" : "no longer")); + } + } + } else + c->Message(0, "Usage #bot showhelm [on|off]"); + + return; + } } // franck: EQoffline diff --git a/zone/bot.h b/zone/bot.h index 25e0d1c52..19968c394 100644 --- a/zone/bot.h +++ b/zone/bot.h @@ -467,6 +467,7 @@ public: uint32 GetHealRotationNextHealTime() { return _healRotationNextHeal; } uint32 GetHealRotationTimer () { return _healRotationTimer; } bool GetBardUseOutOfCombatSongs() { return _bardUseOutOfCombatSongs;} + bool GetShowHelm() { return _showhelm; } inline virtual int32 GetAC() const { return AC; } inline virtual int32 GetSTR() const { return STR; } inline virtual int32 GetSTA() const { return STA; } @@ -550,6 +551,7 @@ public: void SetHealRotationTimer( uint32 timer ) { _healRotationTimer = timer; } void SetNumHealRotationMembers( uint8 numMembers ) { _numHealRotationMembers = numMembers; } void SetBardUseOutOfCombatSongs(bool useOutOfCombatSongs) { _bardUseOutOfCombatSongs = useOutOfCombatSongs;} + void SetShowHelm(bool showhelm) { _showhelm = showhelm; } // Class Destructors virtual ~Bot(); @@ -622,6 +624,7 @@ private: std::map botAAs; InspectMessage_Struct _botInspectMessage; bool _bardUseOutOfCombatSongs; + bool _showhelm; // Private "base stats" Members int32 _baseMR;