diff options
-rw-r--r-- | src/map/battle.c | 48 | ||||
-rw-r--r-- | src/map/battle.h | 3 | ||||
-rw-r--r-- | src/map/clif.c | 7 | ||||
-rw-r--r-- | src/map/guild.c | 27 | ||||
-rw-r--r-- | src/map/map.h | 4 | ||||
-rw-r--r-- | src/map/mob.c | 29 | ||||
-rw-r--r-- | src/map/pc.c | 52 | ||||
-rw-r--r-- | src/map/skill.c | 61 | ||||
-rw-r--r-- | src/map/skill.h | 8 |
9 files changed, 186 insertions, 53 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index 7c2090b6b..8140e0bb3 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -2786,8 +2786,10 @@ static struct Damage battle_calc_pc_weapon_attack( struct mob_data *tmd=NULL; int hitrate,flee,cri = 0,atkmin,atkmax; int dex,luk,target_count = 1; + int no_cardfix=0; int def1 = battle_get_def(target); int def2 = battle_get_def2(target); +// int mdef1, mdef2; int t_vit = battle_get_vit(target); struct Damage wd; int damage,damage2,damage3=0,damage4=0,type,div_,blewcount=skill_get_blewcount(skill_num,skill_lv); @@ -3307,6 +3309,9 @@ static struct Damage battle_calc_pc_weapon_attack( break; case CR_GRANDCROSS: hitrate= 1000000; + if(!battle_config.gx_cardfix) + + no_cardfix = 1; break; case AM_DEMONSTRATION: // デモンストレーション damage = damage*(100+ 20*skill_lv)/100; @@ -3418,6 +3423,7 @@ static struct Damage battle_calc_pc_weapon_attack( case ASC_METEORASSAULT: /* メテオアサルト */ damage = damage*(40+ 40*skill_lv)/100; damage2 = damage2*(40+ 40*skill_lv)/100; + no_cardfix = 1; break; case SN_SHARPSHOOTING: /* シャープシューティング */ damage += damage*(30*skill_lv)/100; @@ -3548,6 +3554,25 @@ static struct Damage battle_calc_pc_weapon_attack( } } } + + // 状態異常中のダメージ追加でクリティカルにも有効なスキル + + if (sc_data) { + + // エンチャントデッドリーポイズン + + if(sc_data[SC_EDP].timer != -1) { + + damage += damage * (150 + sc_data[SC_EDP].val1 * 50) / 100; + + damage2 += damage2 * (150 + sc_data[SC_EDP].val1 * 50) / 100; + + no_cardfix = 1; + + } + + } + // 精錬ダメージの追加 if( skill_num != MO_INVESTIGATE && skill_num != MO_EXTREMITYFIST) { //DEF, VIT無視 damage += battle_get_atk2(src); @@ -3614,7 +3639,7 @@ static struct Damage battle_calc_pc_weapon_attack( //Advanced Katar Research by zanetheinsane if(sd->weapontype1 == 0x10 || sd->weapontype2 == 0x10){ if((skill = pc_checkskill(sd,ASC_KATAR)) > 0) { - damage += (damage*((skill*2)+10)) / 100 ; + damage += damage*(10+(skill * 2))/100; } } @@ -3667,8 +3692,8 @@ static struct Damage battle_calc_pc_weapon_attack( break; } } - if(skill_num != CR_GRANDCROSS || !battle_config.gx_cardfix) - damage=damage*cardfix/100; //カード補正によるダメージ増加 + if(!no_cardfix) + damage=damage*cardfix/100; //カード補正によるダメージ増加 //カードによるダメージ増加処理ここまで //カードによるダメージ追加処理(左手)ここから @@ -3689,7 +3714,10 @@ static struct Damage battle_calc_pc_weapon_attack( break; } } - if(skill_num != CR_GRANDCROSS) damage2=damage2*cardfix/100; //カード補正による左手ダメージ増加 + if(!no_cardfix) + + damage2=damage2*cardfix/100; +//カード補正による左手ダメージ増加 //カードによるダメージ増加処理(左手)ここまで // -- moonsoul (cardfix for magic damage portion of ASC_BREAKER) @@ -4465,6 +4493,12 @@ int battle_weapon_attack( struct block_list *src,struct block_list *target, return 0; } + if(battle_check_target(src,target,BCT_ENEMY) <= 0 && + + !battle_check_range(src,target,0)) + + return 0; // 攻撃対象外 + race = battle_get_race(target); ele = battle_get_elem_type(target); if(battle_check_target(src,target,BCT_ENEMY) > 0 && @@ -5012,6 +5046,7 @@ static const struct { { "player_skillup_limit", &battle_config.skillup_limit }, { "weapon_produce_rate", &battle_config.wp_rate }, { "potion_produce_rate", &battle_config.pp_rate }, + { "deadly_potion_produce_rate", &battle_config.cdp_rate }, { "monster_active_enable", &battle_config.monster_active_enable }, { "monster_damage_delay_rate", &battle_config.monster_damage_delay_rate}, { "monster_loot_type", &battle_config.monster_loot_type }, @@ -5100,6 +5135,7 @@ static const struct { { "making_arrow_name_input", &battle_config.making_arrow_name_input }, { "holywater_name_input", &battle_config.holywater_name_input }, { "display_delay_skill_fail", &battle_config.display_delay_skill_fail }, + { "display_snatcher_skill_fail", &battle_config.display_snatcher_skill_fail }, { "chat_warpportal", &battle_config.chat_warpportal }, { "mob_warpportal", &battle_config.mob_warpportal }, { "dead_branch_active", &battle_config.dead_branch_active }, @@ -5114,6 +5150,7 @@ static const struct { { "gx_cardfix", &battle_config.gx_cardfix }, { "gx_dupele", &battle_config.gx_dupele }, { "gx_disptype", &battle_config.gx_disptype }, + { "devotion_level_difference", &battle_config.devotion_level_difference }, { "player_skill_partner_check", &battle_config.player_skill_partner_check}, { "hide_GM_session", &battle_config.hide_GM_session }, { "unit_movement_type", &battle_config.unit_movement_type }, @@ -5240,6 +5277,7 @@ void battle_set_defaults() { battle_config.skillup_limit = 0; battle_config.wp_rate=100; battle_config.pp_rate=100; + battle_config.cdp_rate=100; battle_config.monster_active_enable=1; battle_config.monster_damage_delay_rate=100; battle_config.monster_loot_type=0; @@ -5329,6 +5367,7 @@ void battle_set_defaults() { battle_config.making_arrow_name_input = 1; battle_config.holywater_name_input = 1; battle_config.display_delay_skill_fail = 1; + battle_config.display_snatcher_skill_fail = 1; battle_config.chat_warpportal = 0; battle_config.mob_warpportal = 0; battle_config.dead_branch_active = 0; @@ -5343,6 +5382,7 @@ void battle_set_defaults() { battle_config.gx_cardfix = 0; battle_config.gx_dupele = 1; battle_config.gx_disptype = 1; + battle_config.devotion_level_difference = 10; battle_config.player_skill_partner_check = 1; battle_config.hide_GM_session = 0; battle_config.unit_movement_type = 0; diff --git a/src/map/battle.h b/src/map/battle.h index df9446285..f6f0345ca 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -174,6 +174,7 @@ extern struct Battle_Config { int skillup_limit; int wp_rate; int pp_rate; + int cdp_rate; int monster_active_enable; int monster_damage_delay_rate; int monster_loot_type; @@ -262,6 +263,7 @@ extern struct Battle_Config { int making_arrow_name_input; int holywater_name_input; int display_delay_skill_fail; + int display_snatcher_skill_fail; int chat_warpportal; int mob_warpportal; int dead_branch_active; @@ -302,6 +304,7 @@ extern struct Battle_Config { int gx_cardfix; int gx_dupele; int gx_disptype; + int devotion_level_difference; int player_skill_partner_check; int hide_GM_session; int unit_movement_type; diff --git a/src/map/clif.c b/src/map/clif.c index 41cc4c13c..101dbbf7e 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -9002,6 +9002,10 @@ void clif_parse_MoveToKafra(int fd, struct map_session_data *sd) { if (item_index < 0 || item_index >= MAX_INVENTORY) return; + if(itemdb_isdropable(sd->status.inventory[item_index].nameid) == 0) + + return; + if (sd->state.storage_flag) storage_guild_storageadd(sd, item_index, item_amount); else @@ -10023,6 +10027,9 @@ static int clif_parse(int fd) { map_deliddb(&sd->bl); // account_id has been included in the DB before auth answer } close(fd); + if (sd) // 追加 + + map_deliddb(&sd->bl); // 追加 delete_session(fd); return 0; } diff --git a/src/map/guild.c b/src/map/guild.c index 411289aa7..ca3bbf1fe 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -54,13 +54,25 @@ int guild_skill_get_inf(int id) { // Modified for new skills [Sara] int guild_skill_get_sp(int id,int lv){ return 0; } int guild_skill_get_range(int id){ return 0; } int guild_skill_get_max(int id) { // Modified for new skills [Sara] - if (id==GD_EXTENSION) return 10; - else if (id==GD_REGENERATION) return 3; + if(id==GD_EXTENSION) return 10; + else if(id==GD_REGENERATION) return 3; else return 1; } // ギルドスキルがあるか確認 -int guild_checkskill(struct guild *g,int id){ return g->skill[id-10000].lv; } +int guild_checkskill(struct guild *g,int id) +{ + + int idx = id-GD_SKILLBASE; + + + if (idx < 0 || idx >= MAX_GUILDSKILL) + + return 0; + + return g->skill[idx].lv; + +} int guild_payexp_timer(int tid,unsigned int tick,int id,int data); @@ -931,17 +943,20 @@ int guild_payexp(struct map_session_data *sd,int exp) int guild_skillup(struct map_session_data *sd,int skill_num,int flag) { struct guild *g; - int idx; + int idx = skill_num - GD_SKILLBASE; nullpo_retr(0, sd); + if(idx < 0 || idx >= MAX_GUILDSKILL) + + return 0; if(sd->status.guild_id==0 || (g=guild_search(sd->status.guild_id))==NULL) return 0; if(strcmp(sd->status.name,g->master)) return 0; if( (g->skill_point>0 || flag&1) && - g->skill[(idx=skill_num-10000)].id!=0 && + g->skill[idx].id!=0 && g->skill[idx].lv < guild_skill_get_max(skill_num) ){ intif_guild_skillup(g->guild_id,skill_num,sd->status.account_id,flag); } @@ -958,7 +973,7 @@ int guild_skillupack(int guild_id,int skill_num,int account_id) if(g==NULL) return 0; if(sd!=NULL) - clif_guild_skillup(sd,skill_num,g->skill[skill_num-10000].lv); + clif_guild_skillup(sd,skill_num,g->skill[skill_num-GD_SKILLBASE].lv); // 全員に通知 for(i=0;i<g->max_member;i++) if((sd=g->member[i].sd)!=NULL) diff --git a/src/map/map.h b/src/map/map.h index 48f1eb750..6b8660998 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -29,7 +29,7 @@ #define NATURAL_HEAL_INTERVAL 500 #define MAX_FLOORITEM 500000 #define MAX_LEVEL 255 -#define MAX_WALKPATH 48 +#define MAX_WALKPATH 32 #define MAX_DROP_PER_MAP 48 #define MAX_IGNORE_LIST 80 @@ -255,6 +255,7 @@ struct map_session_data { short autospell_id,autospell_lv,autospell_rate; short hp_drain_rate,hp_drain_per,sp_drain_rate,sp_drain_per; short hp_drain_rate_,hp_drain_per_,sp_drain_rate_,sp_drain_per_; + short hp_drain_value,sp_drain_value,hp_drain_value_,sp_drain_value_; int short_weapon_damage_return,long_weapon_damage_return; int weapon_coma_ele[10],weapon_coma_race[12]; short break_weapon_rate,break_armor_rate; @@ -582,6 +583,7 @@ enum { SP_ADDEFF2,SP_BREAK_WEAPON_RATE,SP_BREAK_ARMOR_RATE,SP_ADD_STEAL_RATE, // 1067-1070 SP_MAGIC_DAMAGE_RETURN,SP_RANDOM_ATTACK_INCREASE,SP_ALL_STATS,SP_AGI_VIT,SP_AGI_DEX_STR,SP_PERFECT_HIDE, // 1071-1076 SP_DISGUISE,SP_CLASSCHANGE, // 1077-1078 + SP_HP_DRAIN_VALUE,SP_SP_DRAIN_VALUE, // 1079-1080 SP_RESTART_FULL_RECORVER=2000,SP_NO_CASTCANCEL,SP_NO_SIZEFIX,SP_NO_MAGIC_DAMAGE,SP_NO_WEAPON_DAMAGE,SP_NO_GEMSTONE, // 2000-2005 SP_NO_CASTCANCEL2,SP_INFINITE_ENDURE,SP_UNBREAKABLE_WEAPON,SP_UNBREAKABLE_ARMOR // 2006-2009 diff --git a/src/map/mob.c b/src/map/mob.c index 5a0249a6c..93425c81e 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -1590,16 +1590,20 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap) (dist=distance(md->bl.x,md->bl.y,abl->x,abl->y))>=32 || battle_check_target(bl,abl,BCT_ENEMY)==0) md->attacked_id=0; else { - md->target_id=md->attacked_id; // set target - md->state.targettype = ATTACKABLE; - attack_type = 1; - md->attacked_id=0; - md->min_chase=dist+13; - if(md->min_chase>26) - md->min_chase=26; + //距離が遠い場合はタゲを変更しない + + if (!md->target_id || (distance(md->bl.x,md->bl.y,abl->x,abl->y)<3)) { + md->target_id=md->attacked_id; // set target + md->state.targettype = ATTACKABLE; + attack_type = 1; + md->attacked_id=0; + md->min_chase=dist+13; + if(md->min_chase>26) + md->min_chase=26; + } + } } } - } md->state.master_check = 0; // Processing of slave monster @@ -3040,7 +3044,7 @@ int mobskill_castend_id( int tid, unsigned int tick, int id,int data ) if(battle_config.mob_skill_log) printf("MOB skill castend skill=%d, class = %d\n",md->skillid,md->class); - mob_stop_walking(md,0); +// mob_stop_walking(md,0); switch( skill_get_nk(md->skillid) ) { @@ -3171,7 +3175,7 @@ int mobskill_castend_pos( int tid, unsigned int tick, int id,int data ) if(battle_config.mob_skill_log) printf("MOB skill castend skill=%d, class = %d\n",md->skillid,md->class); - mob_stop_walking(md,0); +// mob_stop_walking(md,0); skill_castend_pos2(&md->bl,md->skillx,md->skilly,md->skillid,md->skilllv,tick,0); @@ -3257,6 +3261,7 @@ int mobskill_use_id(struct mob_data *md,struct block_list *target,int skill_idx) if(casttime>0 || forcecast){ // 詠唱が必要 // struct mob_data *md2; + mob_stop_walking(md,0); // 歩行停止 clif_skillcasting( &md->bl, md->bl.id, target->id, 0,0, skill_id,casttime); @@ -3352,9 +3357,11 @@ int mobskill_use_pos( struct mob_data *md, printf("MOB skill use target_pos=(%d,%d) skill=%d lv=%d cast=%d, class = %d\n", skill_x,skill_y,skill_id,skill_lv,casttime,md->class); - if( casttime>0 ) // A cast time is required. + if( casttime>0 ) { // A cast time is required. + mob_stop_walking(md,0); // 歩行停止 clif_skillcasting( &md->bl, md->bl.id, 0, skill_x,skill_y, skill_id,casttime); + } if( casttime<=0 ) // A skill without a cast time wont be cancelled. md->state.skillcastcancel=0; diff --git a/src/map/pc.c b/src/map/pc.c index b037efbeb..892f339a5 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -2727,6 +2727,25 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val) sd->hp_drain_per_ += val; } break; + case SP_HP_DRAIN_VALUE: + + if(!sd->state.lr_flag) { + + sd->hp_drain_rate += type2; + + sd->hp_drain_value += val; + + } + + else if(sd->state.lr_flag == 1) { + + sd->hp_drain_rate_ += type2; + + sd->hp_drain_value_ += val; + + } + + break; case SP_SP_DRAIN_RATE: if(!sd->state.lr_flag) { sd->sp_drain_rate += type2; @@ -2737,6 +2756,25 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val) sd->sp_drain_per_ += val; } break; + case SP_SP_DRAIN_VALUE: + + if(!sd->state.lr_flag) { + + sd->sp_drain_rate += type2; + + sd->sp_drain_value += val; + + } + + else if(sd->state.lr_flag == 1) { + + sd->sp_drain_rate_ += type2; + + sd->sp_drain_value_ += val; + + } + + break; case SP_WEAPON_COMA_ELE: if(sd->state.lr_flag != 2) sd->weapon_coma_ele[type2] += val; @@ -3107,6 +3145,16 @@ int pc_dropitem(struct map_session_data *sd,int n,int amount) { nullpo_retr(1, sd); + if(n < 0 || n >= MAX_INVENTORY) + + return 1; + + + if(amount <= 0) + + return 1; + + if (sd->status.inventory[n].nameid <= 0 || sd->status.inventory[n].amount < amount || sd->trade_partner != 0 || sd->vender_id != 0 || @@ -3240,8 +3288,10 @@ int pc_useitem(struct map_session_data *sd,int n) if(sd->inventory_data[n]) run_script(sd->inventory_data[n]->use_script,0,sd->bl.id,0); - clif_useitemack(sd,n,amount-1,1); pc_delitem(sd,n,1,1); + amount = sd->status.inventory[n].amount; + + clif_useitemack(sd,n,amount,1); } return 0; diff --git a/src/map/skill.c b/src/map/skill.c index cd83e2b39..2be4cab6e 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -232,7 +232,11 @@ int SkillStatusChangeTable[]={ /* skill.hのenumのSC_***とあわせること */ -1,-1, SC_GOSPEL, /* 370- */ - -1,-1,-1,-1,-1,-1,-1,-1,SC_EDP,-1, + -1,-1,-1,-1,-1,-1,-1,-1, + + SC_EDP, + + -1, /* 380- */ SC_TRUESIGHT, -1,-1, @@ -1053,8 +1057,8 @@ int skill_additional_effect( struct block_list* src, struct block_list *bl,int s if((skill*15 + 55) + (skill2 = pc_checkskill(sd,TF_STEAL))*10 > rand()%1000) { if(pc_steal_item(sd,bl)) clif_skill_nodamage(src,bl,TF_STEAL,skill2,1); - //else - // clif_skill_fail(sd,skillid,0,0); // it's annoying! =p [Celest] + else if (battle_config.display_snatcher_skill_fail) + clif_skill_fail(sd,skillid,0,0); // it's annoying! =p [Celest] } // エンチャントデットリ?ポイズン(猛毒?果) if (sd && sd->sc_data[SC_EDP].timer != -1 && rand() % 10000 < sd->sc_data[SC_EDP].val2 * sc_def_vit) { @@ -2559,6 +2563,7 @@ int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int s case WZ_JUPITEL: /* ユピテルサンダ? */ case NPC_MAGICALATTACK: /* MOB:魔法打?攻? */ case PR_ASPERSIO: /* アスペルシオ */ +// case HW_NAPALMVULCAN: /* ナパームバルカン */ skill_attack(BF_MAGIC,src,src,bl,skillid,skilllv,tick,flag); break; @@ -2612,34 +2617,34 @@ int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int s } break; - case HW_NAPALMVULCAN: // Fixed By SteelViruZ - if(flag&1){ - if(bl->id!=skill_area_temp[1]){ - skill_attack(BF_MAGIC,src,src,bl,skillid,skilllv,tick, - skill_area_temp[0]); - } - }else{ - int ar=(skillid==HW_NAPALMVULCAN)?1:2; - skill_area_temp[1]=bl->id; - if(skillid==HW_NAPALMVULCAN){ - skill_area_temp[0]=0; - map_foreachinarea(skill_area_sub, - bl->m,bl->x-1,bl->y-1,bl->x+1,bl->y+1,0, - src,skillid,skilllv,tick, flag|BCT_ENEMY , - skill_area_sub_count); - }else{ - skill_area_temp[0]=0; - skill_area_temp[2]=bl->x; - skill_area_temp[3]=bl->y; - } + case HW_NAPALMVULCAN: // Fixed By SteelViruZ + if(flag&1){ + if(bl->id!=skill_area_temp[1]){ skill_attack(BF_MAGIC,src,src,bl,skillid,skilllv,tick, - skill_area_temp[0] ); + skill_area_temp[0]); + } + }else{ + int ar=(skillid==HW_NAPALMVULCAN)?1:2; + skill_area_temp[1]=bl->id; + if(skillid==HW_NAPALMVULCAN){ + skill_area_temp[0]=0; map_foreachinarea(skill_area_sub, - bl->m,bl->x-ar,bl->y-ar,bl->x+ar,bl->y+ar,0, - src,skillid,skilllv,tick, flag|BCT_ENEMY|1, - skill_castend_damage_id); + bl->m,bl->x-1,bl->y-1,bl->x+1,bl->y+1,0, + src,skillid,skilllv,tick, flag|BCT_ENEMY , + skill_area_sub_count); + }else{ + skill_area_temp[0]=0; + skill_area_temp[2]=bl->x; + skill_area_temp[3]=bl->y; } - break; + skill_attack(BF_MAGIC,src,src,bl,skillid,skilllv,tick, + skill_area_temp[0] ); + map_foreachinarea(skill_area_sub, + bl->m,bl->x-ar,bl->y-ar,bl->x+ar,bl->y+ar,0, + src,skillid,skilllv,tick, flag|BCT_ENEMY|1, + skill_castend_damage_id); + } + break; case WZ_FROSTNOVA: /* フロストノヴァ */ skill_castend_pos2(src,bl->x,bl->y,skillid,skilllv,tick,0); diff --git a/src/map/skill.h b/src/map/skill.h index 83150b044..3b2a942f0 100644 --- a/src/map/skill.h +++ b/src/map/skill.h @@ -311,6 +311,9 @@ enum { // struct map_session_data の status_changeの番?テ?ブル SC_SPIDERWEB =180, /* スパイダ?ウェッブ */ SC_MEMORIZE =181, /* メモライズ */ +// SC_DPOISON =182, /* 猛毒 */ + +// SC_EDP =183, /* エフェクトが判明したら移動 */ SC_WEDDING =187, //結婚用(結婚衣裳になって?くのが?いとか) SC_NOCHAT =188, //赤エモ?態 @@ -860,7 +863,8 @@ enum { CR_FULLPROTECTION, ITM_TOMAHAWK, - GD_APPROVAL=10000, +// moved to common/mmo.h +/* GD_APPROVAL=10000, GD_KAFRACONTACT=10001, GD_GUARDIANRESEARCH=10002, GD_GUARDUP=10003, @@ -874,7 +878,7 @@ enum { GD_REGENERATION=10011, GD_RESTORE=10012, GD_EMERGENCYCALL=10013, - GD_DEVELOPMENT=10014, + GD_DEVELOPMENT=10014,*/ }; #endif |