Firestone Error Fix/Excess Soul Shard Fix

Hello everyone,

This PR addresses two errors that players have been getting with the new warlock changes:

Firestone - Fel Firestone, which is rank 6 of create firestone, learned at level 74, is creating an error in the worldserver that is quite annoying. That is because the database has an incorrect enchant effect of a chance on hit for that rank. This PR changes the CreateFirestoneAction to skip that spell rank entirely, thus never having that error. Note: You might need to wait a little while after the new change for the errors to go away - that is because there still be pre-existing fel firestones  on the warlocks, as well as enchanted on their weapons. Once those disappear, the error will not be there anymore.

Excess soul shards - There is an error that currently exists where if a Warlock uses Drain Soul while they have 32 soul shards, it will spam in the chat log "I can't carry anymore of those". This PR will automatically delete soul shards if they have 6 or more. This PR also will reduce the number of soul shards the warlock receives from maintenance to 5. I figured 5 is a good maximum so their inventory doesn't get clogged with 32 shards. Between "DestroySoulShard" and "CreateSoulShard" actions, they will always have between 1-5 soul shards.
This commit is contained in:
ThePenguinMan96
2025-07-12 11:45:33 -07:00
parent bc5d602326
commit 6d07d6febe
7 changed files with 101 additions and 3 deletions

View File

@@ -135,6 +135,43 @@ bool CreateSoulShardAction::Execute(Event event)
return false;
}
bool DestroySoulShardAction::Execute(Event event)
{
static const uint32 SOUL_SHARD_ID = 6265;
// Look for the first soul shard in any bag and destroy it
for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i)
{
if (Bag* pBag = (Bag*)bot->GetItemByPos(INVENTORY_SLOT_BAG_0, i))
{
for (uint32 j = 0; j < pBag->GetBagSize(); ++j)
{
if (Item* pItem = pBag->GetItemByPos(j))
{
if (pItem->GetTemplate()->ItemId == SOUL_SHARD_ID)
{
bot->DestroyItem(pItem->GetBagSlot(), pItem->GetSlot(), true);
return true; // Only destroy one!
}
}
}
}
}
// Also check main inventory slots (not in bags)
for (int i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; ++i)
{
if (Item* pItem = bot->GetItemByPos(INVENTORY_SLOT_BAG_0, i))
{
if (pItem->GetTemplate()->ItemId == SOUL_SHARD_ID)
{
bot->DestroyItem(pItem->GetBagSlot(), pItem->GetSlot(), true);
return true;
}
}
}
return false;
}
// Checks if the target has a soulstone aura
static bool HasSoulstoneAura(Unit* unit)
{
@@ -322,3 +359,37 @@ bool UseSoulstoneHealerAction::Execute(Event event)
bot->SetSelection(healer->GetGUID());
return UseItem(items[0], ObjectGuid::Empty, nullptr, healer);
}
const std::vector<uint32> CastCreateFirestoneAction::firestoneSpellIds = {
60220, // Create Firestone (Rank 7)
27250, // Rank 5
17953, // Rank 4
17952, // Rank 3
17951, // Rank 2
6366 // Rank 1
};
CastCreateFirestoneAction::CastCreateFirestoneAction(PlayerbotAI* botAI)
: CastBuffSpellAction(botAI, "create firestone")
{
}
bool CastCreateFirestoneAction::Execute(Event event)
{
for (uint32 spellId : firestoneSpellIds)
{
if (bot->HasSpell(spellId))
return botAI->CastSpell(spellId, bot);
}
return false;
}
bool CastCreateFirestoneAction::isUseful()
{
for (uint32 spellId : firestoneSpellIds)
{
if (bot->HasSpell(spellId))
return true;
}
return false;
}