Jump to content
  • 0

[request] about @go random coordinates


myieee

Question


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  83
  • Reputation:   0
  • Joined:  12/07/11
  • Last Seen:  

someone can help me. i have a PK server and i want a random coordinates for example if they use @go 1 . They will warp/respawn in random coordinates like this morocc 123 123 , morocc 213 213 , morocc 412 412 , morocc something like that to avoid hit/kill by the other players . and also to other towns . just give me an example so i can edit the coordinates of the other towns :) thank you.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  185
  • Reputation:   26
  • Joined:  12/07/11
  • Last Seen:  

atcommand.c

FInd this line

ACMD_FUNC(go)
{
int i;
int town;
char map_name[MAP_NAME_LENGTH];
int m;
int xcoordinate = rand();
int ycoordinate = rand();

const struct {
char map[MAP_NAME_LENGTH];
int x, y;
} data[] = {
{ MAP_PRONTERA,	156, 191 }, //  0=Prontera
{ MAP_MORROC,	  156,  93 }, //  1=Morroc
{ MAP_GEFFEN,	  119,  59 }, //  2=Geffen
{ MAP_PAYON,	   162, 233 }, //  3=Payon
{ MAP_ALBERTA,	 192, 147 }, //  4=Alberta
{ MAP_IZLUDE,	  128, 114 }, //  5=Izlude
{ MAP_ALDEBARAN,   140, 131 }, //  6=Al de Baran
{ MAP_LUTIE,	   147, 134 }, //  7=Lutie
{ MAP_COMODO,	  209, 143 }, //  8=Comodo
{ MAP_YUNO,		157,  51 }, //  9=Yuno
{ MAP_AMATSU,	  198,  84 }, // 10=Amatsu
{ MAP_GONRYUN,	 160, 120 }, // 11=Gonryun
{ MAP_UMBALA,	   89, 157 }, // 12=Umbala
{ MAP_NIFLHEIM,	 21, 153 }, // 13=Niflheim
{ MAP_LOUYANG,	 217,  40 }, // 14=Louyang
{ MAP_NOVICE,	   53, 111 }, // 15=Training Grounds
{ MAP_JAIL,		 23,  61 }, // 16=Prison
{ MAP_JAWAII,	  249, 127 }, // 17=Jawaii
{ MAP_AYOTHAYA,	151, 117 }, // 18=Ayothaya
{ MAP_EINBROCH,	 64, 200 }, // 19=Einbroch
{ MAP_LIGHTHALZEN, 158,  92 }, // 20=Lighthalzen
{ MAP_EINBECH,	  70,  95 }, // 21=Einbech
{ MAP_HUGEL,		96, 145 }, // 22=Hugel
{ MAP_RACHEL,	  130, 110 }, // 23=Rachel
{ MAP_VEINS,	   216, 123 }, // 24=Veins
{ MAP_MOSCOVIA,	223, 184 }, // 25=Moscovia
};

Replace with this one:

ACMD_FUNC(go)
{
int i;
int town;
char map_name[MAP_NAME_LENGTH];
int m;
int xcoordinate = rand();
int ycoordinate = rand();
const struct {
 char map[MAP_NAME_LENGTH];
 int x, y;
} data[] = {
 { MAP_PRONTERA,	xcoordinate, ycoordinate }, //  0=Prontera
 { MAP_MORROC,	  xcoordinate, ycoordinate }, //  1=Morroc
 { MAP_GEFFEN,	  xcoordinate, ycoordinate }, //  2=Geffen
 { MAP_PAYON,	   xcoordinate, ycoordinate }, //  3=Payon
 { MAP_ALBERTA,	 xcoordinate, ycoordinate }, //  4=Alberta
 { MAP_IZLUDE,	  xcoordinate, ycoordinate }, //  5=Izlude
 { MAP_ALDEBARAN,   xcoordinate, ycoordinate }, //  6=Al de Baran
 { MAP_LUTIE,	   xcoordinate, ycoordinate }, //  7=Lutie
 { MAP_COMODO,	  xcoordinate, ycoordinate }, //  8=Comodo
 { MAP_YUNO,		xcoordinate, ycoordinate }, //  9=Yuno
 { MAP_AMATSU,	  xcoordinate, ycoordinate }, // 10=Amatsu
 { MAP_GONRYUN,	 xcoordinate, ycoordinate }, // 11=Gonryun
 { MAP_UMBALA,	  xcoordinate, ycoordinate }, // 12=Umbala
 { MAP_NIFLHEIM,	xcoordinate, ycoordinate }, // 13=Niflheim
 { MAP_LOUYANG,	 xcoordinate, ycoordinate }, // 14=Louyang
 { MAP_NOVICE,	  xcoordinate, ycoordinate }, // 15=Training Grounds
 { MAP_JAIL,		xcoordinate, ycoordinate }, // 16=Prison
 { MAP_JAWAII,	  xcoordinate, ycoordinate }, // 17=Jawaii
 { MAP_AYOTHAYA,	xcoordinate, ycoordinate }, // 18=Ayothaya
 { MAP_EINBROCH,	xcoordinate, ycoordinate }, // 19=Einbroch
 { MAP_LIGHTHALZEN, xcoordinate, ycoordinate }, // 20=Lighthalzen
 { MAP_EINBECH,	 xcoordinate, ycoordinate }, // 21=Einbech
 { MAP_HUGEL,	   xcoordinate, ycoordinate }, // 22=Hugel
 { MAP_RACHEL,	  xcoordinate, ycoordinate }, // 23=Rachel
 { MAP_VEINS,	   xcoordinate, ycoordinate }, // 24=Veins
 { MAP_MOSCOVIA,	xcoordinate, ycoordinate }, // 25=Moscovia
};

Then COMPILE!!

Edited by Gerome
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  83
  • Reputation:   0
  • Joined:  12/07/11
  • Last Seen:  

well i tried that but what i want is . only 4 random coordinates :P or something like array ..

bump

Edited by Arcenciel
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...