warlock and dk strategy port

This commit is contained in:
Yunfan Li
2023-06-03 14:01:20 +08:00
parent a44b310c0a
commit 0f483047e5
27 changed files with 562 additions and 88 deletions

View File

@@ -30,6 +30,7 @@ class BloodDKStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
//creators["hysteria"] = &hysteria;
//creators["dancing weapon"] = &dancing_weapon;
//creators["dark command"] = &dark_command;
creators["taunt spell"] = &dark_command;
}
private:
@@ -37,7 +38,7 @@ class BloodDKStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
{
return new ActionNode("rune strike",
/*P*/ NextAction::array(0, new NextAction("frost presence"), nullptr),
/*A*/ NextAction::array(0, new NextAction("death coil"), nullptr),
/*A*/ nullptr,
/*C*/ nullptr);
}
@@ -56,6 +57,13 @@ class BloodDKStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
/*A*/ nullptr,
/*C*/ nullptr);
}
static ActionNode* dark_command([[maybe_unused]] PlayerbotAI* botAI)
{
return new ActionNode("dark command",
/*P*/ NextAction::array(0, new NextAction("frost presence"), NULL),
/*A*/ NextAction::array(0, new NextAction("death grip"), NULL),
/*C*/ NULL);
}
};
BloodDKStrategy::BloodDKStrategy(PlayerbotAI* botAI) : GenericDKStrategy(botAI)
@@ -65,8 +73,15 @@ BloodDKStrategy::BloodDKStrategy(PlayerbotAI* botAI) : GenericDKStrategy(botAI)
NextAction** BloodDKStrategy::getDefaultActions()
{
return NextAction::array(0, new NextAction("melee", ACTION_NORMAL + 2), new NextAction("heart strike", ACTION_NORMAL + 5),
new NextAction("death strike", ACTION_NORMAL + 4), new NextAction("rune strike", ACTION_NORMAL + 3), nullptr);
return NextAction::array(0,
new NextAction("rune strike", ACTION_NORMAL + 7),
new NextAction("heart strike", ACTION_NORMAL + 6),
new NextAction("icy touch", ACTION_NORMAL + 5),
new NextAction("death coil", ACTION_NORMAL + 4),
new NextAction("plague strike", ACTION_NORMAL + 3),
new NextAction("blood strike", ACTION_NORMAL + 2),
new NextAction("melee", ACTION_NORMAL),
NULL);
}
void BloodDKStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)

View File

@@ -3,7 +3,11 @@
*/
#include "DKActions.h"
#include "Duration.h"
#include "GenericSpellActions.h"
#include "Playerbots.h"
#include "SpellInfo.h"
#include "SpellMgr.h"
NextAction** CastDeathchillAction::getPrerequisites()
{
@@ -29,3 +33,15 @@ NextAction** CastBloodMeleeSpellAction::getPrerequisites()
{
return NextAction::merge(NextAction::array(0, new NextAction("blood presence"), nullptr), CastMeleeSpellAction::getPrerequisites());
}
bool CastRaiseDeadAction::Execute(Event event)
{
bool result = CastBuffSpellAction::Execute(event);
if (!result) {
return false;
}
uint32 spellId = AI_VALUE2(uint32, "spell id", spell);
// const SpellInfo *spellInfo = sSpellMgr->GetSpellInfo(spellId);
bot->AddSpellCooldown(spellId, 0, 3 * 60 * 1000);
return true;
}

View File

@@ -5,6 +5,7 @@
#ifndef _PLAYERBOT_DKACTIONS_H
#define _PLAYERBOT_DKACTIONS_H
#include "Event.h"
#include "GenericSpellActions.h"
class PlayerbotAI;
@@ -80,16 +81,30 @@ class CastRuneStrikeAction : public CastMeleeSpellAction
};
//debuff
BEGIN_DEBUFF_ACTION(CastPestilenceAction, "pestilence")
END_SPELL_ACTION()
// BEGIN_DEBUFF_ACTION(CastPestilenceAction, "pestilence")
// END_SPELL_ACTION()
class CastPestilenceAction : public CastSpellAction
{
public:
CastPestilenceAction(PlayerbotAI* ai) : CastSpellAction(ai, "pestilence") {}
ActionThreatType getThreatType() override { return ActionThreatType::None; }
};
//debuff
BEGIN_DEBUFF_ACTION(CastHowlingBlastAction, "howling blast")
END_SPELL_ACTION()
//debuff it
BEGIN_DEBUFF_ACTION(CastIcyTouchAction, "icy touch")
END_SPELL_ACTION()
// BEGIN_DEBUFF_ACTION(CastIcyTouchAction, "icy touch")
// END_SPELL_ACTION()
class CastIcyTouchAction : public CastSpellAction
{
public:
CastIcyTouchAction(PlayerbotAI* ai) : CastSpellAction(ai, "icy touch") {}
};
class CastIcyTouchOnAttackerAction : public CastDebuffSpellOnAttackerAction
{
@@ -189,13 +204,13 @@ class CastDeathStrikeAction : public CastMeleeSpellAction
class CastScourgeStrikeAction : public CastMeleeSpellAction
{
public:
CastScourgeStrikeAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "scorgue strike") { }
CastScourgeStrikeAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "scourge strike") { }
};
class CastDeathCoilAction : public CastSpellAction
{
public:
CastDeathCoilAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "death coill") { }
CastDeathCoilAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "death coil") { }
};
class CastBloodBoilAction : public CastBuffSpellAction
@@ -262,6 +277,7 @@ class CastRaiseDeadAction : public CastBuffSpellAction
{
public:
CastRaiseDeadAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "raise dead") { }
virtual bool Execute(Event event) override;
};
class CastKillingMachineAction : public CastBuffSpellAction

