mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-23 21:46:24 +00:00
Item use check
This commit is contained in:
@@ -56,6 +56,9 @@ bool FollowAction::isUseful()
|
||||
return false;
|
||||
}
|
||||
Formation* formation = AI_VALUE(Formation*, "formation");
|
||||
if (!formation) {
|
||||
return false;
|
||||
}
|
||||
std::string const target = formation->GetTargetName();
|
||||
|
||||
Unit* fTarget = nullptr;
|
||||
|
||||
@@ -86,7 +86,9 @@ bool UseItemAction::UseItem(Item* item, ObjectGuid goGuid, Item* itemTarget, Uni
|
||||
if (item->GetTemplate()->Spells[i].SpellId > 0)
|
||||
{
|
||||
spellId = item->GetTemplate()->Spells[i].SpellId;
|
||||
break;
|
||||
if (!botAI->CanCastSpell(spellId, bot, false, item)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,7 +197,7 @@ bool UseItemAction::UseItem(Item* item, ObjectGuid goGuid, Item* itemTarget, Uni
|
||||
|
||||
for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; i++)
|
||||
{
|
||||
spellId = item->GetTemplate()->Spells[i].SpellId;
|
||||
uint32 spellId = item->GetTemplate()->Spells[i].SpellId;
|
||||
if (!spellId)
|
||||
continue;
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ class GenericDruidNonCombatStrategyActionNodeFactory : public NamedObjectFactory
|
||||
creators["rejuvenation on party"] = &rejuvenation_on_party;
|
||||
creators["remove curse on party"] = &remove_curse_on_party;
|
||||
creators["abolish poison on party"] = &abolish_poison_on_party;
|
||||
creators["revive"] = &revive;
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -81,6 +82,13 @@ class GenericDruidNonCombatStrategyActionNodeFactory : public NamedObjectFactory
|
||||
/*A*/ NULL,
|
||||
/*C*/ NULL);
|
||||
}
|
||||
static ActionNode* revive(PlayerbotAI* ai)
|
||||
{
|
||||
return new ActionNode ("revive",
|
||||
/*P*/ NextAction::array(0, new NextAction("caster form"), nullptr),
|
||||
/*A*/ NULL,
|
||||
/*C*/ NULL);
|
||||
}
|
||||
// static ActionNode* innervate([[maybe_unused]] PlayerbotAI* botAI)
|
||||
// {
|
||||
// return new ActionNode ("innervate",
|
||||
|
||||
Reference in New Issue
Block a user