mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
movement action
This commit is contained in:
@@ -496,7 +496,7 @@ void AiFactory::AddDefaultNonCombatStrategies(Player* player, PlayerbotAI* const
|
||||
nonCombatEngine->addStrategies("dps assist", "cure", nullptr);
|
||||
break;
|
||||
case CLASS_MAGE:
|
||||
if (tab == 1)
|
||||
if (tab == MAGE_TAB_ARCANE || tab == MAGE_TAB_FIRE)
|
||||
nonCombatEngine->addStrategy("bdps");
|
||||
else
|
||||
nonCombatEngine->addStrategy("bmana");
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
*/
|
||||
|
||||
#include "ObjectGuid.h"
|
||||
#include "Player.h"
|
||||
#include "PlayerbotAI.h"
|
||||
#include "Playerbots.h"
|
||||
#include "AiFactory.h"
|
||||
#include "BudgetValues.h"
|
||||
@@ -1306,22 +1308,22 @@ bool PlayerbotAI::IsTank(Player* player)
|
||||
switch (player->getClass())
|
||||
{
|
||||
case CLASS_DEATH_KNIGHT:
|
||||
if (tab == 0) {
|
||||
if (tab == DEATHKNIGT_TAB_BLOOD) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case CLASS_PALADIN:
|
||||
if (tab == 1) {
|
||||
if (tab == PALADIN_TAB_PROTECTION) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case CLASS_WARRIOR:
|
||||
if (tab == 2) {
|
||||
if (tab == WARRIOR_TAB_PROTECTION) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case CLASS_DRUID:
|
||||
if (tab == 1 && HasAnyAuraOf(player, "bear form", "dire bear form", "thick hide", NULL)) {
|
||||
if (tab == DRUID_TAB_FERAL && HasAnyAuraOf(player, "bear form", "dire bear form", "thick hide", NULL)) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -131,7 +131,7 @@ bool HeiganDanceMeleeAction::Execute(Event event) {
|
||||
return false;
|
||||
}
|
||||
// botAI->TellMaster("Let\'s go " + std::to_string(curr_safe));
|
||||
return MoveInside(bot->GetMapId(), waypoints[curr_safe].first, waypoints[curr_safe].second, bot->GetPositionZ(), botAI->IsMainTank(bot) ? 0 : 0.5f);
|
||||
return MoveInside(bot->GetMapId(), waypoints[curr_safe].first, waypoints[curr_safe].second, bot->GetPositionZ(), botAI->IsMainTank(bot) ? 0 : 0);
|
||||
}
|
||||
|
||||
bool HeiganDanceRangedAction::Execute(Event event) {
|
||||
@@ -140,7 +140,7 @@ bool HeiganDanceRangedAction::Execute(Event event) {
|
||||
return MoveTo(bot->GetMapId(), platform.first, platform.second, 276.54f);
|
||||
}
|
||||
botAI->InterruptSpell();
|
||||
return MoveInside(bot->GetMapId(), waypoints[curr_safe].first, waypoints[curr_safe].second, bot->GetPositionZ(), 0.5f);
|
||||
return MoveInside(bot->GetMapId(), waypoints[curr_safe].first, waypoints[curr_safe].second, bot->GetPositionZ(), 0);
|
||||
}
|
||||
|
||||
// bool ThaddiusAttackNearestPetAction::isUseful()
|
||||
|
||||
@@ -29,7 +29,7 @@ class BloodDKStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
//creators["death rune_mastery"] = &death_rune_mastery;
|
||||
//creators["hysteria"] = &hysteria;
|
||||
//creators["dancing weapon"] = &dancing_weapon;
|
||||
//creators["dark command"] = &dark_command;
|
||||
creators["dark command"] = &dark_command;
|
||||
creators["taunt spell"] = &dark_command;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ class BloodDKStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
return new ActionNode ("heart strike",
|
||||
/*P*/ NextAction::array(0, new NextAction("frost presence"), nullptr),
|
||||
/*A*/ NextAction::array(0, new NextAction("death strike"), nullptr),
|
||||
/*A*/ nullptr,
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ float HeiganDanceMultiplier::GetValue(Action* action)
|
||||
if (dynamic_cast<HeiganDanceAction*>(action) || dynamic_cast<CurePartyMemberAction*>(action)) {
|
||||
return 1.0f;
|
||||
}
|
||||
if (dynamic_cast<CastSpellAction*>(action))
|
||||
if (dynamic_cast<CastSpellAction*>(action) && !dynamic_cast<CastMeleeSpellAction*>(action))
|
||||
{
|
||||
uint32 spellId = AI_VALUE2(uint32, "spell id", action->getName());
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||
@@ -49,7 +49,7 @@ float HeiganDanceMultiplier::GetValue(Action* action)
|
||||
return 0.0f;
|
||||
}
|
||||
uint32 castTime = spellInfo->CalcCastTime();
|
||||
if (castTime == 0) {
|
||||
if (castTime == 0 && !spellInfo->IsChanneled()) {
|
||||
return 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#ifndef _PLAYERBOT_PALADINACTIONS_H
|
||||
#define _PLAYERBOT_PALADINACTIONS_H
|
||||
|
||||
#include "AiObject.h"
|
||||
#include "GenericSpellActions.h"
|
||||
#include "SharedDefines.h"
|
||||
|
||||
@@ -20,10 +21,11 @@ BUFF_ACTION(CastSealOfCommandAction, "seal of command");
|
||||
BUFF_ACTION(CastSealOfVengeanceAction, "seal of vengeance");
|
||||
|
||||
// judgements
|
||||
DEBUFF_ACTION_R(CastJudgementAction, "judgement", 10.0f);
|
||||
DEBUFF_ACTION_R(CastJudgementOfLightAction, "judgement of light", 10.0f);
|
||||
DEBUFF_ACTION_R(CastJudgementOfWisdomAction, "judgement of wisdom", 10.0f);
|
||||
DEBUFF_ACTION_R(CastJudgementOfJusticeAction, "judgement of justice", 10.0f);
|
||||
SPELL_ACTION(CastJudgementAction, "judgement");
|
||||
|
||||
SPELL_ACTION(CastJudgementOfLightAction, "judgement of light");
|
||||
SPELL_ACTION(CastJudgementOfWisdomAction, "judgement of wisdom");
|
||||
SPELL_ACTION(CastJudgementOfJusticeAction, "judgement of justice");
|
||||
|
||||
// auras
|
||||
BUFF_ACTION(CastDevotionAuraAction, "devotion aura");
|
||||
@@ -39,7 +41,7 @@ SPELL_ACTION(CastHolyShockAction, "holy shock");
|
||||
HEAL_PARTY_ACTION(CastHolyShockOnPartyAction, "holy shock");
|
||||
|
||||
// consecration
|
||||
SPELL_ACTION(CastConsecrationAction, "consecration");
|
||||
MELEE_ACTION(CastConsecrationAction, "consecration");
|
||||
|
||||
// repentance
|
||||
SNARE_ACTION(CastRepentanceSnareAction, "repentance");
|
||||
|
||||
@@ -22,31 +22,57 @@ bool HasAggroValue::Calculate()
|
||||
|
||||
while( ref )
|
||||
{
|
||||
ThreatMgr* threatMgr = ref->GetSource();
|
||||
Unit* attacker = threatMgr->GetOwner();
|
||||
Unit* victim = attacker->GetVictim();
|
||||
if (victim == bot && target == attacker)
|
||||
ThreatMgr *threatManager = ref->GetSource();
|
||||
Unit *attacker = threatManager->GetOwner();
|
||||
if (attacker != target) {
|
||||
ref = ref->next();
|
||||
continue;
|
||||
}
|
||||
Unit *victim = attacker->GetVictim();
|
||||
if (!victim) {
|
||||
return true;
|
||||
}
|
||||
if ((victim == bot || (victim && victim->ToPlayer() && botAI->IsMainTank(victim->ToPlayer()))) && target == attacker)
|
||||
return true;
|
||||
|
||||
ref = ref->next();
|
||||
}
|
||||
|
||||
ref = target->GetThreatMgr().getCurrentVictim();
|
||||
if (ref)
|
||||
{
|
||||
if (Unit* victim = ref->getTarget())
|
||||
{
|
||||
if (Player* pl = victim->ToPlayer())
|
||||
{
|
||||
if (botAI->IsMainTank(pl))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
// Unit* target = GetTarget();
|
||||
// if (!target)
|
||||
// return true;
|
||||
|
||||
// HostileReference *ref = bot->getHostileRefMgr().getFirst();
|
||||
// if (!ref)
|
||||
// return true; // simulate as target is not atacking anybody yet
|
||||
|
||||
// while( ref )
|
||||
// {
|
||||
// ThreatMgr* threatMgr = ref->GetSource();
|
||||
// Unit* attacker = threatMgr->GetOwner();
|
||||
// Unit* victim = attacker->GetVictim();
|
||||
// if (victim == bot && target == attacker)
|
||||
// return true;
|
||||
|
||||
// ref = ref->next();
|
||||
// }
|
||||
|
||||
// ref = target->GetThreatMgr().getCurrentVictim();
|
||||
// if (ref)
|
||||
// {
|
||||
// if (Unit* victim = ref->getTarget())
|
||||
// {
|
||||
// if (Player* pl = victim->ToPlayer())
|
||||
// {
|
||||
// if (botAI->IsMainTank(pl))
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// return false;
|
||||
}
|
||||
|
||||
uint8 AttackerCountValue::Calculate()
|
||||
|
||||
@@ -32,7 +32,7 @@ class MyAttackerCountValue : public Uint8CalculatedValue, public Qualified
|
||||
class HasAggroValue : public BoolCalculatedValue, public Qualified
|
||||
{
|
||||
public:
|
||||
HasAggroValue(PlayerbotAI* botAI, std::string const name = "has agro") : BoolCalculatedValue(botAI, name) { }
|
||||
HasAggroValue(PlayerbotAI* botAI, std::string const name = "has aggro") : BoolCalculatedValue(botAI, name) { }
|
||||
|
||||
Unit* GetTarget();
|
||||
bool Calculate() override;
|
||||
|
||||
Reference in New Issue
Block a user