View File

@@ -4,9 +4,24 @@
#include "DKTriggers.h"
#include "Playerbots.h"
#include "SharedDefines.h"
#include <string>
bool DKPresenceTrigger::IsActive()
{
Unit* target = GetTarget();
return !botAI->HasAura("blood presence", target) && !botAI->HasAura("unholy presence", target) && !botAI->HasAura("frost presence", target);
}
bool PestilenceTrigger::IsActive() {
if (!SpellTrigger::IsActive()) {
return false;
}
Aura *blood_plague = botAI->GetAura("blood plague", GetTarget(), true, true);
Aura *frost_fever = botAI->GetAura("frost fever", GetTarget(), true, true);
if ((blood_plague && blood_plague->GetDuration() <= 5000) ||
(frost_fever && frost_fever->GetDuration() <= 5000)) {
return true;
}
return false;
}

View File

@@ -12,19 +12,19 @@ class PlayerbotAI;
BUFF_TRIGGER(HornOfWinterTrigger, "horn of winter");
BUFF_TRIGGER(BoneShieldTrigger, "bone shield");
BUFF_TRIGGER(ImprovedIcyTalonsTrigger, "improved icy talons");
DEBUFF_CHECKISOWNER_TRIGGER(PlagueStrikeDebuffTrigger, "plague strike");
DEBUFF_CHECKISOWNER_TRIGGER(IcyTouchDebuffTrigger, "icy touch");
DEBUFF_CHECKISOWNER_TRIGGER(PlagueStrikeDebuffTrigger, "blood plague");
DEBUFF_CHECKISOWNER_TRIGGER(IcyTouchDebuffTrigger, "frost fever");
class PlagueStrikeDebuffOnAttackerTrigger : public DebuffOnAttackerTrigger
{
public:
PlagueStrikeDebuffOnAttackerTrigger(PlayerbotAI* botAI) : DebuffOnAttackerTrigger(botAI, "plague strike", true) { }
PlagueStrikeDebuffOnAttackerTrigger(PlayerbotAI* botAI) : DebuffOnAttackerTrigger(botAI, "blood plague", true) { }
};
class IcyTouchDebuffOnAttackerTrigger : public DebuffOnAttackerTrigger
{
public:
IcyTouchDebuffOnAttackerTrigger(PlayerbotAI* botAI) : DebuffOnAttackerTrigger(botAI, "icy touch", true) { }
IcyTouchDebuffOnAttackerTrigger(PlayerbotAI* botAI) : DebuffOnAttackerTrigger(botAI, "frost fever", true) { }
};
class DKPresenceTrigger : public BuffTrigger
@@ -63,6 +63,7 @@ class PestilenceTrigger : public DebuffTrigger
{
public:
PestilenceTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "pestilence") { }
virtual bool IsActive() override;
};
class BloodStrikeTrigger : public DebuffTrigger

