Skip to content

Commit 9ecadd5

Browse files
authored
Minor tweeks to Priest for Vanillability (#289)
1 parent 4038609 commit 9ecadd5

8 files changed

Lines changed: 86 additions & 1 deletion

src/modules/Bots/playerbot/strategy/priest/GenericPriestStrategy.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,8 @@ void GenericPriestStrategy::InitTriggers(std::list<TriggerNode*> &triggers)
6464
"medium threat",
6565
NextAction::array(0, new NextAction("psychic scream", 50.0f), NULL)));
6666

67+
triggers.push_back(new TriggerNode(
68+
"power infusion",
69+
NextAction::array(0, new NextAction("power infusion", 8.0f), NULL)));
70+
6771
}

src/modules/Bots/playerbot/strategy/priest/GenericPriestStrategyActionNodeFactory.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ namespace ai
2525
creators["lesser heal on party"] = &lesser_heal_on_party;
2626
creators["flash heal"] = &flash_heal;
2727
creators["flash heal on party"] = &flash_heal_on_party;
28+
creators["circle of healing"] = &circle_of_healing;
2829
creators["psychic scream"] = &psychic_scream;
2930
creators["fade"] = &fade;
3031
}
@@ -155,6 +156,13 @@ namespace ai
155156
/*A*/ NextAction::array(0, new NextAction("greater heal on party"), NULL),
156157
/*C*/ NULL);
157158
}
159+
static ActionNode* circle_of_healing(PlayerbotAI* ai)
160+
{
161+
return new ActionNode ("circle of healing",
162+
/*P*/ NextAction::array(0, new NextAction("remove shadowform"), NULL),
163+
/*A*/ NextAction::array(0, new NextAction("flash heal on party"), NULL),
164+
/*C*/ NULL);
165+
}
158166
static ActionNode* psychic_scream(PlayerbotAI* ai)
159167
{
160168
return new ActionNode ("psychic scream",

src/modules/Bots/playerbot/strategy/priest/HealPriestStrategy.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,8 @@ void HealPriestStrategy::InitTriggers(std::list<TriggerNode*> &triggers)
3333
triggers.push_back(new TriggerNode(
3434
"enemy too close for spell",
3535
NextAction::array(0, new NextAction("fade", 50.0f), new NextAction("flee", 49.0f), NULL)));
36+
37+
triggers.push_back(new TriggerNode(
38+
"shackle undead",
39+
NextAction::array(0, new NextAction("shackle undead", 18.0f), NULL)));
3640
}

src/modules/Bots/playerbot/strategy/priest/PriestActions.h

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ namespace ai
166166
BEGIN_DEBUFF_ACTION(CastDevouringPlagueAction, "devouring plague")
167167
END_SPELL_ACTION()
168168

169+
BEGIN_DEBUFF_ACTION(CastVampiricTouchAction, "vampiric touch")
170+
END_SPELL_ACTION()
171+
169172
BEGIN_RANGED_SPELL_ACTION(CastMindBlastAction, "mind blast")
170173
END_SPELL_ACTION()
171174

@@ -226,4 +229,32 @@ namespace ai
226229
public:
227230
CastPsychicScreamAction(PlayerbotAI* ai) : CastSpellAction(ai, "psychic scream") {}
228231
};
232+
233+
class CastShackleUndeadAction : public CastDebuffSpellOnAttackerAction
234+
{
235+
public:
236+
CastShackleUndeadAction(PlayerbotAI* ai) : CastDebuffSpellOnAttackerAction(ai, "shackle undead") {}
237+
virtual bool isUseful()
238+
{
239+
Unit* target = GetTarget();
240+
if (!target || target->GetCreatureType() != CREATURE_TYPE_UNDEAD)
241+
return false;
242+
return CastDebuffSpellOnAttackerAction::isUseful();
243+
}
244+
virtual string getName() { return "shackle undead"; }
245+
};
246+
247+
class CastPowerInfusionAction : public BuffOnPartyAction
248+
{
249+
public:
250+
CastPowerInfusionAction(PlayerbotAI* ai) : BuffOnPartyAction(ai, "power infusion") {}
251+
virtual string getName() { return "power infusion"; }
252+
};
253+
254+
class CastCircleOfHealingAction : public HealPartyMemberAction
255+
{
256+
public:
257+
CastCircleOfHealingAction(PlayerbotAI* ai) : HealPartyMemberAction(ai, "circle of healing") {}
258+
virtual string getName() { return "circle of healing"; }
259+
};
229260
}

src/modules/Bots/playerbot/strategy/priest/PriestAiObjectContext.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,14 @@ namespace ai
8383
creators["vampiric touch"] = &TriggerFactoryInternal::vampiric_touch;
8484
creators["shadowform"] = &TriggerFactoryInternal::shadowform;
8585
creators["vampiric embrace"] = &TriggerFactoryInternal::vampiric_embrace;
86-
86+
creators["shackle undead"] = &TriggerFactoryInternal::shackle_undead;
87+
creators["power infusion"] = &TriggerFactoryInternal::power_infusion;
8788
}
8889

