/// <summary> /// ActivePet is about to be abandoned /// </summary> public void AbandonActivePet() { if (m_activePet.IsInWorld && m_activePet.IsHunterPet && !m_activePet.PetRecord.IsStabled) { m_activePet.RejectMaster(); m_activePet.IsDecaying = true; } else { m_activePet.Delete(); } }
void DeleteMinion(NPC npc) { if (npc.Summon != EntityId.Zero) { var summon = Map.GetObject(npc.Summon); if (summon != null) { summon.Delete(); } npc.Summon = EntityId.Zero; } npc.Delete(); }
/// <summary> /// Move to the killer and pleed /// </summary> /// <param name="ambusher"></param> /// <param name="killer"></param> private static void SeekForgiveness(NPC ambusher, Character killer) { if (killer.IsInWorld && killer.IsAlive && killer.Map == ambusher.Map && killer.IsInRadius(ambusher, MaxForgivenessDistance)) { // make sure we are using the right means of transportation if (killer.IsFlying) { ambusher.Mount(MountId.FlyingBroom); // probably won't display correctly ambusher.Movement.MoveType = AIMoveType.Fly; } else { ambusher.Dismount(); ambusher.Movement.MoveType = AIMoveType.Walk; } // go to killer ambusher.MoveInFrontThenExecute(killer, mover => { mover.StandState = StandState.Kneeling; mover.Say("I beg thee for forgiveness!"); }); } else { // killer is not in reach anymore ambusher.Say("Sigh!"); ambusher.Delete(); } }