View File

@@ -34,7 +34,7 @@ class FrostDKStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
{
return new ActionNode("obliterate",
/*P*/ NextAction::array(0, new NextAction("blood presence"), nullptr),
/*A*/ NextAction::array(0, new NextAction("frost strike"), nullptr),
/*A*/ nullptr,
/*C*/ nullptr);
}
@@ -58,7 +58,7 @@ class FrostDKStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
{
return new ActionNode("howling blast",
/*P*/ NextAction::array(0, new NextAction("blood presence"), nullptr),
/*A*/ NextAction::array(0, new NextAction("icy touch"), nullptr),
/*A*/ nullptr,
/*C*/ nullptr);
}
};
@@ -70,7 +70,13 @@ FrostDKStrategy::FrostDKStrategy(PlayerbotAI* botAI) : GenericDKStrategy(botAI)
NextAction** FrostDKStrategy::getDefaultActions()
{
return NextAction::array(0, new NextAction("melee", ACTION_NORMAL), new NextAction("frost strike", ACTION_NORMAL + 5), new NextAction("obliterate", ACTION_NORMAL + 4), nullptr);
return NextAction::array(0,
new NextAction("obliterate", ACTION_NORMAL + 5),
new NextAction("frost strike", ACTION_NORMAL + 4),
// new NextAction("death strike", ACTION_NORMAL + 3),
new NextAction("melee", ACTION_NORMAL),
NULL
);
}
void FrostDKStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
@@ -78,6 +84,7 @@ void FrostDKStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
GenericDKStrategy::InitTriggers(triggers);
triggers.push_back(new TriggerNode("empower weapon", NextAction::array(0, new NextAction("empower weapon", ACTION_NORMAL + 4), nullptr)));
triggers.push_back(new TriggerNode("pestilence", NextAction::array(0, new NextAction("pestilence", ACTION_HIGH + 9), NULL)));
}
void FrostDKAoeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)

View File

@@ -54,7 +54,7 @@ class GenericDKStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
{
return new ActionNode("death coil",
/*P*/ nullptr,
/*A*/ NextAction::array(0, new NextAction("death strike"), nullptr),
/*A*/ nullptr,
/*C*/ nullptr);
}
@@ -86,7 +86,7 @@ class GenericDKStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
{
return new ActionNode("heart strike",
/*P*/ nullptr,
/*A*/ NextAction::array(0, new NextAction("blood strike"), nullptr),
/*A*/ nullptr,
/*C*/ nullptr);
}
@@ -158,21 +158,20 @@ void GenericDKStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
MeleeCombatStrategy::InitTriggers(triggers);
triggers.push_back(new TriggerNode("high aoe", NextAction::array(0, new NextAction("anti magic shell", ACTION_NORMAL + 3), nullptr)));
triggers.push_back(new TriggerNode("death coil", NextAction::array(0, new NextAction("death coil", ACTION_NORMAL + 3), nullptr)));
// triggers.push_back(new TriggerNode("death coil", NextAction::array(0, new NextAction("death coil", ACTION_NORMAL + 3), nullptr)));
triggers.push_back(new TriggerNode("critical aoe heal", NextAction::array(0, new NextAction("anti magic zone", ACTION_EMERGENCY + 1), nullptr)));
triggers.push_back(new TriggerNode("no pet", NextAction::array(0, new NextAction("raise dead", ACTION_NORMAL + 5), nullptr)));
triggers.push_back(new TriggerNode("mind freeze", NextAction::array(0, new NextAction("mind freeze", ACTION_HIGH + 1), nullptr)));
triggers.push_back(new TriggerNode("bone shield", NextAction::array(0, new NextAction("bone shield", ACTION_NORMAL + 1), nullptr)));
triggers.push_back(new TriggerNode("horn of winter", NextAction::array(0, new NextAction("horn of winter", ACTION_NORMAL + 1), nullptr)));
triggers.push_back(new TriggerNode("mind freeze on enemy healer", NextAction::array(0, new NextAction("mind freeze on enemy healer", ACTION_HIGH + 1), nullptr)));
triggers.push_back(new TriggerNode("enemy out of melee", NextAction::array(0, new NextAction("icy touch", ACTION_NORMAL + 9),
new NextAction("death grip", ACTION_NORMAL + 9), new NextAction("reach melee", ACTION_NORMAL + 8), nullptr)));
triggers.push_back(new TriggerNode("enemy out of melee", NextAction::array(0, new NextAction("reach melee", ACTION_NORMAL + 8), nullptr)));
triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("icebound fortitude", ACTION_HIGH + 5), new NextAction("rune tap", ACTION_HIGH + 4), nullptr)));
triggers.push_back(new TriggerNode("medium health", NextAction::array(0, new NextAction("rune tap", ACTION_NORMAL + 4), new NextAction("death strike", ACTION_NORMAL + 3), nullptr)));
triggers.push_back(new TriggerNode("icy touch on attacker", NextAction::array(0, new NextAction("icy touch", ACTION_HIGH + 1), nullptr)));
triggers.push_back(new TriggerNode("icy touch", NextAction::array(0, new NextAction("icy touch", ACTION_HIGH + 1), nullptr)));
// triggers.push_back(new TriggerNode("icy touch on attacker", NextAction::array(0, new NextAction("icy touch on attacker", ACTION_HIGH + 1), nullptr)));
triggers.push_back(new TriggerNode("plague strike", NextAction::array(0, new NextAction("plague strike", ACTION_HIGH + 1), nullptr)));
triggers.push_back(new TriggerNode("plague strike on attacker", NextAction::array(0, new NextAction("plague strike", ACTION_HIGH + 1), nullptr)));
// triggers.push_back(new TriggerNode("plague strike on attacker", NextAction::array(0, new NextAction("plague strike on attacker", ACTION_HIGH + 1), nullptr)));
triggers.push_back(new TriggerNode("high aoe", NextAction::array(0, new NextAction("unholy blight", ACTION_NORMAL + 6), new NextAction("death and decay", ACTION_NORMAL + 5),
new NextAction("pestilence", ACTION_NORMAL + 4), new NextAction("blood boil", ACTION_NORMAL + 3), nullptr)));
triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, new NextAction("death and decay", ACTION_NORMAL + 5),

