Jump to content

@go Command ändern / adden


Pysk

Recommended Posts


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  234
  • Reputation:   8
  • Joined:  01/19/12
  • Last Seen:  

Ich hatte diesen Guid damals schon in eAthena gepostet und deswegen stelle ich ihn hier auch wieder rein für die, die nicht wissen wie das geht.

@go commands ändern

Also das ändern ist ganz leicht.

Du gehst in deinen Athena Ordner dann in den Ordner src und dann in map. Dort wirst du folgende Datei finden:

atcommand C

Die Datei mit dem Editor öffnen und suche nach diesem:

/*==========================================
* @go [city_number or city_name] - Updated by Harbin
*------------------------------------------*/
int atcommand_go(const int fd, struct map_session_data* sd, const char* command, const char* message)
{
int i;
int town;
char map_name[MAP_NAME_LENGTH];
int m;
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
};

Das in der Liste sind alle @go Commands mit der Koardinate wo man landet.

In meinem Beispielt vertausche ich jetzt mal Niflheim mit Prontera, so das ich mit @go 0 in Niflheim rauskommen.

Das sollte dann so ausehn!

/*==========================================
* @go [city_number or city_name] - Updated by Harbin
*------------------------------------------*/
int atcommand_go(const int fd, struct map_session_data* sd, const char* command, const char* message)
{
int i;
int town;
char map_name[MAP_NAME_LENGTH];
int m;
const struct {
	char map[MAP_NAME_LENGTH];
	int x, y;
} data[] = {
	{ MAP_NIFLHEIM,	 21, 153 }, //  0=Nifelheim
	{ 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_PRONTERA,	156, 191 }, // 13=Prontera
	{ 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
};

So, nun weis der Server schonmal das @go 0 Niflheim ist.

Wenn ich nun @go eingebe steht Prontera noch immer bei @go 0 deswegen müssen wir noch eine kleinigkeit ändern.

Schaut ein wenig weiter unten und ihr werdet das finden:

// if no value, display all value
if (!message || !*message || sscanf(message, "%11s", map_name) < 1 || town < 0 || town >= ARRAYLENGTH(data)) {
	clif_displaymessage(fd, msg_txt(38)); // Invalid location number or name.
	clif_displaymessage(fd, msg_txt(82)); // Please, use one of this number/name:
	clif_displaymessage(fd, " 0=Prontera		 1=Morroc	   2=Geffen");
	clif_displaymessage(fd, " 3=Payon			4=Alberta	  5=Izlude");
	clif_displaymessage(fd, " 6=Al De Baran	  7=Lutie		8=Comodo");
	clif_displaymessage(fd, " 9=Yuno			 10=Amatsu	  11=Gonryun");
	clif_displaymessage(fd, " 12=Umbala		  13=Niflheim	14=Louyang");
	clif_displaymessage(fd, " 15=Novice Grounds  16=Prison	  17=Jawaii");
	clif_displaymessage(fd, " 18=Ayothaya		19=Einbroch	20=Lighthalzen");
	clif_displaymessage(fd, " 21=Einbech		 22=Hugel	   23=Rachel");
	clif_displaymessage(fd, " 24=Veins");
	return -1;
}

So das ist die Liste wie sie mit @go angezeigt wird.

ändert das nun so ab:

// if no value, display all value
if (!message || !*message || sscanf(message, "%11s", map_name) < 1 || town < 0 || town >= ARRAYLENGTH(data)) {
	clif_displaymessage(fd, msg_txt(38)); // Invalid location number or name.
	clif_displaymessage(fd, msg_txt(82)); // Please, use one of this number/name:
	clif_displaymessage(fd, " 0=Niflheim		 1=Morroc	   2=Geffen");
	clif_displaymessage(fd, " 3=Payon			4=Alberta	  5=Izlude");
	clif_displaymessage(fd, " 6=Al De Baran	  7=Lutie		8=Comodo");
	clif_displaymessage(fd, " 9=Yuno			 10=Amatsu	  11=Gonryun");
	clif_displaymessage(fd, " 12=Umbala		  13=Prontera	14=Louyang");
	clif_displaymessage(fd, " 15=Novice Grounds  16=Prison	  17=Jawaii");
	clif_displaymessage(fd, " 18=Ayothaya		19=Einbroch	20=Lighthalzen");
	clif_displaymessage(fd, " 21=Einbech		 22=Hugel	   23=Rachel");
	clif_displaymessage(fd, " 24=Veins");
	return -1;
}

Das war dann schon alles. Speichert die änderungen ab. Jetzt müsst ihr den Server nur noch nue Kompilieren. Ich mache das Mit MS Visual Studio 2008 Express.

Wenn ihr alles richtig gemacht habt wird @go 0 nun Niflheim sein!

Einfügen von neune @go commands

Also hier habe ich damals lange gebraucht umd dahinter zu kommen warum ich nicht weiter gekommen bin.

Daer bin ich froh wenn ich jemandem damit helfen kann.

Ich werde nun zeigen wie man einen @go Command einfügt für bzw. eine eigene Map.

Also geht in euren Atehna Ordner, wieder in den src Ordner und dann in den Ordner Common öffnet folgende Datei

mapindex H

Sucht einfach mal diesen Code ( kann auch sein das derweile Maps dazu gekommen sind )

//Some definitions for the mayor city maps.
#define MAP_PRONTERA "prontera"
#define MAP_GEFFEN "geffen"
#define MAP_MORROC "morocc"
#define MAP_ALBERTA "alberta"
#define MAP_PAYON "payon"
#define MAP_IZLUDE "izlude"
#define MAP_ALDEBARAN "aldebaran"
#define MAP_LUTIE "xmas"
#define MAP_COMODO "comodo"
#define MAP_YUNO "yuno"
#define MAP_AMATSU "amatsu"
#define MAP_GONRYUN "gonryun"
#define MAP_UMBALA "umbala"
#define MAP_NIFLHEIM "niflheim"
#define MAP_LOUYANG "louyang"
#define MAP_JAWAII "jawaii"
#define MAP_AYOTHAYA "ayothaya"
#define MAP_EINBROCH "einbroch"
#define MAP_LIGHTHALZEN "lighthalzen"
#define MAP_EINBECH "einbech"
#define MAP_HUGEL "hugel"
#define MAP_RACHEL "rachel"
#define MAP_VEINS "veins"
#define MAP_JAIL "sec_pri"
#define MAP_NOVICE "new_zone01

Das ist die Liste der Maps die die atcommand kennt. Also in Beispiel nehmen wir Mocovia zum einfügen.

Also tragt unter

#define MAP_NOVICE "new_zone01

das ein

#define MAP_MOSCOVIA "moscovia"

Hierbei steht MAP_MOSCOVIA für den Verweis in der atcomand und "moscovia" ist der Name der Map.

Das ganze sollte so aussehen

//Some definitions for the mayor city maps.
#define MAP_PRONTERA "prontera"
#define MAP_GEFFEN "geffen"
#define MAP_MORROC "morocc"
#define MAP_ALBERTA "alberta"
#define MAP_PAYON "payon"
#define MAP_IZLUDE "izlude"
#define MAP_ALDEBARAN "aldebaran"
#define MAP_LUTIE "xmas"
#define MAP_COMODO "comodo"
#define MAP_YUNO "yuno"
#define MAP_AMATSU "amatsu"
#define MAP_GONRYUN "gonryun"
#define MAP_UMBALA "umbala"
#define MAP_NIFLHEIM "niflheim"
#define MAP_LOUYANG "louyang"
#define MAP_JAWAII "jawaii"
#define MAP_AYOTHAYA "ayothaya"
#define MAP_EINBROCH "einbroch"
#define MAP_LIGHTHALZEN "lighthalzen"
#define MAP_EINBECH "einbech"
#define MAP_HUGEL "hugel"
#define MAP_RACHEL "rachel"
#define MAP_VEINS "veins"
#define MAP_JAIL "sec_pri"
#define MAP_NOVICE "new_zone01
#define MAP_MOSCOVIA "moscovia"

Das einmal abspeichern da wir hier fertig sind.

Gut wen ihr das habt speichert es ab.

Geht nun wieder in den map Ordner im src Ordner

öffnet wieder die atcommand C Datei

und geht wieder zum Eintrag

/*==========================================
* @go [city_number or city_name] - Updated by Harbin
*------------------------------------------*/
int atcommand_go(const int fd, struct map_session_data* sd, const char* command, const char* message)
{
int i;
int town;
char map_name[MAP_NAME_LENGTH];
int m;
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
};

Nun schreibt ihr unter die Zeile von Veins folgendes:

{ MAP_MOSCOVIA,	   224, 190 }, // 25=Moscovia

Wir errinern uns wozu wir eben MAP_Moscovia eingetragen haben :)

Wenn ihr das gemacht habt sollte das so aussehen.

/*==========================================
* @go [city_number or city_name] - Updated by Harbin
*------------------------------------------*/
int atcommand_go(const int fd, struct map_session_data* sd, const char* command, const char* message)
{
int i;
int town;
char map_name[MAP_NAME_LENGTH];
int m;
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,	   224, 190 }, // 25=Moscovia
};

