diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/map/map.h | 4 | ||||
-rw-r--r-- | src/map/party.c | 12 | ||||
-rw-r--r-- | src/map/pc.c | 46 | ||||
-rw-r--r-- | src/map/skill.c | 20 |
4 files changed, 55 insertions, 27 deletions
diff --git a/src/map/map.h b/src/map/map.h index 96cbc9fb3..fb11bc784 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -293,6 +293,8 @@ struct map_session_data { int addrace2[6],addrace2_[6]; int subsize[3]; short unequip_damage; + int itemid; + int itemhealrate[6]; short spiritball, spiritball_old; int spirit_timer[MAX_SKILL_LEVEL]; @@ -640,7 +642,7 @@ enum { SP_CRIT_ATK_RATE, SP_CRITICAL_ADDRACE, SP_NO_REGEN, SP_ADDEFF_WHENHIT, SP_AUTOSPELL_WHENHIT, // 2013-2017 SP_SKILL_ATK, SP_UNSTRIPABLE, SP_ADD_DAMAGE_BY_CLASS, // 2018-2020 SP_SP_GAIN_VALUE, SP_IGNORE_DEF_MOB, SP_HP_LOSS_RATE, SP_ADDRACE2, SP_HP_GAIN_VALUE, // 2021-2025 - SP_SUBSIZE, SP_DAMAGE_WHEN_UNEQUIP // 2026 + SP_SUBSIZE, SP_DAMAGE_WHEN_UNEQUIP, SP_ADD_ITEM_HEAL_RATE // 2026-2028 }; enum { diff --git a/src/map/party.c b/src/map/party.c index 6c6bf9567..85774c33b 100644 --- a/src/map/party.c +++ b/src/map/party.c @@ -250,11 +250,13 @@ int party_reply_invite(struct map_session_data *sd,int account_id,int flag) // パーティが追加された int party_member_added(int party_id,int account_id,int flag) { - struct map_session_data *sd= map_id2sd(account_id),*sd2; - if(sd==NULL && flag==0){ - if(battle_config.error_log) - printf("party: member added error %d is not online\n",account_id); - intif_party_leave(party_id,account_id); // キャラ側に登録できなかったため脱退要求を出す + struct map_session_data *sd = map_id2sd(account_id),*sd2; + if(sd == NULL){ + if (flag == 0) { + if(battle_config.error_log) + printf("party: member added error %d is not online\n",account_id); + intif_party_leave(party_id,account_id); // キャラ側に登録できなかったため脱退要求を出す + } return 0; } sd2=map_id2sd(sd->party_invite_account); diff --git a/src/map/pc.c b/src/map/pc.c index 52c2b6a8f..20f5d8854 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -1855,6 +1855,10 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val) if(sd->state.lr_flag != 2) sd->subsize[type2]+=val; break; + case SP_ADD_ITEM_HEAL_RATE: + if(sd->state.lr_flag != 2) + sd->itemhealrate[type2 - 1] += val; + break; default: if(battle_config.error_log) @@ -2421,17 +2425,18 @@ int pc_isUseitem(struct map_session_data *sd,int n) */ int pc_useitem(struct map_session_data *sd,int n) { - int nameid,amount; + int amount; nullpo_retr(1, sd); if(n >=0 && n < MAX_INVENTORY) { - nameid = sd->status.inventory[n].nameid; + sd->itemid = sd->status.inventory[n].nameid; amount = sd->status.inventory[n].amount; if(sd->status.inventory[n].nameid <= 0 || sd->status.inventory[n].amount <= 0 || sd->sc_data[SC_BERSERK].timer!=-1 || sd->sc_data[SC_MARIONETTE].timer!=-1 || + (pc_issit(sd) && (sd->itemid == 605 || sd->itemid == 606)) || //added item_noequip.txt items check by Maya&[Lupus] (map[sd->bl.m].flag.pvp && (sd->inventory_data[n]->flag.no_equip&1) ) || // PVP (map[sd->bl.m].flag.gvg && (sd->inventory_data[n]->flag.no_equip>1) ) || // GVG @@ -2439,6 +2444,7 @@ int pc_useitem(struct map_session_data *sd,int n) clif_useitemack(sd,n,0,0); return 1; } + if(sd->inventory_data[n]) run_script(sd->inventory_data[n]->use_script,0,sd->bl.id,0); @@ -2902,7 +2908,7 @@ int pc_setpos(struct map_session_data *sd,char *mapname_org,int x,int y,int clrt status_change_end(&sd->bl, SC_HIDING, -1); if(sd->status.option&4) status_change_end(&sd->bl, SC_CLOAKING, -1); - if(sd->status.option&16386) + if(sd->status.option&16384) status_change_end(&sd->bl, SC_CHASEWALK, -1); if(sd->status.pet_id > 0 && sd->pd && sd->pet.intimate > 0) { @@ -4588,7 +4594,7 @@ int pc_damage(struct block_list *src,struct map_session_data *sd,int damage) status_change_end(&sd->bl, SC_HIDING, -1); if(sd->status.option&4) status_change_end(&sd->bl, SC_CLOAKING, -1); - if(sd->status.option&16386) + if(sd->status.option&16384) status_change_end(&sd->bl, SC_CHASEWALK, -1); if(sd->status.hp>0){ @@ -5124,7 +5130,7 @@ int pc_heal(struct map_session_data *sd,int hp,int sp) */ int pc_itemheal(struct map_session_data *sd,int hp,int sp) { - int bonus; + int bonus, type = 0; // if(battle_config.battle_log) // printf("heal %d %d\n",hp,sp); @@ -5147,19 +5153,33 @@ int pc_itemheal(struct map_session_data *sd,int hp,int sp) if(sp > 0) sp = 0; } + + if (sd->itemid >= 501 && sd->itemid <= 505) + type = 1; // potions + else if (sd->itemid >= 507 && sd->itemid <= 510) + type = 2; // herbs + else if (sd->itemid >= 512 && sd->itemid <= 516) + type = 3; // fruits + else if (sd->itemid == 517 || sd->itemid == 528) + type = 4; // meat + else if (sd->itemid == 529 || sd->itemid == 530) + type = 5; // candy + else if (sd->itemid >= 531 && sd->itemid <= 534) + type = 6; // juice + else if (sd->itemid == 544 || sd->itemid == 551) + type = 7; // sashimi + if(hp > 0) { - bonus = (sd->paramc[2]<<1) + 100 + pc_checkskill(sd,SM_RECOVERY)*10; - if(bonus != 100) - hp = hp * bonus / 100; - bonus = 100 + pc_checkskill(sd,AM_LEARNINGPOTION)*5; + bonus = (sd->paramc[2]<<1) + 100 + pc_checkskill(sd,SM_RECOVERY)*10 + + pc_checkskill(sd,AM_LEARNINGPOTION)*5; + if (type > 0) + bonus += sd->itemhealrate[type - 1]; if(bonus != 100) hp = hp * bonus / 100; } if(sp > 0) { - bonus = (sd->paramc[3]<<1) + 100 + pc_checkskill(sd,MG_SRECOVERY)*10; - if(bonus != 100) - sp = sp * bonus / 100; - bonus = 100 + pc_checkskill(sd,AM_LEARNINGPOTION)*5; + bonus = (sd->paramc[3]<<1) + 100 + pc_checkskill(sd,MG_SRECOVERY)*10 + + pc_checkskill(sd,AM_LEARNINGPOTION)*5; if(bonus != 100) sp = sp * bonus / 100; } diff --git a/src/map/skill.c b/src/map/skill.c index 296c95f93..75df62f6b 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -5030,6 +5030,7 @@ struct skill_unit_group *skill_unitsetting( struct block_list *src, int skillid, int target,interval,range,unit_flag; struct skill_unit_layout *layout; struct status_change *sc_data; + int active_flag=1; nullpo_retr(0, src); @@ -5060,6 +5061,7 @@ struct skill_unit_group *skill_unitsetting( struct block_list *src, int skillid, val1=skilllv+6; if(flag==0) limit=2000; + active_flag=0; break; case PR_SANCTUARY: /* サンクチュアリ */ @@ -5264,7 +5266,7 @@ struct skill_unit_group *skill_unitsetting( struct block_list *src, int skillid, break; } } - if (range==0) + if (range==0 && active_flag) map_foreachinarea(skill_unit_effect,unit->bl.m ,unit->bl.x,unit->bl.y,unit->bl.x,unit->bl.y ,0,&unit->bl,gettick(),1); @@ -8059,19 +8061,22 @@ int skill_encchant_eremental_end(struct block_list *bl,int type) /* クロ?キング?査(周りに移動不可能地?があるか) */ int skill_check_cloaking(struct block_list *bl) { + struct map_session_data *sd = NULL; static int dx[]={ 0, 1, 0, -1, -1, 1, 1, -1}; //optimized by Lupus static int dy[]={-1, 0, 1, 0, -1, -1, 1, 1}; int end=1,i; - //missing sd [Found by Celest, commited by Aria] - struct map_session_data *sd=(struct map_session_data *)bl; - nullpo_retr(0, bl); if(bl->type == BL_PC && !battle_config.pc_cloak_check_type) // If it's No it shouldn't be checked return 0; else if(bl->type == BL_MOB && !battle_config.monster_cloak_check_type) return 0; + + //missing sd [Found by Celest, commited by Aria] + if (bl->type == BL_PC) + sd=(struct map_session_data *)bl; + for(i=0;i<sizeof(dx)/sizeof(dx[0]);i++){ if(map_getcell(bl->m,bl->x+dx[i],bl->y+dy[i],CELL_CHKNOPASS)) { end=0; @@ -8079,17 +8084,16 @@ int skill_check_cloaking(struct block_list *bl) } } if(end){ - if ((bl->type == BL_PC && pc_checkskill(sd,AS_CLOAKING)<3) || bl->type == BL_MOB) { + if ((sd && pc_checkskill(sd,AS_CLOAKING)<3) || bl->type == BL_MOB) { status_change_end(bl, SC_CLOAKING, -1); - *status_get_option(bl)&=~4; /* 念のための?理 */ } - else if (bl->type == BL_PC && sd->sc_data[SC_CLOAKING].val3 != 130) { + else if (sd && sd->sc_data[SC_CLOAKING].val3 != 130) { sd->sc_data[SC_CLOAKING].val3 = 130; status_calc_speed (sd); } } else { - if (bl->type == BL_PC && sd->sc_data[SC_CLOAKING].val3 != 103) { + if (sd && sd->sc_data[SC_CLOAKING].val3 != 103) { sd->sc_data[SC_CLOAKING].val3 = 103; status_calc_speed (sd); } |