[VX]Rei VABS Passive Lifesteal Addon
Versi: 1.0
Tipe: Battle System Addon
PengenalanRequest dari bung Dr.Dhoom yg meminta supaya ada lifesteal di dalam Vampyr ABS . .
Awalnya bikin stres juga bikin ini, tapi eh ternyata bisa (TESTED) Kalau ada bug, silahkan bilang aja . .
Fitur
ScreenshotsTidak ada
DemoTidak ada
RequirementsVampyr Action Battle System versi 12
Selain versi itu belum di coba.
Scripts- Spoiler:
- Code:
-
#===============================================================================
# â—Ź [XP] â—¦ Rei VABS 12 Lifesteal Addon â—¦ â–ˇ
# * Bisa punya efek lifesteal secara passive *
#-------------------------------------------------------------------------------
# â—¦ by reijubv [reijubv@ymail.com]
# â—¦ Rpgmakerid
# â—¦ Dipublikasikan pada: 25/07/2010
# â—¦ Versi: 1.0 (25 July 2010)
#-------------------------------------------------------------------------------
# Di note skill,weapon,enemy,state, (ATAU di comment suatu event)
# kasih tulisan Lifesteal = persentase lifesteal
# misal Lifesteal = 50 maka akan memberi lifesteal 50%
# jangan lupa kalau SPASI nya harus ada, jadi jgn ditulis Lifesteal=50, tapi
# harus Lifesteal = 50 , spasi ada sebelum dan sesudah tanda sama dengan (=)
#===============================================================================
# Credit to reijubv
#-------------------------------------------------------------------------------
# â—¦ Installation:
# Taroh diatas Main dibawah Scene_Debug, di bawah SEMUA script dari Vampyr
#===============================================================================
$imported = {} if $imported == nil
$imported["Rei_"+"Lifesteal_Addon_VABS12"] = true
#===============================================================================
# Obrak abrik script di bawah kalau kamu memang mau dan bisa
#===============================================================================
#===============================================================================
# RPG
#===============================================================================
module RPG
class State
def lifesteal_ammount
self.note.each_line { |line|
return line.gsub('Lifesteal = ', '').chomp.to_i if line.include?('Lifesteal = ')
}
return 0
end
end
class BaseItem
def lifesteal_ammount
self.note.each_line { |line|
return line.gsub('Lifesteal = ', '').chomp.to_i if line.include?('Lifesteal = ')
}
return 0
end
end
end
#------------------------------------------------------------------------------
# Game Event
#------------------------------------------------------------------------------
class Game_Event < Game_Character
attr_accessor :lifesteal
alias rei_vabs_ge_refresh refresh
def refresh
rei_vabs_ge_refresh
@lifesteal = check_value("Lifesteal")
end
end
#------------------------------------------------------------------------------
# Game Enemy
#------------------------------------------------------------------------------
class Game_Enemy < Game_Battler
def lifesteal_ammount
enemy.note.each_line { |line|
return line.gsub('Lifesteal = ', '').chomp.to_i if line.include?('Lifesteal = ')
}
return 0
end
end
#------------------------------------------------------------------------------
# Game Battler
#------------------------------------------------------------------------------
class Game_Battler
alias rei_vabs_ge_initialize initialize
def initialize
@ls_percentage = 0
rei_vabs_ge_initialize
end
alias rei_vabs_gb_execute_damage execute_damage
def execute_damage(user)
rei_vabs_gb_execute_damage(user)
if user.is_a?(Game_Actor) or user.is_a?(Game_Enemy)
for state in user.states.compact
next unless state.lifesteal_ammount > 0
@ls_percentage += state.lifesteal_ammount
end
if user.is_a?(Game_Actor)
if user.weapons[0].lifesteal_ammount > 0
@ls_percentage += user.weapons[0].lifesteal_ammount
end
if user.two_swords_style
if user.weapons[1].lifesteal_ammount > 0
@ls_percentage += user.weapons[1].lifesteal_ammount
end
end
end
end
if user.is_a?(Game_Actor)
for skill in user.skills
if skill.lifesteal_ammount > 0
@ls_percentage += skill.lifesteal_ammount
end
end
end
if user.is_a?(Game_Enemy)
if user.lifesteal_ammount > 0
@ls_percentage += user.lifesteal_ammount
end
end
if user.is_a?(Game_Monster)
if user.actor.lifesteal_ammount > 0
@ls_percentage += user.actor.lifesteal_ammount
end
end
if user.is_a?(Game_Event)
if user.lifesteal > 0
@ls_percentage += user.lifesteal
end
end
if @ls_percentage > 0
d = @hp_damage * @ls_percentage / 100
user.damage -= d.to_int
user.hp += d
end
@ls_percentage = 0
end
end
CreditsThanks to