Admin Admin
Jumlah posting : 46 Join date : 23.02.10 Age : 33 Lokasi : Surabaia - Indonesia
| Subyek: Menambahkan @go Wed Feb 24, 2010 12:14 am | |
| Pertama, Buka ./src/map/atcommand.c
Cari Menggunakan Find ( ketik @go )
- Code:
-
/*========================================== * @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, 223, 184 }, // 25=Moscovia }; Sekarang, misalkan anda menginginkan sebuah warp untuk Glast Heim dengan perintah @ go 25: setelah
- Code:
-
{ MAP_MOSCOVIA, 223, 184 }, // 25=Moscovia tambahkan line seperti ini : - Code:
-
<tab><tab>{ MAP_GLAST_01,<tab>123, 234 }, // 26=GlastHeim formatnya seperti ini :
- Code:
-
<tab><tab>{ MAP_MAPNAME,<tab>Coordinate X, Coordinate Y }, // Number=the location name ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sekarang buka /src/common/mapindex.h
akan terlihat seperti ini :
- Code:
-
//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_1-1" #define MAP_MOSCOVIA "moscovia"
Tambahkan pada baris terbawah ( bawah sendiri ) seperti ini
- Code:
-
#define MAP_MAPNAME "mapname" (contoh #define MAP_MAPNAME "glastheim" Perhatikan bahwa tidak ada tab di situ. Sekarang, simpan file source dan kompile ulang server. Dan Anda akan memiliki custom @go untuk menuju map yang anda buat / pasang .
Langkah-langkah opsional :
Jika Anda ingin lokasi yang baru ditambahkan berada di pesan saat Anda mengetik @go , memodifikasi baris berikut di ... / src / map / atcommand.c
- Code:
-
clif_displaymessage(fd, " 24=Veins 25=Moscovia"); dan rubah ke - Code:
-
clif_displaymessage(fd, " 24=Veins 25=Moscovia 26=Your Map"); Jangan lupa gunakan spasi seperti contoh yang lain
Bila anda ingin @go berjalan dengan baik sesuai nama kota dan code yang anda pasang,silakan mencari tulisan ini :
- Code:
-
// try to identify the map name if (strncmp(map_name, "prontera", 3) == 0) { town = 0; } else if (strncmp(map_name, "morocc", 3) == 0) { town = 1; } else if (strncmp(map_name, "geffen", 3) == 0) { town = 2; } else if (strncmp(map_name, "payon", 3) == 0 || strncmp(map_name, "paion", 3) == 0) { town = 3; } else if (strncmp(map_name, "alberta", 3) == 0) { town = 4; } else if (strncmp(map_name, "izlude", 3) == 0 || strncmp(map_name, "islude", 3) == 0) { town = 5; } else if (strncmp(map_name, "aldebaran", 3) == 0 || strcmp(map_name, "al") == 0) { town = 6; } else if (strncmp(map_name, "lutie", 3) == 0 || strcmp(map_name, "christmas") == 0 || strncmp(map_name, "xmas", 3) == 0 || strncmp(map_name, "x-mas", 3) == 0) { town = 7; } else if (strncmp(map_name, "comodo", 3) == 0) { town = 8; } else if (strncmp(map_name, "yuno", 3) == 0) { town = 9; } else if (strncmp(map_name, "amatsu", 3) == 0) { town = 10; } else if (strncmp(map_name, "gonryun", 3) == 0) { town = 11; } else if (strncmp(map_name, "umbala", 3) == 0) { town = 12; } else if (strncmp(map_name, "niflheim", 3) == 0) { town = 13; } else if (strncmp(map_name, "louyang", 3) == 0) { town = 14; } else if (strncmp(map_name, "new_1-1", 3) == 0 || strncmp(map_name, "startpoint", 3) == 0 || strncmp(map_name, "begining", 3) == 0) { town = 15; } else if (strncmp(map_name, "sec_pri", 3) == 0 || strncmp(map_name, "prison", 3) == 0 || strncmp(map_name, "jails", 3) == 0) { town = 16; } else if (strncmp(map_name, "jawaii", 3) == 0 || strncmp(map_name, "jawai", 3) == 0) { town = 17; } else if (strncmp(map_name, "ayothaya", 3) == 0 || strncmp(map_name, "ayotaya", 3) == 0) { town = 18; } else if (strncmp(map_name, "einbroch", 5) == 0 || strncmp(map_name, "ainbroch", 5) == 0) { town = 19; } else if (strncmp(map_name, "lighthalzen", 3) == 0) { town = 20; } else if (strncmp(map_name, "einbech", 3) == 0) { town = 21; } else if (strncmp(map_name, "hugel", 3) == 0) { town = 22; } else if (strncmp(map_name, "rachel", 3) == 0) { town = 23; } else if (strncmp(map_name, "veins", 3) == 0) { town = 24; [b] } else if (strncmp(map_name, "moscovia", 3) == 0) { town = 25;[/b] } setelah code map moscovia ( yang saya bold ) selesai tambahkan ini :
- Code:
-
} else if (strncmp(map_name, "<mapname>", <number of characters required>) == 0) { town = 26; <nomor karakter dibutuhkan / required> adalah jumlah karakter dari nama yang diperlukan untuk diketik bersama dengan @go untuk nama kota harus diakui.
Credit By Eathena
Translate By Andrew Ric0zTa ( Admin MrcRO ) | |
|