Changes requested

Updating based on changes requested for commit
This commit is contained in:
ThePenguinMan96
2025-07-25 14:02:20 -07:00
parent 5ac6e8751c
commit a33bb3b51e
4 changed files with 16 additions and 19 deletions

View File

@@ -171,24 +171,21 @@ bool CastCreateSoulstoneAction::isUseful()
};
// Check if the bot already has any soulstone
uint32 currentSoulstones = 0;
for (uint32 id : soulstoneIds)
currentSoulstones += bot->GetItemCount(id, false); // false = only bags
{
if (bot->GetItemCount(id, false) > 0)
return false; // Already has a soulstone
}
// Allow only if the bot has no soulstone AND there is space for one
// Only need to check one soulstone type for bag space (usually the highest-tier)
ItemPosCountVec dest;
uint32 count = 1;
bool hasSpace = false;
for (uint32 id : soulstoneIds)
{
if (bot->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, id, count) == EQUIP_ERR_OK)
{
hasSpace = true;
break;
}
}
// Use the last in the list (highest tier)
uint32 soulstoneToCreate = soulstoneIds.back();
return (currentSoulstones == 0) && hasSpace;
bool hasSpace = (bot->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, soulstoneToCreate, count) == EQUIP_ERR_OK);
return hasSpace;
}
bool DestroySoulShardAction::Execute(Event event)

View File

@@ -137,7 +137,7 @@ public:
creators["no healthstone"] = &WarlockTriggerFactoryInternal::HasHealthstone;
creators["no firestone"] = &WarlockTriggerFactoryInternal::HasFirestone;
creators["no spellstone"] = &WarlockTriggerFactoryInternal::HasSpellstone;
creators["no soulstone"] = &WarlockTriggerFactoryInternal::HasSoulstone;
creators["no soulstone"] = &WarlockTriggerFactoryInternal::OutOfSoulstone;
creators["firestone"] = &WarlockTriggerFactoryInternal::firestone;
creators["spellstone"] = &WarlockTriggerFactoryInternal::spellstone;
creators["soulstone"] = &WarlockTriggerFactoryInternal::soulstone;
@@ -181,7 +181,7 @@ private:
static Trigger* HasHealthstone(PlayerbotAI* botAI) { return new HasHealthstoneTrigger(botAI); }
static Trigger* HasFirestone(PlayerbotAI* botAI) { return new HasFirestoneTrigger(botAI); }
static Trigger* HasSpellstone(PlayerbotAI* botAI) { return new HasSpellstoneTrigger(botAI); }
static Trigger* HasSoulstone(PlayerbotAI* botAI) { return new HasSoulstoneTrigger(botAI); }
static Trigger* OutOfSoulstone(PlayerbotAI* botAI) { return new OutOfSoulstoneTrigger(botAI); }
static Trigger* firestone(PlayerbotAI* botAI) { return new FirestoneTrigger(botAI); }
static Trigger* spellstone(PlayerbotAI* botAI) { return new SpellstoneTrigger(botAI); }
static Trigger* soulstone(PlayerbotAI* botAI) { return new SoulstoneTrigger(botAI); }

View File

@@ -46,7 +46,7 @@ bool OutOfSoulShardsTrigger::IsActive() { return GetSoulShardCount(botAI->GetBot
bool TooManySoulShardsTrigger::IsActive() { return GetSoulShardCount(botAI->GetBot()) >= 6; }
bool HasSoulstoneTrigger::IsActive() { return GetSoulstoneCount(botAI->GetBot()) == 0; }
bool OutOfSoulstoneTrigger::IsActive() { return GetSoulstoneCount(botAI->GetBot()) == 0; }
// Checks if the target marked with the moon icon can be banished
bool BanishTrigger::IsActive()

View File

@@ -58,10 +58,10 @@ public:
bool IsActive() override;
};
class HasSoulstoneTrigger : public Trigger
class OutOfSoulstoneTrigger : public Trigger
{
public:
HasSoulstoneTrigger(PlayerbotAI* botAI) : Trigger(botAI, "no soulstone") {}
OutOfSoulstoneTrigger(PlayerbotAI* botAI) : Trigger(botAI, "no soulstone") {}
bool IsActive() override;
};