Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 08-10-2010, 03:45 PM
Tabasco's Avatar
Tabasco
Discordant
 
Join Date: Sep 2009
Posts: 270
Default #warpto

I put this in as a sort of reverse summon since I typically find myself needing to travel to a player's exact location rather than the other way around.

Code:
Index: command.cpp
===================================================================
--- command.cpp (revision 1612)
+++ command.cpp (working copy)
@@ -184,6 +184,7 @@
                command_add("log","- Search character event log",80,command_log) ||
                command_add("gm","- Turn player target's or your GM flag on or off",80,command_gm) ||
                command_add("summon","[charname] - Summons your player/npc/corpse target, or charname if specified",80,command_summon) || 
+               command_add("warpto","[charname] - warps to player/npc/corpse target, or charname if specified",80,command_warpto) || 
                command_add("zone","[zonename] [x] [y] [z] - Go to specified zone (coords optional)",50,command_zone) ||
                command_add("zoneinstance","[instanceid] [x] [y] [z] - Go to specified instance zone (coords optional)",50,command_zone_instance) ||
         command_add("peqzone","[zonename] - Go to specified zone, if you have > 75% health",0,command_peqzone) ||
@@ -305,7 +306,7 @@
                command_add("nukebuffs","- Strip all buffs on you or your target",50,command_nukebuffs) ||
                command_add("freeze","- Freeze your target",80,command_freeze) ||
                command_add("unfreeze","- Unfreeze your target",80,command_unfreeze) ||
-               command_add("pvp","[on/off] - Set your or your player target's PVP status",100,command_pvp) ||
+               command_add("pvp","[on/off] - Set you or your player target's PVP status",100,command_pvp) ||
                command_add("setxp","[value] - Set your or your player target's experience",100,command_setxp) ||
                command_add("setpvppoints","[value] - Set your or your player target's PVP points",100,command_setpvppoints) ||
                command_add("setexp",NULL,0,command_setxp) ||
@@ -1406,6 +1407,59 @@
        }
 }
 
