Ejemplo n.º 1
0
        //Return true if the base.OnBeforeDeath should be executed and false if not.
        public static bool UncontrolDeath(Mobile from)
        {
            if (from.AccessLevel < accessLevel)
            {
                return(true);
            }

            ControlItem controlItem = GetControlItem(from);

            if (controlItem != null)
            {
                //Backup NPC
                Mobile NPC = (Mobile)controlItem.NPC;

                //Release GM
                controlItem.Delete();
                from.Hits = from.HitsMax;
                from.Stam = from.StamMax;
                from.Mana = from.StamMax;

                //Kill NPC as normal
                NPC.Kill();

                return(false);                //GM stirbt nicht ;)
            }

            return(true);
        }
Ejemplo n.º 2
0
        private static void ChangeControl(Mobile target, ControlItem controlItem, bool stats, bool skills, bool items)
        {
            Mobile       from      = controlItem.Owner;
            PlayerMobile oldPlayer = controlItem.Player;
            Mobile       oldNPC    = controlItem.NPC;

            if (oldNPC != null)
            {
                //NPC Wiederherstellen
                if (!oldNPC.Deleted)
                {
                    //Props immer übernehmen bei der Rückverwandlung?
                    //ja, weil sich hits etc ändern
                    //Props from -> oldNPC
                    CopyProps(oldNPC, from, stats, skills);
                    //nicht nur zurück holen
                    //if ( oldNPC.Map == Map.Internal )
                    //	oldNPC.MoveToWorld(from.Location, from.Map);

                    //Equip: from -> oldNPC
                    MoveEquip(from, oldNPC, items);
                }
                else
                {
                    from.SendMessage("Der originale NPC wurde gelöscht und wird nicht wiederhergestellt. Grund könnte ein manueller Respawn gewesen sein");
                    oldNPC.Delete();
                }
            }

            //Neuen Mobile übernehmen oder Control abbrechen
            if (target != oldPlayer && target != null && !target.Deleted)               //Neues Mobile übernehmen
            {
                from.SendMessage("Du übernimmst {0}, {1}", target.Name, target.Title);
                //"You Control  {0}, {1}"

                //Update ControlItem
                controlItem.NPC    = target;
                controlItem.Stats  = stats;
                controlItem.Skills = skills;
                controlItem.Items  = items;

                //Props: target -> player
                CopyProps(from, target, stats, skills);
                //Equip: target -> player
                MoveEquip(target, from, items);

                target.Internalize();
            }
            else if (target == oldPlayer && !target.Deleted)
            {
                controlItem.Delete();
            }
        }
Ejemplo n.º 3
0
        public static bool UncontrolDeath(Mobile from)
        {
            if (from.AccessLevel < accessLevel)
            {
                return(true);
            }

            ControlItem controlItem = GetControlItem(from);

            if (controlItem != null)
            {
                controlItem.Delete();
                from.Hits = from.HitsMax;
                return(false);
            }

            return(true);
        }
Ejemplo n.º 4
0
        private static void ChangeControl(Mobile target, ControlItem controlItem, bool stats, bool skills, bool items)
        {
            Mobile       from      = controlItem.Owner;
            PlayerMobile oldPlayer = controlItem.Player;
            Mobile       oldNPC    = controlItem.NPC;

            if (oldNPC != null)
            {
                if (!oldNPC.Deleted)
                {
                    CopyProps(from, oldNPC, stats, skills);
                    MoveEquip(from, oldNPC, items);
                }
                else
                {
                    from.SendMessage("The original NPC has been deleted and will not be restored . Reason could have been a manual Respawn");
                    oldNPC.Delete();
                }
            }

            if (target != oldPlayer && target != null && !target.Deleted)
            {
                from.SendMessage("You Control {0}, {1}", target.Name, target.Title);

                controlItem.NPC    = target;
                controlItem.Stats  = stats;
                controlItem.Skills = skills;
                controlItem.Items  = items;

                CopyProps(target, from, stats, skills);
                MoveEquip(target, from, items);

                target.Internalize();
            }

            else if (target == oldPlayer && !target.Deleted)
            {
                controlItem.Delete();
            }
        }