View File

@@ -33,7 +33,7 @@ class UnholyDKStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
static ActionNode* death_strike([[maybe_unused]] PlayerbotAI* botAI)
{
return new ActionNode("death strike",
/*P*/ NextAction::array(0, new NextAction("unholy pressence"), nullptr),
/*P*/ NextAction::array(0, new NextAction("blood presence"), nullptr),
/*A*/ nullptr,
/*C*/ nullptr);
}
@@ -41,7 +41,7 @@ class UnholyDKStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
static ActionNode* corpse_explosion([[maybe_unused]] PlayerbotAI* botAI)
{
return new ActionNode("corpse explosion",
/*P*/ NextAction::array(0, new NextAction("unholy pressence"), nullptr),
/*P*/ NextAction::array(0, new NextAction("blood presence"), nullptr),
/*A*/ nullptr,
/*C*/ nullptr);
}
@@ -49,15 +49,22 @@ class UnholyDKStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
static ActionNode* scourge_strike([[maybe_unused]] PlayerbotAI* botAI)
{
return new ActionNode("scourge strike",
/*P*/ NextAction::array(0, new NextAction("unholy pressence"), nullptr),
/*A*/ NextAction::array(0, new NextAction("death strike"), nullptr),
/*P*/ NextAction::array(0, new NextAction("blood presence"), nullptr),
/*A*/ nullptr,
/*C*/ nullptr);
}
};
NextAction** UnholyDKStrategy::getDefaultActions()
{
return NextAction::array(0, new NextAction("melee", ACTION_NORMAL), new NextAction("scourge strike" , ACTION_NORMAL + 3), nullptr);
return NextAction::array(0,
new NextAction("scourge strike", ACTION_NORMAL + 6),
new NextAction("blood strike", ACTION_NORMAL + 5),
new NextAction("death coil", ACTION_NORMAL + 4),
new NextAction("plague strike", ACTION_NORMAL + 3),
new NextAction("icy touch", ACTION_NORMAL + 2),
new NextAction("melee", ACTION_NORMAL),
NULL);
}
void UnholyDKStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)