+// Adapted from command_summon
+void command_warpto(Client *c, const Seperator *sep)
+{
+       Mob *t;
+       int32 acc, zid, inst;
+       float px, py, pz;
+
+       if(sep->arg[1][0] != 0)         // arg specified
+       {
+               Client* client = entity_list.GetClientByName(sep->arg[1]);
+               if (client != 0)        // found player in zone
+                       t=client->CastToMob();
+               else 
+               {
+                       if (!worldserver.Connected())
+                               c->Message(0, "Error: World server disconnected.");
+                       else
+                       { // player is in another zone
+                               database.GetCharacterInfo(sep->arg[1], &acc, &zid, &inst, &px, &py, &pz);
+                               c->Message(0, "Warping to %s at %1.1f, %1.1f, %1.1f", sep->arg[1], px, py, pz);
+                               c->MovePC(zid, px, py, pz, 0.0f, 0);
+                       }
+                       return;
+               }
+       }
+       else if(c->GetTarget())         // have target
+               t=c->GetTarget();
+       else
+       {
+               c->Message(0, "Usage: #warpto [charname] Either target or charname is required");
+               return;
+       }
+
+       if(!t)
+               return;
+
+       if (t->IsNPC())
+       { // npc target
+               c->Message(0, "Warping to %s at %1.1f, %1.1f, %1.1f", t->GetName(), t->GetX(), t->GetY(), t->GetZ());
+               c->MovePC(zone->GetZoneID(), t->GetX(), t->GetY(), t->GetZ(), 0.0f, 0);
+       }
+       else if (t->IsCorpse())
+       { // corpse target
+               c->Message(0, "Warping to %s at %1.1f, %1.1f, %1.1f", t->GetName(), t->GetX(), t->GetY(), t->GetZ());
+               c->MovePC(zone->GetZoneID(), t->GetX(), t->GetY(), t->GetZ(), 0.0f, 0);
+       }
+       else if (t->IsClient())
+       {
+               c->Message(0, "Warping to %s at %1.1f, %1.1f, %1.1f", t->GetName(), t->GetX(), t->GetY(), t->GetZ());
+               c->MovePC(zone->GetZoneID(), t->GetX(), t->GetY(), t->GetZ(), 0.0f, 0);
+       }
+}
+
 void command_zone(Client *c, const Seperator *sep)
 {
        if(c->Admin() < commandZoneToCoords &&
Code:
Index: command.h
===================================================================
--- command.h   (revision 1612)
+++ command.h   (working copy)
@@ -91,6 +91,7 @@
 void command_log(Client *c, const Seperator *sep);
 void command_gm(Client *c, const Seperator *sep);
 void command_summon(Client *c, const Seperator *sep);
+void command_warpto(Client *c, const Seperator *sep);
 void command_zone(Client *c, const Seperator *sep);
 void command_zone_instance(Client *c, const Seperator *sep);
 void command_peqzone(Client *c, const Seperator *sep);
Reply With Quote
  #2  
Old 08-10-2010, 04:00 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

There is already a GM command, /goto (not #goto) which seems to do much the same thing (unless I am missing something, which is entirely possible ).
Reply With Quote
  #3  
Old 08-10-2010, 04:03 PM
Tabasco's Avatar
Tabasco
Discordant
 
Join Date: Sep 2009
Posts: 270
Default

I kept wondering why such a thing wouldn't have been implemented by now, especially since it's about 3 minutes worth of work.

This should allow you to target npc's and corpses like #summon, but /goto may already do that, I'd honestly never heard of it. Thanks!
Reply With Quote
  #4  
Old 08-10-2010, 05:54 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

/goto requires a GM flag up but otherwise sounds like everything you want.
Reply With Quote
  #5  
Old 08-10-2010, 06:39 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

#goto works just fine for me. Just target the player/npc and don't provide any coordinates...
Reply With Quote
  #6  
Old 08-10-2010, 07:33 PM
Tabasco's Avatar
Tabasco
Discordant
 
Join Date: Sep 2009
Posts: 270
Default

/goto appears have identical functionality, I just didn't know about it.
#goto only works with a target in the same zone.

Sorry for posting an essentially redundant command. I like not having to have the gm flag on, but if I'd know about /goto I doubt I would have messed with it.
Reply With Quote
  #7  
Old 08-11-2010, 02:53 AM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

No need to be sorry, the code is big. Sometimes people try to fix things that don't need fixing. I appreciate it all the same.
Reply With Quote
  #8  
Old 08-12-2010, 03:00 AM
Hmm
Discordant
 
Join Date: Jan 2002
Posts: 276
Default

I guess there's a room for non-GM goto command? It can be useful that way.

Anyone who wants goto without granting gm powers can add that.
__________________
Hmm...
Reply With Quote
  #9  
Old 08-12-2010, 04:24 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

They can lower the status requirement for individual #commands.
Reply With Quote
  #10  
Old 08-12-2010, 04:47 AM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,450
Default

Quote:
Originally Posted by joligario View Post
They can lower the status requirement for individual #commands.
Not for /commands. /goto is a GM command in the client. Unless you give them #gm on and status above a certain point, you won't be able to warp anywhere. Furthermore anyone with #gm on can /kill NPCs.

If you try to use /goto without status, it gives a hacking report message.

If you try to use /goto without #gm, it gives a client error saying the command does not exist.
Reply With Quote
  #11  
Old 08-12-2010, 08:46 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Yeah, the /goto and #goto commands do not work exactly the same. The #goto command will either let you move to your current target or to a specified X Y Z. The /goto command will let you go to your target or any player on the server directly by doing /goto playername, and it will also let you go to NPCs by typing their full name such as /goto Soandso000.

Using the /target command with the #goto command works fine, but again the /target is limited to GM only as far as zone-wide targetting goes unless the player is using MQ to get around that limitation.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #12  
Old 08-12-2010, 08:59 AM
Tabasco's Avatar
Tabasco
Discordant
 
Join Date: Sep 2009
Posts: 270
Default

Since it's available on my server I find myself using #warpto over /goto anyway just because it's convenient. I hadn't thought about it being handy for support staff though.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 05:08 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3