Here you go.
I've tested it with cogwheel's RTAB 1.16
Everything is aliased, so in theory, it should work in other battle systems too.
set SKILL_ID to your taunt skill's id.
[rgss]module Taunt
SKILL_ID = 96
module_function
# index : the taunter's index in the party/ troop.
def self.user=(taunter)
@taunter = taunter
@index = $game_party.actors.index(taunter)
@active = true
end
#--------------------------------------------------
# Did anyone use Taunt
#--------------------------------------------------
def active?
return (@active)
end
def clear
@active = false
@index = @taunter = nil
end
def skill?(sk)
return sk.id == SKILL_ID
end
def index
@index
end
end
class Scene_Battle
alias clear_Taunt_main main
def main
Taunt::clear
clear_Taunt_main
end
end
class Game_Battler
alias taunt_effect skill_effect
def skill_effect(user, skill)
if Taunt::skill?(skill)
Taunt.user = user
end
taunt_effect(user, skill)
end
end
class Game_BattleAction
def for_one_enemy?
# If kind = attack (basic)
if @kind == 0
return true
end
# If kind = skill, and effect scope is for enemy
if @kind == 1 and $data_skills[@skill_id].scope == 1
return true
end
# If kind = item, and effect scope is for one enemy
if @kind == 2 and $data_items[@item_id].scope == 1
return true
end
return false
end
#--------------------------------------------------------------------------
# * Random Target (for Enemy)
#--------------------------------------------------------------------------
alias taunt_decide_random_target decide_random_target_for_enemy
def decide_random_target_for_enemy
# Target the taunter if the skill's scope is 1 foe.
if Taunt::active? and for_one_enemy?
@target_index = Taunt::index
else
taunt_decide_random_target
end
end
end
[/rgss]