diff options
Diffstat (limited to 'src/map/pc.c')
-rw-r--r-- | src/map/pc.c | 53 |
1 files changed, 19 insertions, 34 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index 854913c28..2303a83ca 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -4907,25 +4907,6 @@ int pc_isUseitem(struct map_session_data *sd,int n) if( map->list[sd->bl.m].flag.nobranch || map_flag_gvg2(sd->bl.m) ) return 0; break; - case ITEMID_BUBBLE_GUM: - case ITEMID_COMP_BUBBLE_GUM: - if( sd->sc.data[SC_CASH_RECEIVEITEM] ) - return 0; - break; - case ITEMID_BATTLE_MANUAL: - case ITEMID_COMP_BATTLE_MANUAL: - case ITEMID_THICK_MANUAL50: - case ITEMID_NOBLE_NAMEPLATE: - case ITEMID_BATTLE_MANUAL25: - case ITEMID_BATTLE_MANUAL100: - case ITEMID_BATTLE_MANUAL_X3: - if( sd->sc.data[SC_CASH_PLUSEXP] ) - return 0; - break; - case ITEMID_JOB_MANUAL50: - if( sd->sc.data[SC_CASH_PLUSONLYJOBEXP] ) - return 0; - break; // Mercenary Items case ITEMID_MERCENARY_RED_POTION: @@ -5043,7 +5024,7 @@ int pc_useitem(struct map_session_data *sd,int n) { #if PACKETVER >= 20110309 clif->msgtable(sd, MSG_NPC_WORK_IN_PROGRESS); #else - clif->messagecolor_self(fd, COLOR_WHITE, msg_fd(fd, 48)); + clif->messagecolor_self(sd->fd, COLOR_WHITE, msg_sd(sd, 48)); #endif return 0; } @@ -5079,10 +5060,8 @@ int pc_useitem(struct map_session_data *sd,int n) { )) return 0; - //Prevent mass item usage. [Skotlex] - if( DIFF_TICK(sd->canuseitem_tick, tick) > 0 || - (itemdb_iscashfood(nameid) && DIFF_TICK(sd->canusecashfood_tick, tick) > 0) - ) + // Prevent mass item usage. [Skotlex] + if (DIFF_TICK(sd->canuseitem_tick, tick) > 0) return 0; /* Items with delayed consume are not meant to work while in mounts except reins of mount(12622) */ @@ -5175,10 +5154,8 @@ int pc_useitem(struct map_session_data *sd,int n) { script->potion_flag = 3; //Even more effective potions. } - //Update item use time. + // Update item use time. sd->canuseitem_tick = tick + battle_config.item_use_interval; - if( itemdb_iscashfood(nameid) ) - sd->canusecashfood_tick = tick + battle_config.cashfood_use_interval; script->run_use_script(sd, sd->inventory_data[n], npc->fake_nd->bl.id); script->potion_flag = 0; @@ -5495,13 +5472,6 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl, uint16 skil //Logs items, Stolen from mobs [Lupus] logs->pick_mob(md, LOG_TYPE_STEAL, -1, &tmp_item, data); - //A Rare Steal Global Announce by Lupus - if(md->db->dropitem[i].p<=battle_config.rare_drop_announce) { - char message[128]; - sprintf (message, msg_txt(542), sd->status.name, md->db->jname, data->jname, (float)md->db->dropitem[i].p / 100); - //MSG: "'%s' stole %s's %s (chance: %0.02f%%)" - intif->broadcast(message, (int)strlen(message)+1, BC_DEFAULT); - } return 1; } @@ -8145,6 +8115,7 @@ int pc_readparam(const struct map_session_data *sd, int type) case SP_SKILLPOINT: val = sd->status.skill_point; break; case SP_STATUSPOINT: val = sd->status.status_point; break; case SP_ZENY: val = sd->status.zeny; break; + case SP_BANKVAULT: val = sd->status.bank_vault; break; 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; @@ -8289,6 +8260,7 @@ int pc_readparam(const struct map_session_data *sd, int type) *------------------------------------------*/ int pc_setparam(struct map_session_data *sd,int type,int val) { + int delta; nullpo_ret(sd); switch(type){ @@ -8339,6 +8311,19 @@ int pc_setparam(struct map_session_data *sd,int type,int val) logs->zeny(sd, LOG_TYPE_SCRIPT, sd, -(sd->status.zeny - cap_value(val, 0, MAX_ZENY))); sd->status.zeny = cap_value(val, 0, MAX_ZENY); break; + case SP_BANKVAULT: + val = cap_value(val, 0, MAX_BANK_ZENY); + delta = (val - sd->status.bank_vault); + sd->status.bank_vault = val; + if (map->save_settings & 256) { + chrif->save(sd, 0); // send to char server + } + if (delta > 0) { + clif->bank_deposit(sd, BDA_SUCCESS); + } else if (delta < 0) { + clif->bank_withdraw(sd, BWA_SUCCESS); + } + return 1; // the vault uses a different packet case SP_BASEEXP: if(pc->nextbaseexp(sd) > 0) { sd->status.base_exp = val; |