Ejemplo n.º 1
0
        private static void ResetTonk(NPC npc)
        {
            if (npc.IsAlive)
            {
                //kill it and return since this should
                //fire the event again
                npc.Kill();
                return;
            }

            var user = npc.Summoner;
            if (user != null && user.IsInWorld)
            {
                var cast = user.SpellCast;
                if(cast != null)
                    cast.TriggerSelf(SpellId.Stun_2);

                var go = user.Map.GetNearestGameObject(user.Position, TonkControlConsoleGOEntryId);
                if (go != null)
                {
                    go.State = GameObjectState.Enabled;
                }
            }

            
            npc.RemoveFromMap();

        }