diff options
Diffstat (limited to 'src/map/pc.c')
-rw-r--r-- | src/map/pc.c | 47 |
1 files changed, 36 insertions, 11 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index 5ef0075bc..567348d20 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -1,7 +1,23 @@ -// Copyright (c) Hercules Dev Team, licensed under GNU GPL. -// See the LICENSE file -// Portions Copyright (c) Athena Dev Teams - +/** + * This file is part of Hercules. + * http://herc.ws - http://github.com/HerculesWS/Hercules + * + * Copyright (C) 2012-2015 Hercules Dev Team + * Copyright (C) Athena Dev Teams + * + * Hercules is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ #define HERCULES_CORE #include "config/core.h" // DBPATH, GP_BOUND_ITEMS, MAX_SPIRITBALL, RENEWAL, RENEWAL_ASPD, RENEWAL_CAST, RENEWAL_DROP, RENEWAL_EXP, SECURE_NPCTIMEOUT @@ -1167,6 +1183,9 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim clif->authfail_fd(sd->fd, 0); return false; } + } else if (map->getcell(map->mapindex2mapid(sd->status.last_point.map), &sd->bl, sd->status.last_point.x, sd->status.last_point.y, CELL_CHKNOPASS)) { + //warp player stuck in invaild cell + pc->setpos(sd,sd->status.last_point.map,0,0,CLR_OUTSIGHT); } clif->authok(sd); @@ -2842,6 +2861,10 @@ int pc_bonus(struct map_session_data *sd,int type,int val) { if (sd->state.lr_flag != 2) pc->bonus_item_drop(sd->add_drop, ARRAYLENGTH(sd->add_drop), 0, val, map->race_id2mask(RC_ALL), 10000); break; + case SP_ADDMAXWEIGHT: + if (sd->state.lr_flag != 2) + sd->max_weight += val; + break; default: ShowWarning("pc_bonus: unknown type %d %d !\n",type,val); break; @@ -3603,13 +3626,13 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val) break; case SP_ADD_MONSTER_DROP_CHAINITEM: { - uint32 race_mask = map->race_id2mask(type2); + uint32 race_mask = map->race_id2mask(val); if (race_mask == RCMASK_NONE) { - ShowWarning("pc_bonus2: SP_ADD_MONSTER_DROP_CHAINITEM: Invalid Race (%d)\n", type2); + ShowWarning("pc_bonus2: SP_ADD_MONSTER_DROP_CHAINITEM: Invalid Race (%d)\n", val); break; } if (sd->state.lr_flag != 2) - pc->bonus_item_drop(sd->add_drop, ARRAYLENGTH(sd->add_drop), 0, val, race_mask, 10000); + pc->bonus_item_drop(sd->add_drop, ARRAYLENGTH(sd->add_drop), 0, type2, race_mask, 10000); } break; #ifdef RENEWAL @@ -3642,7 +3665,7 @@ int pc_bonus3(struct map_session_data *sd,int type,int type2,int type3,int val) switch(type){ case SP_ADD_MONSTER_DROP_ITEM: { - uint32 race_mask = map->race_id2mask(type2); + uint32 race_mask = map->race_id2mask(type3); if (race_mask == RCMASK_NONE) { ShowWarning("pc_bonus2: SP_ADD_MONSTER_DROP_ITEM: Invalid Race (%d)\n", type3); break; @@ -4711,7 +4734,7 @@ int pc_isUseitem(struct map_session_data *sd,int n) case ITEMID_THICK_MANUAL50: case ITEMID_NOBLE_NAMEPLATE: case ITEMID_BATTLE_MANUAL25: - case ITEMIDBATTLE_MANUAL100: + case ITEMID_BATTLE_MANUAL100: case ITEMID_BATTLE_MANUAL_X3: if( sd->sc.data[SC_CASH_PLUSEXP] ) return 0; @@ -4861,7 +4884,7 @@ int pc_useitem(struct map_session_data *sd,int n) { sd->sc.data[SC_DEEP_SLEEP] || sd->sc.data[SC_SATURDAY_NIGHT_FEVER] || sd->sc.data[SC_COLD] || - (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOITEM) + pc_ismuted(&sd->sc, MANNER_NOITEM) )) return 0; @@ -6553,6 +6576,8 @@ void pc_calcexp(struct map_session_data *sd, unsigned int *base_exp, unsigned in if (sd->sc.data[SC_CASH_PLUSEXP]) bonus += sd->sc.data[SC_CASH_PLUSEXP]->val1; + if (sd->sc.data[SC_OVERLAPEXPUP]) + bonus += sd->sc.data[SC_OVERLAPEXPUP]->val1; *base_exp = (unsigned int) cap_value(*base_exp + (double)*base_exp * bonus/100., 1, UINT_MAX); @@ -8850,7 +8875,7 @@ bool pc_can_talk( struct map_session_data *sd ) { if( sd->sc.data[SC_BERSERK] || (sd->sc.data[SC_DEEP_SLEEP] && sd->sc.data[SC_DEEP_SLEEP]->val2) || - (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT) ) + pc_ismuted(&sd->sc, MANNER_NOCHAT) ) return false; return true; |