mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-18 11:15:43 +00:00
Warlock overhaul (#1397)
This is a complete overhaul of the warlock class, making 3 new strategies (affliction, demonology, and destruction), as well as finishing the warlock tank strategy (shadow ward and searing pain). It also includes a soulstone fix, where the bots can change who they soulstone based on the non-combat strategies you set for them. It also includes a self-resurrect action and trigger that allows the bots to resurrect using a soulstone or reincarnation. Many other skills were added to finish out the warlock skillset.
This commit is contained in:
@@ -14,10 +14,25 @@ enum PetSpells
|
||||
PET_PROWL_2 = 24452,
|
||||
PET_PROWL_3 = 24453,
|
||||
PET_COWER = 1742,
|
||||
PET_LEAP = 47482
|
||||
PET_LEAP = 47482,
|
||||
PET_SPELL_LOCK_1 = 19244,
|
||||
PET_SPELL_LOCK_2 = 19647,
|
||||
PET_DEVOUR_MAGIC_1 = 19505,
|
||||
PET_DEVOUR_MAGIC_2 = 19731,
|
||||
PET_DEVOUR_MAGIC_3 = 19734,
|
||||
PET_DEVOUR_MAGIC_4 = 19736,
|
||||
PET_DEVOUR_MAGIC_5 = 27276,
|
||||
PET_DEVOUR_MAGIC_6 = 27277,
|
||||
PET_DEVOUR_MAGIC_7 = 48011
|
||||
};
|
||||
|
||||
static std::vector<uint32> disabledPetSpells = {PET_PROWL_1, PET_PROWL_2, PET_PROWL_3, PET_COWER, PET_LEAP};
|
||||
static std::vector<uint32> disabledPetSpells = {
|
||||
PET_PROWL_1, PET_PROWL_2, PET_PROWL_3,
|
||||
PET_COWER, PET_LEAP,
|
||||
PET_SPELL_LOCK_1, PET_SPELL_LOCK_2,
|
||||
PET_DEVOUR_MAGIC_1, PET_DEVOUR_MAGIC_2, PET_DEVOUR_MAGIC_3,
|
||||
PET_DEVOUR_MAGIC_4, PET_DEVOUR_MAGIC_5, PET_DEVOUR_MAGIC_6, PET_DEVOUR_MAGIC_7
|
||||
};
|
||||
|
||||
bool MeleeAction::isUseful()
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
#include "ReleaseSpiritAction.h"
|
||||
|
||||
#include "ServerFacade.h"
|
||||
#include "Event.h"
|
||||
#include "GameGraveyard.h"
|
||||
#include "NearestNpcsValue.h"
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "Playerbots.h"
|
||||
#include "ServerFacade.h"
|
||||
#include "Corpse.h"
|
||||
#include "Log.h"
|
||||
|
||||
// ReleaseSpiritAction implementation
|
||||
bool ReleaseSpiritAction::Execute(Event event)
|
||||
@@ -247,3 +248,19 @@ void RepopAction::PerformGraveyardTeleport(const GraveyardStruct* graveyard) con
|
||||
RESET_AI_VALUE(bool, "combat::self target");
|
||||
RESET_AI_VALUE(WorldPosition, "current position");
|
||||
}
|
||||
|
||||
// SelfResurrectAction implementation for Warlock's Soulstone Resurrection/Shaman's Reincarnation
|
||||
bool SelfResurrectAction::Execute(Event event)
|
||||
{
|
||||
if (!bot->IsAlive() && bot->GetUInt32Value(PLAYER_SELF_RES_SPELL))
|
||||
{
|
||||
WorldPacket packet(CMSG_SELF_RES);
|
||||
bot->GetSession()->HandleSelfResOpcode(packet);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool SelfResurrectAction::isUseful()
|
||||
{
|
||||
return !bot->IsAlive() && bot->GetUInt32Value(PLAYER_SELF_RES_SPELL);
|
||||
}
|
||||
|
||||
@@ -56,4 +56,13 @@ private:
|
||||
void PerformGraveyardTeleport(const GraveyardStruct* graveyard) const;
|
||||
};
|
||||
|
||||
// SelfResurrectAction action registration
|
||||
class SelfResurrectAction : public Action
|
||||
{
|
||||
public:
|
||||
SelfResurrectAction(PlayerbotAI* ai) : Action(ai, "self resurrect") {}
|
||||
virtual bool Execute(Event event) override;
|
||||
bool isUseful() override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -238,9 +238,24 @@ bool UseItemAction::UseItem(Item* item, ObjectGuid goGuid, Item* itemTarget, Uni
|
||||
{
|
||||
targetFlag = TARGET_FLAG_NONE;
|
||||
packet << targetFlag;
|
||||
packet << bot->GetPackGUID();
|
||||
targetSelected = true;
|
||||
out << " on self";
|
||||
|
||||
// Use the actual target if provided
|
||||
if (unitTarget)
|
||||
{
|
||||
packet << unitTarget->GetGUID();
|
||||
targetSelected = true;
|
||||
// If the target is bot or is an enemy, say "on self"
|
||||
if (unitTarget == bot || (unitTarget->IsHostileTo(bot)))
|
||||
out << " on self";
|
||||
else
|
||||
out << " on " << unitTarget->GetName();
|
||||
}
|
||||
else
|
||||
{
|
||||
packet << bot->GetPackGUID();
|
||||
targetSelected = true;
|
||||
out << " on self";
|
||||
}
|
||||
}
|
||||
|
||||
ItemTemplate const* proto = item->GetTemplate();
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "TradeStatusExtendedAction.h"
|
||||
#include "UseMeetingStoneAction.h"
|
||||
#include "NamedObjectContext.h"
|
||||
#include "ReleaseSpiritAction.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
@@ -68,6 +69,7 @@ public:
|
||||
creators["accept trade"] = &WorldPacketActionContext::accept_trade;
|
||||
creators["trade status extended"] = &WorldPacketActionContext::trade_status_extended;
|
||||
creators["store loot"] = &WorldPacketActionContext::store_loot;
|
||||
creators["self resurrect"] = &WorldPacketActionContext::self_resurrect;
|
||||
|
||||
// quest
|
||||
creators["talk to quest giver"] = &WorldPacketActionContext::turn_in_quest;
|
||||
@@ -136,6 +138,7 @@ private:
|
||||
static Action* tell_not_enough_money(PlayerbotAI* botAI) { return new TellMasterAction(botAI, "Not enough money"); }
|
||||
static Action* tell_not_enough_reputation(PlayerbotAI* botAI) { return new TellMasterAction(botAI, "Not enough reputation"); }
|
||||
static Action* tell_cannot_equip(PlayerbotAI* botAI) { return new InventoryChangeFailureAction(botAI); }
|
||||
static Action* self_resurrect(PlayerbotAI* botAI) { return new SelfResurrectAction(botAI); }
|
||||
|
||||
// quest
|
||||
static Action* quest_update_add_kill(PlayerbotAI* ai) { return new QuestUpdateAddKillAction(ai); }
|
||||
|
||||
Reference in New Issue
Block a user