PDA

View Full Version : new command #zone_player


Arex
01-21-2006, 01:22 PM
new command #zone_player, this command could to be used for all players for get to all basic norrath locations, because many times u need a command #zone, if u char get stucked or if u want go to other continent and u cant see any wizards around (not hard when almost all ppl are playing on servers with 20-30 guys online), then u could use a command #zone_player for go to the next possible locations, and only when u are 75% hp (like #peqzone):

East Antonica --> East commonlands - zoneidnumber=22
South Antonica --> South Ro - zoneidnumber=35
West Antonica --> West Karana - zoneidnumber=12
Faydwer - Gfaydark - zoneidnumber=54
Odus - Toxxulia Forest - zoneidnumber=38
East Kunark --> Emerald Jungle - zoneidnumber=94
West Kunark --> Dreadlands - zoneidnumber=86
East Velious --> Eastern Wastes - zoneidnumber=116
West Velious --> Western Wastes -zoneidnumber=120
Luclin --> Nexus - zoneidnumber=152
East Luclin --> Scarlet Desert - zoneidnumber=175
West Luclin --> Grimling Forest - zoneidnumber=167

if u havent time for implement this new command, i could try to do it, but i cant compile it, because i am using linux, and last emu version is going to be run on linux using wine...

Doodman
01-21-2006, 01:45 PM
EQEmu compiles on both linux and windows.

sdabbs65
01-21-2006, 03:46 PM
EQEmu compiles on both linux and windows.

0.6.4 still has compile errors under Microsoft Visual C++ 6.0
but version 6.0 works fine.

Arex
01-21-2006, 09:29 PM
if i give u the files that contain the new command added for me, anybody could compile it for windows? i am sure that it could to be a useful command for many ppl.

i also need to know how to do that command only works when players are 75-100% hp

thx

Arex
01-21-2006, 10:13 PM
void command_zone_player(Client *c, const Seperator *sep)
{
uint16 zoneid = 0;
zoneid = database.GetZoneID(sep->arg[1]);

if(zoneid == 0)
{
c->Message(0, "Unable to locate zone '%s'", sep->arg[1]);
return;
}

if (sep->IsNumber(1))
{
if((atoi(sep->arg[1])==22) || (atoi(sep->arg[1])==35) || (atoi(sep->arg[1])==12) || (atoi(sep->arg[1])==54)
|| (atoi(sep->arg[1])==38) || (atoi(sep->arg[1])==94) || (atoi(sep->arg[1])==86) || (atoi(sep->arg[1])==116)
|| (atoi(sep->arg[1])==120) || (atoi(sep->arg[1])==152) || (atoi(sep->arg[1])==175) || (atoi(sep->arg[1])==167))
{
zoneid = atoi(sep->arg[1]);
//zone to safe coords
c->GoToSafeCoords(zoneid);
return;
}
else
{
c->Message(0, "You only can zone to basic locations: East commonlands,South Ro, West Karana, Gfaydark, Toxxulia Forest, Emerald Jungle, Dreadlands, Eastern Wastes, Western Wastes, Nexus, Scarlet Desert, Grimling Forest");
return;


} else if (sep->arg[1][0] == 0)
{
c->Message(0, "Usage: #zone [zonename]");
return;
}
}

Arex
01-21-2006, 10:17 PM
anybody could to do a windows compile with it? thx, u also need add any few lines on command.cpp:

command_add("zone_player","[zonename]- Go to specified zone",50,command_zone_player) ||

and command.h after "//commands":

void command_zone_player(Client *c, const Seperator *sep);

I am not sure if i need add any thing more for the new command works..

sdabbs65
01-22-2006, 02:20 AM
it clearly tells you you need to add 3 things in the source file...

To add a new command 3 things must be done:


1. At the bottom of command.h you must add a prototype for it.

2. Add the function in this file.

3. In the command_init function you must add a call to command_add

for your function. If you want an alias for your command, add

a second call to command_add with the descriptin and access args

set to NULL and 0 respectively since they aren't used when adding

an alias. The function pointers being equal is makes it an alias.

The access level you set with command_add is only a default if

the command isn't listed in the addon.ini file.

RangerDown
01-22-2006, 03:11 AM
Many thanks for your submission Arex.

If I get a chance today, I'll try to compile it with my VS.NET 2003 copy. It depends on whether my sickness has passed to the point that I can think clearly :D

Arex
01-23-2006, 09:17 PM
i ll be checking for changelog, i wait that this new command can to be added soon, i am sure that many server admins will find it useful =)

fathernitwit
01-24-2006, 12:35 PM
this command will not be added to the official code. You can add it as your own extension if you like. writting it in perl would be easier to maintain.

Arex
01-25-2006, 02:04 AM
this command will not be added to the official code.

Thank You, i ll care not add more code... =/

fathernitwit
01-25-2006, 01:32 PM
no server specific code is allowed in the official code base, your code is specific to your server and how you want to run your game world. Doodman and I have spent countless hours removing stuff like this from the code because it is too messy.

Arex
01-26-2006, 09:21 PM
the other zone_player command that i posted have any error, then if anybody want use this command, i have this code that i think that should work...