Nun weis der Server das @go 25 Moscovia ist.

Nun muss es noch in die @go Liste eingetragen werden. Geht wieder etwas nach unten zu:

// if no value, display all value
if (!message || !*message || sscanf(message, "%11s", map_name) < 1 || town < 0 || town >= ARRAYLENGTH(data)) {
	clif_displaymessage(fd, msg_txt(38)); // Invalid location number or name.
	clif_displaymessage(fd, msg_txt(82)); // Please, use one of this number/name:
	clif_displaymessage(fd, " 0=Prontera		 1=Morroc	   2=Geffen");
	clif_displaymessage(fd, " 3=Payon			4=Alberta	  5=Izlude");
	clif_displaymessage(fd, " 6=Al De Baran	  7=Lutie		8=Comodo");
	clif_displaymessage(fd, " 9=Yuno			 10=Amatsu	  11=Gonryun");
	clif_displaymessage(fd, " 12=Umbala		  13=Niflheim	14=Louyang");
	clif_displaymessage(fd, " 15=Novice Grounds  16=Prison	  17=Jawaii");
	clif_displaymessage(fd, " 18=Ayothaya		19=Einbroch	20=Lighthalzen");
	clif_displaymessage(fd, " 21=Einbech		 22=Hugel	   23=Rachel");
	clif_displaymessage(fd, " 24=Veins");
	return -1;
}

