Core/Entities: Phasing rewrite

This commit is contained in:
hondacrx
2018-03-28 11:09:30 -04:00
parent caad52f636
commit fa35d60f60
72 changed files with 2254 additions and 1146 deletions
+13 -35
View File
@@ -1283,28 +1283,17 @@ namespace Game.Spells
Unit target = aurApp.GetTarget();
var oldPhases = target.GetPhases();
target.SetInPhase((uint)GetMiscValueB(), false, apply);
// call functions which may have additional effects after chainging state of unit
// phase auras normally not expected at BG but anyway better check
if (apply)
{
PhasingHandler.AddPhase(target, (uint)GetMiscValueB(), true);
// call functions which may have additional effects after chainging state of unit
// phase auras normally not expected at BG but anyway better check
// drop flag at invisibiliy in bg
target.RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags.ImmuneOrLostSelection);
}
Player player = target.ToPlayer();
if (player)
{
if (player.IsInWorld)
player.GetMap().SendUpdateTransportVisibility(player, oldPhases);
player.SendUpdatePhasing();
}
// need triggering visibility update base at phase update of not GM invisible (other GMs anyway see in any phases)
if (target.IsVisible())
target.UpdateObjectVisibility();
else
PhasingHandler.RemovePhase(target, (uint)GetMiscValueB(), true);
}
[AuraEffectHandler(AuraType.PhaseGroup)]
@@ -1314,29 +1303,18 @@ namespace Game.Spells
return;
Unit target = aurApp.GetTarget();
var oldPhases = target.GetPhases();
var phases = Global.DB2Mgr.GetPhasesForGroup((uint)GetMiscValueB());
foreach (var phase in phases)
target.SetInPhase(phase, false, apply);
// call functions which may have additional effects after chainging state of unit
// phase auras normally not expected at BG but anyway better check
if (apply)
{
PhasingHandler.AddPhaseGroup(target, (uint)GetMiscValueB(), true);
// call functions which may have additional effects after chainging state of unit
// phase auras normally not expected at BG but anyway better check
// drop flag at invisibiliy in bg
target.RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags.ImmuneOrLostSelection);
}
Player player = target.ToPlayer();
if (player)
{
if (player.IsInWorld)
player.GetMap().SendUpdateTransportVisibility(player, oldPhases);
player.SendUpdatePhasing();
}
// need triggering visibility update base at phase update of not GM invisible (other GMs anyway see in any phases)
if (target.IsVisible())
target.UpdateObjectVisibility();
else
PhasingHandler.RemovePhaseGroup(target, (uint)GetMiscValueB(), true);
}
/**********************/