diff options
author | malufett <malufett.eat.my.binaries@gmail.com> | 2013-07-11 23:21:51 +0800 |
---|---|---|
committer | malufett <malufett.eat.my.binaries@gmail.com> | 2013-07-11 23:21:51 +0800 |
commit | 94d75f867a6dae10f05a8c2399a301c66b53bce3 (patch) | |
tree | c2a3f3a6c39a0fc3d59a8d3c246238819580e52a /src | |
parent | 5de6aabb0a8c39f7cc327743440fbb28e09d9a69 (diff) | |
download | hercules-94d75f867a6dae10f05a8c2399a301c66b53bce3.tar.gz hercules-94d75f867a6dae10f05a8c2399a301c66b53bce3.tar.bz2 hercules-94d75f867a6dae10f05a8c2399a301c66b53bce3.tar.xz hercules-94d75f867a6dae10f05a8c2399a301c66b53bce3.zip |
Updated some aegis(item, monster, resetstate & resetskill) command to work properly in Hercules.
Diffstat (limited to 'src')
-rw-r--r-- | src/map/clif.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index f17766f50..18aa476ff 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -11859,9 +11859,9 @@ void clif_parse_ResetChar(int fd, struct map_session_data *sd) { char cmd[15]; if( RFIFOW(fd,2) ) - sprintf(cmd,"%cresetskill",atcommand->at_symbol); + sprintf(cmd,"%cskreset",atcommand->at_symbol); else - sprintf(cmd,"%cresetstat",atcommand->at_symbol); + sprintf(cmd,"%streset",atcommand->at_symbol); atcommand->parse(fd, sd, cmd, 1); } @@ -13376,23 +13376,25 @@ void clif_parse_GMRecall2(int fd, struct map_session_data* sd) void clif_parse_GM_Monster_Item(int fd, struct map_session_data *sd) { char *monster_item_name; + struct mob_db *mob_data; + struct item_data *item_data; char command[NAME_LENGTH+10]; monster_item_name = (char*)RFIFOP(fd,2); monster_item_name[NAME_LENGTH-1] = '\0'; - // FIXME: Should look for item first, then for monster. - // FIXME: /monster takes mob_db Sprite_Name as argument - if( mobdb_searchname(monster_item_name) ) { - snprintf(command, sizeof(command)-1, "%cmonster %s", atcommand->at_symbol, monster_item_name); + if( (item_data=itemdb->search_name(monster_item_name)) != NULL + && strcmp(item_data->name, monster_item_name) != 0 ) { // It only accepts aegis name + if( item_data->type == IT_WEAPON || item_data->type == IT_ARMOR ) // nonstackable + snprintf(command, sizeof(command)-1, "%citem2 %d 1 0 0 0 0 0 0 0", atcommand->at_symbol, item_data->nameid); + else + snprintf(command, sizeof(command)-1, "%citem %d 20", atcommand->at_symbol, item_data->nameid); atcommand->parse(fd, sd, command, 1); return; } - // FIXME: Stackables have a quantity of 20. - // FIXME: Equips are supposed to be unidentified. - - if( itemdb->search_name(monster_item_name) ) { - snprintf(command, sizeof(command)-1, "%citem %s", atcommand->at_symbol, monster_item_name); + if( (mob_data=mob_db(mobdb_searchname(monster_item_name))) + && strcmp(mob_data->sprite, monster_item_name) != 0 ) { // It only accepts sprite name + snprintf(command, sizeof(command)-1, "%cmonster %s", atcommand->at_symbol, mob_data->name); atcommand->parse(fd, sd, command, 1); return; } |