Für uns ist nur diese Zeile interesannt:

clif_displaymessage(fd, " 24=Veins");

ändern die Zeile so ab:

clif_displaymessage(fd, " 24=Veins

Nun schreibt ihr euere Map rein. Das sieht dann so aus:

clif_displaymessage(fd, " 24=Veins		 25=Moscovia");

Hierbei gillt es zu beachten das dieses

");

nur am Ende der zeile stehen darf sonst klappt es nicht!

Das ganze sollte nun so ausehn:

// if no value, display all value
if (!message || !*message || sscanf(message, "%11s", map_name) < 1 || town < 0 || town >= ARRAYLENGTH(data)) {
	clif_displaymessage(fd, msg_txt(38)); // Invalid location number or name.
	clif_displaymessage(fd, msg_txt(82)); // Please, use one of this number/name:
	clif_displaymessage(fd, " 0=Niflheim		 1=Morroc	   2=Geffen");
	clif_displaymessage(fd, " 3=Payon			4=Alberta	  5=Izlude");
	clif_displaymessage(fd, " 6=Al De Baran	  7=Lutie		8=Comodo");
	clif_displaymessage(fd, " 9=Yuno			 10=Amatsu	  11=Gonryun");
	clif_displaymessage(fd, " 12=Umbala		  13=Prontera	14=Louyang");
	clif_displaymessage(fd, " 15=Novice Grounds  16=Prison	  17=Jawaii");
	clif_displaymessage(fd, " 18=Ayothaya		19=Einbroch	20=Lighthalzen");
	clif_displaymessage(fd, " 21=Einbech		 22=Hugel	   23=Rachel");
	clif_displaymessage(fd, " 24=Veins		 25=Moscovia");
	return -1;
}

Das war dann schon alles. Speichert die änderungen ab. Jetzt müsst ihr den Server nur noch nue Kompilieren. Ich mache das Mit MS Visual Studio 2008 Express.

Wenn ihr es richtig gemacht habt sollte @go 25 euch nach Moscovia bringen.

Ich hoffe das ich alles richtig erklärt habe und nixs vergessen oder vertauscht habe. Wenns doch Probleme gibt einfach mal melden.

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
Reply to this topic...

×   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...