summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c62
1 files changed, 40 insertions, 22 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index f41665fad..3d5e240f8 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -904,7 +904,8 @@ int pc_isequip(struct map_session_data *sd,int n)
return 0;
if ( item->equip & EQP_AMMO ) {
- if ( !pc_iscarton(sd) && (sd->status.class_ == JOB_GENETIC_T || sd->status.class_ == JOB_GENETIC) ) {
+ if ( (sd->state.active && !pc_iscarton(sd)) // check if sc data is already loaded.
+ && (sd->status.class_ == JOB_GENETIC_T || sd->status.class_ == JOB_GENETIC) ) {
clif->msg(sd, 0x5EF);
return 0;
}
@@ -1132,6 +1133,8 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
sd->vars_ok = false;
sd->vars_received = 0x0;
+ sd->lang_id = map->default_lang_id;
+
//warp player
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);
@@ -1163,7 +1166,7 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
if (battle_config.display_version == 1) {
char buf[256];
- sprintf(buf, msg_txt(1295), sysinfo->vcstype(), sysinfo->vcsrevision_src(), sysinfo->vcsrevision_scripts()); // %s revision '%s' (src) / '%s' (scripts)
+ sprintf(buf, msg_sd(sd,1295), sysinfo->vcstype(), sysinfo->vcsrevision_src(), sysinfo->vcsrevision_scripts()); // %s revision '%s' (src) / '%s' (scripts)
clif->message(sd->fd, buf);
}
@@ -1339,7 +1342,7 @@ int pc_reg_received(struct map_session_data *sd)
if (pc_isinvisible(sd)) {
sd->vd.class_ = INVISIBLE_CLASS;
- clif->message(sd->fd, msg_txt(11)); // Invisible: On
+ clif->message(sd->fd, msg_sd(sd,11)); // Invisible: On
// decrement the number of pvp players on the map
map->list[sd->bl.m].users_pvp--;
@@ -1502,8 +1505,15 @@ int pc_calc_skilltree(struct map_session_data *sd)
}
}
}
- if( sd->status.job_level < pc->skill_tree[c][i].joblv )
- f = 0; // job level requirement wasn't satisfied
+ if ( sd->status.job_level < pc->skill_tree[c][i].joblv ) {
+ int x = pc->mapid2jobid(sd->class_, sd->status.sex); // need to get its own skilltree
+ if ( x > -1 ) {
+ x = pc->class2idx(x);
+ if ( !pc->skill_tree[x][i].inherited )
+ f = 0; // job level requirement wasn't satisfied
+ } else
+ f = 0;
+ }
}
if( f ) {
int inf2;
@@ -1597,8 +1607,16 @@ void pc_check_skilltree(struct map_session_data *sd, int skill_id)
}
if( !f )
continue;
- if( sd->status.job_level < pc->skill_tree[c][i].joblv )
- continue;
+
+ if ( sd->status.job_level < pc->skill_tree[c][i].joblv ) {
+ int x = pc->mapid2jobid(sd->class_, sd->status.sex); // need to get its own skilltree
+ if ( x > -1 ) {
+ x = pc->class2idx(x);
+ if ( !pc->skill_tree[x][i].inherited )
+ continue;
+ } else
+ continue;
+ }
j = skill->db[idx].inf2;
if( !sd->status.skill[idx].lv && (
@@ -3850,7 +3868,7 @@ int pc_paycash(struct map_session_data *sd, int price, int points)
if( battle_config.cashshop_show_points )
{
char output[128];
- sprintf(output, msg_txt(504), points, cash, sd->kafraPoints, sd->cashPoints);
+ sprintf(output, msg_sd(sd,504), points, cash, sd->kafraPoints, sd->cashPoints);
clif_disp_onlyself(sd, output, strlen(output));
}
return cash+points;
@@ -3875,7 +3893,7 @@ int pc_getcash(struct map_session_data *sd, int cash, int points)
if( battle_config.cashshop_show_points )
{
- sprintf(output, msg_txt(505), cash, sd->cashPoints);
+ sprintf(output, msg_sd(sd,505), cash, sd->cashPoints);
clif_disp_onlyself(sd, output, strlen(output));
}
return cash;
@@ -3898,7 +3916,7 @@ int pc_getcash(struct map_session_data *sd, int cash, int points)
if( battle_config.cashshop_show_points )
{
- sprintf(output, msg_txt(506), points, sd->kafraPoints);
+ sprintf(output, msg_sd(sd,506), points, sd->kafraPoints);
clif_disp_onlyself(sd, output, strlen(output));
}
return points;
@@ -4141,13 +4159,13 @@ int pc_dropitem(struct map_session_data *sd,int n,int amount)
return 0;
if( map->list[sd->bl.m].flag.nodrop ) {
- clif->message (sd->fd, msg_txt(271));
+ clif->message (sd->fd, msg_sd(sd,271));
return 0; //Can't drop items in nodrop mapflag maps.
}
if( !pc->candrop(sd,&sd->status.inventory[n]) )
{
- clif->message (sd->fd, msg_txt(263));
+ clif->message (sd->fd, msg_sd(sd,263));
return 0;
}
@@ -4256,7 +4274,7 @@ int pc_isUseitem(struct map_session_data *sd,int n)
}
if (sd->state.storage_flag && item->type != IT_CASH) {
- clif->colormes(sd->fd, COLOR_RED, msg_txt(1475));
+ clif->colormes(sd->fd, COLOR_RED, msg_sd(sd,1475));
return 0; // You cannot use this item while storage is open.
}
@@ -4285,7 +4303,7 @@ int pc_isUseitem(struct map_session_data *sd,int n)
case ITEMID_WOB_LOCAL: // Blue Butterfly Wing
case ITEMID_SIEGE_TELEPORT_SCROLL:
if( sd->duel_group && !battle_config.duel_allow_teleport ) {
- clif->message(sd->fd, msg_txt(863)); // "Duel: Can't use this item in duel."
+ clif->message(sd->fd, msg_sd(sd,863)); // "Duel: Can't use this item in duel."
return 0;
}
if( nameid != ITEMID_WING_OF_FLY && nameid != ITEMID_GIANT_FLY_WING && map->list[sd->bl.m].flag.noreturn )
@@ -4360,7 +4378,7 @@ int pc_isUseitem(struct map_session_data *sd,int n)
return 0;
}
if( !pc->inventoryblank(sd) ) {
- clif->colormes(sd->fd,COLOR_RED,msg_txt(1477));
+ clif->colormes(sd->fd,COLOR_RED,msg_sd(sd,1477));
return 0;
}
}
@@ -4591,7 +4609,7 @@ int pc_cart_additem(struct map_session_data *sd,struct item *item_data,int amoun
if (!itemdb_cancartstore(item_data, pc_get_group_level(sd)) || (item_data->bound > IBT_ACCOUNT && !pc_can_give_bound_items(sd))) {
// Check item trade restrictions
- clif->message (sd->fd, msg_txt(264));
+ clif->message (sd->fd, msg_sd(sd,264));
return 1;/* TODO: there is no official response to this? */
}
@@ -5039,7 +5057,7 @@ int pc_setpos(struct map_session_data* sd, unsigned short map_index, int x, int
sd->regen.state.gc = 0;
// make sure vending is allowed here
if (sd->state.vending && map->list[m].flag.novending) {
- clif->message (sd->fd, msg_txt(276)); // "You can't open a shop on this map"
+ clif->message (sd->fd, msg_sd(sd,276)); // "You can't open a shop on this map"
vending->close(sd);
}
@@ -5086,7 +5104,7 @@ int pc_setpos(struct map_session_data* sd, unsigned short map_index, int x, int
}
if (sd->state.vending && map->getcell(m,x,y,CELL_CHKNOVENDING)) {
- clif->message (sd->fd, msg_txt(204)); // "You can't open a shop on this cell."
+ clif->message (sd->fd, msg_sd(sd,204)); // "You can't open a shop on this cell."
vending->close(sd);
}
@@ -10255,8 +10273,8 @@ void pc_read_skill_tree(void) {
break;
} else if ( pc->skill_tree[idx][a].id || ( pc->skill_tree[idx][a].id == NV_TRICKDEAD && ((pc->jobid2mapid(jnames[k].id)&(MAPID_BASEMASK|JOBL_2))!=MAPID_NOVICE) ) ) /* we skip trickdead for non-novices */
continue;/* skip */
-
- memcpy(&pc->skill_tree[idx][a],&pc->skill_tree[fidx][f],sizeof(pc->skill_tree[fidx][f]));
+ memcpy(&pc->skill_tree[idx][a], &pc->skill_tree[fidx][f], sizeof(pc->skill_tree[fidx][f]));
+ pc->skill_tree[idx][a].inherited = 1;
}
}
@@ -10579,7 +10597,7 @@ void pc_bank_withdraw(struct map_session_data *sd, int money) {
return;
} else if ( limit_check > MAX_ZENY ) {
/* no official response for this scenario exists. */
- clif->colormes(sd->fd,COLOR_RED,msg_txt(1482));
+ clif->colormes(sd->fd,COLOR_RED,msg_sd(sd,1482));
return;
}
@@ -10600,7 +10618,7 @@ void pc_scdata_received(struct map_session_data *sd) {
if (sd->expiration_time != 0) { // don't display if it's unlimited or unknow value
time_t exp_time = sd->expiration_time;
char tmpstr[1024];
- strftime(tmpstr, sizeof(tmpstr) - 1, msg_txt(501), localtime(&exp_time)); // "Your account time limit is: %d-%m-%Y %H:%M:%S."
+ strftime(tmpstr, sizeof(tmpstr) - 1, msg_sd(sd,501), localtime(&exp_time)); // "Your account time limit is: %d-%m-%Y %H:%M:%S."
clif->wis_message(sd->fd, map->wisp_server_name, tmpstr, strlen(tmpstr)+1);
pc->expire_check(sd);