hondacrx
2021-12-07 20:42:47 -05:00
parent b7e4c2fd76
commit c37e1c9f7d
17 changed files with 91 additions and 46 deletions
+6 -6
View File
@@ -28,7 +28,7 @@ namespace Game.AI
{
public class CreatureAI : UnitAI
{
bool _moveInLineOfSightLocked;
bool _moveInLOSLocked;
List<AreaBoundary> _boundary = new();
bool _negateBoundary;
@@ -41,7 +41,7 @@ namespace Game.AI
public CreatureAI(Creature _creature) : base(_creature)
{
me = _creature;
_moveInLineOfSightLocked = false;
_moveInLOSLocked = false;
}
public override void OnCharmed(bool isNew)
@@ -101,12 +101,12 @@ namespace Game.AI
public virtual void MoveInLineOfSight_Safe(Unit who)
{
if (_moveInLineOfSightLocked)
if (_moveInLOSLocked)
return;
_moveInLineOfSightLocked = true;
_moveInLOSLocked = true;
MoveInLineOfSight(who);
_moveInLineOfSightLocked = false;
_moveInLOSLocked = false;
}
public virtual void MoveInLineOfSight(Unit who)
@@ -366,7 +366,7 @@ namespace Game.AI
// Called when the creature summon successfully other creature
public virtual void JustSummoned(Creature summon) { }
public virtual void IsSummonedBy(Unit summoner) { }
public virtual void IsSummonedBy(WorldObject summoner) { }
public virtual void SummonedCreatureDespawn(Creature summon) { }
public virtual void SummonedCreatureDies(Creature summon, Unit killer) { }
+6
View File
@@ -101,5 +101,11 @@ namespace Game.AI
// Called when spell hits a target
public virtual void SpellHitTarget(Unit target, SpellInfo spellInfo) { }
public virtual void SpellHitTargetGameObject(GameObject target, SpellInfo spellInfo) { }
// Called when the gameobject summon successfully other creature
public virtual void JustSummoned(Creature summon) { }
public virtual void SummonedCreatureDespawn(Creature summon) { }
public virtual void SummonedCreatureDies(Creature summon, Unit killer) { }
}
}
+1 -1
View File
@@ -119,7 +119,7 @@ namespace Game.AI
{
public TriggerAI(Creature c) : base(c) { }
public override void IsSummonedBy(Unit summoner)
public override void IsSummonedBy(WorldObject summoner)
{
if (me.m_spells[0] != 0)
{
+2 -2
View File
@@ -689,9 +689,9 @@ namespace Game.AI
GetScript().ProcessEventsFor(SmartEvents.ReceiveEmote, player, (uint)emoteId);
}
public override void IsSummonedBy(Unit summoner)
public override void IsSummonedBy(WorldObject summoner)
{
GetScript().ProcessEventsFor(SmartEvents.JustSummoned, summoner);
GetScript().ProcessEventsFor(SmartEvents.JustSummoned, summoner.ToUnit(), 0, 0, false, null, summoner.ToGameObject());
}
public override void DamageDealt(Unit victim, ref uint damage, DamageEffectType damageType)
+3 -3
View File
@@ -2944,7 +2944,7 @@ namespace Game.AI
TempSummon tempSummon = _me.ToTempSummon();
if (tempSummon)
{
Unit summoner = tempSummon.GetSummoner();
WorldObject summoner = tempSummon.GetSummoner();
if (summoner)
charmerOrOwnerGuid = summoner.GetGUID();
}
@@ -2953,7 +2953,7 @@ namespace Game.AI
if (charmerOrOwnerGuid.IsEmpty())
charmerOrOwnerGuid = _me.GetCreatorGUID();
Unit owner = Global.ObjAccessor.GetUnit(_me, charmerOrOwnerGuid);
WorldObject owner = Global.ObjAccessor.GetWorldObject(_me, charmerOrOwnerGuid);
if (owner != null)
targets.Add(owner);
}
@@ -2967,7 +2967,7 @@ namespace Game.AI
// Get owner of owner
if (e.Target.owner.useCharmerOrOwner != 0 && !targets.Empty())
{
Unit owner = targets.First().ToUnit();
WorldObject owner = targets.First();
targets.Clear();
Unit unitBase = Global.ObjAccessor.GetUnit(owner, owner.GetCharmerOrOwnerGUID());