Spells/Auras: Implement SPELL_AURA_ACT_AS_CONTROL_ZONE
Port From (https://github.com/TrinityCore/TrinityCore/commit/66abfd1c530e81f24856825f7ebe5a1c1ba8c58e)
This commit is contained in:
@@ -4697,7 +4697,7 @@ namespace Game.Entities
|
||||
if (Math.Abs(delta) < minSuperiority)
|
||||
return 0;
|
||||
|
||||
float slope = ((float)minTime - maxTime) / (maxSuperiority - minSuperiority);
|
||||
float slope = ((float)minTime - maxTime) / Math.Max(maxSuperiority - minSuperiority, 1);
|
||||
float intercept = maxTime - slope * minSuperiority;
|
||||
float timeNeeded = slope * Math.Abs(delta) + intercept;
|
||||
float percentageIncrease = 100.0f / timeNeeded;
|
||||
|
||||
@@ -689,6 +689,14 @@ namespace Game.Entities
|
||||
GetMap().PlayerRelocation(ToPlayer(), x, y, z, orientation);
|
||||
else
|
||||
GetMap().CreatureRelocation(ToCreature(), x, y, z, orientation);
|
||||
|
||||
var controlZoneAuras = GetAuraEffectsByType(AuraType.ActAsControlZone);
|
||||
foreach (AuraEffect auraEffect in controlZoneAuras)
|
||||
{
|
||||
GameObject controlZone = GetGameObject(auraEffect.GetSpellInfo().Id);
|
||||
if (controlZone != null)
|
||||
GetMap().GameObjectRelocation(controlZone, x, y, z, orientation);
|
||||
}
|
||||
}
|
||||
else if (turn)
|
||||
UpdateOrientation(orientation);
|
||||
|
||||
Reference in New Issue
Block a user