Make use of Aggressive/Weapon PlayerStates

I HAVE NO IDEA WHAT THIS DOES, BUT LIVE DOES IT

Something to do with the animation system, all I know
This commit is contained in:
Michael Cook (mackal) 2015-05-08 22:42:45 -04:00
parent f68952c168
commit c360aa9b0f
4 changed files with 22 additions and 2 deletions

View File

@ -3459,6 +3459,9 @@ void Bot::AI_Process() {
return; return;
} }
if (!(m_PlayerState & static_cast<uint32>(PlayerState::Aggressive)))
SendAddPlayerState(PlayerState::Aggressive);
bool atCombatRange = false; bool atCombatRange = false;
float meleeDistance = GetMaxMeleeRangeToTarget(GetTarget()); float meleeDistance = GetMaxMeleeRangeToTarget(GetTarget());
@ -3717,6 +3720,9 @@ void Bot::AI_Process() {
// Not engaged in combat // Not engaged in combat
SetTarget(0); SetTarget(0);
if (m_PlayerState & static_cast<uint32>(PlayerState::Aggressive))
SendRemovePlayerState(PlayerState::Aggressive);
if(!IsMoving() && AIthink_timer->Check() && !spellend_timer.Enabled()) { if(!IsMoving() && AIthink_timer->Check() && !spellend_timer.Enabled()) {
if(GetBotStance() != BotStancePassive) { if(GetBotStance() != BotStancePassive) {
if(!AI_IdleCastCheck() && !IsCasting()) if(!AI_IdleCastCheck() && !IsCasting())

View File

@ -332,6 +332,8 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge
CastToMob()->AddProcToWeapon(item2->Proc.Effect, true); CastToMob()->AddProcToWeapon(item2->Proc.Effect, true);
eslot = MaterialPrimary; eslot = MaterialPrimary;
if (item2->Damage > 0)
SendAddPlayerState(PlayerState::PrimaryWeaponEquipped);
} }
else if (foundslot == MainSecondary else if (foundslot == MainSecondary
&& (GetOwner() != nullptr || (GetLevel() >= 13 && zone->random.Roll(NPC_DW_CHANCE)) || (item2->Damage==0)) && && (GetOwner() != nullptr || (GetLevel() >= 13 && zone->random.Roll(NPC_DW_CHANCE)) || (item2->Damage==0)) &&
@ -342,6 +344,8 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge
CastToMob()->AddProcToWeapon(item2->Proc.Effect, true); CastToMob()->AddProcToWeapon(item2->Proc.Effect, true);
eslot = MaterialSecondary; eslot = MaterialSecondary;
if (item2->Damage > 0)
SendAddPlayerState(PlayerState::SecondaryWeaponEquipped);
} }
else if (foundslot == MainHead) { else if (foundslot == MainHead) {
eslot = MaterialHead; eslot = MaterialHead;

View File

@ -1468,6 +1468,9 @@ void Merc::AI_Process() {
return; return;
} }
if (!(m_PlayerState & static_cast<uint32>(PlayerState::Aggressive)))
SendAddPlayerState(PlayerState::Aggressive);
bool atCombatRange = false; bool atCombatRange = false;
float meleeDistance = GetMaxMeleeRangeToTarget(GetTarget()); float meleeDistance = GetMaxMeleeRangeToTarget(GetTarget());
@ -1681,6 +1684,9 @@ void Merc::AI_Process() {
confidence_timer.Disable(); confidence_timer.Disable();
_check_confidence = false; _check_confidence = false;
if (m_PlayerState & static_cast<uint32>(PlayerState::Aggressive))
SendRemovePlayerState(PlayerState::Aggressive);
if(!check_target_timer.Enabled()) if(!check_target_timer.Enabled())
check_target_timer.Start(2000, false); check_target_timer.Start(2000, false);

View File

@ -1084,6 +1084,8 @@ void Mob::AI_Process() {
if (engaged) if (engaged)
{ {
if (!(m_PlayerState & static_cast<uint32>(PlayerState::Aggressive)))
SendAddPlayerState(PlayerState::Aggressive);
// we are prevented from getting here if we are blind and don't have a target in range // we are prevented from getting here if we are blind and don't have a target in range
// from above, so no extra blind checks needed // from above, so no extra blind checks needed
if ((IsRooted() && !GetSpecialAbility(IGNORE_ROOT_AGGRO_RULES)) || IsBlind()) if ((IsRooted() && !GetSpecialAbility(IGNORE_ROOT_AGGRO_RULES)) || IsBlind())
@ -1435,6 +1437,8 @@ void Mob::AI_Process() {
} }
else else
{ {
if (m_PlayerState & static_cast<uint32>(PlayerState::Aggressive))
SendRemovePlayerState(PlayerState::Aggressive);
if(AIfeignremember_timer->Check()) { if(AIfeignremember_timer->Check()) {
// 6/14/06 // 6/14/06
// Improved Feign Death Memory // Improved Feign Death Memory