summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-06-08 17:20:12 -0300
committershennetsind <ind@henn.et>2013-06-08 17:20:12 -0300
commit27147633d447400d4a095a4166c64d3a0df4e078 (patch)
tree6fe2c0b85b7e4f124799bebe4aae3b225ea6b772
parent97b6ba1229f845dc8ae47c91586a195a5bf37e9c (diff)
downloadhercules-27147633d447400d4a095a4166c64d3a0df4e078.tar.gz
hercules-27147633d447400d4a095a4166c64d3a0df4e078.tar.bz2
hercules-27147633d447400d4a095a4166c64d3a0df4e078.tar.xz
hercules-27147633d447400d4a095a4166c64d3a0df4e078.zip
Follow up d73783f22b2bb881aab74524d153d89a5932a199
Adjusting pc.c interface name to adhere with the rest (pretty much we try to make it as short as we can, and being there were no conflicts we saw no reason to maintain the 'i') Signed-off-by: shennetsind <ind@henn.et>
-rw-r--r--src/map/atcommand.c296
-rw-r--r--src/map/battle.c168
-rw-r--r--src/map/battleground.c4
-rw-r--r--src/map/buyingstore.c20
-rw-r--r--src/map/chrif.c14
-rw-r--r--src/map/clif.c220
-rw-r--r--src/map/clif.h2
-rw-r--r--src/map/elemental.c2
-rw-r--r--src/map/guild.c4
-rw-r--r--src/map/homunculus.c4
-rw-r--r--src/map/instance.c6
-rw-r--r--src/map/intif.c8
-rw-r--r--src/map/itemdb.c4
-rw-r--r--src/map/mail.c20
-rw-r--r--src/map/map.c16
-rw-r--r--src/map/mob.c36
-rw-r--r--src/map/npc.c46
-rw-r--r--src/map/party.c18
-rw-r--r--src/map/path.c2
-rw-r--r--src/map/pc.c842
-rw-r--r--src/map/pc.h28
-rw-r--r--src/map/pet.c20
-rw-r--r--src/map/script.c342
-rw-r--r--src/map/skill.c476
-rw-r--r--src/map/status.c252
-rw-r--r--src/map/storage.c24
-rw-r--r--src/map/trade.c28
-rw-r--r--src/map/unit.c46
-rw-r--r--src/map/vending.c20
29 files changed, 1484 insertions, 1484 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index f0e5e34d3..3d417c986 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -410,8 +410,8 @@ ACMD(mapmove)
return false;
}
- 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.
+ if ((x || y) && iMap->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.
clif->message(fd, msg_txt(2));
if (!iMap->search_freecell(NULL, m, &x, &y, 10, 10, 1))
x = y = 0; //Invalid cell, use random spot.
@@ -424,7 +424,7 @@ ACMD(mapmove)
clif->message(fd, msg_txt(248));
return false;
}
- if (iPc->setpos(sd, mapindex, x, y, CLR_TELEPORT) != 0) {
+ if (pc->setpos(sd, mapindex, x, y, CLR_TELEPORT) != 0) {
clif->message(fd, msg_txt(1)); // Map not found.
return false;
}
@@ -451,7 +451,7 @@ ACMD(where)
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) && iPc->get_group_level(pl_sd) > iPc->get_group_level(sd) && !pc_has_permission(sd, PC_PERM_WHO_DISPLAY_AID))
+ (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))
) {
clif->message(fd, msg_txt(3)); // Character not found.
return false;
@@ -501,7 +501,7 @@ ACMD(jumpto)
return false;
}
- iPc->setpos(sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT);
+ pc->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);
@@ -533,13 +533,13 @@ ACMD(jump)
}
if ((x || y) && iMap->getcell(sd->bl.m, x, y, CELL_CHKNOPASS))
- { //This is to prevent the iPc->setpos call from printing an error.
+ { //This is to prevent the pc->setpos call from printing an error.
clif->message(fd, msg_txt(2));
if (!iMap->search_freecell(NULL, sd->bl.m, &x, &y, 10, 10, 1))
x = y = 0; //Invalid cell, use random spot.
}
- iPc->setpos(sd, sd->mapindex, x, y, CLR_TELEPORT);
+ pc->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;
@@ -580,12 +580,12 @@ ACMD(who)
else if (strstr(command, "3") != NULL)
display_type = 3;
- level = iPc->get_group_level(sd);
+ level = pc->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)) && iPc->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)) && pc->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,
- iPc->job_name(pl_sd->status.class_)); // "| Lv:%d/%d | Job: %s"
+ pc->job_name(pl_sd->status.class_)); // "| Lv:%d/%d | Job: %s"
break;
}
case 3: {
@@ -674,12 +674,12 @@ ACMD(whogm)
match_text[j] = TOLOWER(match_text[j]);
count = 0;
- level = iPc->get_group_level(sd);
+ level = pc->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 = iPc->get_group_level(pl_sd);
+ pl_level = pc->get_group_level(pl_sd);
if (!pl_level)
continue;
@@ -708,7 +708,7 @@ ACMD(whogm)
sprintf(atcmd_output, msg_txt(915), // BLvl: %d | Job: %s (Lvl: %d)
pl_sd->status.base_level,
- iPc->job_name(pl_sd->status.class_), pl_sd->status.job_level);
+ pc->job_name(pl_sd->status.class_), pl_sd->status.job_level);
clif->message(fd, atcmd_output);
p = iParty->search(pl_sd->status.party_id);
@@ -741,7 +741,7 @@ ACMD(save)
{
nullpo_retr(-1, sd);
- iPc->setsavepoint(sd, sd->mapindex, sd->bl.x, sd->bl.y);
+ pc->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);
@@ -771,7 +771,7 @@ ACMD(load)
return false;
}
- iPc->setpos(sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, CLR_OUTSIGHT);
+ pc->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;
- iPc->setoption(sd, param3);
+ pc->setoption(sd, param3);
clif->message(fd, msg_txt(9)); // Options changed.
@@ -911,7 +911,7 @@ 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 = iTimer->add_timer( iTimer->gettick() + 200, iPc->calc_pvprank_timer, sd->bl.id, 0 );
+ sd->pvp_timer = iTimer->add_timer( iTimer->gettick() + 200, pc->calc_pvprank_timer, sd->bl.id, 0 );
}
//bugreport:2266
iMap->foreachinmovearea(clif->insight, &sd->bl, AREA_SIZE, sd->bl.x, sd->bl.y, BL_ALL, &sd->bl);
@@ -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
- iTimer->delete_timer( sd->pvp_timer, iPc->calc_pvprank_timer );
+ iTimer->delete_timer( sd->pvp_timer, pc->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, iPc->job_name(i), 16) == 0) {
+ if (strncmpi(message, pc->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, iPc->job_name(i), 16) == 0) {
+ if (strncmpi(message, pc->job_name(i), 16) == 0) {
job = i;
found = true;
}
@@ -982,7 +982,7 @@ ACMD(jobchange)
if (pcdb_checkid(job))
{
- if (iPc->jobchange(sd, job, upper) == 0)
+ if (pc->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.
@@ -1166,7 +1166,7 @@ ACMD(item)
item_tmp.nameid = item_id;
item_tmp.identify = 1;
- if ((flag = iPc->additem(sd, &item_tmp, get_count, LOG_TYPE_COMMAND)))
+ if ((flag = pc->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 = iPc->additem(sd, &item_tmp, get_count, LOG_TYPE_COMMAND)))
+ if ((flag = pc->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) {
- iPc->delitem(sd, i, sd->status.inventory[i].amount, 0, 0, LOG_TYPE_COMMAND);
+ pc->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 >= iPc->maxbaselv(sd)) { // check for max level by Valaris
+ if (sd->status.base_level >= pc->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 > iPc->maxbaselv(sd) || (unsigned int)level > iPc->maxbaselv(sd) - sd->status.base_level) // fix positiv overflow
- level = iPc->maxbaselv(sd) - sd->status.base_level;
+ 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;
for (i = 0; i < level; i++)
- status_point += iPc->gets_status_point(sd->status.base_level + i);
+ status_point += pc->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 += iPc->gets_status_point(sd->status.base_level + i - 1);
+ status_point += pc->gets_status_point(sd->status.base_level + i - 1);
if (sd->status.status_point < status_point)
- iPc->resetstate(sd);
+ pc->resetstate(sd);
if (sd->status.status_point < status_point)
sd->status.status_point = 0;
else
@@ -1325,7 +1325,7 @@ ACMD(baselevelup)
clif->updatestatus(sd, SP_BASEEXP);
clif->updatestatus(sd, SP_NEXTBASEEXP);
status_calc_pc(sd, 0);
- iPc->baselevelchanged(sd);
+ pc->baselevelchanged(sd);
if(sd->status.party_id)
iParty->send_levelup(sd);
return true;
@@ -1346,12 +1346,12 @@ ACMD(joblevelup)
return false;
}
if (level > 0) {
- if (sd->status.job_level >= iPc->maxjoblv(sd)) {
+ if (sd->status.job_level >= pc->maxjoblv(sd)) {
clif->message(fd, msg_txt(23)); // Job level can't go any higher.
return false;
}
- 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;
+ 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;
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)
- iPc->resetskill(sd,0); //Reset skills since we need to substract more points.
+ pc->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) {
- iTimer->delete_timer(sd->pvp_timer, iPc->calc_pvprank_timer);
+ iTimer->delete_timer(sd->pvp_timer, pc->calc_pvprank_timer);
sd->pvp_timer = INVALID_TIMER;
}
return 0;
@@ -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 = iTimer->add_timer(iTimer->gettick() + 200, iPc->calc_pvprank_timer, sd->bl.id, 0);
+ sd->pvp_timer = iTimer->add_timer(iTimer->gettick() + 200, pc->calc_pvprank_timer, sd->bl.id, 0);
sd->pvp_rank = 0;
sd->pvp_lastusers = 0;
sd->pvp_point = 5;
@@ -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) {
- iPc->changelook(sd, LOOK_HAIR, hair_style);
- iPc->changelook(sd, LOOK_HAIR_COLOR, hair_color);
- iPc->changelook(sd, LOOK_CLOTHES_COLOR, 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);
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) {
- iPc->changelook(sd, LOOK_CLOTHES_COLOR, cloth_color);
+ pc->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) {
- iPc->changelook(sd, LOOK_HAIR, hair_style);
+ pc->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) {
- iPc->changelook(sd, LOOK_HAIR_COLOR, hair_color);
+ pc->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.
@@ -1873,7 +1873,7 @@ ACMD(go)
clif->message(fd, msg_txt(248));
return false;
}
- if (iPc->setpos(sd, mapindex_name2id(data[town].map), data[town].x, data[town].y, CLR_TELEPORT) == 0) {
+ if (pc->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.
@@ -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;
- iPc->unequipitem(sd, i, 3);
+ pc->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);
- iPc->equipitem(sd, i, current_position);
+ pc->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 = iPc->additem(sd, &tmp_item, 1, LOG_TYPE_COMMAND)))
+ if ((flag = pc->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;
}
- iPc->memo(sd, position);
+ pc->memo(sd, position);
return true;
}
@@ -2361,12 +2361,12 @@ ACMD(zeny)
}
if(zeny > 0){
- if((ret=iPc->getzeny(sd,zeny,LOG_TYPE_COMMAND,NULL)) == 1)
+ if((ret=pc->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=iPc->payzeny(sd,-zeny,LOG_TYPE_COMMAND,NULL)) == 1)
+ if((ret=pc->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
@@ -2707,7 +2707,7 @@ ACMD(recall) {
return false;
}
- if ( iPc->get_group_level(sd) < iPc->get_group_level(pl_sd) )
+ if ( pc->get_group_level(sd) < pc->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;
}
- iPc->setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN);
+ pc->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) && !iPc->can_use_command(sd, "@unban") ) {
+ if( timestamp <= time(NULL) && !pc->can_use_command(sd, "@unban") ) {
clif->message(fd,msg_txt(1023)); // You are not allowed to reduce the length of a ban.
return false;
}
@@ -2899,7 +2899,7 @@ ACMD(night)
nullpo_retr(-1, sd);
if (iMap->night_flag != 1) {
- iPc->map_night_timer(iPc->night_timer_tid, 0, 0, 1);
+ pc->map_night_timer(pc->night_timer_tid, 0, 0, 1);
} else {
clif->message(fd, msg_txt(89)); // Night mode is already enabled.
return false;
@@ -2916,7 +2916,7 @@ ACMD(day)
nullpo_retr(-1, sd);
if (iMap->night_flag != 0) {
- iPc->map_day_timer(iPc->day_timer_tid, 0, 0, 1);
+ pc->map_day_timer(pc->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 && iPc->get_group_level(sd) >= iPc->get_group_level(pl_sd))
+ if (pl_sd->fd != fd && pc->get_group_level(sd) >= pc->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 && iPc->get_group_level(sd) >= iPc->get_group_level(pl_sd))
+ if (pl_sd->fd != fd && sd->bl.m == pl_sd->bl.m && pc->get_group_level(sd) >= pc->get_group_level(pl_sd))
{
status_kill(&pl_sd->bl);
clif->specialeffect(&pl_sd->bl,450,AREA);
@@ -3053,7 +3053,7 @@ ACMD(kick)
return false;
}
- if ( iPc->get_group_level(sd) < iPc->get_group_level(pl_sd) )
+ if ( pc->get_group_level(sd) < pc->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 (iPc->get_group_level(sd) >= iPc->get_group_level(pl_sd)) { // you can kick only lower or same gm level
+ if (pc->get_group_level(sd) >= pc->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);
- iPc->allskillup(sd); // all skills
+ pc->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 (iPc->checkskill2(sd, index) > 0) {
+ if (pc->checkskill2(sd, index) > 0) {
clif->message(fd, msg_txt(196)); // You already have this quest skill.
return false;
}
- iPc->skill(sd, skill_id, 1, 0);
+ pc->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 (iPc->checkskill2(sd, index) == 0) {
+ if (pc->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 )
- iPc->delspiritball(sd, sd->spiritball, 1);
+ pc->delspiritball(sd, sd->spiritball, 1);
sd->spiritball = number;
clif->spiritball(&sd->bl);
// no message, player can look the difference
@@ -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 && iPc->get_group_level(sd) >= iPc->get_group_level(pl_sd))
+ if (sd->status.account_id != pl_sd->status.account_id && pc->get_group_level(sd) >= pc->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
- iPc->setstand(pl_sd);
- iPc->setrestartvalue(pl_sd,1);
+ pc->setstand(pl_sd);
+ pc->setrestartvalue(pl_sd,1);
}
- iPc->setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN);
+ pc->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 (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))
+ 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))
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
- iPc->setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN);
+ pc->setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN);
}
}
mapit->free(iter);
@@ -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 (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))
+ 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))
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
- iPc->setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN);
+ pc->setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN);
}
}
mapit->free(iter);
@@ -3708,7 +3708,7 @@ ACMD(reloadstatusdb)
*------------------------------------------*/
ACMD(reloadpcdb)
{
- iPc->readdb();
+ pc->readdb();
clif->message(fd, msg_txt(257));
return true;
}
@@ -4001,47 +4001,47 @@ ACMD(mount_peco)
return false;
}
- if( (sd->class_&MAPID_THIRDMASK) == MAPID_RUNE_KNIGHT && iPc->checkskill(sd,RK_DRAGONTRAINING) > 0 ) {
+ if( (sd->class_&MAPID_THIRDMASK) == MAPID_RUNE_KNIGHT && pc->checkskill(sd,RK_DRAGONTRAINING) > 0 ) {
if( !(sd->sc.option&OPTION_DRAGON1) ) {
clif->message(sd->fd,msg_txt(1119)); // You have mounted your Dragon.
- iPc->setoption(sd, sd->sc.option|OPTION_DRAGON1);
+ pc->setoption(sd, sd->sc.option|OPTION_DRAGON1);
} else {
clif->message(sd->fd,msg_txt(1120)); // You have released your Dragon.
- iPc->setoption(sd, sd->sc.option&~OPTION_DRAGON1);
+ pc->setoption(sd, sd->sc.option&~OPTION_DRAGON1);
}
return true;
}
- if( (sd->class_&MAPID_THIRDMASK) == MAPID_RANGER && iPc->checkskill(sd,RA_WUGRIDER) > 0 ) {
+ if( (sd->class_&MAPID_THIRDMASK) == MAPID_RANGER && pc->checkskill(sd,RA_WUGRIDER) > 0 ) {
if( !pc_isridingwug(sd) ) {
clif->message(sd->fd,msg_txt(1121)); // You have mounted your Warg.
- iPc->setoption(sd, sd->sc.option|OPTION_WUGRIDER);
+ pc->setoption(sd, sd->sc.option|OPTION_WUGRIDER);
} else {
clif->message(sd->fd,msg_txt(1122)); // You have released your Warg.
- iPc->setoption(sd, sd->sc.option&~OPTION_WUGRIDER);
+ pc->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.
- iPc->setoption(sd, sd->sc.option|OPTION_MADOGEAR);
+ pc->setoption(sd, sd->sc.option|OPTION_MADOGEAR);
} else {
clif->message(sd->fd,msg_txt(1124)); // You have released your Mado Gear.
- iPc->setoption(sd, sd->sc.option&~OPTION_MADOGEAR);
+ pc->setoption(sd, sd->sc.option&~OPTION_MADOGEAR);
}
return true;
}
if (!pc_isriding(sd)) { // if actually no peco
- if (!iPc->checkskill(sd, KN_RIDING)) {
+ if (!pc->checkskill(sd, KN_RIDING)) {
clif->message(fd, msg_txt(213)); // You can not mount a Peco Peco with your current job.
return false;
}
- iPc->setoption(sd, sd->sc.option | OPTION_RIDING);
+ pc->setoption(sd, sd->sc.option | OPTION_RIDING);
clif->message(fd, msg_txt(102)); // You have mounted a Peco Peco.
} else {//Dismount
- iPc->setoption(sd, sd->sc.option & ~OPTION_RIDING);
+ pc->setoption(sd, sd->sc.option & ~OPTION_RIDING);
clif->message(fd, msg_txt(214)); // You have released your Peco Peco.
}
@@ -4176,7 +4176,7 @@ ACMD(nuke)
}
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
+ 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, iTimer->gettick(), 0);
clif->message(fd, msg_txt(109)); // Player has been nuked!
} else {
@@ -4209,7 +4209,7 @@ ACMD(tonpc)
}
if ((nd = npc_name2id(npcname)) != NULL) {
- if (iPc->setpos(sd, map_id2index(nd->bl.m), nd->bl.x, nd->bl.y, CLR_TELEPORT) == 0)
+ if (pc->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;
@@ -4390,7 +4390,7 @@ ACMD(servertime)
clif->message(fd, msg_txt(232)); // Game time: The game is in permanent night.
} else if (battle_config.night_duration == 0)
if (iMap->night_flag == 1) { // we start with night
- timer_data = iTimer->get_timer(iPc->day_timer_tid);
+ timer_data = iTimer->get_timer(pc->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.
@@ -4398,7 +4398,7 @@ ACMD(servertime)
clif->message(fd, msg_txt(231)); // Game time: The game is in permanent daylight.
else if (battle_config.day_duration == 0)
if (iMap->night_flag == 0) { // we start with day
- timer_data = iTimer->get_timer(iPc->night_timer_tid);
+ timer_data = iTimer->get_timer(pc->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.
@@ -4406,8 +4406,8 @@ ACMD(servertime)
clif->message(fd, msg_txt(232)); // Game time: The game is in permanent night.
else {
if (iMap->night_flag == 0) {
- timer_data = iTimer->get_timer(iPc->night_timer_tid);
- timer_data2 = iTimer->get_timer(iPc->day_timer_tid);
+ timer_data = iTimer->get_timer(pc->night_timer_tid);
+ timer_data2 = iTimer->get_timer(pc->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)
@@ -4418,8 +4418,8 @@ 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 = iTimer->get_timer(iPc->day_timer_tid);
- timer_data2 = iTimer->get_timer(iPc->night_timer_tid);
+ timer_data = iTimer->get_timer(pc->day_timer_tid);
+ timer_data2 = iTimer->get_timer(pc->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)
@@ -4486,7 +4486,7 @@ ACMD(jail)
return false;
}
- if (iPc->get_group_level(sd) < iPc->get_group_level(pl_sd))
+ if (pc->get_group_level(sd) < pc->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;
@@ -4538,7 +4538,7 @@ ACMD(unjail)
return false;
}
- if (iPc->get_group_level(sd) < iPc->get_group_level(pl_sd)) { // you can jail only lower or same GM
+ if (pc->get_group_level(sd) < pc->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;
@@ -4618,7 +4618,7 @@ ACMD(jailfor)
return false;
}
- if (iPc->get_group_level(pl_sd) > iPc->get_group_level(sd)) {
+ if (pc->get_group_level(pl_sd) > pc->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;
}
- iPc->disguise(sd, id);
+ pc->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) )
- iPc->disguise(pl_sd, mob_id);
+ pc->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) )
- iPc->disguise(pl_sd, id);
+ pc->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) {
- iPc->disguise(sd, -1);
+ pc->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 )
- iPc->disguise(pl_sd, -1);
+ pc->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 )
- iPc->disguise(pl_sd, -1);
+ pc->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 = iPc->nextbaseexp(sd);
+ nextb = pc->nextbaseexp(sd);
if (nextb)
nextb = sd->status.base_exp*100.0/nextb;
- nextj = iPc->nextjobexp(sd);
+ nextj = pc->nextjobexp(sd);
if (nextj)
nextj = sd->status.job_exp*100.0/nextj;
@@ -5158,7 +5158,7 @@ ACMD(follow)
if (sd->followtarget == -1)
return false;
- iPc->stop_following (sd);
+ pc->stop_following (sd);
clif->message(fd, msg_txt(1159)); // Follow mode OFF.
return true;
}
@@ -5170,10 +5170,10 @@ ACMD(follow)
}
if (sd->followtarget == pl_sd->bl.id) {
- iPc->stop_following (sd);
+ pc->stop_following (sd);
clif->message(fd, msg_txt(1159)); // Follow mode OFF.
} else {
- iPc->follow(sd, pl_sd->bl.id);
+ pc->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)
- iPc->unequipitem(sd, i, 3);
- iPc->dropitem(sd, i, sd->status.inventory[i].amount);
+ pc->unequipitem(sd, i, 3);
+ pc->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)
- iPc->unequipitem(sd, i, 3);
+ pc->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)
- iPc->cart_delitem(sd, i, sd->status.cart[i].amount, 1, LOG_TYPE_OTHER);
+ pc->cart_delitem(sd, i, sd->status.cart[i].amount, 1, LOG_TYPE_OTHER);
clif->clearcart(fd);
clif->updatestatus(sd,SP_CARTINFO);
@@ -5387,7 +5387,7 @@ ACMD(useskill)
return false;
}
- if ( iPc->get_group_level(sd) < iPc->get_group_level(pl_sd) )
+ if ( pc->get_group_level(sd) < pc->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;
@@ -5457,10 +5457,10 @@ ACMD(skilltree)
return false;
}
- c = iPc->calc_skilltree_normalize_job(pl_sd);
- c = iPc->mapid2jobid(c, pl_sd->status.sex);
+ c = pc->calc_skilltree_normalize_job(pl_sd);
+ c = pc->mapid2jobid(c, pl_sd->status.sex);
- 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).
+ sprintf(atcmd_output, msg_txt(1168), pc->job_name(c), pc->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 && iPc->checkskill(sd,ent->need[j].id) < ent->need[j].lv)
+ if( ent->need[j].id && pc->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,7 +5503,7 @@ 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 = iPc->additem(sd,&item_tmp,1,LOG_TYPE_COMMAND))) {
+ if((flag = pc->additem(sd,&item_tmp,1,LOG_TYPE_COMMAND))) {
clif->additem(sd,0,0,flag);
iMap->addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
@@ -5530,7 +5530,7 @@ ACMD(marry)
return false;
}
- if (iPc->marriage(sd, pl_sd) == 0) {
+ if (pc->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 (iPc->divorce(sd) != 0) {
+ if (pc->divorce(sd) != 0) {
sprintf(atcmd_output, msg_txt(1175), sd->status.name); // '%s' is not married.
clif->message(fd, atcmd_output);
return false;
@@ -6294,8 +6294,8 @@ ACMD(users)
*------------------------------------------*/
ACMD(reset)
{
- iPc->resetstate(sd);
- iPc->resetskill(sd,1);
+ pc->resetstate(sd);
+ pc->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;
@@ -6487,10 +6487,10 @@ ACMD(changesex)
{
int i;
nullpo_retr(-1, sd);
- iPc->resetskill(sd,4);
+ pc->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 ) iPc->unequipitem(sd, sd->equip_index[i], 3);
+ if( sd->equip_index[i] >= 0 ) pc->unequipitem(sd, sd->equip_index[i], 3);
chrif_changesex(sd);
return true;
}
@@ -6515,7 +6515,7 @@ ACMD(mute)
return false;
}
- if ( iPc->get_group_level(sd) < iPc->get_group_level(pl_sd) )
+ if ( pc->get_group_level(sd) < pc->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;
@@ -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 && !iPc->get_group_level(pl_sd)) {
+ if (id != bl->id && !pc->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);
@@ -7371,7 +7371,7 @@ ACMD(size)
if(sd->state.size) {
sd->state.size = SZ_SMALL;
- iPc->setpos(sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_TELEPORT);
+ pc->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;
- iPc->setpos(pl_sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT);
+ pc->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;
- iPc->setpos(pl_sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT);
+ pc->setpos(pl_sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT);
}
pl_sd->state.size = size;
@@ -7820,13 +7820,13 @@ ACMD(cash)
if( !strcmpi(command+1,"cash") )
{
if( value > 0 ) {
- if( (ret=iPc->getcash(sd, value, 0)) >= 0){
+ if( (ret=pc->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=iPc->paycash(sd, -value, 0)) >= 0){
+ if( (ret=pc->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=iPc->getcash(sd, 0, value)) >= 0){
+ if( (ret=pc->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=iPc->paycash(sd, -value, -value)) >= 0){
+ if( (ret=pc->paycash(sd, -value, -value)) >= 0){
sprintf(output, msg_txt(411), ret, sd->kafraPoints);
clif->disp_onlyself(sd, output, strlen(output));
}
@@ -7869,7 +7869,7 @@ ACMD(clone)
return true;
}
- if(iPc->get_group_level(pl_sd) > iPc->get_group_level(sd)) {
+ if(pc->get_group_level(pl_sd) > pc->get_group_level(sd)) {
clif->message(fd, msg_txt(126)); // Cannot clone a player of higher GM level than yourself.
return true;
}
@@ -7948,7 +7948,7 @@ ACMD(request)
*------------------------------------------*/
ACMD(feelreset)
{
- iPc->resetfeel(sd);
+ pc->resetfeel(sd);
clif->message(fd, msg_txt(1324)); // Reset 'Feeling' maps.
return true;
@@ -8020,7 +8020,7 @@ ACMD(resetstat)
{
nullpo_retr(-1, sd);
- iPc->resetstate(sd);
+ pc->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);
- iPc->resetskill(sd,1);
+ pc->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", iPc->job_name(sd->status.class_), "(level %d)");
+ sprintf(job_jobname, "Job - %s %s", pc->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 = iPc->search_inventory(sd, nameid) ) != -1 )
+ while( amount && ( idx = pc->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]));
}
- iPc->delitem(sd, idx, delamount, 0, 0, LOG_TYPE_COMMAND);
+ pc->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, iPc->get_group_level(sd), query );
+ intif_request_accinfo( sd->fd, sd->bl.id, pc->get_group_level(sd), query );
return true;
}
@@ -8519,7 +8519,7 @@ ACMD(set) {
switch( reg[0] ) {
case '@':
- data->u.str = iPc->readregstr(sd, add_str(reg));
+ data->u.str = pc->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 = iPc->readreg(sd, add_str(reg));
+ data->u.num = pc->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 = iPc->checkskill(sd, MC_PUSHCART) ? false : true;
+ bool need_skill = pc->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( iPc->setcart(sd, val) ) {
+ if( pc->setcart(sd, val) ) {
if( need_skill ) {
MC_CART_MDFY(0,index);
}
@@ -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 && iPc->get_group_level(sd) < map[sd->bl.m].nocommand ) {
+ if ( map[sd->bl.m].nocommand && pc->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( !iPc->get_group_level(sd) ) {
+ if( !pc->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,8 +9881,8 @@ 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 && iPc->get_group_level(sd) >= binding->group_lv) ||
- (*atcmd_msg == atcommand->char_symbol && iPc->get_group_level(sd) >= binding->group_lv_char)))
+ ((*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)))
{
// Check if self or character invoking; if self == character invoked, then self invoke.
bool invokeFlag = ((*atcmd_msg == atcommand->at_symbol) ? 1 : 0);
@@ -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( iPc->get_group_level(sd) ) { // TODO: remove or replace with proper permission
+ if( pc->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);
diff --git a/src/map/battle.c b/src/map/battle.c
index 9348c62cd..9dac36671 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -882,7 +882,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
if(sc->data[SC_DODGE] && ( !sc->opt1 || sc->opt1 == OPT1_BURNING ) &&
(flag&BF_LONG || sc->data[SC_SPURT])
&& rnd()%100 < 20) {
- if (sd && pc_issit(sd)) iPc->setstand(sd); //Stand it to dodge.
+ if (sd && pc_issit(sd)) pc->setstand(sd); //Stand it to dodge.
clif->skill_nodamage(bl,bl,TK_DODGE,1,1);
if (!sc->data[SC_COMBO])
sc_start4(bl, SC_COMBO, 100, TK_JUMPKICK, src->id, 1, 0, 2000);
@@ -1131,7 +1131,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
status_heal(src, damage*sce->val4/100, 0, 3);
if( sd && (sce = sc->data[SC_FORCEOFVANGUARD]) && flag&BF_WEAPON && rnd()%100 < sce->val2 )
- iPc->addspiritball(sd,skill->get_time(LG_FORCEOFVANGUARD,sce->val1),sce->val3);
+ pc->addspiritball(sd,skill->get_time(LG_FORCEOFVANGUARD,sce->val1),sce->val3);
if (sc->data[SC_STYLE_CHANGE] && rnd()%2) {
TBL_HOM *hd = BL_CAST(BL_HOM,bl);
if (hd) homun->addspiritball(hd, 10); //add a sphere
@@ -1256,7 +1256,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
else if( element == -3 ) //Use random element
element = rnd()%ELE_MAX;
if( element == ELE_FIRE || element == ELE_WATER )
- iPc->overheat(sd,element == ELE_FIRE ? 1 : -1);
+ pc->overheat(sd,element == ELE_FIRE ? 1 : -1);
}
}
@@ -1363,19 +1363,19 @@ int battle_addmastery(struct map_session_data *sd,struct block_list *target,int
nullpo_ret(sd);
- if((skill = iPc->checkskill(sd,AL_DEMONBANE)) > 0 &&
+ if((skill = pc->checkskill(sd,AL_DEMONBANE)) > 0 &&
target->type == BL_MOB && //This bonus doesnt work against players.
(battle->check_undead(status->race,status->def_ele) || status->race==RC_DEMON) )
damage += (skill*(int)(3+(sd->status.base_level+1)*0.05)); // submitted by orn
//damage += (skill * 3);
- if( (skill = iPc->checkskill(sd, RA_RANGERMAIN)) > 0 && (status->race == RC_BRUTE || status->race == RC_PLANT || status->race == RC_FISH) )
+ if( (skill = pc->checkskill(sd, RA_RANGERMAIN)) > 0 && (status->race == RC_BRUTE || status->race == RC_PLANT || status->race == RC_FISH) )
damage += (skill * 5);
- if( (skill = iPc->checkskill(sd,NC_RESEARCHFE)) > 0 && (status->def_ele == ELE_FIRE || status->def_ele == ELE_EARTH) )
+ if( (skill = pc->checkskill(sd,NC_RESEARCHFE)) > 0 && (status->def_ele == ELE_FIRE || status->def_ele == ELE_EARTH) )
damage += (skill * 10);
if( pc_ismadogear(sd) )
- damage += 20 + 20 * iPc->checkskill(sd, NC_MADOLICENCE);
+ damage += 20 + 20 * pc->checkskill(sd, NC_MADOLICENCE);
- if((skill = iPc->checkskill(sd,HT_BEASTBANE)) > 0 && (status->race==RC_BRUTE || status->race==RC_INSECT) ) {
+ if((skill = pc->checkskill(sd,HT_BEASTBANE)) > 0 && (status->race==RC_BRUTE || status->race==RC_INSECT) ) {
damage += (skill * 4);
if (sd->sc.data[SC_SPIRIT] && sd->sc.data[SC_SPIRIT]->val2 == SL_HUNTER)
damage += sd->status.str;
@@ -1389,26 +1389,26 @@ int battle_addmastery(struct map_session_data *sd,struct block_list *target,int
{
case W_1HSWORD:
#ifdef RENEWAL
- if((skill = iPc->checkskill(sd,AM_AXEMASTERY)) > 0)
+ if((skill = pc->checkskill(sd,AM_AXEMASTERY)) > 0)
damage += (skill * 3);
#endif
case W_DAGGER:
- if((skill = iPc->checkskill(sd,SM_SWORD)) > 0)
+ if((skill = pc->checkskill(sd,SM_SWORD)) > 0)
damage += (skill * 4);
- if((skill = iPc->checkskill(sd,GN_TRAINING_SWORD)) > 0)
+ if((skill = pc->checkskill(sd,GN_TRAINING_SWORD)) > 0)
damage += skill * 10;
break;
case W_2HSWORD:
#ifdef RENEWAL
- if((skill = iPc->checkskill(sd,AM_AXEMASTERY)) > 0)
+ if((skill = pc->checkskill(sd,AM_AXEMASTERY)) > 0)
damage += (skill * 3);
#endif
- if((skill = iPc->checkskill(sd,SM_TWOHAND)) > 0)
+ if((skill = pc->checkskill(sd,SM_TWOHAND)) > 0)
damage += (skill * 4);
break;
case W_1HSPEAR:
case W_2HSPEAR:
- if((skill = iPc->checkskill(sd,KN_SPEARMASTERY)) > 0) {
+ if((skill = pc->checkskill(sd,KN_SPEARMASTERY)) > 0) {
if(!pc_isriding(sd))
damage += (skill * 4);
else
@@ -1417,40 +1417,40 @@ int battle_addmastery(struct map_session_data *sd,struct block_list *target,int
break;
case W_1HAXE:
case W_2HAXE:
- if((skill = iPc->checkskill(sd,AM_AXEMASTERY)) > 0)
+ if((skill = pc->checkskill(sd,AM_AXEMASTERY)) > 0)
damage += (skill * 3);
- if((skill = iPc->checkskill(sd,NC_TRAININGAXE)) > 0)
+ if((skill = pc->checkskill(sd,NC_TRAININGAXE)) > 0)
damage += (skill * 5);
break;
case W_MACE:
case W_2HMACE:
- if((skill = iPc->checkskill(sd,PR_MACEMASTERY)) > 0)
+ if((skill = pc->checkskill(sd,PR_MACEMASTERY)) > 0)
damage += (skill * 3);
- if((skill = iPc->checkskill(sd,NC_TRAININGAXE)) > 0)
+ if((skill = pc->checkskill(sd,NC_TRAININGAXE)) > 0)
damage += (skill * 5);
break;
case W_FIST:
- if((skill = iPc->checkskill(sd,TK_RUN)) > 0)
+ if((skill = pc->checkskill(sd,TK_RUN)) > 0)
damage += (skill * 10);
// No break, fallthrough to Knuckles
case W_KNUCKLE:
- if((skill = iPc->checkskill(sd,MO_IRONHAND)) > 0)
+ if((skill = pc->checkskill(sd,MO_IRONHAND)) > 0)
damage += (skill * 3);
break;
case W_MUSICAL:
- if((skill = iPc->checkskill(sd,BA_MUSICALLESSON)) > 0)
+ if((skill = pc->checkskill(sd,BA_MUSICALLESSON)) > 0)
damage += (skill * 3);
break;
case W_WHIP:
- if((skill = iPc->checkskill(sd,DC_DANCINGLESSON)) > 0)
+ if((skill = pc->checkskill(sd,DC_DANCINGLESSON)) > 0)
damage += (skill * 3);
break;
case W_BOOK:
- if((skill = iPc->checkskill(sd,SA_ADVANCEDBOOK)) > 0)
+ if((skill = pc->checkskill(sd,SA_ADVANCEDBOOK)) > 0)
damage += (skill * 3);
break;
case W_KATAR:
- if((skill = iPc->checkskill(sd,AS_KATAR)) > 0)
+ if((skill = pc->checkskill(sd,AS_KATAR)) > 0)
damage += (skill * 3);
break;
}
@@ -1567,7 +1567,7 @@ void battle_consume_ammo(TBL_PC*sd, int skill_id, int lv) {
}
if(sd->equip_index[EQI_AMMO]>=0) //Qty check should have been done in skill_check_condition
- iPc->delitem(sd,sd->equip_index[EQI_AMMO],qty,0,1,LOG_TYPE_CONSUME);
+ pc->delitem(sd,sd->equip_index[EQI_AMMO],qty,0,1,LOG_TYPE_CONSUME);
sd->state.arrow_atk = 0;
}
@@ -1817,7 +1817,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
}
if( sd && !skill_id ) { //Check for double attack.
- if( ( ( skill_lv = iPc->checkskill(sd,TF_DOUBLE) ) > 0 && sd->weapontype1 == W_DAGGER )
+ if( ( ( skill_lv = pc->checkskill(sd,TF_DOUBLE) ) > 0 && sd->weapontype1 == W_DAGGER )
|| ( sd->bonus.double_rate > 0 && sd->weapontype1 != W_FIST ) //Will fail bare-handed
|| ( sc && sc->data[SC_KAGEMUSYA] && sd->weapontype1 != W_FIST )) // Need confirmation
{ //Success chance is not added, the higher one is used [Skotlex]
@@ -1827,7 +1827,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
wd.type = 0x08;
}
}
- else if( sd->weapontype1 == W_REVOLVER && (skill_lv = iPc->checkskill(sd,GS_CHAINACTION)) > 0 && rnd()%100 < 5*skill_lv )
+ else if( sd->weapontype1 == W_REVOLVER && (skill_lv = pc->checkskill(sd,GS_CHAINACTION)) > 0 && rnd()%100 < 5*skill_lv )
{
wd.div_ = skill->get_num(GS_CHAINACTION,skill_lv);
wd.type = 0x08;
@@ -1970,7 +1970,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
hitrate += sd->bonus.arrow_hit;
#ifdef RENEWAL
if( sd ) //in Renewal hit bonus from Vultures Eye is not anymore shown in status window
- hitrate += iPc->checkskill(sd,AC_VULTURE);
+ hitrate += pc->checkskill(sd,AC_VULTURE);
#endif
if(skill_id)
switch(skill_id)
@@ -2003,14 +2003,14 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
hitrate += hitrate * 5 * skill_lv / 100;
break;
case AS_SONICBLOW:
- if(sd && iPc->checkskill(sd,AS_SONICACCEL)>0)
+ if(sd && pc->checkskill(sd,AS_SONICACCEL)>0)
hitrate += hitrate * 50 / 100;
break;
case MC_CARTREVOLUTION:
case GN_CART_TORNADO:
case GN_CARTCANNON:
- if( sd && iPc->checkskill(sd, GN_REMODELING_CART) )
- hitrate += iPc->checkskill(sd, GN_REMODELING_CART) * 4;
+ if( sd && pc->checkskill(sd, GN_REMODELING_CART) )
+ hitrate += pc->checkskill(sd, GN_REMODELING_CART) * 4;
break;
case GC_VENOMPRESSURE:
hitrate += 10 + 4 * skill_lv;
@@ -2019,11 +2019,11 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
if( sd ) {
// Weaponry Research hidden bonus
- if ((temp = iPc->checkskill(sd,BS_WEAPONRESEARCH)) > 0)
+ if ((temp = pc->checkskill(sd,BS_WEAPONRESEARCH)) > 0)
hitrate += hitrate * ( 2 * temp ) / 100;
if( (sd->status.weapon == W_1HSWORD || sd->status.weapon == W_DAGGER) &&
- (temp = iPc->checkskill(sd, GN_TRAINING_SWORD))>0 )
+ (temp = pc->checkskill(sd, GN_TRAINING_SWORD))>0 )
hitrate += 3 * temp;
}
@@ -2147,7 +2147,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
if(flag.cri && sd->bonus.crit_atk_rate)
ATK_ADDRATE(sd->bonus.crit_atk_rate);
- if(sd->status.party_id && (temp=iPc->checkskill(sd,TK_POWER)) > 0){
+ if(sd->status.party_id && (temp=pc->checkskill(sd,TK_POWER)) > 0){
if( (i = party_foreachsamemap(iParty->sub_count, sd, 0)) > 1 ) // exclude the player himself [Inkfish]
ATK_ADDRATE(2*temp*i);
}
@@ -2393,7 +2393,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
case AS_SPLASHER:
skillratio += 400+50*skill_lv;
if(sd)
- skillratio += 20 * iPc->checkskill(sd,AS_POISONREACT);
+ skillratio += 20 * pc->checkskill(sd,AS_POISONREACT);
break;
case ASC_BREAKER:
skillratio += 100*skill_lv-100;
@@ -2524,7 +2524,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
if( index >= 0 && sd->inventory_data[index]
&& sd->inventory_data[index]->type == IT_WEAPON )
skillratio += max(10000 - sd->inventory_data[index]->weight, 0) / 10;
- skillratio += 50 * iPc->checkskill(sd,LK_SPIRALPIERCE);
+ skillratio += 50 * pc->checkskill(sd,LK_SPIRALPIERCE);
} // (1 + [(Casters Base Level - 100) / 200])
skillratio = skillratio * (100 + (status_get_lv(src)-100) / 2) / 100;
break;
@@ -2554,10 +2554,10 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
}
break;
case RK_STORMBLAST:
- skillratio = 100 * (sd ? iPc->checkskill(sd,RK_RUNEMASTERY) : 1) + 100 * (sstatus->int_ / 4);
+ skillratio = 100 * (sd ? pc->checkskill(sd,RK_RUNEMASTERY) : 1) + 100 * (sstatus->int_ / 4);
break;
case RK_PHANTOMTHRUST:
- skillratio = 50 * skill_lv + 10 * ( sd ? iPc->checkskill(sd,KN_SPEARMASTERY) : 10);
+ skillratio = 50 * skill_lv + 10 * ( sd ? pc->checkskill(sd,KN_SPEARMASTERY) : 10);
//if( s_level > 100 ) skillratio += skillratio * s_level / 150; // Base level bonus. This is official, but is disabled until I can confirm something with was changed or not. [Rytech]
//if( s_level > 100 ) skillratio += skillratio * (s_level - 100) / 200; // Base level bonus.
break;
@@ -2682,7 +2682,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
RE_LVL_DMOD(100);
break;
case LG_BANISHINGPOINT:
- skillratio += -100 + ((50 * skill_lv) + (30 * ((sd)?iPc->checkskill(sd,SM_BASH):1)));
+ skillratio += -100 + ((50 * skill_lv) + (30 * ((sd)?pc->checkskill(sd,SM_BASH):1)));
RE_LVL_DMOD(100);
break;
case LG_SHIELDPRESS:
@@ -2710,11 +2710,11 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
skillratio += 2400; //2500%
break;
case LG_MOONSLASHER:
- skillratio += -100 + (120 * skill_lv + ((sd) ? iPc->checkskill(sd,LG_OVERBRAND) : 5) * 80);
+ skillratio += -100 + (120 * skill_lv + ((sd) ? pc->checkskill(sd,LG_OVERBRAND) : 5) * 80);
RE_LVL_DMOD(100);
break;
case LG_OVERBRAND:
- skillratio = 400 * skill_lv + (iPc->checkskill(sd,CR_SPEARQUICKEN) * 30);
+ skillratio = 400 * skill_lv + (pc->checkskill(sd,CR_SPEARQUICKEN) * 30);
RE_LVL_DMOD(100);
break;
case LG_OVERBRAND_BRANDISH:
@@ -2818,7 +2818,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
break;
case WM_REVERBERATION_MELEE:
// ATK [{(Skill Level x 100) + 300} x Caster Base Level / 100]
- skillratio += 200 + 100 * iPc->checkskill(sd, WM_REVERBERATION);
+ skillratio += 200 + 100 * pc->checkskill(sd, WM_REVERBERATION);
RE_LVL_DMOD(100);
break;
case WM_SEVERE_RAINSTORM_MELEE:
@@ -2841,12 +2841,12 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
// ATK [( Skill Level x 50 ) + ( Cart Weight / ( 150 - Caster Base STR ))] + ( Cart Remodeling Skill Level x 50 )] %
skillratio = 50 * skill_lv;
if( sd && sd->cart_weight)
- skillratio += sd->cart_weight/10 / max(150-sstatus->str,1) + iPc->checkskill(sd, GN_REMODELING_CART) * 50;
+ skillratio += sd->cart_weight/10 / max(150-sstatus->str,1) + pc->checkskill(sd, GN_REMODELING_CART) * 50;
break;
case GN_CARTCANNON:
// ATK [{( Cart Remodeling Skill Level x 50 ) x ( INT / 40 )} + ( Cart Cannon Skill Level x 60 )] %
skillratio = 60 * skill_lv;
- if( sd ) skillratio += iPc->checkskill(sd, GN_REMODELING_CART) * 50 * (sstatus->int_ / 40);
+ if( sd ) skillratio += pc->checkskill(sd, GN_REMODELING_CART) * 50 * (sstatus->int_ / 40);
break;
case GN_SPORE_EXPLOSION:
skillratio += 200 + 100 * skill_lv;
@@ -2874,7 +2874,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
skillratio += 300; // Bombs
break;
case SO_VARETYR_SPEAR://ATK [{( Striking Level x 50 ) + ( Varetyr Spear Skill Level x 50 )} x Caster Base Level / 100 ] %
- skillratio = 50 * skill_lv + ( sd ? iPc->checkskill(sd, SO_STRIKING) * 50 : 0 );
+ skillratio = 50 * skill_lv + ( sd ? pc->checkskill(sd, SO_STRIKING) * 50 : 0 );
if( sc && sc->data[SC_BLAST_OPTION] )
skillratio += sd ? sd->status.job_level * 5 : 0;
break;
@@ -2917,7 +2917,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
skillratio += 100 * (skill_lv-1);
break;
case KO_BAKURETSU:
- skillratio = 50 * skill_lv * (sd?iPc->checkskill(sd,NJ_TOBIDOUGU):10);
+ skillratio = 50 * skill_lv * (sd?pc->checkskill(sd,NJ_TOBIDOUGU):10);
break;
case MH_NEEDLE_OF_PARALYZE:
skillratio += 600 + 100 * skill_lv;
@@ -2951,7 +2951,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
case TK_JUMPKICK:
//TK_RUN kick damage bonus.
if(sd && sd->weapontype1 == W_FIST && sd->weapontype2 == W_FIST)
- ATK_ADD(10*iPc->checkskill(sd, TK_RUN));
+ ATK_ADD(10*pc->checkskill(sd, TK_RUN));
break;
case GS_MAGICALBULLET:
if(sstatus->matk_max>sstatus->matk_min) {
@@ -2976,7 +2976,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
#endif
case HT_FREEZINGTRAP:
if(sd)
- ATK_ADD( 40 * iPc->checkskill(sd, RA_RESEARCHTRAP) );
+ ATK_ADD( 40 * pc->checkskill(sd, RA_RESEARCHTRAP) );
break;
case RA_WUGDASH ://(Caster Current Weight x 10 / 8)
if( sd && sd->weight )
@@ -2984,7 +2984,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
case RA_WUGSTRIKE:
case RA_WUGBITE:
if(sd)
- ATK_ADD(30*iPc->checkskill(sd, RA_TOOTHOFWUG));
+ ATK_ADD(30*pc->checkskill(sd, RA_TOOTHOFWUG));
break;
case SR_GATEOFHELL:
ATK_ADD (sstatus->max_hp - status_get_hp(src));
@@ -3020,7 +3020,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
if( i < 5 ){
s_ele = i;
ATK_ADDRATE(100 * sd->talisman[i]);// +100% custom value.
- iPc->del_talisman(sd, sd->talisman[i], i);
+ pc->del_talisman(sd, sd->talisman[i], i);
}
}
break;
@@ -3072,7 +3072,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
sc->data[SC_SPIRIT]->val2 == SL_ASSASIN)
ATK_ADDRATE(map_flag_gvg(src->m)?25:100); //+25% dmg on woe/+100% dmg on nonwoe
- if(sd && iPc->checkskill(sd,AS_SONICACCEL)>0)
+ if(sd && pc->checkskill(sd,AS_SONICACCEL)>0)
ATK_ADDRATE(10);
break;
case CR_SHIELDBOOMERANG:
@@ -3090,7 +3090,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
ATK_RATE(i);
if( sd ) {
- if (skill_id && (i = iPc->skillatk_bonus(sd, skill_id)))
+ if (skill_id && (i = pc->skillatk_bonus(sd, skill_id)))
ATK_ADDRATE(i);
if( skill_id != PA_SACRIFICE && skill_id != MO_INVESTIGATE && skill_id != CR_GRANDCROSS && skill_id != NPC_GRANDDARKNESS && skill_id != PA_SHIELDCHAIN && !flag.cri )
@@ -3199,9 +3199,9 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
vit_def = def2;
#endif
if((battle->check_undead(sstatus->race,sstatus->def_ele) || sstatus->race==RC_DEMON) && //This bonus already doesnt work vs players
- src->type == BL_MOB && (temp=iPc->checkskill(tsd,AL_DP)) > 0)
+ src->type == BL_MOB && (temp=pc->checkskill(tsd,AL_DP)) > 0)
vit_def += temp*(int)(3 +(tsd->status.base_level+1)*0.04); // submitted by orn
- if( src->type == BL_MOB && (temp=iPc->checkskill(tsd,RA_RANGERMAIN))>0 &&
+ if( src->type == BL_MOB && (temp=pc->checkskill(tsd,RA_RANGERMAIN))>0 &&
(sstatus->race == RC_BRUTE || sstatus->race == RC_FISH || sstatus->race == RC_PLANT) )
vit_def += temp*5;
#ifdef RENEWAL
@@ -3307,7 +3307,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
skill_id != CR_GRANDCROSS)
{ //Add mastery damage
if(skill_id != ASC_BREAKER && sd->status.weapon == W_KATAR &&
- (temp=iPc->checkskill(sd,ASC_KATAR)) > 0)
+ (temp=pc->checkskill(sd,ASC_KATAR)) > 0)
{ //Adv Katar Mastery is does not applies to ASC_BREAKER,
// but other masteries DO apply >_>
ATK_ADDRATE(10+ 2*temp);
@@ -3320,14 +3320,14 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
if (sc && sc->data[SC_MIRACLE]) i = 2; //Star anger
else
ARR_FIND(0, MAX_PC_FEELHATE, i, t_class == sd->hate_mob[i]);
- if (i < MAX_PC_FEELHATE && (temp=iPc->checkskill(sd,sg_info[i].anger_id))) {
+ if (i < MAX_PC_FEELHATE && (temp=pc->checkskill(sd,sg_info[i].anger_id))) {
skillratio = sd->status.base_level + sstatus->dex + sstatus->luk;
if (i == 2) skillratio += sstatus->str; //Star Anger
if (temp<4)
skillratio /= 12-3*temp;
ATK_ADDRATE(skillratio);
}
- if (skill_id == NJ_SYURIKEN && (temp = iPc->checkskill(sd,NJ_TOBIDOUGU)) > 0) {
+ if (skill_id == NJ_SYURIKEN && (temp = pc->checkskill(sd,NJ_TOBIDOUGU)) > 0) {
ATK_ADD(3*temp);
} else if (skill_id == NJ_KUNAI)
ATK_ADD(60);
@@ -3336,7 +3336,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
else if(wd.div_ < 0) //Since the attack missed...
wd.div_ *= -1;
- if(sd && (temp=iPc->checkskill(sd,BS_WEAPONRESEARCH)) > 0)
+ if(sd && (temp=pc->checkskill(sd,BS_WEAPONRESEARCH)) > 0)
ATK_ADD(temp*2);
if(skill_id==TF_POISON)
@@ -3454,21 +3454,21 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
flag.lh=0;
} else if(flag.rh && flag.lh) { //Dual-wield
if (wd.damage) {
- if( (temp = iPc->checkskill(sd,AS_RIGHT)) )
+ if( (temp = pc->checkskill(sd,AS_RIGHT)) )
ATK_RATER(50 + (temp * 10))
- else if( (temp = iPc->checkskill(sd,KO_RIGHT)) )
+ else if( (temp = pc->checkskill(sd,KO_RIGHT)) )
ATK_RATER(70 + (temp * 10))
if(wd.damage < 1) wd.damage = 1;
}
if (wd.damage2) {
- if( (temp = iPc->checkskill(sd,AS_LEFT)) )
+ if( (temp = pc->checkskill(sd,AS_LEFT)) )
ATK_RATEL(30 + (temp * 10))
- else if( (temp = iPc->checkskill(sd,KO_LEFT)) )
+ else if( (temp = pc->checkskill(sd,KO_LEFT)) )
ATK_RATEL(50 + (temp * 10))
if(wd.damage2 < 1) wd.damage2 = 1;
}
} else if(sd->status.weapon == W_KATAR && !skill_id) { //Katars (offhand damage only applies to normal attacks, tested on Aegis 10.2)
- temp = iPc->checkskill(sd,TF_DOUBLE);
+ temp = pc->checkskill(sd,TF_DOUBLE);
wd.damage2 = wd.damage * (1 + (temp * 2))/100;
if(wd.damage && !wd.damage2) wd.damage2 = 1;
@@ -3962,7 +3962,7 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
skillratio += 1900; //2000%
break;
case WM_METALICSOUND:
- skillratio += 120 * skill_lv + 60 * ( sd? iPc->checkskill(sd, WM_LESSON) : 10 ) - 100;
+ skillratio += 120 * skill_lv + 60 * ( sd? pc->checkskill(sd, WM_LESSON) : 10 ) - 100;
break;
/*case WM_SEVERE_RAINSTORM:
skillratio += 50 * skill_lv;
@@ -3973,7 +3973,7 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
*/
case WM_REVERBERATION_MAGIC:
// MATK [{(Skill Level x 100) + 100} x Casters Base Level / 100] %
- skillratio += 100 * (sd ? iPc->checkskill(sd, WM_REVERBERATION) : 1);
+ skillratio += 100 * (sd ? pc->checkskill(sd, WM_REVERBERATION) : 1);
RE_LVL_DMOD(100);
break;
case SO_FIREWALK:
@@ -3989,13 +3989,13 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
skillratio += sd ? sd->status.job_level / 2 : 0;
break;
case SO_EARTHGRAVE:
- skillratio = ( 200 * ( sd ? iPc->checkskill(sd, SA_SEISMICWEAPON) : 10 ) + sstatus->int_ * skill_lv );
+ skillratio = ( 200 * ( sd ? pc->checkskill(sd, SA_SEISMICWEAPON) : 10 ) + sstatus->int_ * skill_lv );
RE_LVL_DMOD(100);
if( sc && sc->data[SC_CURSED_SOIL_OPTION] )
skillratio += sc->data[SC_CURSED_SOIL_OPTION]->val2;
break;
case SO_DIAMONDDUST:
- skillratio = ( 200 * ( sd ? iPc->checkskill(sd, SA_FROSTWEAPON) : 10 ) + sstatus->int_ * skill_lv );
+ skillratio = ( 200 * ( sd ? pc->checkskill(sd, SA_FROSTWEAPON) : 10 ) + sstatus->int_ * skill_lv );
RE_LVL_DMOD(100);
if( sc && sc->data[SC_COOLER_OPTION] )
skillratio += sc->data[SC_COOLER_OPTION]->val3;
@@ -4020,7 +4020,7 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
}
break;
case SO_VARETYR_SPEAR: //MATK [{( Endow Tornado skill level x 50 ) + ( Caster INT x Varetyr Spear Skill level )} x Caster Base Level / 100 ] %
- skillratio = status_get_int(src) * skill_lv + ( sd ? iPc->checkskill(sd, SA_LIGHTNINGLOADER) * 50 : 0 );
+ skillratio = status_get_int(src) * skill_lv + ( sd ? pc->checkskill(sd, SA_LIGHTNINGLOADER) * 50 : 0 );
RE_LVL_DMOD(100);
if( sc && sc->data[SC_BLAST_OPTION] )
skillratio += sd ? sd->status.job_level * 5 : 0;
@@ -4109,7 +4109,7 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
#endif
if(sd) {
//Damage bonuses
- if ((i = iPc->skillatk_bonus(sd, skill_id)))
+ if ((i = pc->skillatk_bonus(sd, skill_id)))
ad.damage += ad.damage*i/100;
if( (i = battle->adjust_skill_damage(src->m,skill_id)) )
@@ -4285,7 +4285,7 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
case HT_CLAYMORETRAP:
md.damage = skill_lv * sstatus->dex * (3+status_get_lv(src)/100) * (1+sstatus->int_/35);
md.damage += md.damage * (rnd()%20-10) / 100;
- md.damage += 40 * (sd?iPc->checkskill(sd,RA_RESEARCHTRAP):0);
+ md.damage += 40 * (sd?pc->checkskill(sd,RA_RESEARCHTRAP):0);
break;
#else
case HT_LANDMINE:
@@ -4302,7 +4302,7 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
case HT_BLITZBEAT:
case SN_FALCONASSAULT:
//Blitz-beat Damage.
- if(!sd || (temp = iPc->checkskill(sd,HT_STEELCROW)) <= 0)
+ if(!sd || (temp = pc->checkskill(sd,HT_STEELCROW)) <= 0)
temp=0;
md.damage=(sstatus->dex/10+sstatus->int_/2+temp*3+40)*2;
if(mflag > 1) //Autocasted Blitz.
@@ -4323,7 +4323,7 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
case BA_DISSONANCE:
md.damage=30+skill_lv*10;
if (sd)
- md.damage+= 3*iPc->checkskill(sd,BA_MUSICALLESSON);
+ md.damage+= 3*pc->checkskill(sd,BA_MUSICALLESSON);
break;
case NPC_SELFDESTRUCTION:
md.damage = sstatus->hp;
@@ -4382,7 +4382,7 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
case RK_DRAGONBREATH:
md.damage = ((status_get_hp(src) / 50) + (status_get_max_sp(src) / 4)) * skill_lv;
RE_LVL_MDMOD(150);
- if (sd) md.damage = md.damage * (100 + 5 * (iPc->checkskill(sd,RK_DRAGONTRAINING) - 1)) / 100;
+ if (sd) md.damage = md.damage * (100 + 5 * (pc->checkskill(sd,RK_DRAGONTRAINING) - 1)) / 100;
md.flag |= BF_LONG|BF_WEAPON;
break;
/**
@@ -4395,7 +4395,7 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
RE_LVL_TMDMOD();
if(sd)
{
- int researchskill_lv = iPc->checkskill(sd,RA_RESEARCHTRAP);
+ int researchskill_lv = pc->checkskill(sd,RA_RESEARCHTRAP);
if(researchskill_lv)
md.damage = md.damage * 20 * researchskill_lv / (skill_id == RA_CLUSTERBOMB?50:100);
else
@@ -4410,7 +4410,7 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
case NC_SELFDESTRUCTION:
{
short totaldef = tstatus->def2 + (short)status_get_def(target);
- md.damage = ( (sd?iPc->checkskill(sd,NC_MAINFRAME):10) + 8 ) * ( skill_lv + 1 ) * ( status_get_sp(src) + sstatus->vit );
+ md.damage = ( (sd?pc->checkskill(sd,NC_MAINFRAME):10) + 8 ) * ( skill_lv + 1 ) * ( status_get_sp(src) + sstatus->vit );
RE_LVL_MDMOD(100);
md.damage += status_get_hp(src) - totaldef;
}
@@ -4420,7 +4420,7 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
break;
case GN_HELLS_PLANT_ATK:
//[{( Hell Plant Skill Level x Casters Base Level ) x 10 } + {( Casters INT x 7 ) / 2 } x { 18 + ( Casters Job Level / 4 )] x ( 5 / ( 10 - Summon Flora Skill Level ))
- md.damage = ( skill_lv * status_get_lv(src) * 10 ) + ( sstatus->int_ * 7 / 2 ) * ( 18 + (sd?sd->status.job_level:0) / 4 ) * ( 5 / (10 - (sd?iPc->checkskill(sd,AM_CANNIBALIZE):0)) );
+ md.damage = ( skill_lv * status_get_lv(src) * 10 ) + ( sstatus->int_ * 7 / 2 ) * ( 18 + (sd?sd->status.job_level:0) / 4 ) * ( 5 / (10 - (sd?pc->checkskill(sd,AM_CANNIBALIZE):0)) );
break;
case KO_HAPPOKUNAI:
{
@@ -4475,7 +4475,7 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
hitrate+= sstatus->hit - flee;
#ifdef RENEWAL
if( sd ) //in Renewal hit bonus from Vultures Eye is not anymore shown in status window
- hitrate += iPc->checkskill(sd,AC_VULTURE);
+ hitrate += pc->checkskill(sd,AC_VULTURE);
#endif
hitrate = cap_value(hitrate, battle_config.min_hitrate, battle_config.max_hitrate);
@@ -4508,7 +4508,7 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
#endif
md.damage = battle->calc_cardfix(BF_MISC, src, target, nk, s_ele, 0, md.damage, 0, md.flag);
- if (sd && (i = iPc->skillatk_bonus(sd, skill_id)))
+ if (sd && (i = pc->skillatk_bonus(sd, skill_id)))
md.damage += md.damage*i/100;
if( (i = battle->adjust_skill_damage(src->m,skill_id)) )
@@ -4559,7 +4559,7 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
if( sd ) {
if ( md.damage > sd->status.zeny )
md.damage = sd->status.zeny;
- iPc->payzeny(sd, md.damage,LOG_TYPE_STEAL,NULL);
+ pc->payzeny(sd, md.damage,LOG_TYPE_STEAL,NULL);
}
break;
}
@@ -4852,7 +4852,7 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
uint16 skill_lv = tsc->data[SC_BLADESTOP_WAIT]->val1;
int duration = skill->get_time2(MO_BLADESTOP,skill_lv);
status_change_end(target, SC_BLADESTOP_WAIT, INVALID_TIMER);
- if(sc_start4(src, SC_BLADESTOP, 100, sd?iPc->checkskill(sd, MO_BLADESTOP):5, 0, 0, target->id, duration))
+ if(sc_start4(src, SC_BLADESTOP, 100, sd?pc->checkskill(sd, MO_BLADESTOP):5, 0, 0, target->id, duration))
{ //Target locked.
clif->damage(src, target, tick, sstatus->amotion, 1, 0, 1, 0, 0); //Display MISS.
clif->bladestop(target, src->id, 1);
@@ -4861,7 +4861,7 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
}
}
- if(sd && (skillv = iPc->checkskill(sd,MO_TRIPLEATTACK)) > 0) {
+ if(sd && (skillv = pc->checkskill(sd,MO_TRIPLEATTACK)) > 0) {
int triple_rate= 30 - skillv; //Base Rate
if (sc && sc->data[SC_SKILLRATE_UP] && sc->data[SC_SKILLRATE_UP]->val1 == MO_TRIPLEATTACK) {
triple_rate+= triple_rate*(sc->data[SC_SKILLRATE_UP]->val2)/100;
@@ -4900,13 +4900,13 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
}
if( sc->data[SC_GT_ENERGYGAIN] ) {
if( sd && rnd()%100 < 10 + 5 * sc->data[SC_GT_ENERGYGAIN]->val1)
- iPc->addspiritball(sd,
+ pc->addspiritball(sd,
skill->get_time(MO_CALLSPIRITS, sc->data[SC_GT_ENERGYGAIN]->val1),
sc->data[SC_GT_ENERGYGAIN]->val1);
}
if( tsc && tsc->data[SC_GT_ENERGYGAIN] ) {
if( tsd && rnd()%100 < 10 + 5 * tsc->data[SC_GT_ENERGYGAIN]->val1)
- iPc->addspiritball(tsd,
+ pc->addspiritball(tsd,
skill->get_time(MO_CALLSPIRITS, tsc->data[SC_GT_ENERGYGAIN]->val1),
tsc->data[SC_GT_ENERGYGAIN]->val1);
}
@@ -4940,7 +4940,7 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
wd.damage *= 3; // Triple Damage
if( sd && sc->data[SC_FEARBREEZE] && sc->data[SC_FEARBREEZE]->val4 > 0 && sd->status.inventory[sd->equip_index[EQI_AMMO]].amount >= sc->data[SC_FEARBREEZE]->val4 && battle_config.arrow_decrement){
- iPc->delitem(sd,sd->equip_index[EQI_AMMO],sc->data[SC_FEARBREEZE]->val4,0,1,LOG_TYPE_CONSUME);
+ pc->delitem(sd,sd->equip_index[EQI_AMMO],sc->data[SC_FEARBREEZE]->val4,0,1,LOG_TYPE_CONSUME);
sc->data[SC_FEARBREEZE]->val4 = 0;
}
}
diff --git a/src/map/battleground.c b/src/map/battleground.c
index 47fef4376..233679dfc 100644
--- a/src/map/battleground.c
+++ b/src/map/battleground.c
@@ -65,7 +65,7 @@ int bg_team_warp(int bg_id, unsigned short mapindex, short x, short y)
struct battleground_data *bg = bg_team_search(bg_id);
if( bg == NULL ) return 0;
for( i = 0; i < MAX_BG_MEMBERS; i++ )
- if( bg->members[i].sd != NULL ) iPc->setpos(bg->members[i].sd, mapindex, x, y, CLR_TELEPORT);
+ if( bg->members[i].sd != NULL ) pc->setpos(bg->members[i].sd, mapindex, x, y, CLR_TELEPORT);
return 1;
}
@@ -145,7 +145,7 @@ int bg_member_respawn(struct map_session_data *sd)
return 0;
if( bg->mapindex == 0 )
return 0; // Respawn not handled by Core
- iPc->setpos(sd, bg->mapindex, bg->x, bg->y, CLR_OUTSIGHT);
+ pc->setpos(sd, bg->mapindex, bg->x, bg->y, CLR_OUTSIGHT);
status_revive(&sd->bl, 1, 100);
return 1; // Warped
diff --git a/src/map/buyingstore.c b/src/map/buyingstore.c
index 0fed57d37..764b51015 100644
--- a/src/map/buyingstore.c
+++ b/src/map/buyingstore.c
@@ -100,7 +100,7 @@ void buyingstore_create(struct map_session_data* sd, int zenylimit, unsigned cha
return;
}
- if( !iPc->can_give_items(sd) )
+ if( !pc->can_give_items(sd) )
{// custom: GM is not allowed to buy (give zeny)
sd->buyingstore.slots = 0;
clif->message(sd->fd, msg_txt(246));
@@ -147,7 +147,7 @@ void buyingstore_create(struct map_session_data* sd, int zenylimit, unsigned cha
break;
}
- if( !id->flag.buyingstore || !itemdb_cantrade_sub(id, iPc->get_group_level(sd), iPc->get_group_level(sd)) || ( idx = iPc->search_inventory(sd, nameid) ) == -1 )
+ if( !id->flag.buyingstore || !itemdb_cantrade_sub(id, pc->get_group_level(sd), pc->get_group_level(sd)) || ( idx = pc->search_inventory(sd, nameid) ) == -1 )
{// restrictions: allowed, no character-bound items and at least one must be owned
break;
}
@@ -221,7 +221,7 @@ void buyingstore_open(struct map_session_data* sd, int account_id)
return;
}
- if( !iPc->can_give_items(sd) )
+ if( !pc->can_give_items(sd) )
{// custom: GM is not allowed to sell
clif->message(sd->fd, msg_txt(246));
return;
@@ -259,7 +259,7 @@ void buyingstore_trade(struct map_session_data* sd, int account_id, unsigned int
return;
}
- if( !iPc->can_give_items(sd) )
+ if( !pc->can_give_items(sd) )
{// custom: GM is not allowed to sell
clif->message(sd->fd, msg_txt(246));
clif->buyingstore_trade_failed_seller(sd, BUYINGSTORE_TRADE_SELLER_FAILED, 0);
@@ -314,7 +314,7 @@ void buyingstore_trade(struct map_session_data* sd, int account_id, unsigned int
return;
}
- if( sd->status.inventory[index].expire_time || !itemdb_cantrade(&sd->status.inventory[index], iPc->get_group_level(sd), iPc->get_group_level(pl_sd)) || memcmp(sd->status.inventory[index].card, buyingstore_blankslots, sizeof(buyingstore_blankslots)) )
+ if( sd->status.inventory[index].expire_time || !itemdb_cantrade(&sd->status.inventory[index], pc->get_group_level(sd), pc->get_group_level(pl_sd)) || memcmp(sd->status.inventory[index].card, buyingstore_blankslots, sizeof(buyingstore_blankslots)) )
{// non-tradable item
clif->buyingstore_trade_failed_seller(sd, BUYINGSTORE_TRADE_SELLER_FAILED, nameid);
return;
@@ -333,7 +333,7 @@ void buyingstore_trade(struct map_session_data* sd, int account_id, unsigned int
return;
}
- if( iPc->checkadditem(pl_sd, nameid, amount) == ADDITEM_OVERAMOUNT )
+ if( pc->checkadditem(pl_sd, nameid, amount) == ADDITEM_OVERAMOUNT )
{// buyer does not have enough space for this item
clif->buyingstore_trade_failed_seller(sd, BUYINGSTORE_TRADE_SELLER_FAILED, nameid);
return;
@@ -369,13 +369,13 @@ void buyingstore_trade(struct map_session_data* sd, int account_id, unsigned int
zeny = amount*pl_sd->buyingstore.items[listidx].price;
// move item
- iPc->additem(pl_sd, &sd->status.inventory[index], amount, LOG_TYPE_BUYING_STORE);
- iPc->delitem(sd, index, amount, 1, 0, LOG_TYPE_BUYING_STORE);
+ pc->additem(pl_sd, &sd->status.inventory[index], amount, LOG_TYPE_BUYING_STORE);
+ pc->delitem(sd, index, amount, 1, 0, LOG_TYPE_BUYING_STORE);
pl_sd->buyingstore.items[listidx].amount-= amount;
// pay up
- iPc->payzeny(pl_sd, zeny, LOG_TYPE_BUYING_STORE, sd);
- iPc->getzeny(sd, zeny, LOG_TYPE_BUYING_STORE, pl_sd);
+ pc->payzeny(pl_sd, zeny, LOG_TYPE_BUYING_STORE, sd);
+ pc->getzeny(sd, zeny, LOG_TYPE_BUYING_STORE, pl_sd);
pl_sd->buyingstore.zenylimit-= zeny;
// notify clients
diff --git a/src/map/chrif.c b/src/map/chrif.c
index 8a70b4931..9f3a07680 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -53,7 +53,7 @@ static const int packet_len_table[0x3d] = { // U - used, F - free
//2af9: Incoming, chrif_connectack -> 'answer of the 2af8 login(ok / fail)'
//2afa: Outgoing, chrif_sendmap -> 'sending our maps'
//2afb: Incoming, chrif_sendmapack -> 'Maps received successfully / or not ..'
-//2afc: Outgoing, chrif_scdata_request -> request sc_data for iPc->authok'ed char. <- new command reuses previous one.
+//2afc: Outgoing, chrif_scdata_request -> request sc_data for pc->authok'ed char. <- new command reuses previous one.
//2afd: Incoming, chrif_authok -> 'client authentication ok'
//2afe: Outgoing, send_usercount_tochar -> 'sends player count of this map server to charserver'
//2aff: Outgoing, send_users_tochar -> 'sends all actual connected character ids to charserver'
@@ -272,7 +272,7 @@ int chrif_isconnected(void) {
int chrif_save(struct map_session_data *sd, int flag) {
nullpo_retr(-1, sd);
- iPc->makesavestatus(sd);
+ pc->makesavestatus(sd);
if (flag && sd->state.active) { //Store player data which is quitting
//FIXME: SC are lost if there's no connection at save-time because of the way its related data is cleared immediately after this function. [Skotlex]
@@ -484,7 +484,7 @@ static int chrif_reconnect(DBKey key, DBData *data, va_list ap) {
switch (node->state) {
case ST_LOGIN:
if ( node->sd && node->char_dat == NULL ) {//Since there is no way to request the char auth, make it fail.
- iPc->authfail(node->sd);
+ pc->authfail(node->sd);
chrif_char_offline(node->sd);
chrif_auth_delete(node->account_id, node->char_id, ST_LOGIN);
}
@@ -645,10 +645,10 @@ void chrif_authok(int fd) {
node->char_id == char_id &&
node->login_id1 == login_id1 )
{ //Auth Ok
- if (iPc->authok(sd, login_id2, expiration_time, group_id, status, changing_mapservers))
+ if (pc->authok(sd, login_id2, expiration_time, group_id, status, changing_mapservers))
return;
} else { //Auth Failed
- iPc->authfail(sd);
+ pc->authfail(sd);
}
chrif_char_offline(sd); //Set him offline, the char server likely has it set as online already.
@@ -949,14 +949,14 @@ int chrif_divorceack(int char_id, int partner_id) {
sd->status.partner_id = 0;
for(i = 0; i < MAX_INVENTORY; i++)
if (sd->status.inventory[i].nameid == WEDDING_RING_M || sd->status.inventory[i].nameid == WEDDING_RING_F)
- iPc->delitem(sd, i, 1, 0, 0, LOG_TYPE_OTHER);
+ pc->delitem(sd, i, 1, 0, 0, LOG_TYPE_OTHER);
}
if( ( sd = iMap->charid2sd(partner_id) ) != NULL && sd->status.partner_id == char_id ) {
sd->status.partner_id = 0;
for(i = 0; i < MAX_INVENTORY; i++)
if (sd->status.inventory[i].nameid == WEDDING_RING_M || sd->status.inventory[i].nameid == WEDDING_RING_F)
- iPc->delitem(sd, i, 1, 0, 0, LOG_TYPE_OTHER);
+ pc->delitem(sd, i, 1, 0, 0, LOG_TYPE_OTHER);
}
return 0;
diff --git a/src/map/clif.c b/src/map/clif.c
index 39ffdd23d..50a228859 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -1763,7 +1763,7 @@ void clif_buylist(struct map_session_data *sd, struct npc_data *nd)
if( id == NULL )
continue;
WFIFOL(fd, 4+c*11) = val;
- WFIFOL(fd, 8+c*11) = iPc->modifybuyvalue(sd,val);
+ WFIFOL(fd, 8+c*11) = pc->modifybuyvalue(sd,val);
WFIFOB(fd,12+c*11) = itemtype(id->type);
WFIFOW(fd,13+c*11) = ( id->view_id > 0 ) ? id->view_id : id->nameid;
c++;
@@ -1806,7 +1806,7 @@ void clif_selllist(struct map_session_data *sd)
{
if( sd->status.inventory[i].nameid > 0 && sd->inventory_data[i] )
{
- if( !itemdb_cansell(&sd->status.inventory[i], iPc->get_group_level(sd)) )
+ if( !itemdb_cansell(&sd->status.inventory[i], pc->get_group_level(sd)) )
continue;
if( sd->status.inventory[i].expire_time )
@@ -1817,7 +1817,7 @@ void clif_selllist(struct map_session_data *sd)
continue;
WFIFOW(fd,4+c*10)=i+2;
WFIFOL(fd,6+c*10)=val;
- WFIFOL(fd,10+c*10)=iPc->modifysellvalue(sd,val);
+ WFIFOL(fd,10+c*10)=pc->modifysellvalue(sd,val);
c++;
}
}
@@ -2233,7 +2233,7 @@ void clif_additem(struct map_session_data *sd, int n, int amount, int fail) {
p.IsDamaged = sd->status.inventory[n].attribute;
p.refiningLevel =sd->status.inventory[n].refine;
clif->addcards2(&p.slot.card[0], &sd->status.inventory[n]);
- p.location = iPc->equippoint(sd,n);
+ p.location = pc->equippoint(sd,n);
p.type = itemtype(sd->inventory_data[n]->type);
#if PACKETVER >= 20061218
p.HireExpireDate = sd->status.inventory[n].expire_time;
@@ -2353,7 +2353,7 @@ void clif_inventorylist(struct map_session_data *sd) {
if( !itemdb_isstackable2(sd->inventory_data[i]) )
{ //Non-stackable (Equippable)
WBUFW(bufe,ne*se+4)=i+2;
- clif->item_sub(bufe, ne*se+6, &sd->status.inventory[i], sd->inventory_data[i], iPc->equippoint(sd,i));
+ clif->item_sub(bufe, ne*se+6, &sd->status.inventory[i], sd->inventory_data[i], pc->equippoint(sd,i));
clif->addcards(WBUFP(bufe, ne*se+16), &sd->status.inventory[i]);
#if PACKETVER >= 20071002
WBUFL(bufe,ne*se+24)=sd->status.inventory[i].expire_time;
@@ -2443,7 +2443,7 @@ void clif_equiplist(struct map_session_data *sd)
continue;
//Equippable
WBUFW(buf,n*cmd+4)=i+2;
- clif->item_sub(buf, n*cmd+6, &sd->status.inventory[i], sd->inventory_data[i], iPc->equippoint(sd,i));
+ clif->item_sub(buf, n*cmd+6, &sd->status.inventory[i], sd->inventory_data[i], pc->equippoint(sd,i));
clif->addcards(WBUFP(buf, n*cmd+16), &sd->status.inventory[i]);
#if PACKETVER >= 20071002
WBUFL(buf,n*cmd+24)=sd->status.inventory[i].expire_time;
@@ -2980,9 +2980,9 @@ void clif_updatestatus(struct map_session_data *sd,int type)
switch(type){
// 00b0
case SP_WEIGHT:
- iPc->updateweightstatus(sd);
+ pc->updateweightstatus(sd);
WFIFOHEAD(fd,14);
- WFIFOW(fd,0)=0xb0; //Need to re-set as iPc->updateweightstatus can alter the buffer. [Skotlex]
+ WFIFOW(fd,0)=0xb0; //Need to re-set as pc->updateweightstatus can alter the buffer. [Skotlex]
WFIFOW(fd,2)=type;
WFIFOL(fd,4)=sd->weight;
break;
@@ -3092,11 +3092,11 @@ void clif_updatestatus(struct map_session_data *sd,int type)
break;
case SP_NEXTBASEEXP:
WFIFOW(fd,0)=0xb1;
- WFIFOL(fd,4)=iPc->nextbaseexp(sd);
+ WFIFOL(fd,4)=pc->nextbaseexp(sd);
break;
case SP_NEXTJOBEXP:
WFIFOW(fd,0)=0xb1;
- WFIFOL(fd,4)=iPc->nextjobexp(sd);
+ WFIFOL(fd,4)=pc->nextjobexp(sd);
break;
/**
@@ -3109,7 +3109,7 @@ void clif_updatestatus(struct map_session_data *sd,int type)
case SP_UDEX:
case SP_ULUK:
WFIFOW(fd,0)=0xbe;
- WFIFOB(fd,4)=iPc->need_status_point(sd,type-SP_USTR+SP_STR,1);
+ WFIFOB(fd,4)=pc->need_status_point(sd,type-SP_USTR+SP_STR,1);
len=5;
break;
@@ -3406,17 +3406,17 @@ void clif_initialstatus(struct map_session_data *sd) {
WBUFW(buf,0)=0xbd;
WBUFW(buf,2)=min(sd->status.status_point, INT16_MAX);
WBUFB(buf,4)=min(sd->status.str, UINT8_MAX);
- WBUFB(buf,5)=iPc->need_status_point(sd,SP_STR,1);
+ WBUFB(buf,5)=pc->need_status_point(sd,SP_STR,1);
WBUFB(buf,6)=min(sd->status.agi, UINT8_MAX);
- WBUFB(buf,7)=iPc->need_status_point(sd,SP_AGI,1);
+ WBUFB(buf,7)=pc->need_status_point(sd,SP_AGI,1);
WBUFB(buf,8)=min(sd->status.vit, UINT8_MAX);
- WBUFB(buf,9)=iPc->need_status_point(sd,SP_VIT,1);
+ WBUFB(buf,9)=pc->need_status_point(sd,SP_VIT,1);
WBUFB(buf,10)=min(sd->status.int_, UINT8_MAX);
- WBUFB(buf,11)=iPc->need_status_point(sd,SP_INT,1);
+ WBUFB(buf,11)=pc->need_status_point(sd,SP_INT,1);
WBUFB(buf,12)=min(sd->status.dex, UINT8_MAX);
- WBUFB(buf,13)=iPc->need_status_point(sd,SP_DEX,1);
+ WBUFB(buf,13)=pc->need_status_point(sd,SP_DEX,1);
WBUFB(buf,14)=min(sd->status.luk, UINT8_MAX);
- WBUFB(buf,15)=iPc->need_status_point(sd,SP_LUK,1);
+ WBUFB(buf,15)=pc->need_status_point(sd,SP_LUK,1);
WBUFW(buf,16) = pc_leftside_atk(sd);
WBUFW(buf,18) = pc_rightside_atk(sd);
@@ -3508,7 +3508,7 @@ void clif_arrow_create_list(struct map_session_data *sd)
for (i = 0, c = 0; i < MAX_SKILL_ARROW_DB; i++) {
if (skill_arrow_db[i].nameid > 0 &&
- (j = iPc->search_inventory(sd, skill_arrow_db[i].nameid)) >= 0 &&
+ (j = pc->search_inventory(sd, skill_arrow_db[i].nameid)) >= 0 &&
!sd->status.inventory[j].equip && sd->status.inventory[j].identify)
{
if ((j = itemdb_viewid(skill_arrow_db[i].nameid)) > 0)
@@ -5932,7 +5932,7 @@ void clif_wis_message(int fd, const char* nick, const char* mes, int mes_len)
WFIFOW(fd,2) = mes_len + NAME_LENGTH + 8;
safestrncpy((char*)WFIFOP(fd,4), nick, NAME_LENGTH);
WFIFOL(fd,28) = 0; // isAdmin; if nonzero, also displays text above char
- // TODO: WFIFOL(fd,28) = iPc->get_group_level(ssd);
+ // TODO: WFIFOL(fd,28) = pc->get_group_level(ssd);
safestrncpy((char*)WFIFOP(fd,32), mes, mes_len);
WFIFOSET(fd,WFIFOW(fd,2));
#endif
@@ -6167,14 +6167,14 @@ void clif_item_refine_list(struct map_session_data *sd)
nullpo_retv(sd);
- skill_lv = iPc->checkskill(sd,WS_WEAPONREFINE);
+ skill_lv = pc->checkskill(sd,WS_WEAPONREFINE);
fd=sd->fd;
refine_item[0] = -1;
- refine_item[1] = iPc->search_inventory(sd,1010);
- refine_item[2] = iPc->search_inventory(sd,1011);
- refine_item[3] = refine_item[4] = iPc->search_inventory(sd,984);
+ refine_item[1] = pc->search_inventory(sd,1010);
+ refine_item[2] = pc->search_inventory(sd,1011);
+ refine_item[3] = refine_item[4] = pc->search_inventory(sd,984);
WFIFOHEAD(fd, MAX_INVENTORY * 13 + 4);
WFIFOW(fd,0)=0x221;
@@ -7086,31 +7086,31 @@ void clif_autospell(struct map_session_data *sd,uint16 skill_lv)
WFIFOHEAD(fd,packet_len(0x1cd));
WFIFOW(fd, 0)=0x1cd;
- if(skill_lv>0 && iPc->checkskill(sd,MG_NAPALMBEAT)>0)
+ if(skill_lv>0 && pc->checkskill(sd,MG_NAPALMBEAT)>0)
WFIFOL(fd,2)= MG_NAPALMBEAT;
else
WFIFOL(fd,2)= 0x00000000;
- if(skill_lv>1 && iPc->checkskill(sd,MG_COLDBOLT)>0)
+ if(skill_lv>1 && pc->checkskill(sd,MG_COLDBOLT)>0)
WFIFOL(fd,6)= MG_COLDBOLT;
else
WFIFOL(fd,6)= 0x00000000;
- if(skill_lv>1 && iPc->checkskill(sd,MG_FIREBOLT)>0)
+ if(skill_lv>1 && pc->checkskill(sd,MG_FIREBOLT)>0)
WFIFOL(fd,10)= MG_FIREBOLT;
else
WFIFOL(fd,10)= 0x00000000;
- if(skill_lv>1 && iPc->checkskill(sd,MG_LIGHTNINGBOLT)>0)
+ if(skill_lv>1 && pc->checkskill(sd,MG_LIGHTNINGBOLT)>0)
WFIFOL(fd,14)= MG_LIGHTNINGBOLT;
else
WFIFOL(fd,14)= 0x00000000;
- if(skill_lv>4 && iPc->checkskill(sd,MG_SOULSTRIKE)>0)
+ if(skill_lv>4 && pc->checkskill(sd,MG_SOULSTRIKE)>0)
WFIFOL(fd,18)= MG_SOULSTRIKE;
else
WFIFOL(fd,18)= 0x00000000;
- if(skill_lv>7 && iPc->checkskill(sd,MG_FIREBALL)>0)
+ if(skill_lv>7 && pc->checkskill(sd,MG_FIREBALL)>0)
WFIFOL(fd,22)= MG_FIREBALL;
else
WFIFOL(fd,22)= 0x00000000;
- if(skill_lv>9 && iPc->checkskill(sd,MG_FROSTDIVER)>0)
+ if(skill_lv>9 && pc->checkskill(sd,MG_FROSTDIVER)>0)
WFIFOL(fd,26)= MG_FROSTDIVER;
else
WFIFOL(fd,26)= 0x00000000;
@@ -7149,7 +7149,7 @@ void clif_devotion(struct block_list *src, struct map_session_data *tsd)
for( i = 0; i < 5; i++ )
WBUFL(buf,6+4*i) = sd->devotion[i];
- WBUFW(buf,26) = skill->get_range2(src, CR_DEVOTION, iPc->checkskill(sd, CR_DEVOTION));
+ WBUFW(buf,26) = skill->get_range2(src, CR_DEVOTION, pc->checkskill(sd, CR_DEVOTION));
}
if( tsd )
@@ -8531,8 +8531,8 @@ void clif_refresh(struct map_session_data *sd)
if( disguised(&sd->bl) ) {/* refresh-da */
short disguise = sd->disguise;
- iPc->disguise(sd, -1);
- iPc->disguise(sd, disguise);
+ pc->disguise(sd, -1);
+ pc->disguise(sd, disguise);
}
}
@@ -8884,7 +8884,7 @@ void clif_feel_info(struct map_session_data* sd, unsigned char feel_level, unsig
void clif_hate_info(struct map_session_data *sd, unsigned char hate_level,int class_, unsigned char type)
{
if( pcdb_checkid(class_) ) {
- clif->starskill(sd, iPc->job_name(class_), class_, hate_level, type ? 10 : 11);
+ clif->starskill(sd, pc->job_name(class_), class_, hate_level, type ? 10 : 11);
} else if( mobdb_checkid(class_) ) {
clif->starskill(sd, mob_db(class_)->jname, class_, hate_level, type ? 10 : 11);
} else {
@@ -8935,7 +8935,7 @@ void clif_equiptickack(struct map_session_data* sd, int flag)
/// open equip window:
/// 0 = disabled
/// 1 = enabled
-void clif_equipcheckbox(struct map_session_data* sd)
+void clif_equpcheckbox(struct map_session_data* sd)
{
int fd;
nullpo_retv(sd);
@@ -8999,7 +8999,7 @@ void clif_viewequip_ack(struct map_session_data* sd, struct map_session_data* ts
// Inventory position
WBUFW(buf, n*s+43) = i + 2;
// Add refine, identify flag, element, etc.
- clif->item_sub(WBUFP(buf,0), n*s+45, &tsd->status.inventory[i], tsd->inventory_data[i], iPc->equippoint(tsd, i));
+ clif->item_sub(WBUFP(buf,0), n*s+45, &tsd->status.inventory[i], tsd->inventory_data[i], pc->equippoint(tsd, i));
// Add cards
clif->addcards(WBUFP(buf, n*s+55), &tsd->status.inventory[i]);
// Expiration date stuff, if all of those are set to 0 then the client doesn't show anything related (6 bytes)
@@ -9271,7 +9271,7 @@ void clif_parse_WantToConnection(int fd, struct map_session_data* sd) {
sd->fd = fd;
session[fd]->session_data = sd;
- iPc->setnewpc(sd, account_id, char_id, login_id1, client_tick, sex, fd);
+ pc->setnewpc(sd, account_id, char_id, login_id1, client_tick, sex, fd);
#if PACKETVER < 20070521
WFIFOHEAD(fd,4);
@@ -9317,7 +9317,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
return;
if (!sd->state.active) { //Character loading is not complete yet!
- //Let iPc->reg_received reinvoke this when ready.
+ //Let pc->reg_received reinvoke this when ready.
sd->state.connect_new = 0;
return;
}
@@ -9342,8 +9342,8 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
if(sd->vd.cloth_color)
clif->refreshlook(&sd->bl,sd->bl.id,LOOK_CLOTHES_COLOR,sd->vd.cloth_color,SELF);
// item
- clif->inventorylist(sd); // inventory list first, otherwise deleted items in iPc->checkitem show up as 'unknown item'
- iPc->checkitem(sd);
+ clif->inventorylist(sd); // inventory list first, otherwise deleted items in pc->checkitem show up as 'unknown item'
+ pc->checkitem(sd);
// cart
if(pc_iscarton(sd)) {
@@ -9361,7 +9361,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
guild->send_memberinfoshort(sd,1);
if(battle_config.pc_invincible_time > 0) {
- iPc->setinvincibletimer(sd,battle_config.pc_invincible_time);
+ pc->setinvincibletimer(sd,battle_config.pc_invincible_time);
}
if( map[sd->bl.m].users++ == 0 && battle_config.dynamic_mobs )
@@ -9393,7 +9393,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
if(map[sd->bl.m].flag.pvp && !(sd->sc.option&OPTION_INVISIBLE)) {
if(!battle_config.pk_mode) { // remove pvp stuff for pk_mode [Valaris]
if (!map[sd->bl.m].flag.pvp_nocalcrank)
- sd->pvp_timer = iTimer->add_timer(iTimer->gettick()+200, iPc->calc_pvprank_timer, sd->bl.id, 0);
+ sd->pvp_timer = iTimer->add_timer(iTimer->gettick()+200, pc->calc_pvprank_timer, sd->bl.id, 0);
sd->pvp_rank = 0;
sd->pvp_lastusers = 0;
sd->pvp_point = 5;
@@ -9484,7 +9484,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
sc_start(&sd->bl,SC_NOCHAT,100,0,0);
//Auron reported that This skill only triggers when you logon on the map o.O [Skotlex]
- if ((lv = iPc->checkskill(sd,SG_KNOWLEDGE)) > 0) {
+ if ((lv = pc->checkskill(sd,SG_KNOWLEDGE)) > 0) {
if(sd->bl.m == sd->feel_map[0].m
|| sd->bl.m == sd->feel_map[1].m
|| sd->bl.m == sd->feel_map[2].m)
@@ -9528,7 +9528,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
if( sd->state.changemap ) {// restore information that gets lost on map-change
#if PACKETVER >= 20070918
clif->partyinvitationstate(sd);
- clif->equipcheckbox(sd);
+ clif->equpcheckbox(sd);
#endif
if( (battle_config.bg_flee_penalty != 100 || battle_config.gvg_flee_penalty != 100) &&
(map_flag_gvg(sd->state.pmap) || map_flag_gvg(sd->bl.m) || map[sd->state.pmap].flag.battleground || map[sd->bl.m].flag.battleground) )
@@ -9585,7 +9585,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
if(map[sd->bl.m].flag.loadevent) // Lance
npc_script_event(sd, NPCE_LOADMAP);
- if (iPc->checkskill(sd, SG_DEVIL) && !iPc->nextjobexp(sd)) //blindness [Komurka]
+ if (pc->checkskill(sd, SG_DEVIL) && !pc->nextjobexp(sd)) //blindness [Komurka]
clif->sc_end(&sd->bl, sd->bl.id, SELF, SI_DEVIL);
if (sd->sc.opt2) //Client loses these on warp.
@@ -9748,7 +9748,7 @@ void clif_parse_WalkToXY(int fd, struct map_session_data *sd)
if(sd->sc.data[SC_RUN] || sd->sc.data[SC_WUGDASH])
return;
- iPc->delinvincibletimer(sd);
+ pc->delinvincibletimer(sd);
RFIFOPOS(fd, packet_db[RFIFOW(fd,0)].pos[0], &x, &y, NULL);
@@ -9819,7 +9819,7 @@ void clif_parse_GetCharNameRequest(int fd, struct map_session_data *sd)
sc = status_get_sc(bl);
if (sc && sc->option&OPTION_INVISIBLE && !disguised(bl) &&
bl->type != BL_NPC && //Skip hidden NPCs which can be seen using Maya Purple
- iPc->get_group_level(sd) < battle_config.hack_info_GM_level
+ pc->get_group_level(sd) < battle_config.hack_info_GM_level
) {
char gm_msg[256];
sprintf(gm_msg, "Hack on NameRequest: character '%s' (account: %d) requested the name of an invisible target (id: %d).\n", sd->status.name, sd->status.account_id, id);
@@ -9837,7 +9837,7 @@ int clif_undisguise_timer(int tid, unsigned int tick, int id, intptr_t data) {
if( (sd = iMap->id2sd(id)) ) {
sd->fontcolor_tid = INVALID_TIMER;
if( sd->fontcolor && sd->disguise == sd->status.class_ )
- iPc->disguise(sd,-1);
+ pc->disguise(sd,-1);
}
return 0;
}
@@ -9880,7 +9880,7 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data* sd)
if( sd->disguise == -1 ) {
sd->fontcolor_tid = iTimer->add_timer(iTimer->gettick()+5000, clif->undisguise_timer, sd->bl.id, 0);
- iPc->disguise(sd,sd->status.class_);
+ pc->disguise(sd,sd->status.class_);
if( pc_isdead(sd) )
clif_clearunit_single(-sd->bl.id, CLR_DEAD, sd->fd);
if( unit_is_walking(&sd->bl) )
@@ -10019,7 +10019,7 @@ void clif_parse_Emotion(int fd, struct map_session_data *sd)
{
int emoticon = RFIFOB(fd,packet_db[RFIFOW(fd,0)].pos[0]);
- if (battle_config.basic_skill_check == 0 || iPc->checkskill(sd, NV_BASIC) >= 2) {
+ if (battle_config.basic_skill_check == 0 || pc->checkskill(sd, NV_BASIC) >= 2) {
if (emoticon == E_MUTE) {// prevent use of the mute emote [Valaris]
clif->skill_fail(sd, 1, USESKILL_FAIL_LEVEL, 1);
return;
@@ -10098,19 +10098,19 @@ void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type,
if( sd->sc.data[SC_BASILICA] || sd->sc.data[SC__SHADOWFORM] )
return;
- if (!battle_config.sdelay_attack_enable && iPc->checkskill(sd, SA_FREECAST) <= 0) {
+ if (!battle_config.sdelay_attack_enable && pc->checkskill(sd, SA_FREECAST) <= 0) {
if (DIFF_TICK(tick, sd->ud.canact_tick) < 0) {
clif->skill_fail(sd, 1, USESKILL_FAIL_SKILLINTERVAL, 0);
return;
}
}
- iPc->delinvincibletimer(sd);
+ pc->delinvincibletimer(sd);
sd->idletime = last_tick;
unit_attack(&sd->bl, target_id, action_type != 0);
break;
case 0x02: // sitdown
- if (battle_config.basic_skill_check && iPc->checkskill(sd, NV_BASIC) < 3) {
+ if (battle_config.basic_skill_check && pc->checkskill(sd, NV_BASIC) < 3) {
clif->skill_fail(sd, 1, USESKILL_FAIL_LEVEL, 2);
break;
}
@@ -10140,7 +10140,7 @@ void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type,
clif->standing(&sd->bl);
return;
}
- iPc->setstand(sd);
+ pc->setstand(sd);
skill->sit(sd,0);
clif->standing(&sd->bl);
break;
@@ -10288,7 +10288,7 @@ void clif_parse_ActionRequest(int fd, struct map_session_data *sd)
void clif_parse_Restart(int fd, struct map_session_data *sd) {
switch(RFIFOB(fd,2)) {
case 0x00:
- iPc->respawn(sd,CLR_RESPAWN);
+ pc->respawn(sd,CLR_RESPAWN);
break;
case 0x01:
/* Rovert's Prevent logout option - Fixed [Valaris] */
@@ -10431,7 +10431,7 @@ void clif_parse_WisMessage(int fd, struct map_session_data* sd)
// if player ignores everyone
if (dstsd->state.ignoreAll) {
- if (dstsd->sc.option & OPTION_INVISIBLE && iPc->get_group_level(sd) < iPc->get_group_level(dstsd))
+ if (dstsd->sc.option & OPTION_INVISIBLE && pc->get_group_level(sd) < pc->get_group_level(dstsd))
clif->wis_end(fd, 1); // 1: target character is not loged in
else
clif->wis_end(fd, 3); // 3: everyone ignored by target
@@ -10512,7 +10512,7 @@ void clif_parse_TakeItem(int fd, struct map_session_data *sd)
if (pc_cant_act(sd))
break;
- if (!iPc->takeitem(sd, fitem))
+ if (!pc->takeitem(sd, fitem))
break;
return;
@@ -10545,7 +10545,7 @@ void clif_parse_DropItem(int fd, struct map_session_data *sd)
))
break;
- if (!iPc->dropitem(sd, item_index, item_amount))
+ if (!pc->dropitem(sd, item_index, item_amount))
break;
return;
@@ -10578,7 +10578,7 @@ void clif_parse_UseItem(int fd, struct map_session_data *sd)
if(n <0 || n >= MAX_INVENTORY)
return;
- if (!iPc->useitem(sd,n))
+ if (!pc->useitem(sd,n))
clif->useitemack(sd,n,0,false); //Send an empty ack packet or the client gets stuck.
}
@@ -10620,9 +10620,9 @@ void clif_parse_EquipItem(int fd,struct map_session_data *sd)
//Client doesn't send the position for ammo.
if(sd->inventory_data[index]->type == IT_AMMO)
- iPc->equipitem(sd,index,EQP_AMMO);
+ pc->equipitem(sd,index,EQP_AMMO);
else
- iPc->equipitem(sd,index,RFIFOW(fd,4));
+ pc->equipitem(sd,index,RFIFOW(fd,4));
}
void clif_hercules_chsys_delete(struct hChSysCh *channel) {
@@ -10735,7 +10735,7 @@ void clif_parse_UnequipItem(int fd,struct map_session_data *sd)
index = RFIFOW(fd,2)-2;
- iPc->unequipitem(sd,index,1);
+ pc->unequipitem(sd,index,1);
}
@@ -10872,7 +10872,7 @@ void clif_parse_CreateChatRoom(int fd, struct map_session_data* sd)
if (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOROOM)
return;
- if(battle_config.basic_skill_check && iPc->checkskill(sd,NV_BASIC) < 4) {
+ if(battle_config.basic_skill_check && pc->checkskill(sd,NV_BASIC) < 4) {
clif->skill_fail(sd,1,USESKILL_FAIL_LEVEL,3);
return;
}
@@ -10990,7 +10990,7 @@ void clif_parse_TradeRequest(int fd,struct map_session_data *sd)
return;
}
- if( battle_config.basic_skill_check && iPc->checkskill(sd,NV_BASIC) < 1) {
+ if( battle_config.basic_skill_check && pc->checkskill(sd,NV_BASIC) < 1) {
clif->skill_fail(sd,1,USESKILL_FAIL_LEVEL,0);
return;
}
@@ -11064,7 +11064,7 @@ void clif_parse_PutItemToCart(int fd,struct map_session_data *sd)
return;
if (!pc_iscarton(sd))
return;
- iPc->putitemtocart(sd,RFIFOW(fd,2)-2,RFIFOL(fd,4));
+ pc->putitemtocart(sd,RFIFOW(fd,2)-2,RFIFOL(fd,4));
}
@@ -11074,7 +11074,7 @@ void clif_parse_GetItemFromCart(int fd,struct map_session_data *sd)
{
if (!pc_iscarton(sd))
return;
- iPc->getitemfromcart(sd,RFIFOW(fd,2)-2,RFIFOL(fd,4));
+ pc->getitemfromcart(sd,RFIFOW(fd,2)-2,RFIFOL(fd,4));
}
@@ -11086,11 +11086,11 @@ void clif_parse_RemoveOption(int fd,struct map_session_data *sd)
* Attempts to remove these options when this function is called (will remove all available)
**/
#ifdef NEW_CARTS
- iPc->setoption(sd,sd->sc.option&~(OPTION_RIDING|OPTION_FALCON|OPTION_DRAGON|OPTION_MADOGEAR));
+ pc->setoption(sd,sd->sc.option&~(OPTION_RIDING|OPTION_FALCON|OPTION_DRAGON|OPTION_MADOGEAR));
if( sd->sc.data[SC_PUSH_CART] )
- iPc->setcart(sd,0);
+ pc->setcart(sd,0);
#else
- iPc->setoption(sd,sd->sc.option&~(OPTION_CART|OPTION_RIDING|OPTION_FALCON|OPTION_DRAGON|OPTION_MADOGEAR));
+ pc->setoption(sd,sd->sc.option&~(OPTION_CART|OPTION_RIDING|OPTION_FALCON|OPTION_DRAGON|OPTION_MADOGEAR));
#endif
}
@@ -11101,7 +11101,7 @@ void clif_parse_ChangeCart(int fd,struct map_session_data *sd)
{// TODO: State tracking?
int type;
- if( sd && iPc->checkskill(sd, MC_CHANGECART) < 1 )
+ if( sd && pc->checkskill(sd, MC_CHANGECART) < 1 )
return;
type = (int)RFIFOW(fd,2);
@@ -11122,7 +11122,7 @@ void clif_parse_ChangeCart(int fd,struct map_session_data *sd)
(type == 2 && sd->status.base_level > 40) ||
(type == 1))
#endif
- iPc->setcart(sd,type);
+ pc->setcart(sd,type);
}
@@ -11135,7 +11135,7 @@ void clif_parse_ChangeCart(int fd,struct map_session_data *sd)
/// the like
void clif_parse_StatusUp(int fd,struct map_session_data *sd)
{
- iPc->statusup(sd,RFIFOW(fd,2));
+ pc->statusup(sd,RFIFOW(fd,2));
}
@@ -11143,7 +11143,7 @@ void clif_parse_StatusUp(int fd,struct map_session_data *sd)
/// 0112 <skill id>.W
void clif_parse_SkillUp(int fd,struct map_session_data *sd)
{
- iPc->skillup(sd,RFIFOW(fd,2));
+ pc->skillup(sd,RFIFOW(fd,2));
}
void clif_parse_UseSkillToId_homun(struct homun_data *hd, struct map_session_data *sd, unsigned int tick, uint16 skill_id, uint16 skill_lv, int target_id)
@@ -11314,7 +11314,7 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd)
if( skill_lv != sd->skillitemlv )
skill_lv = sd->skillitemlv;
if( !(tmp&INF_SELF_SKILL) )
- iPc->delinvincibletimer(sd); // Target skills thru items cancel invincibility. [Inkfish]
+ pc->delinvincibletimer(sd); // Target skills thru items cancel invincibility. [Inkfish]
unit_skilluse_id(&sd->bl, target_id, skill_id, skill_lv);
return;
}
@@ -11327,12 +11327,12 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd)
else
skill_lv = 0;
} else {
- tmp = iPc->checkskill(sd, skill_id);
+ tmp = pc->checkskill(sd, skill_id);
if( skill_lv > tmp )
skill_lv = tmp;
}
- iPc->delinvincibletimer(sd);
+ pc->delinvincibletimer(sd);
if( skill_lv )
unit_skilluse_id(&sd->bl, target_id, skill_id, skill_lv);
@@ -11395,7 +11395,7 @@ void clif_parse_UseSkillToPosSub(int fd, struct map_session_data *sd, uint16 ski
return; //Can't use skills while a menu is open.
}
- iPc->delinvincibletimer(sd);
+ pc->delinvincibletimer(sd);
if( sd->skillitem == skill_id ) {
if( skill_lv != sd->skillitemlv )
@@ -11404,7 +11404,7 @@ void clif_parse_UseSkillToPosSub(int fd, struct map_session_data *sd, uint16 ski
} else {
int lv;
sd->skillitem = sd->skillitemlv = 0;
- if( (lv = iPc->checkskill(sd, skill_id)) > 0 ) {
+ if( (lv = pc->checkskill(sd, skill_id)) > 0 ) {
if( skill_lv > lv )
skill_lv = lv;
unit_skilluse_pos(&sd->bl, x, y, skill_id,skill_lv);
@@ -11471,7 +11471,7 @@ void clif_parse_UseSkillMap(int fd, struct map_session_data* sd)
return;
}
- iPc->delinvincibletimer(sd);
+ pc->delinvincibletimer(sd);
skill->castend_map(sd,skill_id,map_name);
}
@@ -11481,7 +11481,7 @@ void clif_parse_UseSkillMap(int fd, struct map_session_data* sd)
void clif_parse_RequestMemo(int fd,struct map_session_data *sd)
{
if (!pc_isdead(sd))
- iPc->memo(sd,-1);
+ pc->memo(sd,-1);
}
@@ -11729,7 +11729,7 @@ void clif_parse_InsertCard(int fd,struct map_session_data *sd)
{
if (sd->state.trading != 0)
return;
- iPc->insert_card(sd,RFIFOW(fd,2)-2,RFIFOW(fd,4)-2);
+ pc->insert_card(sd,RFIFOW(fd,2)-2,RFIFOW(fd,4)-2);
}
@@ -11933,7 +11933,7 @@ void clif_parse_CreateParty(int fd, struct map_session_data *sd)
clif->message(fd, msg_txt(227));
return;
}
- if( battle_config.basic_skill_check && iPc->checkskill(sd,NV_BASIC) < 7 ) {
+ if( battle_config.basic_skill_check && pc->checkskill(sd,NV_BASIC) < 7 ) {
clif->skill_fail(sd,1,USESKILL_FAIL_LEVEL,4);
return;
}
@@ -11952,7 +11952,7 @@ void clif_parse_CreateParty2(int fd, struct map_session_data *sd)
clif->message(fd, msg_txt(227));
return;
}
- if( battle_config.basic_skill_check && iPc->checkskill(sd,NV_BASIC) < 7 ) {
+ if( battle_config.basic_skill_check && pc->checkskill(sd,NV_BASIC) < 7 ) {
clif->skill_fail(sd,1,USESKILL_FAIL_LEVEL,4);
return;
}
@@ -12853,7 +12853,7 @@ void clif_parse_GMKick(int fd, struct map_session_data *sd)
case BL_MOB:
{
char command[100];
- if( !iPc->can_use_command(sd, "@killmonster")) {
+ if( !pc->can_use_command(sd, "@killmonster")) {
clif->GM_kickack(sd, 0);
return;
}
@@ -13024,7 +13024,7 @@ void clif_parse_GMReqNoChat(int fd,struct map_session_data *sd)
//If type is 2 and the ids don't match, this is a crafted hacked packet!
//Disabled because clients keep self-muting when you give players public @ commands... [Skotlex]
- if (type == 2 /* && (iPc->get_group_level(sd) > 0 || sd->bl.id != id)*/)
+ if (type == 2 /* && (pc->get_group_level(sd) > 0 || sd->bl.id != id)*/)
return;
dstsd = iMap->id2sd(id);
@@ -13241,8 +13241,8 @@ void clif_parse_NoviceDoriDori(int fd, struct map_session_data *sd)
void clif_parse_NoviceExplosionSpirits(int fd, struct map_session_data *sd)
{
if( ( sd->class_&MAPID_UPPERMASK ) == MAPID_SUPER_NOVICE ) {
- unsigned int next = iPc->nextbaseexp(sd);
- if( next == 0 ) next = iPc->thisbaseexp(sd);
+ unsigned int next = pc->nextbaseexp(sd);
+ if( next == 0 ) next = pc->thisbaseexp(sd);
if( next ) {
int percent = (int)( ( (float)sd->status.base_exp/(float)next )*1000. );
@@ -13882,7 +13882,7 @@ void clif_parse_HomMenu(int fd, struct map_session_data *sd) { //[orn]
/// 0292
void clif_parse_AutoRevive(int fd, struct map_session_data *sd)
{
- int item_position = iPc->search_inventory(sd, ITEMID_TOKEN_OF_SIEGFRIED);
+ int item_position = pc->search_inventory(sd, ITEMID_TOKEN_OF_SIEGFRIED);
if (item_position < 0)
return;
@@ -13894,7 +13894,7 @@ void clif_parse_AutoRevive(int fd, struct map_session_data *sd)
return;
clif->skill_nodamage(&sd->bl,&sd->bl,ALL_RESURRECTION,4,1);
- iPc->delitem(sd, item_position, 1, 0, 1, LOG_TYPE_CONSUME);
+ pc->delitem(sd, item_position, 1, 0, 1, LOG_TYPE_CONSUME);
}
@@ -13909,17 +13909,17 @@ void clif_check(int fd, struct map_session_data* pl_sd) {
WFIFOHEAD(fd,packet_len(0x214));
WFIFOW(fd, 0) = 0x214;
WFIFOB(fd, 2) = min(pl_sd->status.str, UINT8_MAX);
- WFIFOB(fd, 3) = iPc->need_status_point(pl_sd, SP_STR, 1);
+ WFIFOB(fd, 3) = pc->need_status_point(pl_sd, SP_STR, 1);
WFIFOB(fd, 4) = min(pl_sd->status.agi, UINT8_MAX);
- WFIFOB(fd, 5) = iPc->need_status_point(pl_sd, SP_AGI, 1);
+ WFIFOB(fd, 5) = pc->need_status_point(pl_sd, SP_AGI, 1);
WFIFOB(fd, 6) = min(pl_sd->status.vit, UINT8_MAX);
- WFIFOB(fd, 7) = iPc->need_status_point(pl_sd, SP_VIT, 1);
+ WFIFOB(fd, 7) = pc->need_status_point(pl_sd, SP_VIT, 1);
WFIFOB(fd, 8) = min(pl_sd->status.int_, UINT8_MAX);
- WFIFOB(fd, 9) = iPc->need_status_point(pl_sd, SP_INT, 1);
+ WFIFOB(fd, 9) = pc->need_status_point(pl_sd, SP_INT, 1);
WFIFOB(fd,10) = min(pl_sd->status.dex, UINT8_MAX);
- WFIFOB(fd,11) = iPc->need_status_point(pl_sd, SP_DEX, 1);
+ WFIFOB(fd,11) = pc->need_status_point(pl_sd, SP_DEX, 1);
WFIFOB(fd,12) = min(pl_sd->status.luk, UINT8_MAX);
- WFIFOB(fd,13) = iPc->need_status_point(pl_sd, SP_LUK, 1);
+ WFIFOB(fd,13) = pc->need_status_point(pl_sd, SP_LUK, 1);
WFIFOW(fd,14) = pl_sd->battle_status.batk+pl_sd->battle_status.rhw.atk+pl_sd->battle_status.lhw.atk;
WFIFOW(fd,16) = pl_sd->battle_status.rhw.atk2+pl_sd->battle_status.lhw.atk2;
WFIFOW(fd,18) = pl_sd->battle_status.matk_max;
@@ -13951,7 +13951,7 @@ void clif_parse_Check(int fd, struct map_session_data *sd)
safestrncpy(charname, (const char*)RFIFOP(fd,packet_db[RFIFOW(fd,0)].pos[0]), sizeof(charname));
- if( ( pl_sd = iMap->nick2sd(charname) ) == NULL || iPc->get_group_level(sd) < iPc->get_group_level(pl_sd) ) {
+ if( ( pl_sd = iMap->nick2sd(charname) ) == NULL || pc->get_group_level(sd) < pc->get_group_level(pl_sd) ) {
return;
}
@@ -14233,9 +14233,9 @@ void clif_parse_Mail_getattach(int fd, struct map_session_data *sd)
if ((data = itemdb_exists(sd->mail.inbox.msg[i].item.nameid)) == NULL)
return;
- switch( iPc->checkadditem(sd, data->nameid, sd->mail.inbox.msg[i].item.amount) ) {
+ switch( pc->checkadditem(sd, data->nameid, sd->mail.inbox.msg[i].item.amount) ) {
case ADDITEM_NEW:
- fail = ( iPc->inventoryblank(sd) == 0 );
+ fail = ( pc->inventoryblank(sd) == 0 );
break;
case ADDITEM_OVERAMOUNT:
fail = true;
@@ -14527,9 +14527,9 @@ void clif_parse_Auction_setitem(int fd, struct map_session_data *sd)
return;
}
- if( !iPc->can_give_items(sd) || sd->status.inventory[idx].expire_time ||
+ if( !pc->can_give_items(sd) || sd->status.inventory[idx].expire_time ||
!sd->status.inventory[idx].identify ||
- !itemdb_canauction(&sd->status.inventory[idx],iPc->get_group_level(sd)) ) { // Quest Item or something else
+ !itemdb_canauction(&sd->status.inventory[idx],pc->get_group_level(sd)) ) { // Quest Item or something else
clif->auction_setitem(sd->fd, idx, true);
return;
}
@@ -14646,10 +14646,10 @@ void clif_parse_Auction_register(int fd, struct map_session_data *sd)
{
int zeny = auction.hours*battle_config.auction_feeperhour;
- iPc->delitem(sd, sd->auction.index, sd->auction.amount, 1, 6, LOG_TYPE_AUCTION);
+ pc->delitem(sd, sd->auction.index, sd->auction.amount, 1, 6, LOG_TYPE_AUCTION);
sd->auction.amount = 0;
- iPc->payzeny(sd, zeny, LOG_TYPE_AUCTION, NULL);
+ pc->payzeny(sd, zeny, LOG_TYPE_AUCTION, NULL);
}
}
@@ -14681,7 +14681,7 @@ void clif_parse_Auction_bid(int fd, struct map_session_data *sd)
unsigned int auction_id = RFIFOL(fd,2);
int bid = RFIFOL(fd,6);
- if( !iPc->can_give_items(sd) ) { //They aren't supposed to give zeny [Inkfish]
+ if( !pc->can_give_items(sd) ) { //They aren't supposed to give zeny [Inkfish]
clif->message(sd->fd, msg_txt(246));
return;
}
@@ -14693,7 +14693,7 @@ void clif_parse_Auction_bid(int fd, struct map_session_data *sd)
else if ( CheckForCharServer() ) // char server is down (bugreport:1138)
clif->auction_message(fd, 0); // You have failed to bid into the auction
else {
- iPc->payzeny(sd, bid, LOG_TYPE_AUCTION, NULL);
+ pc->payzeny(sd, bid, LOG_TYPE_AUCTION, NULL);
intif_Auction_bid(sd->status.char_id, sd->status.name, auction_id, bid);
}
}
@@ -14880,7 +14880,7 @@ void clif_parse_Adopt_request(int fd, struct map_session_data *sd)
{
struct map_session_data *tsd = iMap->id2sd(RFIFOL(fd,2)), *p_sd = iMap->charid2sd(sd->status.partner_id);
- if( iPc->can_Adopt(sd, p_sd, tsd) ) {
+ if( pc->can_Adopt(sd, p_sd, tsd) ) {
tsd->adopt_invite = sd->status.account_id;
clif->adopt_request(tsd, sd, p_sd->status.account_id);
}
@@ -14912,7 +14912,7 @@ void clif_parse_Adopt_reply(int fd, struct map_session_data *sd)
if( result == 0 )
return; // Rejected
- iPc->adoption(p1_sd, p2_sd, sd);
+ pc->adoption(p1_sd, p2_sd, sd);
}
@@ -16836,14 +16836,14 @@ void clif_parse_CashShopBuy(int fd, struct map_session_data *sd) {
if (!itemdb_isstackable2(data))
get_count = 1;
- iPc->paycash(sd, clif->cs.data[tab][j]->price * qty, kafra_pay);// [Ryuuzaki]
+ pc->paycash(sd, clif->cs.data[tab][j]->price * qty, kafra_pay);// [Ryuuzaki]
for (k = 0; k < qty; k += get_count) {
if (!pet_create_egg(sd, data->nameid)) {
memset(&item_tmp, 0, sizeof(item_tmp));
item_tmp.nameid = data->nameid;
item_tmp.identify = 1;
- switch (iPc->additem(sd, &item_tmp, get_count, LOG_TYPE_NPC)) {
+ switch (pc->additem(sd, &item_tmp, get_count, LOG_TYPE_NPC)) {
case 0:
result = CSBR_SUCCESS;
break;
@@ -16865,7 +16865,7 @@ void clif_parse_CashShopBuy(int fd, struct map_session_data *sd) {
}
if( result != CSBR_SUCCESS )
- iPc->getcash(sd, clif->cs.data[tab][j]->price * get_count,0);
+ pc->getcash(sd, clif->cs.data[tab][j]->price * get_count,0);
}
}
}
@@ -17478,7 +17478,7 @@ void clif_defaults(void) {
clif->equiptickack = clif_equiptickack;
clif->viewequip_ack = clif_viewequip_ack;
clif->viewequip_fail = clif_viewequip_fail;
- clif->equipcheckbox = clif_equipcheckbox;
+ clif->equpcheckbox = clif_equpcheckbox;
clif->displayexp = clif_displayexp;
clif->font = clif_font;
clif->progressbar = clif_progressbar;
diff --git a/src/map/clif.h b/src/map/clif.h
index a0959f92a..72466af81 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -612,7 +612,7 @@ struct clif_interface {
void (*equiptickack) (struct map_session_data* sd, int flag);
void (*viewequip_ack) (struct map_session_data* sd, struct map_session_data* tsd);
void (*viewequip_fail) (struct map_session_data* sd);
- void (*equipcheckbox) (struct map_session_data* sd);
+ void (*equpcheckbox) (struct map_session_data* sd);
void (*displayexp) (struct map_session_data *sd, unsigned int exp, char type, bool quest);
void (*font) (struct map_session_data *sd);
void (*progressbar) (struct map_session_data * sd, unsigned long color, unsigned int second);
diff --git a/src/map/elemental.c b/src/map/elemental.c
index 17c6fe16d..53c85577b 100644
--- a/src/map/elemental.c
+++ b/src/map/elemental.c
@@ -126,7 +126,7 @@ int elemental_create(struct map_session_data *sd, int class_, unsigned int lifet
break;
}
- if( (i=iPc->checkskill(sd,SO_EL_SYMPATHY)) > 0 ){
+ if( (i=pc->checkskill(sd,SO_EL_SYMPATHY)) > 0 ){
ele.hp = ele.max_hp = ele.max_hp * 5 * i / 100;
ele.sp = ele.max_sp = ele.max_sp * 5 * i / 100;
ele.atk += 25 * i;
diff --git a/src/map/guild.c b/src/map/guild.c
index fe801462f..fc7779982 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -386,7 +386,7 @@ int guild_create(struct map_session_data *sd, const char *name)
clif->guild_created(sd,1);
return 0;
}
- if( battle_config.guild_emperium_check && iPc->search_inventory(sd,714) == -1 )
+ if( battle_config.guild_emperium_check && pc->search_inventory(sd,714) == -1 )
{// item required
clif->guild_created(sd,3);
return 0;
@@ -412,7 +412,7 @@ int guild_created(int account_id,int guild_id) {
sd->status.guild_id=guild_id;
clif->guild_created(sd,0);
if(battle_config.guild_emperium_check)
- iPc->delitem(sd,iPc->search_inventory(sd,ITEMID_EMPERIUM),1,0,0,LOG_TYPE_CONSUME); //emperium consumption
+ pc->delitem(sd,pc->search_inventory(sd,ITEMID_EMPERIUM),1,0,0,LOG_TYPE_CONSUME); //emperium consumption
return 0;
}
diff --git a/src/map/homunculus.c b/src/map/homunculus.c
index 9c18b9811..efb5c0eb3 100644
--- a/src/map/homunculus.c
+++ b/src/map/homunculus.c
@@ -573,12 +573,12 @@ bool homunculus_feed(struct map_session_data *sd, struct homun_data *hd) {
return false;
foodID = hd->homunculusDB->foodID;
- i = iPc->search_inventory(sd,foodID);
+ i = pc->search_inventory(sd,foodID);
if(i < 0) {
clif->hom_food(sd,foodID,0);
return false;
}
- iPc->delitem(sd,i,1,0,0,LOG_TYPE_CONSUME);
+ pc->delitem(sd,i,1,0,0,LOG_TYPE_CONSUME);
if ( hd->homunculus.hunger >= 91 ) {
homun->consume_intimacy(hd, 50);
diff --git a/src/map/instance.c b/src/map/instance.c
index def0a43a8..75bb004eb 100644
--- a/src/map/instance.c
+++ b/src/map/instance.c
@@ -295,7 +295,7 @@ int instance_del_load(struct map_session_data* sd, va_list args) {
if( !sd || sd->bl.m != m )
return 0;
- iPc->setpos(sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, CLR_OUTSIGHT);
+ pc->setpos(sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, CLR_OUTSIGHT);
return 1;
}
@@ -532,9 +532,9 @@ void instance_check_kick(struct map_session_data *sd) {
clif->instance_leave(sd->fd);
if( map[m].instance_id >= 0 ) { // User was on the instance map
if( map[m].save.map )
- iPc->setpos(sd, map[m].save.map, map[m].save.x, map[m].save.y, CLR_TELEPORT);
+ pc->setpos(sd, map[m].save.map, map[m].save.x, map[m].save.y, CLR_TELEPORT);
else
- iPc->setpos(sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, CLR_TELEPORT);
+ pc->setpos(sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, CLR_TELEPORT);
}
}
diff --git a/src/map/intif.c b/src/map/intif.c
index 607300e57..000ab3f07 100644
--- a/src/map/intif.c
+++ b/src/map/intif.c
@@ -993,7 +993,7 @@ int intif_parse_Registers(int fd)
*qty = j;
if (flag && sd->save_reg.global_num > -1 && sd->save_reg.account_num > -1 && sd->save_reg.account2_num > -1)
- iPc->reg_received(sd); //Received all registry values, execute init scripts and what-not. [Skotlex]
+ pc->reg_received(sd); //Received all registry values, execute init scripts and what-not. [Skotlex]
return 1;
}
@@ -1821,9 +1821,9 @@ static void intif_parse_Auction_register(int fd)
int zeny = auction.hours*battle_config.auction_feeperhour;
clif->auction_message(sd->fd, 4);
- iPc->additem(sd, &auction.item, auction.item.amount, LOG_TYPE_AUCTION);
+ pc->additem(sd, &auction.item, auction.item.amount, LOG_TYPE_AUCTION);
- iPc->getzeny(sd, zeny, LOG_TYPE_AUCTION, NULL);
+ pc->getzeny(sd, zeny, LOG_TYPE_AUCTION, NULL);
}
}
@@ -1919,7 +1919,7 @@ static void intif_parse_Auction_bid(int fd)
clif->auction_message(sd->fd, result);
if( bid > 0 ) {
- iPc->getzeny(sd, bid, LOG_TYPE_AUCTION,NULL);
+ pc->getzeny(sd, bid, LOG_TYPE_AUCTION,NULL);
}
if( result == 1 ) { // To update the list, display your buy list
clif->pAuction_cancelreg(fd, sd);
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index e0cb642fb..00f4198a8 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -1435,7 +1435,7 @@ void itemdb_reload(void)
iter = mapit_geteachpc();
for( sd = (struct map_session_data*)mapit->first(iter); mapit->exists(iter); sd = (struct map_session_data*)mapit->next(iter) ) {
memset(sd->item_delay, 0, sizeof(sd->item_delay)); // reset item delays
- iPc->setinventorydata(sd);
+ pc->setinventorydata(sd);
/* clear combo bonuses */
if( sd->combos.count ) {
aFree(sd->combos.bonus);
@@ -1443,7 +1443,7 @@ void itemdb_reload(void)
sd->combos.bonus = NULL;
sd->combos.id = NULL;
sd->combos.count = 0;
- if( iPc->load_combo(sd) > 0 )
+ if( pc->load_combo(sd) > 0 )
status_calc_pc(sd,0);
}
diff --git a/src/map/mail.c b/src/map/mail.c
index ab3d78ed2..299fb5117 100644
--- a/src/map/mail.c
+++ b/src/map/mail.c
@@ -31,7 +31,7 @@ int mail_removeitem(struct map_session_data *sd, short flag)
if( sd->mail.amount )
{
if (flag) // Item send
- iPc->delitem(sd, sd->mail.index, sd->mail.amount, 1, 0, LOG_TYPE_MAIL);
+ pc->delitem(sd, sd->mail.index, sd->mail.amount, 1, 0, LOG_TYPE_MAIL);
else
clif->additem(sd, sd->mail.index, sd->mail.amount, 0);
}
@@ -48,7 +48,7 @@ int mail_removezeny(struct map_session_data *sd, short flag)
if (flag && sd->mail.zeny > 0)
{ //Zeny send
- iPc->payzeny(sd,sd->mail.zeny,LOG_TYPE_MAIL, NULL);
+ pc->payzeny(sd,sd->mail.zeny,LOG_TYPE_MAIL, NULL);
}
sd->mail.zeny = 0;
@@ -61,7 +61,7 @@ unsigned char mail_setitem(struct map_session_data *sd, int idx, int amount) {
return 1;
if( idx == 0 ) { // Zeny Transfer
- if( amount < 0 || !iPc->can_give_items(sd) )
+ if( amount < 0 || !pc->can_give_items(sd) )
return 1;
if( amount > sd->status.zeny )
@@ -78,8 +78,8 @@ unsigned char mail_setitem(struct map_session_data *sd, int idx, int amount) {
return 1;
if( amount < 0 || amount > sd->status.inventory[idx].amount )
return 1;
- if( !iPc->can_give_items(sd) || sd->status.inventory[idx].expire_time ||
- !itemdb_canmail(&sd->status.inventory[idx],iPc->get_group_level(sd)) )
+ if( !pc->can_give_items(sd) || sd->status.inventory[idx].expire_time ||
+ !itemdb_canmail(&sd->status.inventory[idx],pc->get_group_level(sd)) )
return 1;
sd->mail.index = idx;
@@ -131,13 +131,13 @@ void mail_getattachment(struct map_session_data* sd, int zeny, struct item* item
{
if( item->nameid > 0 && item->amount > 0 )
{
- iPc->additem(sd, item, item->amount, LOG_TYPE_MAIL);
+ pc->additem(sd, item, item->amount, LOG_TYPE_MAIL);
clif->mail_getattachment(sd->fd, 0);
}
if( zeny > 0 )
{ //Zeny receive
- iPc->getzeny(sd, zeny,LOG_TYPE_MAIL, NULL);
+ pc->getzeny(sd, zeny,LOG_TYPE_MAIL, NULL);
}
}
@@ -161,12 +161,12 @@ void mail_deliveryfail(struct map_session_data *sd, struct mail_message *msg)
if( msg->item.amount > 0 )
{
// Item receive (due to failure)
- iPc->additem(sd, &msg->item, msg->item.amount, LOG_TYPE_MAIL);
+ pc->additem(sd, &msg->item, msg->item.amount, LOG_TYPE_MAIL);
}
if( msg->zeny > 0 )
{
- iPc->getzeny(sd,msg->zeny,LOG_TYPE_MAIL, NULL); //Zeny receive (due to failure)
+ pc->getzeny(sd,msg->zeny,LOG_TYPE_MAIL, NULL); //Zeny receive (due to failure)
}
clif->mail_send(sd->fd, true);
@@ -175,7 +175,7 @@ void mail_deliveryfail(struct map_session_data *sd, struct mail_message *msg)
// This function only check if the mail operations are valid
bool mail_invalid_operation(struct map_session_data *sd)
{
- if( !map[sd->bl.m].flag.town && !iPc->can_use_command(sd, "@mail") )
+ if( !map[sd->bl.m].flag.town && !pc->can_use_command(sd, "@mail") )
{
ShowWarning("clif->parse_Mail: char '%s' trying to do invalid mail operations.\n", sd->status.name);
return true;
diff --git a/src/map/map.c b/src/map/map.c
index 496802d28..ddefcf0e1 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -1647,7 +1647,7 @@ int map_quit(struct map_session_data *sd) {
if( sd->bg_id )
bg_team_leave(sd,1);
- iPc->itemcd_do(sd,false);
+ pc->itemcd_do(sd,false);
for( i = 0; i < sd->queues_count; i++ ) {
struct hQueue *queue;
@@ -1711,8 +1711,8 @@ int map_quit(struct map_session_data *sd) {
for( i = 0; i < EQI_MAX; i++ ) {
if( sd->equip_index[ i ] >= 0 )
- if( !iPc->isequip( sd , sd->equip_index[ i ] ) )
- iPc->unequipitem( sd , sd->equip_index[ i ] , 2 );
+ if( !pc->isequip( sd , sd->equip_index[ i ] ) )
+ pc->unequipitem( sd , sd->equip_index[ i ] , 2 );
}
// Return loot to owner
@@ -1752,8 +1752,8 @@ int map_quit(struct map_session_data *sd) {
}
iParty->booking_delete(sd); // Party Booking [Spiria]
- iPc->makesavestatus(sd);
- iPc->clean_skilltree(sd);
+ pc->makesavestatus(sd);
+ pc->clean_skilltree(sd);
chrif_save(sd,1);
unit_free_pc(sd);
return 0;
@@ -5071,7 +5071,7 @@ void do_final(void)
do_final_storage();
guild->final();
iParty->do_final_party();
- iPc->do_final_pc();
+ pc->do_final_pc();
do_final_pet();
do_final_mob();
homun->final();
@@ -5276,7 +5276,7 @@ void map_hp_symbols(void) {
HPM->share(searchstore,"searchstore");
HPM->share(skill,"skill");
HPM->share(vending,"vending");
- HPM->share(iPc,"iPc");
+ HPM->share(pc,"pc");
HPM->share(iParty,"iParty");
HPM->share(iMap,"iMap");
/* partial */
@@ -5493,7 +5493,7 @@ int do_init(int argc, char *argv[])
skill->init();
read_map_zone_db();/* read after item and skill initalization */
do_init_mob();
- iPc->do_init_pc();
+ pc->do_init_pc();
do_init_status();
iParty->do_init_party();
guild->init();
diff --git a/src/map/mob.c b/src/map/mob.c
index 629a79e7f..d83bdec0c 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -1846,7 +1846,7 @@ static void mob_item_drop(struct mob_data *md, struct item_drop_list *dlist, str
if( sd == NULL ) sd = iMap->charid2sd(dlist->third_charid);
if( sd
- && (drop_rate <= sd->state.autoloot || iPc->isautolooting(sd, ditem->item_data.nameid))
+ && (drop_rate <= sd->state.autoloot || pc->isautolooting(sd, ditem->item_data.nameid))
&& (battle_config.idle_no_autoloot == 0 || DIFF_TICK(last_tick, sd->idletime) < battle_config.idle_no_autoloot)
&& (battle_config.homunculus_autoloot?1:!flag)
#ifdef AUTOLOOT_DISTANCE
@@ -2189,7 +2189,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
else
ARR_FIND(0, MAX_PC_FEELHATE, i, temp == sd->hate_mob[i] &&
(battle_config.allow_skill_without_day || sg_info[i].day_func()));
- if(i<MAX_PC_FEELHATE && (temp=iPc->checkskill(sd,sg_info[i].bless_id)))
+ if(i<MAX_PC_FEELHATE && (temp=pc->checkskill(sd,sg_info[i].bless_id)))
bonus += (i==2?20:10)*temp;
}
if(battle_config.mobs_level_up && md->level > md->db->lv) // [Valaris]
@@ -2285,15 +2285,15 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
if(base_exp || job_exp) {
if( md->dmglog[i].flag != MDLF_PET || battle_config.pet_attack_exp_to_master ) {
#ifdef RENEWAL_EXP
- int rate = iPc->level_penalty_mod(tmpsd[i], md, 1);
+ int rate = pc->level_penalty_mod(tmpsd[i], md, 1);
base_exp = (unsigned int)cap_value(base_exp * rate / 100, 1, UINT_MAX);
job_exp = (unsigned int)cap_value(job_exp * rate / 100, 1, UINT_MAX);
#endif
- iPc->gainexp(tmpsd[i], &md->bl, base_exp, job_exp, false);
+ pc->gainexp(tmpsd[i], &md->bl, base_exp, job_exp, false);
}
}
if(zeny) // zeny from mobs [Valaris]
- iPc->getzeny(tmpsd[i], zeny, LOG_TYPE_PICKDROP_MONSTER, NULL);
+ pc->getzeny(tmpsd[i], zeny, LOG_TYPE_PICKDROP_MONSTER, NULL);
}
}
@@ -2313,9 +2313,9 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
struct item_data* it = NULL;
int drop_rate;
#ifdef RENEWAL_DROP
- int drop_modifier = mvp_sd ? iPc->level_penalty_mod(mvp_sd, md, 2) :
- second_sd ? iPc->level_penalty_mod(second_sd, md, 2):
- third_sd ? iPc->level_penalty_mod(third_sd, md, 2) :
+ int drop_modifier = mvp_sd ? pc->level_penalty_mod(mvp_sd, md, 2) :
+ second_sd ? pc->level_penalty_mod(second_sd, md, 2):
+ third_sd ? pc->level_penalty_mod(third_sd, md, 2) :
100;/* no player was attached, we dont use any modifier (100 = rates are not touched) */
#endif
dlist->m = md->bl.m;
@@ -2394,7 +2394,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
}
// Ore Discovery [Celest]
- if (sd == mvp_sd && iPc->checkskill(sd,BS_FINDINGORE)>0 && battle_config.finding_ore_rate/10 >= rnd()%10000) {
+ if (sd == mvp_sd && pc->checkskill(sd,BS_FINDINGORE)>0 && battle_config.finding_ore_rate/10 >= rnd()%10000) {
ditem = mob_setdropitem(itemdb_searchrandomid(IG_FINDINGORE), 1, NULL);
mob_item_drop(md, dlist, ditem, 0, battle_config.finding_ore_rate/10, homkillonly);
}
@@ -2433,7 +2433,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
if( sd->bonus.get_zeny_num && rnd()%100 < sd->bonus.get_zeny_rate ) {
i = sd->bonus.get_zeny_num > 0 ? sd->bonus.get_zeny_num : -md->level * sd->bonus.get_zeny_num;
if (!i) i = 1;
- iPc->getzeny(sd, 1+rnd()%i, LOG_TYPE_PICKDROP_MONSTER, NULL);
+ pc->getzeny(sd, 1+rnd()%i, LOG_TYPE_PICKDROP_MONSTER, NULL);
}
}
@@ -2479,7 +2479,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
clif->mvp_effect(mvp_sd);
clif->mvp_exp(mvp_sd,mexp);
- iPc->gainexp(mvp_sd, &md->bl, mexp,0, false);
+ pc->gainexp(mvp_sd, &md->bl, mexp,0, false);
log_mvp[1] = mexp;
if( !(map[m].flag.nomvploot || type&1) ) {
@@ -2527,7 +2527,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
intif_broadcast(message,strlen(message)+1,0);
}
- if((temp = iPc->additem(mvp_sd,&item,1,LOG_TYPE_PICKDROP_PLAYER)) != 0) {
+ if((temp = pc->additem(mvp_sd,&item,1,LOG_TYPE_PICKDROP_PLAYER)) != 0) {
clif->additem(mvp_sd,0,0,temp);
iMap->addflooritem(&item,1,mvp_sd->bl.m,mvp_sd->bl.x,mvp_sd->bl.y,mvp_sd->status.char_id,(second_sd?second_sd->status.char_id:0),(third_sd?third_sd->status.char_id:0),1);
}
@@ -2560,7 +2560,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
if( sd ) {
if( sd->mission_mobid == md->class_) { //TK_MISSION [Skotlex]
if( ++sd->mission_count >= 100 && (temp = mob_get_random_id(0, 0xE, sd->status.base_level)) ) {
- iPc->addfame(sd, 1);
+ pc->addfame(sd, 1);
sd->mission_mobid = temp;
pc_setglobalreg(sd,"TK_MISSION_ID", temp);
sd->mission_count = 0;
@@ -2580,15 +2580,15 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
if( md->npc_event[0] && !md->state.npc_killmonster ) {
if( sd && battle_config.mob_npc_event_type ) {
- iPc->setparam(sd, SP_KILLERRID, sd->bl.id);
+ pc->setparam(sd, SP_KILLERRID, sd->bl.id);
npc_event(sd,md->npc_event,0);
} else if( mvp_sd ) {
- iPc->setparam(mvp_sd, SP_KILLERRID, sd?sd->bl.id:0);
+ pc->setparam(mvp_sd, SP_KILLERRID, sd?sd->bl.id:0);
npc_event(mvp_sd,md->npc_event,0);
} else
npc_event_do(md->npc_event);
} else if( mvp_sd && !md->state.npc_killmonster ) {
- iPc->setparam(mvp_sd, SP_KILLEDRID, md->class_);
+ pc->setparam(mvp_sd, SP_KILLEDRID, md->class_);
npc_script_event(mvp_sd, NPCE_KILLNPC); // PCKillNPC [Lance]
}
@@ -3384,8 +3384,8 @@ int mob_clone_spawn(struct map_session_data *sd, int16 m, int16 x, int16 y, cons
//Go Backwards to give better priority to advanced skills.
for (i=0,j = MAX_SKILL_TREE-1;j>=0 && i< MAX_MOBSKILL ;j--) {
- int idx = skill_tree[iPc->class2idx(sd->status.class_)][j].idx;
- skill_id = skill_tree[iPc->class2idx(sd->status.class_)][j].id;
+ int idx = skill_tree[pc->class2idx(sd->status.class_)][j].idx;
+ skill_id = skill_tree[pc->class2idx(sd->status.class_)][j].id;
if (!skill_id || sd->status.skill[idx].lv < 1 ||
(skill_db[idx].inf2&(INF2_WEDDING_SKILL|INF2_GUILD_SKILL))
)
diff --git a/src/map/npc.c b/src/map/npc.c
index 7a6516d9a..e842a6c05 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -303,7 +303,7 @@ int npc_event_dequeue(struct map_session_data* sd)
if (!sd->eventqueue[0][0])
return 0; //Nothing to dequeue
- if (!iPc->addeventtimer(sd,100,sd->eventqueue[0])) { //Failed to dequeue, couldn't set a timer.
+ if (!pc->addeventtimer(sd,100,sd->eventqueue[0])) { //Failed to dequeue, couldn't set a timer.
ShowWarning("npc_event_dequeue: event timer is full !\n");
return 0;
}
@@ -954,7 +954,7 @@ int npc_touch_areanpc(struct map_session_data* sd, int16 m, int16 x, int16 y)
case WARP:
if( pc_ishiding(sd) || (sd->sc.count && sd->sc.data[SC_CAMOUFLAGE]) )
break; // hidden chars cannot use warps
- iPc->setpos(sd,map[m].npc[i]->u.warp.mapindex,map[m].npc[i]->u.warp.x,map[m].npc[i]->u.warp.y,CLR_OUTSIGHT);
+ pc->setpos(sd,map[m].npc[i]->u.warp.mapindex,map[m].npc[i]->u.warp.x,map[m].npc[i]->u.warp.y,CLR_OUTSIGHT);
break;
case SCRIPT:
for (j = i; j < map[m].npc_num; j++) {
@@ -966,7 +966,7 @@ int npc_touch_areanpc(struct map_session_data* sd, int16 m, int16 x, int16 y)
(sd->bl.y >= (map[m].npc[j]->bl.y - map[m].npc[j]->u.warp.ys) && sd->bl.y <= (map[m].npc[j]->bl.y + map[m].npc[j]->u.warp.ys))) {
if( pc_ishiding(sd) || (sd->sc.count && sd->sc.data[SC_CAMOUFLAGE]) )
break; // hidden chars cannot use warps
- iPc->setpos(sd,map[m].npc[j]->u.warp.mapindex,map[m].npc[j]->u.warp.x,map[m].npc[j]->u.warp.y,CLR_OUTSIGHT);
+ pc->setpos(sd,map[m].npc[j]->u.warp.mapindex,map[m].npc[j]->u.warp.x,map[m].npc[j]->u.warp.y,CLR_OUTSIGHT);
found_warp = 1;
break;
}
@@ -1335,7 +1335,7 @@ int npc_cashshop_buylist(struct map_session_data *sd, int points, int count, uns
amount = item_list[i*2+0] = 1;
}
- switch( iPc->checkadditem(sd,nameid,amount) )
+ switch( pc->checkadditem(sd,nameid,amount) )
{
case ADDITEM_NEW:
new_++;
@@ -1350,14 +1350,14 @@ int npc_cashshop_buylist(struct map_session_data *sd, int points, int count, uns
if( w + sd->weight > sd->max_weight )
return 3;
- if( iPc->inventoryblank(sd) < new_ )
+ if( pc->inventoryblank(sd) < new_ )
return 3;
if( points > vt ) points = vt;
// Payment Process ----------------------------------------------------
if( sd->kafraPoints < points || sd->cashPoints < (vt - points) )
return 6;
- iPc->paycash(sd,vt,points);
+ pc->paycash(sd,vt,points);
// Delivery Process ----------------------------------------------------
for( i = 0; i < count; i++ )
@@ -1373,7 +1373,7 @@ int npc_cashshop_buylist(struct map_session_data *sd, int points, int count, uns
{
item_tmp.nameid = nameid;
item_tmp.identify = 1;
- iPc->additem(sd,&item_tmp,amount,LOG_TYPE_NPC);
+ pc->additem(sd,&item_tmp,amount,LOG_TYPE_NPC);
}
}
@@ -1443,10 +1443,10 @@ int npc_cashshop_buy(struct map_session_data *sd, int nameid, int amount, int po
amount = 1;
}
- switch( iPc->checkadditem(sd, nameid, amount) )
+ switch( pc->checkadditem(sd, nameid, amount) )
{
case ADDITEM_NEW:
- if( iPc->inventoryblank(sd) == 0 )
+ if( pc->inventoryblank(sd) == 0 )
return 3;
break;
case ADDITEM_OVERAMOUNT:
@@ -1472,7 +1472,7 @@ int npc_cashshop_buy(struct map_session_data *sd, int nameid, int amount, int po
if( (sd->kafraPoints < points) || (sd->cashPoints < price - points) )
return 6;
- iPc->paycash(sd, price, points);
+ pc->paycash(sd, price, points);
if( !pet_create_egg(sd, nameid) )
{
@@ -1481,7 +1481,7 @@ int npc_cashshop_buy(struct map_session_data *sd, int nameid, int amount, int po
item_tmp.nameid = nameid;
item_tmp.identify = 1;
- iPc->additem(sd,&item_tmp, amount, LOG_TYPE_NPC);
+ pc->additem(sd,&item_tmp, amount, LOG_TYPE_NPC);
}
return 0;
@@ -1541,7 +1541,7 @@ int npc_buylist(struct map_session_data* sd, int n, unsigned short* item_list)
continue;
}
- switch( iPc->checkadditem(sd,nameid,amount) ) {
+ switch( pc->checkadditem(sd,nameid,amount) ) {
case ADDITEM_EXIST:
break;
@@ -1553,7 +1553,7 @@ int npc_buylist(struct map_session_data* sd, int n, unsigned short* item_list)
return 2;
}
- value = iPc->modifybuyvalue(sd,value);
+ value = pc->modifybuyvalue(sd,value);
z += (double)value * amount;
w += itemdb_weight(nameid) * amount;
@@ -1566,10 +1566,10 @@ int npc_buylist(struct map_session_data* sd, int n, unsigned short* item_list)
return 1; // Not enough Zeny
if( w + sd->weight > sd->max_weight )
return 2; // Too heavy
- if( iPc->inventoryblank(sd) < new_ )
+ if( pc->inventoryblank(sd) < new_ )
return 3; // Not enough space to store items
- iPc->payzeny(sd,(int)z,LOG_TYPE_NPC, NULL);
+ pc->payzeny(sd,(int)z,LOG_TYPE_NPC, NULL);
for( i = 0; i < n; ++i ) {
int nameid = item_list[i*2+1];
@@ -1583,12 +1583,12 @@ int npc_buylist(struct map_session_data* sd, int n, unsigned short* item_list)
item_tmp.nameid = nameid;
item_tmp.identify = 1;
- iPc->additem(sd,&item_tmp,amount,LOG_TYPE_NPC);
+ pc->additem(sd,&item_tmp,amount,LOG_TYPE_NPC);
}
}
// custom merchant shop exp bonus
- if( battle_config.shop_exp > 0 && z > 0 && (skill_t = iPc->checkskill2(sd,idx)) > 0 ) {
+ if( battle_config.shop_exp > 0 && z > 0 && (skill_t = pc->checkskill2(sd,idx)) > 0 ) {
if( sd->status.skill[idx].flag >= SKILL_FLAG_REPLACED_LV_0 )
skill_t = sd->status.skill[idx].flag - SKILL_FLAG_REPLACED_LV_0;
@@ -1596,7 +1596,7 @@ int npc_buylist(struct map_session_data* sd, int n, unsigned short* item_list)
z = z * (double)skill_t * (double)battle_config.shop_exp/10000.;
if( z < 1 )
z = 1;
- iPc->gainexp(sd,NULL,0,(int)z, false);
+ pc->gainexp(sd,NULL,0,(int)z, false);
}
}
@@ -1700,7 +1700,7 @@ int npc_selllist(struct map_session_data* sd, int n, unsigned short* item_list)
continue;
}
- value = iPc->modifysellvalue(sd, sd->inventory_data[idx]->value_sell);
+ value = pc->modifysellvalue(sd, sd->inventory_data[idx]->value_sell);
z+= (double)value*amount;
}
@@ -1722,16 +1722,16 @@ int npc_selllist(struct map_session_data* sd, int n, unsigned short* item_list)
}
}
- iPc->delitem(sd, idx, amount, 0, 6, LOG_TYPE_NPC);
+ pc->delitem(sd, idx, amount, 0, 6, LOG_TYPE_NPC);
}
if( z > MAX_ZENY )
z = MAX_ZENY;
- iPc->getzeny(sd, (int)z, LOG_TYPE_NPC, NULL);
+ pc->getzeny(sd, (int)z, LOG_TYPE_NPC, NULL);
// custom merchant shop exp bonus
- if( battle_config.shop_exp > 0 && z > 0 && ( skill_t = iPc->checkskill2(sd,idx) ) > 0) {
+ if( battle_config.shop_exp > 0 && z > 0 && ( skill_t = pc->checkskill2(sd,idx) ) > 0) {
if( sd->status.skill[idx].flag >= SKILL_FLAG_REPLACED_LV_0 )
skill_t = sd->status.skill[idx].flag - SKILL_FLAG_REPLACED_LV_0;
@@ -1739,7 +1739,7 @@ int npc_selllist(struct map_session_data* sd, int n, unsigned short* item_list)
z = z * (double)skill_t * (double)battle_config.shop_exp/10000.;
if( z < 1 )
z = 1;
- iPc->gainexp(sd, NULL, 0, (int)z, false);
+ pc->gainexp(sd, NULL, 0, (int)z, false);
}
}
diff --git a/src/map/party.c b/src/map/party.c
index a7a002404..c0fe65d53 100644
--- a/src/map/party.c
+++ b/src/map/party.c
@@ -832,7 +832,7 @@ int party_skill_check(struct map_session_data *sd, int party_id, uint16 skill_id
switch(skill_id) {
case TK_COUNTER: //Increase Triple Attack rate of Monks.
if((p_sd->class_&MAPID_UPPERMASK) == MAPID_MONK
- && iPc->checkskill(p_sd,MO_TRIPLEATTACK)) {
+ && pc->checkskill(p_sd,MO_TRIPLEATTACK)) {
sc_start4(&p_sd->bl,SC_SKILLRATE_UP,100,MO_TRIPLEATTACK,
50+50*skill_lv, //+100/150/200% rate
0,0,skill->get_time(SG_FRIEND, 1));
@@ -841,9 +841,9 @@ int party_skill_check(struct map_session_data *sd, int party_id, uint16 skill_id
case MO_COMBOFINISH: //Increase Counter rate of Star Gladiators
if((p_sd->class_&MAPID_UPPERMASK) == MAPID_STAR_GLADIATOR
&& sd->sc.data[SC_READYCOUNTER]
- && iPc->checkskill(p_sd,SG_FRIEND)) {
+ && pc->checkskill(p_sd,SG_FRIEND)) {
sc_start4(&p_sd->bl,SC_SKILLRATE_UP,100,TK_COUNTER,
- 50+50*iPc->checkskill(p_sd,SG_FRIEND), //+100/150/200% rate
+ 50+50*pc->checkskill(p_sd,SG_FRIEND), //+100/150/200% rate
0,0,skill->get_time(SG_FRIEND, 1));
}
break;
@@ -948,15 +948,15 @@ int party_exp_share(struct party_data* p, struct block_list* src, unsigned int b
for (i = 0; i < c; i++) {
#ifdef RENEWAL_EXP
if( !(src && src->type == BL_MOB && ((TBL_MOB*)src)->db->mexp) ){
- int rate = iPc->level_penalty_mod(sd[i], (TBL_MOB*)src, 1);
+ int rate = pc->level_penalty_mod(sd[i], (TBL_MOB*)src, 1);
base_exp = (unsigned int)cap_value(base_exp_bonus * rate / 100, 1, UINT_MAX);
job_exp = (unsigned int)cap_value(job_exp_bonus * rate / 100, 1, UINT_MAX);
}
#endif
- iPc->gainexp(sd[i], src, base_exp, job_exp, false);
+ pc->gainexp(sd[i], src, base_exp, job_exp, false);
if (zeny) // zeny from mobs [Valaris]
- iPc->getzeny(sd[i],zeny,LOG_TYPE_PICKDROP_MONSTER,NULL);
+ pc->getzeny(sd[i],zeny,LOG_TYPE_PICKDROP_MONSTER,NULL);
}
return 0;
}
@@ -981,7 +981,7 @@ int party_share_loot(struct party_data* p, struct map_session_data* sd, struct i
if( (psd = p->data[i].sd) == NULL || sd->bl.m != psd->bl.m || pc_isdead(psd) || (battle_config.idle_no_share && pc_isidle(psd)) )
continue;
- if (iPc->additem(psd,item_data,item_data->amount,LOG_TYPE_PICKDROP_PLAYER))
+ if (pc->additem(psd,item_data,item_data->amount,LOG_TYPE_PICKDROP_PLAYER))
continue; //Chosen char can't pick up loot.
//Successful pick.
@@ -1003,7 +1003,7 @@ int party_share_loot(struct party_data* p, struct map_session_data* sd, struct i
}
while (count > 0) { //Pick a random member.
i = rnd()%count;
- if (iPc->additem(psd[i],item_data,item_data->amount,LOG_TYPE_PICKDROP_PLAYER))
+ if (pc->additem(psd[i],item_data,item_data->amount,LOG_TYPE_PICKDROP_PLAYER))
{ //Discard this receiver.
psd[i] = psd[count-1];
count--;
@@ -1017,7 +1017,7 @@ int party_share_loot(struct party_data* p, struct map_session_data* sd, struct i
if (!target) {
target = sd; //Give it to the char that picked it up
- if ((i=iPc->additem(sd,item_data,item_data->amount,LOG_TYPE_PICKDROP_PLAYER)))
+ if ((i=pc->additem(sd,item_data,item_data->amount,LOG_TYPE_PICKDROP_PLAYER)))
return i;
}
diff --git a/src/map/path.c b/src/map/path.c
index 8ab63d390..95895cb2a 100644
--- a/src/map/path.c
+++ b/src/map/path.c
@@ -419,7 +419,7 @@ bool path_search(struct walkpath_data *wpd,int16 m,int16 x0,int16 y0,int16 x1,in
}
-//Distance functions, taken from http://www.flipcode.com/articles/article_fastdistance.shtml
+//Distance functions, taken from http://www.flpcode.com/articles/article_fastdistance.shtml
int check_distance(int dx, int dy, int distance)
{
#ifdef CIRCULAR_AREA
diff --git a/src/map/pc.c b/src/map/pc.c
index b5d5e3140..2b00dc78b 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -424,7 +424,7 @@ static int pc_inventory_rental_end(int tid, unsigned int tick, int id, intptr_t
return 0;
}
- iPc->inventory_rentals(sd);
+ pc->inventory_rentals(sd);
return 1;
}
@@ -457,7 +457,7 @@ void pc_inventory_rentals(struct map_session_data *sd)
status_change_end(&sd->bl,SC_ALL_RIDING,INVALID_TIMER);
}
clif->rental_expired(sd->fd, i, sd->status.inventory[i].nameid);
- iPc->delitem(sd, i, sd->status.inventory[i].amount, 0, 0, LOG_TYPE_OTHER);
+ pc->delitem(sd, i, sd->status.inventory[i].amount, 0, 0, LOG_TYPE_OTHER);
} else {
expire_tick = (unsigned int)(sd->status.inventory[i].expire_time - time(NULL)) * 1000;
clif->rental_time(sd->fd, sd->status.inventory[i].nameid, (int)(expire_tick / 1000));
@@ -485,7 +485,7 @@ void pc_inventory_rental_add(struct map_session_data *sd, int seconds)
td = iTimer->get_timer(sd->rental_timer);
if( DIFF_TICK(td->tick, iTimer->gettick()) > tick )
{ // Update Timer as this one ends first than the current one
- iPc->inventory_rental_clear(sd);
+ pc->inventory_rental_clear(sd);
sd->rental_timer = iTimer->add_timer(iTimer->gettick() + tick, pc_inventory_rental_end, sd->bl.id, 0);
}
}
@@ -520,7 +520,7 @@ int pc_makesavestatus(struct map_session_data *sd)
#endif
if (sd->sc.data[SC_JAILED]) { //When Jailed, do not move last point.
if(pc_isdead(sd)){
- iPc->setrestartvalue(sd,0);
+ pc->setrestartvalue(sd,0);
} else {
sd->status.hp = sd->battle_status.hp;
sd->status.sp = sd->battle_status.sp;
@@ -532,7 +532,7 @@ int pc_makesavestatus(struct map_session_data *sd)
}
if(pc_isdead(sd)){
- iPc->setrestartvalue(sd,0);
+ pc->setrestartvalue(sd,0);
memcpy(&sd->status.last_point,&sd->status.save_point,sizeof(sd->status.last_point));
} else {
sd->status.hp = sd->battle_status.hp;
@@ -603,7 +603,7 @@ int pc_equippoint(struct map_session_data *sd,int n)
if(sd->inventory_data[n]->look == W_DAGGER ||
sd->inventory_data[n]->look == W_1HSWORD ||
sd->inventory_data[n]->look == W_1HAXE) {
- if(ep == EQP_HAND_R && (iPc->checkskill(sd,AS_LEFT) > 0 || (sd->class_&MAPID_UPPERMASK) == MAPID_ASSASSIN ||
+ if(ep == EQP_HAND_R && (pc->checkskill(sd,AS_LEFT) > 0 || (sd->class_&MAPID_UPPERMASK) == MAPID_ASSASSIN ||
(sd->class_&MAPID_UPPERMASK) == MAPID_KAGEROUOBORO))//Kagerou and Oboro can dual wield daggers. [Rytech]
return EQP_ARMS;
}
@@ -768,10 +768,10 @@ bool pc_can_Adopt(struct map_session_data *p1_sd, struct map_session_data *p2_sd
return false; // Both parents need to be in the same party
// Parents need to have their ring equipped
- if( !iPc->isequipped(p1_sd, WEDDING_RING_M) && !iPc->isequipped(p1_sd, WEDDING_RING_F) )
+ if( !pc->isequipped(p1_sd, WEDDING_RING_M) && !pc->isequipped(p1_sd, WEDDING_RING_F) )
return false;
- if( !iPc->isequipped(p2_sd, WEDDING_RING_M) && !iPc->isequipped(p2_sd, WEDDING_RING_F) )
+ if( !pc->isequipped(p2_sd, WEDDING_RING_M) && !pc->isequipped(p2_sd, WEDDING_RING_F) )
return false;
// Already adopted a baby
@@ -805,15 +805,15 @@ bool pc_adoption(struct map_session_data *p1_sd, struct map_session_data *p2_sd,
int job, joblevel;
unsigned int jobexp;
- if( !iPc->can_Adopt(p1_sd, p2_sd, b_sd) )
+ if( !pc->can_Adopt(p1_sd, p2_sd, b_sd) )
return false;
// Preserve current job levels and progress
joblevel = b_sd->status.job_level;
jobexp = b_sd->status.job_exp;
- job = iPc->mapid2jobid(b_sd->class_|JOBL_BABY, b_sd->status.sex);
- if( job != -1 && !iPc->jobchange(b_sd, job, 0) )
+ job = pc->mapid2jobid(b_sd->class_|JOBL_BABY, b_sd->status.sex);
+ if( job != -1 && !pc->jobchange(b_sd, job, 0) )
{ // Success, proceed to configure parents and baby skills
p1_sd->status.child = b_sd->status.char_id;
p2_sd->status.child = b_sd->status.char_id;
@@ -827,12 +827,12 @@ bool pc_adoption(struct map_session_data *p1_sd, struct map_session_data *p2_sd,
clif->updatestatus(b_sd, SP_JOBEXP);
// Baby Skills
- iPc->skill(b_sd, WE_BABY, 1, 0);
- iPc->skill(b_sd, WE_CALLPARENT, 1, 0);
+ pc->skill(b_sd, WE_BABY, 1, 0);
+ pc->skill(b_sd, WE_CALLPARENT, 1, 0);
// Parents Skills
- iPc->skill(p1_sd, WE_CALLBABY, 1, 0);
- iPc->skill(p2_sd, WE_CALLBABY, 1, 0);
+ pc->skill(p1_sd, WE_CALLBABY, 1, 0);
+ pc->skill(p2_sd, WE_CALLBABY, 1, 0);
return true;
}
@@ -935,7 +935,7 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
}
//Set the map-server used job id. [Skotlex]
- i = iPc->jobid2mapid(sd->status.class_);
+ i = pc->jobid2mapid(sd->status.class_);
if (i == -1) { //Invalid class?
ShowError("pc_authok: Invalid class %d for player %s (%d:%d). Class was changed to novice.\n", sd->status.class_, sd->status.name, sd->status.account_id, sd->status.char_id);
sd->status.class_ = JOB_NOVICE;
@@ -1005,10 +1005,10 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
if (!(battle_config.display_skill_fail&2))
sd->state.showdelay = 1;
- iPc->setinventorydata(sd);
+ pc->setinventorydata(sd);
pc_setequipindex(sd);
- if( sd->status.option & OPTION_INVISIBLE && !iPc->can_use_command(sd, "@hide") )
+ if( sd->status.option & OPTION_INVISIBLE && !pc->can_use_command(sd, "@hide") )
sd->status.option &=~ OPTION_INVISIBLE;
status_change_init(&sd->bl);
@@ -1047,11 +1047,11 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
sd->hate_mob[i] = -1;
//warp player
- if ((i=iPc->setpos(sd,sd->status.last_point.map, sd->status.last_point.x, sd->status.last_point.y, CLR_OUTSIGHT)) != 0) {
+ if ((i=pc->setpos(sd,sd->status.last_point.map, sd->status.last_point.x, sd->status.last_point.y, CLR_OUTSIGHT)) != 0) {
ShowError ("Last_point_map %s - id %d not found (error code %d)\n", mapindex_id2name(sd->status.last_point.map), sd->status.last_point.map, i);
// try warping to a default map instead (church graveyard)
- if (iPc->setpos(sd, mapindex_name2id(MAP_PRONTERA), 273, 354, CLR_OUTSIGHT) != 0) {
+ if (pc->setpos(sd, mapindex_name2id(MAP_PRONTERA), 273, 354, CLR_OUTSIGHT) != 0) {
// if we fail again
clif->authfail_fd(sd->fd, 0);
return false;
@@ -1109,7 +1109,7 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
/**
* Check if player have any item cooldowns on
**/
- iPc->itemcd_do(sd,true);
+ pc->itemcd_do(sd,true);
/* [Ind/Hercules] */
sd->sc_display = NULL;
@@ -1191,7 +1191,7 @@ int pc_reg_received(struct map_session_data *sd)
sd->hate_mob[i] = pc_readglobalreg(sd,sg_info[i].hate_var)-1;
}
- if ((i = iPc->checkskill(sd,RG_PLAGIARISM)) > 0) {
+ if ((i = pc->checkskill(sd,RG_PLAGIARISM)) > 0) {
sd->cloneskill_id = pc_readglobalreg(sd,"CLONE_SKILL");
if (sd->cloneskill_id > 0 && (idx = skill->get_index(sd->cloneskill_id))) {
sd->status.skill[idx].id = sd->cloneskill_id;
@@ -1201,7 +1201,7 @@ int pc_reg_received(struct map_session_data *sd)
sd->status.skill[idx].flag = SKILL_FLAG_PLAGIARIZED;
}
}
- if ((i = iPc->checkskill(sd,SC_REPRODUCE)) > 0) {
+ if ((i = pc->checkskill(sd,SC_REPRODUCE)) > 0) {
sd->reproduceskill_id = pc_readglobalreg(sd,"REPRODUCE_SKILL");
if( sd->reproduceskill_id > 0 && (idx = skill->get_index(sd->reproduceskill_id))) {
sd->status.skill[idx].id = sd->reproduceskill_id;
@@ -1238,7 +1238,7 @@ int pc_reg_received(struct map_session_data *sd)
if (!chrif_auth_finished(sd))
ShowError("pc_reg_received: Failed to properly remove player %d:%d from logging db!\n", sd->status.account_id, sd->status.char_id);
- iPc->load_combo(sd);
+ pc->load_combo(sd);
status_calc_pc(sd,1);
chrif_scdata_request(sd->status.account_id, sd->status.char_id);
@@ -1251,7 +1251,7 @@ int pc_reg_received(struct map_session_data *sd)
clif->pLoadEndAck(sd->fd, sd);
}
- iPc->inventory_rentals(sd);
+ pc->inventory_rentals(sd);
if( sd->sc.option & OPTION_INVISIBLE ) {
sd->vd.class_ = INVISIBLE_CLASS;
@@ -1260,7 +1260,7 @@ int pc_reg_received(struct map_session_data *sd)
map[sd->bl.m].users_pvp--;
if( map[sd->bl.m].flag.pvp && !map[sd->bl.m].flag.pvp_nocalcrank && sd->pvp_timer != INVALID_TIMER ) {// unregister the player for ranking
- iTimer->delete_timer( sd->pvp_timer, iPc->calc_pvprank_timer );
+ iTimer->delete_timer( sd->pvp_timer, pc->calc_pvprank_timer );
sd->pvp_timer = INVALID_TIMER;
}
clif->changeoption(&sd->bl);
@@ -1279,7 +1279,7 @@ static int pc_calc_skillpoint(struct map_session_data* sd)
nullpo_ret(sd);
for(i=1;i<MAX_SKILL;i++){
- if( (skill_lv = iPc->checkskill2(sd,i)) > 0) {
+ if( (skill_lv = pc->checkskill2(sd,i)) > 0) {
inf2 = skill_db[i].inf2;
if((!(inf2&INF2_QUEST_SKILL) || battle_config.quest_skill_learn) &&
!(inf2&(INF2_WEDDING_SKILL|INF2_SPIRIT_SKILL)) //Do not count wedding/link skills. [Skotlex]
@@ -1305,14 +1305,14 @@ int pc_calc_skilltree(struct map_session_data *sd)
int c=0;
nullpo_ret(sd);
- i = iPc->calc_skilltree_normalize_job(sd);
- c = iPc->mapid2jobid(i, sd->status.sex);
+ i = pc->calc_skilltree_normalize_job(sd);
+ c = pc->mapid2jobid(i, sd->status.sex);
if( c == -1 )
{ //Unable to normalize job??
ShowError("pc_calc_skilltree: Unable to normalize job %d for character %s (%d:%d)\n", i, sd->status.name, sd->status.account_id, sd->status.char_id);
return 1;
}
- c = iPc->class2idx(c);
+ c = pc->class2idx(c);
for( i = 0; i < MAX_SKILL; i++ ) {
if( sd->status.skill[i].flag != SKILL_FLAG_PLAGIARIZED && sd->status.skill[i].flag != SKILL_FLAG_PERM_GRANTED ) //Don't touch these
@@ -1410,7 +1410,7 @@ int pc_calc_skilltree(struct map_session_data *sd)
else if (sd->status.skill[idx2].flag >= SKILL_FLAG_REPLACED_LV_0) //Real lerned level
k = sd->status.skill[idx2].flag - SKILL_FLAG_REPLACED_LV_0;
else
- k = iPc->checkskill2(sd,idx2);
+ k = pc->checkskill2(sd,idx2);
if (k < skill_tree[c][i].need[j].lv) {
f = 0;
break;
@@ -1443,7 +1443,7 @@ int pc_calc_skilltree(struct map_session_data *sd)
} while(flag);
//
- if( c > 0 && (sd->class_&MAPID_UPPERMASK) == MAPID_TAEKWON && sd->status.base_level >= 90 && sd->status.skill_point == 0 && iPc->famerank(sd->status.char_id, MAPID_TAEKWON) )
+ if( c > 0 && (sd->class_&MAPID_UPPERMASK) == MAPID_TAEKWON && sd->status.base_level >= 90 && sd->status.skill_point == 0 && pc->famerank(sd->status.char_id, MAPID_TAEKWON) )
{
/* Taekwon Ranger Bonus Skill Tree
============================================
@@ -1479,13 +1479,13 @@ static void pc_check_skilltree(struct map_session_data *sd, int skill_id)
if(battle_config.skillfree)
return; //Function serves no purpose if this is set
- i = iPc->calc_skilltree_normalize_job(sd);
- c = iPc->mapid2jobid(i, sd->status.sex);
+ i = pc->calc_skilltree_normalize_job(sd);
+ c = pc->mapid2jobid(i, sd->status.sex);
if (c == -1) { //Unable to normalize job??
ShowError("pc_check_skilltree: Unable to normalize job %d for character %s (%d:%d)\n", i, sd->status.name, sd->status.account_id, sd->status.char_id);
return;
}
- c = iPc->class2idx(c);
+ c = pc->class2idx(c);
do {
flag = 0;
for( i = 0; i < MAX_SKILL_TREE && (id=skill_tree[c][i].id)>0; i++ ) {
@@ -1502,7 +1502,7 @@ static void pc_check_skilltree(struct map_session_data *sd, int skill_id)
else if( sd->status.skill[idx2].flag >= SKILL_FLAG_REPLACED_LV_0) //Real lerned level
k = sd->status.skill[idx2].flag - SKILL_FLAG_REPLACED_LV_0;
else
- k = iPc->checkskill2(sd,idx2);
+ k = pc->checkskill2(sd,idx2);
if( k < skill_tree[c][i].need[j].lv ) {
f = 0;
break;
@@ -1557,7 +1557,7 @@ int pc_calc_skilltree_normalize_job(struct map_session_data *sd)
skill_point = pc_calc_skillpoint(sd);
- novice_skills = max_level[iPc->class2idx(JOB_NOVICE)][1] - 1;
+ novice_skills = max_level[pc->class2idx(JOB_NOVICE)][1] - 1;
// limit 1st class and above to novice job levels
if(skill_point < novice_skills)
@@ -1574,7 +1574,7 @@ int pc_calc_skilltree_normalize_job(struct map_session_data *sd)
{
// if neither 2nd nor 3rd jobchange levels are known, we have to assume a default for 2nd
if (!sd->change_level_3rd)
- sd->change_level_2nd = max_level[iPc->class2idx(iPc->mapid2jobid(sd->class_&MAPID_UPPERMASK, sd->status.sex))][1];
+ sd->change_level_2nd = max_level[pc->class2idx(pc->mapid2jobid(sd->class_&MAPID_UPPERMASK, sd->status.sex))][1];
else
sd->change_level_2nd = 1 + skill_point + sd->status.skill_point
- (sd->status.job_level - 1)
@@ -1913,7 +1913,7 @@ int pc_delautobonus(struct map_session_data* sd, struct s_autobonus *autobonus,c
}
else
{ // Logout / Unequipped an item with an activated bonus
- iTimer->delete_timer(autobonus[i].active,iPc->endautobonus);
+ iTimer->delete_timer(autobonus[i].active,pc->endautobonus);
autobonus[i].active = INVALID_TIMER;
}
}
@@ -1941,7 +1941,7 @@ int pc_exeautobonus(struct map_session_data *sd,struct s_autobonus *autobonus)
script_run_autobonus(autobonus->other_script,sd->bl.id,sd->equip_index[j]);
}
- autobonus->active = iTimer->add_timer(iTimer->gettick()+autobonus->duration, iPc->endautobonus, sd->bl.id, (intptr_t)autobonus);
+ autobonus->active = iTimer->add_timer(iTimer->gettick()+autobonus->duration, pc->endautobonus, sd->bl.id, (intptr_t)autobonus);
sd->state.autobonus |= autobonus->pos;
status_calc_pc(sd,0);
@@ -3556,7 +3556,7 @@ int pc_insert_card(struct map_session_data* sd, int idx_card, int idx_equip)
// remember the card id to insert
nameid = sd->status.inventory[idx_card].nameid;
- if( iPc->delitem(sd,idx_card,1,1,0,LOG_TYPE_OTHER) == 1 )
+ if( pc->delitem(sd,idx_card,1,1,0,LOG_TYPE_OTHER) == 1 )
{// failed
clif->insert_card(sd,idx_equip,idx_card,1);
}
@@ -3581,9 +3581,9 @@ int pc_insert_card(struct map_session_data* sd, int idx_card, int idx_equip)
int pc_modifybuyvalue(struct map_session_data *sd,int orig_value)
{
int skill,val = orig_value,rate1 = 0,rate2 = 0;
- if((skill=iPc->checkskill(sd,MC_DISCOUNT))>0) // merchant discount
+ if((skill=pc->checkskill(sd,MC_DISCOUNT))>0) // merchant discount
rate1 = 5+skill*2-((skill==10)? 1:0);
- if((skill=iPc->checkskill(sd,RG_COMPULSION))>0) // rogue discount
+ if((skill=pc->checkskill(sd,RG_COMPULSION))>0) // rogue discount
rate2 = 5+skill*4;
if(rate1 < rate2) rate1 = rate2;
if(rate1)
@@ -3600,7 +3600,7 @@ int pc_modifybuyvalue(struct map_session_data *sd,int orig_value)
int pc_modifysellvalue(struct map_session_data *sd,int orig_value)
{
int skill,val = orig_value,rate = 0;
- if((skill=iPc->checkskill(sd,MC_OVERCHARGE))>0) //OverCharge
+ if((skill=pc->checkskill(sd,MC_OVERCHARGE))>0) //OverCharge
rate = 5+skill*2-((skill==10)? 1:0);
if(rate)
val = (int)((double)orig_value*(double)(100+rate)/100.);
@@ -3889,7 +3889,7 @@ int pc_additem(struct map_session_data *sd,struct item *item_data,int amount,e_l
if( i >= MAX_INVENTORY )
{
- i = iPc->search_inventory(sd,0);
+ i = pc->search_inventory(sd,0);
if( i < 0 )
return 4;
@@ -3912,17 +3912,17 @@ int pc_additem(struct map_session_data *sd,struct item *item_data,int amount,e_l
clif->updatestatus(sd,SP_WEIGHT);
//Auto-equip
if(data->flag.autoequip)
- iPc->equipitem(sd, i, data->equip);
+ pc->equipitem(sd, i, data->equip);
/* rental item check */
if( item_data->expire_time ) {
if( time(NULL) > item_data->expire_time ) {
clif->rental_expired(sd->fd, i, sd->status.inventory[i].nameid);
- iPc->delitem(sd, i, sd->status.inventory[i].amount, 1, 0, LOG_TYPE_OTHER);
+ pc->delitem(sd, i, sd->status.inventory[i].amount, 1, 0, LOG_TYPE_OTHER);
} else {
int seconds = (int)( item_data->expire_time - time(NULL) );
clif->rental_time(sd->fd, sd->status.inventory[i].nameid, seconds);
- iPc->inventory_rental_add(sd, seconds);
+ pc->inventory_rental_add(sd, seconds);
}
}
@@ -3952,7 +3952,7 @@ int pc_delitem(struct map_session_data *sd,int n,int amount,int type, short reas
sd->weight -= sd->inventory_data[n]->weight*amount ;
if( sd->status.inventory[n].amount <= 0 ){
if(sd->status.inventory[n].equip)
- iPc->unequipitem(sd,n,3);
+ pc->unequipitem(sd,n,3);
memset(&sd->status.inventory[n],0,sizeof(sd->status.inventory[0]));
sd->inventory_data[n] = NULL;
}
@@ -3984,7 +3984,7 @@ int pc_dropitem(struct map_session_data *sd,int n,int amount)
sd->status.inventory[n].amount <= 0 ||
sd->status.inventory[n].amount < amount ||
sd->state.trading || sd->state.vending ||
- !sd->inventory_data[n] //iPc->delitem would fail on this case.
+ !sd->inventory_data[n] //pc->delitem would fail on this case.
)
return 0;
@@ -3994,7 +3994,7 @@ int pc_dropitem(struct map_session_data *sd,int n,int amount)
return 0; //Can't drop items in nodrop mapflag maps.
}
- if( !iPc->candrop(sd,&sd->status.inventory[n]) )
+ if( !pc->candrop(sd,&sd->status.inventory[n]) )
{
clif->message (sd->fd, msg_txt(263));
return 0;
@@ -4003,7 +4003,7 @@ int pc_dropitem(struct map_session_data *sd,int n,int amount)
if (!iMap->addflooritem(&sd->status.inventory[n], amount, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 2))
return 0;
- iPc->delitem(sd, n, amount, 1, 0, LOG_TYPE_PICKDROP_PLAYER);
+ pc->delitem(sd, n, amount, 1, 0, LOG_TYPE_PICKDROP_PLAYER);
clif->dropitem(sd, n, amount);
return 1;
}
@@ -4103,7 +4103,7 @@ int pc_isUseitem(struct map_session_data *sd,int n)
if( !item->script ) //if it has no script, you can't really consume it!
return 0;
- if( (item->item_usage.flag&NOUSE_SITTING) && (pc_issit(sd) == 1) && (iPc->get_group_level(sd) < item->item_usage.override) ) {
+ if( (item->item_usage.flag&NOUSE_SITTING) && (pc_issit(sd) == 1) && (pc->get_group_level(sd) < item->item_usage.override) ) {
clif->msgtable(sd->fd,664);
//clif->colormes(sd->fd,COLOR_WHITE,msg_txt(1474));
return 0; // You cannot use this item while sitting.
@@ -4268,7 +4268,7 @@ int pc_useitem(struct map_session_data *sd,int n)
if( !pc_isUseitem(sd,n) )
return 0;
- // Store information for later use before it is lost (via iPc->delitem) [Paradox924X]
+ // Store information for later use before it is lost (via pc->delitem) [Paradox924X]
nameid = sd->inventory_data[n]->nameid;
if (nameid != ITEMID_NAUTHIZ && sd->sc.opt1 > 0 && sd->sc.opt1 != OPT1_STONEWAIT && sd->sc.opt1 != OPT1_BURNING)
@@ -4348,7 +4348,7 @@ int pc_useitem(struct map_session_data *sd,int n)
if( map[sd->bl.m].zone->disabled_items[i] == nameid ) {
if( battle_config.item_restricted_consumption_type ) {
clif->useitemack(sd,n,sd->status.inventory[n].amount-1,true);
- iPc->delitem(sd,n,1,1,0,LOG_TYPE_CONSUME);
+ pc->delitem(sd,n,1,1,0,LOG_TYPE_CONSUME);
}
return 0;
}
@@ -4367,12 +4367,12 @@ int pc_useitem(struct map_session_data *sd,int n)
else {
if( sd->status.inventory[n].expire_time == 0 ) {
clif->useitemack(sd,n,amount-1,true);
- iPc->delitem(sd,n,1,1,0,LOG_TYPE_CONSUME); // Rental Usable Items are not deleted until expiration
+ pc->delitem(sd,n,1,1,0,LOG_TYPE_CONSUME); // Rental Usable Items are not deleted until expiration
} else
clif->useitemack(sd,n,0,false);
}
if(sd->status.inventory[n].card[0]==CARD0_CREATE &&
- iPc->famerank(MakeDWord(sd->status.inventory[n].card[2],sd->status.inventory[n].card[3]), MAPID_ALCHEMIST))
+ pc->famerank(MakeDWord(sd->status.inventory[n].card[2],sd->status.inventory[n].card[3]), MAPID_ALCHEMIST))
{
potion_flag = 2; // Famous player's potions have 50% more efficiency
if (sd->sc.data[SC_SPIRIT] && sd->sc.data[SC_SPIRIT]->val2 == SL_ROGUE)
@@ -4412,7 +4412,7 @@ int pc_cart_additem(struct map_session_data *sd,struct item *item_data,int amoun
return 1;
}
- if( !itemdb_cancartstore(item_data, iPc->get_group_level(sd)) )
+ if( !itemdb_cancartstore(item_data, pc->get_group_level(sd)) )
{ // Check item trade restrictions [Skotlex]
clif->message (sd->fd, msg_txt(264));
return 1;
@@ -4507,8 +4507,8 @@ int pc_putitemtocart(struct map_session_data *sd,int idx,int amount)
if( item_data->nameid == 0 || amount < 1 || item_data->amount < amount || sd->state.vending )
return 1;
- if( iPc->cart_additem(sd,item_data,amount,LOG_TYPE_NONE) == 0 )
- return iPc->delitem(sd,idx,amount,0,5,LOG_TYPE_NONE);
+ if( pc->cart_additem(sd,item_data,amount,LOG_TYPE_NONE) == 0 )
+ return pc->delitem(sd,idx,amount,0,5,LOG_TYPE_NONE);
return 1;
}
@@ -4535,7 +4535,7 @@ int pc_cartitem_amount(struct map_session_data* sd, int idx, int amount)
/*==========================================
* Retrieve an item at index idx from cart.
* Return:
- * 0 = player not found or (FIXME) succes (from iPc->cart_delitem)
+ * 0 = player not found or (FIXME) succes (from pc->cart_delitem)
* 1 = failure
*------------------------------------------*/
int pc_getitemfromcart(struct map_session_data *sd,int idx,int amount)
@@ -4552,8 +4552,8 @@ int pc_getitemfromcart(struct map_session_data *sd,int idx,int amount)
if(item_data->nameid==0 || amount < 1 || item_data->amount<amount || sd->state.vending )
return 1;
- if((flag = iPc->additem(sd,item_data,amount,LOG_TYPE_NONE)) == 0)
- return iPc->cart_delitem(sd,idx,amount,0,LOG_TYPE_NONE);
+ if((flag = pc->additem(sd,item_data,amount,LOG_TYPE_NONE)) == 0)
+ return pc->cart_delitem(sd,idx,amount,0,LOG_TYPE_NONE);
clif->additem(sd,0,0,flag);
return 1;
@@ -4636,7 +4636,7 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl, uint16 skil
tmp_item.nameid = itemid;
tmp_item.amount = 1;
tmp_item.identify = itemdb_isidentified2(data);
- flag = iPc->additem(sd,&tmp_item,1,LOG_TYPE_PICKDROP_PLAYER);
+ flag = pc->additem(sd,&tmp_item,1,LOG_TYPE_PICKDROP_PLAYER);
//TODO: Should we disable stealing when the item you stole couldn't be added to your inventory? Perhaps players will figure out a way to exploit this behaviour otherwise?
md->state.steal_flag = UCHAR_MAX; //you can't steal from this mob any more
@@ -4683,13 +4683,13 @@ int pc_steal_coin(struct map_session_data *sd,struct block_list *target)
return 0;
// FIXME: This formula is either custom or outdated.
- skill = iPc->checkskill(sd,RG_STEALCOIN)*10;
+ skill = pc->checkskill(sd,RG_STEALCOIN)*10;
rate = skill + (sd->status.base_level - md->level)*3 + sd->battle_status.dex*2 + sd->battle_status.luk*2;
if(rnd()%1000 < rate)
{
int amount = md->level*10 + rnd()%100;
- iPc->getzeny(sd, amount, LOG_TYPE_STEAL, NULL);
+ pc->getzeny(sd, amount, LOG_TYPE_STEAL, NULL);
md->state.steal_coin_flag = 1;
return 1;
}
@@ -4714,8 +4714,8 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y
}
if( pc_isdead(sd) ) { //Revive dead people before warping them
- iPc->setstand(sd);
- iPc->setrestartvalue(sd,1);
+ pc->setstand(sd);
+ pc->setrestartvalue(sd,1);
}
m = iMap->mapindex2mapid(mapindex);
@@ -4771,7 +4771,7 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y
for( i = 0; i < sd->queues_count; i++ ) {
struct hQueue *queue;
if( (queue = script->queue(sd->queues[i])) && queue->onMapChange[0] != '\0' ) {
- iPc->setregstr(sd, add_str("QMapChangeTo"), map[m].name);
+ pc->setregstr(sd, add_str("QMapChangeTo"), map[m].name);
npc_event(sd, queue->onMapChange, 0);
}
}
@@ -4799,8 +4799,8 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y
}
for( i = 0; i < EQI_MAX; i++ ) {
if( sd->equip_index[ i ] >= 0 )
- if( !iPc->isequip( sd , sd->equip_index[ i ] ) )
- iPc->unequipitem( sd , sd->equip_index[ i ] , 2 );
+ if( !pc->isequip( sd , sd->equip_index[ i ] ) )
+ pc->unequipitem( sd , sd->equip_index[ i ] , 2 );
}
if (battle_config.clear_unit_onwarp&BL_PC)
skill->clear_unitgroup(&sd->bl);
@@ -4836,7 +4836,7 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y
sd->mapindex = mapindex;
sd->bl.x=x;
sd->bl.y=y;
- iPc->clean_skilltree(sd);
+ pc->clean_skilltree(sd);
chrif_save(sd,2);
chrif_changemapserver(sd, ip, (short)port);
@@ -4909,7 +4909,7 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y
* Warp player sd to random location on current map.
* May fail if no walkable cell found (1000 attempts).
* Return:
- * 0 = fail or FIXME success (from iPc->setpos)
+ * 0 = fail or FIXME success (from pc->setpos)
* x(1|2) = fail
*------------------------------------------*/
int pc_randomwarp(struct map_session_data *sd, clr_type type)
@@ -4930,7 +4930,7 @@ int pc_randomwarp(struct map_session_data *sd, clr_type type)
}while(iMap->getcell(m,x,y,CELL_CHKNOPASS) && (i++)<1000 );
if (i < 1000)
- return iPc->setpos(sd,map[sd->bl.m].index,x,y,type);
+ return pc->setpos(sd,map[sd->bl.m].index,x,y,type);
return 0;
}
@@ -4956,7 +4956,7 @@ int pc_memo(struct map_session_data* sd, int pos)
return 0; // invalid input
// check required skill level
- skill = iPc->checkskill(sd, AL_WARP);
+ skill = pc->checkskill(sd, AL_WARP);
if( skill < 1 ) {
clif->skill_memomessage(sd,2); // "You haven't learned Warp."
return 0;
@@ -5616,7 +5616,7 @@ int pc_follow_timer(int tid, unsigned int tick, int id, intptr_t data)
if (tbl == NULL || pc_isdead(sd) || status_isdead(tbl))
{
- iPc->stop_following(sd);
+ pc->stop_following(sd);
return 0;
}
@@ -5629,7 +5629,7 @@ int pc_follow_timer(int tid, unsigned int tick, int id, intptr_t data)
if (!check_distance_bl(&sd->bl, tbl, 5))
unit_walktobl(&sd->bl, tbl, 5, 0);
} else
- iPc->setpos(sd, map_id2index(tbl->m), tbl->x, tbl->y, CLR_TELEPORT);
+ pc->setpos(sd, map_id2index(tbl->m), tbl->x, tbl->y, CLR_TELEPORT);
}
sd->followtimer = iTimer->add_timer(
tick + 1000, // increase time a bit to loosen up map's load
@@ -5659,7 +5659,7 @@ int pc_follow(struct map_session_data *sd,int target_id)
if (bl == NULL /*|| bl->type != BL_PC*/)
return 1;
if (sd->followtimer != INVALID_TIMER)
- iPc->stop_following(sd);
+ pc->stop_following(sd);
sd->followtarget = target_id;
pc_follow_timer(INVALID_TIMER, iTimer->gettick(), sd->bl.id, 0);
@@ -5668,7 +5668,7 @@ int pc_follow(struct map_session_data *sd,int target_id)
}
int pc_checkbaselevelup(struct map_session_data *sd) {
- unsigned int next = iPc->nextbaseexp(sd);
+ unsigned int next = pc->nextbaseexp(sd);
if (!next || sd->status.base_exp < next)
return 0;
@@ -5679,11 +5679,11 @@ int pc_checkbaselevelup(struct map_session_data *sd) {
if(!battle_config.multi_level_up && sd->status.base_exp > next-1)
sd->status.base_exp = next-1;
- next = iPc->gets_status_point(sd->status.base_level);
+ next = pc->gets_status_point(sd->status.base_level);
sd->status.base_level ++;
sd->status.status_point += next;
- } while ((next=iPc->nextbaseexp(sd)) > 0 && sd->status.base_exp >= next);
+ } while ((next=pc->nextbaseexp(sd)) > 0 && sd->status.base_exp >= next);
if (battle_config.pet_lv_rate && sd->pd) //<Skotlex> update pet's level
status_calc_pet(sd->pd,0);
@@ -5713,7 +5713,7 @@ int pc_checkbaselevelup(struct map_session_data *sd) {
if(sd->status.party_id)
iParty->send_levelup(sd);
- iPc->baselevelchanged(sd);
+ pc->baselevelchanged(sd);
return 1;
}
@@ -5723,7 +5723,7 @@ void pc_baselevelchanged(struct map_session_data *sd) {
for( i = 0; i < EQI_MAX; i++ ) {
if( sd->equip_index[i] >= 0 ) {
if( sd->inventory_data[ sd->equip_index[i] ]->elvmax && sd->status.base_level > (unsigned int)sd->inventory_data[ sd->equip_index[i] ]->elvmax )
- iPc->unequipitem(sd, sd->equip_index[i], 3);
+ pc->unequipitem(sd, sd->equip_index[i], 3);
}
}
#endif
@@ -5731,7 +5731,7 @@ void pc_baselevelchanged(struct map_session_data *sd) {
}
int pc_checkjoblevelup(struct map_session_data *sd)
{
- unsigned int next = iPc->nextjobexp(sd);
+ unsigned int next = pc->nextjobexp(sd);
nullpo_ret(sd);
if(!next || sd->status.job_exp < next)
@@ -5746,7 +5746,7 @@ int pc_checkjoblevelup(struct map_session_data *sd)
sd->status.job_level ++;
sd->status.skill_point ++;
- } while ((next=iPc->nextjobexp(sd)) > 0 && sd->status.job_exp >= next);
+ } while ((next=pc->nextjobexp(sd)) > 0 && sd->status.job_exp >= next);
clif->updatestatus(sd,SP_JOBLEVEL);
clif->updatestatus(sd,SP_JOBEXP);
@@ -5754,7 +5754,7 @@ int pc_checkjoblevelup(struct map_session_data *sd)
clif->updatestatus(sd,SP_SKILLPOINT);
status_calc_pc(sd,0);
clif->misceffect(&sd->bl,1);
- if (iPc->checkskill(sd, SG_DEVIL) && !iPc->nextjobexp(sd))
+ if (pc->checkskill(sd, SG_DEVIL) && !pc->nextjobexp(sd))
clif->status_change(&sd->bl,SI_DEVIL, 1, 0, 0, 0, 1); //Permanent blind effect from SG_DEVIL.
npc_script_event(sd, NPCE_JOBLVUP);
@@ -5809,8 +5809,8 @@ int pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned int
if(src) pc_calcexp(sd, &base_exp, &job_exp, src);
- nextb = iPc->nextbaseexp(sd);
- nextj = iPc->nextjobexp(sd);
+ nextb = pc->nextbaseexp(sd);
+ nextj = pc->nextjobexp(sd);
if(sd->state.showexp || battle_config.max_exp_gain_rate){
if (nextb > 0)
@@ -5836,22 +5836,22 @@ int pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned int
//Cap exp to the level up requirement of the previous level when you are at max level, otherwise cap at UINT_MAX (this is required for some S. Novice bonuses). [Skotlex]
if (base_exp) {
- nextb = nextb?UINT_MAX:iPc->thisbaseexp(sd);
+ nextb = nextb?UINT_MAX:pc->thisbaseexp(sd);
if(sd->status.base_exp > nextb - base_exp)
sd->status.base_exp = nextb;
else
sd->status.base_exp += base_exp;
- iPc->checkbaselevelup(sd);
+ pc->checkbaselevelup(sd);
clif->updatestatus(sd,SP_BASEEXP);
}
if (job_exp) {
- nextj = nextj?UINT_MAX:iPc->thisjobexp(sd);
+ nextj = nextj?UINT_MAX:pc->thisjobexp(sd);
if(sd->status.job_exp > nextj - job_exp)
sd->status.job_exp = nextj;
else
sd->status.job_exp += job_exp;
- iPc->checkjoblevelup(sd);
+ pc->checkjoblevelup(sd);
clif->updatestatus(sd,SP_JOBEXP);
}
@@ -5874,12 +5874,12 @@ int pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned int
*------------------------------------------*/
unsigned int pc_maxbaselv(struct map_session_data *sd)
{
- return max_level[iPc->class2idx(sd->status.class_)][0];
+ return max_level[pc->class2idx(sd->status.class_)][0];
}
unsigned int pc_maxjoblv(struct map_session_data *sd)
{
- return max_level[iPc->class2idx(sd->status.class_)][1];
+ return max_level[pc->class2idx(sd->status.class_)][1];
}
/*==========================================
@@ -5891,19 +5891,19 @@ unsigned int pc_nextbaseexp(struct map_session_data *sd)
{
nullpo_ret(sd);
- if(sd->status.base_level>=iPc->maxbaselv(sd) || sd->status.base_level<=0)
+ if(sd->status.base_level>=pc->maxbaselv(sd) || sd->status.base_level<=0)
return 0;
- return exp_table[iPc->class2idx(sd->status.class_)][0][sd->status.base_level-1];
+ return exp_table[pc->class2idx(sd->status.class_)][0][sd->status.base_level-1];
}
//Base exp needed for this level.
unsigned int pc_thisbaseexp(struct map_session_data *sd)
{
- if(sd->status.base_level>iPc->maxbaselv(sd) || sd->status.base_level<=1)
+ if(sd->status.base_level>pc->maxbaselv(sd) || sd->status.base_level<=1)
return 0;
- return exp_table[iPc->class2idx(sd->status.class_)][0][sd->status.base_level-2];
+ return exp_table[pc->class2idx(sd->status.class_)][0][sd->status.base_level-2];
}
@@ -5919,17 +5919,17 @@ unsigned int pc_nextjobexp(struct map_session_data *sd)
{
nullpo_ret(sd);
- if(sd->status.job_level>=iPc->maxjoblv(sd) || sd->status.job_level<=0)
+ if(sd->status.job_level>=pc->maxjoblv(sd) || sd->status.job_level<=0)
return 0;
- return exp_table[iPc->class2idx(sd->status.class_)][1][sd->status.job_level-1];
+ return exp_table[pc->class2idx(sd->status.class_)][1][sd->status.job_level-1];
}
//Job exp needed for this level.
unsigned int pc_thisjobexp(struct map_session_data *sd)
{
- if(sd->status.job_level>iPc->maxjoblv(sd) || sd->status.job_level<=1)
+ if(sd->status.job_level>pc->maxjoblv(sd) || sd->status.job_level<=1)
return 0;
- return exp_table[iPc->class2idx(sd->status.class_)][1][sd->status.job_level-2];
+ return exp_table[pc->class2idx(sd->status.class_)][1][sd->status.job_level-2];
}
/// Returns the value of the specified stat.
@@ -6020,7 +6020,7 @@ int pc_statusup(struct map_session_data* sd, int type)
nullpo_ret(sd);
// check conditions
- need = iPc->need_status_point(sd,type,1);
+ need = pc->need_status_point(sd,type,1);
if( type < SP_STR || type > SP_LUK || need < 0 || need > sd->status.status_point )
{
clif->statusupack(sd,type,0,0);
@@ -6042,7 +6042,7 @@ int pc_statusup(struct map_session_data* sd, int type)
status_calc_pc(sd,0);
// update increase cost indicator
- if( need != iPc->need_status_point(sd,type,1) )
+ if( need != pc->need_status_point(sd,type,1) )
clif->updatestatus(sd, SP_USTR + type-SP_STR);
// update statpoint count
@@ -6073,7 +6073,7 @@ int pc_statusup2(struct map_session_data* sd, int type, int val)
return 1;
}
- need = iPc->need_status_point(sd,type,1);
+ need = pc->need_status_point(sd,type,1);
// set new value
max = pc_maxparameter(sd);
@@ -6082,7 +6082,7 @@ int pc_statusup2(struct map_session_data* sd, int type, int val)
status_calc_pc(sd,0);
// update increase cost indicator
- if( need != iPc->need_status_point(sd,type,1) )
+ if( need != pc->need_status_point(sd,type,1) )
clif->updatestatus(sd, SP_USTR + type-SP_STR);
// update stat value
@@ -6123,8 +6123,8 @@ int pc_skillup(struct map_session_data *sd,uint16 skill_id) {
sd->status.skill_point--;
if( !skill_db[index].inf )
status_calc_pc(sd,0); // Only recalculate for passive skills.
- else if( sd->status.skill_point == 0 && (sd->class_&MAPID_UPPERMASK) == MAPID_TAEKWON && sd->status.base_level >= 90 && iPc->famerank(sd->status.char_id, MAPID_TAEKWON) )
- iPc->calc_skilltree(sd); // Required to grant all TK Ranger skills.
+ else if( sd->status.skill_point == 0 && (sd->class_&MAPID_UPPERMASK) == MAPID_TAEKWON && sd->status.base_level >= 90 && pc->famerank(sd->status.char_id, MAPID_TAEKWON) )
+ pc->calc_skilltree(sd); // Required to grant all TK Ranger skills.
else
pc_check_skilltree(sd, skill_id); // Check if a new skill can Lvlup
@@ -6173,8 +6173,8 @@ int pc_allskillup(struct map_session_data *sd)
}
} else {
int inf2;
- for(i=0;i < MAX_SKILL_TREE && (id=skill_tree[iPc->class2idx(sd->status.class_)][i].id)>0;i++){
- int idx = skill_tree[iPc->class2idx(sd->status.class_)][i].idx;
+ for(i=0;i < MAX_SKILL_TREE && (id=skill_tree[pc->class2idx(sd->status.class_)][i].id)>0;i++){
+ int idx = skill_tree[pc->class2idx(sd->status.class_)][i].idx;
inf2 = skill_db[idx].inf2;
if (
(inf2&INF2_QUEST_SKILL && !battle_config.quest_skill_learn) ||
@@ -6204,7 +6204,7 @@ int pc_resetlvl(struct map_session_data* sd,int type)
nullpo_ret(sd);
if (type != 3) //Also reset skills
- iPc->resetskill(sd, 0);
+ pc->resetskill(sd, 0);
if(type == 1){
sd->status.skill_point=0;
@@ -6224,8 +6224,8 @@ int pc_resetlvl(struct map_session_data* sd,int type)
if(sd->status.class_ == JOB_NOVICE_HIGH) {
sd->status.status_point=100; // not 88 [celest]
// give platinum skills upon changing
- iPc->skill(sd,142,1,0);
- iPc->skill(sd,143,1,0);
+ pc->skill(sd,142,1,0);
+ pc->skill(sd,143,1,0);
}
}
@@ -6270,8 +6270,8 @@ int pc_resetlvl(struct map_session_data* sd,int type)
for(i=0;i<EQI_MAX;i++) { // unequip items that can't be equipped by base 1 [Valaris]
if(sd->equip_index[i] >= 0)
- if(!iPc->isequip(sd,sd->equip_index[i]))
- iPc->unequipitem(sd,sd->equip_index[i],2);
+ if(!pc->isequip(sd,sd->equip_index[i]))
+ pc->unequipitem(sd,sd->equip_index[i],2);
}
if ((type == 1 || type == 2 || type == 3) && sd->status.party_id)
@@ -6303,12 +6303,12 @@ int pc_resetstate(struct map_session_data* sd)
else
{
int add=0;
- add += iPc->need_status_point(sd, SP_STR, 1-pc_getstat(sd, SP_STR));
- add += iPc->need_status_point(sd, SP_AGI, 1-pc_getstat(sd, SP_AGI));
- add += iPc->need_status_point(sd, SP_VIT, 1-pc_getstat(sd, SP_VIT));
- add += iPc->need_status_point(sd, SP_INT, 1-pc_getstat(sd, SP_INT));
- add += iPc->need_status_point(sd, SP_DEX, 1-pc_getstat(sd, SP_DEX));
- add += iPc->need_status_point(sd, SP_LUK, 1-pc_getstat(sd, SP_LUK));
+ add += pc->need_status_point(sd, SP_STR, 1-pc_getstat(sd, SP_STR));
+ add += pc->need_status_point(sd, SP_AGI, 1-pc_getstat(sd, SP_AGI));
+ add += pc->need_status_point(sd, SP_VIT, 1-pc_getstat(sd, SP_VIT));
+ add += pc->need_status_point(sd, SP_INT, 1-pc_getstat(sd, SP_INT));
+ add += pc->need_status_point(sd, SP_DEX, 1-pc_getstat(sd, SP_DEX));
+ add += pc->need_status_point(sd, SP_LUK, 1-pc_getstat(sd, SP_LUK));
sd->status.status_point+=add;
}
@@ -6366,35 +6366,35 @@ int pc_resetskill(struct map_session_data* sd, int flag)
/**
* It has been confirmed on official server that when you reset skills with a ranked tweakwon your skills are not reset (because you have all of them anyway)
**/
- if( (sd->class_&MAPID_UPPERMASK) == MAPID_TAEKWON && sd->status.base_level >= 90 && iPc->famerank(sd->status.char_id, MAPID_TAEKWON) )
+ if( (sd->class_&MAPID_UPPERMASK) == MAPID_TAEKWON && sd->status.base_level >= 90 && pc->famerank(sd->status.char_id, MAPID_TAEKWON) )
return 0;
- if( iPc->checkskill(sd, SG_DEVIL) && !iPc->nextjobexp(sd) ) //Remove perma blindness due to skill-reset. [Skotlex]
+ if( pc->checkskill(sd, SG_DEVIL) && !pc->nextjobexp(sd) ) //Remove perma blindness due to skill-reset. [Skotlex]
clif->sc_end(&sd->bl, sd->bl.id, SELF, SI_DEVIL);
i = sd->sc.option;
- if( i&OPTION_RIDING && (!iPc->checkskill(sd, KN_RIDING) || (sd->class_&MAPID_THIRDMASK) == MAPID_RUNE_KNIGHT) )
+ if( i&OPTION_RIDING && (!pc->checkskill(sd, KN_RIDING) || (sd->class_&MAPID_THIRDMASK) == MAPID_RUNE_KNIGHT) )
i &= ~OPTION_RIDING;
- if( i&OPTION_FALCON && iPc->checkskill(sd, HT_FALCON) )
+ if( i&OPTION_FALCON && pc->checkskill(sd, HT_FALCON) )
i &= ~OPTION_FALCON;
- if( i&OPTION_DRAGON && iPc->checkskill(sd, RK_DRAGONTRAINING) )
+ if( i&OPTION_DRAGON && pc->checkskill(sd, RK_DRAGONTRAINING) )
i &= ~OPTION_DRAGON;
- if( i&OPTION_WUG && iPc->checkskill(sd, RA_WUGMASTERY) )
+ if( i&OPTION_WUG && pc->checkskill(sd, RA_WUGMASTERY) )
i &= ~OPTION_WUG;
- if( i&OPTION_WUGRIDER && iPc->checkskill(sd, RA_WUGRIDER) )
+ if( i&OPTION_WUGRIDER && pc->checkskill(sd, RA_WUGRIDER) )
i &= ~OPTION_WUGRIDER;
if( i&OPTION_MADOGEAR && ( sd->class_&MAPID_THIRDMASK ) == MAPID_MECHANIC )
i &= ~OPTION_MADOGEAR;
#ifndef NEW_CARTS
- if( i&OPTION_CART && iPc->checkskill(sd, MC_PUSHCART) )
+ if( i&OPTION_CART && pc->checkskill(sd, MC_PUSHCART) )
i &= ~OPTION_CART;
#else
if( sd->sc.data[SC_PUSH_CART] )
- iPc->setcart(sd, 0);
+ pc->setcart(sd, 0);
#endif
if( i != sd->sc.option )
- iPc->setoption(sd, i);
+ pc->setoption(sd, i);
- if( homun_alive(sd->hd) && iPc->checkskill(sd, AM_CALLHOMUN) )
+ if( homun_alive(sd->hd) && pc->checkskill(sd, AM_CALLHOMUN) )
homun->vaporize(sd, 0);
}
@@ -6544,9 +6544,9 @@ void pc_respawn(struct map_session_data* sd, clr_type clrtype)
if( sd->bg_id && bg_member_respawn(sd) )
return; // member revived by battleground
- iPc->setstand(sd);
- iPc->setrestartvalue(sd,3);
- if( iPc->setpos(sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, clrtype) )
+ pc->setstand(sd);
+ pc->setrestartvalue(sd,3);
+ if( pc->setpos(sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, clrtype) )
clif->resurrection(&sd->bl, 1); //If warping fails, send a normal stand up packet.
}
@@ -6556,7 +6556,7 @@ static int pc_respawn_timer(int tid, unsigned int tick, int id, intptr_t data)
if( sd != NULL )
{
sd->pvp_point=0;
- iPc->respawn(sd,CLR_OUTSIGHT);
+ pc->respawn(sd,CLR_OUTSIGHT);
}
return 0;
@@ -6575,7 +6575,7 @@ void pc_damage(struct map_session_data *sd,struct block_list *src,unsigned int h
return;
if( pc_issit(sd) ) {
- iPc->setstand(sd);
+ pc->setstand(sd);
skill->sit(sd,0);
}
@@ -6641,7 +6641,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) {
npc_event_dequeue(sd);
pc_setglobalreg(sd,"PC_DIE_COUNTER",sd->die_counter+1);
- iPc->setparam(sd, SP_KILLERRID, src?src->id:0);
+ pc->setparam(sd, SP_KILLERRID, src?src->id:0);
if( sd->bg_id ) {/* TODO: purge when bgqueue is deemed ok */
struct battleground_data *bg;
@@ -6673,7 +6673,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) {
sd->st->state = END;
}
- /* e.g. not killed thru iPc->damage */
+ /* e.g. not killed thru pc->damage */
if( pc_issit(sd) ) {
clif->sc_end(&sd->bl,sd->bl.id,SELF,SI_SIT);
}
@@ -6688,10 +6688,10 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) {
sd->hp_loss.tick = sd->sp_loss.tick = sd->hp_regen.tick = sd->sp_regen.tick = 0;
if ( sd && sd->spiritball )
- iPc->delspiritball(sd,sd->spiritball,0);
+ pc->delspiritball(sd,sd->spiritball,0);
for(i = 1; i < 5; i++)
- iPc->del_talisman(sd, sd->talisman[i], i);
+ pc->del_talisman(sd, sd->talisman[i], i);
if (src) {
switch (src->type) {
@@ -6701,7 +6701,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) {
if(md->target_id==sd->bl.id)
mob_unlocktarget(md,tick);
if(battle_config.mobs_level_up && md->status.hp &&
- (unsigned int)md->level < iPc->maxbaselv(sd) &&
+ (unsigned int)md->level < pc->maxbaselv(sd) &&
!md->guardian_data && !md->special_state.ai// Guardians/summons should not level. [Skotlex]
) { // monster level up [Valaris]
clif->misceffect(&md->bl,0);
@@ -6731,7 +6731,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) {
if (src && src->type == BL_PC) {
struct map_session_data *ssd = (struct map_session_data *)src;
- iPc->setparam(ssd, SP_KILLEDRID, sd->bl.id);
+ pc->setparam(ssd, SP_KILLEDRID, sd->bl.id);
npc_script_event(ssd, NPCE_KILLPC);
if (battle_config.pk_mode&2) {
@@ -6781,15 +6781,15 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) {
// activate Steel body if a super novice dies at 99+% exp [celest]
if ((sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE && !sd->state.snovice_dead_flag)
{
- unsigned int next = iPc->nextbaseexp(sd);
- if( next == 0 ) next = iPc->thisbaseexp(sd);
+ unsigned int next = pc->nextbaseexp(sd);
+ if( next == 0 ) next = pc->thisbaseexp(sd);
if( get_percentage(sd->status.base_exp,next) >= 99 ) {
sd->state.snovice_dead_flag = 1;
- iPc->setstand(sd);
+ pc->setstand(sd);
status_percent_heal(&sd->bl, 100, 100);
clif->resurrection(&sd->bl, 1);
if(battle_config.pc_invincible_time)
- iPc->setinvincibletimer(sd, battle_config.pc_invincible_time);
+ pc->setinvincibletimer(sd, battle_config.pc_invincible_time);
sc_start(&sd->bl,status_skill2sc(MO_STEELBODY),100,1,skill->get_time(MO_STEELBODY,1));
if(map_flag_gvg(sd->bl.m))
pc_respawn_timer(INVALID_TIMER, iTimer->gettick(), sd->bl.id, 0);
@@ -6807,7 +6807,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) {
if (battle_config.death_penalty_base > 0) {
switch (battle_config.death_penalty_type) {
case 1:
- base_penalty = (unsigned int) ((double)iPc->nextbaseexp(sd) * (double)battle_config.death_penalty_base/10000);
+ base_penalty = (unsigned int) ((double)pc->nextbaseexp(sd) * (double)battle_config.death_penalty_base/10000);
break;
case 2:
base_penalty = (unsigned int) ((double)sd->status.base_exp * (double)battle_config.death_penalty_base/10000);
@@ -6825,7 +6825,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) {
base_penalty = 0;
switch (battle_config.death_penalty_type) {
case 1:
- base_penalty = (unsigned int) ((double)iPc->nextjobexp(sd) * (double)battle_config.death_penalty_job/10000);
+ base_penalty = (unsigned int) ((double)pc->nextjobexp(sd) * (double)battle_config.death_penalty_job/10000);
break;
case 2:
base_penalty = (unsigned int) ((double)sd->status.job_exp * (double)battle_config.death_penalty_job/10000);
@@ -6842,7 +6842,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) {
{
base_penalty = (unsigned int)((double)sd->status.zeny * (double)battle_config.zeny_penalty / 10000.);
if(base_penalty)
- iPc->payzeny(sd, base_penalty, LOG_TYPE_PICKDROP_PLAYER, NULL);
+ pc->payzeny(sd, base_penalty, LOG_TYPE_PICKDROP_PLAYER, NULL);
}
}
@@ -6874,8 +6874,8 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) {
int n = eq_n[rnd()%eq_num];
if(rnd()%10000 < per){
if(sd->status.inventory[n].equip)
- iPc->unequipitem(sd,n,3);
- iPc->dropitem(sd,n,1);
+ pc->unequipitem(sd,n,3);
+ pc->dropitem(sd,n,1);
}
}
}
@@ -6887,8 +6887,8 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) {
|| (type == 2 && sd->status.inventory[i].equip)
|| type == 3) ){
if(sd->status.inventory[i].equip)
- iPc->unequipitem(sd,i,3);
- iPc->dropitem(sd,i,1);
+ pc->unequipitem(sd,i,3);
+ pc->dropitem(sd,i,1);
break;
}
}
@@ -6940,9 +6940,9 @@ void pc_revive(struct map_session_data *sd,unsigned int hp, unsigned int sp) {
if(hp) clif->updatestatus(sd,SP_HP);
if(sp) clif->updatestatus(sd,SP_SP);
- iPc->setstand(sd);
+ pc->setstand(sd);
if(battle_config.pc_invincible_time > 0)
- iPc->setinvincibletimer(sd, battle_config.pc_invincible_time);
+ pc->setinvincibletimer(sd, battle_config.pc_invincible_time);
if( sd->state.gmaster_flag ) {
guild->aura_refresh(sd,GD_LEADERSHIP,guild->checkskill(sd->state.gmaster_flag,GD_LEADERSHIP));
@@ -6969,16 +6969,16 @@ int pc_readparam(struct map_session_data* sd,int type)
case SP_BASELEVEL: val = sd->status.base_level; break;
case SP_JOBLEVEL: val = sd->status.job_level; break;
case SP_CLASS: val = sd->status.class_; break;
- case SP_BASEJOB: val = iPc->mapid2jobid(sd->class_&MAPID_UPPERMASK, sd->status.sex); break; //Base job, extracting upper type.
+ case SP_BASEJOB: val = pc->mapid2jobid(sd->class_&MAPID_UPPERMASK, sd->status.sex); break; //Base job, extracting upper type.
case SP_UPPER: val = sd->class_&JOBL_UPPER?1:(sd->class_&JOBL_BABY?2:0); break;
- case SP_BASECLASS: val = iPc->mapid2jobid(sd->class_&MAPID_BASEMASK, sd->status.sex); break; //Extract base class tree. [Skotlex]
+ case SP_BASECLASS: val = pc->mapid2jobid(sd->class_&MAPID_BASEMASK, sd->status.sex); break; //Extract base class tree. [Skotlex]
case SP_SEX: val = sd->status.sex; break;
case SP_WEIGHT: val = sd->weight; break;
case SP_MAXWEIGHT: val = sd->max_weight; break;
case SP_BASEEXP: val = sd->status.base_exp; break;
case SP_JOBEXP: val = sd->status.job_exp; break;
- case SP_NEXTBASEEXP: val = iPc->nextbaseexp(sd); break;
- case SP_NEXTJOBEXP: val = iPc->nextjobexp(sd); break;
+ case SP_NEXTBASEEXP: val = pc->nextbaseexp(sd); break;
+ case SP_NEXTJOBEXP: val = pc->nextjobexp(sd); break;
case SP_HP: val = sd->battle_status.hp; break;
case SP_MAXHP: val = sd->battle_status.max_hp; break;
case SP_SP: val = sd->battle_status.sp; break;
@@ -7114,12 +7114,12 @@ int pc_setparam(struct map_session_data *sd,int type,int val)
switch(type){
case SP_BASELEVEL:
- if ((unsigned int)val > iPc->maxbaselv(sd)) //Capping to max
- val = iPc->maxbaselv(sd);
+ if ((unsigned int)val > pc->maxbaselv(sd)) //Capping to max
+ val = pc->maxbaselv(sd);
if ((unsigned int)val > sd->status.base_level) {
int stat=0;
for (i = 0; i < (int)((unsigned int)val - sd->status.base_level); i++)
- stat += iPc->gets_status_point(sd->status.base_level + i);
+ stat += pc->gets_status_point(sd->status.base_level + i);
sd->status.status_point += stat;
}
sd->status.base_level = (unsigned int)val;
@@ -7136,7 +7136,7 @@ int pc_setparam(struct map_session_data *sd,int type,int val)
break;
case SP_JOBLEVEL:
if ((unsigned int)val >= sd->status.job_level) {
- if ((unsigned int)val > iPc->maxjoblv(sd)) val = iPc->maxjoblv(sd);
+ if ((unsigned int)val > pc->maxjoblv(sd)) val = pc->maxjoblv(sd);
sd->status.skill_point += val - sd->status.job_level;
clif->updatestatus(sd, SP_SKILLPOINT);
}
@@ -7160,15 +7160,15 @@ int pc_setparam(struct map_session_data *sd,int type,int val)
sd->status.zeny = cap_value(val, 0, MAX_ZENY);
break;
case SP_BASEEXP:
- if(iPc->nextbaseexp(sd) > 0) {
+ if(pc->nextbaseexp(sd) > 0) {
sd->status.base_exp = val;
- iPc->checkbaselevelup(sd);
+ pc->checkbaselevelup(sd);
}
break;
case SP_JOBEXP:
- if(iPc->nextjobexp(sd) > 0) {
+ if(pc->nextjobexp(sd) > 0) {
sd->status.job_exp = val;
- iPc->checkjoblevelup(sd);
+ pc->checkjoblevelup(sd);
}
break;
case SP_SEX:
@@ -7283,8 +7283,8 @@ int pc_itemheal(struct map_session_data *sd,int itemid, int hp,int sp)
if(hp) {
int i;
bonus = 100 + (sd->battle_status.vit<<1)
- + iPc->checkskill(sd,SM_RECOVERY)*10
- + iPc->checkskill(sd,AM_LEARNINGPOTION)*5;
+ + pc->checkskill(sd,SM_RECOVERY)*10
+ + pc->checkskill(sd,AM_LEARNINGPOTION)*5;
// A potion produced by an Alchemist in the Fame Top 10 gets +50% effect [DracoRPG]
if (potion_flag > 1)
bonus += bonus*(potion_flag-1)*50/100;
@@ -7309,8 +7309,8 @@ int pc_itemheal(struct map_session_data *sd,int itemid, int hp,int sp)
}
if(sp) {
bonus = 100 + (sd->battle_status.int_<<1)
- + iPc->checkskill(sd,MG_SRECOVERY)*10
- + iPc->checkskill(sd,AM_LEARNINGPOTION)*5;
+ + pc->checkskill(sd,MG_SRECOVERY)*10
+ + pc->checkskill(sd,AM_LEARNINGPOTION)*5;
if (potion_flag > 1)
bonus += bonus*(potion_flag-1)*50/100;
if(bonus != 100)
@@ -7407,7 +7407,7 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
return 1;
//Normalize job.
- b_class = iPc->jobid2mapid(job);
+ b_class = pc->jobid2mapid(job);
if (b_class == -1)
return 1;
switch (upper) {
@@ -7420,7 +7420,7 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
}
//This will automatically adjust bard/dancer classes to the correct gender
//That is, if you try to jobchange into dancer, it will turn you to bard.
- job = iPc->mapid2jobid(b_class, sd->status.sex);
+ job = pc->mapid2jobid(b_class, sd->status.sex);
if (job == -1)
return 1;
@@ -7465,7 +7465,7 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
}
if ( (b_class&MAPID_UPPERMASK) != (sd->class_&MAPID_UPPERMASK) ) { //Things to remove when changing class tree.
- const int class_ = iPc->class2idx(sd->status.class_);
+ const int class_ = pc->class2idx(sd->status.class_);
short id;
for(i = 0; i < MAX_SKILL_TREE && (id = skill_tree[class_][i].id) > 0; i++) {
//Remove status specific to your current tree skills.
@@ -7477,19 +7477,19 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
if( (sd->class_&MAPID_UPPERMASK) == MAPID_STAR_GLADIATOR && (b_class&MAPID_UPPERMASK) != MAPID_STAR_GLADIATOR) {
/* going off star glad lineage, reset feel to not store no-longer-used vars in the database */
- iPc->resetfeel(sd);
+ pc->resetfeel(sd);
}
sd->status.class_ = job;
- fame_flag = iPc->famerank(sd->status.char_id,sd->class_&MAPID_UPPERMASK);
+ fame_flag = pc->famerank(sd->status.char_id,sd->class_&MAPID_UPPERMASK);
sd->class_ = (unsigned short)b_class;
sd->status.job_level=1;
sd->status.job_exp=0;
- if (sd->status.base_level > iPc->maxbaselv(sd)) {
- sd->status.base_level = iPc->maxbaselv(sd);
+ if (sd->status.base_level > pc->maxbaselv(sd)) {
+ sd->status.base_level = pc->maxbaselv(sd);
sd->status.base_exp=0;
- iPc->resetstate(sd);
+ pc->resetstate(sd);
clif->updatestatus(sd,SP_STATUSPOINT);
clif->updatestatus(sd,SP_BASELEVEL);
clif->updatestatus(sd,SP_BASEEXP);
@@ -7502,14 +7502,14 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
for(i=0;i<EQI_MAX;i++) {
if(sd->equip_index[i] >= 0)
- if(!iPc->isequip(sd,sd->equip_index[i]))
- iPc->unequipitem(sd,sd->equip_index[i],2); // unequip invalid item for class
+ if(!pc->isequip(sd,sd->equip_index[i]))
+ pc->unequipitem(sd,sd->equip_index[i],2); // unequip invalid item for class
}
//Change look, if disguised, you need to undisguise
//to correctly calculate new job sprite without
if (sd->disguise != -1)
- iPc->disguise(sd, -1);
+ pc->disguise(sd, -1);
status_set_viewdata(&sd->bl, job);
clif->changelook(&sd->bl,LOOK_BASE,sd->vd.class_); // move sprite update to prevent client crashes with incompatible equipment [Valaris]
@@ -7517,7 +7517,7 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
clif->changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->vd.cloth_color);
//Update skill tree.
- iPc->calc_skilltree(sd);
+ pc->calc_skilltree(sd);
clif->skillinfoblock(sd);
if (sd->ed)
@@ -7529,37 +7529,37 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
//Remove peco/cart/falcon
i = sd->sc.option;
- if( i&OPTION_RIDING && !iPc->checkskill(sd, KN_RIDING) )
+ if( i&OPTION_RIDING && !pc->checkskill(sd, KN_RIDING) )
i&=~OPTION_RIDING;
- if( i&OPTION_FALCON && !iPc->checkskill(sd, HT_FALCON) )
+ if( i&OPTION_FALCON && !pc->checkskill(sd, HT_FALCON) )
i&=~OPTION_FALCON;
- if( i&OPTION_DRAGON && !iPc->checkskill(sd,RK_DRAGONTRAINING) )
+ if( i&OPTION_DRAGON && !pc->checkskill(sd,RK_DRAGONTRAINING) )
i&=~OPTION_DRAGON;
- if( i&OPTION_WUGRIDER && !iPc->checkskill(sd,RA_WUGMASTERY) )
+ if( i&OPTION_WUGRIDER && !pc->checkskill(sd,RA_WUGMASTERY) )
i&=~OPTION_WUGRIDER;
- if( i&OPTION_WUG && !iPc->checkskill(sd,RA_WUGMASTERY) )
+ if( i&OPTION_WUG && !pc->checkskill(sd,RA_WUGMASTERY) )
i&=~OPTION_WUG;
if( i&OPTION_MADOGEAR ) //You do not need a skill for this.
i&=~OPTION_MADOGEAR;
#ifndef NEW_CARTS
- if( i&OPTION_CART && !iPc->checkskill(sd, MC_PUSHCART) )
+ if( i&OPTION_CART && !pc->checkskill(sd, MC_PUSHCART) )
i&=~OPTION_CART;
#else
- if( sd->sc.data[SC_PUSH_CART] && !iPc->checkskill(sd, MC_PUSHCART) )
- iPc->setcart(sd, 0);
+ if( sd->sc.data[SC_PUSH_CART] && !pc->checkskill(sd, MC_PUSHCART) )
+ pc->setcart(sd, 0);
#endif
if(i != sd->sc.option)
- iPc->setoption(sd, i);
+ pc->setoption(sd, i);
- if(homun_alive(sd->hd) && !iPc->checkskill(sd, AM_CALLHOMUN))
+ if(homun_alive(sd->hd) && !pc->checkskill(sd, AM_CALLHOMUN))
homun->vaporize(sd, 0);
if(sd->status.manner < 0)
clif->changestatus(sd,SP_MANNER,sd->status.manner);
status_calc_pc(sd,0);
- iPc->checkallowskill(sd);
- iPc->equiplookall(sd);
+ pc->checkallowskill(sd);
+ pc->equiplookall(sd);
//if you were previously famous, not anymore.
if (fame_flag) {
@@ -7677,7 +7677,7 @@ int pc_setoption(struct map_session_data *sd,int type)
sd->sc.option=type;
clif->changeoption(&sd->bl);
- if( (type&OPTION_RIDING && !(p_type&OPTION_RIDING)) || (type&OPTION_DRAGON && !(p_type&OPTION_DRAGON) && iPc->checkskill(sd,RK_DRAGONTRAINING) > 0) ) {
+ if( (type&OPTION_RIDING && !(p_type&OPTION_RIDING)) || (type&OPTION_DRAGON && !(p_type&OPTION_DRAGON) && pc->checkskill(sd,RK_DRAGONTRAINING) > 0) ) {
// Mounting
clif->sc_load(&sd->bl,sd->bl.id,AREA,SI_RIDING, 0, 0, 0);
status_calc_pc(sd,0);
@@ -7691,11 +7691,11 @@ int pc_setoption(struct map_session_data *sd,int type)
if( type&OPTION_CART && !( p_type&OPTION_CART ) ) { //Cart On
clif->cartlist(sd);
clif->updatestatus(sd, SP_CARTINFO);
- if(iPc->checkskill(sd, MC_PUSHCART) < 10)
+ if(pc->checkskill(sd, MC_PUSHCART) < 10)
status_calc_pc(sd,0); //Apply speed penalty.
} else if( !( type&OPTION_CART ) && p_type&OPTION_CART ){ //Cart Off
clif->clearcart(sd->fd);
- if(iPc->checkskill(sd, MC_PUSHCART) < 10)
+ if(pc->checkskill(sd, MC_PUSHCART) < 10)
status_calc_pc(sd,0); //Remove speed penalty.
}
#endif
@@ -7769,7 +7769,7 @@ int pc_setcart(struct map_session_data *sd,int type) {
if( type < 0 || type > MAX_CARTS )
return 1;// Never trust the values sent by the client! [Skotlex]
- if( iPc->checkskill(sd,MC_PUSHCART) <= 0 && type != 0 )
+ if( pc->checkskill(sd,MC_PUSHCART) <= 0 && type != 0 )
return 1;// Push cart is required
if( type == 0 && pc_iscarton(sd) )
@@ -7796,14 +7796,14 @@ int pc_setcart(struct map_session_data *sd,int type) {
break;
}
- if(iPc->checkskill(sd, MC_PUSHCART) < 10)
+ if(pc->checkskill(sd, MC_PUSHCART) < 10)
status_calc_pc(sd,0); //Recalc speed penalty.
#else
// Update option
option = sd->sc.option;
option &= ~OPTION_CART;// clear cart bits
option |= cart[type]; // set cart
- iPc->setoption(sd, option);
+ pc->setoption(sd, option);
#endif
return 0;
@@ -7815,10 +7815,10 @@ int pc_setcart(struct map_session_data *sd,int type) {
int pc_setfalcon(TBL_PC* sd, int flag)
{
if( flag ){
- if( iPc->checkskill(sd,HT_FALCON)>0 ) // add falcon if he have the skill
- iPc->setoption(sd,sd->sc.option|OPTION_FALCON);
+ if( pc->checkskill(sd,HT_FALCON)>0 ) // add falcon if he have the skill
+ pc->setoption(sd,sd->sc.option|OPTION_FALCON);
} else if( pc_isfalcon(sd) ){
- iPc->setoption(sd,sd->sc.option&~OPTION_FALCON); // remove falcon
+ pc->setoption(sd,sd->sc.option&~OPTION_FALCON); // remove falcon
}
return 0;
@@ -7830,10 +7830,10 @@ int pc_setfalcon(TBL_PC* sd, int flag)
int pc_setriding(TBL_PC* sd, int flag)
{
if( flag ){
- if( iPc->checkskill(sd,KN_RIDING) > 0 ) // add peco
- iPc->setoption(sd, sd->sc.option|OPTION_RIDING);
+ if( pc->checkskill(sd,KN_RIDING) > 0 ) // add peco
+ pc->setoption(sd, sd->sc.option|OPTION_RIDING);
} else if( pc_isriding(sd) ){
- iPc->setoption(sd, sd->sc.option&~OPTION_RIDING);
+ pc->setoption(sd, sd->sc.option&~OPTION_RIDING);
}
return 0;
@@ -7845,10 +7845,10 @@ int pc_setriding(TBL_PC* sd, int flag)
int pc_setmadogear(TBL_PC* sd, int flag)
{
if( flag ){
- if( iPc->checkskill(sd,NC_MADOLICENCE) > 0 )
- iPc->setoption(sd, sd->sc.option|OPTION_MADOGEAR);
+ if( pc->checkskill(sd,NC_MADOLICENCE) > 0 )
+ pc->setoption(sd, sd->sc.option|OPTION_MADOGEAR);
} else if( pc_ismadogear(sd) ){
- iPc->setoption(sd, sd->sc.option&~OPTION_MADOGEAR);
+ pc->setoption(sd, sd->sc.option&~OPTION_MADOGEAR);
}
return 0;
@@ -7861,9 +7861,9 @@ int pc_candrop(struct map_session_data *sd, struct item *item)
{
if( item && item->expire_time )
return 0;
- if( !iPc->can_give_items(sd) ) //check if this GM level can drop items
+ if( !pc->can_give_items(sd) ) //check if this GM level can drop items
return 0;
- return (itemdb_isdropable(item, iPc->get_group_level(sd)));
+ return (itemdb_isdropable(item, pc->get_group_level(sd)));
}
/*==========================================
@@ -8493,12 +8493,12 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos)
}
id = sd->inventory_data[n];
- pos = iPc->equippoint(sd,n); //With a few exceptions, item should go in all specified slots.
+ pos = pc->equippoint(sd,n); //With a few exceptions, item should go in all specified slots.
if(battle_config.battle_log)
ShowInfo("equip %d(%d) %x:%x\n",sd->status.inventory[n].nameid,n,id?id->equip:0,req_pos);
- if(!iPc->isequip(sd,n) || !(pos&req_pos) || sd->status.inventory[n].equip != 0 || sd->status.inventory[n].attribute==1 ) { // [Valaris]
- // FIXME: iPc->isequip: equip level failure uses 2 instead of 0
+ if(!pc->isequip(sd,n) || !(pos&req_pos) || sd->status.inventory[n].equip != 0 || sd->status.inventory[n].attribute==1 ) { // [Valaris]
+ // FIXME: pc->isequip: equip level failure uses 2 instead of 0
clif->equipitemack(sd,n,0,0); // fail
return 0;
}
@@ -8534,7 +8534,7 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos)
for(i=0;i<EQI_MAX;i++) {
if(pos & equip_pos[i]) {
if(sd->equip_index[i] >= 0) //Slot taken, remove item from there.
- iPc->unequipitem(sd,sd->equip_index[i],2);
+ pc->unequipitem(sd,sd->equip_index[i],2);
sd->equip_index[i] = n;
}
@@ -8576,21 +8576,21 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos)
}
//Added check to prevent sending the same look on multiple slots ->
//causes client to redraw item on top of itself. (suggested by Lupus)
- if(pos & EQP_HEAD_LOW && iPc->checkequip(sd,EQP_COSTUME_HEAD_LOW) == -1) {
+ if(pos & EQP_HEAD_LOW && pc->checkequip(sd,EQP_COSTUME_HEAD_LOW) == -1) {
if(id && !(pos&(EQP_HEAD_TOP|EQP_HEAD_MID)))
sd->status.head_bottom = id->look;
else
sd->status.head_bottom = 0;
clif->changelook(&sd->bl,LOOK_HEAD_BOTTOM,sd->status.head_bottom);
}
- if(pos & EQP_HEAD_TOP && iPc->checkequip(sd,EQP_COSTUME_HEAD_TOP) == -1) {
+ if(pos & EQP_HEAD_TOP && pc->checkequip(sd,EQP_COSTUME_HEAD_TOP) == -1) {
if(id)
sd->status.head_top = id->look;
else
sd->status.head_top = 0;
clif->changelook(&sd->bl,LOOK_HEAD_TOP,sd->status.head_top);
}
- if(pos & EQP_HEAD_MID && iPc->checkequip(sd,EQP_COSTUME_HEAD_MID) == -1) {
+ if(pos & EQP_HEAD_MID && pc->checkequip(sd,EQP_COSTUME_HEAD_MID) == -1) {
if(id && !(pos&EQP_HEAD_TOP))
sd->status.head_mid = id->look;
else
@@ -8621,7 +8621,7 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos)
if(pos & EQP_SHOES)
clif->changelook(&sd->bl,LOOK_SHOES,0);
- if( pos&EQP_GARMENT && iPc->checkequip(sd,EQP_COSTUME_GARMENT) == -1 ) {
+ if( pos&EQP_GARMENT && pc->checkequip(sd,EQP_COSTUME_GARMENT) == -1 ) {
sd->status.robe = id ? id->look : 0;
clif->changelook(&sd->bl, LOOK_ROBE, sd->status.robe);
}
@@ -8632,7 +8632,7 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos)
}
- iPc->checkallowskill(sd); //Check if status changes should be halted.
+ pc->checkallowskill(sd); //Check if status changes should be halted.
iflag = sd->npc_item_flag;
/* check for combos (MUST be before status_calc_pc) */
@@ -8712,7 +8712,7 @@ int pc_unequipitem(struct map_session_data *sd,int n,int flag) {
}
if(battle_config.battle_log)
- ShowInfo("unequip %d %x:%x\n",n,iPc->equippoint(sd,n),sd->status.inventory[n].equip);
+ ShowInfo("unequip %d %x:%x\n",n,pc->equippoint(sd,n),sd->status.inventory[n].equip);
if(!sd->status.inventory[n].equip){ //Nothing to unequip
clif->unequipitemack(sd,n,0,0);
@@ -8736,44 +8736,44 @@ int pc_unequipitem(struct map_session_data *sd,int n,int flag) {
pc_calcweapontype(sd);
clif->changelook(&sd->bl,LOOK_SHIELD,sd->status.shield);
}
- if(sd->status.inventory[n].equip & EQP_HEAD_LOW && iPc->checkequip(sd,EQP_COSTUME_HEAD_LOW) == -1 ) {
+ if(sd->status.inventory[n].equip & EQP_HEAD_LOW && pc->checkequip(sd,EQP_COSTUME_HEAD_LOW) == -1 ) {
sd->status.head_bottom = 0;
clif->changelook(&sd->bl,LOOK_HEAD_BOTTOM,sd->status.head_bottom);
}
- if(sd->status.inventory[n].equip & EQP_HEAD_TOP && iPc->checkequip(sd,EQP_COSTUME_HEAD_TOP) == -1 ) {
+ if(sd->status.inventory[n].equip & EQP_HEAD_TOP && pc->checkequip(sd,EQP_COSTUME_HEAD_TOP) == -1 ) {
sd->status.head_top = 0;
clif->changelook(&sd->bl,LOOK_HEAD_TOP,sd->status.head_top);
}
- if(sd->status.inventory[n].equip & EQP_HEAD_MID && iPc->checkequip(sd,EQP_COSTUME_HEAD_MID) == -1 ) {
+ if(sd->status.inventory[n].equip & EQP_HEAD_MID && pc->checkequip(sd,EQP_COSTUME_HEAD_MID) == -1 ) {
sd->status.head_mid = 0;
clif->changelook(&sd->bl,LOOK_HEAD_MID,sd->status.head_mid);
}
if(sd->status.inventory[n].equip & EQP_COSTUME_HEAD_TOP) {
- sd->status.head_top = ( iPc->checkequip(sd,EQP_HEAD_TOP) >= 0 ) ? sd->inventory_data[iPc->checkequip(sd,EQP_HEAD_TOP)]->look : 0;
+ sd->status.head_top = ( pc->checkequip(sd,EQP_HEAD_TOP) >= 0 ) ? sd->inventory_data[pc->checkequip(sd,EQP_HEAD_TOP)]->look : 0;
clif->changelook(&sd->bl,LOOK_HEAD_TOP,sd->status.head_top);
}
if(sd->status.inventory[n].equip & EQP_COSTUME_HEAD_MID) {
- sd->status.head_mid = ( iPc->checkequip(sd,EQP_HEAD_MID) >= 0 ) ? sd->inventory_data[iPc->checkequip(sd,EQP_HEAD_MID)]->look : 0;
+ sd->status.head_mid = ( pc->checkequip(sd,EQP_HEAD_MID) >= 0 ) ? sd->inventory_data[pc->checkequip(sd,EQP_HEAD_MID)]->look : 0;
clif->changelook(&sd->bl,LOOK_HEAD_MID,sd->status.head_mid);
}
if(sd->status.inventory[n].equip & EQP_COSTUME_HEAD_LOW) {
- sd->status.head_bottom = ( iPc->checkequip(sd,EQP_HEAD_LOW) >= 0 ) ? sd->inventory_data[iPc->checkequip(sd,EQP_HEAD_LOW)]->look : 0;
+ sd->status.head_bottom = ( pc->checkequip(sd,EQP_HEAD_LOW) >= 0 ) ? sd->inventory_data[pc->checkequip(sd,EQP_HEAD_LOW)]->look : 0;
clif->changelook(&sd->bl,LOOK_HEAD_BOTTOM,sd->status.head_bottom);
}
if(sd->status.inventory[n].equip & EQP_SHOES)
clif->changelook(&sd->bl,LOOK_SHOES,0);
- if( sd->status.inventory[n].equip&EQP_GARMENT && iPc->checkequip(sd,EQP_COSTUME_GARMENT) == -1 ) {
+ if( sd->status.inventory[n].equip&EQP_GARMENT && pc->checkequip(sd,EQP_COSTUME_GARMENT) == -1 ) {
sd->status.robe = 0;
clif->changelook(&sd->bl, LOOK_ROBE, 0);
}
if(sd->status.inventory[n].equip & EQP_COSTUME_GARMENT) {
- sd->status.robe = ( iPc->checkequip(sd,EQP_GARMENT) >= 0 ) ? sd->inventory_data[iPc->checkequip(sd,EQP_GARMENT)]->look : 0;
+ sd->status.robe = ( pc->checkequip(sd,EQP_GARMENT) >= 0 ) ? sd->inventory_data[pc->checkequip(sd,EQP_GARMENT)]->look : 0;
clif->changelook(&sd->bl,LOOK_ROBE,sd->status.robe);
}
@@ -8818,7 +8818,7 @@ int pc_unequipitem(struct map_session_data *sd,int n,int flag) {
}
if(flag&1 || status_cacl) {
- iPc->checkallowskill(sd);
+ pc->checkallowskill(sd);
status_calc_pc(sd,0);
}
@@ -8869,7 +8869,7 @@ int pc_checkitem(struct map_session_data *sd)
if( id && !itemdb_available(id) ) {
ShowWarning("Removed invalid/disabled item id %d from inventory (amount=%d, char_id=%d).\n", id, sd->status.inventory[i].amount, sd->status.char_id);
- iPc->delitem(sd, i, sd->status.inventory[i].amount, 0, 0, LOG_TYPE_OTHER);
+ pc->delitem(sd, i, sd->status.inventory[i].amount, 0, 0, LOG_TYPE_OTHER);
}
}
@@ -8878,7 +8878,7 @@ int pc_checkitem(struct map_session_data *sd)
if( id && !itemdb_available(id) ) {
ShowWarning("Removed invalid/disabled item id %d from cart (amount=%d, char_id=%d).\n", id, sd->status.cart[i].amount, sd->status.char_id);
- iPc->cart_delitem(sd, i, sd->status.cart[i].amount, 0, LOG_TYPE_OTHER);
+ pc->cart_delitem(sd, i, sd->status.cart[i].amount, 0, LOG_TYPE_OTHER);
}
}
}
@@ -8891,8 +8891,8 @@ int pc_checkitem(struct map_session_data *sd)
if( !sd->status.inventory[i].equip )
continue;
- if( sd->status.inventory[i].equip&~iPc->equippoint(sd,i) ) {
- iPc->unequipitem(sd, i, 2);
+ if( sd->status.inventory[i].equip&~pc->equippoint(sd,i) ) {
+ pc->unequipitem(sd, i, 2);
calc_flag = 1;
continue;
}
@@ -8900,7 +8900,7 @@ int pc_checkitem(struct map_session_data *sd)
}
if( calc_flag && sd->state.active ) {
- iPc->checkallowskill(sd);
+ pc->checkallowskill(sd);
status_calc_pc(sd,0);
}
@@ -8959,8 +8959,8 @@ int pc_calc_pvprank_timer(int tid, unsigned int tick, int id, intptr_t data)
return 0;
}
- if( iPc->calc_pvprank(sd) > 0 )
- sd->pvp_timer = iTimer->add_timer(iTimer->gettick()+PVP_CALCRANK_INTERVAL,iPc->calc_pvprank_timer,id,data);
+ if( pc->calc_pvprank(sd) > 0 )
+ sd->pvp_timer = iTimer->add_timer(iTimer->gettick()+PVP_CALCRANK_INTERVAL,pc->calc_pvprank_timer,id,data);
return 0;
}
@@ -9007,7 +9007,7 @@ int pc_divorce(struct map_session_data *sd)
struct map_session_data *p_sd;
int i;
- if( sd == NULL || !iPc->ismarried(sd) )
+ if( sd == NULL || !pc->ismarried(sd) )
return -1;
if( !sd->status.partner_id )
@@ -9027,9 +9027,9 @@ int pc_divorce(struct map_session_data *sd)
for( i = 0; i < MAX_INVENTORY; i++ )
{
if( sd->status.inventory[i].nameid == WEDDING_RING_M || sd->status.inventory[i].nameid == WEDDING_RING_F )
- iPc->delitem(sd, i, 1, 0, 0, LOG_TYPE_OTHER);
+ pc->delitem(sd, i, 1, 0, 0, LOG_TYPE_OTHER);
if( p_sd->status.inventory[i].nameid == WEDDING_RING_M || p_sd->status.inventory[i].nameid == WEDDING_RING_F )
- iPc->delitem(p_sd, i, 1, 0, 0, LOG_TYPE_OTHER);
+ pc->delitem(p_sd, i, 1, 0, 0, LOG_TYPE_OTHER);
}
clif->divorced(sd, p_sd->status.name);
@@ -9043,7 +9043,7 @@ int pc_divorce(struct map_session_data *sd)
*------------------------------------------*/
struct map_session_data *pc_get_partner(struct map_session_data *sd)
{
- if (sd && iPc->ismarried(sd))
+ if (sd && pc->ismarried(sd))
// charid2sd returns NULL if not found
return iMap->charid2sd(sd->status.partner_id);
@@ -9079,7 +9079,7 @@ struct map_session_data *pc_get_mother (struct map_session_data *sd)
*------------------------------------------*/
struct map_session_data *pc_get_child (struct map_session_data *sd)
{
- if (sd && iPc->ismarried(sd) && sd->status.child > 0)
+ if (sd && pc->ismarried(sd) && sd->status.child > 0)
// charid2sd returns NULL if not found
return iMap->charid2sd(sd->status.child);
@@ -9277,7 +9277,7 @@ void pc_overheat(struct map_session_data *sd, int val) {
if( !pc_ismadogear(sd) || sd->sc.data[SC_OVERHEAT] )
return; // already burning
- skill = cap_value(iPc->checkskill(sd,NC_MAINFRAME),0,4);
+ skill = cap_value(pc->checkskill(sd,NC_MAINFRAME),0,4);
if( sd->sc.data[SC_OVERHEAT_LIMITPOINT] ) {
heat += sd->sc.data[SC_OVERHEAT_LIMITPOINT]->val1;
status_change_end(&sd->bl,SC_OVERHEAT_LIMITPOINT,INVALID_TIMER);
@@ -9531,7 +9531,7 @@ static bool pc_readdb_skilltree(char* fields[], int columns, int current)
ShowWarning("pc_readdb_skilltree: Invalid job class %d specified.\n", class_);
return false;
}
- idx = iPc->class2idx(class_);
+ idx = pc->class2idx(class_);
//This is to avoid adding two lines for the same skill. [Skotlex]
ARR_FIND( 0, MAX_SKILL_TREE, skill_idx, skill_tree[idx][skill_idx].id == 0 || skill_tree[idx][skill_idx].id == skill_id );
@@ -9638,7 +9638,7 @@ int pc_readdb(void)
maxlv = MAX_LEVEL;
}
count++;
- job = jobs[0] = iPc->class2idx(job_id);
+ job = jobs[0] = pc->class2idx(job_id);
//We send one less and then one more because the last entry in the exp array should hold 0.
max_level[job][type] = pc_split_atoui(split[3], exp_table[job][type],',',maxlv-1)+1;
//Reverse check in case the array has a bunch of trailing zeros... [Skotlex]
@@ -9663,7 +9663,7 @@ int pc_readdb(void)
ShowError("pc_readdb: Invalid job ID %d.\n", job_id);
continue;
}
- job = iPc->class2idx(job_id);
+ job = pc->class2idx(job_id);
memcpy(exp_table[job][type], exp_table[jobs[0]][type], sizeof(exp_table[0][0]));
max_level[job][type] = maxlv;
// ShowDebug("%s - Class %d: %u\n", type?"Job":"Base", job_id, max_level[job][type]);
@@ -9674,11 +9674,11 @@ int pc_readdb(void)
if (!pcdb_checkid(i)) continue;
if (i == JOB_WEDDING || i == JOB_XMAS || i == JOB_SUMMER)
continue; //Classes that do not need exp tables.
- j = iPc->class2idx(i);
+ j = pc->class2idx(i);
if (!max_level[j][0])
- ShowWarning("Class %s (%d) does not has a base exp table.\n", iPc->job_name(i), i);
+ ShowWarning("Class %s (%d) does not has a base exp table.\n", pc->job_name(i), i);
if (!max_level[j][1])
- ShowWarning("Class %s (%d) does not has a job exp table.\n", iPc->job_name(i), i);
+ ShowWarning("Class %s (%d) does not has a job exp table.\n", pc->job_name(i), i);
}
ShowStatus("Done reading '"CL_WHITE"%lu"CL_RESET"' entries in '"CL_WHITE"%s/"DBPATH"%s"CL_RESET"'.\n",count,iMap->db_path,"exp.txt");
count = 0;
@@ -9784,10 +9784,10 @@ int pc_readdb(void)
}
// generate the remaining parts of the db if necessary
k = battle_config.use_statpoint_table; //save setting
- battle_config.use_statpoint_table = 0; //temporarily disable to force iPc->gets_status_point use default values
+ battle_config.use_statpoint_table = 0; //temporarily disable to force pc->gets_status_point use default values
statp[0] = 45; // seed value
for (; i <= MAX_LEVEL; i++)
- statp[i] = statp[i-1] + iPc->gets_status_point(i-1);
+ statp[i] = statp[i-1] + pc->gets_status_point(i-1);
battle_config.use_statpoint_table = k; //restore setting
return 0;
@@ -9844,16 +9844,16 @@ int do_init_pc(void) {
itemcd_db = idb_alloc(DB_OPT_RELEASE_DATA);
- iPc->readdb();
+ pc->readdb();
iTimer->add_timer_func_list(pc_invincible_timer, "pc_invincible_timer");
iTimer->add_timer_func_list(pc_eventtimer, "pc_eventtimer");
iTimer->add_timer_func_list(pc_inventory_rental_end, "pc_inventory_rental_end");
- iTimer->add_timer_func_list(iPc->calc_pvprank_timer, "iPc->calc_pvprank_timer");
+ iTimer->add_timer_func_list(pc->calc_pvprank_timer, "pc->calc_pvprank_timer");
iTimer->add_timer_func_list(pc_autosave, "pc_autosave");
iTimer->add_timer_func_list(pc_spiritball_timer, "pc_spiritball_timer");
iTimer->add_timer_func_list(pc_follow_timer, "pc_follow_timer");
- iTimer->add_timer_func_list(iPc->endautobonus, "iPc->endautobonus");
+ iTimer->add_timer_func_list(pc->endautobonus, "pc->endautobonus");
iTimer->add_timer_func_list(pc_talisman_timer, "pc_talisman_timer");
iTimer->add_timer(iTimer->gettick() + iMap->autosave_interval, pc_autosave, 0, 0);
@@ -9865,11 +9865,11 @@ int do_init_pc(void) {
int day_duration = battle_config.day_duration;
int night_duration = battle_config.night_duration;
// add night/day timer [Yor]
- iTimer->add_timer_func_list(iPc->map_day_timer, "iPc->map_day_timer");
- iTimer->add_timer_func_list(iPc->map_night_timer, "iPc->map_night_timer");
+ iTimer->add_timer_func_list(pc->map_day_timer, "pc->map_day_timer");
+ iTimer->add_timer_func_list(pc->map_night_timer, "pc->map_night_timer");
- iPc->day_timer_tid = iTimer->add_timer_interval(iTimer->gettick() + (iMap->night_flag ? 0 : day_duration) + night_duration, iPc->map_day_timer, 0, 0, day_duration + night_duration);
- iPc->night_timer_tid = iTimer->add_timer_interval(iTimer->gettick() + day_duration + (iMap->night_flag ? night_duration : 0), iPc->map_night_timer, 0, 0, day_duration + night_duration);
+ pc->day_timer_tid = iTimer->add_timer_interval(iTimer->gettick() + (iMap->night_flag ? 0 : day_duration) + night_duration, pc->map_day_timer, 0, 0, day_duration + night_duration);
+ pc->night_timer_tid = iTimer->add_timer_interval(iTimer->gettick() + day_duration + (iMap->night_flag ? night_duration : 0), pc->map_night_timer, 0, 0, day_duration + night_duration);
}
do_init_pc_groups();
@@ -9885,211 +9885,211 @@ int do_init_pc(void) {
* created by Susu
*-------------------------------------*/
void pc_defaults(void) {
- iPc = &iPc_s;
+ pc = &pc_s;
/* vars */
// timer for night.day
- iPc->day_timer_tid = day_timer_tid;
- iPc->night_timer_tid = night_timer_tid;
+ pc->day_timer_tid = day_timer_tid;
+ pc->night_timer_tid = night_timer_tid;
/* funcs */
- iPc->class2idx = pc_class2idx;
- iPc->get_group_level = pc_get_group_level;
- iPc->can_give_items = pc_can_give_items;
+ pc->class2idx = pc_class2idx;
+ pc->get_group_level = pc_get_group_level;
+ pc->can_give_items = pc_can_give_items;
- iPc->can_use_command = pc_can_use_command;
+ pc->can_use_command = pc_can_use_command;
- iPc->setrestartvalue = pc_setrestartvalue;
- iPc->makesavestatus = pc_makesavestatus;
- iPc->respawn = pc_respawn;
- iPc->setnewpc = pc_setnewpc;
- iPc->authok = pc_authok;
- iPc->authfail = pc_authfail;
- iPc->reg_received = pc_reg_received;
+ pc->setrestartvalue = pc_setrestartvalue;
+ pc->makesavestatus = pc_makesavestatus;
+ pc->respawn = pc_respawn;
+ pc->setnewpc = pc_setnewpc;
+ pc->authok = pc_authok;
+ pc->authfail = pc_authfail;
+ pc->reg_received = pc_reg_received;
- iPc->isequip = pc_isequip;
- iPc->equippoint = pc_equippoint;
- iPc->setinventorydata = pc_setinventorydata;
+ pc->isequip = pc_isequip;
+ pc->equippoint = pc_equippoint;
+ pc->setinventorydata = pc_setinventorydata;
- iPc->checkskill = pc_checkskill;
- iPc->checkskill2 = pc_checkskill2;
- iPc->checkallowskill = pc_checkallowskill;
- iPc->checkequip = pc_checkequip;
+ pc->checkskill = pc_checkskill;
+ pc->checkskill2 = pc_checkskill2;
+ pc->checkallowskill = pc_checkallowskill;
+ pc->checkequip = pc_checkequip;
- iPc->calc_skilltree = pc_calc_skilltree;
- iPc->calc_skilltree_normalize_job = pc_calc_skilltree_normalize_job;
- iPc->clean_skilltree = pc_clean_skilltree;
+ pc->calc_skilltree = pc_calc_skilltree;
+ pc->calc_skilltree_normalize_job = pc_calc_skilltree_normalize_job;
+ pc->clean_skilltree = pc_clean_skilltree;
- iPc->setpos = pc_setpos;
- iPc->setsavepoint = pc_setsavepoint;
- iPc->randomwarp = pc_randomwarp;
- iPc->memo = pc_memo;
+ pc->setpos = pc_setpos;
+ pc->setsavepoint = pc_setsavepoint;
+ pc->randomwarp = pc_randomwarp;
+ pc->memo = pc_memo;
- iPc->checkadditem = pc_checkadditem;
- iPc->inventoryblank = pc_inventoryblank;
- iPc->search_inventory = pc_search_inventory;
- iPc->payzeny = pc_payzeny;
- iPc->additem = pc_additem;
- iPc->getzeny = pc_getzeny;
- iPc->delitem = pc_delitem;
+ pc->checkadditem = pc_checkadditem;
+ pc->inventoryblank = pc_inventoryblank;
+ pc->search_inventory = pc_search_inventory;
+ pc->payzeny = pc_payzeny;
+ pc->additem = pc_additem;
+ pc->getzeny = pc_getzeny;
+ pc->delitem = pc_delitem;
// Special Shop System
- iPc->paycash = pc_paycash;
- iPc->getcash = pc_getcash;
+ pc->paycash = pc_paycash;
+ pc->getcash = pc_getcash;
- iPc->cart_additem = pc_cart_additem;
- iPc->cart_delitem = pc_cart_delitem;
- iPc->putitemtocart = pc_putitemtocart;
- iPc->getitemfromcart = pc_getitemfromcart;
- iPc->cartitem_amount = pc_cartitem_amount;
+ pc->cart_additem = pc_cart_additem;
+ pc->cart_delitem = pc_cart_delitem;
+ pc->putitemtocart = pc_putitemtocart;
+ pc->getitemfromcart = pc_getitemfromcart;
+ pc->cartitem_amount = pc_cartitem_amount;
- iPc->takeitem = pc_takeitem;
- iPc->dropitem = pc_dropitem;
+ pc->takeitem = pc_takeitem;
+ pc->dropitem = pc_dropitem;
- iPc->isequipped = pc_isequipped;
- iPc->can_Adopt = pc_can_Adopt;
- iPc->adoption = pc_adoption;
+ pc->isequipped = pc_isequipped;
+ pc->can_Adopt = pc_can_Adopt;
+ pc->adoption = pc_adoption;
- iPc->updateweightstatus = pc_updateweightstatus;
+ pc->updateweightstatus = pc_updateweightstatus;
- iPc->addautobonus = pc_addautobonus;
- iPc->exeautobonus = pc_exeautobonus;
- iPc->endautobonus = pc_endautobonus;
- iPc->delautobonus = pc_delautobonus;
+ pc->addautobonus = pc_addautobonus;
+ pc->exeautobonus = pc_exeautobonus;
+ pc->endautobonus = pc_endautobonus;
+ pc->delautobonus = pc_delautobonus;
- iPc->bonus = pc_bonus;
- iPc->bonus2 = pc_bonus2;
- iPc->bonus3 = pc_bonus3;
- iPc->bonus4 = pc_bonus4;
- iPc->bonus5 = pc_bonus5;
- iPc->skill = pc_skill;
+ pc->bonus = pc_bonus;
+ pc->bonus2 = pc_bonus2;
+ pc->bonus3 = pc_bonus3;
+ pc->bonus4 = pc_bonus4;
+ pc->bonus5 = pc_bonus5;
+ pc->skill = pc_skill;
- iPc->insert_card = pc_insert_card;
+ pc->insert_card = pc_insert_card;
- iPc->steal_item = pc_steal_item;
- iPc->steal_coin = pc_steal_coin;
+ pc->steal_item = pc_steal_item;
+ pc->steal_coin = pc_steal_coin;
- iPc->modifybuyvalue = pc_modifybuyvalue;
- iPc->modifysellvalue = pc_modifysellvalue;
+ pc->modifybuyvalue = pc_modifybuyvalue;
+ pc->modifysellvalue = pc_modifysellvalue;
- iPc->follow = pc_follow; // [MouseJstr]
- iPc->stop_following = pc_stop_following;
+ pc->follow = pc_follow; // [MouseJstr]
+ pc->stop_following = pc_stop_following;
- iPc->maxbaselv = pc_maxbaselv;
- iPc->maxjoblv = pc_maxjoblv;
- iPc->checkbaselevelup = pc_checkbaselevelup;
- iPc->checkjoblevelup = pc_checkjoblevelup;
- iPc->gainexp = pc_gainexp;
- iPc->nextbaseexp = pc_nextbaseexp;
- iPc->thisbaseexp = pc_thisbaseexp;
- iPc->nextjobexp = pc_nextjobexp;
- iPc->thisjobexp = pc_thisjobexp;
- iPc->gets_status_point = pc_gets_status_point;
- iPc->need_status_point = pc_need_status_point;
- iPc->statusup = pc_statusup;
- iPc->statusup2 = pc_statusup2;
- iPc->skillup = pc_skillup;
- iPc->allskillup = pc_allskillup;
- iPc->resetlvl = pc_resetlvl;
- iPc->resetstate = pc_resetstate;
- iPc->resetskill = pc_resetskill;
- iPc->resetfeel = pc_resetfeel;
- iPc->resethate = pc_resethate;
- iPc->equipitem = pc_equipitem;
- iPc->unequipitem = pc_unequipitem;
- iPc->checkitem = pc_checkitem;
- iPc->useitem = pc_useitem;
+ pc->maxbaselv = pc_maxbaselv;
+ pc->maxjoblv = pc_maxjoblv;
+ pc->checkbaselevelup = pc_checkbaselevelup;
+ pc->checkjoblevelup = pc_checkjoblevelup;
+ pc->gainexp = pc_gainexp;
+ pc->nextbaseexp = pc_nextbaseexp;
+ pc->thisbaseexp = pc_thisbaseexp;
+ pc->nextjobexp = pc_nextjobexp;
+ pc->thisjobexp = pc_thisjobexp;
+ pc->gets_status_point = pc_gets_status_point;
+ pc->need_status_point = pc_need_status_point;
+ pc->statusup = pc_statusup;
+ pc->statusup2 = pc_statusup2;
+ pc->skillup = pc_skillup;
+ pc->allskillup = pc_allskillup;
+ pc->resetlvl = pc_resetlvl;
+ pc->resetstate = pc_resetstate;
+ pc->resetskill = pc_resetskill;
+ pc->resetfeel = pc_resetfeel;
+ pc->resethate = pc_resethate;
+ pc->equipitem = pc_equipitem;
+ pc->unequipitem = pc_unequipitem;
+ pc->checkitem = pc_checkitem;
+ pc->useitem = pc_useitem;
- iPc->skillatk_bonus = pc_skillatk_bonus;
- iPc->skillheal_bonus = pc_skillheal_bonus;
- iPc->skillheal2_bonus = pc_skillheal2_bonus;
+ pc->skillatk_bonus = pc_skillatk_bonus;
+ pc->skillheal_bonus = pc_skillheal_bonus;
+ pc->skillheal2_bonus = pc_skillheal2_bonus;
- iPc->damage = pc_damage;
- iPc->dead = pc_dead;
- iPc->revive = pc_revive;
- iPc->heal = pc_heal;
- iPc->itemheal = pc_itemheal;
- iPc->percentheal = pc_percentheal;
- iPc->jobchange = pc_jobchange;
- iPc->setoption = pc_setoption;
- iPc->setcart = pc_setcart;
- iPc->setfalcon = pc_setfalcon;
- iPc->setriding = pc_setriding;
- iPc->setmadogear = pc_setmadogear;
- iPc->changelook = pc_changelook;
- iPc->equiplookall = pc_equiplookall;
+ pc->damage = pc_damage;
+ pc->dead = pc_dead;
+ pc->revive = pc_revive;
+ pc->heal = pc_heal;
+ pc->itemheal = pc_itemheal;
+ pc->percentheal = pc_percentheal;
+ pc->jobchange = pc_jobchange;
+ pc->setoption = pc_setoption;
+ pc->setcart = pc_setcart;
+ pc->setfalcon = pc_setfalcon;
+ pc->setriding = pc_setriding;
+ pc->setmadogear = pc_setmadogear;
+ pc->changelook = pc_changelook;
+ pc->equiplookall = pc_equiplookall;
- iPc->readparam = pc_readparam;
- iPc->setparam = pc_setparam;
- iPc->readreg = pc_readreg;
- iPc->setreg = pc_setreg;
- iPc->readregstr = pc_readregstr;
- iPc->setregstr = pc_setregstr;
- iPc->readregistry = pc_readregistry;
- iPc->setregistry = pc_setregistry;
- iPc->readregistry_str = pc_readregistry_str;
- iPc->setregistry_str = pc_setregistry_str;
+ pc->readparam = pc_readparam;
+ pc->setparam = pc_setparam;
+ pc->readreg = pc_readreg;
+ pc->setreg = pc_setreg;
+ pc->readregstr = pc_readregstr;
+ pc->setregstr = pc_setregstr;
+ pc->readregistry = pc_readregistry;
+ pc->setregistry = pc_setregistry;
+ pc->readregistry_str = pc_readregistry_str;
+ pc->setregistry_str = pc_setregistry_str;
- iPc->addeventtimer = pc_addeventtimer;
- iPc->deleventtimer = pc_deleventtimer;
- iPc->cleareventtimer = pc_cleareventtimer;
- iPc->addeventtimercount = pc_addeventtimercount;
+ pc->addeventtimer = pc_addeventtimer;
+ pc->deleventtimer = pc_deleventtimer;
+ pc->cleareventtimer = pc_cleareventtimer;
+ pc->addeventtimercount = pc_addeventtimercount;
- iPc->calc_pvprank = pc_calc_pvprank;
- iPc->calc_pvprank_timer = pc_calc_pvprank_timer;
+ pc->calc_pvprank = pc_calc_pvprank;
+ pc->calc_pvprank_timer = pc_calc_pvprank_timer;
- iPc->ismarried = pc_ismarried;
- iPc->marriage = pc_marriage;
- iPc->divorce = pc_divorce;
- iPc->get_partner = pc_get_partner;
- iPc->get_father = pc_get_father;
- iPc->get_mother = pc_get_mother;
- iPc->get_child = pc_get_child;
+ pc->ismarried = pc_ismarried;
+ pc->marriage = pc_marriage;
+ pc->divorce = pc_divorce;
+ pc->get_partner = pc_get_partner;
+ pc->get_father = pc_get_father;
+ pc->get_mother = pc_get_mother;
+ pc->get_child = pc_get_child;
- iPc->bleeding = pc_bleeding;
- iPc->regen = pc_regen;
+ pc->bleeding = pc_bleeding;
+ pc->regen = pc_regen;
- iPc->setstand = pc_setstand;
- iPc->candrop = pc_candrop;
+ pc->setstand = pc_setstand;
+ pc->candrop = pc_candrop;
- iPc->jobid2mapid = pc_jobid2mapid; // Skotlex
- iPc->mapid2jobid = pc_mapid2jobid; // Skotlex
+ pc->jobid2mapid = pc_jobid2mapid; // Skotlex
+ pc->mapid2jobid = pc_mapid2jobid; // Skotlex
- iPc->job_name = job_name;
+ pc->job_name = job_name;
- iPc->setinvincibletimer = pc_setinvincibletimer;
- iPc->delinvincibletimer = pc_delinvincibletimer;
+ pc->setinvincibletimer = pc_setinvincibletimer;
+ pc->delinvincibletimer = pc_delinvincibletimer;
- iPc->addspiritball = pc_addspiritball;
- iPc->delspiritball = pc_delspiritball;
- iPc->addfame = pc_addfame;
- iPc->famerank = pc_famerank;
- iPc->set_hate_mob = pc_set_hate_mob;
+ pc->addspiritball = pc_addspiritball;
+ pc->delspiritball = pc_delspiritball;
+ pc->addfame = pc_addfame;
+ pc->famerank = pc_famerank;
+ pc->set_hate_mob = pc_set_hate_mob;
- iPc->readdb = pc_readdb;
- iPc->do_init_pc = do_init_pc;
- iPc->do_final_pc = do_final_pc;
- iPc->map_day_timer = map_day_timer; // by [yor]
- iPc->map_night_timer = map_night_timer; // by [yor]
+ pc->readdb = pc_readdb;
+ pc->do_init_pc = do_init_pc;
+ pc->do_final_pc = do_final_pc;
+ pc->map_day_timer = map_day_timer; // by [yor]
+ pc->map_night_timer = map_night_timer; // by [yor]
// Rental System
- iPc->inventory_rentals = pc_inventory_rentals;
- iPc->inventory_rental_clear = pc_inventory_rental_clear;
- iPc->inventory_rental_add = pc_inventory_rental_add;
+ pc->inventory_rentals = pc_inventory_rentals;
+ pc->inventory_rental_clear = pc_inventory_rental_clear;
+ pc->inventory_rental_add = pc_inventory_rental_add;
- iPc->disguise = pc_disguise;
- iPc->isautolooting = pc_isautolooting;
+ pc->disguise = pc_disguise;
+ pc->isautolooting = pc_isautolooting;
- iPc->overheat = pc_overheat;
+ pc->overheat = pc_overheat;
- iPc->banding = pc_banding;
+ pc->banding = pc_banding;
- iPc->itemcd_do = pc_itemcd_do;
+ pc->itemcd_do = pc_itemcd_do;
- iPc->load_combo = pc_load_combo;
+ pc->load_combo = pc_load_combo;
- iPc->add_talisman = pc_add_talisman;
- iPc->del_talisman = pc_del_talisman;
+ pc->add_talisman = pc_add_talisman;
+ pc->del_talisman = pc_del_talisman;
- iPc->baselevelchanged = pc_baselevelchanged;
- iPc->level_penalty_mod = pc_level_penalty_mod;
+ pc->baselevelchanged = pc_baselevelchanged;
+ pc->level_penalty_mod = pc_level_penalty_mod;
}
diff --git a/src/map/pc.h b/src/map/pc.h
index 91f7750b3..f7c67b564 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -707,18 +707,18 @@ enum equip_pos {
-#define pc_readglobalreg(sd,reg) iPc->readregistry(sd,reg,3)
-#define pc_setglobalreg(sd,reg,val) iPc->setregistry(sd,reg,val,3)
-#define pc_readglobalreg_str(sd,reg) iPc->readregistry_str(sd,reg,3)
-#define pc_setglobalreg_str(sd,reg,val) iPc->setregistry_str(sd,reg,val,3)
-#define pc_readaccountreg(sd,reg) iPc->readregistry(sd,reg,2)
-#define pc_setaccountreg(sd,reg,val) iPc->setregistry(sd,reg,val,2)
-#define pc_readaccountregstr(sd,reg) iPc->readregistry_str(sd,reg,2)
-#define pc_setaccountregstr(sd,reg,val) iPc->setregistry_str(sd,reg,val,2)
-#define pc_readaccountreg2(sd,reg) iPc->readregistry(sd,reg,1)
-#define pc_setaccountreg2(sd,reg,val) iPc->setregistry(sd,reg,val,1)
-#define pc_readaccountreg2str(sd,reg) iPc->readregistry_str(sd,reg,1)
-#define pc_setaccountreg2str(sd,reg,val) iPc->setregistry_str(sd,reg,val,1)
+#define pc_readglobalreg(sd,reg) pc->readregistry(sd,reg,3)
+#define pc_setglobalreg(sd,reg,val) pc->setregistry(sd,reg,val,3)
+#define pc_readglobalreg_str(sd,reg) pc->readregistry_str(sd,reg,3)
+#define pc_setglobalreg_str(sd,reg,val) pc->setregistry_str(sd,reg,val,3)
+#define pc_readaccountreg(sd,reg) pc->readregistry(sd,reg,2)
+#define pc_setaccountreg(sd,reg,val) pc->setregistry(sd,reg,val,2)
+#define pc_readaccountregstr(sd,reg) pc->readregistry_str(sd,reg,2)
+#define pc_setaccountregstr(sd,reg,val) pc->setregistry_str(sd,reg,val,2)
+#define pc_readaccountreg2(sd,reg) pc->readregistry(sd,reg,1)
+#define pc_setaccountreg2(sd,reg,val) pc->setregistry(sd,reg,val,1)
+#define pc_readaccountreg2str(sd,reg) pc->readregistry_str(sd,reg,1)
+#define pc_setaccountreg2str(sd,reg,val) pc->setregistry_str(sd,reg,val,1)
@@ -982,9 +982,9 @@ struct pc_interface {
void (*baselevelchanged) (struct map_session_data *sd);
int (*level_penalty_mod) (struct map_session_data *sd, struct mob_data * md, int type);
-} iPc_s;
+} pc_s;
-struct pc_interface *iPc;
+struct pc_interface *pc;
void pc_defaults(void);
diff --git a/src/map/pet.c b/src/map/pet.c
index fa5188e79..00402f9d4 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -76,7 +76,7 @@ int pet_create_egg(struct map_session_data *sd, int item_id)
{
int pet_id = search_petDB_index(item_id, PET_EGG);
if (pet_id < 0) return 0; //No pet egg here.
- if (!iPc->inventoryblank(sd)) return 0; // Inventory full
+ if (!pc->inventoryblank(sd)) return 0; // Inventory full
sd->catch_target_class = pet_db[pet_id].class_;
intif_create_pet(sd->status.account_id, sd->status.char_id,
(short)pet_db[pet_id].class_,
@@ -304,7 +304,7 @@ static int pet_return_egg(struct map_session_data *sd, struct pet_data *pd)
tmp_item.card[1] = GetWord(pd->pet.pet_id,0);
tmp_item.card[2] = GetWord(pd->pet.pet_id,1);
tmp_item.card[3] = pd->pet.rename_flag;
- if((flag = iPc->additem(sd,&tmp_item,1,LOG_TYPE_OTHER))) {
+ if((flag = pc->additem(sd,&tmp_item,1,LOG_TYPE_OTHER))) {
clif->additem(sd,0,0,flag);
iMap->addflooritem(&tmp_item,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
@@ -448,7 +448,7 @@ int pet_recv_petdata(int account_id,struct s_pet *p,int flag)
return 1;
}
if (!pet_birth_process(sd,p)) //Pet hatched. Delete egg.
- iPc->delitem(sd,i,1,0,0,LOG_TYPE_OTHER);
+ pc->delitem(sd,i,1,0,0,LOG_TYPE_OTHER);
} else {
pet_data_init(sd,p);
if(sd->pd && sd->bl.prev != NULL) {
@@ -569,7 +569,7 @@ int pet_get_egg(int account_id,int pet_id,int flag)
tmp_item.card[1] = GetWord(pet_id,0);
tmp_item.card[2] = GetWord(pet_id,1);
tmp_item.card[3] = 0; //New pets are not named.
- if((ret = iPc->additem(sd,&tmp_item,1,LOG_TYPE_PICKDROP_PLAYER))) {
+ if((ret = pc->additem(sd,&tmp_item,1,LOG_TYPE_PICKDROP_PLAYER))) {
clif->additem(sd,0,0,ret);
iMap->addflooritem(&tmp_item,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
@@ -594,7 +594,7 @@ int pet_menu(struct map_session_data *sd,int menunum)
egg_id = itemdb_exists(sd->pd->petDB->EggID);
if (egg_id) {
- if ((egg_id->flag.trade_restriction&0x01) && !iPc->inventoryblank(sd)) {
+ if ((egg_id->flag.trade_restriction&0x01) && !pc->inventoryblank(sd)) {
clif->message(sd->fd, msg_txt(451)); // You can't return your pet because your inventory is full.
return 1;
}
@@ -674,7 +674,7 @@ int pet_equipitem(struct map_session_data *sd,int index)
return 1;
}
- iPc->delitem(sd,index,1,0,0,LOG_TYPE_OTHER);
+ pc->delitem(sd,index,1,0,0,LOG_TYPE_OTHER);
pd->pet.equip = nameid;
status_set_viewdata(&pd->bl, pd->pet.class_); //Updates view_data.
clif->send_petdata(NULL, sd->pd, 3, sd->pd->vd.head_bottom);
@@ -710,7 +710,7 @@ static int pet_unequipitem(struct map_session_data *sd, struct pet_data *pd)
memset(&tmp_item,0,sizeof(tmp_item));
tmp_item.nameid = nameid;
tmp_item.identify = 1;
- if((flag = iPc->additem(sd,&tmp_item,1,LOG_TYPE_OTHER))) {
+ if((flag = pc->additem(sd,&tmp_item,1,LOG_TYPE_OTHER))) {
clif->additem(sd,0,0,flag);
iMap->addflooritem(&tmp_item,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
@@ -744,12 +744,12 @@ static int pet_food(struct map_session_data *sd, struct pet_data *pd)
int i,k;
k=pd->petDB->FoodID;
- i=iPc->search_inventory(sd,k);
+ i=pc->search_inventory(sd,k);
if(i < 0) {
clif->pet_food(sd,k,0);
return 1;
}
- iPc->delitem(sd,i,1,0,0,LOG_TYPE_CONSUME);
+ pc->delitem(sd,i,1,0,0,LOG_TYPE_CONSUME);
if( pd->pet.hungry > 90 )
pet_set_intimate(pd, pd->pet.intimate - pd->petDB->r_full);
@@ -1021,7 +1021,7 @@ int pet_lootitem_drop(struct pet_data *pd,struct map_session_data *sd)
for(i=0;i<pd->loot->count;i++) {
it = &pd->loot->item[i];
if(sd){
- if((flag = iPc->additem(sd,it,it->amount,LOG_TYPE_PICKDROP_PLAYER))){
+ if((flag = pc->additem(sd,it,it->amount,LOG_TYPE_PICKDROP_PLAYER))){
clif->additem(sd,0,0,flag);
ditem = ers_alloc(item_drop_ers, struct item_drop);
memcpy(&ditem->item_data, it, sizeof(struct item));
diff --git a/src/map/script.c b/src/map/script.c
index 9569e526d..608a1fcff 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -2335,7 +2335,7 @@ void get_val(struct script_state* st, struct script_data* data)
switch( prefix )
{
case '@':
- data->u.str = iPc->readregstr(sd, data->u.num);
+ data->u.str = pc->readregstr(sd, data->u.num);
break;
case '$':
data->u.str = mapreg_readregstr(data->u.num);
@@ -2394,13 +2394,13 @@ void get_val(struct script_state* st, struct script_data* data)
}
else if( reference_toparam(data) )
{
- data->u.num = iPc->readparam(sd, reference_getparamtype(data));
+ data->u.num = pc->readparam(sd, reference_getparamtype(data));
}
else
switch( prefix )
{
case '@':
- data->u.num = iPc->readreg(sd, data->u.num);
+ data->u.num = pc->readreg(sd, data->u.num);
break;
case '$':
data->u.num = mapreg_readreg(data->u.num);
@@ -2467,7 +2467,7 @@ static int set_reg(struct script_state* st, TBL_PC* sd, int num, const char* nam
const char* str = (const char*)value;
switch (prefix) {
case '@':
- return iPc->setregstr(sd, num, str);
+ return pc->setregstr(sd, num, str);
case '$':
return mapreg_setregstr(num, str);
case '#':
@@ -2499,7 +2499,7 @@ static int set_reg(struct script_state* st, TBL_PC* sd, int num, const char* nam
int val = (int)__64BPTRSIZE(value);
if(str_data[num&0x00ffffff].type == C_PARAM)
{
- if( iPc->setparam(sd, str_data[num&0x00ffffff].val, val) == 0 )
+ if( pc->setparam(sd, str_data[num&0x00ffffff].val, val) == 0 )
{
if( st != NULL )
{
@@ -2514,7 +2514,7 @@ static int set_reg(struct script_state* st, TBL_PC* sd, int num, const char* nam
switch (prefix) {
case '@':
- return iPc->setreg(sd, num, val);
+ return pc->setreg(sd, num, val);
case '$':
return mapreg_setreg(num, val);
case '#':
@@ -3706,14 +3706,14 @@ void script_cleararray_pc(struct map_session_data* sd, const char* varname, void
{
for( idx = 0; idx < SCRIPT_MAX_ARRAYSIZE; idx++ )
{
- iPc->setregstr(sd, reference_uid(key, idx), (const char*)value);
+ pc->setregstr(sd, reference_uid(key, idx), (const char*)value);
}
}
else
{
for( idx = 0; idx < SCRIPT_MAX_ARRAYSIZE; idx++ )
{
- iPc->setreg(sd, reference_uid(key, idx), (int)__64BPTRSIZE(value));
+ pc->setreg(sd, reference_uid(key, idx), (int)__64BPTRSIZE(value));
}
}
}
@@ -3741,11 +3741,11 @@ void script_setarray_pc(struct map_session_data* sd, const char* varname, uint8
if( is_string_variable(varname) )
{
- iPc->setregstr(sd, reference_uid(key, idx), (const char*)value);
+ pc->setregstr(sd, reference_uid(key, idx), (const char*)value);
}
else
{
- iPc->setreg(sd, reference_uid(key, idx), (int)__64BPTRSIZE(value));
+ pc->setreg(sd, reference_uid(key, idx), (int)__64BPTRSIZE(value));
}
if( refcache )
@@ -4159,7 +4159,7 @@ BUILDIN(menu)
st->state = END;
return false;
}
- iPc->setreg(sd, add_str("@menu"), menu);
+ pc->setreg(sd, add_str("@menu"), menu);
st->pos = script_getnum(st, i + 1);
st->state = GOTO;
}
@@ -4236,7 +4236,7 @@ BUILDIN(select)
if( sd->npc_menu <= 0 )
break;// entry found
}
- iPc->setreg(sd, add_str("@menu"), menu);
+ pc->setreg(sd, add_str("@menu"), menu);
script_pushint(st, menu);
st->state = RUN;
}
@@ -4307,7 +4307,7 @@ BUILDIN(prompt)
else if( sd->npc_menu == 0xff )
{// Cancel was pressed
sd->state.menu_or_input = 0;
- iPc->setreg(sd, add_str("@menu"), 0xff);
+ pc->setreg(sd, add_str("@menu"), 0xff);
script_pushint(st, 0xff);
st->state = RUN;
}
@@ -4323,7 +4323,7 @@ BUILDIN(prompt)
if( sd->npc_menu <= 0 )
break;// entry found
}
- iPc->setreg(sd, add_str("@menu"), menu);
+ pc->setreg(sd, add_str("@menu"), menu);
script_pushint(st, menu);
st->state = RUN;
}
@@ -4569,11 +4569,11 @@ BUILDIN(warp)
y = script_getnum(st,4);
if(strcmp(str,"Random")==0)
- ret = iPc->randomwarp(sd,CLR_TELEPORT);
+ ret = pc->randomwarp(sd,CLR_TELEPORT);
else if(strcmp(str,"SavePoint")==0 || strcmp(str,"Save")==0)
- ret = iPc->setpos(sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,CLR_TELEPORT);
+ ret = pc->setpos(sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,CLR_TELEPORT);
else
- ret = iPc->setpos(sd,mapindex_name2id(str),x,y,CLR_OUTSIGHT);
+ ret = pc->setpos(sd,mapindex_name2id(str),x,y,CLR_OUTSIGHT);
if( ret ) {
ShowError("buildin_warp: moving player '%s' to \"%s\",%d,%d failed.\n", sd->status.name, str, x, y);
@@ -4597,7 +4597,7 @@ static int buildin_areawarp_sub(struct block_list *bl,va_list ap)
y3 = va_arg(ap,int);
if(index == 0)
- iPc->randomwarp((TBL_PC *)bl,CLR_TELEPORT);
+ pc->randomwarp((TBL_PC *)bl,CLR_TELEPORT);
else if(x3 && y3) {
int max, tx, ty, j = 0;
@@ -4612,10 +4612,10 @@ static int buildin_areawarp_sub(struct block_list *bl,va_list ap)
j++;
} while( iMap->getcell(index,tx,ty,CELL_CHKNOPASS) && j < max );
- iPc->setpos((TBL_PC *)bl,index,tx,ty,CLR_OUTSIGHT);
+ pc->setpos((TBL_PC *)bl,index,tx,ty,CLR_OUTSIGHT);
}
else
- iPc->setpos((TBL_PC *)bl,index,x2,y2,CLR_OUTSIGHT);
+ pc->setpos((TBL_PC *)bl,index,x2,y2,CLR_OUTSIGHT);
return 0;
}
BUILDIN(areawarp)
@@ -4665,7 +4665,7 @@ static int buildin_areapercentheal_sub(struct block_list *bl,va_list ap)
int hp, sp;
hp = va_arg(ap, int);
sp = va_arg(ap, int);
- iPc->percentheal((TBL_PC *)bl,hp,sp);
+ pc->percentheal((TBL_PC *)bl,hp,sp);
return 0;
}
BUILDIN(areapercentheal)
@@ -4711,12 +4711,12 @@ BUILDIN(warpchar)
return true;
if(strcmp(str, "Random") == 0)
- iPc->randomwarp(sd, CLR_TELEPORT);
+ pc->randomwarp(sd, CLR_TELEPORT);
else
if(strcmp(str, "SavePoint") == 0)
- iPc->setpos(sd, sd->status.save_point.map,sd->status.save_point.x, sd->status.save_point.y, CLR_TELEPORT);
+ pc->setpos(sd, sd->status.save_point.map,sd->status.save_point.x, sd->status.save_point.y, CLR_TELEPORT);
else
- iPc->setpos(sd, mapindex_name2id(str), x, y, CLR_TELEPORT);
+ pc->setpos(sd, mapindex_name2id(str), x, y, CLR_TELEPORT);
return true;
}
@@ -4790,20 +4790,20 @@ BUILDIN(warpparty)
{
case 0: // Random
if(!map[pl_sd->bl.m].flag.nowarp)
- iPc->randomwarp(pl_sd,CLR_TELEPORT);
+ pc->randomwarp(pl_sd,CLR_TELEPORT);
break;
case 1: // SavePointAll
if(!map[pl_sd->bl.m].flag.noreturn)
- iPc->setpos(pl_sd,pl_sd->status.save_point.map,pl_sd->status.save_point.x,pl_sd->status.save_point.y,CLR_TELEPORT);
+ pc->setpos(pl_sd,pl_sd->status.save_point.map,pl_sd->status.save_point.x,pl_sd->status.save_point.y,CLR_TELEPORT);
break;
case 2: // SavePoint
if(!map[pl_sd->bl.m].flag.noreturn)
- iPc->setpos(pl_sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,CLR_TELEPORT);
+ pc->setpos(pl_sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,CLR_TELEPORT);
break;
case 3: // Leader
case 4: // m,x,y
if(!map[pl_sd->bl.m].flag.noreturn && !map[pl_sd->bl.m].flag.nowarp)
- iPc->setpos(pl_sd,mapindex,x,y,CLR_TELEPORT);
+ pc->setpos(pl_sd,mapindex,x,y,CLR_TELEPORT);
break;
}
}
@@ -4851,19 +4851,19 @@ BUILDIN(warpguild)
{
case 0: // Random
if(!map[pl_sd->bl.m].flag.nowarp)
- iPc->randomwarp(pl_sd,CLR_TELEPORT);
+ pc->randomwarp(pl_sd,CLR_TELEPORT);
break;
case 1: // SavePointAll
if(!map[pl_sd->bl.m].flag.noreturn)
- iPc->setpos(pl_sd,pl_sd->status.save_point.map,pl_sd->status.save_point.x,pl_sd->status.save_point.y,CLR_TELEPORT);
+ pc->setpos(pl_sd,pl_sd->status.save_point.map,pl_sd->status.save_point.x,pl_sd->status.save_point.y,CLR_TELEPORT);
break;
case 2: // SavePoint
if(!map[pl_sd->bl.m].flag.noreturn)
- iPc->setpos(pl_sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,CLR_TELEPORT);
+ pc->setpos(pl_sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,CLR_TELEPORT);
break;
case 3: // m,x,y
if(!map[pl_sd->bl.m].flag.noreturn && !map[pl_sd->bl.m].flag.nowarp)
- iPc->setpos(pl_sd,mapindex_name2id(str),x,y,CLR_TELEPORT);
+ pc->setpos(pl_sd,mapindex_name2id(str),x,y,CLR_TELEPORT);
break;
}
}
@@ -4906,7 +4906,7 @@ BUILDIN(itemheal)
sd = script_rid2sd(st);
if (!sd) return true;
- iPc->itemheal(sd,sd->itemid,hp,sp);
+ pc->itemheal(sd,sd->itemid,hp,sp);
return true;
}
/*==========================================
@@ -4933,7 +4933,7 @@ BUILDIN(percentheal)
if( sd->sc.data[SC_EXTREMITYFIST2] )
sp = 0;
#endif
- iPc->percentheal(sd,hp,sp);
+ pc->percentheal(sd,hp,sp);
return true;
}
@@ -4956,7 +4956,7 @@ BUILDIN(jobchange)
if( sd == NULL )
return true;
- iPc->jobchange(sd, job, upper);
+ pc->jobchange(sd, job, upper);
}
return true;
@@ -4968,7 +4968,7 @@ BUILDIN(jobchange)
BUILDIN(jobname)
{
int class_=script_getnum(st,2);
- script_pushconststr(st, (char*)iPc->job_name(class_));
+ script_pushconststr(st, (char*)pc->job_name(class_));
return true;
}
@@ -5530,7 +5530,7 @@ BUILDIN(setlook)
if( sd == NULL )
return true;
- iPc->changelook(sd,type,val);
+ pc->changelook(sd,type,val);
return true;
}
@@ -5719,7 +5719,7 @@ BUILDIN(checkweight)
script_pushint(st,0);
return false;
}
- slots = iPc->inventoryblank(sd); //nb of empty slot
+ slots = pc->inventoryblank(sd); //nb of empty slot
for(i=2; i<nbargs; i=i+2){
data = script_getdata(st,i);
@@ -5750,7 +5750,7 @@ BUILDIN(checkweight)
return true;
}
- switch( iPc->checkadditem(sd, nameid, amount) )
+ switch( pc->checkadditem(sd, nameid, amount) )
{
case ADDITEM_EXIST:
// item is already in inventory, but there is still space for the requested amount
@@ -5833,7 +5833,7 @@ BUILDIN(checkweight2)
fail = 1;
}
- slots = iPc->inventoryblank(sd);
+ slots = pc->inventoryblank(sd);
for(i=0; i<nb_it; i++){
nameid = (int32)__64BPTRSIZE(get_val2(st,reference_uid(id_it,idx_it+i),reference_getref(data_it)));
script_removetop(st, -1, 0);
@@ -5856,7 +5856,7 @@ BUILDIN(checkweight2)
fail = 1;
continue;
}
- switch( iPc->checkadditem(sd, nameid, amount) ) {
+ switch( pc->checkadditem(sd, nameid, amount) ) {
case ADDITEM_EXIST:
// item is already in inventory, but there is still space for the requested amount
break;
@@ -5950,10 +5950,10 @@ BUILDIN(getitem)
// if not pet egg
if (!pet_create_egg(sd, nameid))
{
- if ((flag = iPc->additem(sd, &it, get_count, LOG_TYPE_SCRIPT)))
+ if ((flag = pc->additem(sd, &it, get_count, LOG_TYPE_SCRIPT)))
{
clif->additem(sd, 0, 0, flag);
- if( iPc->candrop(sd,&it) )
+ if( pc->candrop(sd,&it) )
iMap->addflooritem(&it,get_count,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
}
@@ -6048,10 +6048,10 @@ BUILDIN(getitem2)
// if not pet egg
if (!pet_create_egg(sd, nameid))
{
- if ((flag = iPc->additem(sd, &item_tmp, get_count, LOG_TYPE_SCRIPT)))
+ if ((flag = pc->additem(sd, &item_tmp, get_count, LOG_TYPE_SCRIPT)))
{
clif->additem(sd, 0, 0, flag);
- if( iPc->candrop(sd,&item_tmp) )
+ if( pc->candrop(sd,&item_tmp) )
iMap->addflooritem(&item_tmp,get_count,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
}
@@ -6111,7 +6111,7 @@ BUILDIN(rentitem)
it.identify = 1;
it.expire_time = (unsigned int)(time(NULL) + seconds);
- if( (flag = iPc->additem(sd, &it, 1, LOG_TYPE_SCRIPT)) )
+ if( (flag = pc->additem(sd, &it, 1, LOG_TYPE_SCRIPT)) )
{
clif->additem(sd, 0, 0, flag);
return false;
@@ -6180,7 +6180,7 @@ BUILDIN(getnameditem)
item_tmp.card[0]=CARD0_CREATE; //we don't use 255! because for example SIGNED WEAPON shouldn't get TOP10 BS Fame bonus [Lupus]
item_tmp.card[2]=tsd->status.char_id;
item_tmp.card[3]=tsd->status.char_id >> 16;
- if(iPc->additem(sd,&item_tmp,1,LOG_TYPE_SCRIPT)) {
+ if(pc->additem(sd,&item_tmp,1,LOG_TYPE_SCRIPT)) {
script_pushint(st,0);
return true; //Failed to add item, we will not drop if they don't fit
}
@@ -6272,7 +6272,7 @@ static void buildin_delitem_delete(struct map_session_data* sd, int idx, int* am
{// delete associated pet
intif_delete_petdata(MakeDWord(inv->card[1], inv->card[2]));
}
- iPc->delitem(sd, idx, delamount, 0, 0, LOG_TYPE_SCRIPT);
+ pc->delitem(sd, idx, delamount, 0, 0, LOG_TYPE_SCRIPT);
}
amount[0]-= delamount;
@@ -6566,7 +6566,7 @@ BUILDIN(disableitemuse)
/*==========================================
* return the basic stats of sd
- * chk iPc->readparam for available type
+ * chk pc->readparam for available type
*------------------------------------------*/
BUILDIN(readparam)
{
@@ -6584,7 +6584,7 @@ BUILDIN(readparam)
return true;
}
- script_pushint(st,iPc->readparam(sd,type));
+ script_pushint(st,pc->readparam(sd,type));
return true;
}
@@ -6951,7 +6951,7 @@ BUILDIN(getequipid)
}
// get inventory position of item
- i = iPc->checkequip(sd,equip[num]);
+ i = pc->checkequip(sd,equip[num]);
if( i < 0 )
{
script_pushint(st,-1);
@@ -6989,7 +6989,7 @@ BUILDIN(getequipname)
}
// get inventory position of item
- i = iPc->checkequip(sd,equip[num]);
+ i = pc->checkequip(sd,equip[num]);
if( i < 0 )
{
script_pushconststr(st,"");
@@ -7108,7 +7108,7 @@ BUILDIN(getequipisequiped)
return true;
if (num > 0 && num <= ARRAYLENGTH(equip))
- i=iPc->checkequip(sd,equip[num-1]);
+ i=pc->checkequip(sd,equip[num-1]);
if(i >= 0)
script_pushint(st,1);
@@ -7135,7 +7135,7 @@ BUILDIN(getequipisenableref)
return true;
if( num > 0 && num <= ARRAYLENGTH(equip) )
- i = iPc->checkequip(sd,equip[num-1]);
+ i = pc->checkequip(sd,equip[num-1]);
if( i >= 0 && sd->inventory_data[i] && !sd->inventory_data[i]->flag.no_refine && !sd->status.inventory[i].expire_time )
script_pushint(st,1);
else
@@ -7161,7 +7161,7 @@ BUILDIN(getequipisidentify)
return true;
if (num > 0 && num <= ARRAYLENGTH(equip))
- i=iPc->checkequip(sd,equip[num-1]);
+ i=pc->checkequip(sd,equip[num-1]);
if(i >= 0)
script_pushint(st,sd->status.inventory[i].identify);
else
@@ -7187,7 +7187,7 @@ BUILDIN(getequiprefinerycnt)
return true;
if (num > 0 && num <= ARRAYLENGTH(equip))
- i=iPc->checkequip(sd,equip[num-1]);
+ i=pc->checkequip(sd,equip[num-1]);
if(i >= 0)
script_pushint(st,sd->status.inventory[i].refine);
else
@@ -7214,7 +7214,7 @@ BUILDIN(getequipweaponlv)
return true;
if (num > 0 && num <= ARRAYLENGTH(equip))
- i=iPc->checkequip(sd,equip[num-1]);
+ i=pc->checkequip(sd,equip[num-1]);
if(i >= 0 && sd->inventory_data[i])
script_pushint(st,sd->inventory_data[i]->wlv);
else
@@ -7240,7 +7240,7 @@ BUILDIN(getequippercentrefinery)
return true;
if (num > 0 && num <= ARRAYLENGTH(equip))
- i=iPc->checkequip(sd,equip[num-1]);
+ i=pc->checkequip(sd,equip[num-1]);
if(i >= 0 && sd->status.inventory[i].nameid && sd->status.inventory[i].refine < MAX_REFINE)
script_pushint(st,status_get_refine_chance(itemdb_wlv(sd->status.inventory[i].nameid), (int)sd->status.inventory[i].refine));
else
@@ -7263,7 +7263,7 @@ BUILDIN(successrefitem)
return true;
if (num > 0 && num <= ARRAYLENGTH(equip))
- i=iPc->checkequip(sd,equip[num-1]);
+ i=pc->checkequip(sd,equip[num-1]);
if(i >= 0) {
ep=sd->status.inventory[i].equip;
@@ -7271,7 +7271,7 @@ BUILDIN(successrefitem)
logs->pick_pc(sd, LOG_TYPE_SCRIPT, -1, &sd->status.inventory[i],sd->inventory_data[i]);
sd->status.inventory[i].refine++;
- iPc->unequipitem(sd,i,2); // status calc will happen in iPc->equipitem() below
+ pc->unequipitem(sd,i,2); // status calc will happen in pc->equipitem() below
clif->refine(sd->fd,0,i,sd->status.inventory[i].refine);
clif->delitem(sd,i,1,3);
@@ -7280,7 +7280,7 @@ BUILDIN(successrefitem)
logs->pick_pc(sd, LOG_TYPE_SCRIPT, 1, &sd->status.inventory[i],sd->inventory_data[i]);
clif->additem(sd,i,1,0);
- iPc->equipitem(sd,i,ep);
+ pc->equipitem(sd,i,ep);
clif->misceffect(&sd->bl,3);
if(sd->status.inventory[i].refine == 10 &&
sd->status.inventory[i].card[0] == CARD0_FORGE &&
@@ -7288,13 +7288,13 @@ BUILDIN(successrefitem)
){ // Fame point system [DracoRPG]
switch (sd->inventory_data[i]->wlv){
case 1:
- iPc->addfame(sd,1); // Success to refine to +10 a lv1 weapon you forged = +1 fame point
+ pc->addfame(sd,1); // Success to refine to +10 a lv1 weapon you forged = +1 fame point
break;
case 2:
- iPc->addfame(sd,25); // Success to refine to +10 a lv2 weapon you forged = +25 fame point
+ pc->addfame(sd,25); // Success to refine to +10 a lv2 weapon you forged = +25 fame point
break;
case 3:
- iPc->addfame(sd,1000); // Success to refine to +10 a lv3 weapon you forged = +1000 fame point
+ pc->addfame(sd,1000); // Success to refine to +10 a lv3 weapon you forged = +1000 fame point
break;
}
}
@@ -7317,13 +7317,13 @@ BUILDIN(failedrefitem)
return true;
if (num > 0 && num <= ARRAYLENGTH(equip))
- i=iPc->checkequip(sd,equip[num-1]);
+ i=pc->checkequip(sd,equip[num-1]);
if(i >= 0) {
sd->status.inventory[i].refine = 0;
- iPc->unequipitem(sd,i,3); //recalculate bonus
+ pc->unequipitem(sd,i,3); //recalculate bonus
clif->refine(sd->fd,1,i,sd->status.inventory[i].refine); //notify client of failure
- iPc->delitem(sd,i,1,0,2,LOG_TYPE_SCRIPT);
+ pc->delitem(sd,i,1,0,2,LOG_TYPE_SCRIPT);
clif->misceffect(&sd->bl,2); // display failure effect
}
@@ -7345,7 +7345,7 @@ BUILDIN(downrefitem)
return true;
if (num > 0 && num <= ARRAYLENGTH(equip))
- i = iPc->checkequip(sd,equip[num-1]);
+ i = pc->checkequip(sd,equip[num-1]);
if(i >= 0) {
ep = sd->status.inventory[i].equip;
@@ -7353,7 +7353,7 @@ BUILDIN(downrefitem)
logs->pick_pc(sd, LOG_TYPE_SCRIPT, -1, &sd->status.inventory[i],sd->inventory_data[i]);
sd->status.inventory[i].refine++;
- iPc->unequipitem(sd,i,2); // status calc will happen in iPc->equipitem() below
+ pc->unequipitem(sd,i,2); // status calc will happen in pc->equipitem() below
clif->refine(sd->fd,2,i,sd->status.inventory[i].refine = sd->status.inventory[i].refine - 2);
clif->delitem(sd,i,1,3);
@@ -7362,7 +7362,7 @@ BUILDIN(downrefitem)
logs->pick_pc(sd, LOG_TYPE_SCRIPT, 1, &sd->status.inventory[i],sd->inventory_data[i]);
clif->additem(sd,i,1,0);
- iPc->equipitem(sd,i,ep);
+ pc->equipitem(sd,i,ep);
clif->misceffect(&sd->bl,2);
}
@@ -7383,10 +7383,10 @@ BUILDIN(delequip)
return true;
if (num > 0 && num <= ARRAYLENGTH(equip))
- i=iPc->checkequip(sd,equip[num-1]);
+ i=pc->checkequip(sd,equip[num-1]);
if(i >= 0) {
- iPc->unequipitem(sd,i,3); //recalculate bonus
- iPc->delitem(sd,i,1,0,2,LOG_TYPE_SCRIPT);
+ pc->unequipitem(sd,i,3); //recalculate bonus
+ pc->delitem(sd,i,1,0,2,LOG_TYPE_SCRIPT);
}
return true;
@@ -7405,7 +7405,7 @@ BUILDIN(statusup)
if( sd == NULL )
return true;
- iPc->statusup(sd,type);
+ pc->statusup(sd,type);
return true;
}
@@ -7423,7 +7423,7 @@ BUILDIN(statusup2)
if( sd == NULL )
return true;
- iPc->statusup2(sd,type,val);
+ pc->statusup2(sd,type,val);
return true;
}
@@ -7477,16 +7477,16 @@ BUILDIN(bonus)
switch( script_lastdata(st)-2 ) {
case 1:
- iPc->bonus(sd, type, val1);
+ pc->bonus(sd, type, val1);
break;
case 2:
val2 = script_getnum(st,4);
- iPc->bonus2(sd, type, val1, val2);
+ pc->bonus2(sd, type, val1, val2);
break;
case 3:
val2 = script_getnum(st,4);
val3 = script_getnum(st,5);
- iPc->bonus3(sd, type, val1, val2, val3);
+ pc->bonus3(sd, type, val1, val2, val3);
break;
case 4:
if( type == SP_AUTOSPELL_ONSKILL && script_isstring(st,4) )
@@ -7496,7 +7496,7 @@ BUILDIN(bonus)
val3 = script_getnum(st,5);
val4 = script_getnum(st,6);
- iPc->bonus4(sd, type, val1, val2, val3, val4);
+ pc->bonus4(sd, type, val1, val2, val3, val4);
break;
case 5:
if( type == SP_AUTOSPELL_ONSKILL && script_isstring(st,4) )
@@ -7507,7 +7507,7 @@ BUILDIN(bonus)
val3 = script_getnum(st,5);
val4 = script_getnum(st,6);
val5 = script_getnum(st,7);
- iPc->bonus5(sd, type, val1, val2, val3, val4, val5);
+ pc->bonus5(sd, type, val1, val2, val3, val4, val5);
break;
default:
ShowDebug("buildin_bonus: unexpected number of arguments (%d)\n", (script_lastdata(st) - 1));
@@ -7543,7 +7543,7 @@ BUILDIN(autobonus)
if( script_hasdata(st,6) )
other_script = script_getstr(st,6);
- if( iPc->addautobonus(sd->autobonus,ARRAYLENGTH(sd->autobonus),
+ if( pc->addautobonus(sd->autobonus,ARRAYLENGTH(sd->autobonus),
bonus_script,rate,dur,atk_type,other_script,sd->status.inventory[current_equip_item_index].equip,false) )
{
script_add_autobonus(bonus_script);
@@ -7580,7 +7580,7 @@ BUILDIN(autobonus2)
if( script_hasdata(st,6) )
other_script = script_getstr(st,6);
- if( iPc->addautobonus(sd->autobonus2,ARRAYLENGTH(sd->autobonus2),
+ if( pc->addautobonus(sd->autobonus2,ARRAYLENGTH(sd->autobonus2),
bonus_script,rate,dur,atk_type,other_script,sd->status.inventory[current_equip_item_index].equip,false) )
{
script_add_autobonus(bonus_script);
@@ -7615,7 +7615,7 @@ BUILDIN(autobonus3)
if( script_hasdata(st,6) )
other_script = script_getstr(st,6);
- if( iPc->addautobonus(sd->autobonus3,ARRAYLENGTH(sd->autobonus3),
+ if( pc->addautobonus(sd->autobonus3,ARRAYLENGTH(sd->autobonus3),
bonus_script,rate,dur,atk_type,other_script,sd->status.inventory[current_equip_item_index].equip,true) )
{
script_add_autobonus(bonus_script);
@@ -7651,7 +7651,7 @@ BUILDIN(skill)
level = script_getnum(st,3);
if( script_hasdata(st,4) )
flag = script_getnum(st,4);
- iPc->skill(sd, id, level, flag);
+ pc->skill(sd, id, level, flag);
return true;
}
@@ -7680,7 +7680,7 @@ BUILDIN(addtoskill)
level = script_getnum(st,3);
if( script_hasdata(st,4) )
flag = script_getnum(st,4);
- iPc->skill(sd, id, level, flag);
+ pc->skill(sd, id, level, flag);
return true;
}
@@ -7722,7 +7722,7 @@ BUILDIN(getskilllv)
return true;// no player attached, report source
id = ( script_isstring(st,2) ? skill->name2id(script_getstr(st,2)) : script_getnum(st,2) );
- script_pushint(st, iPc->checkskill(sd,id));
+ script_pushint(st, pc->checkskill(sd,id));
return true;
}
@@ -7770,7 +7770,7 @@ BUILDIN(getgmlevel)
if( sd == NULL )
return true;// no player attached, report source
- script_pushint(st, iPc->get_group_level(sd));
+ script_pushint(st, pc->get_group_level(sd));
return true;
}
@@ -7891,9 +7891,9 @@ BUILDIN(setoption)
if( flag ){// Add option
if( option&OPTION_WEDDING && !battle_config.wedding_modifydisplay )
option &= ~OPTION_WEDDING;// Do not show the wedding sprites
- iPc->setoption(sd, sd->sc.option|option);
+ pc->setoption(sd, sd->sc.option|option);
} else// Remove option
- iPc->setoption(sd, sd->sc.option&~option);
+ pc->setoption(sd, sd->sc.option&~option);
return true;
}
@@ -7941,7 +7941,7 @@ BUILDIN(setcart)
if( script_hasdata(st,2) )
type = script_getnum(st,2);
- iPc->setcart(sd, type);
+ pc->setcart(sd, type);
return true;
}
@@ -7984,7 +7984,7 @@ BUILDIN(setfalcon)
if( script_hasdata(st,2) )
flag = script_getnum(st,2);
- iPc->setfalcon(sd, flag);
+ pc->setfalcon(sd, flag);
return true;
}
@@ -8026,7 +8026,7 @@ BUILDIN(setriding)
if( script_hasdata(st,2) )
flag = script_getnum(st,2);
- iPc->setriding(sd, flag);
+ pc->setriding(sd, flag);
return true;
}
@@ -8087,7 +8087,7 @@ BUILDIN(setmadogear)
if( script_hasdata(st,2) )
flag = script_getnum(st,2);
- iPc->setmadogear(sd, flag);
+ pc->setmadogear(sd, flag);
return true;
}
@@ -8113,7 +8113,7 @@ BUILDIN(savepoint)
y = script_getnum(st,4);
map = mapindex_name2id(str);
if( map )
- iPc->setsavepoint(sd, map, x, y);
+ pc->setsavepoint(sd, map, x, y);
return true;
}
@@ -8360,7 +8360,7 @@ BUILDIN(getexp)
base = (int) cap_value(base * bonus, 0, INT_MAX);
job = (int) cap_value(job * bonus, 0, INT_MAX);
- iPc->gainexp(sd, NULL, base, job, true);
+ pc->gainexp(sd, NULL, base, job, true);
return true;
}
@@ -8789,7 +8789,7 @@ BUILDIN(addtimer)
if( sd == NULL )
return true;
- iPc->addeventtimer(sd,tick,event);
+ pc->addeventtimer(sd,tick,event);
return true;
}
/*==========================================
@@ -8805,7 +8805,7 @@ BUILDIN(deltimer)
return true;
check_event(st, event);
- iPc->deleventtimer(sd,event);
+ pc->deleventtimer(sd,event);
return true;
}
/*==========================================
@@ -8823,7 +8823,7 @@ BUILDIN(addtimercount)
return true;
check_event(st, event);
- iPc->addeventtimercount(sd,event,tick);
+ pc->addeventtimercount(sd,event,tick);
return true;
}
@@ -9292,11 +9292,11 @@ BUILDIN(getusersname)
sd = script_rid2sd(st);
if (!sd) return true;
- group_level = iPc->get_group_level(sd);
+ group_level = pc->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) )
{
- if (pc_has_permission(pl_sd, PC_PERM_HIDE_SESSION) && iPc->get_group_level(pl_sd) > group_level)
+ if (pc_has_permission(pl_sd, PC_PERM_HIDE_SESSION) && pc->get_group_level(pl_sd) > group_level)
continue; // skip hidden sessions
/* Temporary fix for bugreport:1023.
@@ -9833,7 +9833,7 @@ BUILDIN(eaclass)
}
class_ = sd->status.class_;
}
- script_pushint(st,iPc->jobid2mapid(class_));
+ script_pushint(st,pc->jobid2mapid(class_));
return true;
}
@@ -9850,7 +9850,7 @@ BUILDIN(roclass)
else
sex = 1; //Just use male when not found.
}
- script_pushint(st,iPc->mapid2jobid(class_, sex));
+ script_pushint(st,pc->mapid2jobid(class_, sex));
return true;
}
@@ -9891,7 +9891,7 @@ BUILDIN(resetlvl)
if( sd == NULL )
return true;
- iPc->resetlvl(sd,type);
+ pc->resetlvl(sd,type);
return true;
}
/*==========================================
@@ -9901,7 +9901,7 @@ BUILDIN(resetstatus)
{
TBL_PC *sd;
sd=script_rid2sd(st);
- iPc->resetstate(sd);
+ pc->resetstate(sd);
return true;
}
@@ -9912,7 +9912,7 @@ BUILDIN(resetskill)
{
TBL_PC *sd;
sd=script_rid2sd(st);
- iPc->resetskill(sd,1);
+ pc->resetskill(sd,1);
return true;
}
@@ -9923,7 +9923,7 @@ BUILDIN(skillpointcount)
{
TBL_PC *sd;
sd=script_rid2sd(st);
- script_pushint(st,sd->status.skill_point + iPc->resetskill(sd,2));
+ script_pushint(st,sd->status.skill_point + pc->resetskill(sd,2));
return true;
}
@@ -9974,10 +9974,10 @@ BUILDIN(changesex)
TBL_PC *sd = NULL;
sd = script_rid2sd(st);
- iPc->resetskill(sd,4);
+ pc->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 ) iPc->unequipitem(sd, sd->equip_index[i], 3);
+ if( sd->equip_index[i] >= 0 ) pc->unequipitem(sd, sd->equip_index[i], 3);
chrif_changesex(sd);
return true;
}
@@ -10202,17 +10202,17 @@ BUILDIN(warpwaitingpc)
{// no zeny to cover set fee
break;
}
- iPc->payzeny(sd, cd->zeny, LOG_TYPE_NPC, NULL);
+ pc->payzeny(sd, cd->zeny, LOG_TYPE_NPC, NULL);
}
mapreg_setreg(reference_uid(add_str("$@warpwaitingpc"), i), sd->bl.id);
if( strcmp(map_name,"Random") == 0 )
- iPc->randomwarp(sd,CLR_TELEPORT);
+ pc->randomwarp(sd,CLR_TELEPORT);
else if( strcmp(map_name,"SavePoint") == 0 )
- iPc->setpos(sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, CLR_TELEPORT);
+ pc->setpos(sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, CLR_TELEPORT);
else
- iPc->setpos(sd, mapindex_name2id(map_name), x, y, CLR_OUTSIGHT);
+ pc->setpos(sd, mapindex_name2id(map_name), x, y, CLR_OUTSIGHT);
}
mapreg_setreg(add_str("$@warpwaitingpcnum"), i);
return true;
@@ -10368,7 +10368,7 @@ BUILDIN(getmapflag)
static int script_mapflag_pvp_sub(struct block_list *bl,va_list ap) {
TBL_PC* sd = (TBL_PC*)bl;
if (sd->pvp_timer == INVALID_TIMER) {
- sd->pvp_timer = iTimer->add_timer(iTimer->gettick() + 200, iPc->calc_pvprank_timer, sd->bl.id, 0);
+ sd->pvp_timer = iTimer->add_timer(iTimer->gettick() + 200, pc->calc_pvprank_timer, sd->bl.id, 0);
sd->pvp_rank = 0;
sd->pvp_lastusers = 0;
sd->pvp_point = 5;
@@ -10599,7 +10599,7 @@ BUILDIN(pvpon)
if( sd->bl.m != m || sd->pvp_timer != INVALID_TIMER )
continue; // not applicable
- sd->pvp_timer = iTimer->add_timer(iTimer->gettick()+200,iPc->calc_pvprank_timer,sd->bl.id,0);
+ sd->pvp_timer = iTimer->add_timer(iTimer->gettick()+200,pc->calc_pvprank_timer,sd->bl.id,0);
sd->pvp_rank = 0;
sd->pvp_lastusers = 0;
sd->pvp_point = 5;
@@ -10616,7 +10616,7 @@ static int buildin_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) {
- iTimer->delete_timer(sd->pvp_timer, iPc->calc_pvprank_timer);
+ iTimer->delete_timer(sd->pvp_timer, pc->calc_pvprank_timer);
sd->pvp_timer = INVALID_TIMER;
}
return 0;
@@ -10735,7 +10735,7 @@ static int buildin_maprespawnguildid_sub_pc(struct map_session_data* sd, va_list
(sd->status.guild_id != g_id && flag&2) || //Warp out outsiders
(sd->status.guild_id == 0) // Warp out players not in guild [Valaris]
)
- iPc->setpos(sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,CLR_TELEPORT);
+ pc->setpos(sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,CLR_TELEPORT);
return 1;
}
@@ -10936,8 +10936,8 @@ BUILDIN(requestguildinfo)
}
/// Returns the number of cards that have been compounded onto the specified equipped item.
-/// getequipcardcnt(<equipment slot>);
-BUILDIN(getequipcardcnt)
+/// getequpcardcnt(<equipment slot>);
+BUILDIN(getequpcardcnt)
{
int i=-1,j,num;
TBL_PC *sd;
@@ -10946,7 +10946,7 @@ BUILDIN(getequipcardcnt)
num=script_getnum(st,2);
sd=script_rid2sd(st);
if (num > 0 && num <= ARRAYLENGTH(equip))
- i=iPc->checkequip(sd,equip[num-1]);
+ i=pc->checkequip(sd,equip[num-1]);
if (i < 0 || !sd->inventory_data[i]) {
script_pushint(st,0);
@@ -10978,7 +10978,7 @@ BUILDIN(successremovecards) {
int num = script_getnum(st,2);
if (num > 0 && num <= ARRAYLENGTH(equip))
- i=iPc->checkequip(sd,equip[num-1]);
+ i=pc->checkequip(sd,equip[num-1]);
if (i < 0 || !sd->inventory_data[i]) {
return true;
@@ -10996,7 +10996,7 @@ BUILDIN(successremovecards) {
item_tmp.nameid = sd->status.inventory[i].card[c];
item_tmp.identify = 1;
- if((flag=iPc->additem(sd,&item_tmp,1,LOG_TYPE_SCRIPT))){ // get back the cart in inventory
+ if((flag=pc->additem(sd,&item_tmp,1,LOG_TYPE_SCRIPT))){ // get back the cart in inventory
clif->additem(sd,0,0,flag);
iMap->addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
@@ -11017,8 +11017,8 @@ BUILDIN(successremovecards) {
for (j = sd->inventory_data[i]->slot; j < MAX_SLOTS; j++)
item_tmp.card[j]=sd->status.inventory[i].card[j];
- iPc->delitem(sd,i,1,0,3,LOG_TYPE_SCRIPT);
- if((flag=iPc->additem(sd,&item_tmp,1,LOG_TYPE_SCRIPT))){ //chk if can be spawn in inventory otherwise put on floor
+ pc->delitem(sd,i,1,0,3,LOG_TYPE_SCRIPT);
+ if((flag=pc->additem(sd,&item_tmp,1,LOG_TYPE_SCRIPT))){ //chk if can be spawn in inventory otherwise put on floor
clif->additem(sd,0,0,flag);
iMap->addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
@@ -11042,7 +11042,7 @@ BUILDIN(failedremovecards) {
int typefail = script_getnum(st,3);
if (num > 0 && num <= ARRAYLENGTH(equip))
- i=iPc->checkequip(sd,equip[num-1]);
+ i=pc->checkequip(sd,equip[num-1]);
if (i < 0 || !sd->inventory_data[i])
return true;
@@ -11063,7 +11063,7 @@ BUILDIN(failedremovecards) {
item_tmp.nameid = sd->status.inventory[i].card[c];
item_tmp.identify = 1;
- if((flag=iPc->additem(sd,&item_tmp,1,LOG_TYPE_SCRIPT))){
+ if((flag=pc->additem(sd,&item_tmp,1,LOG_TYPE_SCRIPT))){
clif->additem(sd,0,0,flag);
iMap->addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
@@ -11073,7 +11073,7 @@ BUILDIN(failedremovecards) {
if(cardflag == 1) {
if(typefail == 0 || typefail == 2){ // destroy the item
- iPc->delitem(sd,i,1,0,2,LOG_TYPE_SCRIPT);
+ pc->delitem(sd,i,1,0,2,LOG_TYPE_SCRIPT);
}
if(typefail == 1){ // destroy the card
int flag;
@@ -11090,9 +11090,9 @@ BUILDIN(failedremovecards) {
for (j = sd->inventory_data[i]->slot; j < MAX_SLOTS; j++)
item_tmp.card[j]=sd->status.inventory[i].card[j];
- iPc->delitem(sd,i,1,0,2,LOG_TYPE_SCRIPT);
+ pc->delitem(sd,i,1,0,2,LOG_TYPE_SCRIPT);
- if((flag=iPc->additem(sd,&item_tmp,1,LOG_TYPE_SCRIPT))){
+ if((flag=pc->additem(sd,&item_tmp,1,LOG_TYPE_SCRIPT))){
clif->additem(sd,0,0,flag);
iMap->addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
@@ -11138,7 +11138,7 @@ BUILDIN(mapwarp) // Added by RoVeRT
for( i=0; i < g->max_member; i++)
{
if(g->member[i].sd && g->member[i].sd->bl.m==m){
- iPc->setpos(g->member[i].sd,index,x,y,CLR_TELEPORT);
+ pc->setpos(g->member[i].sd,index,x,y,CLR_TELEPORT);
}
}
}
@@ -11148,7 +11148,7 @@ BUILDIN(mapwarp) // Added by RoVeRT
if(p){
for(i=0;i<MAX_PARTY; i++){
if(p->data[i].sd && p->data[i].sd->bl.m == m){
- iPc->setpos(p->data[i].sd,index,x,y,CLR_TELEPORT);
+ pc->setpos(p->data[i].sd,index,x,y,CLR_TELEPORT);
}
}
}
@@ -11211,7 +11211,7 @@ BUILDIN(marriage)
TBL_PC *sd=script_rid2sd(st);
TBL_PC *p_sd=iMap->nick2sd(partner);
- if(sd==NULL || p_sd==NULL || iPc->marriage(sd,p_sd) < 0){
+ if(sd==NULL || p_sd==NULL || pc->marriage(sd,p_sd) < 0){
script_pushint(st,0);
return true;
}
@@ -11233,7 +11233,7 @@ BUILDIN(wedding_effect)
BUILDIN(divorce)
{
TBL_PC *sd=script_rid2sd(st);
- if(sd==NULL || iPc->divorce(sd) < 0){
+ if(sd==NULL || pc->divorce(sd) < 0){
script_pushint(st,0);
return true;
}
@@ -11245,7 +11245,7 @@ BUILDIN(ispartneron)
{
TBL_PC *sd=script_rid2sd(st);
- if(sd==NULL || !iPc->ismarried(sd) ||
+ if(sd==NULL || !pc->ismarried(sd) ||
iMap->charid2sd(sd->status.partner_id) == NULL) {
script_pushint(st,0);
return true;
@@ -11311,7 +11311,7 @@ BUILDIN(warppartner)
TBL_PC *sd=script_rid2sd(st);
TBL_PC *p_sd=NULL;
- if(sd==NULL || !iPc->ismarried(sd) ||
+ if(sd==NULL || !pc->ismarried(sd) ||
(p_sd=iMap->charid2sd(sd->status.partner_id)) == NULL) {
script_pushint(st,0);
return true;
@@ -11323,7 +11323,7 @@ BUILDIN(warppartner)
mapindex = mapindex_name2id(str);
if (mapindex) {
- iPc->setpos(p_sd,mapindex,x,y,CLR_OUTSIGHT);
+ pc->setpos(p_sd,mapindex,x,y,CLR_OUTSIGHT);
script_pushint(st,1);
} else
script_pushint(st,0);
@@ -11618,7 +11618,7 @@ BUILDIN(setiteminfo)
/*==========================================
* Returns value from equipped item slot n [Lupus]
- getequipcardid(num,slot)
+ getequpcardid(num,slot)
where
num = eqip position slot
slot = 0,1,2,3 (Card Slot N)
@@ -11628,7 +11628,7 @@ BUILDIN(setiteminfo)
Useful for such quests as "Sign this refined item with players name" etc
Hat[0] +4 -> Player's Hat[0] +4
*------------------------------------------*/
-BUILDIN(getequipcardid)
+BUILDIN(getequpcardid)
{
int i=-1,num,slot;
TBL_PC *sd;
@@ -11637,7 +11637,7 @@ BUILDIN(getequipcardid)
slot=script_getnum(st,3);
sd=script_rid2sd(st);
if (num > 0 && num <= ARRAYLENGTH(equip))
- i=iPc->checkequip(sd,equip[num-1]);
+ i=pc->checkequip(sd,equip[num-1]);
if(i >= 0 && slot>=0 && slot<4)
script_pushint(st,sd->status.inventory[i].card[slot]);
else
@@ -11735,22 +11735,22 @@ BUILDIN(getinventorylist)
if(!sd) return true;
for(i=0;i<MAX_INVENTORY;i++){
if(sd->status.inventory[i].nameid > 0 && sd->status.inventory[i].amount > 0){
- iPc->setreg(sd,reference_uid(add_str("@inventorylist_id"), j),sd->status.inventory[i].nameid);
- iPc->setreg(sd,reference_uid(add_str("@inventorylist_amount"), j),sd->status.inventory[i].amount);
- iPc->setreg(sd,reference_uid(add_str("@inventorylist_equip"), j),sd->status.inventory[i].equip);
- iPc->setreg(sd,reference_uid(add_str("@inventorylist_refine"), j),sd->status.inventory[i].refine);
- iPc->setreg(sd,reference_uid(add_str("@inventorylist_identify"), j),sd->status.inventory[i].identify);
- iPc->setreg(sd,reference_uid(add_str("@inventorylist_attribute"), j),sd->status.inventory[i].attribute);
+ pc->setreg(sd,reference_uid(add_str("@inventorylist_id"), j),sd->status.inventory[i].nameid);
+ pc->setreg(sd,reference_uid(add_str("@inventorylist_amount"), j),sd->status.inventory[i].amount);
+ pc->setreg(sd,reference_uid(add_str("@inventorylist_equip"), j),sd->status.inventory[i].equip);
+ pc->setreg(sd,reference_uid(add_str("@inventorylist_refine"), j),sd->status.inventory[i].refine);
+ pc->setreg(sd,reference_uid(add_str("@inventorylist_identify"), j),sd->status.inventory[i].identify);
+ pc->setreg(sd,reference_uid(add_str("@inventorylist_attribute"), j),sd->status.inventory[i].attribute);
for (k = 0; k < MAX_SLOTS; k++)
{
sprintf(card_var, "@inventorylist_card%d",k+1);
- iPc->setreg(sd,reference_uid(add_str(card_var), j),sd->status.inventory[i].card[k]);
+ pc->setreg(sd,reference_uid(add_str(card_var), j),sd->status.inventory[i].card[k]);
}
- iPc->setreg(sd,reference_uid(add_str("@inventorylist_expire"), j),sd->status.inventory[i].expire_time);
+ pc->setreg(sd,reference_uid(add_str("@inventorylist_expire"), j),sd->status.inventory[i].expire_time);
j++;
}
}
- iPc->setreg(sd,add_str("@inventorylist_count"),j);
+ pc->setreg(sd,add_str("@inventorylist_count"),j);
return true;
}
@@ -11761,13 +11761,13 @@ BUILDIN(getskilllist)
if(!sd) return true;
for(i=0;i<MAX_SKILL;i++){
if(sd->status.skill[i].id > 0 && sd->status.skill[i].lv > 0){
- iPc->setreg(sd,reference_uid(add_str("@skilllist_id"), j),sd->status.skill[i].id);
- iPc->setreg(sd,reference_uid(add_str("@skilllist_lv"), j),sd->status.skill[i].lv);
- iPc->setreg(sd,reference_uid(add_str("@skilllist_flag"), j),sd->status.skill[i].flag);
+ pc->setreg(sd,reference_uid(add_str("@skilllist_id"), j),sd->status.skill[i].id);
+ pc->setreg(sd,reference_uid(add_str("@skilllist_lv"), j),sd->status.skill[i].lv);
+ pc->setreg(sd,reference_uid(add_str("@skilllist_flag"), j),sd->status.skill[i].flag);
j++;
}
}
- iPc->setreg(sd,add_str("@skilllist_count"),j);
+ pc->setreg(sd,add_str("@skilllist_count"),j);
return true;
}
@@ -11778,7 +11778,7 @@ BUILDIN(clearitem)
if(sd==NULL) return true;
for (i=0; i<MAX_INVENTORY; i++) {
if (sd->status.inventory[i].amount) {
- iPc->delitem(sd, i, sd->status.inventory[i].amount, 0, 0, LOG_TYPE_SCRIPT);
+ pc->delitem(sd, i, sd->status.inventory[i].amount, 0, 0, LOG_TYPE_SCRIPT);
}
}
return true;
@@ -11796,7 +11796,7 @@ BUILDIN(disguise)
id = script_getnum(st,2);
if (mobdb_checkid(id) || npcdb_checkid(id)) {
- iPc->disguise(sd, id);
+ pc->disguise(sd, id);
script_pushint(st,id);
} else
script_pushint(st,0);
@@ -11813,7 +11813,7 @@ BUILDIN(undisguise)
if (sd == NULL) return true;
if (sd->disguise != -1) {
- iPc->disguise(sd, -1);
+ pc->disguise(sd, -1);
script_pushint(st,0);
} else {
script_pushint(st,1);
@@ -12257,7 +12257,7 @@ BUILDIN(nude)
if( sd->equip_index[ i ] >= 0 ) {
if( !calcflag )
calcflag = 1;
- iPc->unequipitem( sd , sd->equip_index[ i ] , 2);
+ pc->unequipitem( sd , sd->equip_index[ i ] , 2);
}
}
@@ -13116,12 +13116,12 @@ BUILDIN(getrefine)
*-------------------------------------------------------*/
BUILDIN(night)
{
- if (iMap->night_flag != 1) iPc->map_night_timer(iPc->night_timer_tid, 0, 0, 1);
+ if (iMap->night_flag != 1) pc->map_night_timer(pc->night_timer_tid, 0, 0, 1);
return true;
}
BUILDIN(day)
{
- if (iMap->night_flag != 0) iPc->map_day_timer(iPc->day_timer_tid, 0, 0, 1);
+ if (iMap->night_flag != 0) pc->map_day_timer(pc->day_timer_tid, 0, 0, 1);
return true;
}
@@ -13138,9 +13138,9 @@ BUILDIN(unequip)
sd = script_rid2sd(st);
if( sd != NULL && num >= 1 && num <= ARRAYLENGTH(equip) )
{
- i = iPc->checkequip(sd,equip[num-1]);
+ i = pc->checkequip(sd,equip[num-1]);
if (i >= 0)
- iPc->unequipitem(sd,i,1|2);
+ pc->unequipitem(sd,i,1|2);
}
return true;
}
@@ -13161,7 +13161,7 @@ BUILDIN(equip)
}
ARR_FIND( 0, MAX_INVENTORY, i, sd->status.inventory[i].nameid == nameid );
if( i < MAX_INVENTORY )
- iPc->equipitem(sd,i,item_data->equip);
+ pc->equipitem(sd,i,item_data->equip);
return true;
}
@@ -14835,7 +14835,7 @@ BUILDIN(pcfollow)
sd = script_rid2sd(st);
if(sd)
- iPc->follow(sd, targetid);
+ pc->follow(sd, targetid);
return true;
}
@@ -14854,7 +14854,7 @@ BUILDIN(pcstopfollow)
sd = script_rid2sd(st);
if(sd)
- iPc->stop_following(sd);
+ pc->stop_following(sd);
return true;
}
@@ -15728,7 +15728,7 @@ BUILDIN(waitingroom2bg_single)
if( bg_team_join(bg_id, sd) )
{
- iPc->setpos(sd, mapindex, x, y, CLR_TELEPORT);
+ pc->setpos(sd, mapindex, x, y, CLR_TELEPORT);
script_pushint(st,1);
}
else
@@ -16167,7 +16167,7 @@ static int buildin_instance_warpall_sub(struct block_list *bl,va_list ap) {
int x = va_arg(ap,int);
int y = va_arg(ap,int);
- iPc->setpos(sd,mapindex,x,y,CLR_TELEPORT);
+ pc->setpos(sd,mapindex,x,y,CLR_TELEPORT);
return 0;
}
@@ -16524,10 +16524,10 @@ BUILDIN(setdragon) {
if( (sd = script_rid2sd(st)) == NULL )
return true;
- if( !iPc->checkskill(sd,RK_DRAGONTRAINING) || (sd->class_&MAPID_THIRDMASK) != MAPID_RUNE_KNIGHT )
+ if( !pc->checkskill(sd,RK_DRAGONTRAINING) || (sd->class_&MAPID_THIRDMASK) != MAPID_RUNE_KNIGHT )
script_pushint(st,0);//Doesn't have the skill or it's not a Rune Knight
else if ( pc_isridingdragon(sd) ) {//Is mounted; release
- iPc->setoption(sd, sd->sc.option&~OPTION_DRAGON);
+ pc->setoption(sd, sd->sc.option&~OPTION_DRAGON);
script_pushint(st,1);
} else {//Not mounted; Mount now.
unsigned int option = OPTION_DRAGON1;
@@ -16542,7 +16542,7 @@ BUILDIN(setdragon) {
option = OPTION_DRAGON1;
}
}
- iPc->setoption(sd, sd->sc.option|option);
+ pc->setoption(sd, sd->sc.option|option);
script_pushint(st,1);
}
return true;
@@ -16921,9 +16921,9 @@ BUILDIN(getrandgroupitem) {
for (i = 0; i < qty; i += get_count) {
// if not pet egg
if (!pet_create_egg(sd, nameid)) {
- if ((flag = iPc->additem(sd, &item_tmp, get_count, LOG_TYPE_SCRIPT))) {
+ if ((flag = pc->additem(sd, &item_tmp, get_count, LOG_TYPE_SCRIPT))) {
clif->additem(sd, 0, 0, flag);
- if( iPc->candrop(sd,&item_tmp) )
+ if( pc->candrop(sd,&item_tmp) )
iMap->addflooritem(&item_tmp,get_count,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
}
@@ -17563,7 +17563,7 @@ void script_parse_builtin(void) {
BUILDIN_DEF(getcastledata,"si"),
BUILDIN_DEF(setcastledata,"sii"),
BUILDIN_DEF(requestguildinfo,"i?"),
- BUILDIN_DEF(getequipcardcnt,"i"),
+ BUILDIN_DEF(getequpcardcnt,"i"),
BUILDIN_DEF(successremovecards,"i"),
BUILDIN_DEF(failedremovecards,"ii"),
BUILDIN_DEF(marriage,"s"),
@@ -17668,7 +17668,7 @@ void script_parse_builtin(void) {
BUILDIN_DEF(compare,"ss"), // Lordalfa - To bring strstr to scripting Engine.
BUILDIN_DEF(getiteminfo,"ii"), //[Lupus] returns Items Buy / sell Price, etc info
BUILDIN_DEF(setiteminfo,"iii"), //[Lupus] set Items Buy / sell Price, etc info
- BUILDIN_DEF(getequipcardid,"ii"), //[Lupus] returns CARD ID or other info from CARD slot N of equipped item
+ BUILDIN_DEF(getequpcardid,"ii"), //[Lupus] returns CARD ID or other info from CARD slot N of equipped item
// [zBuffer] List of mathematics commands --->
BUILDIN_DEF(sqrt,"i"),
BUILDIN_DEF(pow,"ii"),
diff --git a/src/map/skill.c b/src/map/skill.c
index 676a6e463..f9d189f37 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -248,7 +248,7 @@ int skill_get_fixed_cast( uint16 skill_id ,uint16 skill_lv ){ skill_get2 (skill_
int skill_tree_get_max(uint16 skill_id, int b_class)
{
int i;
- b_class = iPc->class2idx(b_class);
+ b_class = pc->class2idx(b_class);
ARR_FIND( 0, MAX_SKILL_TREE, i, skill_tree[b_class][i].id == 0 || skill_tree[b_class][i].id == skill_id );
if( i < MAX_SKILL_TREE && skill_tree[b_class][i].id == skill_id )
@@ -322,7 +322,7 @@ int skill_get_range2 (struct block_list *bl, uint16 skill_id, uint16 skill_lv) {
case RA_AIMEDBOLT:
case RA_WUGBITE:
if( bl->type == BL_PC )
- range += iPc->checkskill((TBL_PC*)bl, AC_VULTURE);
+ range += pc->checkskill((TBL_PC*)bl, AC_VULTURE);
else
range += 10; //Assume level 10?
break;
@@ -333,13 +333,13 @@ int skill_get_range2 (struct block_list *bl, uint16 skill_id, uint16 skill_lv) {
case GS_SPREADATTACK:
case GS_GROUNDDRIFT:
if (bl->type == BL_PC)
- range += iPc->checkskill((TBL_PC*)bl, GS_SNAKEEYE);
+ range += pc->checkskill((TBL_PC*)bl, GS_SNAKEEYE);
else
range += 10; //Assume level 10?
break;
case NJ_KIRIKAGE:
if (bl->type == BL_PC)
- range = skill->get_range(NJ_SHADOWJUMP,iPc->checkskill((TBL_PC*)bl,NJ_SHADOWJUMP));
+ range = skill->get_range(NJ_SHADOWJUMP,pc->checkskill((TBL_PC*)bl,NJ_SHADOWJUMP));
break;
/**
* Warlock
@@ -357,7 +357,7 @@ int skill_get_range2 (struct block_list *bl, uint16 skill_id, uint16 skill_lv) {
case WL_TETRAVORTEX:
case WL_RELEASE:
if( bl->type == BL_PC )
- range += iPc->checkskill((TBL_PC*)bl, WL_RADIUS);
+ range += pc->checkskill((TBL_PC*)bl, WL_RADIUS);
break;
/**
* Ranger Bonus
@@ -370,7 +370,7 @@ int skill_get_range2 (struct block_list *bl, uint16 skill_id, uint16 skill_lv) {
case RA_FIRINGTRAP:
case RA_ICEBOUNDTRAP:
if( bl->type == BL_PC )
- range += (1 + iPc->checkskill((TBL_PC*)bl, RA_RESEARCHTRAP))/2;
+ range += (1 + pc->checkskill((TBL_PC*)bl, RA_RESEARCHTRAP))/2;
}
if( !range && bl->type != BL_PC )
@@ -392,7 +392,7 @@ int skill_calc_heal(struct block_list *src, struct block_list *target, uint16 sk
hp = 30+5*skill_lv+5*(status_get_vit(src)/10); // HP recovery
#endif
if( sd )
- hp += 5*iPc->checkskill(sd,BA_MUSICALLESSON);
+ hp += 5*pc->checkskill(sd,BA_MUSICALLESSON);
break;
case PR_SANCTUARY:
hp = (skill_lv>6)?777:skill_lv*100;
@@ -410,9 +410,9 @@ int skill_calc_heal(struct block_list *src, struct block_list *target, uint16 sk
**/
hp = (status_get_lv(src) + status_get_int(src)) / 5 * 30 * skill_lv / 10;
#else
- hp = ( status_get_lv(src) + status_get_int(src) ) / 8 * (4 + ( skill_id == AB_HIGHNESSHEAL ? ( sd ? iPc->checkskill(sd,AL_HEAL) : 10 ) : skill_lv ) * 8);
+ hp = ( status_get_lv(src) + status_get_int(src) ) / 8 * (4 + ( skill_id == AB_HIGHNESSHEAL ? ( sd ? pc->checkskill(sd,AL_HEAL) : 10 ) : skill_lv ) * 8);
#endif
- if( sd && ((skill = iPc->checkskill(sd, HP_MEDITATIO)) > 0) )
+ if( sd && ((skill = pc->checkskill(sd, HP_MEDITATIO)) > 0) )
hp += hp * skill * 2 / 100;
else if( src->type == BL_HOM && (skill = homun->checkskill(((TBL_HOM*)src), HLIF_BRAIN)) > 0 )
hp += hp * skill * 2 / 100;
@@ -422,10 +422,10 @@ int skill_calc_heal(struct block_list *src, struct block_list *target, uint16 sk
if( ( (target && target->type == BL_MER) || !heal ) && skill_id != NPC_EVILLAND )
hp >>= 1;
- if( sd && (skill = iPc->skillheal_bonus(sd, skill_id)) )
+ if( sd && (skill = pc->skillheal_bonus(sd, skill_id)) )
hp += hp*skill/100;
- if( tsd && (skill = iPc->skillheal2_bonus(tsd, skill_id)) )
+ if( tsd && (skill = pc->skillheal2_bonus(tsd, skill_id)) )
hp += hp*skill/100;
sc = status_get_sc(target);
@@ -814,19 +814,19 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, uint
break; // If a normal attack is a skill, it's splash damage. [Inkfish]
if(sd) {
// Automatic trigger of Blitz Beat
- if (pc_isfalcon(sd) && sd->status.weapon == W_BOW && (temp=iPc->checkskill(sd,HT_BLITZBEAT))>0 &&
+ if (pc_isfalcon(sd) && sd->status.weapon == W_BOW && (temp=pc->checkskill(sd,HT_BLITZBEAT))>0 &&
rnd()%1000 <= sstatus->luk*10/3+1 ) {
rate=(sd->status.job_level+9)/10;
skill->castend_damage_id(src,bl,HT_BLITZBEAT,(temp<rate)?temp:rate,tick,SD_LEVEL);
}
// Automatic trigger of Warg Strike [Jobbie]
- if( pc_iswug(sd) && (sd->status.weapon == W_BOW || sd->status.weapon == W_FIST) && (temp=iPc->checkskill(sd,RA_WUGSTRIKE)) > 0 && rnd()%1000 <= sstatus->luk*10/3+1 )
+ if( pc_iswug(sd) && (sd->status.weapon == W_BOW || sd->status.weapon == W_FIST) && (temp=pc->checkskill(sd,RA_WUGSTRIKE)) > 0 && rnd()%1000 <= sstatus->luk*10/3+1 )
skill->castend_damage_id(src,bl,RA_WUGSTRIKE,temp,tick,0);
// Gank
if(dstmd && sd->status.weapon != W_BOW &&
- (temp=iPc->checkskill(sd,RG_SNATCHER)) > 0 &&
- (temp*15 + 55) + iPc->checkskill(sd,TF_STEAL)*10 > rnd()%1000) {
- if(iPc->steal_item(sd,bl,iPc->checkskill(sd,TF_STEAL)))
+ (temp=pc->checkskill(sd,RG_SNATCHER)) > 0 &&
+ (temp*15 + 55) + pc->checkskill(sd,TF_STEAL)*10 > rnd()%1000) {
+ if(pc->steal_item(sd,bl,pc->checkskill(sd,TF_STEAL)))
clif->skill_nodamage(src,bl,TF_STEAL,temp,1);
else
clif->skill_fail(sd,RG_SNATCHER,USESKILL_FAIL_LEVEL,0);
@@ -874,7 +874,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, uint
break;
case SM_BASH:
- if( sd && skill_lv > 5 && iPc->checkskill(sd,SM_FATALBLOW)>0 ){
+ if( sd && skill_lv > 5 && pc->checkskill(sd,SM_FATALBLOW)>0 ){
//TODO: How much % per base level it actually is?
sc_start(bl,SC_STUN,(5*(skill_lv-5)+(int)sd->status.base_level/10),
skill_lv,skill->get_time2(SM_FATALBLOW,skill_lv));
@@ -887,7 +887,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, uint
case AS_VENOMKNIFE:
if (sd) //Poison chance must be that of Envenom. [Skotlex]
- skill_lv = iPc->checkskill(sd, TF_POISON);
+ skill_lv = pc->checkskill(sd, TF_POISON);
case TF_POISON:
case AS_SPLASHER:
if(!sc_start2(bl,SC_POISON,(4*skill_lv+10),skill_lv,src->id,skill->get_time2(skill_id,skill_lv))
@@ -1034,7 +1034,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, uint
case DC_UGLYDANCE:
rate = 5+5*skill_lv;
- if(sd && (temp=iPc->checkskill(sd,DC_DANCINGLESSON)))
+ if(sd && (temp=pc->checkskill(sd,DC_DANCINGLESSON)))
rate += 5+temp;
status_zap(bl, 0, rate);
break;
@@ -1194,7 +1194,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, uint
sc_start(bl,SC_CRITICALWOUND,100,skill_lv,skill->get_time2(skill_id,skill_lv));
break;
case RK_HUNDREDSPEAR:
- if( !sd || iPc->checkskill(sd,KN_SPEARBOOMERANG) == 0 )
+ if( !sd || pc->checkskill(sd,KN_SPEARBOOMERANG) == 0 )
break; // Spear Boomerang auto cast chance only works if you have mastered Spear Boomerang.
rate = 10 + 3 * skill_lv;
if( rnd()%100 < rate )
@@ -1231,11 +1231,11 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, uint
sc_start(bl,SC_FREEZE,100,skill_lv,skill->get_time(skill_id,skill_lv));
break;
case RA_WUGBITE:
- sc_start(bl, SC_BITE, (sd ? iPc->checkskill(sd,RA_TOOTHOFWUG)*2 : 0), skill_lv, (skill->get_time(skill_id,skill_lv) + (sd ? iPc->checkskill(sd,RA_TOOTHOFWUG)*500 : 0)) );
+ sc_start(bl, SC_BITE, (sd ? pc->checkskill(sd,RA_TOOTHOFWUG)*2 : 0), skill_lv, (skill->get_time(skill_id,skill_lv) + (sd ? pc->checkskill(sd,RA_TOOTHOFWUG)*500 : 0)) );
break;
case RA_SENSITIVEKEEN:
if( rnd()%100 < 8 * skill_lv )
- skill->castend_damage_id(src, bl, RA_WUGBITE, sd ? iPc->checkskill(sd, RA_WUGBITE):skill_lv, tick, SD_ANIMATION);
+ skill->castend_damage_id(src, bl, RA_WUGBITE, sd ? pc->checkskill(sd, RA_WUGBITE):skill_lv, tick, SD_ANIMATION);
break;
case RA_FIRINGTRAP:
case RA_ICEBOUNDTRAP:
@@ -1261,7 +1261,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, uint
case NC_POWERSWING:
sc_start(bl, SC_STUN, 5*skill_lv, skill_lv, skill->get_time(skill_id, skill_lv));
if( rnd()%100 < 5*skill_lv )
- skill->castend_damage_id(src, bl, NC_AXEBOOMERANG, iPc->checkskill(sd, NC_AXEBOOMERANG), tick, 1);
+ skill->castend_damage_id(src, bl, NC_AXEBOOMERANG, pc->checkskill(sd, NC_AXEBOOMERANG), tick, 1);
break;
case GC_WEAPONCRUSH:
skill->castend_nodamage_id(src,bl,skill_id,skill_lv,tick,BCT_ENEMY);
@@ -1270,14 +1270,14 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, uint
sc_start(bl, SC_STUN, 30 + 8 * skill_lv, skill_lv, skill->get_time(skill_id,skill_lv));
break;
case LG_PINPOINTATTACK:
- rate = 30 + (((5 * (sd?iPc->checkskill(sd,LG_PINPOINTATTACK):skill_lv)) + (sstatus->agi + status_get_lv(src))) / 10);
+ rate = 30 + (((5 * (sd?pc->checkskill(sd,LG_PINPOINTATTACK):skill_lv)) + (sstatus->agi + status_get_lv(src))) / 10);
switch( skill_lv ) {
case 1:
sc_start2(bl,SC_BLEEDING,rate,skill_lv,src->id,skill->get_time(skill_id,skill_lv));
break;
case 2:
if( dstsd && dstsd->spiritball && rnd()%100 < rate )
- iPc->delspiritball(dstsd, dstsd->spiritball, 0);
+ pc->delspiritball(dstsd, dstsd->spiritball, 0);
break;
default:
skill->break_equip(bl,(skill_lv == 3) ? EQP_SHIELD : (skill_lv == 4) ? EQP_ARMOR : EQP_WEAPON,rate * 100,BCT_ENEMY);
@@ -1609,7 +1609,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, uint
sd->autobonus[i].atk_type&attack_type&BF_RANGEMASK &&
sd->autobonus[i].atk_type&attack_type&BF_SKILLMASK))
continue; // one or more trigger conditions were not fulfilled
- iPc->exeautobonus(sd,&sd->autobonus[i]);
+ pc->exeautobonus(sd,&sd->autobonus[i]);
}
}
@@ -1722,7 +1722,7 @@ int skill_onskillusage(struct map_session_data *sd, struct block_list *bl, uint1
continue;
if( sd->autobonus3[i].atk_type != skill_id )
continue;
- iPc->exeautobonus(sd,&sd->autobonus3[i]);
+ pc->exeautobonus(sd,&sd->autobonus3[i]);
}
}
@@ -1807,9 +1807,9 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
if(sd && skill_id && attack_type&BF_MAGIC && status_isdead(bl) &&
!(skill->get_inf(skill_id)&(INF_GROUND_SKILL|INF_SELF_SKILL)) &&
- (rate=iPc->checkskill(sd,HW_SOULDRAIN))>0
+ (rate=pc->checkskill(sd,HW_SOULDRAIN))>0
){ //Soul Drain should only work on targetted spells [Skotlex]
- if (pc_issit(sd)) iPc->setstand(sd); //Character stuck in attacking animation while 'sitting' fix. [Skotlex]
+ if (pc_issit(sd)) pc->setstand(sd); //Character stuck in attacking animation while 'sitting' fix. [Skotlex]
clif->skill_nodamage(src,bl,HW_SOULDRAIN,rate,1);
status_heal(src, 0, status_get_lv(bl)*(95+15*rate)/100, 2);
}
@@ -1943,7 +1943,7 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
dstsd->autobonus2[i].atk_type&attack_type&BF_RANGEMASK &&
dstsd->autobonus2[i].atk_type&attack_type&BF_SKILLMASK))
continue; // one or more trigger conditions were not fulfilled
- iPc->exeautobonus(dstsd,&dstsd->autobonus2[i]);
+ pc->exeautobonus(dstsd,&dstsd->autobonus2[i]);
}
}
@@ -2036,7 +2036,7 @@ int skill_break_equip (struct block_list *bl, unsigned short where, int rate, in
}
if (flag) {
sd->status.inventory[j].attribute = 1;
- iPc->unequipitem(sd, j, 3);
+ pc->unequipitem(sd, j, 3);
}
}
clif->equiplist(sd);
@@ -2255,9 +2255,9 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
//Spirit of Wizard blocks Kaite's reflection
if( type == 2 && sc && sc->data[SC_SPIRIT] && sc->data[SC_SPIRIT]->val2 == SL_WIZARD )
{ //Consume one Fragment per hit of the casted skill? [Skotlex]
- type = tsd?iPc->search_inventory (tsd, 7321):0;
+ type = tsd?pc->search_inventory (tsd, 7321):0;
if (type >= 0) {
- if ( tsd ) iPc->delitem(tsd, type, 1, 0, 1, LOG_TYPE_CONSUME);
+ if ( tsd ) pc->delitem(tsd, type, 1, 0, 1, LOG_TYPE_CONSUME);
dmg.damage = dmg.damage2 = 0;
dmg.dmg_lv = ATK_MISS;
sc->data[SC_SPIRIT]->val3 = skill_id;
@@ -2354,7 +2354,7 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
case TK_STORMKICK:
case TK_DOWNKICK:
case TK_COUNTER:
- if (iPc->famerank(sd->status.char_id,MAPID_TAEKWON)) {//Extend combo time.
+ if (pc->famerank(sd->status.char_id,MAPID_TAEKWON)) {//Extend combo time.
sce->val1 = skill_id; //Update combo-skill
sce->val3 = skill_id;
if( sce->timer != INVALID_TIMER )
@@ -2371,27 +2371,27 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
}
switch(skill_id) {
case MO_TRIPLEATTACK:
- if (iPc->checkskill(sd, MO_CHAINCOMBO) > 0 || iPc->checkskill(sd, SR_DRAGONCOMBO) > 0)
+ if (pc->checkskill(sd, MO_CHAINCOMBO) > 0 || pc->checkskill(sd, SR_DRAGONCOMBO) > 0)
flag=1;
break;
case MO_CHAINCOMBO:
- if(iPc->checkskill(sd, MO_COMBOFINISH) > 0 && sd->spiritball > 0)
+ if(pc->checkskill(sd, MO_COMBOFINISH) > 0 && sd->spiritball > 0)
flag=1;
break;
case MO_COMBOFINISH:
if (sd->status.party_id>0) //bonus from SG_FRIEND [Komurka]
iParty->skill_check(sd, sd->status.party_id, MO_COMBOFINISH, skill_lv);
- if (iPc->checkskill(sd, CH_TIGERFIST) > 0 && sd->spiritball > 0)
+ if (pc->checkskill(sd, CH_TIGERFIST) > 0 && sd->spiritball > 0)
flag=1;
case CH_TIGERFIST:
- if (!flag && iPc->checkskill(sd, CH_CHAINCRUSH) > 0 && sd->spiritball > 1)
+ if (!flag && pc->checkskill(sd, CH_CHAINCRUSH) > 0 && sd->spiritball > 1)
flag=1;
case CH_CHAINCRUSH:
- if (!flag && iPc->checkskill(sd, MO_EXTREMITYFIST) > 0 && sd->spiritball > 0 && sd->sc.data[SC_EXPLOSIONSPIRITS])
+ if (!flag && pc->checkskill(sd, MO_EXTREMITYFIST) > 0 && sd->spiritball > 0 && sd->sc.data[SC_EXPLOSIONSPIRITS])
flag=1;
break;
case AC_DOUBLE:
- if( (tstatus->race == RC_BRUTE || tstatus->race == RC_INSECT) && iPc->checkskill(sd, HT_POWER))
+ if( (tstatus->race == RC_BRUTE || tstatus->race == RC_INSECT) && pc->checkskill(sd, HT_POWER))
{
//TODO: This code was taken from Triple Blows, is this even how it should be? [Skotlex]
sc_start2(src,SC_COMBO,100,HT_POWER,bl->id,2000);
@@ -2401,7 +2401,7 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
case TK_COUNTER:
{ //bonus from SG_FRIEND [Komurka]
int level;
- if(sd->status.party_id>0 && (level = iPc->checkskill(sd,SG_FRIEND)))
+ if(sd->status.party_id>0 && (level = pc->checkskill(sd,SG_FRIEND)))
iParty->skill_check(sd, sd->status.party_id, TK_COUNTER,level);
}
break;
@@ -2415,11 +2415,11 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
sd->ud.attackabletime = sd->canuseitem_tick = sd->ud.canact_tick;
break;
case SR_DRAGONCOMBO:
- if( iPc->checkskill(sd, SR_FALLENEMPIRE) > 0 )
+ if( pc->checkskill(sd, SR_FALLENEMPIRE) > 0 )
flag = 1;
break;
case SR_FALLENEMPIRE:
- if( iPc->checkskill(sd, SR_TIGERCANNON) > 0 || iPc->checkskill(sd, SR_GATEOFHELL) > 0 )
+ if( pc->checkskill(sd, SR_TIGERCANNON) > 0 || pc->checkskill(sd, SR_GATEOFHELL) > 0 )
flag = 1;
break;
} //Switch End
@@ -2537,7 +2537,7 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
iMap->freeblock_lock();
if(damage > 0 && dmg.flag&BF_SKILL && tsd
- && iPc->checkskill(tsd,RG_PLAGIARISM)
+ && pc->checkskill(tsd,RG_PLAGIARISM)
&& (!sc || !sc->data[SC_PRESERVE])
&& damage < tsd->battle_status.hp)
{ //Updated to not be able to copy skills if the blow will kill you. [Skotlex]
@@ -2610,7 +2610,7 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
}
}
- if ((type = iPc->checkskill(tsd,RG_PLAGIARISM)) < lv)
+ if ((type = pc->checkskill(tsd,RG_PLAGIARISM)) < lv)
lv = type;
tsd->cloneskill_id = copy_skill;
@@ -2803,7 +2803,7 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
}
break;
case WM_METALICSOUND:
- status_zap(bl, 0, damage*100/(100*(110-iPc->checkskill(sd,WM_LESSON)*10)));
+ status_zap(bl, 0, damage*100/(100*(110-pc->checkskill(sd,WM_LESSON)*10)));
break;
case SR_TIGERCANNON:
status_zap(bl, 0, damage/10); // 10% of damage dealt
@@ -3098,7 +3098,7 @@ int skill_check_condition_mercenary(struct block_list *bl, int skill_id, int lv,
{
index[i] = -1;
if( itemid[i] < 1 ) continue; // No item
- index[i] = iPc->search_inventory(sd, itemid[i]);
+ index[i] = pc->search_inventory(sd, itemid[i]);
if( index[i] < 0 || sd->status.inventory[index[i]].amount < amount[i] )
{
clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0);
@@ -3109,7 +3109,7 @@ int skill_check_condition_mercenary(struct block_list *bl, int skill_id, int lv,
// Consume items
for( i = 0; i < ARRAYLENGTH(itemid); i++ )
{
- if( index[i] >= 0 ) iPc->delitem(sd, index[i], amount[i], 0, 1, LOG_TYPE_CONSUME);
+ if( index[i] >= 0 ) pc->delitem(sd, index[i], amount[i], 0, 1, LOG_TYPE_CONSUME);
}
if( type&2 )
@@ -3567,7 +3567,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
case NC_VULCANARM:
case NC_COLDSLOWER:
case NC_ARMSCANNON:
- if (sd) iPc->overheat(sd,1);
+ if (sd) pc->overheat(sd,1);
case RK_WINDCUTTER:
skill->attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag|SD_ANIMATION);
break;
@@ -3628,7 +3628,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
break;
case NC_FLAMELAUNCHER:
- if (sd) iPc->overheat(sd,1);
+ if (sd) pc->overheat(sd,1);
case SN_SHARPSHOOTING:
case MA_SHARPSHOOTING:
case NJ_KAMAITACHI:
@@ -4115,7 +4115,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
case RK_STORMBLAST:
case RK_CRUSHSTRIKE:
if( sd ) {
- if( iPc->checkskill(sd,RK_RUNEMASTERY) >= ( skill_id == RK_CRUSHSTRIKE ? 7 : 3 ) )
+ if( pc->checkskill(sd,RK_RUNEMASTERY) >= ( skill_id == RK_CRUSHSTRIKE ? 7 : 3 ) )
skill->attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag);
else
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
@@ -4396,7 +4396,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
{
iMap->foreachinrange(skill->area_sub, bl, skill->get_splash(skill_id, skill_lv), splash_target(src), src, skill_id, skill_lv, tick, flag|BCT_ENEMY|SD_SPLASH|1, skill->castend_damage_id);
clif->skill_damage(src,src,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
- if( sd ) iPc->overheat(sd,1);
+ if( sd ) pc->overheat(sd,1);
}
break;
@@ -4806,7 +4806,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
heal_get_jobexp = heal_get_jobexp * battle_config.heal_exp / 100;
if (heal_get_jobexp <= 0)
heal_get_jobexp = 1;
- iPc->gainexp (sd, bl, 0, heal_get_jobexp, false);
+ pc->gainexp (sd, bl, 0, heal_get_jobexp, false);
}
}
break;
@@ -4828,8 +4828,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
}
skill_area_temp[0] = 5 - skill_area_temp[0]; // The actual penalty...
if (skill_area_temp[0] > 0 && !map[src->m].flag.noexppenalty) { //Apply penalty
- sd->status.base_exp -= min(sd->status.base_exp, iPc->nextbaseexp(sd) * skill_area_temp[0] * 2/1000); //0.2% penalty per each.
- sd->status.job_exp -= min(sd->status.job_exp, iPc->nextjobexp(sd) * skill_area_temp[0] * 2/1000);
+ sd->status.base_exp -= min(sd->status.base_exp, pc->nextbaseexp(sd) * skill_area_temp[0] * 2/1000); //0.2% penalty per each.
+ sd->status.job_exp -= min(sd->status.job_exp, pc->nextjobexp(sd) * skill_area_temp[0] * 2/1000);
clif->updatestatus(sd,SP_BASEEXP);
clif->updatestatus(sd,SP_JOBEXP);
}
@@ -4873,16 +4873,16 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
{
int exp = 0,jexp = 0;
int lv = dstsd->status.base_level - sd->status.base_level, jlv = dstsd->status.job_level - sd->status.job_level;
- if(lv > 0 && iPc->nextbaseexp(dstsd)) {
+ if(lv > 0 && pc->nextbaseexp(dstsd)) {
exp = (int)((double)dstsd->status.base_exp * (double)lv * (double)battle_config.resurrection_exp / 1000000.);
if (exp < 1) exp = 1;
}
- if(jlv > 0 && iPc->nextjobexp(dstsd)) {
+ if(jlv > 0 && pc->nextjobexp(dstsd)) {
jexp = (int)((double)dstsd->status.job_exp * (double)lv * (double)battle_config.resurrection_exp / 1000000.);
if (jexp < 1) jexp = 1;
}
if(exp > 0 || jexp > 0)
- iPc->gainexp (sd, bl, exp, jexp, false);
+ pc->gainexp (sd, bl, exp, jexp, false);
}
}
}
@@ -4994,7 +4994,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
break;
case SA_LEVELUP:
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
- if (sd && iPc->nextbaseexp(sd)) iPc->gainexp(sd, NULL, iPc->nextbaseexp(sd) * 10 / 100, 0, false);
+ if (sd && pc->nextbaseexp(sd)) pc->gainexp(sd, NULL, pc->nextbaseexp(sd) * 10 / 100, 0, false);
break;
case SA_INSTANTDEATH:
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
@@ -5042,7 +5042,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
break;
case SA_FORTUNE:
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
- if(sd) iPc->getzeny(sd,status_get_lv(bl)*100,LOG_TYPE_STEAL,NULL);
+ if(sd) pc->getzeny(sd,status_get_lv(bl)*100,LOG_TYPE_STEAL,NULL);
break;
case SA_TAMINGMONSTER:
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
@@ -5286,7 +5286,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case SO_STRIKING:
if (sd) {
int bonus = 25 + 10 * skill_lv;
- bonus += (iPc->checkskill(sd, SA_FLAMELAUNCHER)+iPc->checkskill(sd, SA_FROSTWEAPON)+iPc->checkskill(sd, SA_LIGHTNINGLOADER)+iPc->checkskill(sd, SA_SEISMICWEAPON))*5;
+ bonus += (pc->checkskill(sd, SA_FLAMELAUNCHER)+pc->checkskill(sd, SA_FROSTWEAPON)+pc->checkskill(sd, SA_LIGHTNINGLOADER)+pc->checkskill(sd, SA_SEISMICWEAPON))*5;
clif->skill_nodamage( src, bl, skill_id, skill_lv,
battle->check_target(src,bl,BCT_PARTY) > 0 ?
sc_start2(bl, type, 100, skill_lv, bonus, skill->get_time(skill_id,skill_lv)) :
@@ -5503,7 +5503,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if( sd->sc.data[SC_RAISINGDRAGON] )
limit += sd->sc.data[SC_RAISINGDRAGON]->val1;
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
- iPc->addspiritball(sd,skill->get_time(skill_id,skill_lv),limit);
+ pc->addspiritball(sd,skill->get_time(skill_id,skill_lv),limit);
}
break;
@@ -5514,13 +5514,13 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
limit += sd->sc.data[SC_RAISINGDRAGON]->val1;
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
for (i = 0; i < limit; i++)
- iPc->addspiritball(sd,skill->get_time(skill_id,skill_lv),limit);
+ pc->addspiritball(sd,skill->get_time(skill_id,skill_lv),limit);
}
break;
case MO_KITRANSLATION:
if(dstsd && (dstsd->class_&MAPID_BASEMASK)!=MAPID_GUNSLINGER) {
- iPc->addspiritball(dstsd,skill->get_time(skill_id,skill_lv),5);
+ pc->addspiritball(dstsd,skill->get_time(skill_id,skill_lv),5);
}
break;
@@ -5537,7 +5537,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if (dstsd && dstsd->spiritball && (sd == dstsd || map_flag_vs(src->m)) && (dstsd->class_&MAPID_BASEMASK)!=MAPID_GUNSLINGER)
{ // split the if for readability, and included gunslingers in the check so that their coins cannot be removed [Reddozen]
i = dstsd->spiritball * 7;
- iPc->delspiritball(dstsd,dstsd->spiritball,0);
+ pc->delspiritball(dstsd,dstsd->spiritball,0);
} else if (dstmd && !(tstatus->mode&MD_BOSS) && rnd() % 100 < 20)
{ // check if target is a monster and not a Boss, for the 20% chance to absorb 2 SP per monster's level [Reddozen]
i = 2 * dstmd->level;
@@ -5840,7 +5840,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case TF_STEAL:
if(sd) {
- if(iPc->steal_item(sd,bl,skill_lv))
+ if(pc->steal_item(sd,bl,skill_lv))
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
else
clif->skill_fail(sd,skill_id,USESKILL_FAIL,0);
@@ -5849,7 +5849,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case RG_STEALCOIN:
if(sd) {
- if(iPc->steal_coin(sd,bl))
+ if(pc->steal_coin(sd,bl))
{
dstmd->state.provoke_flag = src->id;
mob_target(dstmd, src, skill->get_range2(src,skill_id,skill_lv));
@@ -6019,7 +6019,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case MC_VENDING:
if(sd)
{ //Prevent vending of GMs with unnecessary Level to trade/drop. [Skotlex]
- if ( !iPc->can_give_items(sd) )
+ if ( !pc->can_give_items(sd) )
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
else {
sd->state.prevend = 1;
@@ -6044,9 +6044,9 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if( sd->state.autocast || ( (sd->skillitem == AL_TELEPORT || battle_config.skip_teleport_lv1_menu) && skill_lv == 1 ) || skill_lv == 3 )
{
if( skill_lv == 1 )
- iPc->randomwarp(sd,CLR_TELEPORT);
+ pc->randomwarp(sd,CLR_TELEPORT);
else
- iPc->setpos(sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,CLR_TELEPORT);
+ pc->setpos(sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,CLR_TELEPORT);
break;
}
@@ -6085,7 +6085,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
item_tmp.identify = 1;
tbl.id = 0;
clif->takeitem(&sd->bl,&tbl);
- eflag = iPc->additem(sd,&item_tmp,1,LOG_TYPE_PRODUCE);
+ eflag = pc->additem(sd,&item_tmp,1,LOG_TYPE_PRODUCE);
if(eflag) {
clif->additem(sd,0,0,eflag);
iMap->addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
@@ -6182,7 +6182,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if( sd ) {
int x,bonus=100;
x = skill_lv%11 - 1;
- i = iPc->search_inventory(sd,skill_db[skill_id].itemid[x]);
+ i = pc->search_inventory(sd,skill_db[skill_id].itemid[x]);
if( i < 0 || skill_db[skill_id].itemid[x] <= 0 ) {
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
iMap->freeblock_unlock();
@@ -6209,23 +6209,23 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
bonus += sd->status.base_level;
if( potion_per_hp > 0 || potion_per_sp > 0 ) {
hp = tstatus->max_hp * potion_per_hp / 100;
- hp = hp * (100 + iPc->checkskill(sd,AM_POTIONPITCHER)*10 + iPc->checkskill(sd,AM_LEARNINGPOTION)*5)*bonus/10000;
+ hp = hp * (100 + pc->checkskill(sd,AM_POTIONPITCHER)*10 + pc->checkskill(sd,AM_LEARNINGPOTION)*5)*bonus/10000;
if( dstsd ) {
sp = dstsd->status.max_sp * potion_per_sp / 100;
- sp = sp * (100 + iPc->checkskill(sd,AM_POTIONPITCHER)*10 + iPc->checkskill(sd,AM_LEARNINGPOTION)*5)*bonus/10000;
+ sp = sp * (100 + pc->checkskill(sd,AM_POTIONPITCHER)*10 + pc->checkskill(sd,AM_LEARNINGPOTION)*5)*bonus/10000;
}
} else {
if( potion_hp > 0 ) {
- hp = potion_hp * (100 + iPc->checkskill(sd,AM_POTIONPITCHER)*10 + iPc->checkskill(sd,AM_LEARNINGPOTION)*5)*bonus/10000;
+ hp = potion_hp * (100 + pc->checkskill(sd,AM_POTIONPITCHER)*10 + pc->checkskill(sd,AM_LEARNINGPOTION)*5)*bonus/10000;
hp = hp * (100 + (tstatus->vit<<1)) / 100;
if( dstsd )
- hp = hp * (100 + iPc->checkskill(dstsd,SM_RECOVERY)*10) / 100;
+ hp = hp * (100 + pc->checkskill(dstsd,SM_RECOVERY)*10) / 100;
}
if( potion_sp > 0 ) {
- sp = potion_sp * (100 + iPc->checkskill(sd,AM_POTIONPITCHER)*10 + iPc->checkskill(sd,AM_LEARNINGPOTION)*5)*bonus/10000;
+ sp = potion_sp * (100 + pc->checkskill(sd,AM_POTIONPITCHER)*10 + pc->checkskill(sd,AM_LEARNINGPOTION)*5)*bonus/10000;
sp = sp * (100 + (tstatus->int_<<1)) / 100;
if( dstsd )
- sp = sp * (100 + iPc->checkskill(dstsd,MG_SRECOVERY)*10) / 100;
+ sp = sp * (100 + pc->checkskill(dstsd,MG_SRECOVERY)*10) / 100;
}
}
@@ -6234,7 +6234,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
sp += sp * sd->itemgrouphealrate[IG_POTION] / 100;
}
- if( (i = iPc->skillheal_bonus(sd, skill_id)) ) {
+ if( (i = pc->skillheal_bonus(sd, skill_id)) ) {
hp += hp * i / 100;
sp += sp * i / 100;
}
@@ -6242,9 +6242,9 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
hp = (1 + rnd()%400) * (100 + skill_lv*10) / 100;
hp = hp * (100 + (tstatus->vit<<1)) / 100;
if( dstsd )
- hp = hp * (100 + iPc->checkskill(dstsd,SM_RECOVERY)*10) / 100;
+ hp = hp * (100 + pc->checkskill(dstsd,SM_RECOVERY)*10) / 100;
}
- if( dstsd && (i = iPc->skillheal2_bonus(dstsd, skill_id)) ) {
+ if( dstsd && (i = pc->skillheal2_bonus(dstsd, skill_id)) ) {
hp += hp * i / 100;
sp += sp * i / 100;
}
@@ -6281,7 +6281,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
{
unsigned int equip[] = {EQP_WEAPON, EQP_SHIELD, EQP_ARMOR, EQP_HEAD_TOP};
- if( sd && ( bl->type != BL_PC || ( dstsd && iPc->checkequip(dstsd,equip[skill_id - AM_CP_WEAPON]) < 0 ) ) ){
+ if( sd && ( bl->type != BL_PC || ( dstsd && pc->checkequip(dstsd,equip[skill_id - AM_CP_WEAPON]) < 0 ) ) ){
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
iMap->freeblock_unlock(); // Don't consume item requirements
return 0;
@@ -6309,7 +6309,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
break;
case AM_TWILIGHT3:
if (sd) {
- int ebottle = iPc->search_inventory(sd,713);
+ int ebottle = pc->search_inventory(sd,713);
if( ebottle >= 0 )
ebottle = sd->status.inventory[ebottle].amount;
//check if you can produce all three, if not, then fail:
@@ -6766,8 +6766,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
// parent-baby skills
case WE_BABY:
if(sd){
- struct map_session_data *f_sd = iPc->get_father(sd);
- struct map_session_data *m_sd = iPc->get_mother(sd);
+ struct map_session_data *f_sd = pc->get_father(sd);
+ struct map_session_data *m_sd = pc->get_mother(sd);
// if neither was found
if(!f_sd && !m_sd){
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
@@ -6819,7 +6819,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
memset(&item_tmp,0,sizeof(item_tmp));
item_tmp.nameid = skill_db[su->group->skill_id].itemid[i];
item_tmp.identify = 1;
- if( item_tmp.nameid && (flag=iPc->additem(sd,&item_tmp,skill_db[su->group->skill_id].amount[i],LOG_TYPE_OTHER)) )
+ if( item_tmp.nameid && (flag=pc->additem(sd,&item_tmp,skill_db[su->group->skill_id].amount[i],LOG_TYPE_OTHER)) )
{
clif->additem(sd,0,0,flag);
iMap->addflooritem(&item_tmp,skill_db[su->group->skill_id].amount[i],sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
@@ -6833,7 +6833,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
memset(&item_tmp,0,sizeof(item_tmp));
item_tmp.nameid = su->group->item_id?su->group->item_id:ITEMID_TRAP;
item_tmp.identify = 1;
- if( item_tmp.nameid && (flag=iPc->additem(sd,&item_tmp,1,LOG_TYPE_OTHER)) )
+ if( item_tmp.nameid && (flag=pc->additem(sd,&item_tmp,1,LOG_TYPE_OTHER)) )
{
clif->additem(sd,0,0,flag);
iMap->addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
@@ -6977,9 +6977,9 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
sp = sp * (100 + (tstatus->int_<<1))/100;
if (dstsd) {
if (hp)
- hp = hp * (100 + iPc->checkskill(dstsd,SM_RECOVERY)*10 + iPc->skillheal2_bonus(dstsd, skill_id))/100;
+ hp = hp * (100 + pc->checkskill(dstsd,SM_RECOVERY)*10 + pc->skillheal2_bonus(dstsd, skill_id))/100;
if (sp)
- sp = sp * (100 + iPc->checkskill(dstsd,MG_SRECOVERY)*10 + iPc->skillheal2_bonus(dstsd, skill_id))/100;
+ sp = sp * (100 + pc->checkskill(dstsd,MG_SRECOVERY)*10 + pc->skillheal2_bonus(dstsd, skill_id))/100;
}
if( tsc && tsc->count ) {
if (tsc->data[SC_CRITICALWOUND]) {
@@ -7009,7 +7009,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
int i, s = 0, skilltime = skill->get_time(skill_id,skill_lv);
for (i=0 ; i<4; i++) {
- if( bl->type != BL_PC || ( dstsd && iPc->checkequip(dstsd,equip[i]) < 0 ) )
+ if( bl->type != BL_PC || ( dstsd && pc->checkequip(dstsd,equip[i]) < 0 ) )
continue;
sc_start(bl,(sc_type)(SC_CP_WEAPON + i),100,skill_lv,skilltime);
s++;
@@ -7253,7 +7253,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
continue;
if(iMap->getcell(src->m,src->x+dx[j],src->y+dy[j],CELL_CHKNOREACH))
dx[j] = dy[j] = 0;
- iPc->setpos(dstsd, map_id2index(src->m), src->x+dx[j], src->y+dy[j], CLR_RESPAWN);
+ pc->setpos(dstsd, map_id2index(src->m), src->x+dx[j], src->y+dy[j], CLR_RESPAWN);
}
}
if (sd)
@@ -7274,7 +7274,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case SG_HATE:
if (sd) {
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
- if (!iPc->set_hate_mob(sd, skill_lv-1, bl))
+ if (!pc->set_hate_mob(sd, skill_lv-1, bl))
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
}
break;
@@ -7283,9 +7283,9 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if(sd) {
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
if(rnd()%100 < (20+10*skill_lv))
- iPc->addspiritball(sd,skill->get_time(skill_id,skill_lv),10);
+ pc->addspiritball(sd,skill->get_time(skill_id,skill_lv),10);
else if(sd->spiritball > 0)
- iPc->delspiritball(sd,1,0);
+ pc->delspiritball(sd,1,0);
}
break;
@@ -7475,7 +7475,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
src,skill_id,skill_lv,tick,flag|BCT_ENEMY|1,skill->castend_damage_id);
break;
case RK_STONEHARDSKIN:
- if( sd && iPc->checkskill(sd,RK_RUNEMASTERY) >= 4 )
+ if( sd && pc->checkskill(sd,RK_RUNEMASTERY) >= 4 )
{
int heal = sstatus->hp / 4; // 25% HP
if( status_charge(bl,heal,0) )
@@ -7485,7 +7485,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
}
break;
case RK_REFRESH:
- if( sd && iPc->checkskill(sd,RK_RUNEMASTERY) >= 8 )
+ if( sd && pc->checkskill(sd,RK_RUNEMASTERY) >= 8 )
{
int heal = status_get_max_hp(bl) * 25 / 100;
clif->skill_nodamage(src,bl,skill_id,skill_lv,
@@ -7496,7 +7496,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
break;
case RK_MILLENNIUMSHIELD:
- if( sd && iPc->checkskill(sd,RK_RUNEMASTERY) >= 9 )
+ if( sd && pc->checkskill(sd,RK_RUNEMASTERY) >= 9 )
{
short shields = (rnd()%100<50) ? 4 : ((rnd()%100<80) ? 3 : 2);
sc_start4(bl,type,100,skill_lv,shields,1000,0,skill->get_time(skill_id,skill_lv));
@@ -7518,7 +7518,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
lv = 6;
else if( skill_id == RK_CRUSHSTRIKE )
lv = 7;
- if( iPc->checkskill(sd,RK_RUNEMASTERY) >= lv )
+ if( pc->checkskill(sd,RK_RUNEMASTERY) >= lv )
clif->skill_nodamage(src,bl,skill_id,skill_lv,sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
}
break;
@@ -7526,10 +7526,10 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case RK_FIGHTINGSPIRIT:
if( flag&1 ) {
if( src == bl )
- sc_start2(bl,type,100,skill_area_temp[5],10*(sd?iPc->checkskill(sd,RK_RUNEMASTERY):10),skill->get_time(skill_id,skill_lv));
+ sc_start2(bl,type,100,skill_area_temp[5],10*(sd?pc->checkskill(sd,RK_RUNEMASTERY):10),skill->get_time(skill_id,skill_lv));
else
sc_start(bl,type,100,skill_area_temp[5]/4,skill->get_time(skill_id,skill_lv));
- } else if( sd && iPc->checkskill(sd,RK_RUNEMASTERY) >= 5 ) {
+ } else if( sd && pc->checkskill(sd,RK_RUNEMASTERY) >= 5 ) {
if( sd->status.party_id ) {
i = party_foreachsamemap(skill->area_sub,sd,skill->get_splash(skill_id,skill_lv),src,skill_id,skill_lv,tick,BCT_PARTY,skill->area_sub_count);
skill_area_temp[5] = 7 * i; // ATK
@@ -7632,8 +7632,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case AB_CLEMENTIA:
case AB_CANTO:
{
- int bless_lv = iPc->checkskill(sd,AL_BLESSING) + (sd->status.job_level / 10);
- int agi_lv = iPc->checkskill(sd,AL_INCAGI) + (sd->status.job_level / 10);
+ int bless_lv = pc->checkskill(sd,AL_BLESSING) + (sd->status.job_level / 10);
+ int agi_lv = pc->checkskill(sd,AL_INCAGI) + (sd->status.job_level / 10);
if( sd == NULL || sd->status.party_id == 0 || flag&1 )
clif->skill_nodamage(bl, bl, skill_id, skill_lv, sc_start(bl,type,100,
(skill_id == AB_CLEMENTIA)? bless_lv : (skill_id == AB_CANTO)? agi_lv : skill_lv, skill->get_time(skill_id,skill_lv)));
@@ -7652,7 +7652,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case AB_CHEAL:
if( sd == NULL || sd->status.party_id == 0 || flag&1 ) {
if( sd && tstatus && !battle->check_undead(tstatus->race, tstatus->def_ele) ) {
- i = skill->calc_heal(src, bl, AL_HEAL, iPc->checkskill(sd, AL_HEAL), true);
+ i = skill->calc_heal(src, bl, AL_HEAL, pc->checkskill(sd, AL_HEAL), true);
if( (dstsd && pc_ismadogear(dstsd)) || status_isimmune(bl))
i = 0; // Should heal by 0 or won't do anything?? in iRO it breaks the healing to members.. [malufett]
@@ -7947,9 +7947,9 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case RA_WUGMASTERY:
if( sd ) {
if( !pc_iswug(sd) )
- iPc->setoption(sd,sd->sc.option|OPTION_WUG);
+ pc->setoption(sd,sd->sc.option|OPTION_WUG);
else
- iPc->setoption(sd,sd->sc.option&~OPTION_WUG);
+ pc->setoption(sd,sd->sc.option&~OPTION_WUG);
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
}
break;
@@ -7957,11 +7957,11 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case RA_WUGRIDER:
if( sd ) {
if( !pc_isridingwug(sd) && pc_iswug(sd) ) {
- iPc->setoption(sd,sd->sc.option&~OPTION_WUG);
- iPc->setoption(sd,sd->sc.option|OPTION_WUGRIDER);
+ pc->setoption(sd,sd->sc.option&~OPTION_WUG);
+ pc->setoption(sd,sd->sc.option|OPTION_WUGRIDER);
} else if( pc_isridingwug(sd) ) {
- iPc->setoption(sd,sd->sc.option&~OPTION_WUGRIDER);
- iPc->setoption(sd,sd->sc.option|OPTION_WUG);
+ pc->setoption(sd,sd->sc.option&~OPTION_WUGRIDER);
+ pc->setoption(sd,sd->sc.option|OPTION_WUG);
}
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
}
@@ -8001,7 +8001,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case NC_SELFDESTRUCTION:
if( sd ) {
if( pc_ismadogear(sd) )
- iPc->setmadogear(sd, 0);
+ pc->setmadogear(sd, 0);
clif->skill_nodamage(src, bl, skill_id, skill_lv, 1);
skill->castend_damage_id(src, src, skill_id, skill_lv, tick, flag);
status_set_sp(src, 0, 0);
@@ -8012,7 +8012,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
clif->skill_damage(src, bl, tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
clif->skill_nodamage(src, bl, skill_id, skill_lv,
sc_start(bl,type, 30 + 12 * skill_lv,skill_lv,skill->get_time(skill_id,skill_lv)));
- if( sd ) iPc->overheat(sd,1);
+ if( sd ) pc->overheat(sd,1);
break;
case NC_MAGNETICFIELD:
@@ -8020,7 +8020,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
{
iMap->foreachinrange(skill->area_sub,src,skill->get_splash(skill_id,skill_lv),splash_target(src),src,skill_id,skill_lv,tick,flag|BCT_ENEMY|SD_SPLASH|1,skill->castend_damage_id);;
clif->skill_damage(src,src,tick,status_get_amotion(src),0,-30000,1,skill_id,skill_lv,6);
- if (sd) iPc->overheat(sd,1);
+ if (sd) pc->overheat(sd,1);
}
clif->skill_nodamage(src,src,skill_id,skill_lv,i);
break;
@@ -8262,8 +8262,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case LG_INSPIRATION:
if( sd && !map[sd->bl.m].flag.noexppenalty && sd->status.base_level != MAX_LEVEL ) {
- sd->status.base_exp -= min(sd->status.base_exp, iPc->nextbaseexp(sd) * 1 / 100); // 1% penalty.
- sd->status.job_exp -= min(sd->status.job_exp, iPc->nextjobexp(sd) * 1 / 100);
+ sd->status.base_exp -= min(sd->status.base_exp, pc->nextbaseexp(sd) * 1 / 100); // 1% penalty.
+ sd->status.job_exp -= min(sd->status.job_exp, pc->nextjobexp(sd) * 1 / 100);
clif->updatestatus(sd,SP_BASEEXP);
clif->updatestatus(sd,SP_JOBEXP);
}
@@ -8286,7 +8286,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
clif->skill_damage(src, bl, tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
count = iMap->forcountinrange(skill->area_sub, src, skill->get_splash(skill_id,skill_lv), (sd)?sd->spiritball_old:15, // Assume 15 spiritballs in non-charactors
BL_CHAR, src, skill_id, skill_lv, tick, flag|BCT_ENEMY|1, skill->castend_nodamage_id);
- if( sd ) iPc->delspiritball(sd, count, 0);
+ if( sd ) pc->delspiritball(sd, count, 0);
clif->skill_nodamage(src, src, skill_id, skill_lv,
sc_start2(src, SC_CURSEDCIRCLE_ATKER, 100, skill_lv, count, skill->get_time(skill_id,skill_lv)));
}
@@ -8297,7 +8297,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
short max = 5 + skill_lv;
sc_start(bl, SC_EXPLOSIONSPIRITS, 100, skill_lv, skill->get_time(skill_id, skill_lv));
for( i = 0; i < max; i++ ) // Don't call more than max available spheres.
- iPc->addspiritball(sd, skill->get_time(skill_id, skill_lv), max);
+ pc->addspiritball(sd, skill->get_time(skill_id, skill_lv), max);
clif->skill_nodamage(src, bl, skill_id, skill_lv, sc_start(bl, type, 100, skill_lv,skill->get_time(skill_id, skill_lv)));
}
break;
@@ -8308,7 +8308,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if( dstsd && dstsd->spiritball && (sd == dstsd || map_flag_vs(src->m)) && (dstsd->class_&MAPID_BASEMASK)!=MAPID_GUNSLINGER )
{
i = dstsd->spiritball; //1%sp per spiritball.
- iPc->delspiritball(dstsd, dstsd->spiritball, 0);
+ pc->delspiritball(dstsd, dstsd->spiritball, 0);
}
if( i ) status_percent_heal(src, 0, i);
clif->skill_nodamage(src, bl, skill_id, skill_lv, i ? 1:0);
@@ -8323,8 +8323,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
break;
if( sd && dstsd->spiritball <= 5 ) {
for(i = 0; i <= 5; i++) {
- iPc->addspiritball(dstsd, skill->get_time(MO_CALLSPIRITS, iPc->checkskill(sd,MO_CALLSPIRITS)), i);
- iPc->delspiritball(sd, sd->spiritball, 0);
+ pc->addspiritball(dstsd, skill->get_time(MO_CALLSPIRITS, pc->checkskill(sd,MO_CALLSPIRITS)), i);
+ pc->delspiritball(sd, sd->spiritball, 0);
}
}
clif->skill_nodamage(src, bl, skill_id, skill_lv, 1);
@@ -8378,7 +8378,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case MI_RUSH_WINDMILL:
case MI_ECHOSONG:
if( sd == NULL || sd->status.party_id == 0 || (flag & 1) )
- sc_start4(bl,type,100,skill_lv,6*skill_lv,(sd?iPc->checkskill(sd,WM_LESSON):0),(sd?sd->status.job_level:0),skill->get_time(skill_id,skill_lv));
+ sc_start4(bl,type,100,skill_lv,6*skill_lv,(sd?pc->checkskill(sd,WM_LESSON):0),(sd?sd->status.job_level:0),skill->get_time(skill_id,skill_lv));
else if( sd ) { // Only shows effects on caster.
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
party_foreachsamemap(skill->area_sub, sd, skill->get_splash(skill_id, skill_lv), src, skill_id, skill_lv, tick, flag|BCT_PARTY|1, skill->castend_nodamage_id);
@@ -8403,7 +8403,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
tstatus->hp = heal;
tstatus->sp -= tstatus->sp * ( 120 - 20 * skill_lv ) / 100;
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
- iPc->revive((TBL_PC*)bl,heal,0);
+ pc->revive((TBL_PC*)bl,heal,0);
clif->resurrection(bl,1);
}
}
@@ -8424,9 +8424,9 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case WM_GLOOMYDAY:
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
- if( dstsd && ( iPc->checkskill(dstsd,KN_BRANDISHSPEAR) || iPc->checkskill(dstsd,LK_SPIRALPIERCE) ||
- iPc->checkskill(dstsd,CR_SHIELDCHARGE) || iPc->checkskill(dstsd,CR_SHIELDBOOMERANG) ||
- iPc->checkskill(dstsd,PA_SHIELDCHAIN) || iPc->checkskill(dstsd,LG_SHIELDPRESS) ) )
+ if( dstsd && ( pc->checkskill(dstsd,KN_BRANDISHSPEAR) || pc->checkskill(dstsd,LK_SPIRALPIERCE) ||
+ pc->checkskill(dstsd,CR_SHIELDCHARGE) || pc->checkskill(dstsd,CR_SHIELDBOOMERANG) ||
+ pc->checkskill(dstsd,PA_SHIELDCHAIN) || pc->checkskill(dstsd,LG_SHIELDPRESS) ) )
{
sc_start(bl,SC_GLOOMYDAY_SK,100,skill_lv,skill->get_time(skill_id,skill_lv));
break;
@@ -8562,7 +8562,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
iMap->freeblock_unlock();
return 0;
}
- iPc->setpos(sd, mapindex, x, y, CLR_TELEPORT);
+ pc->setpos(sd, mapindex, x, y, CLR_TELEPORT);
}
break;
@@ -8590,7 +8590,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case WM_LULLABY_DEEPSLEEP:
if( flag&1 ){
//[(Skill Level x 4) + (Voice Lessons Skill Level x 2) + (Caster�s Base Level / 15) + (Caster�s Job Level / 5)] %
- int rate = (4 * skill_lv) + ( (sd) ? iPc->checkskill(sd,WM_LESSON)*2 + sd->status.job_level/5 : 0 ) + status_get_lv(src) / 15;
+ int rate = (4 * skill_lv) + ( (sd) ? pc->checkskill(sd,WM_LESSON)*2 + sd->status.job_level/5 : 0 ) + status_get_lv(src) / 15;
if( bl != src )
sc_start(bl,type,rate,skill_lv,skill->get_time(skill_id,skill_lv));
}else {
@@ -8836,7 +8836,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if(sd) {
int ttype = skill->get_ele(skill_id, skill_lv);
clif->skill_nodamage(src, bl, skill_id, skill_lv, 1);
- iPc->add_talisman(sd, skill->get_time(skill_id, skill_lv), 10, ttype);
+ pc->add_talisman(sd, skill->get_time(skill_id, skill_lv), 10, ttype);
}
break;
@@ -8853,7 +8853,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
iTimer->delete_timer(md->deletetimer, mob_timer_delete);
md->deletetimer = iTimer->add_timer (iTimer->gettick() + skill->get_time(skill_id, skill_lv), mob_timer_delete, md->bl.id, 0);
mob_spawn( md );
- iPc->setinvincibletimer(sd,500);// unlock target lock
+ pc->setinvincibletimer(sd,500);// unlock target lock
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
skill->blown(src,bl,skill->get_blewcount(skill_id,skill_lv),unit_getdir(bl),0);
}
@@ -9111,7 +9111,7 @@ int skill_castend_id(int tid, unsigned int tick, int id, intptr_t data)
return 0;
}
- if( sd && ud->skilltimer != INVALID_TIMER && (iPc->checkskill(sd,SA_FREECAST) > 0 || ud->skill_id == LG_EXEEDBREAK) )
+ if( sd && ud->skilltimer != INVALID_TIMER && (pc->checkskill(sd,SA_FREECAST) > 0 || ud->skill_id == LG_EXEEDBREAK) )
{// restore original walk speed
ud->skilltimer = INVALID_TIMER;
status_calc_bl(&sd->bl, SCB_SPEED);
@@ -9425,7 +9425,7 @@ int skill_castend_pos(int tid, unsigned int tick, int id, intptr_t data)
return 0;
}
- if( sd && ud->skilltimer != INVALID_TIMER && ( iPc->checkskill(sd,SA_FREECAST) > 0 || ud->skill_id == LG_EXEEDBREAK ) )
+ if( sd && ud->skilltimer != INVALID_TIMER && ( pc->checkskill(sd,SA_FREECAST) > 0 || ud->skill_id == LG_EXEEDBREAK ) )
{// restore original walk speed
ud->skilltimer = INVALID_TIMER;
status_calc_bl(&sd->bl, SCB_SPEED);
@@ -9887,7 +9887,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
case CR_SLIMPITCHER:
if (sd) {
int i = skill_lv%11 - 1;
- int j = iPc->search_inventory(sd,skill_db[skill_id].itemid[i]);
+ int j = pc->search_inventory(sd,skill_db[skill_id].itemid[i]);
if( j < 0 || skill_db[skill_id].itemid[i] <= 0 || sd->inventory_data[j] == NULL || sd->status.inventory[j].amount < skill_db[skill_id].amount[i] )
{
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
@@ -9899,10 +9899,10 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
run_script(sd->inventory_data[j]->script,0,sd->bl.id,0);
potion_flag = 0;
//Apply skill bonuses
- i = iPc->checkskill(sd,CR_SLIMPITCHER)*10
- + iPc->checkskill(sd,AM_POTIONPITCHER)*10
- + iPc->checkskill(sd,AM_LEARNINGPOTION)*5
- + iPc->skillheal_bonus(sd, skill_id);
+ i = pc->checkskill(sd,CR_SLIMPITCHER)*10
+ + pc->checkskill(sd,AM_POTIONPITCHER)*10
+ + pc->checkskill(sd,AM_LEARNINGPOTION)*5
+ + pc->skillheal_bonus(sd, skill_id);
potion_hp = potion_hp * (100+i)/100;
potion_sp = potion_sp * (100+i)/100;
@@ -10104,7 +10104,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
skill->clear_unitgroup(src); // To remove previous skills - cannot used combined
if( (sg = skill->unitsetting(src,skill_id,skill_lv,src->x,src->y,0)) != NULL ) {
sc_start2(src,skill_id == NC_NEUTRALBARRIER ? SC_NEUTRALBARRIER_MASTER : SC_STEALTHFIELD_MASTER,100,skill_lv,sg->group_id,skill->get_time(skill_id,skill_lv));
- if( sd ) iPc->overheat(sd,1);
+ if( sd ) pc->overheat(sd,1);
}
break;
@@ -10154,7 +10154,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
status_change_end(src,SC_BANDING,INVALID_TIMER);
else if( (sg = skill->unitsetting(src,skill_id,skill_lv,src->x,src->y,0)) != NULL ) {
sc_start4(src,SC_BANDING,100,skill_lv,0,0,sg->group_id,skill->get_time(skill_id,skill_lv));
- if( sd ) iPc->banding(sd,skill_lv);
+ if( sd ) pc->banding(sd,skill_lv);
}
clif->skill_nodamage(src,src,skill_id,skill_lv,1);
break;
@@ -10211,7 +10211,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
iMap->foreachinarea(skill->area_sub, src->m,
ud->skillunit[i]->unit->bl.x - 3, ud->skillunit[i]->unit->bl.y - 3,
ud->skillunit[i]->unit->bl.x + 3, ud->skillunit[i]->unit->bl.y + 3, BL_CHAR,
- src, CR_ACIDDEMONSTRATION, sd ? iPc->checkskill(sd, CR_ACIDDEMONSTRATION) : skill_lv, tick, flag|BCT_ENEMY|1|SD_LEVEL, skill->castend_damage_id);
+ src, CR_ACIDDEMONSTRATION, sd ? pc->checkskill(sd, CR_ACIDDEMONSTRATION) : skill_lv, tick, flag|BCT_ENEMY|1|SD_LEVEL, skill->castend_damage_id);
skill->delunit(ud->skillunit[i]->unit);
break;
default:
@@ -10294,7 +10294,7 @@ int skill_castend_map (struct map_session_data *sd, uint16 skill_id, const char
sd->sc.data[SC_ROKISWEIL] ||
sd->sc.data[SC_AUTOCOUNTER] ||
sd->sc.data[SC_STEELBODY] ||
- (sd->sc.data[SC_DANCING] && skill_id < RK_ENCHANTBLADE && !iPc->checkskill(sd, WM_LESSON)) ||
+ (sd->sc.data[SC_DANCING] && skill_id < RK_ENCHANTBLADE && !pc->checkskill(sd, WM_LESSON)) ||
sd->sc.data[SC_BERSERK] || sd->sc.data[SC__BLOODYLUST] ||
sd->sc.data[SC_BASILICA] ||
sd->sc.data[SC_MARIONETTE] ||
@@ -10323,9 +10323,9 @@ int skill_castend_map (struct map_session_data *sd, uint16 skill_id, const char
switch(skill_id) {
case AL_TELEPORT:
if(strcmp(map,"Random")==0)
- iPc->randomwarp(sd,CLR_TELEPORT);
+ pc->randomwarp(sd,CLR_TELEPORT);
else if (sd->menuskill_val > 1) //Need lv2 to be able to warp here.
- iPc->setpos(sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,CLR_TELEPORT);
+ pc->setpos(sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,CLR_TELEPORT);
break;
case AL_WARP:
@@ -10360,7 +10360,7 @@ int skill_castend_map (struct map_session_data *sd, uint16 skill_id, const char
}
}
- lv = sd->skillitem==skill_id?sd->skillitemlv:iPc->checkskill(sd,skill_id);
+ lv = sd->skillitem==skill_id?sd->skillitemlv:pc->checkskill(sd,skill_id);
wx = sd->menuskill_val>>16;
wy = sd->menuskill_val&0xffff;
@@ -10680,8 +10680,8 @@ struct skill_unit_group* skill_unitsetting (struct block_list *src, uint16 skill
val1 = skill_lv +status->agi/10; // Flee increase
val2 = ((skill_lv+1)/2)+status->luk/10; // Perfect dodge increase
if(sd){
- val1 += iPc->checkskill(sd,BA_MUSICALLESSON);
- val2 += iPc->checkskill(sd,BA_MUSICALLESSON);
+ val1 += pc->checkskill(sd,BA_MUSICALLESSON);
+ val2 += pc->checkskill(sd,BA_MUSICALLESSON);
}
break;
case DC_HUMMING:
@@ -10690,47 +10690,47 @@ struct skill_unit_group* skill_unitsetting (struct block_list *src, uint16 skill
val1 *= 2;
#endif
if(sd)
- val1 += iPc->checkskill(sd,DC_DANCINGLESSON);
+ val1 += pc->checkskill(sd,DC_DANCINGLESSON);
break;
case BA_POEMBRAGI:
val1 = 3*skill_lv+status->dex/10; // Casting time reduction
//For some reason at level 10 the base delay reduction is 50%.
val2 = (skill_lv<10?3*skill_lv:50)+status->int_/5; // After-cast delay reduction
if(sd){
- val1 += 2*iPc->checkskill(sd,BA_MUSICALLESSON);
- val2 += 2*iPc->checkskill(sd,BA_MUSICALLESSON);
+ val1 += 2*pc->checkskill(sd,BA_MUSICALLESSON);
+ val2 += 2*pc->checkskill(sd,BA_MUSICALLESSON);
}
break;
case DC_DONTFORGETME:
val1 = status->dex/10 + 3*skill_lv + 5; // ASPD decrease
val2 = status->agi/10 + 3*skill_lv + 5; // Movement speed adjustment.
if(sd){
- val1 += iPc->checkskill(sd,DC_DANCINGLESSON);
- val2 += iPc->checkskill(sd,DC_DANCINGLESSON);
+ val1 += pc->checkskill(sd,DC_DANCINGLESSON);
+ val2 += pc->checkskill(sd,DC_DANCINGLESSON);
}
break;
case BA_APPLEIDUN:
val1 = 5+2*skill_lv+status->vit/10; // MaxHP percent increase
if(sd)
- val1 += iPc->checkskill(sd,BA_MUSICALLESSON);
+ val1 += pc->checkskill(sd,BA_MUSICALLESSON);
break;
case DC_SERVICEFORYOU:
val1 = 15+skill_lv+(status->int_/10); // MaxSP percent increase TO-DO: this INT bonus value is guessed
val2 = 20+3*skill_lv+(status->int_/10); // SP cost reduction
if(sd){
- val1 += iPc->checkskill(sd,DC_DANCINGLESSON); //TO-DO This bonus value is guessed
- val2 += iPc->checkskill(sd,DC_DANCINGLESSON); //TO-DO Should be half this value
+ val1 += pc->checkskill(sd,DC_DANCINGLESSON); //TO-DO This bonus value is guessed
+ val2 += pc->checkskill(sd,DC_DANCINGLESSON); //TO-DO Should be half this value
}
break;
case BA_ASSASSINCROSS:
val1 = 100+(10*skill_lv)+(status->agi/10); // ASPD increase
if(sd)
- val1 += 5*iPc->checkskill(sd,BA_MUSICALLESSON);
+ val1 += 5*pc->checkskill(sd,BA_MUSICALLESSON);
break;
case DC_FORTUNEKISS:
val1 = 10+skill_lv+(status->luk/10); // Critical increase
if(sd)
- val1 += iPc->checkskill(sd,DC_DANCINGLESSON);
+ val1 += pc->checkskill(sd,DC_DANCINGLESSON);
val1*=10; //Because every 10 crit is an actual cri point.
break;
case BD_DRUMBATTLEFIELD:
@@ -10848,7 +10848,7 @@ struct skill_unit_group* skill_unitsetting (struct block_list *src, uint16 skill
val2 = i; // aura type
limit += val1 * 1000;
subunt = i - 1;
- iPc->del_talisman(sd, sd->talisman[i], i);
+ pc->del_talisman(sd, sd->talisman[i], i);
}
}
break;
@@ -11100,7 +11100,7 @@ int skill_unit_onplace (struct skill_unit *src, struct block_list *bl, unsigned
sg->val1 = (count<<16)|working;
- iPc->setpos(sd,m,x,y,CLR_TELEPORT);
+ pc->setpos(sd,m,x,y,CLR_TELEPORT);
}
} else if(bl->type == BL_MOB && battle_config.mob_warp&2) {
int16 m = iMap->mapindex2mapid(sg->val3);
@@ -11725,7 +11725,7 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
case UNT_DIMENSIONDOOR:
if( tsd && !map[bl->m].flag.noteleport )
- iPc->randomwarp(tsd,3);
+ pc->randomwarp(tsd,3);
else if( bl->type == BL_MOB && battle_config.mob_warp&8 )
unit_warp(bl,-1,-1,-1,3);
break;
@@ -11782,7 +11782,7 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
break;
case 3:
skill->attack(skill->get_type(CR_ACIDDEMONSTRATION), ss, &src->bl, bl,
- CR_ACIDDEMONSTRATION, sd ? iPc->checkskill(sd, CR_ACIDDEMONSTRATION) : sg->skill_lv, tick, 0);
+ CR_ACIDDEMONSTRATION, sd ? pc->checkskill(sd, CR_ACIDDEMONSTRATION) : sg->skill_lv, tick, 0);
break;
}
@@ -12238,7 +12238,7 @@ int skill_check_condition_char_sub (struct block_list *bl, va_list ap) {
return 0;
if (sd->status.sex != tsd->status.sex &&
(tsd->class_&MAPID_UPPERMASK) == MAPID_BARDDANCER &&
- (skill_lv = iPc->checkskill(tsd, skill_id)) > 0 &&
+ (skill_lv = pc->checkskill(tsd, skill_id)) > 0 &&
(tsd->weapontype1==W_MUSICAL || tsd->weapontype1==W_WHIP) &&
sd->status.party_id && tsd->status.party_id &&
sd->status.party_id == tsd->status.party_id &&
@@ -12417,7 +12417,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
if( skill_id == WZ_EARTHSPIKE && sc && sc->data[SC_EARTHSCROLL] && rnd()%100 > sc->data[SC_EARTHSCROLL]->val2 ) // [marquis007]
; //Do not consume item.
else if( sd->status.inventory[i].expire_time == 0 )
- iPc->delitem(sd,i,1,0,0,LOG_TYPE_CONSUME); // Rental usable items are not consumed until expiration
+ pc->delitem(sd,i,1,0,0,LOG_TYPE_CONSUME); // Rental usable items are not consumed until expiration
}
return 1;
}
@@ -12595,7 +12595,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
status_change_end(&sd->bl, SC_COMBO, INVALID_TIMER);
return 0;
}
- if(sc->data[SC_COMBO]->val1 != skill_id && !( sd && sd->status.base_level >= 90 && iPc->famerank(sd->status.char_id, MAPID_TAEKWON) )) { //Cancel combo wait.
+ if(sc->data[SC_COMBO]->val1 != skill_id && !( sd && sd->status.base_level >= 90 && pc->famerank(sd->status.char_id, MAPID_TAEKWON) )) { //Cancel combo wait.
unit_cancel_combo(&sd->bl);
return 0;
}
@@ -12662,8 +12662,8 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
case PR_REDEMPTIO:
{
int exp;
- if( ((exp = iPc->nextbaseexp(sd)) > 0 && get_percentage(sd->status.base_exp, exp) < 1) ||
- ((exp = iPc->nextjobexp(sd)) > 0 && get_percentage(sd->status.job_exp, exp) < 1)) {
+ if( ((exp = pc->nextbaseexp(sd)) > 0 && get_percentage(sd->status.base_exp, exp) < 1) ||
+ ((exp = pc->nextjobexp(sd)) > 0 && get_percentage(sd->status.job_exp, exp) < 1)) {
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); //Not enough exp.
return 0;
}
@@ -12804,7 +12804,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
* Warlock
**/
case WL_COMET:
- if( skill->check_pc_partner(sd,skill_id,&skill_lv,1,0) <= 0 && ((i = iPc->search_inventory(sd,require.itemid[0])) < 0 || sd->status.inventory[i].amount < require.amount[0]) )
+ if( skill->check_pc_partner(sd,skill_id,&skill_lv,1,0) <= 0 && ((i = pc->search_inventory(sd,require.itemid[0])) < 0 || sd->status.inventory[i].amount < require.amount[0]) )
{
//clif->skill_fail(sd,skill_id,USESKILL_FAIL_NEED_ITEM,require.amount[0],require.itemid[0]);
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
@@ -13342,7 +13342,7 @@ int skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id,
for( i = 0; i < MAX_SKILL_ITEM_REQUIRE; ++i ) {
if( !require.itemid[i] )
continue;
- index[i] = iPc->search_inventory(sd,require.itemid[i]);
+ index[i] = pc->search_inventory(sd,require.itemid[i]);
if( index[i] < 0 || sd->status.inventory[index[i]].amount < require.amount[i] ) {
if( require.itemid[i] == ITEMID_RED_GEMSTONE )
clif->skill_fail(sd,skill_id,USESKILL_FAIL_REDJAMSTONE,0);// red gemstone required
@@ -13375,7 +13375,7 @@ int skill_consume_requirement( struct map_session_data *sd, uint16 skill_id, uin
status_zap(&sd->bl, req.hp, req.sp);
if(req.spiritball > 0)
- iPc->delspiritball(sd,req.spiritball,0);
+ pc->delspiritball(sd,req.spiritball,0);
if(req.zeny > 0)
{
@@ -13383,7 +13383,7 @@ int skill_consume_requirement( struct map_session_data *sd, uint16 skill_id, uin
req.zeny = 0; //Zeny is reduced on skill->attack.
if( sd->status.zeny < req.zeny )
req.zeny = sd->status.zeny;
- iPc->payzeny(sd,req.zeny,LOG_TYPE_CONSUME,NULL);
+ pc->payzeny(sd,req.zeny,LOG_TYPE_CONSUME,NULL);
}
}
@@ -13425,8 +13425,8 @@ int skill_consume_requirement( struct map_session_data *sd, uint16 skill_id, uin
break;
}
- if( (n = iPc->search_inventory(sd,req.itemid[i])) >= 0 )
- iPc->delitem(sd,n,req.amount[i],0,1,LOG_TYPE_CONSUME);
+ if( (n = pc->search_inventory(sd,req.itemid[i])) >= 0 )
+ pc->delitem(sd,n,req.amount[i],0,1,LOG_TYPE_CONSUME);
}
}
@@ -13593,9 +13593,9 @@ struct skill_condition skill_get_requirement(struct map_session_data* sd, uint16
req.amount[i] = 1; // Hocus Pocus allways use at least 1 gem
}
}
- if( skill_id >= HT_SKIDTRAP && skill_id <= HT_TALKIEBOX && iPc->checkskill(sd, RA_RESEARCHTRAP) > 0){
+ if( skill_id >= HT_SKIDTRAP && skill_id <= HT_TALKIEBOX && pc->checkskill(sd, RA_RESEARCHTRAP) > 0){
int16 itIndex;
- if( (itIndex = iPc->search_inventory(sd,req.itemid[i])) < 0 || ( itIndex >= 0 && sd->status.inventory[itIndex].amount < req.amount[i] ) ){
+ if( (itIndex = pc->search_inventory(sd,req.itemid[i])) < 0 || ( itIndex >= 0 && sd->status.inventory[itIndex].amount < req.amount[i] ) ){
req.itemid[i] = ITEMID_TRAP_ALLOY;
req.amount[i] = 1;
}
@@ -13623,7 +13623,7 @@ struct skill_condition skill_get_requirement(struct map_session_data* sd, uint16
// Check for cost reductions due to skills & SCs
switch(skill_id) {
case MC_MAMMONITE:
- if(iPc->checkskill(sd,BS_UNFAIRLYTRICK)>0)
+ if(pc->checkskill(sd,BS_UNFAIRLYTRICK)>0)
req.zeny -= req.zeny*10/100;
break;
case AL_HOLYLIGHT:
@@ -13634,7 +13634,7 @@ struct skill_condition skill_get_requirement(struct map_session_data* sd, uint16
case SL_STUN:
case SL_STIN:
{
- int kaina_lv = iPc->checkskill(sd,SL_KAINA);
+ int kaina_lv = pc->checkskill(sd,SL_KAINA);
if(kaina_lv==0 || sd->status.base_level<70)
break;
@@ -13692,7 +13692,7 @@ struct skill_condition skill_get_requirement(struct map_session_data* sd, uint16
case SO_SUMMON_AQUA:
case SO_SUMMON_VENTUS:
case SO_SUMMON_TERA:
- req.sp -= req.sp * (5 + 5 * iPc->checkskill(sd,SO_EL_SYMPATHY)) / 100;
+ req.sp -= req.sp * (5 + 5 * pc->checkskill(sd,SO_EL_SYMPATHY)) / 100;
break;
case SO_PSYCHIC_WAVE:
if( sc && sc->data[SC_BLAST_OPTION] )
@@ -13866,7 +13866,7 @@ int skill_vfcastfix (struct block_list *bl, double time, uint16 skill_id, uint16
fixcast_r = max(fixcast_r, sc->data[SC__LAZINESS]->val2);
if( sc->data[SC_SECRAMENT] )
fixcast_r = max(fixcast_r, sc->data[SC_SECRAMENT]->val2);
- if( sd && ( skill_lv = iPc->checkskill(sd, WL_RADIUS) ) && skill_id >= WL_WHITEIMPRISON && skill_id <= WL_FREEZE_SP )
+ if( sd && ( skill_lv = pc->checkskill(sd, WL_RADIUS) ) && skill_id >= WL_WHITEIMPRISON && skill_id <= WL_FREEZE_SP )
fixcast_r = max(fixcast_r, 5 + skill_lv * 5);
// Fixed cast non percentage bonuses
if( sc->data[SC_MANDRAGORA] )
@@ -14187,7 +14187,7 @@ void skill_repairweapon (struct map_session_data *sd, int idx) {
material = materials [ target_sd->inventory_data[idx]->wlv - 1 ]; // Lv1/2/3/4 weapons consume 1 Iron Ore/Iron/Steel/Rough Oridecon
else
material = materials [2]; // Armors consume 1 Steel
- if ( iPc->search_inventory(sd,material) < 0 ) {
+ if ( pc->search_inventory(sd,material) < 0 ) {
clif->skill_fail(sd,sd->menuskill_id,USESKILL_FAIL_LEVEL,0);
return;
}
@@ -14198,7 +14198,7 @@ void skill_repairweapon (struct map_session_data *sd, int idx) {
clif->equiplist(target_sd);
- iPc->delitem(sd,iPc->search_inventory(sd,material),1,0,0,LOG_TYPE_CONSUME);
+ pc->delitem(sd,pc->search_inventory(sd,material),1,0,0,LOG_TYPE_CONSUME);
clif->item_repaireffect(sd,idx,0);
@@ -14244,7 +14244,7 @@ void skill_weaponrefine (struct map_session_data *sd, int idx)
if( item->refine >= sd->menuskill_val
|| item->refine >= 10 // if it's no longer refineable
|| ditem->flag.no_refine // if the item isn't refinable
- || (i = iPc->search_inventory(sd, material [ditem->wlv])) < 0 )
+ || (i = pc->search_inventory(sd, material [ditem->wlv])) < 0 )
{
clif->skill_fail(sd,sd->menuskill_id,USESKILL_FAIL_LEVEL,0);
return;
@@ -14253,20 +14253,20 @@ void skill_weaponrefine (struct map_session_data *sd, int idx)
per = status_get_refine_chance(ditem->wlv, (int)item->refine);
per += (((signed int)sd->status.job_level)-50)/2; //Updated per the new kro descriptions. [Skotlex]
- iPc->delitem(sd, i, 1, 0, 0, LOG_TYPE_OTHER);
+ pc->delitem(sd, i, 1, 0, 0, LOG_TYPE_OTHER);
if (per > rnd() % 100) {
logs->pick_pc(sd, LOG_TYPE_OTHER, -1, item, ditem);
item->refine++;
logs->pick_pc(sd, LOG_TYPE_OTHER, 1, item, ditem);
if(item->equip) {
ep = item->equip;
- iPc->unequipitem(sd,idx,3);
+ pc->unequipitem(sd,idx,3);
}
clif->refine(sd->fd,0,idx,item->refine);
clif->delitem(sd,idx,1,3);
clif->additem(sd,idx,1,0);
if (ep)
- iPc->equipitem(sd,idx,ep);
+ pc->equipitem(sd,idx,ep);
clif->misceffect(&sd->bl,3);
if(item->refine == 10 &&
item->card[0] == CARD0_FORGE &&
@@ -14274,22 +14274,22 @@ void skill_weaponrefine (struct map_session_data *sd, int idx)
{ // Fame point system [DracoRPG]
switch(ditem->wlv){
case 1:
- iPc->addfame(sd,1); // Success to refine to +10 a lv1 weapon you forged = +1 fame point
+ pc->addfame(sd,1); // Success to refine to +10 a lv1 weapon you forged = +1 fame point
break;
case 2:
- iPc->addfame(sd,25); // Success to refine to +10 a lv2 weapon you forged = +25 fame point
+ pc->addfame(sd,25); // Success to refine to +10 a lv2 weapon you forged = +25 fame point
break;
case 3:
- iPc->addfame(sd,1000); // Success to refine to +10 a lv3 weapon you forged = +1000 fame point
+ pc->addfame(sd,1000); // Success to refine to +10 a lv3 weapon you forged = +1000 fame point
break;
}
}
} else {
item->refine = 0;
if(item->equip)
- iPc->unequipitem(sd,idx,3);
+ pc->unequipitem(sd,idx,3);
clif->refine(sd->fd,1,idx,item->refine);
- iPc->delitem(sd,idx,1,0,2, LOG_TYPE_OTHER);
+ pc->delitem(sd,idx,1,0,2, LOG_TYPE_OTHER);
clif->misceffect(&sd->bl,2);
clif->emotion(&sd->bl, E_OMG);
}
@@ -14308,7 +14308,7 @@ int skill_autospell (struct map_session_data *sd, uint16 skill_id)
nullpo_ret(sd);
skill_lv = sd->menuskill_val;
- lv=iPc->checkskill(sd,skill_id);
+ lv=pc->checkskill(sd,skill_id);
if(!skill_lv || !lv) return 0; // Player must learn the skill before doing auto-spell [Lance]
@@ -14351,10 +14351,10 @@ int skill_sit_count (struct block_list *bl, va_list ap) {
if(!pc_issit(sd))
return 0;
- if(type&1 && iPc->checkskill(sd,RG_GANGSTER) > 0)
+ if(type&1 && pc->checkskill(sd,RG_GANGSTER) > 0)
return 1;
- if(type&2 && (iPc->checkskill(sd,TK_HPTIME) > 0 || iPc->checkskill(sd,TK_SPTIME) > 0))
+ if(type&2 && (pc->checkskill(sd,TK_HPTIME) > 0 || pc->checkskill(sd,TK_SPTIME) > 0))
return 1;
return 0;
@@ -14369,10 +14369,10 @@ int skill_sit_in (struct block_list *bl, va_list ap) {
if(!pc_issit(sd))
return 0;
- if(type&1 && iPc->checkskill(sd,RG_GANGSTER) > 0)
+ if(type&1 && pc->checkskill(sd,RG_GANGSTER) > 0)
sd->state.gangsterparadise=1;
- if(type&2 && (iPc->checkskill(sd,TK_HPTIME) > 0 || iPc->checkskill(sd,TK_SPTIME) > 0 )) {
+ if(type&2 && (pc->checkskill(sd,TK_HPTIME) > 0 || pc->checkskill(sd,TK_SPTIME) > 0 )) {
sd->state.rest=1;
status_calc_regen(bl, &sd->battle_status, &sd->regen);
status_calc_regen_rate(bl, &sd->regen, &sd->sc);
@@ -14402,15 +14402,15 @@ int skill_sit (struct map_session_data *sd, int type)
nullpo_ret(sd);
- if((lv = iPc->checkskill(sd,RG_GANGSTER)) > 0) {
+ if((lv = pc->checkskill(sd,RG_GANGSTER)) > 0) {
flag|=1;
range = skill->get_splash(RG_GANGSTER, lv);
}
- if((lv = iPc->checkskill(sd,TK_HPTIME)) > 0) {
+ if((lv = pc->checkskill(sd,TK_HPTIME)) > 0) {
flag|=2;
range = skill->get_splash(TK_HPTIME, lv);
}
- else if ((lv = iPc->checkskill(sd,TK_SPTIME)) > 0) {
+ else if ((lv = pc->checkskill(sd,TK_SPTIME)) > 0) {
flag|=2;
range = skill->get_splash(TK_SPTIME, lv);
}
@@ -14613,7 +14613,7 @@ int skill_greed (struct block_list *bl, va_list ap) {
nullpo_ret(src = va_arg(ap, struct block_list *));
if(src->type == BL_PC && (sd=(struct map_session_data *)src) && bl->type==BL_ITEM && (fitem=(struct flooritem_data *)bl))
- iPc->takeitem(sd, fitem);
+ pc->takeitem(sd, fitem);
return 0;
}
@@ -15461,13 +15461,13 @@ int skill_unit_timer_sub(DBKey key, DBData *data, va_list ap) {
sd = iMap->charid2sd(group->val1);
group->val1 = 0;
if (sd && !map[sd->bl.m].flag.nowarp)
- iPc->setpos(sd,map_id2index(unit->bl.m),unit->bl.x,unit->bl.y,CLR_TELEPORT);
+ pc->setpos(sd,map_id2index(unit->bl.m),unit->bl.x,unit->bl.y,CLR_TELEPORT);
}
if(group->val2) {
sd = iMap->charid2sd(group->val2);
group->val2 = 0;
if (sd && !map[sd->bl.m].flag.nowarp)
- iPc->setpos(sd,map_id2index(unit->bl.m),unit->bl.x,unit->bl.y,CLR_TELEPORT);
+ pc->setpos(sd,map_id2index(unit->bl.m),unit->bl.x,unit->bl.y,CLR_TELEPORT);
}
skill->delunit(unit);
}
@@ -15829,7 +15829,7 @@ int skill_can_produce_mix (struct map_session_data *sd, int nameid, int trigger,
for(i=0;i<MAX_SKILL_PRODUCE_DB;i++){
if(skill_produce_db[i].nameid == nameid ){
if((j=skill_produce_db[i].req_skill)>0 &&
- iPc->checkskill(sd,j) < skill_produce_db[i].req_skill_lv)
+ pc->checkskill(sd,j) < skill_produce_db[i].req_skill_lv)
continue; // must iterate again to check other skills that produce it. [malufett]
if( j > 0 && sd->menuskill_id > 0 && sd->menuskill_id != j )
continue; // special case
@@ -15840,7 +15840,7 @@ int skill_can_produce_mix (struct map_session_data *sd, int nameid, int trigger,
if( i >= MAX_SKILL_PRODUCE_DB )
return 0;
- if( iPc->checkadditem(sd, nameid, qty) == ADDITEM_OVERAMOUNT )
+ if( pc->checkadditem(sd, nameid, qty) == ADDITEM_OVERAMOUNT )
{// cannot carry the produced stuff
return 0;
}
@@ -15863,7 +15863,7 @@ int skill_can_produce_mix (struct map_session_data *sd, int nameid, int trigger,
if( (id=skill_produce_db[i].mat_id[j]) <= 0 )
continue;
if(skill_produce_db[i].mat_amount[j] <= 0) {
- if(iPc->search_inventory(sd,id) < 0)
+ if(pc->search_inventory(sd,id) < 0)
return 0;
}
else {
@@ -15915,22 +15915,22 @@ int skill_produce_mix (struct map_session_data *sd, uint16 skill_id, int nameid,
int j;
if( slot[i]<=0 )
continue;
- j = iPc->search_inventory(sd,slot[i]);
+ j = pc->search_inventory(sd,slot[i]);
if(j < 0)
continue;
if(slot[i]==1000){ /* Star Crumb */
- iPc->delitem(sd,j,1,1,0,LOG_TYPE_PRODUCE);
+ pc->delitem(sd,j,1,1,0,LOG_TYPE_PRODUCE);
sc++;
}
if(slot[i]>=994 && slot[i]<=997 && ele==0){ /* Flame Heart . . . Great Nature */
static const int ele_table[4]={3,1,4,2};
- iPc->delitem(sd,j,1,1,0,LOG_TYPE_PRODUCE);
+ pc->delitem(sd,j,1,1,0,LOG_TYPE_PRODUCE);
ele=ele_table[slot[i]-994];
}
}
if( skill_id == RK_RUNEMASTERY ) {
- int temp_qty, skill_lv = iPc->checkskill(sd,skill_id);
+ int temp_qty, skill_lv = pc->checkskill(sd,skill_id);
data = itemdb_search(nameid);
if( skill_lv == 10 ) temp_qty = 1 + rnd()%3;
@@ -15965,12 +15965,12 @@ int skill_produce_mix (struct map_session_data *sd, uint16 skill_id, int nameid,
x=( skill_id == RK_RUNEMASTERY ? 1 : qty)*skill_produce_db[idx].mat_amount[i];
do{
int y=0;
- j = iPc->search_inventory(sd,id);
+ j = pc->search_inventory(sd,id);
if(j >= 0){
y = sd->status.inventory[j].amount;
if(y>x)y=x;
- iPc->delitem(sd,j,y,0,0,LOG_TYPE_PRODUCE);
+ pc->delitem(sd,j,y,0,0,LOG_TYPE_PRODUCE);
} else
ShowError("skill_produce_mix: material item error\n");
@@ -15986,7 +15986,7 @@ int skill_produce_mix (struct map_session_data *sd, uint16 skill_id, int nameid,
case BS_STEEL:
case BS_ENCHANTEDSTONE:
// Ores & Metals Refining - skill bonuses are straight from kRO website [DracoRPG]
- i = iPc->checkskill(sd,skill_id);
+ i = pc->checkskill(sd,skill_id);
make_per = sd->status.job_level*20 + status->dex*10 + status->luk*10; //Base chance
switch(nameid){
case 998: // Iron
@@ -16017,8 +16017,8 @@ int skill_produce_mix (struct map_session_data *sd, uint16 skill_id, int nameid,
case AM_TWILIGHT1:
case AM_TWILIGHT2:
case AM_TWILIGHT3:
- make_per = iPc->checkskill(sd,AM_LEARNINGPOTION)*50
- + iPc->checkskill(sd,AM_PHARMACY)*300 + sd->status.job_level*20
+ make_per = pc->checkskill(sd,AM_LEARNINGPOTION)*50
+ + pc->checkskill(sd,AM_PHARMACY)*300 + sd->status.job_level*20
+ (status->int_/2)*10 + status->dex*10+status->luk*10;
if(homun_alive(sd->hd)) {//Player got a homun
int skill;
@@ -16066,7 +16066,7 @@ int skill_produce_mix (struct map_session_data *sd, uint16 skill_id, int nameid,
**/
case RK_RUNEMASTERY:
{
- int A = 100 * (51 + 2 * iPc->checkskill(sd, skill_id));
+ int A = 100 * (51 + 2 * pc->checkskill(sd, skill_id));
int B = 100 * status->dex / 30 + 10 * (status->luk + sd->status.job_level);
int C = 100 * cap_value(sd->itemid,0,100); //itemid depend on makerune()
int D = 0;
@@ -16098,8 +16098,8 @@ int skill_produce_mix (struct map_session_data *sd, uint16 skill_id, int nameid,
* Guilotine Cross
**/
case GC_CREATENEWPOISON:
- make_per = 3000 + 500 * iPc->checkskill(sd,GC_RESEARCHNEWPOISON);
- qty = 1+rnd()%iPc->checkskill(sd,GC_RESEARCHNEWPOISON);
+ make_per = 3000 + 500 * pc->checkskill(sd,GC_RESEARCHNEWPOISON);
+ qty = 1+rnd()%pc->checkskill(sd,GC_RESEARCHNEWPOISON);
break;
case GN_CHANGEMATERIAL:
for(i=0; i<MAX_SKILL_PRODUCE_DB; i++)
@@ -16115,7 +16115,7 @@ int skill_produce_mix (struct map_session_data *sd, uint16 skill_id, int nameid,
difficulty = (620 - 20 * skill_lv);// (620 - 20 * Skill Level)
make_per = status->int_ + status->dex/2 + status->luk + sd->status.job_level + (30+rnd()%120) + // (Caster?s INT) + (Caster?s DEX / 2) + (Caster?s LUK) + (Caster?s Job Level) + Random number between (30 ~ 150) +
- (sd->status.base_level-100) + iPc->checkskill(sd, AM_LEARNINGPOTION) + iPc->checkskill(sd, CR_FULLPROTECTION)*(4+rnd()%6); // (Caster?s Base Level - 100) + (Potion Research x 5) + (Full Chemical Protection Skill Level) x (Random number between 4 ~ 10)
+ (sd->status.base_level-100) + pc->checkskill(sd, AM_LEARNINGPOTION) + pc->checkskill(sd, CR_FULLPROTECTION)*(4+rnd()%6); // (Caster?s Base Level - 100) + (Potion Research x 5) + (Full Chemical Protection Skill Level) x (Random number between 4 ~ 10)
switch(nameid){// difficulty factor
case 12422: case 12425:
@@ -16217,13 +16217,13 @@ int skill_produce_mix (struct map_session_data *sd, uint16 skill_id, int nameid,
}
} else { // Weapon Forging - skill bonuses are straight from kRO website, other things from a jRO calculator [DracoRPG]
make_per = 5000 + sd->status.job_level*20 + status->dex*10 + status->luk*10; // Base
- make_per += iPc->checkskill(sd,skill_id)*500; // Smithing skills bonus: +5/+10/+15
- make_per += iPc->checkskill(sd,BS_WEAPONRESEARCH)*100 +((wlv >= 3)? iPc->checkskill(sd,BS_ORIDEOCON)*100:0); // Weaponry Research bonus: +1/+2/+3/+4/+5/+6/+7/+8/+9/+10, Oridecon Research bonus (custom): +1/+2/+3/+4/+5
+ make_per += pc->checkskill(sd,skill_id)*500; // Smithing skills bonus: +5/+10/+15
+ make_per += pc->checkskill(sd,BS_WEAPONRESEARCH)*100 +((wlv >= 3)? pc->checkskill(sd,BS_ORIDEOCON)*100:0); // Weaponry Research bonus: +1/+2/+3/+4/+5/+6/+7/+8/+9/+10, Oridecon Research bonus (custom): +1/+2/+3/+4/+5
make_per -= (ele?2000:0) + sc*1500 + (wlv>1?wlv*1000:0); // Element Stone: -20%, Star Crumb: -15% each, Weapon level malus: -0/-20/-30
- if(iPc->search_inventory(sd,989) > 0) make_per+= 1000; // Emperium Anvil: +10
- else if(iPc->search_inventory(sd,988) > 0) make_per+= 500; // Golden Anvil: +5
- else if(iPc->search_inventory(sd,987) > 0) make_per+= 300; // Oridecon Anvil: +3
- else if(iPc->search_inventory(sd,986) > 0) make_per+= 0; // Anvil: +0?
+ if(pc->search_inventory(sd,989) > 0) make_per+= 1000; // Emperium Anvil: +10
+ else if(pc->search_inventory(sd,988) > 0) make_per+= 500; // Golden Anvil: +5
+ else if(pc->search_inventory(sd,987) > 0) make_per+= 300; // Oridecon Anvil: +3
+ else if(pc->search_inventory(sd,986) > 0) make_per+= 0; // Anvil: +0?
if(battle_config.wp_rate != 100)
make_per = make_per * battle_config.wp_rate / 100;
}
@@ -16293,7 +16293,7 @@ int skill_produce_mix (struct map_session_data *sd, uint16 skill_id, int nameid,
clif->produce_effect(sd,0,nameid);
clif->misceffect(&sd->bl,3);
if(itemdb_wlv(nameid) >= 3 && ((ele? 1 : 0) + sc) >= 3) // Fame point system [DracoRPG]
- iPc->addfame(sd,10); // Success to forge a lv3 weapon with 3 additional ingredients = +10 fame point
+ pc->addfame(sd,10); // Success to forge a lv3 weapon with 3 additional ingredients = +10 fame point
} else {
int fame = 0;
tmp_item.amount = 0;
@@ -16333,7 +16333,7 @@ int skill_produce_mix (struct map_session_data *sd, uint16 skill_id, int nameid,
}
if (fame)
- iPc->addfame(sd,fame);
+ pc->addfame(sd,fame);
//Visual effects and the like.
switch (skill_id) {
case AM_PHARMACY:
@@ -16372,7 +16372,7 @@ int skill_produce_mix (struct map_session_data *sd, uint16 skill_id, int nameid,
for(j=0; j<5; j++){
if( rnd()%1000 < skill_changematerial_db[i].qty_rate[j] ){
tmp_item.amount = qty * skill_changematerial_db[i].qty[j];
- if((flag = iPc->additem(sd,&tmp_item,tmp_item.amount,LOG_TYPE_PRODUCE))) {
+ if((flag = pc->additem(sd,&tmp_item,tmp_item.amount,LOG_TYPE_PRODUCE))) {
clif->additem(sd,0,0,flag);
iMap->addflooritem(&tmp_item,tmp_item.amount,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
@@ -16386,7 +16386,7 @@ int skill_produce_mix (struct map_session_data *sd, uint16 skill_id, int nameid,
return 1;
}
} else if (tmp_item.amount) { //Success
- if((flag = iPc->additem(sd,&tmp_item,tmp_item.amount,LOG_TYPE_PRODUCE))) {
+ if((flag = pc->additem(sd,&tmp_item,tmp_item.amount,LOG_TYPE_PRODUCE))) {
clif->additem(sd,0,0,flag);
iMap->addflooritem(&tmp_item,tmp_item.amount,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
@@ -16438,7 +16438,7 @@ int skill_produce_mix (struct map_session_data *sd, uint16 skill_id, int nameid,
tmp_item.nameid = compensation[i];
tmp_item.amount = qty;
tmp_item.identify = 1;
- if( iPc->additem(sd,&tmp_item,tmp_item.amount,LOG_TYPE_PRODUCE) ) {
+ if( pc->additem(sd,&tmp_item,tmp_item.amount,LOG_TYPE_PRODUCE) ) {
clif->additem(sd,0,0,flag);
iMap->addflooritem(&tmp_item,tmp_item.amount,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
@@ -16478,10 +16478,10 @@ int skill_arrow_create (struct map_session_data *sd, int nameid)
break;
}
- if(index < 0 || (j = iPc->search_inventory(sd,nameid)) < 0)
+ if(index < 0 || (j = pc->search_inventory(sd,nameid)) < 0)
return 1;
- iPc->delitem(sd,j,1,0,0,LOG_TYPE_PRODUCE);
+ pc->delitem(sd,j,1,0,0,LOG_TYPE_PRODUCE);
for(i=0;i<MAX_ARROW_RESOURCE;i++) {
memset(&tmp_item,0,sizeof(tmp_item));
tmp_item.identify = 1;
@@ -16495,7 +16495,7 @@ int skill_arrow_create (struct map_session_data *sd, int nameid)
}
if(tmp_item.nameid <= 0 || tmp_item.amount <= 0)
continue;
- if((flag = iPc->additem(sd,&tmp_item,tmp_item.amount,LOG_TYPE_PRODUCE))) {
+ if((flag = pc->additem(sd,&tmp_item,tmp_item.amount,LOG_TYPE_PRODUCE))) {
clif->additem(sd,0,0,flag);
iMap->addflooritem(&tmp_item,tmp_item.amount,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
@@ -16507,7 +16507,7 @@ int skill_poisoningweapon( struct map_session_data *sd, int nameid) {
sc_type type;
int chance, i;
nullpo_ret(sd);
- if( nameid <= 0 || (i = iPc->search_inventory(sd,nameid)) < 0 || iPc->delitem(sd,i,1,0,0,LOG_TYPE_CONSUME) ) {
+ if( nameid <= 0 || (i = pc->search_inventory(sd,nameid)) < 0 || pc->delitem(sd,i,1,0,0,LOG_TYPE_CONSUME) ) {
clif->skill_fail(sd,GC_POISONINGWEAPON,USESKILL_FAIL_LEVEL,0);
return 0;
}
@@ -16527,7 +16527,7 @@ int skill_poisoningweapon( struct map_session_data *sd, int nameid) {
}
chance = 2 + 2 * sd->menuskill_val; // 2 + 2 * skill_lv
- sc_start4(&sd->bl, SC_POISONINGWEAPON, 100, iPc->checkskill(sd, GC_RESEARCHNEWPOISON), //in Aegis it store the level of GC_RESEARCHNEWPOISON in val1
+ sc_start4(&sd->bl, SC_POISONINGWEAPON, 100, pc->checkskill(sd, GC_RESEARCHNEWPOISON), //in Aegis it store the level of GC_RESEARCHNEWPOISON in val1
type, chance, 0, skill->get_time(GC_POISONINGWEAPON, sd->menuskill_val));
return 0;
@@ -16563,14 +16563,14 @@ int skill_magicdecoy(struct map_session_data *sd, int nameid) {
nullpo_ret(sd);
skill_id = sd->menuskill_val;
- if( nameid <= 0 || !itemdb_is_element(nameid) || (i = iPc->search_inventory(sd,nameid)) < 0 || !skill_id || iPc->delitem(sd,i,1,0,0,LOG_TYPE_CONSUME) )
+ if( nameid <= 0 || !itemdb_is_element(nameid) || (i = pc->search_inventory(sd,nameid)) < 0 || !skill_id || pc->delitem(sd,i,1,0,0,LOG_TYPE_CONSUME) )
{
clif->skill_fail(sd,NC_MAGICDECOY,USESKILL_FAIL_LEVEL,0);
return 0;
}
// Spawn Position
- iPc->delitem(sd,i,1,0,0,LOG_TYPE_CONSUME);
+ pc->delitem(sd,i,1,0,0,LOG_TYPE_CONSUME);
x = sd->sc.comet_x;
y = sd->sc.comet_y;
sd->sc.comet_x = sd->sc.comet_y = 0;
@@ -16613,14 +16613,14 @@ int skill_spellbook (struct map_session_data *sd, int nameid) {
ARR_FIND(0,MAX_SKILL_SPELLBOOK_DB,i,skill_spellbook_db[i].nameid == nameid); // Search for information of this item
if( i == MAX_SKILL_SPELLBOOK_DB ) return 0;
- if( !iPc->checkskill(sd, (skill_id = skill_spellbook_db[i].skill_id)) )
+ if( !pc->checkskill(sd, (skill_id = skill_spellbook_db[i].skill_id)) )
{ // User don't know the skill
- sc_start(&sd->bl, SC_SLEEP, 100, 1, skill->get_time(WL_READING_SB, iPc->checkskill(sd,WL_READING_SB)));
+ sc_start(&sd->bl, SC_SLEEP, 100, 1, skill->get_time(WL_READING_SB, pc->checkskill(sd,WL_READING_SB)));
clif->skill_fail(sd, WL_READING_SB, USESKILL_FAIL_SPELLBOOK_DIFFICULT_SLEEP, 0);
return 0;
}
- max_preserve = 4 * iPc->checkskill(sd, WL_FREEZE_SP) + status_get_int(&sd->bl) / 10 + sd->status.base_level / 10;
+ max_preserve = 4 * pc->checkskill(sd, WL_FREEZE_SP) + status_get_int(&sd->bl) / 10 + sd->status.base_level / 10;
point = skill_spellbook_db[i].point;
if( sc && sc->data[SC_READING_SB] ) {
@@ -16631,13 +16631,13 @@ int skill_spellbook (struct map_session_data *sd, int nameid) {
for(i = SC_MAXSPELLBOOK; i >= SC_SPELLBOOK1; i--){ // This is how official saves spellbook. [malufett]
if( !sc->data[i] ){
sc->data[SC_READING_SB]->val2 += point; // increase points
- sc_start4(&sd->bl, (sc_type)i, 100, skill_id, iPc->checkskill(sd,skill_id), point, 0, INVALID_TIMER);
+ sc_start4(&sd->bl, (sc_type)i, 100, skill_id, pc->checkskill(sd,skill_id), point, 0, INVALID_TIMER);
break;
}
}
}else{
sc_start2(&sd->bl, SC_READING_SB, 100, 0, point, INVALID_TIMER);
- sc_start4(&sd->bl, SC_MAXSPELLBOOK, 100, skill_id, iPc->checkskill(sd,skill_id), point, 0, INVALID_TIMER);
+ sc_start4(&sd->bl, SC_MAXSPELLBOOK, 100, skill_id, pc->checkskill(sd,skill_id), point, 0, INVALID_TIMER);
}
return 1;
@@ -16706,7 +16706,7 @@ int skill_elementalanalysis(struct map_session_data* sd, int n, uint16 skill_lv,
return 1;
}
- if( iPc->delitem(sd,idx,del_amount,0,1,LOG_TYPE_CONSUME) ) {
+ if( pc->delitem(sd,idx,del_amount,0,1,LOG_TYPE_CONSUME) ) {
clif->skill_fail(sd,SO_EL_ANALYSIS,USESKILL_FAIL_LEVEL,0);
return 1;
}
@@ -16723,7 +16723,7 @@ int skill_elementalanalysis(struct map_session_data* sd, int n, uint16 skill_lv,
tmp_item.identify = 1;
if( tmp_item.amount ) {
- if( (flag = iPc->additem(sd,&tmp_item,tmp_item.amount,LOG_TYPE_CONSUME)) ) {
+ if( (flag = pc->additem(sd,&tmp_item,tmp_item.amount,LOG_TYPE_CONSUME)) ) {
clif->additem(sd,0,0,flag);
iMap->addflooritem(&tmp_item,tmp_item.amount,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
diff --git a/src/map/status.c b/src/map/status.c
index 09350fff0..faee88e28 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -1199,7 +1199,7 @@ int status_damage(struct block_list *src,struct block_list *target,int hp, int s
}
switch (target->type) {
- case BL_PC: iPc->damage((TBL_PC*)target,src,hp,sp); break;
+ case BL_PC: pc->damage((TBL_PC*)target,src,hp,sp); break;
case BL_MOB: mob_damage((TBL_MOB*)target, src, hp); break;
case BL_HOM: homun->damaged((TBL_HOM*)target); break;
case BL_MER: mercenary_heal((TBL_MER*)target,hp,sp); break;
@@ -1224,7 +1224,7 @@ int status_damage(struct block_list *src,struct block_list *target,int hp, int s
//&2: Also remove object from map.
//&4: Also delete object from memory.
switch (target->type) {
- case BL_PC: flag = iPc->dead((TBL_PC*)target,src); break;
+ case BL_PC: flag = pc->dead((TBL_PC*)target,src); break;
case BL_MOB: flag = mob_dead((TBL_MOB*)target, src, flag&4?3:0); break;
case BL_HOM: flag = homun->dead((TBL_HOM*)target); break;
case BL_MER: flag = mercenary_dead((TBL_MER*)target); break;
@@ -1370,7 +1370,7 @@ int status_heal(struct block_list *bl,int hp,int sp, int flag)
// send hp update to client
switch(bl->type) {
- case BL_PC: iPc->heal((TBL_PC*)bl,hp,sp,flag&2?1:0); break;
+ case BL_PC: pc->heal((TBL_PC*)bl,hp,sp,flag&2?1:0); break;
case BL_MOB: mob_heal((TBL_MOB*)bl,hp); break;
case BL_HOM: homun->healed((TBL_HOM*)bl); break;
case BL_MER: mercenary_heal((TBL_MER*)bl,hp,sp); break;
@@ -1474,7 +1474,7 @@ int status_revive(struct block_list *bl, unsigned char per_hp, unsigned char per
if (bl->prev) //Animation only if character is already on a map.
clif->resurrection(bl, 1);
switch (bl->type) {
- case BL_PC: iPc->revive((TBL_PC*)bl, hp, sp); break;
+ case BL_PC: pc->revive((TBL_PC*)bl, hp, sp); break;
case BL_MOB: mob_revive((TBL_MOB*)bl, hp); break;
case BL_HOM: homun->revive((TBL_HOM*)bl, hp, sp); break;
}
@@ -1597,7 +1597,7 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, uin
if (sc->data[SC_DANCING] && flag!=2) {
if( src->type == BL_PC && skill_id >= WA_SWING_DANCE && skill_id <= WM_UNLIMITED_HUMMING_VOICE )
{ // Lvl 5 Lesson or higher allow you use 3rd job skills while dancing.v
- if( iPc->checkskill((TBL_PC*)src,WM_LESSON) < 5 )
+ if( pc->checkskill((TBL_PC*)src,WM_LESSON) < 5 )
return 0;
} else if(sc->data[SC_LONGING]) { //Allow everything except dancing/re-dancing. [Skotlex]
if (skill_id == BD_ENCORE ||
@@ -1813,21 +1813,21 @@ int status_base_amotion_pc(struct map_session_data* sd, struct status_data* stat
}
amotion = ( sd->status.weapon < MAX_WEAPON_TYPE && mod < 0 )
- ? (aspd_base[iPc->class2idx(sd->status.class_)][sd->status.weapon]) // single weapon
- : ((aspd_base[iPc->class2idx(sd->status.class_)][sd->weapontype2] // dual-wield
- + aspd_base[iPc->class2idx(sd->status.class_)][sd->weapontype2]) * 6 / 10 + 10 * mod
- - aspd_base[iPc->class2idx(sd->status.class_)][sd->weapontype2]
- + aspd_base[iPc->class2idx(sd->status.class_)][sd->weapontype1]);
+ ? (aspd_base[pc->class2idx(sd->status.class_)][sd->status.weapon]) // single weapon
+ : ((aspd_base[pc->class2idx(sd->status.class_)][sd->weapontype2] // dual-wield
+ + aspd_base[pc->class2idx(sd->status.class_)][sd->weapontype2]) * 6 / 10 + 10 * mod
+ - aspd_base[pc->class2idx(sd->status.class_)][sd->weapontype2]
+ + aspd_base[pc->class2idx(sd->status.class_)][sd->weapontype1]);
if ( sd->status.shield )
- amotion += ( 2000 - aspd_base[iPc->class2idx(sd->status.class_)][W_FIST] ) +
- ( aspd_base[iPc->class2idx(sd->status.class_)][MAX_WEAPON_TYPE] - 2000 );
+ amotion += ( 2000 - aspd_base[pc->class2idx(sd->status.class_)][W_FIST] ) +
+ ( aspd_base[pc->class2idx(sd->status.class_)][MAX_WEAPON_TYPE] - 2000 );
#else
// base weapon delay
amotion = (sd->status.weapon < MAX_WEAPON_TYPE)
- ? (aspd_base[iPc->class2idx(sd->status.class_)][sd->status.weapon]) // single weapon
- : (aspd_base[iPc->class2idx(sd->status.class_)][sd->weapontype1] + aspd_base[iPc->class2idx(sd->status.class_)][sd->weapontype2])*7/10; // dual-wield
+ ? (aspd_base[pc->class2idx(sd->status.class_)][sd->status.weapon]) // single weapon
+ : (aspd_base[pc->class2idx(sd->status.class_)][sd->weapontype1] + aspd_base[pc->class2idx(sd->status.class_)][sd->weapontype2])*7/10; // dual-wield
// percentual delay reduction from stats
amotion -= amotion * (4*status->agi + status->dex)/1000;
@@ -2222,12 +2222,12 @@ static void status_calc_sigma(void)
/// f(x) = 35 + x*(A + B*C/D) + sum(i=2..x){ i*C/D }
static unsigned int status_base_pc_maxhp(struct map_session_data* sd, struct status_data* status)
{
- uint64 val = iPc->class2idx(sd->status.class_);
+ uint64 val = pc->class2idx(sd->status.class_);
val = 35 + sd->status.base_level*(int64)hp_coefficient2[val]/100 + hp_sigma_val[val][sd->status.base_level];
if((sd->class_&MAPID_UPPERMASK) == MAPID_NINJA || (sd->class_&MAPID_UPPERMASK) == MAPID_GUNSLINGER)
val += 100; //Since their HP can't be approximated well enough without this.
- if((sd->class_&MAPID_UPPERMASK) == MAPID_TAEKWON && sd->status.base_level >= 90 && iPc->famerank(sd->status.char_id, MAPID_TAEKWON))
+ if((sd->class_&MAPID_UPPERMASK) == MAPID_TAEKWON && sd->status.base_level >= 90 && pc->famerank(sd->status.char_id, MAPID_TAEKWON))
val *= 3; //Triple max HP for top ranking Taekwons over level 90.
if((sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE && sd->status.base_level >= 99)
val += 2000; //Supernovice lvl99 hp bonus.
@@ -2245,14 +2245,14 @@ static unsigned int status_base_pc_maxsp(struct map_session_data* sd, struct sta
{
uint64 val;
- val = 10 + sd->status.base_level*(int64)sp_coefficient[iPc->class2idx(sd->status.class_)]/100;
+ val = 10 + sd->status.base_level*(int64)sp_coefficient[pc->class2idx(sd->status.class_)]/100;
val += val * status->int_/100;
if (sd->class_&JOBL_UPPER)
val += val * 25/100;
else if (sd->class_&JOBL_BABY)
val -= val * 30/100;
- if ((sd->class_&MAPID_UPPERMASK) == MAPID_TAEKWON && sd->status.base_level >= 90 && iPc->famerank(sd->status.char_id, MAPID_TAEKWON))
+ if ((sd->class_&MAPID_UPPERMASK) == MAPID_TAEKWON && sd->status.base_level >= 90 && pc->famerank(sd->status.char_id, MAPID_TAEKWON))
val *= 3; //Triple max SP for top ranking Taekwons over level 90.
return (unsigned int)val;
@@ -2279,9 +2279,9 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
b_max_weight = sd->max_weight;
b_cart_weight_max = sd->cart_weight_max;
- iPc->calc_skilltree(sd); // SkillTree calculation
+ pc->calc_skilltree(sd); // SkillTree calculation
- sd->max_weight = max_weight_base[iPc->class2idx(sd->status.class_)]+sd->status.str*300;
+ sd->max_weight = max_weight_base[pc->class2idx(sd->status.class_)]+sd->status.str*300;
if(first) {
//Load Hp/SP from char-received data.
@@ -2410,9 +2410,9 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
memset (&sd->bonus, 0,sizeof(sd->bonus));
// Autobonus
- iPc->delautobonus(sd,sd->autobonus,ARRAYLENGTH(sd->autobonus),true);
- iPc->delautobonus(sd,sd->autobonus2,ARRAYLENGTH(sd->autobonus2),true);
- iPc->delautobonus(sd,sd->autobonus3,ARRAYLENGTH(sd->autobonus3),true);
+ pc->delautobonus(sd,sd->autobonus,ARRAYLENGTH(sd->autobonus),true);
+ pc->delautobonus(sd,sd->autobonus2,ARRAYLENGTH(sd->autobonus2),true);
+ pc->delautobonus(sd,sd->autobonus3,ARRAYLENGTH(sd->autobonus3),true);
// Parse equipment.
for(i=0;i<EQI_MAX-1;i++) {
@@ -2498,7 +2498,7 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
{ // Forged weapon
wd->star += (sd->status.inventory[index].card[1]>>8);
if(wd->star >= 15) wd->star = 40; // 3 Star Crumbs now give +40 dmg
- if(iPc->famerank(MakeDWord(sd->status.inventory[index].card[2],sd->status.inventory[index].card[3]) ,MAPID_BLACKSMITH))
+ if(pc->famerank(MakeDWord(sd->status.inventory[index].card[2],sd->status.inventory[index].card[3]) ,MAPID_BLACKSMITH))
wd->star += 10;
if (!wa->ele) //Do not overwrite element from previous bonuses.
@@ -2617,7 +2617,7 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
if( pd && pd->petDB && pd->petDB->equip_script && pd->pet.intimate >= battle_config.pet_equip_min_friendly )
run_script(pd->petDB->equip_script,0,sd->bl.id,0);
if( pd && pd->pet.intimate > 0 && (!battle_config.pet_equip_required || pd->pet.equip > 0) && pd->state.skillbonus == 1 && pd->bonus )
- iPc->bonus(sd,pd->bonus->type, pd->bonus->val);
+ pc->bonus(sd,pd->bonus->type, pd->bonus->val);
}
//param_bonus now holds card bonuses.
@@ -2649,7 +2649,7 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
// ----- STATS CALCULATION -----
// Job bonuses
- index = iPc->class2idx(sd->status.class_);
+ index = pc->class2idx(sd->status.class_);
for(i=0;i<(int)sd->status.job_level && i<MAX_LEVEL;i++){
if(!job_bonus[index][i])
continue;
@@ -2674,13 +2674,13 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
}
// Absolute modifiers from passive skills
- if(iPc->checkskill(sd,BS_HILTBINDING)>0)
+ if(pc->checkskill(sd,BS_HILTBINDING)>0)
status->str++;
- if((skill=iPc->checkskill(sd,SA_DRAGONOLOGY))>0)
+ if((skill=pc->checkskill(sd,SA_DRAGONOLOGY))>0)
status->int_ += (skill+1)/2; // +1 INT / 2 lv
- if((skill=iPc->checkskill(sd,AC_OWL))>0)
+ if((skill=pc->checkskill(sd,AC_OWL))>0)
status->dex += skill;
- if((skill = iPc->checkskill(sd,RA_RESEARCHTRAP))>0)
+ if((skill = pc->checkskill(sd,RA_RESEARCHTRAP))>0)
status->int_ += skill;
// Bonuses from cards and equipment as well as base stat, remember to avoid overflows.
@@ -2704,7 +2704,7 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
if (sd->status.weapon < MAX_WEAPON_TYPE && sd->weapon_atk[sd->status.weapon])
status->batk += sd->weapon_atk[sd->status.weapon];
// Absolute modifiers from passive skills
- if((skill=iPc->checkskill(sd,BS_HILTBINDING))>0)
+ if((skill=pc->checkskill(sd,BS_HILTBINDING))>0)
status->batk += 4;
// ----- HP MAX CALCULATION -----
@@ -2717,7 +2717,7 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
status->max_hp = (unsigned int)cap_value(i64, 0, INT_MAX);
// Absolute modifiers from passive skills
- if((skill=iPc->checkskill(sd,CR_TRUST))>0)
+ if((skill=pc->checkskill(sd,CR_TRUST))>0)
status->max_hp += skill*200;
// Apply relative modifiers from equipment
@@ -2742,15 +2742,15 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
status->max_sp = (unsigned int)cap_value(i64, 0, INT_MAX);
// Absolute modifiers from passive skills
- if((skill=iPc->checkskill(sd,SL_KAINA))>0)
+ if((skill=pc->checkskill(sd,SL_KAINA))>0)
status->max_sp += 30*skill;
- if((skill=iPc->checkskill(sd,HP_MEDITATIO))>0)
+ if((skill=pc->checkskill(sd,HP_MEDITATIO))>0)
status->max_sp += (int64)status->max_sp * skill/100;
- if((skill=iPc->checkskill(sd,HW_SOULDRAIN))>0)
+ if((skill=pc->checkskill(sd,HW_SOULDRAIN))>0)
status->max_sp += (int64)status->max_sp * 2*skill/100;
- if( (skill = iPc->checkskill(sd,RA_RESEARCHTRAP)) > 0 )
+ if( (skill = pc->checkskill(sd,RA_RESEARCHTRAP)) > 0 )
status->max_sp += 200 + 20 * skill;
- if( (skill = iPc->checkskill(sd,WM_LESSON)) > 0 )
+ if( (skill = pc->checkskill(sd,WM_LESSON)) > 0 )
status->max_sp += 30 * skill;
@@ -2834,9 +2834,9 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
// ----- HIT CALCULATION -----
// Absolute modifiers from passive skills
- if((skill=iPc->checkskill(sd,BS_WEAPONRESEARCH))>0)
+ if((skill=pc->checkskill(sd,BS_WEAPONRESEARCH))>0)
status->hit += skill*2;
- if((skill=iPc->checkskill(sd,AC_VULTURE))>0){
+ if((skill=pc->checkskill(sd,AC_VULTURE))>0){
#ifndef RENEWAL
status->hit += skill;
#endif
@@ -2845,9 +2845,9 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
}
if(sd->status.weapon >= W_REVOLVER && sd->status.weapon <= W_GRENADE)
{
- if((skill=iPc->checkskill(sd,GS_SINGLEACTION))>0)
+ if((skill=pc->checkskill(sd,GS_SINGLEACTION))>0)
status->hit += 2*skill;
- if((skill=iPc->checkskill(sd,GS_SNAKEEYE))>0) {
+ if((skill=pc->checkskill(sd,GS_SNAKEEYE))>0) {
status->hit += skill;
status->rhw.range += skill;
}
@@ -2856,9 +2856,9 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
// ----- FLEE CALCULATION -----
// Absolute modifiers from passive skills
- if((skill=iPc->checkskill(sd,TF_MISS))>0)
+ if((skill=pc->checkskill(sd,TF_MISS))>0)
status->flee += skill*(sd->class_&JOBL_2 && (sd->class_&MAPID_BASEMASK) == MAPID_THIEF? 4 : 3);
- if((skill=iPc->checkskill(sd,MO_DODGE))>0)
+ if((skill=pc->checkskill(sd,MO_DODGE))>0)
status->flee += (skill*3)>>1;
// ----- EQUIPMENT-DEF CALCULATION -----
@@ -2905,29 +2905,29 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
// Relative modifiers from passive skills
#ifndef RENEWAL_ASPD
- if((skill=iPc->checkskill(sd,SA_ADVANCEDBOOK))>0 && sd->status.weapon == W_BOOK)
+ if((skill=pc->checkskill(sd,SA_ADVANCEDBOOK))>0 && sd->status.weapon == W_BOOK)
status->aspd_rate -= 5*skill;
- if((skill = iPc->checkskill(sd,SG_DEVIL)) > 0 && !iPc->nextjobexp(sd))
+ if((skill = pc->checkskill(sd,SG_DEVIL)) > 0 && !pc->nextjobexp(sd))
status->aspd_rate -= 30*skill;
- if((skill=iPc->checkskill(sd,GS_SINGLEACTION))>0 &&
+ if((skill=pc->checkskill(sd,GS_SINGLEACTION))>0 &&
(sd->status.weapon >= W_REVOLVER && sd->status.weapon <= W_GRENADE))
status->aspd_rate -= ((skill+1)/2) * 10;
if(pc_isriding(sd))
- status->aspd_rate += 500-100*iPc->checkskill(sd,KN_CAVALIERMASTERY);
+ status->aspd_rate += 500-100*pc->checkskill(sd,KN_CAVALIERMASTERY);
else if(pc_isridingdragon(sd))
- status->aspd_rate += 250-50*iPc->checkskill(sd,RK_DRAGONTRAINING);
+ status->aspd_rate += 250-50*pc->checkskill(sd,RK_DRAGONTRAINING);
#else // needs more info
- if((skill=iPc->checkskill(sd,SA_ADVANCEDBOOK))>0 && sd->status.weapon == W_BOOK)
+ if((skill=pc->checkskill(sd,SA_ADVANCEDBOOK))>0 && sd->status.weapon == W_BOOK)
status->aspd_rate += 5*skill;
- if((skill = iPc->checkskill(sd,SG_DEVIL)) > 0 && !iPc->nextjobexp(sd))
+ if((skill = pc->checkskill(sd,SG_DEVIL)) > 0 && !pc->nextjobexp(sd))
status->aspd_rate += 30*skill;
- if((skill=iPc->checkskill(sd,GS_SINGLEACTION))>0 &&
+ if((skill=pc->checkskill(sd,GS_SINGLEACTION))>0 &&
(sd->status.weapon >= W_REVOLVER && sd->status.weapon <= W_GRENADE))
status->aspd_rate += ((skill+1)/2) * 10;
if(pc_isriding(sd))
- status->aspd_rate -= 500-100*iPc->checkskill(sd,KN_CAVALIERMASTERY);
+ status->aspd_rate -= 500-100*pc->checkskill(sd,KN_CAVALIERMASTERY);
else if(pc_isridingdragon(sd))
- status->aspd_rate -= 250-50*iPc->checkskill(sd,RK_DRAGONTRAINING);
+ status->aspd_rate -= 250-50*pc->checkskill(sd,RK_DRAGONTRAINING);
#endif
status->adelay = 2*status->amotion;
@@ -2942,26 +2942,26 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
// ----- MISC CALCULATIONS -----
// Weight
- if((skill=iPc->checkskill(sd,MC_INCCARRY))>0)
+ if((skill=pc->checkskill(sd,MC_INCCARRY))>0)
sd->max_weight += 2000*skill;
- if(pc_isriding(sd) && iPc->checkskill(sd,KN_RIDING)>0)
+ if(pc_isriding(sd) && pc->checkskill(sd,KN_RIDING)>0)
sd->max_weight += 10000;
else if(pc_isridingdragon(sd))
- sd->max_weight += 5000+2000*iPc->checkskill(sd,RK_DRAGONTRAINING);
+ sd->max_weight += 5000+2000*pc->checkskill(sd,RK_DRAGONTRAINING);
if(sc->data[SC_KNOWLEDGE])
sd->max_weight += sd->max_weight*sc->data[SC_KNOWLEDGE]->val1/10;
- if((skill=iPc->checkskill(sd,ALL_INCCARRY))>0)
+ if((skill=pc->checkskill(sd,ALL_INCCARRY))>0)
sd->max_weight += 2000*skill;
- sd->cart_weight_max = battle_config.max_cart_weight + (iPc->checkskill(sd, GN_REMODELING_CART)*5000);
+ sd->cart_weight_max = battle_config.max_cart_weight + (pc->checkskill(sd, GN_REMODELING_CART)*5000);
- if (iPc->checkskill(sd,SM_MOVINGRECOVERY)>0)
+ if (pc->checkskill(sd,SM_MOVINGRECOVERY)>0)
sd->regen.state.walk = 1;
else
sd->regen.state.walk = 0;
// Skill SP cost
- if((skill=iPc->checkskill(sd,HP_MANARECHARGE))>0 )
+ if((skill=pc->checkskill(sd,HP_MANARECHARGE))>0 )
sd->dsprate -= 4*skill;
if(sc->data[SC_SERVICE4U])
@@ -2983,17 +2983,17 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
sd->sprecov_rate = 0;
// Anti-element and anti-race
- if((skill=iPc->checkskill(sd,CR_TRUST))>0)
+ if((skill=pc->checkskill(sd,CR_TRUST))>0)
sd->subele[ELE_HOLY] += skill*5;
- if((skill=iPc->checkskill(sd,BS_SKINTEMPER))>0) {
+ if((skill=pc->checkskill(sd,BS_SKINTEMPER))>0) {
sd->subele[ELE_NEUTRAL] += skill;
sd->subele[ELE_FIRE] += skill*4;
}
- if((skill=iPc->checkskill(sd,NC_RESEARCHFE))>0) {
+ if((skill=pc->checkskill(sd,NC_RESEARCHFE))>0) {
sd->subele[ELE_EARTH] += skill*10;
sd->subele[ELE_FIRE] += skill*10;
}
- if((skill=iPc->checkskill(sd,SA_DRAGONOLOGY))>0 ){
+ if((skill=pc->checkskill(sd,SA_DRAGONOLOGY))>0 ){
skill = skill*4;
sd->right_weapon.addrace[RC_DRAGON]+=skill;
sd->left_weapon.addrace[RC_DRAGON]+=skill;
@@ -3077,7 +3077,7 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
clif->updatestatus(sd,SP_WEIGHT);
if(b_max_weight != sd->max_weight) {
clif->updatestatus(sd,SP_MAXWEIGHT);
- iPc->updateweightstatus(sd);
+ pc->updateweightstatus(sd);
}
if( b_cart_weight_max != sd->cart_weight_max ) {
clif->updatestatus(sd,SP_CARTINFO);
@@ -3324,7 +3324,7 @@ void status_calc_regen(struct block_list *bl, struct status_data *status, struct
if( sd )
{
struct regen_data_sub *sregen;
- if( (skill=iPc->checkskill(sd,HP_MEDITATIO)) > 0 )
+ if( (skill=pc->checkskill(sd,HP_MEDITATIO)) > 0 )
{
val = regen->sp*(100+3*skill)/100;
regen->sp = cap_value(val, 1, SHRT_MAX);
@@ -3333,16 +3333,16 @@ void status_calc_regen(struct block_list *bl, struct status_data *status, struct
sregen = regen->sregen;
val = 0;
- if( (skill=iPc->checkskill(sd,SM_RECOVERY)) > 0 )
+ if( (skill=pc->checkskill(sd,SM_RECOVERY)) > 0 )
val += skill*5 + skill*status->max_hp/500;
sregen->hp = cap_value(val, 0, SHRT_MAX);
val = 0;
- if( (skill=iPc->checkskill(sd,MG_SRECOVERY)) > 0 )
+ if( (skill=pc->checkskill(sd,MG_SRECOVERY)) > 0 )
val += skill*3 + skill*status->max_sp/500;
- if( (skill=iPc->checkskill(sd,NJ_NINPOU)) > 0 )
+ if( (skill=pc->checkskill(sd,NJ_NINPOU)) > 0 )
val += skill*3 + skill*status->max_sp/500;
- if( (skill=iPc->checkskill(sd,WM_LESSON)) > 0 )
+ if( (skill=pc->checkskill(sd,WM_LESSON)) > 0 )
val += 3 + 3 * skill;
sregen->sp = cap_value(val, 0, SHRT_MAX);
@@ -3351,21 +3351,21 @@ void status_calc_regen(struct block_list *bl, struct status_data *status, struct
sregen = regen->ssregen;
val = 0;
- if( (skill=iPc->checkskill(sd,MO_SPIRITSRECOVERY)) > 0 )
+ if( (skill=pc->checkskill(sd,MO_SPIRITSRECOVERY)) > 0 )
val += skill*4 + skill*status->max_hp/500;
- if( (skill=iPc->checkskill(sd,TK_HPTIME)) > 0 && sd->state.rest )
+ if( (skill=pc->checkskill(sd,TK_HPTIME)) > 0 && sd->state.rest )
val += skill*30 + skill*status->max_hp/500;
sregen->hp = cap_value(val, 0, SHRT_MAX);
val = 0;
- if( (skill=iPc->checkskill(sd,TK_SPTIME)) > 0 && sd->state.rest )
+ if( (skill=pc->checkskill(sd,TK_SPTIME)) > 0 && sd->state.rest )
{
val += skill*3 + skill*status->max_sp/500;
- if ((skill=iPc->checkskill(sd,SL_KAINA)) > 0) //Power up Enjoyable Rest
+ if ((skill=pc->checkskill(sd,SL_KAINA)) > 0) //Power up Enjoyable Rest
val += (30+10*skill)*val/100;
}
- if( (skill=iPc->checkskill(sd,MO_SPIRITSRECOVERY)) > 0 )
+ if( (skill=pc->checkskill(sd,MO_SPIRITSRECOVERY)) > 0 )
val += skill*2 + skill*status->max_sp/500;
sregen->sp = cap_value(val, 0, SHRT_MAX);
}
@@ -5015,12 +5015,12 @@ static unsigned short status_calc_speed(struct block_list *bl, struct status_cha
if (sd && sd->state.permanent_speed)
return (short)cap_value(speed,10,USHRT_MAX);
- if( sd && sd->ud.skilltimer != INVALID_TIMER && (iPc->checkskill(sd,SA_FREECAST) > 0 || sd->ud.skill_id == LG_EXEEDBREAK) )
+ if( sd && sd->ud.skilltimer != INVALID_TIMER && (pc->checkskill(sd,SA_FREECAST) > 0 || sd->ud.skill_id == LG_EXEEDBREAK) )
{
if( sd->ud.skill_id == LG_EXEEDBREAK )
speed_rate = 100 + 60 - (sd->ud.skill_lv * 10);
else
- speed_rate = 175 - 5 * iPc->checkskill(sd,SA_FREECAST);
+ speed_rate = 175 - 5 * pc->checkskill(sd,SA_FREECAST);
}
else
{
@@ -5036,9 +5036,9 @@ static unsigned short status_calc_speed(struct block_list *bl, struct status_cha
if( pc_isriding(sd) || sd->sc.option&(OPTION_DRAGON) || sd->sc.data[SC_ALL_RIDING] )
val = 25;//Same bonus
else if( pc_isridingwug(sd) )
- val = 15 + 5 * iPc->checkskill(sd, RA_WUGRIDER);
+ val = 15 + 5 * pc->checkskill(sd, RA_WUGRIDER);
else if( pc_ismadogear(sd) ) {
- val = (- 10 * (5 - iPc->checkskill(sd,NC_MADOLICENCE)));
+ val = (- 10 * (5 - pc->checkskill(sd,NC_MADOLICENCE)));
if( sc->data[SC_ACCELERATION] )
val += 25;
}
@@ -5051,8 +5051,8 @@ static unsigned short status_calc_speed(struct block_list *bl, struct status_cha
{
int val = 0;
- if( sd && sc->data[SC_HIDING] && iPc->checkskill(sd,RG_TUNNELDRIVE) > 0 )
- val = 120 - 6 * iPc->checkskill(sd,RG_TUNNELDRIVE);
+ if( sd && sc->data[SC_HIDING] && pc->checkskill(sd,RG_TUNNELDRIVE) > 0 )
+ val = 120 - 6 * pc->checkskill(sd,RG_TUNNELDRIVE);
else
if( sd && sc->data[SC_CHASEWALK] && sc->data[SC_CHASEWALK]->val3 < 0 )
val = sc->data[SC_CHASEWALK]->val3;
@@ -5063,7 +5063,7 @@ static unsigned short status_calc_speed(struct block_list *bl, struct status_cha
val = max( val, 50 - 10 * sc->data[SC_LONGING]->val1 );
else
if( sd && sc->data[SC_DANCING] )
- val = max( val, 500 - (40 + 10 * (sc->data[SC_SPIRIT] && sc->data[SC_SPIRIT]->val2 == SL_BARDDANCER)) * iPc->checkskill(sd,(sd->status.sex?BA_MUSICALLESSON:DC_DANCINGLESSON)) );
+ val = max( val, 500 - (40 + 10 * (sc->data[SC_SPIRIT] && sc->data[SC_SPIRIT]->val2 == SL_BARDDANCER)) * pc->checkskill(sd,(sd->status.sex?BA_MUSICALLESSON:DC_DANCINGLESSON)) );
if( sc->data[SC_DECREASEAGI] )
val = max( val, 25 );
@@ -5129,8 +5129,8 @@ static unsigned short status_calc_speed(struct block_list *bl, struct status_cha
val = max( val, 2 * sc->data[SC_WINDWALK]->val1 );
if( sc->data[SC_CARTBOOST] )
val = max( val, 20 );
- if( sd && (sd->class_&MAPID_UPPERMASK) == MAPID_ASSASSIN && iPc->checkskill(sd,TF_MISS) > 0 )
- val = max( val, 1 * iPc->checkskill(sd,TF_MISS) );
+ if( sd && (sd->class_&MAPID_UPPERMASK) == MAPID_ASSASSIN && pc->checkskill(sd,TF_MISS) > 0 )
+ val = max( val, 1 * pc->checkskill(sd,TF_MISS) );
if( sc->data[SC_CLOAKING] && (sc->data[SC_CLOAKING]->val4&1) == 1 )
val = max( val, sc->data[SC_CLOAKING]->val1 >= 10 ? 25 : 3 * sc->data[SC_CLOAKING]->val1 - 3 );
if (sc->data[SC_BERSERK] || sc->data[SC__BLOODYLUST])
@@ -5168,7 +5168,7 @@ static unsigned short status_calc_speed(struct block_list *bl, struct status_cha
//GetSpeed()
{
if( sd && pc_iscarton(sd) )
- speed += speed * (50 - 5 * iPc->checkskill(sd,MC_PUSHCART)) / 100;
+ speed += speed * (50 - 5 * pc->checkskill(sd,MC_PUSHCART)) / 100;
if( sc->data[SC_PARALYSE] )
speed += speed * 50 / 100;
if( speed_rate != 100 )
@@ -5321,7 +5321,7 @@ static short status_calc_fix_aspd(struct block_list *bl, struct status_change *s
|| sc->data[SC_WILD_STORM_OPTION]))
aspd -= 50; // +5 ASPD
if( sc && sc->data[SC_FIGHTINGSPIRIT] && sc->data[SC_FIGHTINGSPIRIT]->val2 )
- aspd -= (bl->type==BL_PC?iPc->checkskill((TBL_PC *)bl, RK_RUNEMASTERY):10) / 10 * 40;
+ aspd -= (bl->type==BL_PC?pc->checkskill((TBL_PC *)bl, RK_RUNEMASTERY):10) / 10 * 40;
return cap_value(aspd, 0, 2000); // will be recap for proper bl anyway
}
@@ -6603,7 +6603,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
case SC_INCREASEAGI:
if(sd && pc_issit(sd)){
- iPc->setstand(sd);
+ pc->setstand(sd);
}
case SC_CONCENTRATE:
@@ -6622,7 +6622,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
//Due to the cloaking card, we have to check the wall versus to known
//skill level rather than the used one. [Skotlex]
//if (sd && val1 < 3 && skill_check_cloaking(bl,NULL))
- if( sd && iPc->checkskill(sd, AS_CLOAKING) < 3 && !skill->check_cloaking(bl,NULL) )
+ if( sd && pc->checkskill(sd, AS_CLOAKING) < 3 && !skill->check_cloaking(bl,NULL) )
return 0;
break;
case SC_MODECHANGE:
@@ -6657,7 +6657,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
i = sd->equip_index[EQI_HAND_R];
if (i>=0 && sd->inventory_data[i] && sd->inventory_data[i]->type == IT_WEAPON) {
opt_flag|=2;
- iPc->unequipitem(sd,i,3);
+ pc->unequipitem(sd,i,3);
}
if (!opt_flag) return 0;
}
@@ -6673,7 +6673,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
i = sd->equip_index[EQI_HAND_L];
if ( i < 0 || !sd->inventory_data[i] || sd->inventory_data[i]->type != IT_ARMOR )
return 0;
- iPc->unequipitem(sd,i,3);
+ pc->unequipitem(sd,i,3);
}
if (tick == 1) return 1; //Minimal duration: Only strip without causing the SC
break;
@@ -6685,7 +6685,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
i = sd->equip_index[EQI_ARMOR];
if ( i < 0 || !sd->inventory_data[i] )
return 0;
- iPc->unequipitem(sd,i,3);
+ pc->unequipitem(sd,i,3);
}
if (tick == 1) return 1; //Minimal duration: Only strip without causing the SC
break;
@@ -6697,7 +6697,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
i = sd->equip_index[EQI_HEAD_TOP];
if ( i < 0 || !sd->inventory_data[i] )
return 0;
- iPc->unequipitem(sd,i,3);
+ pc->unequipitem(sd,i,3);
}
if (tick == 1) return 1; //Minimal duration: Only strip without causing the SC
break;
@@ -6758,7 +6758,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
return 0;
break;
case SC_CAMOUFLAGE:
- if( sd && iPc->checkskill(sd, RA_CAMOUFLAGE) < 3 && !skill->check_camouflage(bl,NULL) )
+ if( sd && pc->checkskill(sd, RA_CAMOUFLAGE) < 3 && !skill->check_camouflage(bl,NULL) )
return 0;
break;
case SC__STRIPACCESSORY:
@@ -6767,11 +6767,11 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
if( !(sd->bonus.unstripable_equip&EQI_ACC_L) ) {
i = sd->equip_index[EQI_ACC_L];
if( i >= 0 && sd->inventory_data[i] && sd->inventory_data[i]->type == IT_ARMOR )
- iPc->unequipitem(sd,i,3); //L-Accessory
+ pc->unequipitem(sd,i,3); //L-Accessory
} if( !(sd->bonus.unstripable_equip&EQI_ACC_R) ) {
i = sd->equip_index[EQI_ACC_R];
if( i >= 0 && sd->inventory_data[i] && sd->inventory_data[i]->type == IT_ARMOR )
- iPc->unequipitem(sd,i,3); //R-Accessory
+ pc->unequipitem(sd,i,3); //R-Accessory
}
if( i < 0 )
return 0;
@@ -7223,7 +7223,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
val3 = 50*(val1+1); //Damage increase (+50 +50*lv%)
#endif
if( sd )//[Ind] - iROwiki says each level increases its duration by 3 seconds
- tick += iPc->checkskill(sd,GC_RESEARCHNEWPOISON)*3000;
+ tick += pc->checkskill(sd,GC_RESEARCHNEWPOISON)*3000;
break;
case SC_POISONREACT:
val2=(val1+1)/2 + val1/10; // Number of counters [Skotlex]
@@ -7794,14 +7794,14 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
case SC_OVERTHRUST:
//val2 holds if it was casted on self, or is bonus received from others
val3 = 5*val1; //Power increase
- if(sd && iPc->checkskill(sd,BS_HILTBINDING)>0)
+ if(sd && pc->checkskill(sd,BS_HILTBINDING)>0)
tick += tick / 10;
break;
case SC_ADRENALINE2:
case SC_ADRENALINE:
val3 = (val2) ? 300 : 200; // aspd increase
case SC_WEAPONPERFECTION:
- if(sd && iPc->checkskill(sd,BS_HILTBINDING)>0)
+ if(sd && pc->checkskill(sd,BS_HILTBINDING)>0)
tick += tick / 10;
break;
case SC_CONCENTRATION:
@@ -7889,7 +7889,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
int pos = (bl->x&0xFFFF)|(bl->y<<16), //Current Coordinates
map = sd->mapindex; //Current Map
//1. Place in Jail (val2 -> Jail Map, val3 -> x, val4 -> y
- iPc->setpos(sd,(unsigned short)val2,val3,val4, CLR_TELEPORT);
+ pc->setpos(sd,(unsigned short)val2,val3,val4, CLR_TELEPORT);
//2. Set restore point (val3 -> return map, val4 return coords
val3 = map;
val4 = pos;
@@ -8033,7 +8033,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
break;
case SC_STONEHARDSKIN:
if( sd )
- val1 = sd->status.job_level * iPc->checkskill(sd, RK_RUNEMASTERY) / 4; //DEF/MDEF Increase
+ val1 = sd->status.job_level * pc->checkskill(sd, RK_RUNEMASTERY) / 4; //DEF/MDEF Increase
break;
case SC_FIGHTINGSPIRIT:
val_flag |= 1|2;
@@ -8181,18 +8181,18 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
case SC__ENERVATION:
val2 = 20 + 10 * val1; // ATK Reduction
val_flag |= 1|2;
- if( sd ) iPc->delspiritball(sd,sd->spiritball,0);
+ if( sd ) pc->delspiritball(sd,sd->spiritball,0);
break;
case SC__GROOMY:
val2 = 20 + 10 * val1; //ASPD. Need to confirm if Movement Speed reduction is the same. [Jobbie]
val3 = 20 * val1; //HIT
val_flag |= 1|2|4;
if( sd ) { // Removes Animals
- if( pc_isriding(sd) ) iPc->setriding(sd, 0);
- if( pc_isridingdragon(sd) ) iPc->setoption(sd, sd->sc.option&~OPTION_DRAGON);
- if( pc_iswug(sd) ) iPc->setoption(sd, sd->sc.option&~OPTION_WUG);
- if( pc_isridingwug(sd) ) iPc->setoption(sd, sd->sc.option&~OPTION_WUGRIDER);
- if( pc_isfalcon(sd) ) iPc->setoption(sd, sd->sc.option&~OPTION_FALCON);
+ if( pc_isriding(sd) ) pc->setriding(sd, 0);
+ if( pc_isridingdragon(sd) ) pc->setoption(sd, sd->sc.option&~OPTION_DRAGON);
+ if( pc_iswug(sd) ) pc->setoption(sd, sd->sc.option&~OPTION_WUG);
+ if( pc_isridingwug(sd) ) pc->setoption(sd, sd->sc.option&~OPTION_WUGRIDER);
+ if( pc_isfalcon(sd) ) pc->setoption(sd, sd->sc.option&~OPTION_FALCON);
if( sd->status.pet_id > 0 ) pet_menu(sd, 3);
if( homun_alive(sd->hd) ) homun->vaporize(sd,1);
if( sd->md ) merc_delete(sd->md,3);
@@ -8292,13 +8292,13 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
val3 = 15 + 5 * val1; // ASPD reduction.
if( sd && rand()%100 < val1 ){ // (Skill Lv) %
val4 = 1; // reduce walk speed by half.
- if( pc_isriding(sd) ) iPc->setriding(sd, 0);
- if( pc_isridingdragon(sd) ) iPc->setoption(sd, sd->sc.option&~OPTION_DRAGON);
+ if( pc_isriding(sd) ) pc->setriding(sd, 0);
+ if( pc_isridingdragon(sd) ) pc->setoption(sd, sd->sc.option&~OPTION_DRAGON);
}
break;
case SC_GLOOMYDAY_SK:
// Random number between [15 ~ (Voice Lesson Skill Level x 5) + (Skill Level x 10)] %.
- val2 = 15 + rand()%( (sd?iPc->checkskill(sd, WM_LESSON)*5:0) + val1*10 );
+ val2 = 15 + rand()%( (sd?pc->checkskill(sd, WM_LESSON)*5:0) + val1*10 );
break;
case SC_SITDOWN_FORCE:
case SC_BANANA_BOMB_SITDOWN:
@@ -8355,7 +8355,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
val2 = ((status->int_ + status->luk) / 6) + 5; // Chance to evade magic damage.
val1 *= 15; // Defence added
if( sd )
- val1 += 10 * iPc->checkskill(sd,CR_DEFENDER);
+ val1 += 10 * pc->checkskill(sd,CR_DEFENDER);
val_flag |= 1|2;
break;
case SC_BANDING:
@@ -8643,7 +8643,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
case SC_STONE:
case SC_DEEPSLEEP:
if (sd && pc_issit(sd)) //Avoid sprite sync problems.
- iPc->setstand(sd);
+ pc->setstand(sd);
case SC_TRICKDEAD:
status_change_end(bl, SC_DANCING, INVALID_TIMER);
// Cancel cast when get status [LuzZza]
@@ -8964,7 +8964,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
clif->skillinfo(sd,TK_JUMPKICK, INF_SELF_SKILL);
break;
case MO_TRIPLEATTACK:
- if (sd && iPc->checkskill(sd, SR_DRAGONCOMBO) > 0)
+ if (sd && pc->checkskill(sd, SR_DRAGONCOMBO) > 0)
clif->skillinfo(sd,SR_DRAGONCOMBO, INF_SELF_SKILL);
break;
case SR_FALLENEMPIRE:
@@ -9360,7 +9360,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
clif->skillinfo(sd, TK_JUMPKICK, 0);
break;
case MO_TRIPLEATTACK:
- if (iPc->checkskill(sd, SR_DRAGONCOMBO) > 0)
+ if (pc->checkskill(sd, SR_DRAGONCOMBO) > 0)
clif->skillinfo(sd, SR_DRAGONCOMBO, 0);
break;
case SR_FALLENEMPIRE:
@@ -9437,7 +9437,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
break;
//natural expiration.
if(sd && sd->mapindex == sce->val2)
- iPc->setpos(sd,(unsigned short)sce->val3,sce->val4&0xFFFF, sce->val4>>16, CLR_TELEPORT);
+ pc->setpos(sd,(unsigned short)sce->val3,sce->val4&0xFFFF, sce->val4>>16, CLR_TELEPORT);
break; //guess hes not in jail :P
case SC_CHANGE:
if (tid == INVALID_TIMER)
@@ -9504,7 +9504,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
break;
case SC_SITDOWN_FORCE:
if( sd && pc_issit(sd) ) {
- iPc->setstand(sd);
+ pc->setstand(sd);
clif->standing(bl);
}
break;
@@ -9533,10 +9533,10 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
if( sd && sce->val2 && !pc_isdead(sd) ) {
int i;
i = min(sd->spiritball,5);
- iPc->delspiritball(sd, sd->spiritball, 0);
+ pc->delspiritball(sd, sd->spiritball, 0);
status_change_end(bl, SC_EXPLOSIONSPIRITS, INVALID_TIMER);
while( i > 0 ) {
- iPc->addspiritball(sd, skill->get_time(MO_CALLSPIRITS, iPc->checkskill(sd,MO_CALLSPIRITS)), 5);
+ pc->addspiritball(sd, skill->get_time(MO_CALLSPIRITS, pc->checkskill(sd,MO_CALLSPIRITS)), 5);
--i;
}
}
@@ -9963,7 +9963,7 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr_t data)
if(bl->m == sd->feel_map[0].m ||
bl->m == sd->feel_map[1].m ||
bl->m == sd->feel_map[2].m)
- { //Timeout will be handled by iPc->setpos
+ { //Timeout will be handled by pc->setpos
sce->timer = INVALID_TIMER;
return 0;
}
@@ -10482,7 +10482,7 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr_t data)
case SC_BANDING:
if( status_charge(bl, 0, 7 - sce->val1) )
{
- if( sd ) iPc->banding(sd, sce->val1);
+ if( sd ) pc->banding(sd, sce->val1);
sc_timer_next(5000 + tick, status_change_timer, bl->id, data);
return 0;
}
@@ -10961,9 +10961,9 @@ static int status_natural_heal(struct block_list* bl, va_list args)
if (sd) {
if (sd->hp_loss.value || sd->sp_loss.value)
- iPc->bleeding(sd, natural_heal_diff_tick);
+ pc->bleeding(sd, natural_heal_diff_tick);
if (sd->hp_regen.value || sd->sp_regen.value)
- iPc->regen(sd, natural_heal_diff_tick);
+ pc->regen(sd, natural_heal_diff_tick);
}
if(flag&(RGN_SHP|RGN_SSP) && regen->ssregen &&
@@ -11098,7 +11098,7 @@ static int status_natural_heal(struct block_list* bl, va_list args)
if (sd && sd->state.doridori) {
val*=2;
sd->state.doridori = 0;
- if ((rate = iPc->checkskill(sd,TK_SPTIME)))
+ if ((rate = pc->checkskill(sd,TK_SPTIME)))
sc_start(bl,status_skill2sc(TK_SPTIME),
100,rate,skill->get_time(TK_SPTIME, rate));
if (
@@ -11106,8 +11106,8 @@ static int status_natural_heal(struct block_list* bl, va_list args)
rnd()%10000 < battle_config.sg_angel_skill_ratio
) { //Angel of the Sun/Moon/Star
clif->feel_hate_reset(sd);
- iPc->resethate(sd);
- iPc->resetfeel(sd);
+ pc->resethate(sd);
+ pc->resetfeel(sd);
}
}
sregen->tick.sp -= battle_config.natural_heal_skill_interval;
@@ -11161,7 +11161,7 @@ static bool status_readdb_job1(char* fields[], int columns, int current)
ShowWarning("status_readdb_job1: Invalid job class %d specified.\n", class_);
return false;
}
- idx = iPc->class2idx(class_);
+ idx = pc->class2idx(class_);
max_weight_base[idx] = atoi(fields[1]);
hp_coefficient[idx] = atoi(fields[2]);
@@ -11189,7 +11189,7 @@ static bool status_readdb_job2(char* fields[], int columns, int current)
ShowWarning("status_readdb_job2: Invalid job class %d specified.\n", class_);
return false;
}
- idx = iPc->class2idx(class_);
+ idx = pc->class2idx(class_);
for(i = 1; i < columns; i++)
{
diff --git a/src/map/storage.c b/src/map/storage.c
index 188534b61..17b7c82ae 100644
--- a/src/map/storage.c
+++ b/src/map/storage.c
@@ -98,7 +98,7 @@ int storage_storageopen(struct map_session_data *sd)
if(sd->state.storage_flag)
return 1; //Already open?
- if( !iPc->can_give_items(sd) )
+ if( !pc->can_give_items(sd) )
{ //check is this GM level is allowed to put items to storage
clif->message(sd->fd, msg_txt(246));
return 1;
@@ -148,7 +148,7 @@ static int storage_additem(struct map_session_data* sd, struct item* item_data,
return 1;
}
- if( !itemdb_canstore(item_data, iPc->get_group_level(sd)) )
+ if( !itemdb_canstore(item_data, pc->get_group_level(sd)) )
{ //Check if item is storable. [Skotlex]
clif->message (sd->fd, msg_txt(264));
return 1;
@@ -227,7 +227,7 @@ int storage_storageadd(struct map_session_data* sd, int index, int amount)
return 0;
if( storage_additem(sd,&sd->status.inventory[index],amount) == 0 )
- iPc->delitem(sd,index,amount,0,4,LOG_TYPE_STORAGE);
+ pc->delitem(sd,index,amount,0,4,LOG_TYPE_STORAGE);
return 1;
}
@@ -252,7 +252,7 @@ int storage_storageget(struct map_session_data* sd, int index, int amount)
if( amount < 1 || amount > sd->status.storage.items[index].amount )
return 0;
- if( (flag = iPc->additem(sd,&sd->status.storage.items[index],amount,LOG_TYPE_STORAGE)) == 0 )
+ if( (flag = pc->additem(sd,&sd->status.storage.items[index],amount,LOG_TYPE_STORAGE)) == 0 )
storage_delitem(sd,index,amount);
else
clif->additem(sd,0,0,flag);
@@ -284,7 +284,7 @@ int storage_storageaddfromcart(struct map_session_data* sd, int index, int amoun
return 0;
if( storage_additem(sd,&sd->status.cart[index],amount) == 0 )
- iPc->cart_delitem(sd,index,amount,0,LOG_TYPE_STORAGE);
+ pc->cart_delitem(sd,index,amount,0,LOG_TYPE_STORAGE);
return 1;
}
@@ -309,7 +309,7 @@ int storage_storagegettocart(struct map_session_data* sd, int index, int amount)
if( amount < 1 || amount > sd->status.storage.items[index].amount )
return 0;
- if( iPc->cart_additem(sd,&sd->status.storage.items[index],amount,LOG_TYPE_STORAGE) == 0 )
+ if( pc->cart_additem(sd,&sd->status.storage.items[index],amount,LOG_TYPE_STORAGE) == 0 )
storage_delitem(sd,index,amount);
return 1;
@@ -394,7 +394,7 @@ int storage_guild_storageopen(struct map_session_data* sd)
if(sd->state.storage_flag)
return 1; //Can't open both storages at a time.
- if( !iPc->can_give_items(sd) ) { //check is this GM level can open guild storage and store items [Lupus]
+ if( !pc->can_give_items(sd) ) { //check is this GM level can open guild storage and store items [Lupus]
clif->message(sd->fd, msg_txt(246));
return 1;
}
@@ -442,7 +442,7 @@ int guild_storage_additem(struct map_session_data* sd, struct guild_storage* sto
return 1;
}
- if( !itemdb_canguildstore(item_data, iPc->get_group_level(sd)) || item_data->expire_time )
+ if( !itemdb_canguildstore(item_data, pc->get_group_level(sd)) || item_data->expire_time )
{ //Check if item is storable. [Skotlex]
clif->message (sd->fd, msg_txt(264));
return 1;
@@ -532,7 +532,7 @@ int storage_guild_storageadd(struct map_session_data* sd, int index, int amount)
}
if(guild_storage_additem(sd,stor,&sd->status.inventory[index],amount)==0)
- iPc->delitem(sd,index,amount,0,4,LOG_TYPE_GSTORAGE);
+ pc->delitem(sd,index,amount,0,4,LOG_TYPE_GSTORAGE);
return 1;
}
@@ -569,7 +569,7 @@ int storage_guild_storageget(struct map_session_data* sd, int index, int amount)
return 0;
}
- if((flag = iPc->additem(sd,&stor->items[index],amount,LOG_TYPE_GSTORAGE)) == 0)
+ if((flag = pc->additem(sd,&stor->items[index],amount,LOG_TYPE_GSTORAGE)) == 0)
guild_storage_delitem(sd,stor,index,amount);
else //inform fail
clif->additem(sd,0,0,flag);
@@ -605,7 +605,7 @@ int storage_guild_storageaddfromcart(struct map_session_data* sd, int index, int
return 0;
if(guild_storage_additem(sd,stor,&sd->status.cart[index],amount)==0)
- iPc->cart_delitem(sd,index,amount,0,LOG_TYPE_GSTORAGE);
+ pc->cart_delitem(sd,index,amount,0,LOG_TYPE_GSTORAGE);
return 1;
}
@@ -636,7 +636,7 @@ int storage_guild_storagegettocart(struct map_session_data* sd, int index, int a
if(amount < 1 || amount > stor->items[index].amount)
return 0;
- if(iPc->cart_additem(sd,&stor->items[index],amount,LOG_TYPE_GSTORAGE)==0)
+ if(pc->cart_additem(sd,&stor->items[index],amount,LOG_TYPE_GSTORAGE)==0)
guild_storage_delitem(sd,stor,index,amount);
return 1;
diff --git a/src/map/trade.c b/src/map/trade.c
index 4f4cc7394..8311dbf3d 100644
--- a/src/map/trade.c
+++ b/src/map/trade.c
@@ -69,7 +69,7 @@ void trade_traderequest(struct map_session_data *sd, struct map_session_data *ta
return;
}
- if (!iPc->can_give_items(sd) || !iPc->can_give_items(target_sd)) //check if both GMs are allowed to trade
+ if (!pc->can_give_items(sd) || !pc->can_give_items(target_sd)) //check if both GMs are allowed to trade
{
clif->message(sd->fd, msg_txt(246));
clif->tradestart(sd, 2); // GM is not allowed to trade
@@ -77,7 +77,7 @@ void trade_traderequest(struct map_session_data *sd, struct map_session_data *ta
}
// Players can not request trade from far away, unless they are allowed to use @trade.
- if (!iPc->can_use_command(sd, "@trade") &&
+ if (!pc->can_use_command(sd, "@trade") &&
(sd->bl.m != target_sd->bl.m || !check_distance_bl(&sd->bl, &target_sd->bl, TRADE_DISTANCE))) {
clif->tradestart(sd, 0); // too far
return ;
@@ -135,7 +135,7 @@ void trade_tradeack(struct map_session_data *sd, int type)
// Players can not request trade from far away, unless they are allowed to use @trade.
// Check here as well since the original character could had warped.
- if (!iPc->can_use_command(sd, "@trade") &&
+ if (!pc->can_use_command(sd, "@trade") &&
(sd->bl.m != tsd->bl.m || !check_distance_bl(&sd->bl, &tsd->bl, TRADE_DISTANCE))) {
clif->tradestart(sd, 0); // too far
sd->trade_partner=0;
@@ -350,10 +350,10 @@ void trade_tradeadditem(struct map_session_data *sd, short index, short amount)
return;
item = &sd->status.inventory[index];
- src_lv = iPc->get_group_level(sd);
- dst_lv = iPc->get_group_level(target_sd);
+ src_lv = pc->get_group_level(sd);
+ dst_lv = pc->get_group_level(target_sd);
if( !itemdb_cantrade(item, src_lv, dst_lv) && //Can't trade
- (iPc->get_partner(sd) != target_sd || !itemdb_canpartnertrade(item, src_lv, dst_lv)) ) //Can't partner-trade
+ (pc->get_partner(sd) != target_sd || !itemdb_canpartnertrade(item, src_lv, dst_lv)) ) //Can't partner-trade
{
clif->message (sd->fd, msg_txt(260));
clif->tradeitemok(sd, index+2, 1);
@@ -555,9 +555,9 @@ void trade_tradecommit(struct map_session_data *sd)
{
n = sd->deal.item[trade_i].index;
- flag = iPc->additem(tsd, &sd->status.inventory[n], sd->deal.item[trade_i].amount,LOG_TYPE_TRADE);
+ flag = pc->additem(tsd, &sd->status.inventory[n], sd->deal.item[trade_i].amount,LOG_TYPE_TRADE);
if (flag == 0)
- iPc->delitem(sd, n, sd->deal.item[trade_i].amount, 1, 6, LOG_TYPE_TRADE);
+ pc->delitem(sd, n, sd->deal.item[trade_i].amount, 1, 6, LOG_TYPE_TRADE);
else
clif->additem(sd, n, sd->deal.item[trade_i].amount, 0);
sd->deal.item[trade_i].index = 0;
@@ -567,9 +567,9 @@ void trade_tradecommit(struct map_session_data *sd)
{
n = tsd->deal.item[trade_i].index;
- flag = iPc->additem(sd, &tsd->status.inventory[n], tsd->deal.item[trade_i].amount,LOG_TYPE_TRADE);
+ flag = pc->additem(sd, &tsd->status.inventory[n], tsd->deal.item[trade_i].amount,LOG_TYPE_TRADE);
if (flag == 0)
- iPc->delitem(tsd, n, tsd->deal.item[trade_i].amount, 1, 6, LOG_TYPE_TRADE);
+ pc->delitem(tsd, n, tsd->deal.item[trade_i].amount, 1, 6, LOG_TYPE_TRADE);
else
clif->additem(tsd, n, tsd->deal.item[trade_i].amount, 0);
tsd->deal.item[trade_i].index = 0;
@@ -578,14 +578,14 @@ void trade_tradecommit(struct map_session_data *sd)
}
if( sd->deal.zeny ) {
- iPc->payzeny(sd ,sd->deal.zeny, LOG_TYPE_TRADE, tsd);
- iPc->getzeny(tsd,sd->deal.zeny,LOG_TYPE_TRADE, sd);
+ pc->payzeny(sd ,sd->deal.zeny, LOG_TYPE_TRADE, tsd);
+ pc->getzeny(tsd,sd->deal.zeny,LOG_TYPE_TRADE, sd);
sd->deal.zeny = 0;
}
if ( tsd->deal.zeny) {
- iPc->payzeny(tsd,tsd->deal.zeny,LOG_TYPE_TRADE, sd);
- iPc->getzeny(sd ,tsd->deal.zeny,LOG_TYPE_TRADE, tsd);
+ pc->payzeny(tsd,tsd->deal.zeny,LOG_TYPE_TRADE, sd);
+ pc->getzeny(sd ,tsd->deal.zeny,LOG_TYPE_TRADE, tsd);
tsd->deal.zeny = 0;
}
diff --git a/src/map/unit.c b/src/map/unit.c
index a09776298..c6378ffdd 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -754,7 +754,7 @@ int unit_blown(struct block_list* bl, int dx, int dy, int count, int flag)
}
//Warps a unit/ud to a given map/position.
-//In the case of players, iPc->setpos is used.
+//In the case of players, pc->setpos is used.
//it respects the no warp flags, so it is safe to call this without doing nowarpto/nowarp checks.
int unit_warp(struct block_list *bl,short m,short x,short y,clr_type type)
{
@@ -804,7 +804,7 @@ int unit_warp(struct block_list *bl,short m,short x,short y,clr_type type)
}
if (bl->type == BL_PC) //Use pc_setpos
- return iPc->setpos((TBL_PC*)bl, map_id2index(m), x, y, type);
+ return pc->setpos((TBL_PC*)bl, map_id2index(m), x, y, type);
if (!unit_remove_map(bl, type))
return 3;
@@ -908,7 +908,7 @@ int unit_can_move(struct block_list *bl) {
if (!ud)
return 0;
- if (ud->skilltimer != INVALID_TIMER && ud->skill_id != LG_EXEEDBREAK && (!sd || !iPc->checkskill(sd, SA_FREECAST) || skill->get_inf2(ud->skill_id)&INF2_GUILD_SKILL))
+ if (ud->skilltimer != INVALID_TIMER && ud->skill_id != LG_EXEEDBREAK && (!sd || !pc->checkskill(sd, SA_FREECAST) || skill->get_inf2(ud->skill_id)&INF2_GUILD_SKILL))
return 0; // prevent moving while casting
if (DIFF_TICK(ud->canmove_tick, iTimer->gettick()) > 0)
@@ -968,7 +968,7 @@ int unit_can_move(struct block_list *bl) {
if (sc->opt1 > 0 && sc->opt1 != OPT1_STONEWAIT && sc->opt1 != OPT1_BURNING && !(sc->opt1 == OPT1_CRYSTALIZE && bl->type == BL_MOB))
return 0;
- if ((sc->option & OPTION_HIDE) && (!sd || iPc->checkskill(sd, RG_TUNNELDRIVE) <= 0))
+ if ((sc->option & OPTION_HIDE) && (!sd || pc->checkskill(sd, RG_TUNNELDRIVE) <= 0))
return 0;
}
@@ -1162,7 +1162,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui
break;
case BD_ENCORE:
//Prevent using the dance skill if you no longer have the skill in your tree.
- if(!sd->skill_id_dance || iPc->checkskill(sd,sd->skill_id_dance)<=0){
+ if(!sd->skill_id_dance || pc->checkskill(sd,sd->skill_id_dance)<=0){
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
@@ -1277,7 +1277,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui
}
break;
case GD_EMERGENCYCALL: //Emergency Call double cast when the user has learned Leap [Daegaladh]
- if( sd && iPc->checkskill(sd,TK_HIGHJUMP) )
+ if( sd && pc->checkskill(sd,TK_HIGHJUMP) )
casttime *= 2;
break;
case RA_WUGDASH:
@@ -1386,7 +1386,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui
if( casttime > 0 ) {
ud->skilltimer = iTimer->add_timer( tick+casttime, skill->castend_id, src->id, 0 );
- if( sd && (iPc->checkskill(sd,SA_FREECAST) > 0 || skill_id == LG_EXEEDBREAK) )
+ if( sd && (pc->checkskill(sd,SA_FREECAST) > 0 || skill_id == LG_EXEEDBREAK) )
status_calc_bl(&sd->bl, SCB_SPEED);
} else
skill->castend_id(ud->skilltimer,tick,src->id,0);
@@ -1517,7 +1517,7 @@ int unit_skilluse_pos2( struct block_list *src, short skill_x, short skill_y, ui
clif->skillcasting(src, src->id, 0, skill_x, skill_y, skill_id, skill->get_ele(skill_id, skill_lv), casttime);
if( casttime > 0 ) {
ud->skilltimer = iTimer->add_timer( tick+casttime, skill->castend_pos, src->id, 0 );
- if( (sd && iPc->checkskill(sd,SA_FREECAST) > 0) || skill_id == LG_EXEEDBREAK)
+ if( (sd && pc->checkskill(sd,SA_FREECAST) > 0) || skill_id == LG_EXEEDBREAK)
status_calc_bl(&sd->bl, SCB_SPEED);
} else {
ud->skilltimer = INVALID_TIMER;
@@ -1804,10 +1804,10 @@ static int unit_attack_timer_sub(struct block_list* src, int tid, unsigned int t
return 0;
}
- if( ud->skilltimer != INVALID_TIMER && !(sd && iPc->checkskill(sd,SA_FREECAST) > 0) )
+ if( ud->skilltimer != INVALID_TIMER && !(sd && pc->checkskill(sd,SA_FREECAST) > 0) )
return 0; // can't attack while casting
- if( !battle_config.sdelay_attack_enable && DIFF_TICK(ud->canact_tick,tick) > 0 && !(sd && iPc->checkskill(sd,SA_FREECAST) > 0) )
+ if( !battle_config.sdelay_attack_enable && DIFF_TICK(ud->canact_tick,tick) > 0 && !(sd && pc->checkskill(sd,SA_FREECAST) > 0) )
{ // attacking when under cast delay has restrictions:
if( tid == INVALID_TIMER )
{ //requested attack.
@@ -1945,7 +1945,7 @@ int unit_skillcastcancel(struct block_list *bl,int type)
ud->skilltimer = INVALID_TIMER;
- if( sd && iPc->checkskill(sd,SA_FREECAST) > 0 )
+ if( sd && pc->checkskill(sd,SA_FREECAST) > 0 )
status_calc_bl(&sd->bl, SCB_SPEED);
if( sd ) {
@@ -2131,7 +2131,7 @@ int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file,
sd->adopt_invite = 0;
if(sd->pvp_timer != INVALID_TIMER) {
- iTimer->delete_timer(sd->pvp_timer,iPc->calc_pvprank_timer);
+ iTimer->delete_timer(sd->pvp_timer,pc->calc_pvprank_timer);
sd->pvp_timer = INVALID_TIMER;
sd->pvp_rank = 0;
}
@@ -2139,7 +2139,7 @@ int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file,
duel_leave(sd->duel_group, sd);
if(pc_issit(sd)) {
- iPc->setstand(sd);
+ pc->setstand(sd);
skill->sit(sd,0);
}
iParty->send_dot_remove(sd);//minimap dot fix [Kevin]
@@ -2301,15 +2301,15 @@ int unit_free(struct block_list *bl, clr_type clrtype)
int i;
if( status_isdead(bl) )
- iPc->setrestartvalue(sd,2);
+ pc->setrestartvalue(sd,2);
- iPc->delinvincibletimer(sd);
- iPc->delautobonus(sd,sd->autobonus,ARRAYLENGTH(sd->autobonus),false);
- iPc->delautobonus(sd,sd->autobonus2,ARRAYLENGTH(sd->autobonus2),false);
- iPc->delautobonus(sd,sd->autobonus3,ARRAYLENGTH(sd->autobonus3),false);
+ pc->delinvincibletimer(sd);
+ pc->delautobonus(sd,sd->autobonus,ARRAYLENGTH(sd->autobonus),false);
+ pc->delautobonus(sd,sd->autobonus2,ARRAYLENGTH(sd->autobonus2),false);
+ pc->delautobonus(sd,sd->autobonus3,ARRAYLENGTH(sd->autobonus3),false);
if( sd->followtimer != INVALID_TIMER )
- iPc->stop_following(sd);
+ pc->stop_following(sd);
if( sd->duel_invite > 0 )
duel_reject(sd->duel_invite, sd);
@@ -2318,11 +2318,11 @@ int unit_free(struct block_list *bl, clr_type clrtype)
iMap->map_foreachpc(clif->friendslist_toggle_sub, sd->status.account_id, sd->status.char_id, 0);
iParty->send_logout(sd);
guild->send_memberinfoshort(sd,0);
- iPc->cleareventtimer(sd);
- iPc->inventory_rental_clear(sd);
- iPc->delspiritball(sd,sd->spiritball,1);
+ pc->cleareventtimer(sd);
+ pc->inventory_rental_clear(sd);
+ pc->delspiritball(sd,sd->spiritball,1);
for(i = 1; i < 5; i++)
- iPc->del_talisman(sd, sd->talisman[i], i);
+ pc->del_talisman(sd, sd->talisman[i], i);
if( sd->reg ) { //Double logout already freed pointer fix... [Skotlex]
aFree(sd->reg);
diff --git a/src/map/vending.c b/src/map/vending.c
index 5b0bfdaa5..e0dd844e1 100644
--- a/src/map/vending.c
+++ b/src/map/vending.c
@@ -51,7 +51,7 @@ void vending_vendinglistreq(struct map_session_data* sd, unsigned int id) {
if( !vsd->state.vending )
return; // not vending
- if (!iPc->can_give_items(sd) || !iPc->can_give_items(vsd)) { //check if both GMs are allowed to trade
+ if (!pc->can_give_items(sd) || !pc->can_give_items(vsd)) { //check if both GMs are allowed to trade
// GM is not allowed to trade
clif->message(sd->fd, msg_txt(246));
return;
@@ -88,7 +88,7 @@ void vending_purchasereq(struct map_session_data* sd, int aid, unsigned int uid,
if( count < 1 || count > MAX_VENDING || count > vsd->vend_num )
return; // invalid amount of purchased items
- blank = iPc->inventoryblank(sd); //number of free cells in the buyer's inventory
+ blank = pc->inventoryblank(sd); //number of free cells in the buyer's inventory
// duplicate item in vending to check hacker with multiple packets
memcpy(&vend, &vsd->vending, sizeof(vsd->vending)); // copy vending list
@@ -144,7 +144,7 @@ void vending_purchasereq(struct map_session_data* sd, int aid, unsigned int uid,
vend[j].amount -= amount;
- switch( iPc->checkadditem(sd, vsd->status.cart[idx].nameid, amount) ) {
+ switch( pc->checkadditem(sd, vsd->status.cart[idx].nameid, amount) ) {
case ADDITEM_EXIST:
break; //We'd add this item to the existing one (in buyers inventory)
case ADDITEM_NEW:
@@ -157,10 +157,10 @@ void vending_purchasereq(struct map_session_data* sd, int aid, unsigned int uid,
}
}
- iPc->payzeny(sd, (int)z, LOG_TYPE_VENDING, vsd);
+ pc->payzeny(sd, (int)z, LOG_TYPE_VENDING, vsd);
if( battle_config.vending_tax )
z -= z * (battle_config.vending_tax/10000.);
- iPc->getzeny(vsd, (int)z, LOG_TYPE_VENDING, sd);
+ pc->getzeny(vsd, (int)z, LOG_TYPE_VENDING, sd);
for( i = 0; i < count; i++ ) {
short amount = *(uint16*)(data + 4*i + 0);
@@ -168,9 +168,9 @@ void vending_purchasereq(struct map_session_data* sd, int aid, unsigned int uid,
idx -= 2;
// vending item
- iPc->additem(sd, &vsd->status.cart[idx], amount, LOG_TYPE_VENDING);
+ pc->additem(sd, &vsd->status.cart[idx], amount, LOG_TYPE_VENDING);
vsd->vending[vend_list[i]].amount -= amount;
- iPc->cart_delitem(vsd, idx, amount, 0, LOG_TYPE_VENDING);
+ pc->cart_delitem(vsd, idx, amount, 0, LOG_TYPE_VENDING);
clif->vendingreport(vsd, idx, amount);
//print buyer's name
@@ -226,7 +226,7 @@ void vending_openvending(struct map_session_data* sd, const char* message, const
if ( pc_isdead(sd) || !sd->state.prevend || pc_istrading(sd))
return; // can't open vendings lying dead || didn't use via the skill (wpe/hack) || can't have 2 shops at once
- vending_skill_lvl = iPc->checkskill(sd, MC_VENDING);
+ vending_skill_lvl = pc->checkskill(sd, MC_VENDING);
// skill level and cart check
if( !vending_skill_lvl || !pc_iscarton(sd) ) {
clif->skill_fail(sd, MC_VENDING, USESKILL_FAIL_LEVEL, 0);
@@ -250,12 +250,12 @@ void vending_openvending(struct map_session_data* sd, const char* message, const
index -= 2; // offset adjustment (client says that the first cart position is 2)
if( index < 0 || index >= MAX_CART // invalid position
- || iPc->cartitem_amount(sd, index, amount) < 0 // invalid item or insufficient quantity
+ || pc->cartitem_amount(sd, index, amount) < 0 // invalid item or insufficient quantity
//NOTE: official server does not do any of the following checks!
|| !sd->status.cart[index].identify // unidentified item
|| sd->status.cart[index].attribute == 1 // broken item
|| sd->status.cart[index].expire_time // It should not be in the cart but just in case
- || !itemdb_cantrade(&sd->status.cart[index], iPc->get_group_level(sd), iPc->get_group_level(sd)) ) // untradeable item
+ || !itemdb_cantrade(&sd->status.cart[index], pc->get_group_level(sd), pc->get_group_level(sd)) ) // untradeable item
continue;
sd->vending[i].index = index;