CODE |
using Server; using Server.Network; using Server.Items; using Server.Mobiles; using Server.Misc; using Server.Targeting; using Server.Commands; namespace Server.Scripts.Commands { public class GMRecall { public static void Initialize() { Register(); } public static void Register() { CommandSystem.Register( "Recall", AccessLevel.Counselor, new CommandEventHandler( GMRecall_OnCommand ) ); } private class RecallTarget : Target { public RecallTarget( Mobile m ) : base( 1, false, TargetFlags.None ) { } protected override void OnTarget( Mobile from, object target ) { if ( target is RecallRune ) { RecallRune t = ( RecallRune )target; if ( t.Marked == true ) { from.Location = t.Target; from.Map = t.TargetMap; } else from.SendLocalizedMessage( 502354 ); // Target is not marked. } else if ( target is Runebook ) { RunebookEntry e = ((Runebook)target).Default; if ( e != null ) { from.Location = e.Location; from.Map = e.Map; } else from.SendLocalizedMessage( 502354 ); // Target is not marked. } else { from.SendMessage( "That can not be done,!" ); } } } [Usage( "Recall" )] [Description( "Recall on rune." )] private static void GMRecall_OnCommand( CommandEventArgs e ) { e.Mobile.SendMessage( "Target A Default Runebook" ); e.Mobile.Target = new RecallTarget( e.Mobile ); } } } |
QUOTE |
if ( t.Marked == true ) { BaseCreature.TeleportPets(from, t.Target, t.TargetMap, true); from.Location = t.Target; from.Map = t.TargetMap; } |
QUOTE (ArteGordon @ September 25, 2007 04:17 am) | ||
add a call to TeleportPets here
|
CODE |
Errors: + Custom Scripts 2.0/Heal And Recall/GMRecall.cs: CS1502: Line 39: The best overloaded method match for 'Server.Mobiles.BaseCr eature.TeleportPets(Server.Mobile, Server.Point3D, Server.Map)' has some invalid arguments CS1503: Line 39: Argument '2': cannot convert from 'Server.Map' to 'Server.P oint3D' CS1503: Line 39: Argument '3': cannot convert from 'bool' to 'Server.Map' Scripts: One or more scripts failed to compile or no script files were found. - Press return to exit, or R to try again. |
QUOTE (Erica @ September 25, 2007 04:59 am) | ||||||
Did That ArteGordon and got 1 error.
|
QUOTE |
if ( e != null ) { BaseCreature.TeleportPets(from, e.Location, e.Map, true); from.Location = e.Location; from.Map = e.Map; } |
QUOTE (ArteGordon @ September 25, 2007 05:07 am) | ||
Show the code that you added. Also, you have to make sure they are within 3 tiles of you and they have to be bonded. If you want to also teleport them when you recall using a book, then you have to add that code in here as well
|