魔法撃ち分け ■機能説明 元からついているスキル使用対象モンスターの部分をmon_control.txtで 設定できるようにしたもの。スキルレベルも個々に調節可能。 ■使い方 config.txtでattackSkillSlot_#の部分を設定する。 mon_control.txtで以下のようにする。 モンスター名 1 0 0 # Lv 例)ポリンにattackSkillSlot_0、レベル5を使う ポリン 1 0 0 0 5 例)クリーミーにattackSkillSlot_1、レベル9を使う クリーミー 1 0 0 1 9 ----- [kore.pl] -if (percent_hp(\%{$chars[$config{'char'}]}) >= $config{"attackSkillSlot_$i"."_hp_lower"} && percent_hp(\%{$chars[$config{'char'}]}) <= $config{"attackSkillSlot_$i"."_hp_upper"} - && percent_sp(\%{$chars[$config{'char'}]}) >= $config{"attackSkillSlot_$i"."_sp_lower"} && percent_sp(\%{$chars[$config{'char'}]}) <= $config{"attackSkillSlot_$i"."_sp_upper"} - && $chars[$config{'char'}]{'sp'} >= $skillsSP_lut{$skills_rlut{lc($config{"attackSkillSlot_$i"})}}{$config{"attackSkillSlot_$i"."_lvl"}} - && !($config{"attackSkillSlot_$i"."_stopWhenHit"} && ai_getMonstersWhoHitMe()) - && (!$config{"attackSkillSlot_$i"."_maxUses"} || $ai_seq_args[0]{'attackSkillSlot_uses'}{$i} < $config{"attackSkillSlot_$i"."_maxUses"}) - && $config{"attackSkillSlot_$i"."_minAggressives"} <= ai_getAggressives() - && (!$config{"attackSkillSlot_$i"."_maxAggressives"} || $config{"attackSkillSlot_$i"."_maxAggressives"} >= ai_getAggressives()) - && (!$config{"attackSkillSlot_$i"."_monsters"} || existsInList($config{"attackSkillSlot_$i"."_monsters"}, $monsters{$ai_seq_args[0]{'ID'}}{'name'}))) { - $ai_seq_args[0]{'attackSkillSlot_uses'}{$i}++; - $ai_seq_args[0]{'attackMethod'}{'distance'} = $config{"attackSkillSlot_$i"."_dist"}; - $ai_seq_args[0]{'attackMethod'}{'type'} = "skill"; - $ai_seq_args[0]{'attackMethod'}{'skillSlot'} = $i; - last; +if (percent_hp(\%{$chars[$config{'char'}]}) >= $config{"attackSkillSlot_$i"."_hp_lower"} && percent_hp(\%{$chars[$config{'char'}]}) <= $config{"attackSkillSlot_$i"."_hp_upper"} + && percent_sp(\%{$chars[$config{'char'}]}) >= $config{"attackSkillSlot_$i"."_sp_lower"} && percent_sp(\%{$chars[$config{'char'}]}) <= $config{"attackSkillSlot_$i"."_sp_upper"} + && !($config{"attackSkillSlot_$i"."_stopWhenHit"} && ai_getMonstersWhoHitMe()) + && (!$config{"attackSkillSlot_$i"."_maxUses"} || $ai_seq_args[0]{'attackSkillSlot_uses'}{$i} < $config{"attackSkillSlot_$i"."_maxUses"}) + && $config{"attackSkillSlot_$i"."_minAggressives"} <= ai_getAggressives() + && (!$config{"attackSkillSlot_$i"."_maxAggressives"} || $config{"attackSkillSlot_$i"."_maxAggressives"} >= ai_getAggressives()) + ) { + my $num = 0; + my $flag = 0; + my $true = 0; + while (${"SkillSlotMonsters$i"}[$num]){ + if (${"SkillSlotMonsters$i"}[$num] eq $monsters{$ai_seq_args[0]{'ID'}}{'name'}){ + $config{"attackSkillSlot_$i"."_lvl"} = ${"SkillSlotLv$i"}[$num]; # レベル設定 + $true = 1; + last; + } + ++$num; + } + if (($true == 1 && $chars[$config{'char'}]{'sp'} >= $skillsSP_lut{$skills_rlut{lc($config{"attackSkillSlot_$i"})}}{$config{"attackSkillSlot_$i"."_lvl"}}) + || ($num == 0 && $mon_control{lc($monsters{$ai_seq_args[0]{'ID'}}{'name'})}{'skill'} eq "" + && (!$config{"attackSkillSlot_$i"."_monsters"} || existsInList($config{"attackSkillSlot_$i"."_monsters"}, $monsters{$ai_seq_args[0]{'ID'}}{'name'})) + && $chars[$config{'char'}]{'sp'} >= $skillsSP_lut{$skills_rlut{lc($config{"attackSkillSlot_$i"})}}{$config{"attackSkillSlot_$i"."_lvl"}})){ + $ai_seq_args[0]{'attackSkillSlot_uses'}{$i}++; + $ai_seq_args[0]{'attackMethod'}{'distance'} = $config{"attackSkillSlot_$i"."_dist"}; + $ai_seq_args[0]{'attackMethod'}{'type'} = "skill"; + $ai_seq_args[0]{'attackMethod'}{'skillSlot'} = $i; + last; + } ----- [kore.pl] sub parseMonControl { my $file = shift; my $r_hash = shift; undef %{$r_hash}; + for(my $i = 0;$config{"attackSkillSlot_$i"} ne "";++$i){ + undef @{"SkillSlotMonsters$i"}; + undef @{"SkillSlotLv$i"}; + } ----- [kore.pl] $$r_hash{lc($key)}{'attack_auto'} = $args[0]; $$r_hash{lc($key)}{'teleport_auto'} = $args[1]; $$r_hash{lc($key)}{'teleport_search'} = $args[2]; + if ($args[3] ne "" && $args[4] ne "") { # スロットごとに分別 + $$r_hash{lc($key)}{'skill'} = $key; + push(@{"SkillSlotMonsters$args[3]"},$key); + push(@{"SkillSlotLv$args[3]"},$args[4]); + }