Salut et désolé pour le nécropost,
Mais tu as tout à fait raison Keldak Miyano, Maker a en effet utilisé un script de ce genre dans son jeu et justement le voici.
- Spoiler:
- Code:
# Cooperative Skills Ver 1.02 (04-16-2004)
# Distribution original support URL
# http://members.jcom.home.ne.jp/cogwheel/
class Scene_Battle
#--------------------------------------------------------------------------
# * Synthesis skill distinction
#--------------------------------------------------------------------------
def synthe_spell(battler)
if battler.is_a?(Game_Actor)
@spell_p[battler] = $data_skills[battler.current_action.skill_id].name
end
if battler.is_a?(Game_Enemy)
@spell_e[battler] = $data_skills[battler.current_action.skill_id].name
end
# synthe_s.push([["Skill A","Skill B"],"Skill C"]
# Quand les skills A et B sont utilisés, Le skill C est utilisé.
#
# synthe_s.push([["Skill A","Skill B","Skill C"],"Skill D"]
# Même chos, la commande est utilisable avec autant de skill possibles
# Si vous avez 4 persos en combat, vous pouvez combiner 4 skills
#
# Note: noté que si les skills combiné ont des cibles différentes(1 ennemi,
#tout les ennemis), le script choisira une cible au hasard parmi les ennemis
synthe_s = []
synthe_s.push([["Cross Cut","Wind"],"Hurricane"])
synthe_s.push([["Leg Sweep","Thunder"],"Thunder Pierce"])
synthe_s.push([["Leg Sweep","Hurricane"],"Spiral Blade"])
synthe_s.push([["Cross Cut","Thunder Pierce"],"Screw Thrust"])
synthe_s.push([["Cross Cut","Leg Sweep","Fire"],"Burning Shot"])
synthe_s.push([["Water","Water"],"Greater Water"])
synthe_s.push([["Water","Water"],"Greater Water"])
synthe_s.push([["Water","Greater Water"],"Mass Water"])
synthe_s.push([["Greater Water","Greater Water"],"Mass Water"])
temp = [@spell_p, @spell_e]
for spell in temp
for spells in synthe_s
magic = spells[1]
spell_c = spell.clone
for name in spells[0]
if spell_c.has_value?(name)
spell_c.delete(spell_c.index(name))
else
magic = nil
break
end
end
# Union magical decision
if magic != nil
for skill in $data_skills
if magic == $data_skills[skill.id].name
break
end
end
if magic != $data_skills[skill.id].name
p "Error: The defined 'Cooperative Skill' is not found."
end
rt = 0
synthe_b = []
spell_c = spell.clone
for name in spells[0]
actor = spell_c.index(name)
speller = synthe?(actor)
if speller != nil
for battlers in speller
synthe_b.push(battlers)
spell_c.delete(battlers)
end
rt += battlers.rt
end
unless synthe_b.include?(actor)
synthe_b.push(actor)
spell_c.delete(actor)
rt += actor.rt
end
end
# This set of routines determines the success of a Cooperative Skill
# attack based on the individual skills being combined.
#
# spells = ["Skill Effect A","Skill Effect B"]
# success = spell_effect(battler, synthe_b, spells)
#
# By specifying a Skill(when "Hurricane"), you can combine the success
# rate of the skills (spells = ["Hurricane","Greater Wind"]) to gener-
# ate an average.
#
# The last (else) IS necessary for "Non-Combined" skill attacks.
case magic
when "Hurricane"
spells = ["Hurricane","Greater Wind"]
success = spell_effect(battler, synthe_b, spells)
when "Thunder Pierce"
spells = ["Thunder Pierce","Greater Thunder"]
success = spell_effect(battler, synthe_b, spells)
when "Spiral Blade"
spells = ["Beast Slayer","Hurricane","Greater Wind"]
success = spell_effect(battler, synthe_b, spells)
when "Screw Thrust"
spells = ["Feint Attack","Thunder Pierce","Greater Thunder"]
success = spell_effect(battler, synthe_b, spells)
when "Burning Shot"
spells = ["Hurricane","Thunder Pierce","Greater Fire"]
success = spell_effect(battler, synthe_b, spells)
else
spells = [magic]
success = spell_effect(battler, synthe_b, spells)
end
if success == true
for actor in synthe_b
speller = synthe?(actor)
if speller != nil
@synthe.delete(speller)
end
if battler != actor
@action_battlers.delete(actor)
end
actor.spell = true
if actor == synthe_b[0]
spell[actor] = $data_skills[skill.id].name
else
spell.delete(actor)
end
actor.current_action.skill_id = skill.id
recite_time(actor)
actor.rtp = 1 if actor.rtp == 0
# When a combination of skills that result in a combined skill at-
# tack is formed, it results in the instantaneous delivery of the
# "Cooperative Skill", regardless any ATB gauge.
#
# These "Cooperative Skills" cancels out the casting time required
# by the "Skill Casting Time Counter" script WHEN the "Cooperative
# Skill" is determined.
actor.rt = rt
end
@synthe.push(synthe_b)
else
for actor in synthe_b
actor.current_action.spell_id = 0
end
end
end
end
end
end
def spell_effect(battler, synthe, spells)
spell_id = []
for actor in synthe
if spells.size != 0
spell = spells.shift
end
for skill in $data_skills
if spell == $data_skills[skill.id].name
break
end
end
if spell != $data_skills[skill.id].name
p "Error: The defined 'Cooperative Skill' is not found."
end
if actor.skill_can_use?(skill.id) or
battler.current_action.forcing == true
spell_id.push(skill.id)
else
return false
end
end
for actor in synthe
actor.current_action.spell_id = spell_id.shift
end
return true
end
end
Les explications sont de la ligne 17 à la ligne 25.