diff options
author | Susu <bruant.bastien@gmail.com> | 2013-06-07 20:03:32 +0200 |
---|---|---|
committer | Susu <bruant.bastien@gmail.com> | 2013-06-07 20:03:32 +0200 |
commit | d73783f22b2bb881aab74524d153d89a5932a199 (patch) | |
tree | feea3cd428cee18be3da9bf0bee6d4570d9cad02 /src/map/atcommand.c | |
parent | dc7f14c7dc9829061f8902354367bdc8467eb841 (diff) | |
download | hercules-d73783f22b2bb881aab74524d153d89a5932a199.tar.gz hercules-d73783f22b2bb881aab74524d153d89a5932a199.tar.bz2 hercules-d73783f22b2bb881aab74524d153d89a5932a199.tar.xz hercules-d73783f22b2bb881aab74524d153d89a5932a199.zip |
Hercules Renewal Phase One : pc, party, map, timer
Added iPc, iParty, iMap, iTimer to HPM exported interfaces
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r-- | src/map/atcommand.c | 538 |
1 files changed, 269 insertions, 269 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index e578fee85..f0e5e34d3 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -403,17 +403,17 @@ ACMD(mapmove) mapindex = mapindex_name2id(map_name); if (mapindex) - m = map_mapindex2mapid(mapindex); + m = iMap->mapindex2mapid(mapindex); if (!mapindex) { // m < 0 means on different server! [Kevin] clif->message(fd, msg_txt(1)); // Map not found. return false; } - if ((x || y) && map_getcell(m, x, y, CELL_CHKNOPASS) && pc_get_group_level(sd) < battle_config.gm_ignore_warpable_area) - { //This is to prevent the pc_setpos call from printing an error. + if ((x || y) && iMap->getcell(m, x, y, CELL_CHKNOPASS) && iPc->get_group_level(sd) < battle_config.gm_ignore_warpable_area) + { //This is to prevent the iPc->setpos call from printing an error. clif->message(fd, msg_txt(2)); - if (!map_search_freecell(NULL, m, &x, &y, 10, 10, 1)) + if (!iMap->search_freecell(NULL, m, &x, &y, 10, 10, 1)) x = y = 0; //Invalid cell, use random spot. } if (map[m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { @@ -424,7 +424,7 @@ ACMD(mapmove) clif->message(fd, msg_txt(248)); return false; } - if (pc_setpos(sd, mapindex, x, y, CLR_TELEPORT) != 0) { + if (iPc->setpos(sd, mapindex, x, y, CLR_TELEPORT) != 0) { clif->message(fd, msg_txt(1)); // Map not found. return false; } @@ -448,10 +448,10 @@ ACMD(where) return false; } - pl_sd = map_nick2sd(atcmd_player_name); + pl_sd = iMap->nick2sd(atcmd_player_name); if (pl_sd == NULL || strncmp(pl_sd->status.name, atcmd_player_name, NAME_LENGTH) != 0 || - (pc_has_permission(pl_sd, PC_PERM_HIDE_SESSION) && pc_get_group_level(pl_sd) > pc_get_group_level(sd) && !pc_has_permission(sd, PC_PERM_WHO_DISPLAY_AID)) + (pc_has_permission(pl_sd, PC_PERM_HIDE_SESSION) && iPc->get_group_level(pl_sd) > iPc->get_group_level(sd) && !pc_has_permission(sd, PC_PERM_WHO_DISPLAY_AID)) ) { clif->message(fd, msg_txt(3)); // Character not found. return false; @@ -477,7 +477,7 @@ ACMD(jumpto) return false; } - if((pl_sd=map_nick2sd((char *)message)) == NULL && (pl_sd=map_charid2sd(atoi(message))) == NULL) + if((pl_sd=iMap->nick2sd((char *)message)) == NULL && (pl_sd=iMap->charid2sd(atoi(message))) == NULL) { clif->message(fd, msg_txt(3)); // Character not found. return false; @@ -501,7 +501,7 @@ ACMD(jumpto) return false; } - pc_setpos(sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT); + iPc->setpos(sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT); sprintf(atcmd_output, msg_txt(4), pl_sd->status.name); // Jumped to %s clif->message(fd, atcmd_output); @@ -532,14 +532,14 @@ ACMD(jump) return false; } - if ((x || y) && map_getcell(sd->bl.m, x, y, CELL_CHKNOPASS)) - { //This is to prevent the pc_setpos call from printing an error. + if ((x || y) && iMap->getcell(sd->bl.m, x, y, CELL_CHKNOPASS)) + { //This is to prevent the iPc->setpos call from printing an error. clif->message(fd, msg_txt(2)); - if (!map_search_freecell(NULL, sd->bl.m, &x, &y, 10, 10, 1)) + if (!iMap->search_freecell(NULL, sd->bl.m, &x, &y, 10, 10, 1)) x = y = 0; //Invalid cell, use random spot. } - pc_setpos(sd, sd->mapindex, x, y, CLR_TELEPORT); + iPc->setpos(sd, sd->mapindex, x, y, CLR_TELEPORT); sprintf(atcmd_output, msg_txt(5), sd->bl.x, sd->bl.y); // Jumped to %d %d clif->message(fd, atcmd_output); return true; @@ -569,7 +569,7 @@ ACMD(who) nullpo_retr(-1, sd); if (strstr(command, "map") != NULL) { - if (sscanf(message, "%15s %23s", map_name, player_name) < 1 || (map_id = map_mapname2mapid(map_name)) < 0) + if (sscanf(message, "%15s %23s", map_name, player_name) < 1 || (map_id = iMap->mapname2mapid(map_name)) < 0) map_id = sd->bl.m; } else { sscanf(message, "%23s", player_name); @@ -580,12 +580,12 @@ ACMD(who) else if (strstr(command, "3") != NULL) display_type = 3; - level = pc_get_group_level(sd); + level = iPc->get_group_level(sd); StrBuf->Init(&buf); iter = mapit_getallusers(); for (pl_sd = (TBL_PC*)mapit->first(iter); mapit->exists(iter); pl_sd = (TBL_PC*)mapit->next(iter)) { - if (!((pc_has_permission(pl_sd, PC_PERM_HIDE_SESSION) || (pl_sd->sc.option & OPTION_INVISIBLE)) && pc_get_group_level(pl_sd) > level)) { // you can look only lower or same level + if (!((pc_has_permission(pl_sd, PC_PERM_HIDE_SESSION) || (pl_sd->sc.option & OPTION_INVISIBLE)) && iPc->get_group_level(pl_sd) > level)) { // you can look only lower or same level if (stristr(pl_sd->status.name, player_name) == NULL // search with no case sensitive || (map_id >= 0 && pl_sd->bl.m != map_id)) continue; @@ -595,7 +595,7 @@ ACMD(who) if (pc_get_group_id(pl_sd) > 0) // Player title, if exists StrBuf->Printf(&buf, msg_txt(344), pc_group_id2name(pc_get_group_id(pl_sd))); // "(%s) " StrBuf->Printf(&buf, msg_txt(347), pl_sd->status.base_level, pl_sd->status.job_level, - job_name(pl_sd->status.class_)); // "| Lv:%d/%d | Job: %s" + iPc->job_name(pl_sd->status.class_)); // "| Lv:%d/%d | Job: %s" break; } case 3: { @@ -608,7 +608,7 @@ ACMD(who) break; } default: { - struct party_data *p = party_search(pl_sd->status.party_id); + struct party_data *p = iParty->search(pl_sd->status.party_id); struct guild *g = pl_sd->guild; StrBuf->Printf(&buf, msg_txt(343), pl_sd->status.name); // "Name: %s " @@ -674,12 +674,12 @@ ACMD(whogm) match_text[j] = TOLOWER(match_text[j]); count = 0; - level = pc_get_group_level(sd); + level = iPc->get_group_level(sd); iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit->first(iter); mapit->exists(iter); pl_sd = (TBL_PC*)mapit->next(iter) ) { - pl_level = pc_get_group_level(pl_sd); + pl_level = iPc->get_group_level(pl_sd); if (!pl_level) continue; @@ -708,10 +708,10 @@ ACMD(whogm) sprintf(atcmd_output, msg_txt(915), // BLvl: %d | Job: %s (Lvl: %d) pl_sd->status.base_level, - job_name(pl_sd->status.class_), pl_sd->status.job_level); + iPc->job_name(pl_sd->status.class_), pl_sd->status.job_level); clif->message(fd, atcmd_output); - p = party_search(pl_sd->status.party_id); + p = iParty->search(pl_sd->status.party_id); g = pl_sd->guild; sprintf(atcmd_output,msg_txt(916), // Party: '%s' | Guild: '%s' @@ -741,7 +741,7 @@ ACMD(save) { nullpo_retr(-1, sd); - pc_setsavepoint(sd, sd->mapindex, sd->bl.x, sd->bl.y); + iPc->setsavepoint(sd, sd->mapindex, sd->bl.x, sd->bl.y); if (sd->status.pet_id > 0 && sd->pd) intif_save_petdata(sd->status.account_id, &sd->pd->pet); @@ -761,7 +761,7 @@ ACMD(load) nullpo_retr(-1, sd); - m = map_mapindex2mapid(sd->status.save_point.map); + m = iMap->mapindex2mapid(sd->status.save_point.map); if (m >= 0 && map[m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { clif->message(fd, msg_txt(249)); // You are not authorized to warp to your save map. return false; @@ -771,7 +771,7 @@ ACMD(load) return false; } - pc_setpos(sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, CLR_OUTSIGHT); + iPc->setpos(sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, CLR_OUTSIGHT); clif->message(fd, msg_txt(7)); // Warping to save point.. return true; @@ -885,7 +885,7 @@ ACMD(option) sd->sc.opt1 = param1; sd->sc.opt2 = param2; - pc_setoption(sd, param3); + iPc->setoption(sd, param3); clif->message(fd, msg_txt(9)); // Options changed. @@ -911,10 +911,10 @@ ACMD(hide) if( map[sd->bl.m].flag.pvp && !map[sd->bl.m].flag.pvp_nocalcrank ) {// register the player for ranking calculations - sd->pvp_timer = add_timer( gettick() + 200, pc_calc_pvprank_timer, sd->bl.id, 0 ); + sd->pvp_timer = iTimer->add_timer( iTimer->gettick() + 200, iPc->calc_pvprank_timer, sd->bl.id, 0 ); } //bugreport:2266 - map_foreachinmovearea(clif->insight, &sd->bl, AREA_SIZE, sd->bl.x, sd->bl.y, BL_ALL, &sd->bl); + iMap->foreachinmovearea(clif->insight, &sd->bl, AREA_SIZE, sd->bl.x, sd->bl.y, BL_ALL, &sd->bl); } else { sd->sc.option |= OPTION_INVISIBLE; sd->vd.class_ = INVISIBLE_CLASS; @@ -925,7 +925,7 @@ ACMD(hide) if( map[sd->bl.m].flag.pvp && !map[sd->bl.m].flag.pvp_nocalcrank && sd->pvp_timer != INVALID_TIMER ) {// unregister the player for ranking - delete_timer( sd->pvp_timer, pc_calc_pvprank_timer ); + iTimer->delete_timer( sd->pvp_timer, iPc->calc_pvprank_timer ); sd->pvp_timer = INVALID_TIMER; } } @@ -951,7 +951,7 @@ ACMD(jobchange) // Normal Jobs for( i = JOB_NOVICE; i < JOB_MAX_BASIC && !found; i++ ){ - if (strncmpi(message, job_name(i), 16) == 0) { + if (strncmpi(message, iPc->job_name(i), 16) == 0) { job = i; found = true; } @@ -959,7 +959,7 @@ ACMD(jobchange) // High Jobs, Babys and Third for( i = JOB_NOVICE_HIGH; i < JOB_MAX && !found; i++ ){ - if (strncmpi(message, job_name(i), 16) == 0) { + if (strncmpi(message, iPc->job_name(i), 16) == 0) { job = i; found = true; } @@ -982,7 +982,7 @@ ACMD(jobchange) if (pcdb_checkid(job)) { - if (pc_jobchange(sd, job, upper) == 0) + if (iPc->jobchange(sd, job, upper) == 0) clif->message(fd, msg_txt(12)); // Your job has been changed. else { clif->message(fd, msg_txt(155)); // You are unable to change your job. @@ -1095,7 +1095,7 @@ ACMD(heal) if ( hp < 0 && sp <= 0 ) { status_damage(NULL, &sd->bl, -hp, -sp, 0, 0); - clif->damage(&sd->bl,&sd->bl, gettick(), 0, 0, -hp, 0, 4, 0); + clif->damage(&sd->bl,&sd->bl, iTimer->gettick(), 0, 0, -hp, 0, 4, 0); clif->message(fd, msg_txt(156)); // HP or/and SP modified. return true; } @@ -1106,7 +1106,7 @@ ACMD(heal) status_heal(&sd->bl, hp, 0, 0); else { status_damage(NULL, &sd->bl, -hp, 0, 0, 0); - clif->damage(&sd->bl,&sd->bl, gettick(), 0, 0, -hp, 0, 4, 0); + clif->damage(&sd->bl,&sd->bl, iTimer->gettick(), 0, 0, -hp, 0, 4, 0); } } @@ -1166,7 +1166,7 @@ ACMD(item) item_tmp.nameid = item_id; item_tmp.identify = 1; - if ((flag = pc_additem(sd, &item_tmp, get_count, LOG_TYPE_COMMAND))) + if ((flag = iPc->additem(sd, &item_tmp, get_count, LOG_TYPE_COMMAND))) clif->additem(sd, 0, 0, flag); } } @@ -1239,7 +1239,7 @@ ACMD(item2) item_tmp.card[1] = c2; item_tmp.card[2] = c3; item_tmp.card[3] = c4; - if ((flag = pc_additem(sd, &item_tmp, get_count, LOG_TYPE_COMMAND))) + if ((flag = iPc->additem(sd, &item_tmp, get_count, LOG_TYPE_COMMAND))) clif->additem(sd, 0, 0, flag); } @@ -1263,7 +1263,7 @@ ACMD(itemreset) for (i = 0; i < MAX_INVENTORY; i++) { if (sd->status.inventory[i].amount && sd->status.inventory[i].equip == 0) { - pc_delitem(sd, i, sd->status.inventory[i].amount, 0, 0, LOG_TYPE_COMMAND); + iPc->delitem(sd, i, sd->status.inventory[i].amount, 0, 0, LOG_TYPE_COMMAND); } } clif->message(fd, msg_txt(20)); // All of your items have been removed. @@ -1286,14 +1286,14 @@ ACMD(baselevelup) } if (level > 0) { - if (sd->status.base_level >= pc_maxbaselv(sd)) { // check for max level by Valaris + if (sd->status.base_level >= iPc->maxbaselv(sd)) { // check for max level by Valaris clif->message(fd, msg_txt(47)); // Base level can't go any higher. return false; } // End Addition - if ((unsigned int)level > pc_maxbaselv(sd) || (unsigned int)level > pc_maxbaselv(sd) - sd->status.base_level) // fix positiv overflow - level = pc_maxbaselv(sd) - sd->status.base_level; + if ((unsigned int)level > iPc->maxbaselv(sd) || (unsigned int)level > iPc->maxbaselv(sd) - sd->status.base_level) // fix positiv overflow + level = iPc->maxbaselv(sd) - sd->status.base_level; for (i = 0; i < level; i++) - status_point += pc_gets_status_point(sd->status.base_level + i); + status_point += iPc->gets_status_point(sd->status.base_level + i); sd->status.status_point += status_point; sd->status.base_level += (unsigned int)level; @@ -1309,9 +1309,9 @@ ACMD(baselevelup) if ((unsigned int)level >= sd->status.base_level) level = sd->status.base_level-1; for (i = 0; i > -level; i--) - status_point += pc_gets_status_point(sd->status.base_level + i - 1); + status_point += iPc->gets_status_point(sd->status.base_level + i - 1); if (sd->status.status_point < status_point) - pc_resetstate(sd); + iPc->resetstate(sd); if (sd->status.status_point < status_point) sd->status.status_point = 0; else @@ -1325,9 +1325,9 @@ ACMD(baselevelup) clif->updatestatus(sd, SP_BASEEXP); clif->updatestatus(sd, SP_NEXTBASEEXP); status_calc_pc(sd, 0); - pc_baselevelchanged(sd); + iPc->baselevelchanged(sd); if(sd->status.party_id) - party_send_levelup(sd); + iParty->send_levelup(sd); return true; } @@ -1346,12 +1346,12 @@ ACMD(joblevelup) return false; } if (level > 0) { - if (sd->status.job_level >= pc_maxjoblv(sd)) { + if (sd->status.job_level >= iPc->maxjoblv(sd)) { clif->message(fd, msg_txt(23)); // Job level can't go any higher. return false; } - if ((unsigned int)level > pc_maxjoblv(sd) || (unsigned int)level > pc_maxjoblv(sd) - sd->status.job_level) // fix positiv overflow - level = pc_maxjoblv(sd) - sd->status.job_level; + if ((unsigned int)level > iPc->maxjoblv(sd) || (unsigned int)level > iPc->maxjoblv(sd) - sd->status.job_level) // fix positiv overflow + level = iPc->maxjoblv(sd) - sd->status.job_level; sd->status.job_level += (unsigned int)level; sd->status.skill_point += level; clif->misceffect(&sd->bl, 1); @@ -1366,7 +1366,7 @@ ACMD(joblevelup) level = sd->status.job_level-1; sd->status.job_level -= (unsigned int)level; if (sd->status.skill_point < level) - pc_resetskill(sd,0); //Reset skills since we need to substract more points. + iPc->resetskill(sd,0); //Reset skills since we need to substract more points. if (sd->status.skill_point < level) sd->status.skill_point = 0; else @@ -1469,7 +1469,7 @@ static int atcommand_pvpoff_sub(struct block_list *bl,va_list ap) TBL_PC* sd = (TBL_PC*)bl; clif->pvpset(sd, 0, 0, 2); if (sd->pvp_timer != INVALID_TIMER) { - delete_timer(sd->pvp_timer, pc_calc_pvprank_timer); + iTimer->delete_timer(sd->pvp_timer, iPc->calc_pvprank_timer); sd->pvp_timer = INVALID_TIMER; } return 0; @@ -1484,15 +1484,15 @@ ACMD(pvpoff) return false; } - map_zone_change2(sd->bl.m,map[sd->bl.m].prev_zone); + iMap->zone_change2(sd->bl.m,map[sd->bl.m].prev_zone); map[sd->bl.m].flag.pvp = 0; if (!battle_config.pk_mode) { clif->map_property_mapall(sd->bl.m, MAPPROPERTY_NOTHING); clif->maptypeproperty2(&sd->bl,ALL_SAMEMAP); } - map_foreachinmap(atcommand_pvpoff_sub,sd->bl.m, BL_PC); - map_foreachinmap(atcommand_stopattack,sd->bl.m, BL_CHAR, 0); + iMap->foreachinmap(atcommand_pvpoff_sub,sd->bl.m, BL_PC); + iMap->foreachinmap(atcommand_stopattack,sd->bl.m, BL_CHAR, 0); clif->message(fd, msg_txt(31)); // PvP: Off. return true; } @@ -1504,7 +1504,7 @@ static int atcommand_pvpon_sub(struct block_list *bl,va_list ap) { TBL_PC* sd = (TBL_PC*)bl; if (sd->pvp_timer == INVALID_TIMER) { - sd->pvp_timer = add_timer(gettick() + 200, pc_calc_pvprank_timer, sd->bl.id, 0); + sd->pvp_timer = iTimer->add_timer(iTimer->gettick() + 200, iPc->calc_pvprank_timer, sd->bl.id, 0); sd->pvp_rank = 0; sd->pvp_lastusers = 0; sd->pvp_point = 5; @@ -1523,13 +1523,13 @@ ACMD(pvpon) return false; } - map_zone_change2(sd->bl.m,strdb_get(zone_db, MAP_ZONE_PVP_NAME)); + iMap->zone_change2(sd->bl.m,strdb_get(zone_db, MAP_ZONE_PVP_NAME)); map[sd->bl.m].flag.pvp = 1; if (!battle_config.pk_mode) {// display pvp circle and rank clif->map_property_mapall(sd->bl.m, MAPPROPERTY_FREEPVPZONE); clif->maptypeproperty2(&sd->bl,ALL_SAMEMAP); - map_foreachinmap(atcommand_pvpon_sub,sd->bl.m, BL_PC); + iMap->foreachinmap(atcommand_pvpon_sub,sd->bl.m, BL_PC); } clif->message(fd, msg_txt(32)); // PvP: On. @@ -1549,11 +1549,11 @@ ACMD(gvgoff) return false; } - map_zone_change2(sd->bl.m,map[sd->bl.m].prev_zone); + iMap->zone_change2(sd->bl.m,map[sd->bl.m].prev_zone); map[sd->bl.m].flag.gvg = 0; clif->map_property_mapall(sd->bl.m, MAPPROPERTY_NOTHING); clif->maptypeproperty2(&sd->bl,ALL_SAMEMAP); - map_foreachinmap(atcommand_stopattack,sd->bl.m, BL_CHAR, 0); + iMap->foreachinmap(atcommand_stopattack,sd->bl.m, BL_CHAR, 0); clif->message(fd, msg_txt(33)); // GvG: Off. return true; @@ -1571,7 +1571,7 @@ ACMD(gvgon) return false; } - map_zone_change2(sd->bl.m,strdb_get(zone_db, MAP_ZONE_GVG_NAME)); + iMap->zone_change2(sd->bl.m,strdb_get(zone_db, MAP_ZONE_GVG_NAME)); map[sd->bl.m].flag.gvg = 1; clif->map_property_mapall(sd->bl.m, MAPPROPERTY_AGITZONE); clif->maptypeproperty2(&sd->bl,ALL_SAMEMAP); @@ -1600,9 +1600,9 @@ ACMD(model) if (hair_style >= MIN_HAIR_STYLE && hair_style <= MAX_HAIR_STYLE && hair_color >= MIN_HAIR_COLOR && hair_color <= MAX_HAIR_COLOR && cloth_color >= MIN_CLOTH_COLOR && cloth_color <= MAX_CLOTH_COLOR) { - pc_changelook(sd, LOOK_HAIR, hair_style); - pc_changelook(sd, LOOK_HAIR_COLOR, hair_color); - pc_changelook(sd, LOOK_CLOTHES_COLOR, cloth_color); + iPc->changelook(sd, LOOK_HAIR, hair_style); + iPc->changelook(sd, LOOK_HAIR_COLOR, hair_color); + iPc->changelook(sd, LOOK_CLOTHES_COLOR, cloth_color); clif->message(fd, msg_txt(36)); // Appearence changed. } else { clif->message(fd, msg_txt(37)); // An invalid number was specified. @@ -1629,7 +1629,7 @@ ACMD(dye) } if (cloth_color >= MIN_CLOTH_COLOR && cloth_color <= MAX_CLOTH_COLOR) { - pc_changelook(sd, LOOK_CLOTHES_COLOR, cloth_color); + iPc->changelook(sd, LOOK_CLOTHES_COLOR, cloth_color); clif->message(fd, msg_txt(36)); // Appearence changed. } else { clif->message(fd, msg_txt(37)); // An invalid number was specified. @@ -1656,7 +1656,7 @@ ACMD(hair_style) } if (hair_style >= MIN_HAIR_STYLE && hair_style <= MAX_HAIR_STYLE) { - pc_changelook(sd, LOOK_HAIR, hair_style); + iPc->changelook(sd, LOOK_HAIR, hair_style); clif->message(fd, msg_txt(36)); // Appearence changed. } else { clif->message(fd, msg_txt(37)); // An invalid number was specified. @@ -1683,7 +1683,7 @@ ACMD(hair_color) } if (hair_color >= MIN_HAIR_COLOR && hair_color <= MAX_HAIR_COLOR) { - pc_changelook(sd, LOOK_HAIR_COLOR, hair_color); + iPc->changelook(sd, LOOK_HAIR_COLOR, hair_color); clif->message(fd, msg_txt(36)); // Appearence changed. } else { clif->message(fd, msg_txt(37)); // An invalid number was specified. @@ -1864,7 +1864,7 @@ ACMD(go) if (town >= 0 && town < ARRAYLENGTH(data)) { - m = map_mapname2mapid(data[town].map); + m = iMap->mapname2mapid(data[town].map); if (m >= 0 && map[m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { clif->message(fd, msg_txt(247)); return false; @@ -1873,7 +1873,7 @@ ACMD(go) clif->message(fd, msg_txt(248)); return false; } - if (pc_setpos(sd, mapindex_name2id(data[town].map), data[town].x, data[town].y, CLR_TELEPORT) == 0) { + if (iPc->setpos(sd, mapindex_name2id(data[town].map), data[town].x, data[town].y, CLR_TELEPORT) == 0) { clif->message(fd, msg_txt(0)); // Warped. } else { clif->message(fd, msg_txt(1)); // Map not found. @@ -1964,7 +1964,7 @@ ACMD(monster) count = 0; range = (int)sqrt((float)number) +2; // calculation of an odd number (+ 4 area around) for (i = 0; i < number; i++) { - map_search_freecell(&sd->bl, 0, &mx, &my, range, range, 0); + iMap->search_freecell(&sd->bl, 0, &mx, &my, range, range, 0); k = mob_once_spawn(sd, sd->bl.m, mx, my, name, mob_id, 1, eventname, size, AI_NONE); count += (k != 0) ? 1 : 0; } @@ -2016,13 +2016,13 @@ ACMD(killmonster) if (!message || !*message || sscanf(message, "%15s", map_name) < 1) map_id = sd->bl.m; else { - if ((map_id = map_mapname2mapid(map_name)) < 0) + if ((map_id = iMap->mapname2mapid(map_name)) < 0) map_id = sd->bl.m; } drop_flag = strcmp(command+1, "killmonster2"); - map_foreachinmap(atkillmonster_sub, map_id, BL_MOB, -drop_flag); + iMap->foreachinmap(atkillmonster_sub, map_id, BL_MOB, -drop_flag); clif->message(fd, msg_txt(165)); // All monsters killed! @@ -2085,11 +2085,11 @@ ACMD(refine) if (sd->status.inventory[i].refine != final_refine) { sd->status.inventory[i].refine = final_refine; current_position = sd->status.inventory[i].equip; - pc_unequipitem(sd, i, 3); + iPc->unequipitem(sd, i, 3); clif->refine(fd, 0, i, sd->status.inventory[i].refine); clif->delitem(sd, i, 1, 3); clif->additem(sd, i, 1, 0); - pc_equipitem(sd, i, current_position); + iPc->equipitem(sd, i, current_position); clif->misceffect(&sd->bl, 3); count++; } @@ -2155,7 +2155,7 @@ ACMD(produce) clif->produce_effect(sd, 0, item_id); clif->misceffect(&sd->bl, 3); - if ((flag = pc_additem(sd, &tmp_item, 1, LOG_TYPE_COMMAND))) + if ((flag = iPc->additem(sd, &tmp_item, 1, LOG_TYPE_COMMAND))) clif->additem(sd, 0, 0, flag); } else { sprintf(atcmd_output, msg_txt(169), item_id, item_data->name); // The item (%d: '%s') is not equipable. @@ -2198,7 +2198,7 @@ ACMD(memo) return false; } - pc_memo(sd, position); + iPc->memo(sd, position); return true; } @@ -2215,11 +2215,11 @@ ACMD(gat) for (y = 2; y >= -2; y--) { sprintf(atcmd_output, "%s (x= %d, y= %d) %02X %02X %02X %02X %02X", map[sd->bl.m].name, sd->bl.x - 2, sd->bl.y + y, - map_getcell(sd->bl.m, sd->bl.x - 2, sd->bl.y + y, CELL_GETTYPE), - map_getcell(sd->bl.m, sd->bl.x - 1, sd->bl.y + y, CELL_GETTYPE), - map_getcell(sd->bl.m, sd->bl.x, sd->bl.y + y, CELL_GETTYPE), - map_getcell(sd->bl.m, sd->bl.x + 1, sd->bl.y + y, CELL_GETTYPE), - map_getcell(sd->bl.m, sd->bl.x + 2, sd->bl.y + y, CELL_GETTYPE)); + iMap->getcell(sd->bl.m, sd->bl.x - 2, sd->bl.y + y, CELL_GETTYPE), + iMap->getcell(sd->bl.m, sd->bl.x - 1, sd->bl.y + y, CELL_GETTYPE), + iMap->getcell(sd->bl.m, sd->bl.x, sd->bl.y + y, CELL_GETTYPE), + iMap->getcell(sd->bl.m, sd->bl.x + 1, sd->bl.y + y, CELL_GETTYPE), + iMap->getcell(sd->bl.m, sd->bl.x + 2, sd->bl.y + y, CELL_GETTYPE)); clif->message(fd, atcmd_output); } @@ -2361,12 +2361,12 @@ ACMD(zeny) } if(zeny > 0){ - if((ret=pc_getzeny(sd,zeny,LOG_TYPE_COMMAND,NULL)) == 1) + if((ret=iPc->getzeny(sd,zeny,LOG_TYPE_COMMAND,NULL)) == 1) clif->message(fd, msg_txt(149)); // Unable to increase the number/value. } else { if( sd->status.zeny < -zeny ) zeny = -sd->status.zeny; - if((ret=pc_payzeny(sd,-zeny,LOG_TYPE_COMMAND,NULL)) == 1) + if((ret=iPc->payzeny(sd,-zeny,LOG_TYPE_COMMAND,NULL)) == 1) clif->message(fd, msg_txt(41)); // Unable to decrease the number/value. } if(!ret) clif->message(fd, msg_txt(176)); //ret=0 mean cmd success @@ -2701,13 +2701,13 @@ ACMD(recall) { return false; } - if((pl_sd=map_nick2sd((char *)message)) == NULL && (pl_sd=map_charid2sd(atoi(message))) == NULL) + if((pl_sd=iMap->nick2sd((char *)message)) == NULL && (pl_sd=iMap->charid2sd(atoi(message))) == NULL) { clif->message(fd, msg_txt(3)); // Character not found. return false; } - if ( pc_get_group_level(sd) < pc_get_group_level(pl_sd) ) + if ( iPc->get_group_level(sd) < iPc->get_group_level(pl_sd) ) { clif->message(fd, msg_txt(81)); // Your GM level doesn't authorize you to preform this action on the specified player. return false; @@ -2724,7 +2724,7 @@ ACMD(recall) { if (pl_sd->bl.m == sd->bl.m && pl_sd->bl.x == sd->bl.x && pl_sd->bl.y == sd->bl.y) { return false; } - pc_setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN); + iPc->setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN); sprintf(atcmd_output, msg_txt(46), pl_sd->status.name); // %s recalled! clif->message(fd, atcmd_output); @@ -2838,7 +2838,7 @@ ACMD(char_ban) tmtime->tm_min = tmtime->tm_min + minute; tmtime->tm_sec = tmtime->tm_sec + second; timestamp = mktime(tmtime); - if( timestamp <= time(NULL) && !pc_can_use_command(sd, "@unban") ) { + if( timestamp <= time(NULL) && !iPc->can_use_command(sd, "@unban") ) { clif->message(fd,msg_txt(1023)); // You are not allowed to reduce the length of a ban. return false; } @@ -2898,8 +2898,8 @@ ACMD(night) { nullpo_retr(-1, sd); - if (night_flag != 1) { - map_night_timer(night_timer_tid, 0, 0, 1); + if (iMap->night_flag != 1) { + iPc->map_night_timer(iPc->night_timer_tid, 0, 0, 1); } else { clif->message(fd, msg_txt(89)); // Night mode is already enabled. return false; @@ -2915,8 +2915,8 @@ ACMD(day) { nullpo_retr(-1, sd); - if (night_flag != 0) { - map_day_timer(day_timer_tid, 0, 0, 1); + if (iMap->night_flag != 0) { + iPc->map_day_timer(iPc->day_timer_tid, 0, 0, 1); } else { clif->message(fd, msg_txt(90)); // Day mode is already enabled. return false; @@ -2938,7 +2938,7 @@ ACMD(doom) iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit->first(iter); mapit->exists(iter); pl_sd = (TBL_PC*)mapit->next(iter) ) { - if (pl_sd->fd != fd && pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) + if (pl_sd->fd != fd && iPc->get_group_level(sd) >= iPc->get_group_level(pl_sd)) { status_kill(&pl_sd->bl); clif->specialeffect(&pl_sd->bl,450,AREA); @@ -2965,7 +2965,7 @@ ACMD(doommap) iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit->first(iter); mapit->exists(iter); pl_sd = (TBL_PC*)mapit->next(iter) ) { - if (pl_sd->fd != fd && sd->bl.m == pl_sd->bl.m && pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) + if (pl_sd->fd != fd && sd->bl.m == pl_sd->bl.m && iPc->get_group_level(sd) >= iPc->get_group_level(pl_sd)) { status_kill(&pl_sd->bl); clif->specialeffect(&pl_sd->bl,450,AREA); @@ -3047,13 +3047,13 @@ ACMD(kick) return false; } - if((pl_sd=map_nick2sd((char *)message)) == NULL && (pl_sd=map_charid2sd(atoi(message))) == NULL) + if((pl_sd=iMap->nick2sd((char *)message)) == NULL && (pl_sd=iMap->charid2sd(atoi(message))) == NULL) { clif->message(fd, msg_txt(3)); // Character not found. return false; } - if ( pc_get_group_level(sd) < pc_get_group_level(pl_sd) ) + if ( iPc->get_group_level(sd) < iPc->get_group_level(pl_sd) ) { clif->message(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player. return false; @@ -3076,7 +3076,7 @@ ACMD(kickall) iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit->first(iter); mapit->exists(iter); pl_sd = (TBL_PC*)mapit->next(iter) ) { - if (pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) { // you can kick only lower or same gm level + if (iPc->get_group_level(sd) >= iPc->get_group_level(pl_sd)) { // you can kick only lower or same gm level if (sd->status.account_id != pl_sd->status.account_id) clif->GM_kick(NULL, pl_sd); } @@ -3094,7 +3094,7 @@ ACMD(kickall) ACMD(allskill) { nullpo_retr(-1, sd); - pc_allskillup(sd); // all skills + iPc->allskillup(sd); // all skills sd->status.skill_point = 0; // 0 skill points clif->updatestatus(sd, SP_SKILLPOINT); // update clif->message(fd, msg_txt(76)); // All skills have been added to your skill tree. @@ -3134,12 +3134,12 @@ ACMD(questskill) clif->message(fd, msg_txt(197)); // This skill number doesn't exist or isn't a quest skill. return false; } - if (pc_checkskill2(sd, index) > 0) { + if (iPc->checkskill2(sd, index) > 0) { clif->message(fd, msg_txt(196)); // You already have this quest skill. return false; } - pc_skill(sd, skill_id, 1, 0); + iPc->skill(sd, skill_id, 1, 0); clif->message(fd, msg_txt(70)); // You have learned the skill. return true; @@ -3177,7 +3177,7 @@ ACMD(lostskill) clif->message(fd, msg_txt(197)); // This skill number doesn't exist or isn't a quest skill. return false; } - if (pc_checkskill2(sd, index) == 0) { + if (iPc->checkskill2(sd, index) == 0) { clif->message(fd, msg_txt(201)); // You don't have this quest skill. return false; } @@ -3210,7 +3210,7 @@ ACMD(spiritball) } if( sd->spiritball > 0 ) - pc_delspiritball(sd, sd->spiritball, 1); + iPc->delspiritball(sd, sd->spiritball, 1); sd->spiritball = number; clif->spiritball(&sd->bl); // no message, player can look the difference @@ -3233,7 +3233,7 @@ ACMD(party) return false; } - party_create(sd, party, 0, 0); + iParty->create(sd, party, 0, 0); return true; } @@ -3299,12 +3299,12 @@ ACMD(breakguild) ACMD(agitstart) { nullpo_retr(-1, sd); - if (agit_flag == 1) { + if (iMap->agit_flag == 1) { clif->message(fd, msg_txt(73)); // War of Emperium is currently in progress. return false; } - agit_flag = 1; + iMap->agit_flag = 1; guild->agit_start(); clif->message(fd, msg_txt(72)); // War of Emperium has been initiated. @@ -3317,12 +3317,12 @@ ACMD(agitstart) ACMD(agitstart2) { nullpo_retr(-1, sd); - if (agit2_flag == 1) { + if (iMap->agit2_flag == 1) { clif->message(fd, msg_txt(404)); // "War of Emperium SE is currently in progress." return false; } - agit2_flag = 1; + iMap->agit2_flag = 1; guild->agit2_start(); clif->message(fd, msg_txt(403)); // "War of Emperium SE has been initiated." @@ -3335,12 +3335,12 @@ ACMD(agitstart2) ACMD(agitend) { nullpo_retr(-1, sd); - if (agit_flag == 0) { + if (iMap->agit_flag == 0) { clif->message(fd, msg_txt(75)); // War of Emperium is currently not in progress. return false; } - agit_flag = 0; + iMap->agit_flag = 0; guild->agit_end(); clif->message(fd, msg_txt(74)); // War of Emperium has been ended. @@ -3353,12 +3353,12 @@ ACMD(agitend) ACMD(agitend2) { nullpo_retr(-1, sd); - if (agit2_flag == 0) { + if (iMap->agit2_flag == 0) { clif->message(fd, msg_txt(406)); // "War of Emperium SE is currently not in progress." return false; } - agit2_flag = 0; + iMap->agit2_flag = 0; guild->agit2_end(); clif->message(fd, msg_txt(405)); // "War of Emperium SE has been ended." @@ -3372,7 +3372,7 @@ ACMD(mapexit) { nullpo_retr(-1, sd); - do_shutdown(); + iMap->do_shutdown(); return true; } @@ -3433,7 +3433,7 @@ ACMD(recallall) iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit->first(iter); mapit->exists(iter); pl_sd = (TBL_PC*)mapit->next(iter) ) { - if (sd->status.account_id != pl_sd->status.account_id && pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) + if (sd->status.account_id != pl_sd->status.account_id && iPc->get_group_level(sd) >= iPc->get_group_level(pl_sd)) { if (pl_sd->bl.m == sd->bl.m && pl_sd->bl.x == sd->bl.x && pl_sd->bl.y == sd->bl.y) continue; // Don't waste time warping the character to the same place. @@ -3441,10 +3441,10 @@ ACMD(recallall) count++; else { if (pc_isdead(pl_sd)) { //Wake them up - pc_setstand(pl_sd); - pc_setrestartvalue(pl_sd,1); + iPc->setstand(pl_sd); + iPc->setrestartvalue(pl_sd,1); } - pc_setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN); + iPc->setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN); } } } @@ -3498,12 +3498,12 @@ ACMD(guildrecall) { if (sd->status.account_id != pl_sd->status.account_id && pl_sd->status.guild_id == g->guild_id) { - if (pc_get_group_level(pl_sd) > pc_get_group_level(sd) || (pl_sd->bl.m == sd->bl.m && pl_sd->bl.x == sd->bl.x && pl_sd->bl.y == sd->bl.y)) + if (iPc->get_group_level(pl_sd) > iPc->get_group_level(sd) || (pl_sd->bl.m == sd->bl.m && pl_sd->bl.x == sd->bl.x && pl_sd->bl.y == sd->bl.y)) continue; // Skip GMs greater than you... or chars already on the cell if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) count++; else - pc_setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN); + iPc->setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN); } } mapit->free(iter); @@ -3543,8 +3543,8 @@ ACMD(partyrecall) return false; } - if ((p = party_searchname(party_name)) == NULL && // name first to avoid error when name begin with a number - (p = party_search(atoi(message))) == NULL) + if ((p = iParty->searchname(party_name)) == NULL && // name first to avoid error when name begin with a number + (p = iParty->search(atoi(message))) == NULL) { clif->message(fd, msg_txt(96)); // Incorrect name or ID, or no one from the party is online. return false; @@ -3557,12 +3557,12 @@ ACMD(partyrecall) { if (sd->status.account_id != pl_sd->status.account_id && pl_sd->status.party_id == p->party.party_id) { - if (pc_get_group_level(pl_sd) > pc_get_group_level(sd) || (pl_sd->bl.m == sd->bl.m && pl_sd->bl.x == sd->bl.x && pl_sd->bl.y == sd->bl.y)) + if (iPc->get_group_level(pl_sd) > iPc->get_group_level(sd) || (pl_sd->bl.m == sd->bl.m && pl_sd->bl.x == sd->bl.x && pl_sd->bl.y == sd->bl.y)) continue; // Skip GMs greater than you... or chars already on the cell if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) count++; else - pc_setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN); + iPc->setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN); } } mapit->free(iter); @@ -3634,7 +3634,7 @@ ACMD(reloadatcommand) { config_destroy(&run_test); - if (conf_read_file(&run_test, ATCOMMAND_CONF_FILENAME)) { + if (conf_read_file(&run_test, iMap->ATCOMMAND_CONF_FILENAME)) { clif->message(fd, msg_txt(1037)); // Error reading atcommand.conf, reload failed. return false; } @@ -3654,7 +3654,7 @@ ACMD(reloadbattleconf) struct Battle_Config prev_config; memcpy(&prev_config, &battle_config, sizeof(prev_config)); - battle->config_read(BATTLE_CONF_FILENAME); + battle->config_read(iMap->BATTLE_CONF_FILENAME); if( prev_config.item_rate_mvp != battle_config.item_rate_mvp || prev_config.item_rate_common != battle_config.item_rate_common @@ -3708,7 +3708,7 @@ ACMD(reloadstatusdb) *------------------------------------------*/ ACMD(reloadpcdb) { - pc_readdb(); + iPc->readdb(); clif->message(fd, msg_txt(257)); return true; } @@ -3723,7 +3723,7 @@ ACMD(reloadscript) //atcommand_broadcast( fd, sd, "@broadcast", "You will feel a bit of lag at this point !" ); flush_fifos(); - map_reloadnpc(true); // reload config files seeking for npcs + iMap->reloadnpc(true); // reload config files seeking for npcs script_reload(); npc_reload(); @@ -3766,9 +3766,9 @@ ACMD(mapinfo) { if (mapname[0] == '\0') { safestrncpy(mapname, mapindex_id2name(sd->mapindex), MAP_NAME_LENGTH); - m_id = map_mapindex2mapid(sd->mapindex); + m_id = iMap->mapindex2mapid(sd->mapindex); } else { - m_id = map_mapname2mapid(mapname); + m_id = iMap->mapname2mapid(mapname); } if (m_id < 0) { @@ -3786,7 +3786,7 @@ ACMD(mapinfo) { if( pl_sd->mapindex == m_index ) { if( pl_sd->state.vending ) vend_num++; - else if( (cd = (struct chat_data*)map_id2bl(pl_sd->chatID)) != NULL && cd->usersd[0] == pl_sd ) + else if( (cd = (struct chat_data*)iMap->id2bl(pl_sd->chatID)) != NULL && cd->usersd[0] == pl_sd ) chat_num++; } } @@ -3966,7 +3966,7 @@ ACMD(mapinfo) { iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit->first(iter); mapit->exists(iter); pl_sd = (TBL_PC*)mapit->next(iter) ) { - if ((cd = (struct chat_data*)map_id2bl(pl_sd->chatID)) != NULL && + if ((cd = (struct chat_data*)iMap->id2bl(pl_sd->chatID)) != NULL && pl_sd->mapindex == m_index && cd->usersd[0] == pl_sd) { @@ -4001,47 +4001,47 @@ ACMD(mount_peco) return false; } - if( (sd->class_&MAPID_THIRDMASK) == MAPID_RUNE_KNIGHT && pc_checkskill(sd,RK_DRAGONTRAINING) > 0 ) { + if( (sd->class_&MAPID_THIRDMASK) == MAPID_RUNE_KNIGHT && iPc->checkskill(sd,RK_DRAGONTRAINING) > 0 ) { if( !(sd->sc.option&OPTION_DRAGON1) ) { clif->message(sd->fd,msg_txt(1119)); // You have mounted your Dragon. - pc_setoption(sd, sd->sc.option|OPTION_DRAGON1); + iPc->setoption(sd, sd->sc.option|OPTION_DRAGON1); } else { clif->message(sd->fd,msg_txt(1120)); // You have released your Dragon. - pc_setoption(sd, sd->sc.option&~OPTION_DRAGON1); + iPc->setoption(sd, sd->sc.option&~OPTION_DRAGON1); } return true; } - if( (sd->class_&MAPID_THIRDMASK) == MAPID_RANGER && pc_checkskill(sd,RA_WUGRIDER) > 0 ) { + if( (sd->class_&MAPID_THIRDMASK) == MAPID_RANGER && iPc->checkskill(sd,RA_WUGRIDER) > 0 ) { if( !pc_isridingwug(sd) ) { clif->message(sd->fd,msg_txt(1121)); // You have mounted your Warg. - pc_setoption(sd, sd->sc.option|OPTION_WUGRIDER); + iPc->setoption(sd, sd->sc.option|OPTION_WUGRIDER); } else { clif->message(sd->fd,msg_txt(1122)); // You have released your Warg. - pc_setoption(sd, sd->sc.option&~OPTION_WUGRIDER); + iPc->setoption(sd, sd->sc.option&~OPTION_WUGRIDER); } return true; } if( (sd->class_&MAPID_THIRDMASK) == MAPID_MECHANIC ) { if( !pc_ismadogear(sd) ) { clif->message(sd->fd,msg_txt(1123)); // You have mounted your Mado Gear. - pc_setoption(sd, sd->sc.option|OPTION_MADOGEAR); + iPc->setoption(sd, sd->sc.option|OPTION_MADOGEAR); } else { clif->message(sd->fd,msg_txt(1124)); // You have released your Mado Gear. - pc_setoption(sd, sd->sc.option&~OPTION_MADOGEAR); + iPc->setoption(sd, sd->sc.option&~OPTION_MADOGEAR); } return true; } if (!pc_isriding(sd)) { // if actually no peco - if (!pc_checkskill(sd, KN_RIDING)) { + if (!iPc->checkskill(sd, KN_RIDING)) { clif->message(fd, msg_txt(213)); // You can not mount a Peco Peco with your current job. return false; } - pc_setoption(sd, sd->sc.option | OPTION_RIDING); + iPc->setoption(sd, sd->sc.option | OPTION_RIDING); clif->message(fd, msg_txt(102)); // You have mounted a Peco Peco. } else {//Dismount - pc_setoption(sd, sd->sc.option & ~OPTION_RIDING); + iPc->setoption(sd, sd->sc.option & ~OPTION_RIDING); clif->message(fd, msg_txt(214)); // You have released your Peco Peco. } @@ -4060,7 +4060,7 @@ ACMD(guildspy) memset(guild_name, '\0', sizeof(guild_name)); memset(atcmd_output, '\0', sizeof(atcmd_output)); - if (!enable_spy) + if (!iMap->enable_spy) { clif->message(fd, msg_txt(1125)); // The mapserver has spy command support disabled. return false; @@ -4101,7 +4101,7 @@ ACMD(partyspy) memset(party_name, '\0', sizeof(party_name)); memset(atcmd_output, '\0', sizeof(atcmd_output)); - if (!enable_spy) + if (!iMap->enable_spy) { clif->message(fd, msg_txt(1125)); // The mapserver has spy command support disabled. return false; @@ -4112,8 +4112,8 @@ ACMD(partyspy) return false; } - if ((p = party_searchname(party_name)) != NULL || // name first to avoid error when name begin with a number - (p = party_search(atoi(message))) != NULL) { + if ((p = iParty->searchname(party_name)) != NULL || // name first to avoid error when name begin with a number + (p = iParty->search(atoi(message))) != NULL) { if (sd->partyspy == p->party.party_id) { sd->partyspy = 0; sprintf(atcmd_output, msg_txt(105), p->party.name); // No longer spying on the %s party. @@ -4175,9 +4175,9 @@ ACMD(nuke) return false; } - if ((pl_sd = map_nick2sd(atcmd_player_name)) != NULL) { - if (pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) { // you can kill only lower or same GM level - skill->castend_nodamage_id(&pl_sd->bl, &pl_sd->bl, NPC_SELFDESTRUCTION, 99, gettick(), 0); + if ((pl_sd = iMap->nick2sd(atcmd_player_name)) != NULL) { + if (iPc->get_group_level(sd) >= iPc->get_group_level(pl_sd)) { // you can kill only lower or same GM level + skill->castend_nodamage_id(&pl_sd->bl, &pl_sd->bl, NPC_SELFDESTRUCTION, 99, iTimer->gettick(), 0); clif->message(fd, msg_txt(109)); // Player has been nuked! } else { clif->message(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player. @@ -4209,7 +4209,7 @@ ACMD(tonpc) } if ((nd = npc_name2id(npcname)) != NULL) { - if (pc_setpos(sd, map_id2index(nd->bl.m), nd->bl.x, nd->bl.y, CLR_TELEPORT) == 0) + if (iPc->setpos(sd, map_id2index(nd->bl.m), nd->bl.x, nd->bl.y, CLR_TELEPORT) == 0) clif->message(fd, msg_txt(0)); // Warped. else return false; @@ -4384,31 +4384,31 @@ ACMD(servertime) clif->message(fd, temp); if (battle_config.night_duration == 0 && battle_config.day_duration == 0) { - if (night_flag == 0) + if (iMap->night_flag == 0) clif->message(fd, msg_txt(231)); // Game time: The game is in permanent daylight. else clif->message(fd, msg_txt(232)); // Game time: The game is in permanent night. } else if (battle_config.night_duration == 0) - if (night_flag == 1) { // we start with night - timer_data = get_timer(day_timer_tid); - sprintf(temp, msg_txt(233), txt_time(DIFF_TICK(timer_data->tick,gettick())/1000)); // Game time: The game is actualy in night for %s. + if (iMap->night_flag == 1) { // we start with night + timer_data = iTimer->get_timer(iPc->day_timer_tid); + sprintf(temp, msg_txt(233), txt_time(DIFF_TICK(timer_data->tick,iTimer->gettick())/1000)); // Game time: The game is actualy in night for %s. clif->message(fd, temp); clif->message(fd, msg_txt(234)); // Game time: After, the game will be in permanent daylight. } else clif->message(fd, msg_txt(231)); // Game time: The game is in permanent daylight. else if (battle_config.day_duration == 0) - if (night_flag == 0) { // we start with day - timer_data = get_timer(night_timer_tid); - sprintf(temp, msg_txt(235), txt_time(DIFF_TICK(timer_data->tick,gettick())/1000)); // Game time: The game is actualy in daylight for %s. + if (iMap->night_flag == 0) { // we start with day + timer_data = iTimer->get_timer(iPc->night_timer_tid); + sprintf(temp, msg_txt(235), txt_time(DIFF_TICK(timer_data->tick,iTimer->gettick())/1000)); // Game time: The game is actualy in daylight for %s. clif->message(fd, temp); clif->message(fd, msg_txt(236)); // Game time: After, the game will be in permanent night. } else clif->message(fd, msg_txt(232)); // Game time: The game is in permanent night. else { - if (night_flag == 0) { - timer_data = get_timer(night_timer_tid); - timer_data2 = get_timer(day_timer_tid); - sprintf(temp, msg_txt(235), txt_time(DIFF_TICK(timer_data->tick,gettick())/1000)); // Game time: The game is actualy in daylight for %s. + if (iMap->night_flag == 0) { + timer_data = iTimer->get_timer(iPc->night_timer_tid); + timer_data2 = iTimer->get_timer(iPc->day_timer_tid); + sprintf(temp, msg_txt(235), txt_time(DIFF_TICK(timer_data->tick,iTimer->gettick())/1000)); // Game time: The game is actualy in daylight for %s. clif->message(fd, temp); if (DIFF_TICK(timer_data->tick, timer_data2->tick) > 0) sprintf(temp, msg_txt(237), txt_time(DIFF_TICK(timer_data->interval,DIFF_TICK(timer_data->tick,timer_data2->tick)) / 1000)); // Game time: After, the game will be in night for %s. @@ -4418,9 +4418,9 @@ ACMD(servertime) sprintf(temp, msg_txt(238), txt_time(timer_data->interval / 1000)); // Game time: A day cycle has a normal duration of %s. clif->message(fd, temp); } else { - timer_data = get_timer(day_timer_tid); - timer_data2 = get_timer(night_timer_tid); - sprintf(temp, msg_txt(233), txt_time(DIFF_TICK(timer_data->tick,gettick()) / 1000)); // Game time: The game is actualy in night for %s. + timer_data = iTimer->get_timer(iPc->day_timer_tid); + timer_data2 = iTimer->get_timer(iPc->night_timer_tid); + sprintf(temp, msg_txt(233), txt_time(DIFF_TICK(timer_data->tick,iTimer->gettick()) / 1000)); // Game time: The game is actualy in night for %s. clif->message(fd, temp); if (DIFF_TICK(timer_data->tick,timer_data2->tick) > 0) sprintf(temp, msg_txt(239), txt_time((timer_data->interval - DIFF_TICK(timer_data->tick, timer_data2->tick)) / 1000)); // Game time: After, the game will be in daylight for %s. @@ -4481,12 +4481,12 @@ ACMD(jail) return false; } - if ((pl_sd = map_nick2sd(atcmd_player_name)) == NULL) { + if ((pl_sd = iMap->nick2sd(atcmd_player_name)) == NULL) { clif->message(fd, msg_txt(3)); // Character not found. return false; } - if (pc_get_group_level(sd) < pc_get_group_level(pl_sd)) + if (iPc->get_group_level(sd) < iPc->get_group_level(pl_sd)) { // you can jail only lower or same GM clif->message(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player. return false; @@ -4533,12 +4533,12 @@ ACMD(unjail) return false; } - if ((pl_sd = map_nick2sd(atcmd_player_name)) == NULL) { + if ((pl_sd = iMap->nick2sd(atcmd_player_name)) == NULL) { clif->message(fd, msg_txt(3)); // Character not found. return false; } - if (pc_get_group_level(sd) < pc_get_group_level(pl_sd)) { // you can jail only lower or same GM + if (iPc->get_group_level(sd) < iPc->get_group_level(pl_sd)) { // you can jail only lower or same GM clif->message(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player. return false; @@ -4613,12 +4613,12 @@ ACMD(jailfor) return false; } - if ((pl_sd = map_nick2sd(atcmd_player_name)) == NULL) { + if ((pl_sd = iMap->nick2sd(atcmd_player_name)) == NULL) { clif->message(fd, msg_txt(3)); // Character not found. return false; } - if (pc_get_group_level(pl_sd) > pc_get_group_level(sd)) { + if (iPc->get_group_level(pl_sd) > iPc->get_group_level(sd)) { clif->message(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player. return false; } @@ -4738,7 +4738,7 @@ ACMD(disguise) return false; } - pc_disguise(sd, id); + iPc->disguise(sd, id); clif->message(fd, msg_txt(122)); // Disguise applied. return true; @@ -4769,7 +4769,7 @@ ACMD(disguiseall) iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit->first(iter); mapit->exists(iter); pl_sd = (TBL_PC*)mapit->next(iter) ) - pc_disguise(pl_sd, mob_id); + iPc->disguise(pl_sd, mob_id); mapit->free(iter); clif->message(fd, msg_txt(122)); // Disguise applied. @@ -4817,7 +4817,7 @@ ACMD(disguiseguild) for( i = 0; i < g->max_member; i++ ) if( (pl_sd = g->member[i].sd) && !pc_isriding(pl_sd) ) - pc_disguise(pl_sd, id); + iPc->disguise(pl_sd, id); clif->message(fd, msg_txt(122)); // Disguise applied. return true; @@ -4831,7 +4831,7 @@ ACMD(undisguise) { nullpo_retr(-1, sd); if (sd->disguise != -1) { - pc_disguise(sd, -1); + iPc->disguise(sd, -1); clif->message(fd, msg_txt(124)); // Undisguise applied. } else { clif->message(fd, msg_txt(125)); // You're not disguised. @@ -4852,7 +4852,7 @@ ACMD(undisguiseall) { iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit->first(iter); mapit->exists(iter); pl_sd = (TBL_PC*)mapit->next(iter) ) if( pl_sd->disguise != -1 ) - pc_disguise(pl_sd, -1); + iPc->disguise(pl_sd, -1); mapit->free(iter); clif->message(fd, msg_txt(124)); // Undisguise applied. @@ -4885,7 +4885,7 @@ ACMD(undisguiseguild) for(i = 0; i < g->max_member; i++) if( (pl_sd = g->member[i].sd) && pl_sd->disguise != -1 ) - pc_disguise(pl_sd, -1); + iPc->disguise(pl_sd, -1); clif->message(fd, msg_txt(124)); // Undisguise applied. @@ -4902,11 +4902,11 @@ ACMD(exp) nullpo_retr(-1, sd); memset(output, '\0', sizeof(output)); - nextb = pc_nextbaseexp(sd); + nextb = iPc->nextbaseexp(sd); if (nextb) nextb = sd->status.base_exp*100.0/nextb; - nextj = pc_nextjobexp(sd); + nextj = iPc->nextjobexp(sd); if (nextj) nextj = sd->status.job_exp*100.0/nextj; @@ -5042,7 +5042,7 @@ ACMD(killable) clif->message(fd, msg_txt(242)); else { clif->message(fd, msg_txt(288)); - map_foreachinrange(atcommand_stopattack,&sd->bl, AREA_SIZE, BL_CHAR, sd->bl.id); + iMap->foreachinrange(atcommand_stopattack,&sd->bl, AREA_SIZE, BL_CHAR, sd->bl.id); } return true; } @@ -5101,9 +5101,9 @@ ACMD(npcmove) x = cap_value(x, 0, map[m].xs-1); y = cap_value(y, 0, map[m].ys-1); - map_foreachinrange(clif->outsight, &nd->bl, AREA_SIZE, BL_PC, &nd->bl); - map_moveblock(&nd->bl, x, y, gettick()); - map_foreachinrange(clif->insight, &nd->bl, AREA_SIZE, BL_PC, &nd->bl); + iMap->foreachinrange(clif->outsight, &nd->bl, AREA_SIZE, BL_PC, &nd->bl); + iMap->moveblock(&nd->bl, x, y, iTimer->gettick()); + iMap->foreachinrange(clif->insight, &nd->bl, AREA_SIZE, BL_PC, &nd->bl); clif->message(fd, msg_txt(1155)); // NPC moved. return true; @@ -5158,22 +5158,22 @@ ACMD(follow) if (sd->followtarget == -1) return false; - pc_stop_following (sd); + iPc->stop_following (sd); clif->message(fd, msg_txt(1159)); // Follow mode OFF. return true; } - if ( (pl_sd = map_nick2sd((char *)message)) == NULL ) + if ( (pl_sd = iMap->nick2sd((char *)message)) == NULL ) { clif->message(fd, msg_txt(3)); // Character not found. return false; } if (sd->followtarget == pl_sd->bl.id) { - pc_stop_following (sd); + iPc->stop_following (sd); clif->message(fd, msg_txt(1159)); // Follow mode OFF. } else { - pc_follow(sd, pl_sd->bl.id); + iPc->follow(sd, pl_sd->bl.id); clif->message(fd, msg_txt(1160)); // Follow mode ON. } @@ -5192,8 +5192,8 @@ ACMD(dropall) for (i = 0; i < MAX_INVENTORY; i++) { if (sd->status.inventory[i].amount) { if(sd->status.inventory[i].equip != 0) - pc_unequipitem(sd, i, 3); - pc_dropitem(sd, i, sd->status.inventory[i].amount); + iPc->unequipitem(sd, i, 3); + iPc->dropitem(sd, i, sd->status.inventory[i].amount); } } return true; @@ -5219,7 +5219,7 @@ ACMD(storeall) for (i = 0; i < MAX_INVENTORY; i++) { if (sd->status.inventory[i].amount) { if(sd->status.inventory[i].equip != 0) - pc_unequipitem(sd, i, 3); + iPc->unequipitem(sd, i, 3); storage_storageadd(sd, i, sd->status.inventory[i].amount); } } @@ -5306,7 +5306,7 @@ ACMD(clearcart) for( i = 0; i < MAX_CART; i++ ) if(sd->status.cart[i].nameid > 0) - pc_cart_delitem(sd, i, sd->status.cart[i].amount, 1, LOG_TYPE_OTHER); + iPc->cart_delitem(sd, i, sd->status.cart[i].amount, 1, LOG_TYPE_OTHER); clif->clearcart(fd); clif->updatestatus(sd,SP_CARTINFO); @@ -5340,12 +5340,12 @@ ACMD(skillid) { iter = db_iterator(skilldb_name2id); for( data = iter->first(iter,&key); iter->exists(iter); data = iter->next(iter,&key) ) { - idx = skill->get_index(DB->data2i(data)); + idx = skill->get_index(iDB->data2i(data)); if (strnicmp(key.str, message, skillen) == 0 || strnicmp(skill_db[idx].desc, message, skillen) == 0) { - sprintf(atcmd_output, msg_txt(1164), DB->data2i(data), skill_db[idx].desc, key.str); // skill %d: %s (%s) + sprintf(atcmd_output, msg_txt(1164), iDB->data2i(data), skill_db[idx].desc, key.str); // skill %d: %s (%s) clif->message(fd, atcmd_output); } else if ( found < MAX_SKILLID_PARTIAL_RESULTS && ( stristr(key.str,message) || stristr(skill_db[idx].desc,message) ) ) { - snprintf(partials[found++], MAX_SKILLID_PARTIAL_RESULTS_LEN, msg_txt(1164), DB->data2i(data), skill_db[idx].desc, key.str); + snprintf(partials[found++], MAX_SKILLID_PARTIAL_RESULTS_LEN, msg_txt(1164), iDB->data2i(data), skill_db[idx].desc, key.str); } } @@ -5382,12 +5382,12 @@ ACMD(useskill) } if(!strcmp(target,"self")) pl_sd = sd; //quick keyword - else if ( (pl_sd = map_nick2sd(target)) == NULL ){ + else if ( (pl_sd = iMap->nick2sd(target)) == NULL ){ clif->message(fd, msg_txt(3)); // Character not found. return false; } - if ( pc_get_group_level(sd) < pc_get_group_level(pl_sd) ) + if ( iPc->get_group_level(sd) < iPc->get_group_level(pl_sd) ) { clif->message(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player. return false; @@ -5426,7 +5426,7 @@ ACMD(displayskill) return false; } status = status_get_status_data(&sd->bl); - tick = gettick(); + tick = iTimer->gettick(); clif->skill_damage(&sd->bl,&sd->bl, tick, status->amotion, status->dmotion, 1, 1, skill_id, skill_lv, 5); clif->skill_nodamage(&sd->bl, &sd->bl, skill_id, skill_lv, 1); clif->skill_poseffect(&sd->bl, skill_id, skill_lv, sd->bl.x, sd->bl.y, tick); @@ -5451,16 +5451,16 @@ ACMD(skilltree) return false; } - if ( (pl_sd = map_nick2sd(target)) == NULL ) + if ( (pl_sd = iMap->nick2sd(target)) == NULL ) { clif->message(fd, msg_txt(3)); // Character not found. return false; } - c = pc_calc_skilltree_normalize_job(pl_sd); - c = pc_mapid2jobid(c, pl_sd->status.sex); + c = iPc->calc_skilltree_normalize_job(pl_sd); + c = iPc->mapid2jobid(c, pl_sd->status.sex); - sprintf(atcmd_output, msg_txt(1168), job_name(c), pc_checkskill(pl_sd, NV_BASIC)); // Player is using %s skill tree (%d basic points). + sprintf(atcmd_output, msg_txt(1168), iPc->job_name(c), iPc->checkskill(pl_sd, NV_BASIC)); // Player is using %s skill tree (%d basic points). clif->message(fd, atcmd_output); ARR_FIND( 0, MAX_SKILL_TREE, j, skill_tree[c][j].id == 0 || skill_tree[c][j].id == skill_id ); @@ -5475,7 +5475,7 @@ ACMD(skilltree) meets = 1; for(j=0;j<MAX_PC_SKILL_REQUIRE;j++) { - if( ent->need[j].id && pc_checkskill(sd,ent->need[j].id) < ent->need[j].lv) + if( ent->need[j].id && iPc->checkskill(sd,ent->need[j].id) < ent->need[j].lv) { sprintf(atcmd_output, msg_txt(1170), ent->need[j].lv, skill_db[ent->need[j].id].desc); // Player requires level %d of skill %s. clif->message(fd, atcmd_output); @@ -5503,9 +5503,9 @@ void getring (struct map_session_data* sd) item_tmp.card[2] = sd->status.partner_id; item_tmp.card[3] = sd->status.partner_id >> 16; - if((flag = pc_additem(sd,&item_tmp,1,LOG_TYPE_COMMAND))) { + if((flag = iPc->additem(sd,&item_tmp,1,LOG_TYPE_COMMAND))) { clif->additem(sd,0,0,flag); - map_addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0); + iMap->addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0); } } @@ -5525,12 +5525,12 @@ ACMD(marry) return false; } - if ((pl_sd = map_nick2sd(player_name)) == NULL) { + if ((pl_sd = iMap->nick2sd(player_name)) == NULL) { clif->message(fd, msg_txt(3)); return false; } - if (pc_marriage(sd, pl_sd) == 0) { + if (iPc->marriage(sd, pl_sd) == 0) { clif->message(fd, msg_txt(1173)); // They are married... wish them well. clif->wedding_effect(&pl_sd->bl); //wedding effect and music [Lupus] getring(sd); // Auto-give named rings (Aru) @@ -5550,7 +5550,7 @@ ACMD(divorce) { nullpo_retr(-1, sd); - if (pc_divorce(sd) != 0) { + if (iPc->divorce(sd) != 0) { sprintf(atcmd_output, msg_txt(1175), sd->status.name); // '%s' is not married. clif->message(fd, atcmd_output); return false; @@ -5647,7 +5647,7 @@ ACMD(changegm) return false; } - if((pl_sd=map_nick2sd((char *) message)) == NULL || pl_sd->status.guild_id != sd->status.guild_id) { + if((pl_sd=iMap->nick2sd((char *) message)) == NULL || pl_sd->status.guild_id != sd->status.guild_id) { clif->message(fd, msg_txt(1184)); // Target character must be online and be a guild member. return false; } @@ -5670,7 +5670,7 @@ ACMD(changeleader) return false; } - if (party_changeleader(sd, map_nick2sd((char *) message))) + if (iParty->changeleader(sd, iMap->nick2sd((char *) message))) return true; return false; } @@ -5686,7 +5686,7 @@ ACMD(partyoption) char w1[16], w2[16]; nullpo_retr(-1, sd); - if (sd->status.party_id == 0 || (p = party_search(sd->status.party_id)) == NULL) + if (sd->status.party_id == 0 || (p = iParty->search(sd->status.party_id)) == NULL) { clif->message(fd, msg_txt(282)); return false; @@ -5712,7 +5712,7 @@ ACMD(partyoption) //Change item share type. if (option != p->party.item) - party_changeoption(sd, p->party.exp, option); + iParty->changeoption(sd, p->party.exp, option); else clif->message(fd, msg_txt(286)); @@ -6106,14 +6106,14 @@ ACMD(mobsearch) static int atcommand_cleanfloor_sub(struct block_list *bl, va_list ap) { nullpo_ret(bl); - map_clearflooritem(bl); + iMap->clearflooritem(bl); return 0; } ACMD(cleanmap) { - map_foreachinmap(atcommand_cleanfloor_sub, sd->bl.m, BL_ITEM); + iMap->foreachinmap(atcommand_cleanfloor_sub, sd->bl.m, BL_ITEM); clif->message(fd, msg_txt(1221)); // All dropped items have been cleaned up. return true; } @@ -6123,13 +6123,13 @@ ACMD(cleanarea) int x0 = 0, y0 = 0, x1 = 0, y1 = 0; if (!message || !*message || sscanf(message, "%d %d %d %d", &x0, &y0, &x1, &y1) < 1) { - map_foreachinarea(atcommand_cleanfloor_sub, sd->bl.m, sd->bl.x - (AREA_SIZE * 2), sd->bl.y - (AREA_SIZE * 2), sd->bl.x + (AREA_SIZE * 2), sd->bl.y + (AREA_SIZE * 2), BL_ITEM); + iMap->foreachinarea(atcommand_cleanfloor_sub, sd->bl.m, sd->bl.x - (AREA_SIZE * 2), sd->bl.y - (AREA_SIZE * 2), sd->bl.x + (AREA_SIZE * 2), sd->bl.y + (AREA_SIZE * 2), BL_ITEM); } else if (sscanf(message, "%d %d %d %d", &x0, &y0, &x1, &y1) == 1) { - map_foreachinarea(atcommand_cleanfloor_sub, sd->bl.m, sd->bl.x - x0, sd->bl.y - x0, sd->bl.x + x0, sd->bl.y + x0, BL_ITEM); + iMap->foreachinarea(atcommand_cleanfloor_sub, sd->bl.m, sd->bl.x - x0, sd->bl.y - x0, sd->bl.x + x0, sd->bl.y + x0, BL_ITEM); } else if (sscanf(message, "%d %d %d %d", &x0, &y0, &x1, &y1) == 4) { - map_foreachinarea(atcommand_cleanfloor_sub, sd->bl.m, x0, y0, x1, y1, BL_ITEM); + iMap->foreachinarea(atcommand_cleanfloor_sub, sd->bl.m, x0, y0, x1, y1, BL_ITEM); } clif->message(fd, msg_txt(1221)); // All dropped items have been cleaned up. @@ -6187,9 +6187,9 @@ ACMD(pettalk) nullpo_retr(-1, sd); if ( battle_config.min_chat_delay ) { - if( DIFF_TICK(sd->cantalk_tick, gettick()) > 0 ) + if( DIFF_TICK(sd->cantalk_tick, iTimer->gettick()) > 0 ) return true; - sd->cantalk_tick = gettick() + battle_config.min_chat_delay; + sd->cantalk_tick = iTimer->gettick() + battle_config.min_chat_delay; } if(!sd->status.pet_id || !(pd=sd->pd)) @@ -6294,8 +6294,8 @@ ACMD(users) *------------------------------------------*/ ACMD(reset) { - pc_resetstate(sd); - pc_resetskill(sd,1); + iPc->resetstate(sd); + iPc->resetskill(sd,1); sprintf(atcmd_output, msg_txt(208), sd->status.name); // '%s' skill and stats points reseted! clif->message(fd, atcmd_output); return true; @@ -6310,7 +6310,7 @@ ACMD(summon) int mob_id = 0; int duration = 0; struct mob_data *md; - unsigned int tick=gettick(); + unsigned int tick=iTimer->gettick(); nullpo_retr(-1, sd); @@ -6340,7 +6340,7 @@ ACMD(summon) md->master_id=sd->bl.id; md->special_state.ai=1; - md->deletetimer=add_timer(tick+(duration*60000),mob_timer_delete,md->bl.id,0); + md->deletetimer=iTimer->add_timer(tick+(duration*60000),mob_timer_delete,md->bl.id,0); clif->specialeffect(&md->bl,344,AREA); mob_spawn(md); sc_start4(&md->bl, SC_MODECHANGE, 100, 1, 0, MD_AGGRESSIVE, 0, 60000); @@ -6391,7 +6391,7 @@ ACMD(trade) return false; } - if ( (pl_sd = map_nick2sd((char *)message)) == NULL ) + if ( (pl_sd = iMap->nick2sd((char *)message)) == NULL ) { clif->message(fd, msg_txt(3)); // Character not found. return false; @@ -6438,7 +6438,7 @@ ACMD(unmute) return false; } - if ( (pl_sd = map_nick2sd((char *)message)) == NULL ) + if ( (pl_sd = iMap->nick2sd((char *)message)) == NULL ) { clif->message(fd, msg_txt(3)); // Character not found. return false; @@ -6465,7 +6465,7 @@ ACMD(uptime) minute = 60, days = 0, hours = 0, minutes = 0; nullpo_retr(-1, sd); - seconds = get_uptime(); + seconds = iTimer->get_uptime(); days = seconds/day; seconds -= (seconds/day>0)?(seconds/day)*day:0; hours = seconds/hour; @@ -6487,10 +6487,10 @@ ACMD(changesex) { int i; nullpo_retr(-1, sd); - pc_resetskill(sd,4); + iPc->resetskill(sd,4); // to avoid any problem with equipment and invalid sex, equipment is unequiped. for( i=0; i<EQI_MAX; i++ ) - if( sd->equip_index[i] >= 0 ) pc_unequipitem(sd, sd->equip_index[i], 3); + if( sd->equip_index[i] >= 0 ) iPc->unequipitem(sd, sd->equip_index[i], 3); chrif_changesex(sd); return true; } @@ -6509,13 +6509,13 @@ ACMD(mute) return false; } - if ( (pl_sd = map_nick2sd(atcmd_player_name)) == NULL ) + if ( (pl_sd = iMap->nick2sd(atcmd_player_name)) == NULL ) { clif->message(fd, msg_txt(3)); // Character not found. return false; } - if ( pc_get_group_level(sd) < pc_get_group_level(pl_sd) ) + if ( iPc->get_group_level(sd) < iPc->get_group_level(pl_sd) ) { clif->message(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player. return false; @@ -6953,9 +6953,9 @@ ACMD(homtalk) nullpo_retr(-1, sd); if ( battle_config.min_chat_delay ) { - if( DIFF_TICK(sd->cantalk_tick, gettick()) > 0 ) + if( DIFF_TICK(sd->cantalk_tick, iTimer->gettick()) > 0 ) return true; - sd->cantalk_tick = gettick() + battle_config.min_chat_delay; + sd->cantalk_tick = iTimer->gettick() + battle_config.min_chat_delay; } if (sd->sc.count && //no "chatting" while muted. @@ -7234,7 +7234,7 @@ ACMD(whereis) for (i = 0; i < ARRAYLENGTH(mob->spawn) && mob->spawn[i].qty; i++) { - j = map_mapindex2mapid(mob->spawn[i].mapindex); + j = iMap->mapindex2mapid(mob->spawn[i].mapindex); if (j < 0) continue; snprintf(atcmd_output, sizeof atcmd_output, "%s (%d)", map[j].name, mob->spawn[i].qty); clif->message(fd, atcmd_output); @@ -7276,7 +7276,7 @@ static int atcommand_mutearea_sub(struct block_list *bl,va_list ap) id = va_arg(ap, int); time = va_arg(ap, int); - if (id != bl->id && !pc_get_group_level(pl_sd)) { + if (id != bl->id && !iPc->get_group_level(pl_sd)) { pl_sd->status.manner -= time; if (pl_sd->status.manner < 0) sc_start(&pl_sd->bl,SC_NOCHAT,100,0,0); @@ -7298,7 +7298,7 @@ ACMD(mutearea) time = atoi(message); - map_foreachinarea(atcommand_mutearea_sub,sd->bl.m, + iMap->foreachinarea(atcommand_mutearea_sub,sd->bl.m, sd->bl.x-AREA_SIZE, sd->bl.y-AREA_SIZE, sd->bl.x+AREA_SIZE, sd->bl.y+AREA_SIZE, BL_PC, sd->bl.id, time); @@ -7371,7 +7371,7 @@ ACMD(size) if(sd->state.size) { sd->state.size = SZ_SMALL; - pc_setpos(sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_TELEPORT); + iPc->setpos(sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_TELEPORT); } sd->state.size = size; @@ -7398,7 +7398,7 @@ ACMD(sizeall) if( pl_sd->state.size != size ) { if( pl_sd->state.size ) { pl_sd->state.size = SZ_SMALL; - pc_setpos(pl_sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT); + iPc->setpos(pl_sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT); } pl_sd->state.size = size; @@ -7440,7 +7440,7 @@ ACMD(sizeguild) if( (pl_sd = g->member[i].sd) && pl_sd->state.size != size ) { if( pl_sd->state.size ) { pl_sd->state.size = SZ_SMALL; - pc_setpos(pl_sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT); + iPc->setpos(pl_sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT); } pl_sd->state.size = size; @@ -7549,19 +7549,19 @@ return true;\ if ( strcmp( flag_name , "gvg" ) == 0 ) { if( flag && !map[sd->bl.m].flag.gvg ) - map_zone_change2(sd->bl.m,strdb_get(zone_db, MAP_ZONE_GVG_NAME)); + iMap->zone_change2(sd->bl.m,strdb_get(zone_db, MAP_ZONE_GVG_NAME)); else if ( !flag && map[sd->bl.m].flag.gvg ) - map_zone_change2(sd->bl.m,map[sd->bl.m].prev_zone); + iMap->zone_change2(sd->bl.m,map[sd->bl.m].prev_zone); } else if ( strcmp( flag_name , "pvp" ) == 0 ) { if( flag && !map[sd->bl.m].flag.pvp ) - map_zone_change2(sd->bl.m,strdb_get(zone_db, MAP_ZONE_PVP_NAME)); + iMap->zone_change2(sd->bl.m,strdb_get(zone_db, MAP_ZONE_PVP_NAME)); else if ( !flag && map[sd->bl.m].flag.pvp ) - map_zone_change2(sd->bl.m,map[sd->bl.m].prev_zone); + iMap->zone_change2(sd->bl.m,map[sd->bl.m].prev_zone); } else if ( strcmp( flag_name , "battleground" ) == 0 ) { if( flag && !map[sd->bl.m].flag.battleground ) - map_zone_change2(sd->bl.m,strdb_get(zone_db, MAP_ZONE_BG_NAME)); + iMap->zone_change2(sd->bl.m,strdb_get(zone_db, MAP_ZONE_BG_NAME)); else if ( !flag && map[sd->bl.m].flag.battleground ) - map_zone_change2(sd->bl.m,map[sd->bl.m].prev_zone); + iMap->zone_change2(sd->bl.m,map[sd->bl.m].prev_zone); } setflag(autotrade); setflag(allowks); setflag(nomemo); setflag(noteleport); @@ -7649,7 +7649,7 @@ ACMD(showdelay) ACMD(invite) { unsigned int did = sd->duel_group; - struct map_session_data *target_sd = map_nick2sd((char *)message); + struct map_session_data *target_sd = iMap->nick2sd((char *)message); if(did == 0) { // "Duel: @invite without @duel." @@ -7722,7 +7722,7 @@ ACMD(duel) duel_create(sd, maxpl); } else { struct map_session_data *target_sd; - target_sd = map_nick2sd((char *)message); + target_sd = iMap->nick2sd((char *)message); if(target_sd != NULL) { unsigned int newduel; if((newduel = duel_create(sd, 2)) != -1) { @@ -7820,13 +7820,13 @@ ACMD(cash) if( !strcmpi(command+1,"cash") ) { if( value > 0 ) { - if( (ret=pc_getcash(sd, value, 0)) >= 0){ + if( (ret=iPc->getcash(sd, value, 0)) >= 0){ sprintf(output, msg_txt(505), ret, sd->cashPoints); clif->disp_onlyself(sd, output, strlen(output)); } else clif->message(fd, msg_txt(149)); // Unable to decrease the number/value. } else { - if( (ret=pc_paycash(sd, -value, 0)) >= 0){ + if( (ret=iPc->paycash(sd, -value, 0)) >= 0){ sprintf(output, msg_txt(410), ret, sd->cashPoints); clif->disp_onlyself(sd, output, strlen(output)); } @@ -7836,13 +7836,13 @@ ACMD(cash) else { // @points if( value > 0 ) { - if( (ret=pc_getcash(sd, 0, value)) >= 0){ + if( (ret=iPc->getcash(sd, 0, value)) >= 0){ sprintf(output, msg_txt(506), ret, sd->kafraPoints); clif->disp_onlyself(sd, output, strlen(output)); } else clif->message(fd, msg_txt(149)); // Unable to decrease the number/value. } else { - if( (ret=pc_paycash(sd, -value, -value)) >= 0){ + if( (ret=iPc->paycash(sd, -value, -value)) >= 0){ sprintf(output, msg_txt(411), ret, sd->kafraPoints); clif->disp_onlyself(sd, output, strlen(output)); } @@ -7864,12 +7864,12 @@ ACMD(clone) return true; } - if((pl_sd=map_nick2sd((char *)message)) == NULL && (pl_sd=map_charid2sd(atoi(message))) == NULL) { + if((pl_sd=iMap->nick2sd((char *)message)) == NULL && (pl_sd=iMap->charid2sd(atoi(message))) == NULL) { clif->message(fd, msg_txt(3)); // Character not found. return true; } - if(pc_get_group_level(pl_sd) > pc_get_group_level(sd)) { + if(iPc->get_group_level(pl_sd) > iPc->get_group_level(sd)) { clif->message(fd, msg_txt(126)); // Cannot clone a player of higher GM level than yourself. return true; } @@ -7893,7 +7893,7 @@ ACMD(clone) do { x = sd->bl.x + (rnd() % 10 - 5); y = sd->bl.y + (rnd() % 10 - 5); - } while (map_getcell(sd->bl.m,x,y,CELL_CHKNOPASS) && i++ < 10); + } while (iMap->getcell(sd->bl.m,x,y,CELL_CHKNOPASS) && i++ < 10); if (i >= 10) { x = sd->bl.x; @@ -7948,7 +7948,7 @@ ACMD(request) *------------------------------------------*/ ACMD(feelreset) { - pc_resetfeel(sd); + iPc->resetfeel(sd); clif->message(fd, msg_txt(1324)); // Reset 'Feeling' maps. return true; @@ -8020,7 +8020,7 @@ ACMD(resetstat) { nullpo_retr(-1, sd); - pc_resetstate(sd); + iPc->resetstate(sd); sprintf(atcmd_output, msg_txt(207), sd->status.name); clif->message(fd, atcmd_output); return true; @@ -8030,7 +8030,7 @@ ACMD(resetskill) { nullpo_retr(-1,sd); - pc_resetskill(sd,1); + iPc->resetskill(sd,1); sprintf(atcmd_output, msg_txt(206), sd->status.name); clif->message(fd, atcmd_output); return true; @@ -8252,7 +8252,7 @@ ACMD(stats) output_table[14].value = sd->change_level_2nd; output_table[15].value = sd->change_level_3rd; - sprintf(job_jobname, "Job - %s %s", job_name(sd->status.class_), "(level %d)"); + sprintf(job_jobname, "Job - %s %s", iPc->job_name(sd->status.class_), "(level %d)"); sprintf(output, msg_txt(53), sd->status.name); // '%s' stats: clif->message(fd, output); @@ -8292,7 +8292,7 @@ ACMD(delitem) total = amount; // delete items - while( amount && ( idx = pc_search_inventory(sd, nameid) ) != -1 ) + while( amount && ( idx = iPc->search_inventory(sd, nameid) ) != -1 ) { int delamount = ( amount < sd->status.inventory[idx].amount ) ? amount : sd->status.inventory[idx].amount; @@ -8300,7 +8300,7 @@ ACMD(delitem) {// delete pet intif_delete_petdata(MakeDWord(sd->status.inventory[idx].card[1], sd->status.inventory[idx].card[2])); } - pc_delitem(sd, idx, delamount, 0, 0, LOG_TYPE_COMMAND); + iPc->delitem(sd, idx, delamount, 0, 0, LOG_TYPE_COMMAND); amount-= delamount; } @@ -8466,7 +8466,7 @@ ACMD(accinfo) { //remove const type safestrncpy(query, message, NAME_LENGTH); - intif_request_accinfo( sd->fd, sd->bl.id, pc_get_group_level(sd), query ); + intif_request_accinfo( sd->fd, sd->bl.id, iPc->get_group_level(sd), query ); return true; } @@ -8519,7 +8519,7 @@ ACMD(set) { switch( reg[0] ) { case '@': - data->u.str = pc_readregstr(sd, add_str(reg)); + data->u.str = iPc->readregstr(sd, add_str(reg)); break; case '$': data->u.str = mapreg_readregstr(add_str(reg)); @@ -8548,7 +8548,7 @@ ACMD(set) { data->type = C_INT; switch( reg[0] ) { case '@': - data->u.num = pc_readreg(sd, add_str(reg)); + data->u.num = iPc->readreg(sd, add_str(reg)); break; case '$': data->u.num = mapreg_readreg(add_str(reg)); @@ -8674,7 +8674,7 @@ sd->status.skill[idx].lv = x?1:0; \ sd->status.skill[idx].flag = x?1:0; int val = atoi(message); - bool need_skill = pc_checkskill(sd, MC_PUSHCART) ? false : true; + bool need_skill = iPc->checkskill(sd, MC_PUSHCART) ? false : true; unsigned int index = skill->get_index(MC_PUSHCART); if( !message || !*message || val < 0 || val > MAX_CARTS ) { @@ -8692,7 +8692,7 @@ sd->status.skill[idx].flag = x?1:0; MC_CART_MDFY(1,index); } - if( pc_setcart(sd, val) ) { + if( iPc->setcart(sd, val) ) { if( need_skill ) { MC_CART_MDFY(0,index); } @@ -9017,7 +9017,7 @@ ACMD(channel) { return false; } - if( sub2[0] == '\0' || ( pl_sd = map_nick2sd(sub2) ) == NULL ) { + if( sub2[0] == '\0' || ( pl_sd = iMap->nick2sd(sub2) ) == NULL ) { sprintf(atcmd_output, msg_txt(1434), sub2);// Player '%s' was not found clif->message(fd, atcmd_output); return false; @@ -9073,7 +9073,7 @@ ACMD(channel) { return false; } - if( sub2[0] == '\0' || ( pl_sd = map_nick2sd(sub2) ) == NULL ) { + if( sub2[0] == '\0' || ( pl_sd = iMap->nick2sd(sub2) ) == NULL ) { sprintf(atcmd_output, msg_txt(1434), sub2);// Player '%s' was not found clif->message(fd, atcmd_output); return false; @@ -9156,7 +9156,7 @@ ACMD(channel) { iter = db_iterator(channel->banned); for( data = iter->first(iter,&key); iter->exists(iter); data = iter->next(iter,&key) ) { - struct hChSysBanEntry * entry = DB->data2ptr(data); + struct hChSysBanEntry * entry = iDB->data2ptr(data); if( !isA ) sprintf(atcmd_output, msg_txt(1444), entry->name);// - %s %s @@ -9808,7 +9808,7 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message // 1 = player invoked if ( type == 1) { //Commands are disabled on maps flagged as 'nocommand' - if ( map[sd->bl.m].nocommand && pc_get_group_level(sd) < map[sd->bl.m].nocommand ) { + if ( map[sd->bl.m].nocommand && iPc->get_group_level(sd) < map[sd->bl.m].nocommand ) { clif->message(fd, msg_txt(143)); return false; } @@ -9843,7 +9843,7 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message break; } - if( !pc_get_group_level(sd) ) { + if( !iPc->get_group_level(sd) ) { if( x >= 1 || y >= 1 ) { /* we have command */ info = get_atcommandinfo_byname(atcommand_checkalias(command + 1)); if( !info || info->char_groups[sd->group_pos] == 0 ) /* if we can't use or doesn't exist: don't even display the command failed message */ @@ -9881,15 +9881,15 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message // Check if the binding isn't NULL and there is a NPC event, level of usage met, et cetera if( binding != NULL && binding->npc_event[0] && - ((*atcmd_msg == atcommand->at_symbol && pc_get_group_level(sd) >= binding->group_lv) || - (*atcmd_msg == atcommand->char_symbol && pc_get_group_level(sd) >= binding->group_lv_char))) + ((*atcmd_msg == atcommand->at_symbol && iPc->get_group_level(sd) >= binding->group_lv) || + (*atcmd_msg == atcommand->char_symbol && iPc->get_group_level(sd) >= binding->group_lv_char))) { // Check if self or character invoking; if self == character invoked, then self invoke. bool invokeFlag = ((*atcmd_msg == atcommand->at_symbol) ? 1 : 0); // Check if the command initiated is a character command if (*message == atcommand->char_symbol && - (ssd = map_nick2sd(charname)) == NULL && (ssd = map_nick2sd(charname2)) == NULL ) { + (ssd = iMap->nick2sd(charname)) == NULL && (ssd = iMap->nick2sd(charname2)) == NULL ) { sprintf(output, msg_txt(1389), command); // %s failed. Player not found. clif->message(fd, output); return true; @@ -9906,7 +9906,7 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message //Grab the command information and check for the proper GM level required to use it or if the command exists info = get_atcommandinfo_byname(atcommand_checkalias(command + 1)); if (info == NULL) { - if( pc_get_group_level(sd) ) { // TODO: remove or replace with proper permission + if( iPc->get_group_level(sd) ) { // TODO: remove or replace with proper permission sprintf(output, msg_txt(153), command); // "%s is Unknown Command." clif->message(fd, output); atcommand_get_suggestions(sd, command + 1, *message == atcommand->at_symbol); @@ -9939,7 +9939,7 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message // Check if target is valid only if confirmed that player can use command. if (*message == atcommand->char_symbol && - (ssd = map_nick2sd(charname)) == NULL && (ssd = map_nick2sd(charname2)) == NULL ) { + (ssd = iMap->nick2sd(charname)) == NULL && (ssd = iMap->nick2sd(charname2)) == NULL ) { sprintf(output, msg_txt(1389), command); // %s failed. Player not found. clif->message(fd, output); return true; @@ -10184,7 +10184,7 @@ void atcommand_doload(void) { atcommand->db = stridb_alloc(DB_OPT_DUP_KEY|DB_OPT_RELEASE_DATA, ATCOMMAND_LENGTH); atcommand->alias_db = stridb_alloc(DB_OPT_DUP_KEY|DB_OPT_RELEASE_DATA, ATCOMMAND_LENGTH); atcommand_basecommands(); //fills initial atcommand_db with known commands - atcommand_config_read(ATCOMMAND_CONF_FILENAME); + atcommand_config_read(iMap->ATCOMMAND_CONF_FILENAME); } void do_init_atcommand(void) { |