GMcommand go2 : 43 locations

If you want to help us or give some corrections / codes, put it here :)

Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators

GMcommand go2 : 43 locations

Postby BlackLousky on 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.

    - 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 :

    GMcommand_go2.gif
    GMcommand go2


Code :

Files to modify :
- common/sockets.h
- World Server/worldserver.cpp
- World Server/gmcmds.cpp
- Binary/commands.ini


In worldserver.cpp find:
  1.    Config.Command_Go = ConfigGetInt    ( "commands.ini", "go", 299 ); //change to 99 to give access for all players

Under it add:
  1.    Config.Command_Go2 = ConfigGetInt    ( "commands.ini", "go2", 299 ); //change to 99 to give access for all players



In sockets.h find:

Under it add:



In gmcmds.cpp find:
  1.            Log( MSG_GMACTION, " %s : /go %i" , thisclient->CharInfo->charname, loc);
  2.         }
  3.         return true;
  4.     }

Under it add:
  1.     else if (strcmp(command, "go2")==0) // AtCommandGo2
  2.     {
  3.         if(Config.Command_Go2 > thisclient->Session->accesslevel)
  4.            return true;
  5.         if ((tmp = strtok(NULL, " ")) == NULL) tmp = 0; int loc=atoi(tmp);
  6.         if(Config.Command_Go2 > thisclient->Session->accesslevel)
  7.             return true;
  8.         int x = 0;
  9.         int y = 0;
  10.         int map = 0;
  11.        
  12.         switch(loc)
  13.         {
  14.             case 1:
  15.                 map = 1;
  16.                 x = 5242;
  17.                 y = 5193;
  18.             break;
  19.             case 2:
  20.                 map = 2;
  21.                 x = 5655;
  22.                 y = 5228;
  23.             break;
  24.             case 3:
  25.                 map = 3;
  26.                 x = 5198;
  27.                 y = 5010;
  28.             break;
  29.             case 4:
  30.                 map = 5;
  31.                 x = 5201;
  32.                 y = 5277;
  33.             break;
  34.             case 5:
  35.                 map = 6;
  36.                 x = 5201;
  37.                 y = 5277;
  38.             break;
  39.             case 6:
  40.                 map = 8;
  41.                 x = 5160;
  42.                 y = 5080;
  43.             break;
  44.             case 7:
  45.                 map = 11;
  46.                 x = 5160;
  47.                 y = 5132;
  48.             break;
  49.             case 8:
  50.                 map = 12;
  51.                 x = 5160;
  52.                 y = 5132;
  53.             break;
  54.             case 9:
  55.                 map = 13;
  56.                 x = 5160;
  57.                 y = 5132;
  58.             break;
  59.             case 10:
  60.                 map = 21;
  61.                 x = 5158;
  62.                 y = 5352;
  63.             break;
  64.             case 11:
  65.                 map = 22;
  66.                 x = 5112;
  67.                 y = 5350;
  68.             break;
  69.             case 12:
  70.                 map = 23;
  71.                 x = 5351;
  72.                 y = 5056;
  73.             break;
  74.             case 13:
  75.                 map = 24;
  76.                 x = 5379;
  77.                 y = 5329;
  78.             break;
  79.             case 14:
  80.                 map = 25;
  81.                 x = 5377;
  82.                 y = 5185;
  83.             break;
  84.             case 15:
  85.                 map = 26;
  86.                 x = 5278;
  87.                 y = 5158;
  88.             break;
  89.             case 16:
  90.                 map = 27;
  91.                 x = 5479;
  92.                 y = 4976;
  93.             break;
  94.             case 17:
  95.                 map = 28;
  96.                 x = 5205;
  97.                 y = 4911;
  98.             break;
  99.             case 18:
  100.                 map = 29;
  101.                 x = 5093;
  102.                 y = 5144;
  103.             break;
  104.             case 19:
  105.                 map = 31;
  106.                 x = 5516;
  107.                 y = 5437;
  108.             break;
  109.             case 20:
  110.                 map = 32;
  111.                 x = 5435;
  112.                 y = 5259;
  113.             break;
  114.             case 21:
  115.                 map = 33;
  116.                 x = 5605;
  117.                 y = 5488;
  118.             break;
  119.             case 22:
  120.                 map = 37;
  121.                 x = 5184;
  122.                 y = 5256;
  123.             break;
  124.             case 23:
  125.                 map = 38;
  126.                 x = 5074;
  127.                 y = 5342;
  128.             break;
  129.             case 24:
  130.                 map = 51;
  131.                 x = 5362;
  132.                 y = 5094;
  133.             break;
  134.             case 25:
  135.                 map = 52;
  136.                 x = 6079;
  137.                 y = 5269;
  138.             break;
  139.             case 26:
  140.                 map = 53;
  141.                 x = 6229;
  142.                 y = 5313;
  143.             break;
  144.             case 27:
  145.                 map = 54;
  146.                 x = 5094;
  147.                 y = 4254;
  148.             break;
  149.             case 28:
  150.                 map = 55;
  151.                 x = 5789;
  152.                 y = 4619;
  153.             break;
  154.             case 29:
  155.                 map = 56;
  156.                 x = 5035;
  157.                 y = 5200;
  158.             break;
  159.             case 30:
  160.                 map = 57;
  161.                 x = 5540;
  162.                 y = 5145;
  163.             break;
  164.             case 31:
  165.                 map = 58;
  166.                 x = 5680;
  167.                 y = 4287;
  168.             break;
  169.             case 32:
  170.                 map = 59;
  171.                 x = 5102;
  172.                 y = 5132;
  173.             break;
  174.             case 33:
  175.                 map = 61;
  176.                 x = 5431;
  177.                 y = 4603;
  178.             break;
  179.             case 34:
  180.                 map = 62;
  181.                 x = 5666;
  182.                 y = 5139;
  183.             break;
  184.             case 35:
  185.                 map = 63;
  186.                 x = 5407;
  187.                 y = 4491;
  188.             break;
  189.             case 36:
  190.                 map = 64;
  191.                 x = 5197;
  192.                 y = 5157;
  193.             break;
  194.             case 37:
  195.                 map = 65;
  196.                 x = 5395;
  197.                 y = 5205;
  198.             break;
  199.             case 38:
  200.                 map = 4;
  201.                 x = 5200;
  202.                 y = 5230;
  203.             break;
  204.             case 39:
  205.                 map = 9;
  206.                 x = 5200;
  207.                 y = 4860;
  208.             break;
  209.             case 40:
  210.                 map = 40;
  211.                 x = 5180;
  212.                 y = 5210;
  213.             break;
  214.             case 41:
  215.                 map = 41;
  216.                 x = 5200;
  217.                 y = 5250;
  218.             break;
  219.             case 42:
  220.                 map = 42;
  221.                 x = 5150;
  222.                 y = 5250;
  223.             break;
  224.             case 43:
  225.                 map = 70;
  226.                 x = 5302;
  227.                 y = 5040;
  228.             break;
  229.           default:
  230.             SendPM(thisclient, "Please input a number after the go2 command, below is a list of places and their appropriate number");
  231.             SendPM(thisclient, "1 [1] = Canyon City of Zant");
  232.             SendPM(thisclient, "2 [2] = City of Junon Polis");
  233.             SendPM(thisclient, "3 [3] = Dolphin Island");
  234.             SendPM(thisclient, "4 [5] = Junon Cartel");
  235.             SendPM(thisclient, "5 [6] = Crusader Training Camp");
  236.             SendPM(thisclient, "6 [8] = Lion's Plains");
  237.             SendPM(thisclient, "7 [11] = Junon Clan Field (30-49)");
  238.             SendPM(thisclient, "8 [12] = Junon Clan Field (50-59)");
  239.             SendPM(thisclient, "9 [13] = Junon Clan Field (69-89)");
  240.             SendPM(thisclient, "10 [21] = Valley of Luxem Tower");
  241.             SendPM(thisclient, "11 [22] = Adventurer's Plains");
  242.             SendPM(thisclient, "12 [23] = Breezy Hills");
  243.             SendPM(thisclient, "13 [24] = El Verloon Desert");
  244.             SendPM(thisclient, "14 [25] = Anima Lake");
  245.             SendPM(thisclient, "15 [26] = Forest of Wisdom");
  246.             SendPM(thisclient, "16 [27] = Kenji Beach");
  247.             SendPM(thisclient, "17 [28] = Gorge of Silence");
  248.             SendPM(thisclient, "18 [29] = Desert of the Dead");
  249.             SendPM(thisclient, "19 [31] = Goblin Cave (B1)");
  250.             SendPM(thisclient, "20 [32] = Goblin Cave (B2)");
  251.             SendPM(thisclient, "21 [33] = Goblin Cave (B3)");
  252.             SendPM(thisclient, "22 [37] = Sunshine Coast");
  253.             SendPM(thisclient, "23 [38] = Santa Planetoid");
  254.             SendPM(thisclient, "24 [51] = Magic City of the Eucar");
  255.             SendPM(thisclient, "25 [52] = Mana Snowfields"); // error map bugged
  256.             SendPM(thisclient, "26 [53] = Arumic Valley");
  257.             SendPM(thisclient, "27 [54] = Crystal Snowfields");
  258.             SendPM(thisclient, "28 [55] = Freezing Plateau");
  259.             SendPM(thisclient, "29 [56] = Forgotten Temple (B1)");
  260.             SendPM(thisclient, "30 [57] = Forgotten Temple (B2)");
  261.             SendPM(thisclient, "31 [58] = Mount Eruca");
  262.             SendPM(thisclient, "32 [59] = Luna Clan Field");
  263.             SendPM(thisclient, "33 [61] = Refuge Xita");
  264.             SendPM(thisclient, "34 [62] = Shady Jungle");
  265.             SendPM(thisclient, "35 [63] = Forest of Wandering");
  266.             SendPM(thisclient, "36 [64] = Marsh of Ghosts");
  267.             SendPM(thisclient, "37 [65] = Sikuku Underground Prison");
  268.             SendPM(thisclient, "38 [4] = Character Select Map");
  269.             SendPM(thisclient, "39 [9] = Union War PvP");
  270.             SendPM(thisclient, "40 [40] = Grand Ballroom");
  271.             SendPM(thisclient, "41 [41] = Pyramide 1F - Elveroon Desert");
  272.             SendPM(thisclient, "42 [42] = Pyramide - Elveroon Desert");
  273.             SendPM(thisclient, "43 [70] = Pedion - Clan Wars");
  274.             SendPM(thisclient, "Example; /go2 13");
  275.         };
  276.  
  277.         // You can remove these 5 lines if you don't want the 25% HP limitation
  278.         if ( thisclient->Stats->HP < (thisclient->Stats->MaxHP / 4) || thisclient->Stats->HP < 1 || thisclient->Session->inGame == false )
  279.         {
  280.              SendPM(thisclient, "You need at least 25% HP in order to warp");
  281.              return true;
  282.         }
  283.  
  284.         if( (x != 0) && (y != 0) && (map != 0) )
  285.         {
  286.             fPoint coord;
  287.             coord.x = x;
  288.             coord.y = y;
  289.             MapList.Index[map]->TeleportPlayer( thisclient, coord, false );
  290.             Log( MSG_GMACTION, " %s : /go2 %i" , thisclient->CharInfo->charname, loc);
  291.         }
  292.         return true;
  293.     }



In commands.ini find:
  1. Go=299 //change to 99 to give access for all player

Under it add:
  1. Go2=299 //change to 99 to give access for all players
BlackLousky
Little soul
Little soul
 
Posts: 8
Joined: Sat Apr 19, 2008 8:50 pm

Return to Submit Code

Who is online

Users browsing this forum: No registered users and 6 guests

cron