8990
private:
9091
static Trigger* vampiric_embrace(PlayerbotAI* ai) { return new VampiricEmbraceTrigger(ai); }
92+
static Trigger* shackle_undead(PlayerbotAI* ai) { return new ShackleUndeadTrigger(ai); }
93+
static Trigger* power_infusion(PlayerbotAI* ai) { return new PowerInfusionTrigger(ai); }
9194
static Trigger* shadowform(PlayerbotAI* ai) { return new ShadowformTrigger(ai); }
9295
static Trigger* vampiric_touch(PlayerbotAI* ai) { return new VampiricTouchTrigger(ai); }
9396
static Trigger* devouring_plague(PlayerbotAI* ai) { return new DevouringPlagueTrigger(ai); }
@@ -157,10 +160,18 @@ namespace ai
157160
creators["resurrection"] = &AiObjectContextInternal::resurrection;
158161
creators["psychic scream"] = &AiObjectContextInternal::psychic_scream;
159162
creators["vampiric embrace"] = &AiObjectContextInternal::vampiric_embrace;
163+
creators["vampiric touch"] = &AiObjectContextInternal::vampiric_touch;
164+
creators["shackle undead"] = &AiObjectContextInternal::shackle_undead;
165+
creators["power infusion"] = &AiObjectContextInternal::power_infusion;
166+
creators["circle of healing"] = &AiObjectContextInternal::circle_of_healing;
160167
}
161168

162169
private:
163170
static Action* vampiric_embrace(PlayerbotAI* ai) { return new CastVampiricEmbraceAction(ai); }
171+
static Action* vampiric_touch(PlayerbotAI* ai) { return new CastVampiricTouchAction(ai); }
172+
static Action* shackle_undead(PlayerbotAI* ai) { return new CastShackleUndeadAction(ai); }
173+
static Action* power_infusion(PlayerbotAI* ai) { return new CastPowerInfusionAction(ai); }
174+
static Action* circle_of_healing(PlayerbotAI* ai) { return new CastCircleOfHealingAction(ai); }
164175
static Action* psychic_scream(PlayerbotAI* ai) { return new CastPsychicScreamAction(ai); }
165176
static Action* resurrection(PlayerbotAI* ai) { return new CastResurrectionAction(ai); }
166177
static Action* shadow_word_pain(PlayerbotAI* ai) { return new CastPowerWordPainAction(ai); }

src/modules/Bots/playerbot/strategy/priest/PriestNonCombatStrategy.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,8 @@ void PriestNonCombatStrategy::InitTriggers(std::list<TriggerNode*> &triggers)
7979
triggers.push_back(new TriggerNode(
8080
"party member cure disease",
8181
NextAction::array(0, new NextAction("abolish disease on party", 30.0f), NULL)));
82+
83+
triggers.push_back(new TriggerNode(
84+
"power infusion",
85+
NextAction::array(0, new NextAction("power infusion", 8.0f), NULL)));
8286
}

src/modules/Bots/playerbot/strategy/priest/PriestTriggers.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,19 @@ namespace ai
5151
ShadowformTrigger(PlayerbotAI* ai) : BuffTrigger(ai, "shadowform") {}
5252
virtual bool IsActive() { return !ai->HasAura("shadowform", bot); }
5353
};
54+
55+
class ShackleUndeadTrigger : public DebuffOnAttackerTrigger
56+
{
57+
public:
58+
ShackleUndeadTrigger(PlayerbotAI* ai) : DebuffOnAttackerTrigger(ai, "shackle undead") {}
59+
virtual bool IsActive()
60+
{
61+
Unit* target = GetTargetValue()->Get();
62+
if (!target || target->GetCreatureType() != CREATURE_TYPE_UNDEAD)
63+
return false;
64+
return DebuffTrigger::IsActive();
65+
}
66+
};
67+
68+
BUFF_ON_PARTY_TRIGGER(PowerInfusionTrigger, "power infusion", "power infusion")
5469
}

src/modules/Bots/playerbot/strategy/priest/ShadowPriestStrategyActionNodeFactory.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,19 @@ namespace ai
77
public:
88
ShadowPriestStrategyActionNodeFactory()
99
{
10+
creators["vampiric touch"] = &vampiric_touch;
1011
creators["mind flay"] = &mind_flay;
1112
creators["mind blast"] = &mind_blast;
1213
creators["dispersion"] = &dispersion;
1314
}
1415
private:
16+
static ActionNode* vampiric_touch(PlayerbotAI* ai)
17+
{
18+
return new ActionNode ("vampiric touch",
19+
/*P*/ NULL,
20+
/*A*/ NextAction::array(0, new NextAction("shadow word: pain"), NULL),
21+
/*C*/ NULL);
22+
}
1523
static ActionNode* mind_flay(PlayerbotAI* ai)
1624
{
1725
return new ActionNode ("mind flay",

0 commit comments

Comments
 (0)