Example #1
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("Ten NPC nie istnieje i niemozesz go wiecej kontrolowac, najpewniej ktos usunal jego respawn");
                    oldNPC.Delete();
                }
            }

            //Neuen Mobile übernehmen oder Control abbrechen
            if ( target != oldPlayer && target != null && !target.Deleted ) //Neues Mobile übernehmen
            {
                from.SendMessage("Kontrolujesz {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();
            }
        }
Example #2
0
        private static void StartControl( Mobile from, Mobile target, bool stats, bool skills, bool items )
        {
            from.SendMessage("Opuszczasz swoje cialo aby kontrolowac {0}, {1}", target.Name, target.Title);
            //"You leave your Body an control {0}, {1}"

            //Clone Player
            PlayerMobile playerClone = (PlayerMobile)DupeMobile(from);

            //Create ControlItem
            ControlItem controlItem = new ControlItem(from, playerClone, target, stats, skills, items);
            from.Backpack.DropItem(controlItem);

            //Props target -> player
            CopyProps(from, target, stats, skills);

            //Backup Equip
            MoveEquip(from, playerClone, items);
            //Equip from target to player
            MoveEquip(target, from, items);

            target.Internalize();
            playerClone.Internalize();
        }
Example #3
0
        public static void EndControl( ControlItem controlItem, bool stats, bool skills, bool items )
        {
            Mobile from							= controlItem.Owner;
            PlayerMobile oldPlayer 	= controlItem.Player;
            Mobile oldNPC 				 	= controlItem.NPC;

            if ( from == null )
                return;

            from.SendMessage("Wrociles do swejgo orginalnego ciala");
            //"You are in your original Body"

            //NPC wiederherstellen
            if ( oldNPC != null && !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("Ten NPC nie istnieje i niemozesz go wiecej kontrolowac, najpewniej ktos usunal jego respawn");
                //"The original NPC was deleted. Maybe because a manual respawn"
                oldNPC.Delete();
            }

            if ( oldPlayer != null && !oldPlayer.Deleted )
            {
                //Spieler Wiederherstellen (100%)
                //Props: oldPlayer -> player
                CopyProps( from, oldPlayer, true, true );
                //Equip: oldPlayer -> player
                MoveEquip( oldPlayer, from, true );

                oldPlayer.Delete();
            }
        }
        private static void StartControl(Mobile from, Mobile target, bool stats, bool skills, bool items)
        {
            from.SendMessage("You leave your Body and control {0}, {1}", target.Name, target.Title);
            //"You leave your Body and control {0}, {1}"

            //Clone Player
            PlayerMobile playerClone = (PlayerMobile)DupeMobile(from);
            new CloneTarget().SimulateTarget(playerClone, from, false);

            //Create ControlItem
            ControlItem controlItem = new ControlItem(from, playerClone, target, stats, skills, items);
            from.Backpack.DropItem(controlItem);

            /*
            //Props target -> player
            CopyProps(from, target, stats, skills);

            //Backup Equip
            //Equip from target to player
            MoveEquip(target, from, items);
            */
            new CloneTarget().SimulateTarget(from, target, true);
            from.Hidden = target.Hidden;

            target.Internalize();
            playerClone.Internalize();
        }
        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
                    new CloneTarget().SimulateTarget(oldNPC, from, true);
                }
                else
                {
                    from.SendMessage("Votre corps d'origine a été détruit.");
                    oldNPC.Delete();
                }
            }

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

                //Update ControlItem
                controlItem.NPC = target;
                controlItem.Stats = stats;
                controlItem.Skills = skills;
                controlItem.Items = items;
                new CloneTarget().SimulateTarget(from, target, true);

                target.Internalize();
            }
            else if (target == oldPlayer && !target.Deleted)
            {
                controlItem.Delete();
            }
        }
        public static void EndControl(ControlItem controlItem, bool stats, bool skills, bool items)
        {
            Mobile from = controlItem.Owner;
            PlayerMobile oldPlayer = controlItem.Player;
            Mobile oldNPC = controlItem.NPC;

            if (from == null)
                return;

            from.SendMessage("Vous êtes dans votre corps d'origine.");
            //"You are in your original Body"

            //NPC wiederherstellen
            if (oldNPC != null && !oldNPC.Deleted)
            {
                new CloneTarget().SimulateTarget(oldNPC, from, true);
            }
            else
            {
                from.SendMessage("Votre corps original a été détruit.");
                //"The original NPC was deleted. Maybe because a manual respawn"
                oldNPC.Delete();
            }

            if (oldPlayer != null && !oldPlayer.Deleted)
            {
                //Spieler Wiederherstellen (100%)
                //Props: oldPlayer -> player
                //CopyProps(from, oldPlayer, true, true);
                new CloneTarget().SimulateTarget(from, oldPlayer, false);
                //Equip: oldPlayer -> player
                //MoveEquip(oldPlayer, from, true);

                oldPlayer.Delete();
            }
        }
Example #7
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("You Control  {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();
			}
		}