diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/battle.c | 14 | ||||
-rw-r--r-- | src/map/map.c | 33 | ||||
-rw-r--r-- | src/map/skill.c | 67 | ||||
-rw-r--r-- | src/map/status.c | 4 |
4 files changed, 53 insertions, 65 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index 421f85ec3..3529b9946 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -396,7 +396,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i } if(sc_data[SC_FOGWALL].timer != -1 && flag&BF_MAGIC) - if(rand()%100 < sc_data[SC_FOGWALL].val2) + if(rand()%100 < 75) damage = 0; } @@ -978,7 +978,7 @@ static struct Damage battle_calc_pet_weapon_attack( // 回避修正 if( hitrate < 1000000 && t_sc_data ) { // 必中攻撃 if(t_sc_data[SC_FOGWALL].timer != -1 && flag&BF_LONG) - hitrate -= 50; + hitrate -= 75; if (t_sc_data[SC_SLEEP].timer!=-1 || // 睡眠は必中 t_sc_data[SC_STAN].timer!=-1 || // スタンは必中 t_sc_data[SC_FREEZE].timer!=-1 || @@ -1000,7 +1000,7 @@ static struct Damage battle_calc_pet_weapon_attack( if(t_sc_data[SC_DEFENDER].timer != -1 && flag&BF_LONG) cardfix=cardfix*(100-t_sc_data[SC_DEFENDER].val2)/100; if(t_sc_data[SC_FOGWALL].timer != -1 && flag&BF_LONG) - cardfix=cardfix*(100-t_sc_data[SC_FOGWALL].val2)/100; + cardfix=cardfix*50/100; if(cardfix != 100) damage=damage*cardfix/100; } @@ -1488,7 +1488,7 @@ static struct Damage battle_calc_mob_weapon_attack( // 回避修正 if( hitrate < 1000000 && t_sc_data ) { // 必中攻撃 if(t_sc_data[SC_FOGWALL].timer != -1 && flag&BF_LONG) - hitrate -= 50; + hitrate -= 75; if (t_sc_data[SC_SLEEP].timer!=-1 || // 睡眠は必中 t_sc_data[SC_STAN].timer!=-1 || // スタンは必中 t_sc_data[SC_FREEZE].timer!=-1 || @@ -1537,7 +1537,7 @@ static struct Damage battle_calc_mob_weapon_attack( if(t_sc_data[SC_DEFENDER].timer != -1 && flag&BF_LONG) cardfix=cardfix*(100-t_sc_data[SC_DEFENDER].val2)/100; if(t_sc_data[SC_FOGWALL].timer != -1 && flag&BF_LONG) - cardfix=cardfix*(100-t_sc_data[SC_FOGWALL].val2)/100; + cardfix=cardfix*50/100; if(cardfix != 100) damage=damage*cardfix/100; } @@ -2495,7 +2495,7 @@ static struct Damage battle_calc_pc_weapon_attack( // 回避修正 if( hitrate < 1000000 && t_sc_data ) { // 必中攻撃 if(t_sc_data[SC_FOGWALL].timer != -1 && flag&BF_LONG) - hitrate -= 50; + hitrate -= 75; if (t_sc_data[SC_SLEEP].timer!=-1 || // 睡眠は必中 t_sc_data[SC_STAN].timer!=-1 || // スタンは必中 t_sc_data[SC_FREEZE].timer!=-1 || @@ -2635,7 +2635,7 @@ static struct Damage battle_calc_pc_weapon_attack( if(t_sc_data[SC_DEFENDER].timer != -1 && flag&BF_LONG) //ディフェンダー状態で遠距離攻撃 cardfix=cardfix*(100-t_sc_data[SC_DEFENDER].val2)/100; //ディフェンダーによる減衰 if(t_sc_data[SC_FOGWALL].timer != -1 && flag&BF_LONG) - cardfix=cardfix*(100-t_sc_data[SC_FOGWALL].val2)/100; + cardfix=cardfix*50/100; if(cardfix != 100) { damage=damage*cardfix/100; //ディフェンダー補正によるダメージ減少 damage2=damage2*cardfix/100; //ディフェンダー補正による左手ダメージ減少 diff --git a/src/map/map.c b/src/map/map.c index 902306ce8..4a9fc171e 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -103,9 +103,7 @@ int read_gm_interval = 600000; char char_db[32] = "char"; static int online_timer(int,unsigned int,int,int); - int CHECK_INTERVAL = 3600000; // [Valaris] -int check_online_timer=0; // [Valaris] #endif /* not TXT_ONLY */ @@ -1555,9 +1553,7 @@ int map_quit(struct map_session_data *sd) { sd->npc_stackbuf = NULL; } -#ifndef TXT_ONLY chrif_char_offline(sd); -#endif { void *p = numdb_search(charid_db,sd->status.char_id); @@ -3072,41 +3068,27 @@ int log_sql_init(void){ return 0; } -int online_timer(int tid,unsigned int tick,int id,int data) +int online_timer (int tid,unsigned int tick,int id,int data) { if(check_online_timer != tid) return 0; - char_online_check(); - - check_online_timer=add_timer(gettick()+CHECK_INTERVAL,online_timer,0,0); - return 0; } - void char_online_check(void) { int i; - struct map_session_data *sd=NULL; + struct map_session_data *sd; chrif_char_reset_offline(); - for(i=0;i<fd_max;i++){ - if (session[i] && (sd = (struct map_session_data*)session[i]->session_data) && sd && sd->state.auth && - !(battle_config.hide_GM_session && pc_isGM(sd))) - if(sd->status.char_id) { + for (i = 0; i < fd_max; i++) { + if (session[i] && (sd = (struct map_session_data*)session[i]->session_data) && sd->state.auth && + !(battle_config.hide_GM_session && pc_isGM(sd))) + if(sd->status.char_id) chrif_char_online(sd); - } } - - - if(check_online_timer && check_online_timer != -1) { - delete_timer(check_online_timer,online_timer); - add_timer(gettick()+CHECK_INTERVAL,online_timer,0,0); - } - } - #endif /* not TXT_ONLY */ //----------------------------------------------------- @@ -3275,6 +3257,7 @@ int do_init(int argc, char *argv[]) { FILE *data_conf; char line[1024], w1[1024], w2[1024]; + SERVER_TYPE = SERVER_MAP; #ifdef GCOLLECT GC_enable_incremental(); #endif @@ -3398,7 +3381,7 @@ int do_init(int argc, char *argv[]) { #ifndef TXT_ONLY // online status timer, checks every hour [Valaris] add_timer_func_list(online_timer, "online_timer"); - check_online_timer=add_timer(gettick()+CHECK_INTERVAL,online_timer,0,0); + add_timer_interval(gettick()+10, online_timer, 0, 0, CHECK_INTERVAL); #endif /* not TXT_ONLY */ do_init_chrif(); diff --git a/src/map/skill.c b/src/map/skill.c index 63e588eea..887395b40 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -978,8 +978,11 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int status_change_start(bl,SC_AUTOCOUNTER,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); break; case PF_FOGWALL: /* ホ?リ?クロス */ - if(src!=bl && rand()%100 < 3*skilllv*sc_def_int/100 ) - status_change_start(bl,SC_BLIND,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + if (src != bl) { + struct status_change *sc_data = status_get_sc_data(bl); + if (sc_data && sc_data[SC_DELUGE].timer == -1) + status_change_start(bl,SC_BLIND,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + } break; case LK_HEADCRUSH: /* ヘッドクラッシュ */ {//?件が良く分からないので適?に @@ -995,14 +998,11 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int break; case PF_SPIDERWEB: /* スパイダ?ウェッブ */ { - if(bl->type == BL_MOB) - { - int sec=skill_get_time2(skillid,skilllv); - if(map[src->m].flag.pvp) //PvPでは拘束時間半減? - sec = sec/2; - battle_stopwalking(bl,1); - status_change_start(bl,SC_SPIDERWEB,skilllv,0,0,0,sec,0); - } + int sec = skill_get_time2(skillid,skilllv); + if(map[src->m].flag.pvp) //PvPでは拘束時間半減? + sec = sec/2; + battle_stopwalking(bl,1); + status_change_start(bl,SC_SPIDERWEB,skilllv,0,0,0,sec,0); } break; case ASC_METEORASSAULT: /* メテオアサルト */ @@ -4389,16 +4389,19 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in break; case PF_HPCONVERSION: /* ライフ置き換え */ - clif_skill_nodamage(src,bl,skillid,skilllv,1); - if(sd){ - int conv_hp=0,conv_sp=0; - conv_hp=sd->status.hp/10; //基本はHPの10% - sd->status.hp -= conv_hp; //HPを減らす - conv_sp=conv_hp*10*skilllv/100; - conv_sp=(sd->status.sp+conv_sp>sd->status.max_sp)?sd->status.max_sp-sd->status.sp:conv_sp; - sd->status.sp += conv_sp; //SPを?やす - pc_heal(sd,-conv_hp,conv_sp); - clif_heal(sd->fd,SP_SP,conv_sp); + clif_skill_nodamage(src, bl, skillid, skilllv, 1); + if (sd) { + int conv_hp, conv_sp; + conv_hp = sd->status.max_hp / 10; //基本はHPの10% + //sd->status.hp -= conv_hp; //HPを減らす + conv_sp = conv_hp * 10 * skilllv / 100; + if (sd->status.sp + conv_sp > sd->status.max_sp) + conv_hp = sd->status.max_sp - sd->status.sp; + if (pc_checkoversp(sd)) + conv_hp = conv_sp = 0; + //sd->status.sp += conv_sp; //SPを?やす + pc_heal(sd, -conv_hp, conv_sp); + clif_heal(sd->fd, SP_SP, conv_sp); } break; case HT_REMOVETRAP: /* リム?ブトラップ */ @@ -4555,6 +4558,11 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in } break; + case PF_SPIDERWEB: /* スパイダ?ウェッブ */ + clif_skill_nodamage(src,bl,skillid,skilllv,1); + skill_unitsetting(src,skillid,skilllv,bl->x,bl->y,0); + break; + // Weapon Refining [Celest] case WS_WEAPONREFINE: if(sd) @@ -4975,7 +4983,6 @@ int skill_castend_pos2( struct block_list *src, int x,int y,int skillid,int skil case HT_CLAYMORETRAP: /* クレイモア?トラップ */ case AS_VENOMDUST: /* ベノムダスト */ case AM_DEMONSTRATION: /* デモンストレ?ション */ - case PF_SPIDERWEB: /* スパイダ?ウェッブ */ case PF_FOGWALL: /* フォグウォ?ル */ case HT_TALKIEBOX: /* ト?キ?ボックス */ skill_unitsetting(src,skillid,skilllv,x,y,0); @@ -5553,21 +5560,20 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int skill_blown(&src->bl,bl,1); break; - case 0xb6: /* フォグウォ?ル */ + case 0xb6: /* フォグウォ?ル */ if (sc_data && sc_data[type].timer!=-1) { - unit2 = (struct skill_unit *)sc_data[type].val4; - if (unit2 && unit2->group && - (unit2 == src || DIFF_TICK(sg->tick,unit2->group->tick)<=0)) + struct skill_unit_group *sg2 = (struct skill_unit_group *)sc_data[type].val4; + if (sg2 && (sg2 == src->group || DIFF_TICK(sg->tick,sg2->tick)<=0)) break; } - status_change_start(bl,type,sg->skill_lv,sg->val1,sg->val2, - (int)src,skill_get_time2(sg->skill_id,sg->skill_lv),0); - skill_additional_effect(ss,bl,sg->skill_id,sg->skill_lv,BF_MISC,tick); + status_change_start (bl, type, sg->skill_lv, sg->val1, sg->val2, (int)sg, + skill_get_time2(sg->skill_id, sg->skill_lv), 0); + if (battle_check_target(&src->bl,bl,BCT_ENEMY)>0) + skill_additional_effect (ss, bl, sg->skill_id, sg->skill_lv, BF_MISC, tick); break; case 0xb2: /* あなたを_?いたいです */ case 0xb3: /* ゴスペル */ - //case 0xb6: /* フォグウォ?ル */ - moved [celest] //とりあえず何もしない break; /* default: @@ -5911,8 +5917,7 @@ int skill_unit_onout(struct skill_unit *src,struct block_list *bl,unsigned int t case 0xb6: { - struct block_list *target = map_id2bl(sg->val2); - if(target && target==bl) { + if (sc_data[type].timer!=-1 && sc_data[type].val4==(int)sg) { status_change_end(bl,SC_FOGWALL,-1); if (sc_data && sc_data[SC_BLIND].timer!=-1) sc_data[SC_BLIND].timer = add_timer( diff --git a/src/map/status.c b/src/map/status.c index 68212e6e7..4418543de 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -3340,6 +3340,8 @@ int status_change_start(struct block_list *bl,int type,int val1,int val2,int val calc_flag = 1; val3 = val1>=5?15: (val1==4?14: (val1==3?12: ( val1==2?9:5 ) ) ); val4 = val1>=5?20: (val1==4?19: (val1==3?17: ( val1==2?14:10 ) ) ); + if (sc_data[SC_FOGWALL].timer != -1 && sc_data[SC_BLIND].timer != -1) + status_change_end(bl,SC_BLIND,-1); break; case SC_VIOLENTGALE: calc_flag = 1; @@ -3802,8 +3804,6 @@ int status_change_start(struct block_list *bl,int type,int val1,int val2,int val break; case SC_FOGWALL: - val2 = 75; - // calc_flag = 1; // not sure of effects yet [celest] break; case SC_PRESERVE: |