Автор: Extez1: Дата: 09.18.2009
как добавить @go 100500? и убрать @go 100500?
Т.е. добавить новый варп в команду @go.
и ещё есть у кого стилист нормальный? не стандартный?
Перенесите в соотвествующий раздел.
Автор: Eleidan: Дата: 11.01.2009
Народ, помогите плиз.
У меня синтаксис другой, хотел добавить мапу на @go 0, а пронту на @go 26.
Вот код:
/*==========================================
* @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_ZENIA, 196, 139 }, // 0=Zenia
{ 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
{ MAP_PRONTERA, 156, 191 }, // 26=Prontera
};
nullpo_retr(-1, sd);
if( map[sd->bl.m].flag.nogo && battle_config.any_warp_GM_min_level > pc_isGM(sd) ) {
clif_displaymessage(sd->fd,"You can not use @go on this map.");
return 0;
}
memset(map_name, '\0', sizeof(map_name));
memset(atcmd_output, '\0', sizeof(atcmd_output));
// get the number
town = atoi(message);
// 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 provide a name or number from the list provided:
clif_displaymessage(fd, " 0=Zenia 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 25=Moscovia 26=Prontera");
return -1;
}
// get possible name of the city
map_name[MAP_NAME_LENGTH-1] = '\0';
for (i = 0; map_name; i++)
map_name = TOLOWER(map_name);
// try to identify the map name
if (strncmp(map_name, "zenia", 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;
} else if (strncmp(map_name, "moscovia", 3) == 0) {
town = 25;
} else if (strncmp(map_name, "prontera", 3) == 0) {
town = 25;
}
if (town >= 0 && town < ARRAYLENGTH(data))
{
m = map_mapname2mapid(data[town].map);
if (m >= 0 && map[m].flag.nowarpto && battle_config.any_warp_GM_min_level > pc_isGM(sd)) {
clif_displaymessage(fd, msg_txt(247));
return -1;
}
if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarp && battle_config.any_warp_GM_min_level > pc_isGM(sd)) {
clif_displaymessage(fd, msg_txt(248));
return -1;
}
if (pc_setpos(sd, mapindex_name2id(data[town].map), data[town].x, data[town].y, 3) == 0) {
clif_displaymessage(fd, msg_txt(0)); // Warped.
} else {
clif_displaymessage(fd, msg_txt(1)); // Map not found.
return -1;
}
} else { // if you arrive here, you have an error in town variable when reading of names
clif_displaymessage(fd, msg_txt(38)); // Invalid location number or name.
return -1;
}
return 0;
}
Автор: Eleidan: Дата: 11.06.2009
Все. Проблему решил. Если кому интересно как, могу написать, если кто не знает.
Автор: Cutlet: Дата: 11.10.2009
пиши,если сейчас не интересно кому нибудь потом понадобится
Автор: nomn: Дата: 11.10.2009
Идём в src\common\mapindex.h
находим
//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_MOYAMAPA "moyamapa"
Автор: Cutlet: Дата: 11.12.2009
Цитата Extez1;12847:
и ещё есть у кого стилист нормальный? не стандартный?