mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Changes requested
I fixed what was requested of me. Built it, tested it - all functions are working.
This commit is contained in:
@@ -193,8 +193,8 @@ public:
|
||||
creators["calc"] = &ChatActionContext::calc;
|
||||
creators["wipe"] = &ChatActionContext::wipe;
|
||||
creators["tame"] = &ChatActionContext::tame;
|
||||
creators["glyphs"] = &ChatActionContext::glyphs; // Added for custom Glyphs
|
||||
creators["glyph equip"] = &ChatActionContext::glyph_equip; // Added for custom Glyphs
|
||||
creators["glyphs"] = &ChatActionContext::glyphs; // Added for custom Glyphs
|
||||
creators["glyph equip"] = &ChatActionContext::glyph_equip; // Added for custom Glyphs
|
||||
creators["pet"] = &ChatActionContext::pet;
|
||||
creators["pet attack"] = &ChatActionContext::pet_attack;
|
||||
creators["roll"] = &ChatActionContext::roll_action;
|
||||
@@ -305,8 +305,8 @@ private:
|
||||
static Action* calc(PlayerbotAI* ai) { return new TellCalculateItemAction(ai); }
|
||||
static Action* wipe(PlayerbotAI* ai) { return new WipeAction(ai); }
|
||||
static Action* tame(PlayerbotAI* botAI) { return new TameAction(botAI); }
|
||||
static Action* glyphs(PlayerbotAI* botAI) { return new TellGlyphsAction(botAI); } // Added for custom Glyphs
|
||||
static Action* glyph_equip(PlayerbotAI* ai) { return new EquipGlyphsAction(ai); } // Added for custom Glyphs
|
||||
static Action* glyphs(PlayerbotAI* botAI) { return new TellGlyphsAction(botAI); } // Added for custom Glyphs
|
||||
static Action* glyph_equip(PlayerbotAI* ai) { return new EquipGlyphsAction(ai); } // Added for custom Glyphs
|
||||
static Action* pet(PlayerbotAI* botAI) { return new PetAction(botAI); }
|
||||
static Action* pet_attack(PlayerbotAI* botAI) { return new PetAction(botAI, "attack"); }
|
||||
static Action* roll_action(PlayerbotAI* botAI) { return new RollAction(botAI); }
|
||||
|
||||
@@ -156,9 +156,6 @@ bool PetAttackAction::Execute(Event event)
|
||||
|
||||
bool SetPetStanceAction::Execute(Event /*event*/)
|
||||
{
|
||||
// Get the bot player object from the AI
|
||||
Player* bot = botAI->GetBot();
|
||||
|
||||
// Prepare a list to hold all controlled pet and guardian creatures
|
||||
std::vector<Creature*> targets;
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ bool TameAction::Execute(Event event)
|
||||
// Handle "tame abandon" command to give up your current pet
|
||||
if (mode == "abandon")
|
||||
{
|
||||
return abandonPet();
|
||||
return AbandonPet();
|
||||
}
|
||||
|
||||
// Try to process the command based on mode and value
|
||||
@@ -476,7 +476,7 @@ bool TameAction::CreateAndSetPet(uint32 creatureEntry)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TameAction::abandonPet()
|
||||
bool TameAction::AbandonPet()
|
||||
{
|
||||
// Get the bot player and its current pet (if any)
|
||||
Player* bot = botAI->GetBot();
|
||||
|
||||
@@ -25,7 +25,7 @@ private:
|
||||
bool SetPetByFamily(const std::string& family);
|
||||
bool RenamePet(const std::string& newName);
|
||||
bool CreateAndSetPet(uint32 creatureEntry);
|
||||
bool abandonPet();
|
||||
bool AbandonPet();
|
||||
|
||||
std::string lastPetName;
|
||||
uint32 lastPetId = 0;
|
||||
|
||||
@@ -692,9 +692,11 @@ bool NewPetTrigger::IsActive()
|
||||
{
|
||||
// Get the bot player object from the AI
|
||||
Player* bot = botAI->GetBot();
|
||||
if (!bot)
|
||||
return false;
|
||||
|
||||
// Try to get the current pet; initialize guardian and GUID to null/empty
|
||||
Pet* pet = bot ? bot->GetPet() : nullptr;
|
||||
Pet* pet = bot->GetPet();
|
||||
Guardian* guardian = nullptr;
|
||||
ObjectGuid currentPetGuid = ObjectGuid::Empty;
|
||||
|
||||
@@ -706,7 +708,7 @@ bool NewPetTrigger::IsActive()
|
||||
else
|
||||
{
|
||||
// If no pet, try to get a guardian pet and its GUID
|
||||
guardian = bot ? bot->GetGuardianPet() : nullptr;
|
||||
guardian = bot->GetGuardianPet();
|
||||
if (guardian)
|
||||
currentPetGuid = guardian->GetGUID();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user