mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
[Class spell] Improve warrior, dk, paladin
This commit is contained in:
@@ -67,7 +67,7 @@ class DeathKnightTriggerFactoryInternal : public NamedObjectContext<Trigger>
|
|||||||
DeathKnightTriggerFactoryInternal()
|
DeathKnightTriggerFactoryInternal()
|
||||||
{
|
{
|
||||||
creators["bone shield"] = &DeathKnightTriggerFactoryInternal::bone_shield;
|
creators["bone shield"] = &DeathKnightTriggerFactoryInternal::bone_shield;
|
||||||
creators["pestilence"] = &DeathKnightTriggerFactoryInternal::pestilence;
|
creators["pestilence glyph"] = &DeathKnightTriggerFactoryInternal::pestilence_glyph;
|
||||||
creators["blood strike"] = &DeathKnightTriggerFactoryInternal::blood_strike;
|
creators["blood strike"] = &DeathKnightTriggerFactoryInternal::blood_strike;
|
||||||
creators["plague strike"] = &DeathKnightTriggerFactoryInternal::plague_strike;
|
creators["plague strike"] = &DeathKnightTriggerFactoryInternal::plague_strike;
|
||||||
creators["plague strike on attacker"] = &DeathKnightTriggerFactoryInternal::plague_strike_on_attacker;
|
creators["plague strike on attacker"] = &DeathKnightTriggerFactoryInternal::plague_strike_on_attacker;
|
||||||
@@ -94,7 +94,7 @@ class DeathKnightTriggerFactoryInternal : public NamedObjectContext<Trigger>
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static Trigger* bone_shield(PlayerbotAI* botAI) { return new BoneShieldTrigger(botAI); }
|
static Trigger* bone_shield(PlayerbotAI* botAI) { return new BoneShieldTrigger(botAI); }
|
||||||
static Trigger* pestilence(PlayerbotAI* botAI) { return new PestilenceTrigger(botAI); }
|
static Trigger* pestilence_glyph(PlayerbotAI* botAI) { return new PestilenceGlyphTrigger(botAI); }
|
||||||
static Trigger* blood_strike(PlayerbotAI* botAI) { return new BloodStrikeTrigger(botAI); }
|
static Trigger* blood_strike(PlayerbotAI* botAI) { return new BloodStrikeTrigger(botAI); }
|
||||||
static Trigger* plague_strike(PlayerbotAI* botAI) { return new PlagueStrikeDebuffTrigger(botAI); }
|
static Trigger* plague_strike(PlayerbotAI* botAI) { return new PlagueStrikeDebuffTrigger(botAI); }
|
||||||
static Trigger* plague_strike_on_attacker(PlayerbotAI* botAI) { return new PlagueStrikeDebuffOnAttackerTrigger(botAI); }
|
static Trigger* plague_strike_on_attacker(PlayerbotAI* botAI) { return new PlagueStrikeDebuffOnAttackerTrigger(botAI); }
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ bool DKPresenceTrigger::IsActive()
|
|||||||
return !botAI->HasAura("blood presence", target) && !botAI->HasAura("unholy presence", target) && !botAI->HasAura("frost presence", target);
|
return !botAI->HasAura("blood presence", target) && !botAI->HasAura("unholy presence", target) && !botAI->HasAura("frost presence", target);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PestilenceTrigger::IsActive() {
|
bool PestilenceGlyphTrigger::IsActive() {
|
||||||
if (!SpellTrigger::IsActive()) {
|
if (!SpellTrigger::IsActive()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,10 +71,10 @@ class DeathCoilTrigger : public SpellCanBeCastTrigger
|
|||||||
DeathCoilTrigger(PlayerbotAI* botAI) : SpellCanBeCastTrigger(botAI, "death coil") { }
|
DeathCoilTrigger(PlayerbotAI* botAI) : SpellCanBeCastTrigger(botAI, "death coil") { }
|
||||||
};
|
};
|
||||||
|
|
||||||
class PestilenceTrigger : public DebuffTrigger
|
class PestilenceGlyphTrigger : public SpellTrigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PestilenceTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "pestilence") { }
|
PestilenceGlyphTrigger(PlayerbotAI* botAI) : SpellTrigger(botAI, "pestilence") { }
|
||||||
virtual bool IsActive() override;
|
virtual bool IsActive() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -192,5 +192,5 @@ void GenericDKStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
|||||||
// triggers.push_back(new TriggerNode("light aoe", NextAction::array(0,
|
// triggers.push_back(new TriggerNode("light aoe", NextAction::array(0,
|
||||||
// new NextAction("pestilence", ACTION_NORMAL + 4),
|
// new NextAction("pestilence", ACTION_NORMAL + 4),
|
||||||
// nullptr)));
|
// nullptr)));
|
||||||
triggers.push_back(new TriggerNode("pestilence", NextAction::array(0, new NextAction("pestilence", ACTION_HIGH + 9), NULL)));
|
triggers.push_back(new TriggerNode("pestilence glyph", NextAction::array(0, new NextAction("pestilence", ACTION_HIGH + 9), NULL)));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ bool CastMeleeConsecrationAction::isUseful()
|
|||||||
{
|
{
|
||||||
Unit* target = GetTarget();
|
Unit* target = GetTarget();
|
||||||
// float dis = distance + CONTACT_DISTANCE;
|
// float dis = distance + CONTACT_DISTANCE;
|
||||||
return target && bot->IsWithinCombatRange(target, sPlayerbotAIConfig->meleeDistance); // sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float, "distance", GetTargetName()), distance);
|
return target && bot->IsWithinMeleeRange(target); // sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float, "distance", GetTargetName()), distance);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CastDivineSacrificeAction::isUseful()
|
bool CastDivineSacrificeAction::isUseful()
|
||||||
|
|||||||
@@ -94,6 +94,9 @@ void TankPaladinStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
|||||||
triggers.push_back(new TriggerNode(
|
triggers.push_back(new TriggerNode(
|
||||||
"medium group heal occasion",
|
"medium group heal occasion",
|
||||||
NextAction::array(0, new NextAction("divine sacrifice", ACTION_HIGH + 5), nullptr)));
|
NextAction::array(0, new NextAction("divine sacrifice", ACTION_HIGH + 5), nullptr)));
|
||||||
|
triggers.push_back(new TriggerNode(
|
||||||
|
"enough mana",
|
||||||
|
NextAction::array(0, new NextAction("melee consecration", ACTION_HIGH + 4), nullptr)));
|
||||||
triggers.push_back(new TriggerNode(
|
triggers.push_back(new TriggerNode(
|
||||||
"not facing target",
|
"not facing target",
|
||||||
NextAction::array(0, new NextAction("set facing", ACTION_NORMAL + 7), nullptr)));
|
NextAction::array(0, new NextAction("set facing", ACTION_NORMAL + 7), nullptr)));
|
||||||
|
|||||||
@@ -64,6 +64,11 @@ bool AlmostFullManaTrigger::IsActive()
|
|||||||
return AI_VALUE2(bool, "has mana", "self target") && AI_VALUE2(uint8, "mana", "self target") > 85;
|
return AI_VALUE2(bool, "has mana", "self target") && AI_VALUE2(uint8, "mana", "self target") > 85;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool EnoughManaTrigger::IsActive()
|
||||||
|
{
|
||||||
|
return AI_VALUE2(bool, "has mana", "self target") && AI_VALUE2(uint8, "mana", "self target") > 65;
|
||||||
|
}
|
||||||
|
|
||||||
bool RageAvailable::IsActive()
|
bool RageAvailable::IsActive()
|
||||||
{
|
{
|
||||||
return AI_VALUE2(uint8, "rage", "self target") >= amount;
|
return AI_VALUE2(uint8, "rage", "self target") >= amount;
|
||||||
|
|||||||
@@ -30,6 +30,14 @@ class HighManaTrigger : public Trigger
|
|||||||
bool IsActive() override;
|
bool IsActive() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class EnoughManaTrigger : public Trigger
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
EnoughManaTrigger(PlayerbotAI* botAI) : Trigger(botAI, "enough mana") { }
|
||||||
|
|
||||||
|
bool IsActive() override;
|
||||||
|
};
|
||||||
|
|
||||||
class AlmostFullManaTrigger : public Trigger
|
class AlmostFullManaTrigger : public Trigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ class TriggerContext : public NamedObjectContext<Trigger>
|
|||||||
creators["medium mana"] = &TriggerContext::MediumMana;
|
creators["medium mana"] = &TriggerContext::MediumMana;
|
||||||
creators["high mana"] = &TriggerContext::HighMana;
|
creators["high mana"] = &TriggerContext::HighMana;
|
||||||
creators["almost full mana"] = &TriggerContext::AlmostFullMana;
|
creators["almost full mana"] = &TriggerContext::AlmostFullMana;
|
||||||
|
creators["enough mana"] = &TriggerContext::EnoughMana;
|
||||||
|
|
||||||
creators["party member critical health"] = &TriggerContext::PartyMemberCriticalHealth;
|
creators["party member critical health"] = &TriggerContext::PartyMemberCriticalHealth;
|
||||||
creators["party member low health"] = &TriggerContext::PartyMemberLowHealth;
|
creators["party member low health"] = &TriggerContext::PartyMemberLowHealth;
|
||||||
@@ -253,6 +254,7 @@ class TriggerContext : public NamedObjectContext<Trigger>
|
|||||||
static Trigger* MediumMana(PlayerbotAI* botAI) { return new MediumManaTrigger(botAI); }
|
static Trigger* MediumMana(PlayerbotAI* botAI) { return new MediumManaTrigger(botAI); }
|
||||||
static Trigger* HighMana(PlayerbotAI* botAI) { return new HighManaTrigger(botAI); }
|
static Trigger* HighMana(PlayerbotAI* botAI) { return new HighManaTrigger(botAI); }
|
||||||
static Trigger* AlmostFullMana(PlayerbotAI* botAI) { return new AlmostFullManaTrigger(botAI); }
|
static Trigger* AlmostFullMana(PlayerbotAI* botAI) { return new AlmostFullManaTrigger(botAI); }
|
||||||
|
static Trigger* EnoughMana(PlayerbotAI* botAI) { return new EnoughManaTrigger(botAI); }
|
||||||
static Trigger* LightRageAvailable(PlayerbotAI* botAI) { return new LightRageAvailableTrigger(botAI); }
|
static Trigger* LightRageAvailable(PlayerbotAI* botAI) { return new LightRageAvailableTrigger(botAI); }
|
||||||
static Trigger* MediumRageAvailable(PlayerbotAI* botAI) { return new MediumRageAvailableTrigger(botAI); }
|
static Trigger* MediumRageAvailable(PlayerbotAI* botAI) { return new MediumRageAvailableTrigger(botAI); }
|
||||||
static Trigger* HighRageAvailable(PlayerbotAI* botAI) { return new HighRageAvailableTrigger(botAI); }
|
static Trigger* HighRageAvailable(PlayerbotAI* botAI) { return new HighRageAvailableTrigger(botAI); }
|
||||||
|
|||||||
@@ -32,7 +32,9 @@ ArmsWarriorStrategy::ArmsWarriorStrategy(PlayerbotAI* botAI) : GenericWarriorStr
|
|||||||
|
|
||||||
NextAction** ArmsWarriorStrategy::getDefaultActions()
|
NextAction** ArmsWarriorStrategy::getDefaultActions()
|
||||||
{
|
{
|
||||||
return NextAction::array(0, new NextAction("heroic strike", ACTION_DEFAULT), nullptr);
|
return NextAction::array(0,
|
||||||
|
new NextAction("bladestorm", ACTION_DEFAULT + 0.1f),
|
||||||
|
new NextAction("melee", ACTION_DEFAULT), nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ArmsWarriorStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
void ArmsWarriorStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||||
@@ -56,4 +58,5 @@ void ArmsWarriorStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
|||||||
triggers.push_back(new TriggerNode("rend", NextAction::array(0, new NextAction("rend", ACTION_HIGH + 5), nullptr)));
|
triggers.push_back(new TriggerNode("rend", NextAction::array(0, new NextAction("rend", ACTION_HIGH + 5), nullptr)));
|
||||||
triggers.push_back(new TriggerNode("rend on attacker", NextAction::array(0, new NextAction("rend on attacker", ACTION_HIGH + 5), nullptr)));
|
triggers.push_back(new TriggerNode("rend on attacker", NextAction::array(0, new NextAction("rend on attacker", ACTION_HIGH + 5), nullptr)));
|
||||||
triggers.push_back(new TriggerNode("critical health", NextAction::array(0, new NextAction("intimidating shout", ACTION_EMERGENCY), nullptr)));
|
triggers.push_back(new TriggerNode("critical health", NextAction::array(0, new NextAction("intimidating shout", ACTION_EMERGENCY), nullptr)));
|
||||||
|
triggers.push_back(new TriggerNode("medium rage available", NextAction::array(0, new NextAction("thunder clap", ACTION_HIGH + 1), nullptr)));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ void FuryWarriorStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
|||||||
triggers.push_back(new TriggerNode("bloodthirst", NextAction::array(0, new NextAction("bloodthirst", ACTION_HIGH + 7), nullptr)));
|
triggers.push_back(new TriggerNode("bloodthirst", NextAction::array(0, new NextAction("bloodthirst", ACTION_HIGH + 7), nullptr)));
|
||||||
triggers.push_back(new TriggerNode("instant slam", NextAction::array(0, new NextAction("slam", ACTION_HIGH + 5), nullptr)));
|
triggers.push_back(new TriggerNode("instant slam", NextAction::array(0, new NextAction("slam", ACTION_HIGH + 5), nullptr)));
|
||||||
triggers.push_back(new TriggerNode("bloodrage", NextAction::array(0, new NextAction("bloodrage", ACTION_HIGH + 2), nullptr)));
|
triggers.push_back(new TriggerNode("bloodrage", NextAction::array(0, new NextAction("bloodrage", ACTION_HIGH + 2), nullptr)));
|
||||||
triggers.push_back(new TriggerNode("high rage available", NextAction::array(0, new NextAction("heroic strike", ACTION_HIGH + 1), NULL)));
|
triggers.push_back(new TriggerNode("medium rage available", NextAction::array(0, new NextAction("heroic strike", ACTION_HIGH + 1), NULL)));
|
||||||
// triggers.push_back(new TriggerNode("berserker rage", NextAction::array(0, new NextAction("berserker rage", ACTION_HIGH + 2), nullptr)));
|
// triggers.push_back(new TriggerNode("berserker rage", NextAction::array(0, new NextAction("berserker rage", ACTION_HIGH + 2), nullptr)));
|
||||||
// triggers.push_back(new TriggerNode("light aoe", NextAction::array(0,
|
// triggers.push_back(new TriggerNode("light aoe", NextAction::array(0,
|
||||||
// new NextAction("whirlwind", ACTION_HIGH + 2),
|
// new NextAction("whirlwind", ACTION_HIGH + 2),
|
||||||
|
|||||||
@@ -88,4 +88,6 @@ void TankWarriorStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
|||||||
triggers.push_back(new TriggerNode("rend", NextAction::array(0, new NextAction("rend", ACTION_NORMAL + 1), nullptr)));
|
triggers.push_back(new TriggerNode("rend", NextAction::array(0, new NextAction("rend", ACTION_NORMAL + 1), nullptr)));
|
||||||
triggers.push_back(new TriggerNode("rend on attacker", NextAction::array(0, new NextAction("rend on attacker", ACTION_NORMAL + 1), nullptr)));
|
triggers.push_back(new TriggerNode("rend on attacker", NextAction::array(0, new NextAction("rend on attacker", ACTION_NORMAL + 1), nullptr)));
|
||||||
triggers.push_back(new TriggerNode("protect party member", NextAction::array(0, new NextAction("intervene", ACTION_EMERGENCY), nullptr)));
|
triggers.push_back(new TriggerNode("protect party member", NextAction::array(0, new NextAction("intervene", ACTION_EMERGENCY), nullptr)));
|
||||||
|
triggers.push_back(new TriggerNode("high rage available", NextAction::array(0, new NextAction("heroic strike", ACTION_HIGH + 1), nullptr)));
|
||||||
|
triggers.push_back(new TriggerNode("medium rage available", NextAction::array(0, new NextAction("thunder clap", ACTION_HIGH + 1), nullptr)));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ class WarriorTriggerFactoryInternal : public NamedObjectContext<Trigger>
|
|||||||
static Trigger* SwordAndBoard(PlayerbotAI* botAI) { return new SwordAndBoardTrigger(botAI); }
|
static Trigger* SwordAndBoard(PlayerbotAI* botAI) { return new SwordAndBoardTrigger(botAI); }
|
||||||
static Trigger* shield_bash_on_enemy_healer(PlayerbotAI* botAI) { return new ShieldBashInterruptEnemyHealerSpellTrigger(botAI); }
|
static Trigger* shield_bash_on_enemy_healer(PlayerbotAI* botAI) { return new ShieldBashInterruptEnemyHealerSpellTrigger(botAI); }
|
||||||
|
|
||||||
static Trigger* thunderclap_and_rage(PlayerbotAI* botAI) { return new TwoTriggers(botAI, "thunderclap", "light rage available"); }
|
static Trigger* thunderclap_and_rage(PlayerbotAI* botAI) { return new TwoTriggers(botAI, "thunder clap", "light rage available"); }
|
||||||
static Trigger* intercept_can_cast(PlayerbotAI* botAI) { return new InterceptCanCastTrigger(botAI); }
|
static Trigger* intercept_can_cast(PlayerbotAI* botAI) { return new InterceptCanCastTrigger(botAI); }
|
||||||
static Trigger* intercept_and_far_enemy(PlayerbotAI* botAI) { return new TwoTriggers(botAI, "enemy is out of melee", "intercept can cast"); }
|
static Trigger* intercept_and_far_enemy(PlayerbotAI* botAI) { return new TwoTriggers(botAI, "enemy is out of melee", "intercept can cast"); }
|
||||||
static Trigger* intercept_and_rage(PlayerbotAI* botAI) { return new TwoTriggers(botAI, "intercept and far enemy", "light rage available"); }
|
static Trigger* intercept_and_rage(PlayerbotAI* botAI) { return new TwoTriggers(botAI, "intercept and far enemy", "light rage available"); }
|
||||||
|
|||||||
Reference in New Issue
Block a user