mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-28 16:16:27 +00:00
feat(Core/Anticheat): Preparation to implement new passive anticheat … (#5516)
This commit is contained in:
@@ -2382,6 +2382,11 @@ void AuraEffect::HandleFeignDeath(AuraApplication const* aurApp, uint8 mode, boo
|
||||
if (target->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
if (Player* targetPlayer = target->ToPlayer())
|
||||
{
|
||||
sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
|
||||
}
|
||||
|
||||
if (apply)
|
||||
{
|
||||
/*
|
||||
@@ -2874,6 +2879,11 @@ void AuraEffect::HandleAuraWaterWalk(AuraApplication const* aurApp, uint8 mode,
|
||||
|
||||
Unit* target = aurApp->GetTarget();
|
||||
|
||||
if (Player* targetPlayer = target->ToPlayer())
|
||||
{
|
||||
sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
|
||||
}
|
||||
|
||||
if (!apply)
|
||||
{
|
||||
// do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
|
||||
@@ -2891,6 +2901,11 @@ void AuraEffect::HandleAuraFeatherFall(AuraApplication const* aurApp, uint8 mode
|
||||
|
||||
Unit* target = aurApp->GetTarget();
|
||||
|
||||
if (Player* targetPlayer = target->ToPlayer())
|
||||
{
|
||||
sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
|
||||
}
|
||||
|
||||
if (!apply)
|
||||
{
|
||||
// do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
|
||||
@@ -2912,6 +2927,11 @@ void AuraEffect::HandleAuraHover(AuraApplication const* aurApp, uint8 mode, bool
|
||||
|
||||
Unit* target = aurApp->GetTarget();
|
||||
|
||||
if (Player* targetPlayer = target->ToPlayer())
|
||||
{
|
||||
sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
|
||||
}
|
||||
|
||||
if (!apply)
|
||||
{
|
||||
// do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
|
||||
@@ -3226,6 +3246,11 @@ void AuraEffect::HandleAuraModIncreaseSpeed(AuraApplication const* aurApp, uint8
|
||||
Unit* target = aurApp->GetTarget();
|
||||
|
||||
target->UpdateSpeed(MOVE_RUN, true);
|
||||
|
||||
if (Player* targetPlayer = target->ToPlayer())
|
||||
{
|
||||
sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
void AuraEffect::HandleAuraModIncreaseMountedSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const
|
||||
@@ -3266,6 +3291,11 @@ void AuraEffect::HandleAuraModIncreaseFlightSpeed(AuraApplication const* aurApp,
|
||||
target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, 16314);
|
||||
}
|
||||
}
|
||||
|
||||
if (Player* targetPlayer = target->ToPlayer())
|
||||
{
|
||||
sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
void AuraEffect::HandleAuraModIncreaseSwimSpeed(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
|
||||
@@ -3276,6 +3306,11 @@ void AuraEffect::HandleAuraModIncreaseSwimSpeed(AuraApplication const* aurApp, u
|
||||
Unit* target = aurApp->GetTarget();
|
||||
|
||||
target->UpdateSpeed(MOVE_SWIM, true);
|
||||
|
||||
if (Player* targetPlayer = target->ToPlayer())
|
||||
{
|
||||
sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
void AuraEffect::HandleAuraModDecreaseSpeed(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
|
||||
@@ -3291,6 +3326,11 @@ void AuraEffect::HandleAuraModDecreaseSpeed(AuraApplication const* aurApp, uint8
|
||||
target->UpdateSpeed(MOVE_RUN_BACK, true);
|
||||
target->UpdateSpeed(MOVE_SWIM_BACK, true);
|
||||
target->UpdateSpeed(MOVE_FLIGHT_BACK, true);
|
||||
|
||||
if (Player* targetPlayer = target->ToPlayer())
|
||||
{
|
||||
sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
void AuraEffect::HandleAuraModUseNormalSpeed(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
|
||||
@@ -3303,6 +3343,11 @@ void AuraEffect::HandleAuraModUseNormalSpeed(AuraApplication const* aurApp, uint
|
||||
target->UpdateSpeed(MOVE_RUN, true);
|
||||
target->UpdateSpeed(MOVE_SWIM, true);
|
||||
target->UpdateSpeed(MOVE_FLIGHT, true);
|
||||
|
||||
if (Player* targetPlayer = target->ToPlayer())
|
||||
{
|
||||
sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
/*********************************************************/
|
||||
|
||||
@@ -1113,6 +1113,11 @@ void Spell::EffectJump(SpellEffIndex effIndex)
|
||||
float speedXY, speedZ;
|
||||
CalculateJumpSpeeds(effIndex, m_caster->GetExactDist2d(unitTarget), speedXY, speedZ);
|
||||
m_caster->GetMotionMaster()->MoveJump(*unitTarget, speedXY, speedZ);
|
||||
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
sScriptMgr->AnticheatSetUnderACKmount(m_caster->ToPlayer());
|
||||
}
|
||||
}
|
||||
|
||||
void Spell::EffectJumpDest(SpellEffIndex effIndex)
|
||||
@@ -1142,6 +1147,12 @@ void Spell::EffectJumpDest(SpellEffIndex effIndex)
|
||||
{
|
||||
speedXY = pow(speedZ * 10, 8);
|
||||
m_caster->GetMotionMaster()->MoveJump(x, y, z, speedXY, speedZ, 0, ObjectAccessor::GetUnit(*m_caster, m_caster->GetGuidValue(UNIT_FIELD_TARGET)));
|
||||
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
sScriptMgr->AnticheatSetUnderACKmount(m_caster->ToPlayer());
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1156,6 +1167,11 @@ void Spell::EffectJumpDest(SpellEffIndex effIndex)
|
||||
speedXY = 1.0f;
|
||||
|
||||
m_caster->GetMotionMaster()->MoveJump(x, y, z, speedXY, speedZ);
|
||||
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
sScriptMgr->AnticheatSetUnderACKmount(m_caster->ToPlayer());
|
||||
}
|
||||
}
|
||||
|
||||
void Spell::CalculateJumpSpeeds(uint8 i, float dist, float& speedXY, float& speedZ)
|
||||
@@ -1177,6 +1193,11 @@ void Spell::EffectTeleportUnits(SpellEffIndex /*effIndex*/)
|
||||
if (!unitTarget || unitTarget->IsInFlight())
|
||||
return;
|
||||
|
||||
if (unitTarget->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
sScriptMgr->AnticheatSetUnderACKmount(unitTarget->ToPlayer());
|
||||
}
|
||||
|
||||
// Pre effects
|
||||
switch (m_spellInfo->Id)
|
||||
{
|
||||
@@ -5056,6 +5077,11 @@ void Spell::EffectCharge(SpellEffIndex /*effIndex*/)
|
||||
if (!unitTarget)
|
||||
return;
|
||||
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
sScriptMgr->AnticheatSetSkipOnePacketForASH(m_caster->ToPlayer(), true);
|
||||
}
|
||||
|
||||
// charge changes fall time
|
||||
if( m_caster->GetTypeId() == TYPEID_PLAYER )
|
||||
m_caster->ToPlayer()->SetFallInformation(time(nullptr), m_caster->GetPositionZ());
|
||||
@@ -5063,6 +5089,13 @@ void Spell::EffectCharge(SpellEffIndex /*effIndex*/)
|
||||
if (m_pathFinder)
|
||||
{
|
||||
m_caster->GetMotionMaster()->MoveCharge(m_pathFinder->GetEndPosition().x, m_pathFinder->GetEndPosition().y, m_pathFinder->GetEndPosition().z, 42.0f, EVENT_CHARGE, &m_pathFinder->GetPath());
|
||||
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
sScriptMgr->AnticheatSetUnderACKmount(m_caster->ToPlayer());
|
||||
}
|
||||
|
||||
m_caster->AddUnitState(UNIT_STATE_CHARGING);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -5077,6 +5110,13 @@ void Spell::EffectCharge(SpellEffIndex /*effIndex*/)
|
||||
}
|
||||
|
||||
m_caster->GetMotionMaster()->MoveCharge(pos.m_positionX, pos.m_positionY, pos.m_positionZ + Z_OFFSET_FIND_HEIGHT);
|
||||
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
sScriptMgr->AnticheatSetUnderACKmount(m_caster->ToPlayer());
|
||||
}
|
||||
|
||||
m_caster->AddUnitState(UNIT_STATE_CHARGING);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5085,6 +5125,13 @@ void Spell::EffectCharge(SpellEffIndex /*effIndex*/)
|
||||
if (!unitTarget)
|
||||
return;
|
||||
|
||||
m_caster->ClearUnitState(UNIT_STATE_CHARGING);
|
||||
|
||||
if (m_caster->ToPlayer())
|
||||
{
|
||||
sScriptMgr->AnticheatSetSkipOnePacketForASH(m_caster->ToPlayer(), true);
|
||||
}
|
||||
|
||||
// not all charge effects used in negative spells
|
||||
if (!m_spellInfo->IsPositive() && m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
m_caster->Attack(unitTarget, true);
|
||||
@@ -5096,6 +5143,11 @@ void Spell::EffectChargeDest(SpellEffIndex /*effIndex*/)
|
||||
if (effectHandleMode != SPELL_EFFECT_HANDLE_LAUNCH)
|
||||
return;
|
||||
|
||||
if (m_caster->ToPlayer())
|
||||
{
|
||||
sScriptMgr->AnticheatSetSkipOnePacketForASH(m_caster->ToPlayer(), true);
|
||||
}
|
||||
|
||||
if (m_targets.HasDst())
|
||||
{
|
||||
Position pos;
|
||||
@@ -5109,6 +5161,11 @@ void Spell::EffectChargeDest(SpellEffIndex /*effIndex*/)
|
||||
}
|
||||
|
||||
m_caster->GetMotionMaster()->MoveCharge(pos.m_positionX, pos.m_positionY, pos.m_positionZ);
|
||||
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
sScriptMgr->AnticheatSetUnderACKmount(m_caster->ToPlayer());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5162,6 +5219,11 @@ void Spell::EffectKnockBack(SpellEffIndex effIndex)
|
||||
}
|
||||
|
||||
unitTarget->KnockbackFrom(x, y, speedxy, speedz);
|
||||
|
||||
if (unitTarget->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
sScriptMgr->AnticheatSetUnderACKmount(unitTarget->ToPlayer());
|
||||
}
|
||||
}
|
||||
|
||||
void Spell::EffectLeapBack(SpellEffIndex effIndex)
|
||||
@@ -5177,6 +5239,11 @@ void Spell::EffectLeapBack(SpellEffIndex effIndex)
|
||||
//1891: Disengage
|
||||
m_caster->JumpTo(speedxy, speedz, m_spellInfo->SpellFamilyName != SPELLFAMILY_HUNTER);
|
||||
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
sScriptMgr->AnticheatSetUnderACKmount(m_caster->ToPlayer());
|
||||
}
|
||||
|
||||
// xinef: changes fall time
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
m_caster->ToPlayer()->SetFallInformation(time(nullptr), m_caster->GetPositionZ());
|
||||
@@ -5262,6 +5329,12 @@ void Spell::EffectPullTowards(SpellEffIndex effIndex)
|
||||
float speedZ = unitTarget->GetDistance(pos) / speedXY * 0.5f * Movement::gravity;
|
||||
|
||||
unitTarget->GetMotionMaster()->MoveJump(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), speedXY, speedZ);
|
||||
|
||||
if (unitTarget->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
sScriptMgr->AnticheatSetSkipOnePacketForASH(unitTarget->ToPlayer(), true);
|
||||
sScriptMgr->AnticheatSetUnderACKmount(unitTarget->ToPlayer());
|
||||
}
|
||||
}
|
||||
|
||||
void Spell::EffectDispelMechanic(SpellEffIndex effIndex)
|
||||
|
||||
Reference in New Issue
Block a user