RPGVX.net
RPG-Maker VX => VX Skripte [Fertiger Code] => Thema gestartet von: ERZENGEL am Januar 24, 2008, 22:19:53
-
- Vorwort:
Das Abwehren im Kampf bringt eigentlich nicht viel. Mit diesem Skript von Synthesize kann den Kampfbefehl Abwehren um eine HP und MP-Regeneration hinzufügen.
- Anleitung:
Einfach normal einfügen. Siehe FAQ (http://forum.rpgvx.net/index.php?showtopic=186) (RGSS2, Wie baue ich die Skripte ein?)
Weitere Einstellungen werden in den ersten Zeilen erklärt.
- Skript:
#===============================================================================
# HP+MP Regneration - RMVX Version
#===============================================================================
# Geschrieben von Synthesize
# Version 1.2.0
# 19. Januar 2008
#===============================================================================
# *Das Skript ist nicht kompatibel mit dem RPG Maker XP*
#===============================================================================
module SynRegen
# Format = { Actor_ID => Percent to restore, Actor_ID2 => Percent to restore}
HP_regen = {1 => 5, 2 =>7} # %
# You can define how much HP each individual actor regenerates when they
# Defend. Add new actors by seperating each returning value with a comma (,)
#-----------------------------------------------------------------------------
# This value determines the Default Percent growth if the Actor_ID is not
# in the above hash
HP_regen.default = 5 # %
#-----------------------------------------------------------------------------
# Auf true setzen, wenn Hp regeneriert werden sollen; false wenn nicht.
Use_hp_regen = true
#----------------------------------------------------------------------------
# Format = {Actor_ID => SP to restore
SP_regen = {1 => 5, 2 => 7} # %
# You can define how much SP each individual actor regenerates when they
# defend. Add new actors by seperating each returning value with a comma (,)
#-----------------------------------------------------------------------------
# This is the default percentage to regenerate if the Actor_ID is not in the
# hash.
SP_regen.default = 5 # %
#-----------------------------------------------------------------------------
# Auf true setzen, wenn MP regeneriert werden sollen; false wenn nicht.
Use_mp_regen = true
#-----------------------------------------------------------------------------
# Zeige wie viel HP/MP regeneriert wurde. true = an; false = aus
Draw_text = true
#-----------------------------------------------------------------------------
# The defense rate if the actor has 'Super Defense'
Super_guard_rate = 4
#-----------------------------------------------------------------------------
# The defense rate if the actor has 'Normal Defense'
Normal_guard_rate = 2
end
#-------------------------------------------------------------------------------
# Scene_Battle
# This aliases the execute_action_guard method in Scene_Battle
#-------------------------------------------------------------------------------
class Scene_Battle
# Alias execute_action_guard
alias syn_regen_execute_guard execute_action_guard
#-----------------------------------------------------------------------------
# Execute Action_Guard
#-----------------------------------------------------------------------------
def execute_action_guard
# Calculate the amount of HP and MP gained
hp_restore = ((@active_battler.maxhp * SynRegen::HP_regen[@active_battler.id]) / 100) if SynRegen::Use_hp_regen == true
sp_restore = ((@active_battler.maxmp * SynRegen::SP_regen[@active_battler.id]) / 100) if SynRegen::Use_mp_regen == true
# Calculate the different between MaxHP, HP, MaxMP and MP
temp_value_hp = (@active_battler.maxhp - @active_battler.hp)
temp_value_mp = (@active_battler.maxmp - @active_battler.mp)
# Add HP and MP
@active_battler.hp += hp_restore if SynRegen::Use_hp_regen == true
@active_battler.mp += sp_restore if SynRegen::Use_mp_regen == true
# Draw how much HP/MP the actor regenerated
if temp_value_hp != 0 and temp_value_mp != 0
@message_window.add_instant_text("#{@active_battler.name} HP increased by #{hp_restore} and MP increased by #{sp_restore}")
elsif temp_value_hp != 0 and temp_value_mp == 0
@message_window.add_instant_text("#{@active_battler.name} HP increased by #{hp_restore}")
elsif temp_value_hp == 0 and temp_value_mp != 0
@message_window.add_instant_text("#{@active_battler.name} MP increased by #{sp_restore}")
end
# Call the original code
syn_regen_execute_guard
end
end
#-------------------------------------------------------------------------------
# Game_Battler
# This rewrites the defense method found in Game_Battler
#-------------------------------------------------------------------------------
class Game_Battler
#-----------------------------------------------------------------------------
# Apply_Guard_Damage
#-----------------------------------------------------------------------------
def apply_guard(damage)
if damage > 0 and guarding?
# Divide the total damage from the effectivness of the defense rate.
damage /= super_guard ? SynRegen::Super_guard_rate : SynRegen::Normal_guard_rate
end
return damage
end
end
#===============================================================================
# This script is not compatible with Rpg Maker XP. However, I have also made a
# RPG Maker Xp version which can be found on RPGRPG Revolution.
#===============================================================================
# * This script is untested but should work in theory *
#===============================================================================
# Written by Synthesize
# January 19, 2008
#===============================================================================
# Regenerate HP/MP - RMVX Version
#===============================================================================
- Links:
- RPG RPG Revolution (Quelle) (http://www.rpgrevolution.com/forums/-RMVX-Regenerate-HP-MP-on-Defense-t8019.html)
-
Thx fürs reinstellen. Funktioniert einwandfrei!
-
Das is ja mal echt genial O_O
Das Abwehren fand ich schon immer Doof >_>
Danke fürs posten <3!!
-
Muss man das Skript einfach nur einfügen, und dann geht des oder muss ich da noch i-welcche switches oder variables benutzen oder so was ?
mfg Orion
-
Danke sehr. Einwandfrei und nützlich. happy.gif\" style=\"vertical-align:middle\" emoid=\"^_^\" border=\"0\" alt=\"happy.gif\" /]
-
Muss man das Skript einfach nur einfügen, und dann geht des oder muss ich da noch i-welcche switches oder variables benutzen oder so was ?
Das wüsste ich auch gerne - fände es sehr praktisch für mein Game, doch wenn ich das kopiere und einfüge (ab "module SynRegen") dann kommt bei mir immer nen Error...
-
Normalerweise muss man nichts weiter machen als reinkopieren, wenn nichts dabeisteht. Hast du's unter Materials und über Main eingefügt?
-
Ocean, du meist wohl unter Materials ''ODER'' über Main... :D
@Draagonfab:
Mach nen Screenshot von der Fehlermeldung, so kann man dir besser Helfen... :D
WS
D.N.S
-
Nein, ÜBER Main. Wenn du es unter Main einfügst, hast du ein Problem. Unter Materials ist nicht zwingend, erleichtert aber die Übersicht.