void command_zone_player(Client *c, const Seperator *sep)
{
uint16 zoneid = 0;

if (sep->IsNumber(1))
{
zoneid = atoi(sep->arg[1]);
}
else if (sep->arg[1][0] == 0)
{
c->Message(0, "Usage: #zone [zonename]");
return;
}
else
{
zoneid = database.GetZoneID(sep->arg[1]);
if(zoneid == 0)
{
c->Message(0, "Unable to locate zone '%s'", sep->arg[1]);
return;
}
}

if((atoi(sep->arg[1])==22) || (atoi(sep->arg[1])==35) || (atoi(sep->arg[1])==12) || (atoi(sep->arg[1])==54)
|| (atoi(sep->arg[1])==38) || (atoi(sep->arg[1])==94) || (atoi(sep->arg[1])==86) || (atoi(sep->arg[1])==116)
|| (atoi(sep->arg[1])==120) || (atoi(sep->arg[1])==152) || (atoi(sep->arg[1])==175) || (atoi(sep->arg[1])==167))
{
//zone to safe coords
c->GoToSafeCoords(zoneid);
return;
}
else
{
c->Message(0, "You only can zone to basic locations: East commonlands,South Ro, West Karana, Gfaydark, Toxxulia Forest, Emerald Jungle, Dreadlands, Eastern Wastes, Western Wastes, Nexus, Scarlet Desert, Grimling Forest");
return;
}
}

Angelox
06-08-2006, 07:14 AM
the other zone_player command that i posted have any error, then if anybody want use this command, i have this code that i think that should work...

void command_zone_player(Client *c, const Seperator *sep)
{
uint16 zoneid = 0;

if (sep->IsNumber(1))
{
zoneid = atoi(sep->arg[1]);
}
else if (sep->arg[1][0] == 0)
{
c->Message(0, "Usage: #zone [zonename]");
return;
}
else
{
zoneid = database.GetZoneID(sep->arg[1]);
if(zoneid == 0)
{
c->Message(0, "Unable to locate zone '%s'", sep->arg[1]);
return;
}
}

if((atoi(sep->arg[1])==22) || (atoi(sep->arg[1])==35) || (atoi(sep->arg[1])==12) || (atoi(sep->arg[1])==54)
|| (atoi(sep->arg[1])==38) || (atoi(sep->arg[1])==94) || (atoi(sep->arg[1])==86) || (atoi(sep->arg[1])==116)
|| (atoi(sep->arg[1])==120) || (atoi(sep->arg[1])==152) || (atoi(sep->arg[1])==175) || (atoi(sep->arg[1])==167))
{
//zone to safe coords
c->GoToSafeCoords(zoneid);
return;
}
else
{
c->Message(0, "You only can zone to basic locations: East commonlands,South Ro, West Karana, Gfaydark, Toxxulia Forest, Emerald Jungle, Dreadlands, Eastern Wastes, Western Wastes, Nexus, Scarlet Desert, Grimling Forest");
return;
}
}



I'm wondering if anyone has tested these codes and can verify they work? Reason is, i was trying to compile them and I get errors when I add the scripts - I need to make sure it's me doing something wrong.

Arex
06-08-2006, 07:42 AM
void command_zone(Client *c, const Seperator *sep)
{
uint16 zoneid = 0;
if (sep->arg[1][0] == 0)
{
c->Message(0, "Command Usage: #zone nombre_zona");
return;
} else {
zoneid = database.GetZoneID(sep->arg[1]);
if((zoneid != 22) && (zoneid != 35) && (zoneid != 12) && (zoneid != 54) && (zoneid != 38) && (zoneid != 94) && (zoneid != 86) && (zoneid != 116) && (zoneid != 120) && (zoneid != 152) && (zoneid != 175) && (zoneid != 167))
{
c->Message(0, "You only can zone to basic locations: East commonlands (ecommons),South Ro (sro), West Karana (qey2hh1), Gfaydark (gfaydark), Toxxulia Forest (tox), The Emerald Jungle (emeraldjungle), Dreadlands (dreadlands), Eastern Wastelands (eastwastes), Western Wastes (westwastes), Nexus (nexus), Scarlet Desert (scarlet), Grimling Forest (grimling)");
return;
} else {
c->GoToSafeCoords(zoneid);
}
}
}

This command is working sure, i did any changes, and i am sure that it is working NOW, because i use it on my server...

Angelox
06-08-2006, 09:47 AM
void command_zone(Client *c, const Seperator *sep)
{
uint16 zoneid = 0;
if (sep->arg[1][0] == 0)
{
c->Message(0, "Command Usage: #zone nombre_zona");
return;
} else {
zoneid = database.GetZoneID(sep->arg[1]);
if((zoneid != 22) && (zoneid != 35) && (zoneid != 12) && (zoneid != 54) && (zoneid != 38) && (zoneid != 94) && (zoneid != 86) && (zoneid != 116) && (zoneid != 120) && (zoneid != 152) && (zoneid != 175) && (zoneid != 167))
{
c->Message(0, "You only can zone to basic locations: East commonlands (ecommons),South Ro (sro), West Karana (qey2hh1), Gfaydark (gfaydark), Toxxulia Forest (tox), The Emerald Jungle (emeraldjungle), Dreadlands (dreadlands), Eastern Wastelands (eastwastes), Western Wastes (westwastes), Nexus (nexus), Scarlet Desert (scarlet), Grimling Forest (grimling)");
return;
} else {
c->GoToSafeCoords(zoneid);
}
}
}

This command is working sure, i did any changes, and i am sure that it is working NOW, because i use it on my server...


Ok thanks for your answer - I had figured it out too , i was mis-placing the scripts . I finally compiled, but then lost the hard disk I thought was good :(
I'm trying to get a dedicated EQ Linux server running, I'll try again, when I finish re install the box on another hardisk.