GMcommand go2 : 43 locations
Posted: Sat Apr 19, 2008 9:55 pm
Hi,
This is my first post here.
Happy to join your community.
Configuration:
This code was compiled and tested in game.
Client : Client 131 by OsiRose Dev Team without modifications
Server : OsiRose rev.69 without modifications
Sources :
I didn't create a new thing.
I took the code of this post : viewtopic.php?f=21&t=973 by CursedYew
in the OsRose SubmitCode
Modifications :
All my modifications are located in the gmcmds.cpp file.
So, if you already added the CursedYew /go2 GMcommand, you only need to modify this file.
Bugs :
I only have 1 bug.
When i go to location 25 [52] = Mana Snowfields
After few secondes on this map, the client crashes.
/go2 is not the reason of this bug.
But, if you use same client/server, you have the risk to have the same bug.
Screenshot :
Code :
Files to modify :
- common/sockets.h
- World Server/worldserver.cpp
- World Server/gmcmds.cpp
- Binary/commands.ini
In worldserver.cpp find:
Under it add:
In sockets.h find:
Under it add:
In gmcmds.cpp find:
Under it add:
In commands.ini find:
Under it add:
This is my first post here.
Happy to join your community.
Configuration:
This code was compiled and tested in game.
Client : Client 131 by OsiRose Dev Team without modifications
Server : OsiRose rev.69 without modifications
Sources :
I didn't create a new thing.
I took the code of this post : viewtopic.php?f=21&t=973 by CursedYew
in the OsRose SubmitCode
Modifications :
All my modifications are located in the gmcmds.cpp file.
So, if you already added the CursedYew /go2 GMcommand, you only need to modify this file.
- - switch case /else if
As core proposed, i replaced else if by switch case.
- - new locations
Cursed version has 37 locations, i added 6 more.
- - Map Id
Because, it could be useful to have the Map Id, i added it just after the warp number.
For exemple : /go7 is 7 [11] = Junon Clan Field (30-49)
warp number 7, Map Id 11, description Junon Clan Field (30-49)
So, you can use /teleport Gmcommande with the Map Id
Bugs :
I only have 1 bug.
When i go to location 25 [52] = Mana Snowfields
After few secondes on this map, the client crashes.
/go2 is not the reason of this bug.
But, if you use same client/server, you have the risk to have the same bug.
Screenshot :
Code :
Files to modify :
- common/sockets.h
- World Server/worldserver.cpp
- World Server/gmcmds.cpp
- Binary/commands.ini
In worldserver.cpp find:
- Config.Command_Go = ConfigGetInt ( "commands.ini", "go", 299 ); //change to 99 to give access for all players
Under it add:
- Config.Command_Go2 = ConfigGetInt ( "commands.ini", "go2", 299 ); //change to 99 to give access for all players
In sockets.h find:
- int Command_Go;
Under it add:
- int Command_Go2;
In gmcmds.cpp find:
- Log( MSG_GMACTION, " %s : /go %i" , thisclient->CharInfo->charname, loc);
- }
- return true;
- }
Under it add:
- else if (strcmp(command, "go2")==0) // AtCommandGo2
- {
- if(Config.Command_Go2 > thisclient->Session->accesslevel)
- return true;
- if ((tmp = strtok(NULL, " ")) == NULL) tmp = 0; int loc=atoi(tmp);
- if(Config.Command_Go2 > thisclient->Session->accesslevel)
- return true;
- int x = 0;
- int y = 0;
- int map = 0;
- switch(loc)
- {
- case 1:
- map = 1;
- x = 5242;
- y = 5193;
- break;
- case 2:
- map = 2;
- x = 5655;
- y = 5228;
- break;
- case 3:
- map = 3;
- x = 5198;
- y = 5010;
- break;
- case 4:
- map = 5;
- x = 5201;
- y = 5277;
- break;
- case 5:
- map = 6;
- x = 5201;
- y = 5277;
- break;
- case 6:
- map = 8;
- x = 5160;
- y = 5080;
- break;
- case 7:
- map = 11;
- x = 5160;
- y = 5132;
- break;
- case 8:
- map = 12;
- x = 5160;
- y = 5132;
- break;
- case 9:
- map = 13;
- x = 5160;
- y = 5132;
- break;
- case 10:
- map = 21;
- x = 5158;
- y = 5352;
- break;
- case 11:
- map = 22;
- x = 5112;
- y = 5350;
- break;
- case 12:
- map = 23;
- x = 5351;
- y = 5056;
- break;
- case 13:
- map = 24;
- x = 5379;
- y = 5329;
- break;
- case 14:
- map = 25;
- x = 5377;
- y = 5185;
- break;
- case 15:
- map = 26;
- x = 5278;
- y = 5158;
- break;
- case 16:
- map = 27;
- x = 5479;
- y = 4976;
- break;
- case 17:
- map = 28;
- x = 5205;
- y = 4911;
- break;
- case 18:
- map = 29;
- x = 5093;
- y = 5144;
- break;
- case 19:
- map = 31;
- x = 5516;
- y = 5437;
- break;
- case 20:
- map = 32;
- x = 5435;
- y = 5259;
- break;
- case 21:
- map = 33;
- x = 5605;
- y = 5488;
- break;
- case 22:
- map = 37;
- x = 5184;
- y = 5256;
- break;
- case 23:
- map = 38;
- x = 5074;
- y = 5342;
- break;
- case 24:
- map = 51;
- x = 5362;
- y = 5094;
- break;
- case 25:
- map = 52;
- x = 6079;
- y = 5269;
- break;
- case 26:
- map = 53;
- x = 6229;
- y = 5313;
- break;
- case 27:
- map = 54;
- x = 5094;
- y = 4254;
- break;
- case 28:
- map = 55;
- x = 5789;
- y = 4619;
- break;
- case 29:
- map = 56;
- x = 5035;
- y = 5200;
- break;
- case 30:
- map = 57;
- x = 5540;
- y = 5145;
- break;
- case 31:
- map = 58;
- x = 5680;
- y = 4287;
- break;
- case 32:
- map = 59;
- x = 5102;
- y = 5132;
- break;
- case 33:
- map = 61;
- x = 5431;
- y = 4603;
- break;
- case 34:
- map = 62;
- x = 5666;
- y = 5139;
- break;
- case 35:
- map = 63;
- x = 5407;
- y = 4491;
- break;
- case 36:
- map = 64;
- x = 5197;
- y = 5157;
- break;
- case 37:
- map = 65;
- x = 5395;
- y = 5205;
- break;
- case 38:
- map = 4;
- x = 5200;
- y = 5230;
- break;
- case 39:
- map = 9;
- x = 5200;
- y = 4860;
- break;
- case 40:
- map = 40;
- x = 5180;
- y = 5210;
- break;
- case 41:
- map = 41;
- x = 5200;
- y = 5250;
- break;
- case 42:
- map = 42;
- x = 5150;
- y = 5250;
- break;
- case 43:
- map = 70;
- x = 5302;
- y = 5040;
- break;
- default:
- SendPM(thisclient, "Please input a number after the go2 command, below is a list of places and their appropriate number");
- SendPM(thisclient, "1 [1] = Canyon City of Zant");
- SendPM(thisclient, "2 [2] = City of Junon Polis");
- SendPM(thisclient, "3 [3] = Dolphin Island");
- SendPM(thisclient, "4 [5] = Junon Cartel");
- SendPM(thisclient, "5 [6] = Crusader Training Camp");
- SendPM(thisclient, "6 [8] = Lion's Plains");
- SendPM(thisclient, "7 [11] = Junon Clan Field (30-49)");
- SendPM(thisclient, "8 [12] = Junon Clan Field (50-59)");
- SendPM(thisclient, "9 [13] = Junon Clan Field (69-89)");
- SendPM(thisclient, "10 [21] = Valley of Luxem Tower");
- SendPM(thisclient, "11 [22] = Adventurer's Plains");
- SendPM(thisclient, "12 [23] = Breezy Hills");
- SendPM(thisclient, "13 [24] = El Verloon Desert");
- SendPM(thisclient, "14 [25] = Anima Lake");
- SendPM(thisclient, "15 [26] = Forest of Wisdom");
- SendPM(thisclient, "16 [27] = Kenji Beach");
- SendPM(thisclient, "17 [28] = Gorge of Silence");
- SendPM(thisclient, "18 [29] = Desert of the Dead");
- SendPM(thisclient, "19 [31] = Goblin Cave (B1)");
- SendPM(thisclient, "20 [32] = Goblin Cave (B2)");
- SendPM(thisclient, "21 [33] = Goblin Cave (B3)");
- SendPM(thisclient, "22 [37] = Sunshine Coast");
- SendPM(thisclient, "23 [38] = Santa Planetoid");
- SendPM(thisclient, "24 [51] = Magic City of the Eucar");
- SendPM(thisclient, "25 [52] = Mana Snowfields"); // error map bugged
- SendPM(thisclient, "26 [53] = Arumic Valley");
- SendPM(thisclient, "27 [54] = Crystal Snowfields");
- SendPM(thisclient, "28 [55] = Freezing Plateau");
- SendPM(thisclient, "29 [56] = Forgotten Temple (B1)");
- SendPM(thisclient, "30 [57] = Forgotten Temple (B2)");
- SendPM(thisclient, "31 [58] = Mount Eruca");
- SendPM(thisclient, "32 [59] = Luna Clan Field");
- SendPM(thisclient, "33 [61] = Refuge Xita");
- SendPM(thisclient, "34 [62] = Shady Jungle");
- SendPM(thisclient, "35 [63] = Forest of Wandering");
- SendPM(thisclient, "36 [64] = Marsh of Ghosts");
- SendPM(thisclient, "37 [65] = Sikuku Underground Prison");
- SendPM(thisclient, "38 [4] = Character Select Map");
- SendPM(thisclient, "39 [9] = Union War PvP");
- SendPM(thisclient, "40 [40] = Grand Ballroom");
- SendPM(thisclient, "41 [41] = Pyramide 1F - Elveroon Desert");
- SendPM(thisclient, "42 [42] = Pyramide - Elveroon Desert");
- SendPM(thisclient, "43 [70] = Pedion - Clan Wars");
- SendPM(thisclient, "Example; /go2 13");
- };
- // You can remove these 5 lines if you don't want the 25% HP limitation
- if ( thisclient->Stats->HP < (thisclient->Stats->MaxHP / 4) || thisclient->Stats->HP < 1 || thisclient->Session->inGame == false )
- {
- SendPM(thisclient, "You need at least 25% HP in order to warp");
- return true;
- }
- if( (x != 0) && (y != 0) && (map != 0) )
- {
- fPoint coord;
- coord.x = x;
- coord.y = y;
- MapList.Index[map]->TeleportPlayer( thisclient, coord, false );
- Log( MSG_GMACTION, " %s : /go2 %i" , thisclient->CharInfo->charname, loc);
- }
- return true;
- }
In commands.ini find:
- Go=299 //change to 99 to give access for all player
Under it add:
- Go2=299 //change to 99 to give access for all players