2025/11/17 記事をまとめてブログ全体を整理しました。

他人からの被魔法で自動的に着替える方法

GearSwapは自分のアクションに応じて着替えるアドオンですので、他人からの魔法バフを受ける際に自動的に着替えることはできません。

ですが、強引に着替えてくれるファンクションを追加しました。

ただし、問題点もありますのでフラグのオンオフで切り替えながら使うと結構便利です。

目次

ロジック

require('sets')
require('chat')
filter_mode = S{51,52}
windower.register_event("incoming text", function(original, modified, original_mode, modified_mode, blocked)
    if state.Increased and state.Increased.value then
        if filter_mode:contains(original_mode) then
            if windower.wc_match(original,windower.to_shift_jis('*リジェネ*')) then
                if sets.midcast.IncreasedRegenerated then
                    send_command('gs equip sets.midcast.IncreasedRegenerated; wait 3; gs c Idle;')
                end
            elseif windower.wc_match(original,windower.to_shift_jis('*ファランクス*')) then
                if sets.midcast.IncreasedPhalanx then
                    send_command('gs equip sets.midcast.IncreasedPhalanx; wait 3; gs c Idle;')
                end
            elseif windower.wc_match(original,windower.to_shift_jis('*リフレシュ*')) then
                if sets.midcast.IncreasedRefresh then
                    send_command('gs equip sets.midcast.IncreasedRefresh; wait 3; gs c Idle;')
                end
            elseif windower.wc_match(original,windower.to_shift_jis('*プロテス*')) then
                if sets.midcast.IncreasedProtect then
                    send_command('gs equip sets.midcast.IncreasedProtect; wait 3; gs c Idle;')
                end
            elseif windower.wc_match(original,windower.to_shift_jis('*シェル*')) then
                if sets.midcast.IncreasedShell then
                    send_command('gs equip sets.midcast.IncreasedShell; wait 3; gs c Idle;')
                end
            elseif windower.wc_match(original,windower.to_shift_jis('*カーズナ*')) then
                if sets.midcast.IncreasedCursna then
                    send_command('gs equip sets.midcast.IncreasedCursna; wait 3; gs c Idle;')
                end
            end
        end
    end
end)

ロジック説明

ざっと思いつく限り、被魔法効果アップ装備があるものは次の魔法ですかね。

  • リジェネ
  • ファランクス
  • リフレシュ
  • プロテス
  • シェル
  • カーズナ

まだ改良の余地はあるのですが、現状だれか(敵NPC含む)が上記魔法を詠唱したログを検知して自動的に着替える仕組みで組んでいます。

着替えた3秒後に待機装備に復帰します。

課題

学者が女神降臨の章で範囲化する場合、自分を対象に詠唱しないので直接自分に魔法が詠唱された場合に着替えるロジックを組めません。

たとえば、ファランクス装備を受けるためのマクロを実行して、被ファラ状態になっているのにだれかが該当魔法を唱えるたびに別の装備に着替えてしまって鬱陶しいです。

なので、PTプレイするときは被魔法の自動着替えフラグをオフにしておき、ソロプレイ(二垢など)の時にフラグをオンにするなどすることで、この課題はある程度回避できます。

コメント

コメントする

目次