mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Changes requested
Updating based on changes requested for commit
This commit is contained in:
@@ -171,24 +171,21 @@ bool CastCreateSoulstoneAction::isUseful()
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Check if the bot already has any soulstone
|
// Check if the bot already has any soulstone
|
||||||
uint32 currentSoulstones = 0;
|
|
||||||
for (uint32 id : soulstoneIds)
|
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;
|
ItemPosCountVec dest;
|
||||||
uint32 count = 1;
|
uint32 count = 1;
|
||||||
bool hasSpace = false;
|
// Use the last in the list (highest tier)
|
||||||
for (uint32 id : soulstoneIds)
|
uint32 soulstoneToCreate = soulstoneIds.back();
|
||||||
{
|
|
||||||
if (bot->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, id, count) == EQUIP_ERR_OK)
|
|
||||||
{
|
|
||||||
hasSpace = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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)
|
bool DestroySoulShardAction::Execute(Event event)
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ public:
|
|||||||
creators["no healthstone"] = &WarlockTriggerFactoryInternal::HasHealthstone;
|
creators["no healthstone"] = &WarlockTriggerFactoryInternal::HasHealthstone;
|
||||||
creators["no firestone"] = &WarlockTriggerFactoryInternal::HasFirestone;
|
creators["no firestone"] = &WarlockTriggerFactoryInternal::HasFirestone;
|
||||||
creators["no spellstone"] = &WarlockTriggerFactoryInternal::HasSpellstone;
|
creators["no spellstone"] = &WarlockTriggerFactoryInternal::HasSpellstone;
|
||||||
creators["no soulstone"] = &WarlockTriggerFactoryInternal::HasSoulstone;
|
creators["no soulstone"] = &WarlockTriggerFactoryInternal::OutOfSoulstone;
|
||||||
creators["firestone"] = &WarlockTriggerFactoryInternal::firestone;
|
creators["firestone"] = &WarlockTriggerFactoryInternal::firestone;
|
||||||
creators["spellstone"] = &WarlockTriggerFactoryInternal::spellstone;
|
creators["spellstone"] = &WarlockTriggerFactoryInternal::spellstone;
|
||||||
creators["soulstone"] = &WarlockTriggerFactoryInternal::soulstone;
|
creators["soulstone"] = &WarlockTriggerFactoryInternal::soulstone;
|
||||||
@@ -181,7 +181,7 @@ private:
|
|||||||
static Trigger* HasHealthstone(PlayerbotAI* botAI) { return new HasHealthstoneTrigger(botAI); }
|
static Trigger* HasHealthstone(PlayerbotAI* botAI) { return new HasHealthstoneTrigger(botAI); }
|
||||||
static Trigger* HasFirestone(PlayerbotAI* botAI) { return new HasFirestoneTrigger(botAI); }
|
static Trigger* HasFirestone(PlayerbotAI* botAI) { return new HasFirestoneTrigger(botAI); }
|
||||||
static Trigger* HasSpellstone(PlayerbotAI* botAI) { return new HasSpellstoneTrigger(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* firestone(PlayerbotAI* botAI) { return new FirestoneTrigger(botAI); }
|
||||||
static Trigger* spellstone(PlayerbotAI* botAI) { return new SpellstoneTrigger(botAI); }
|
static Trigger* spellstone(PlayerbotAI* botAI) { return new SpellstoneTrigger(botAI); }
|
||||||
static Trigger* soulstone(PlayerbotAI* botAI) { return new SoulstoneTrigger(botAI); }
|
static Trigger* soulstone(PlayerbotAI* botAI) { return new SoulstoneTrigger(botAI); }
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ bool OutOfSoulShardsTrigger::IsActive() { return GetSoulShardCount(botAI->GetBot
|
|||||||
|
|
||||||
bool TooManySoulShardsTrigger::IsActive() { return GetSoulShardCount(botAI->GetBot()) >= 6; }
|
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
|
// Checks if the target marked with the moon icon can be banished
|
||||||
bool BanishTrigger::IsActive()
|
bool BanishTrigger::IsActive()
|
||||||
|
|||||||
@@ -58,10 +58,10 @@ public:
|
|||||||
bool IsActive() override;
|
bool IsActive() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class HasSoulstoneTrigger : public Trigger
|
class OutOfSoulstoneTrigger : public Trigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
HasSoulstoneTrigger(PlayerbotAI* botAI) : Trigger(botAI, "no soulstone") {}
|
OutOfSoulstoneTrigger(PlayerbotAI* botAI) : Trigger(botAI, "no soulstone") {}
|
||||||
bool IsActive() override;
|
bool IsActive() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user