MOG_Element LV System V1.4

11 de junho de 2015
MOG_Element LV System V1.4

MOG_Element LV System é um script criado pelo Moghunter script para a ferramenta RPG Maker XP que implementa um sistema de level (níveis) para o atributos de elementos. Quanto maior o level do elemento, maior será o seu poder.

O sistema permite também que as habilidades possam causar danos críticos.

MOG_Element LV System

Utilização

Para utilizar o sistema de level, basta atribuir os elementos, que são definidos no script, nas habilidades desejadas.

Para ativar o critical nas habilidades, crie um atributo com o nome de Critical e atribua-o a habilidade desejada.

Na pasta Graphics/Pictures do seu projeto, copie e cole as imagens abaixo:

ELV_Meter

ELV_Back

Para ver a janela de Elemental Data basta apertar a tecla C na janela de Status.

Adicione o código abaixo acima do “Main”, na sua janela de scripts do RMXP:

#_________________________________________________
# MOG_Element LV System V1.4            
#_________________________________________________
# By Moghunter    
# http://www.atelier-rgss.com
#_________________________________________________
# Sistema de Level para o atributos de elementos.
# Quanto maior o level do elemento maior será o seu
# poder.
# Para usar o sistema de level basta atribuir os
# elementos as skills desejadas.
#
# O sistema permite também que as skill causem 
# dano crítico, para isso basta criar um atributo
# com o nome de "Critical" e atribu-a a skill
# desejada.
#_________________________________________________
module MOG
#Definição do limite maximo de level.  
MAXELLV = 99
#Tipo de calculo para ganhar exp.
# 0 = Experiência é baseada na diferença do level do
#     do personagem em relação ao level do elemento.
# 1 = Experiência ganha é baseada no valor definido 
#
EXP_TYPE = 0
# Definição do valor de experiência ganha(Calculo tipo 1)
EL_EXP = 10
#Defina os nomes dos atributo dos elementos, eles devem
#ser iguais a do Database.
# Nome do Elemento 1
EL_NAME1 = "Fire"  
# Nome do Elemento 2
EL_NAME2 = "Ice"  
# Nome do Elemento 3
EL_NAME3 = "Thunder"
# Nome do Elemento 4
EL_NAME4 = "Water"
# Nome do Elemento 5
EL_NAME5 = "Earth" 
# Nome do Elemento 6
EL_NAME6 = "Wind" 
# Nome do Elemento 7
EL_NAME7 = "Light" 
# Nome do Elemento 8
EL_NAME8 = "Darkness" 
#Definição do som ao fazer Level UP.
ELE_LVSE = "056-Right02"
#Definição da ID da animação ao fazer LVUP.
EL_LVANIME = 63
end
$mogscript = {} if $mogscript == nil
$mogscript["elementlv"] = true
##############
# Game_Actor #
##############
class Game_Actor < Game_Battler
include MOG
attr_accessor   :element1_exp 
attr_accessor   :element2_exp 
attr_accessor   :element3_exp
attr_accessor   :element4_exp
attr_accessor   :element5_exp
attr_accessor   :element6_exp
attr_accessor   :element7_exp
attr_accessor   :element8_exp
attr_accessor   :element1_lv
attr_accessor   :element2_lv
attr_accessor   :element3_lv
attr_accessor   :element4_lv
attr_accessor   :element5_lv
attr_accessor   :element6_lv
attr_accessor   :element7_lv
attr_accessor   :element8_lv
alias mog30_setup setup
def setup(actor_id)
@element1_exp = 0
@element2_exp = 0
@element3_exp = 0
@element4_exp = 0
@element5_exp = 0
@element6_exp = 0
@element7_exp = 0
@element8_exp = 0
@element1_lv = 1
@element2_lv = 1
@element3_lv = 1
@element4_lv = 1
@element5_lv = 1
@element6_lv = 1
@element7_lv = 1
@element8_lv = 1
mog30_setup(actor_id)  
end
def element1_exp
n = [[@element1_exp, 0].max, 100].min  
return n
end
def element2_exp
n = [[@element2_exp, 0].max, 100].min  
return n
end
def element3_exp
n = [[@element3_exp, 0].max, 100].min  
return n
end
def element4_exp
n = [[@element4_exp, 0].max, 100].min  
return n
end
def element5_exp
n = [[@element5_exp, 0].max, 100].min  
return n
end
def element6_exp
n = [[@element6_exp, 0].max, 100].min  
return n
end
def element7_exp
n = [[@element7_exp, 0].max, 100].min  
return n
end
def element8_exp
n = [[@element8_exp, 0].max, 100].min  
return n
end
def element1_lv
n = [[@element1_lv, 1].max, MAXELLV].min    
return n
end
def element2_lv
n = [[@element2_lv, 1].max, MAXELLV].min    
return n
end
def element3_lv
n = [[@element3_lv, 1].max, MAXELLV].min    
return n
end
def element4_lv
n = [[@element4_lv, 1].max, MAXELLV].min    
return n
end
def element5_lv
n = [[@element5_lv, 1].max, MAXELLV].min    
return n
end
def element6_lv
n = [[@element6_lv, 1].max, MAXELLV].min    
return n
end
def element7_lv
n = [[@element7_lv, 1].max, MAXELLV].min    
return n
end
def element8_lv
n = [[@element8_lv, 1].max, MAXELLV].min    
return n
end
end
###############
# Window_Base #
###############
class Window_Base < Window
def draw_elementlv(actor, x, y,type)
self.contents.font.color = normal_color
back = RPG::Cache.picture("ELV_Back")    
cw = back.width  
ch = back.height 
src_rect = Rect.new(0, 0, cw, ch)    
self.contents.blt(x + 77, y - ch , back, src_rect)
meter = RPG::Cache.picture("ELV_Meter")    
case type  
when 0
cw = meter.width * actor.element1_exp / 100 
when 1
cw = meter.width * actor.element2_exp / 100 
when 2
cw = meter.width * actor.element3_exp / 100 
when 3
cw = meter.width * actor.element4_exp / 100 
when 4
cw = meter.width * actor.element5_exp / 100 
when 5
cw = meter.width * actor.element6_exp / 100 
when 6
cw = meter.width * actor.element7_exp / 100 
when 7
cw = meter.width * actor.element8_exp / 100 
end
ch = meter.height 
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 80, y - ch - 8, meter, src_rect)
self.contents.font.name = "Georgia"
case type  
when 0
self.contents.font.color = Color.new(0,0,0,255)  
self.contents.draw_text(x + 161, y - 34, 50, 32, actor.element1_exp.to_s + "%",1) 
self.contents.draw_text(x + 331, y - 34, 32, 32, actor.element1_lv.to_s)
self.contents.draw_text(x + 301, y - 34, 32, 32, "Lv")
self.contents.draw_text(x + 1, y - 34, 75, 32, MOG::EL_NAME1.to_s)
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x + 160, y - 35, 50, 32, actor.element1_exp.to_s + "%",1) 
self.contents.draw_text(x + 330, y - 35, 32, 32, actor.element1_lv.to_s) 
self.contents.draw_text(x + 300, y - 35, 32, 32, "Lv")
self.contents.draw_text(x , y - 35, 75, 32, MOG::EL_NAME1.to_s)
when 1
self.contents.font.color = Color.new(0,0,0,255)  
self.contents.draw_text(x + 161, y - 34, 50, 32, actor.element2_exp.to_s + "%",1) 
self.contents.draw_text(x + 331, y - 34, 32, 32, actor.element2_lv.to_s)
self.contents.draw_text(x + 301, y - 34, 32, 32, "Lv")
self.contents.draw_text(x + 1, y - 34, 75, 32, MOG::EL_NAME2.to_s)
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x + 160, y - 35, 50, 32, actor.element2_exp.to_s + "%",1) 
self.contents.draw_text(x + 330, y - 35, 32, 32, actor.element2_lv.to_s) 
self.contents.draw_text(x + 300, y - 35, 32, 32, "Lv")
self.contents.draw_text(x , y - 35, 75, 32, MOG::EL_NAME2.to_s)
when 2
self.contents.font.color = Color.new(0,0,0,255)  
self.contents.draw_text(x + 161, y - 34, 50, 32, actor.element3_exp.to_s + "%",1) 
self.contents.draw_text(x + 331, y - 34, 32, 32, actor.element3_lv.to_s)
self.contents.draw_text(x + 301, y - 34, 32, 32, "Lv")
self.contents.draw_text(x + 1, y - 34, 75, 32, MOG::EL_NAME3.to_s)
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x + 160, y - 35, 50, 32, actor.element3_exp.to_s + "%",1) 
self.contents.draw_text(x + 330, y - 35, 32, 32, actor.element3_lv.to_s) 
self.contents.draw_text(x + 300, y - 35, 32, 32, "Lv")
self.contents.draw_text(x , y - 35, 75, 32, MOG::EL_NAME3.to_s)
when 3
self.contents.font.color = Color.new(0,0,0,255)  
self.contents.draw_text(x + 161, y - 34, 50, 32, actor.element4_exp.to_s + "%",1) 
self.contents.draw_text(x + 331, y - 34, 32, 32, actor.element4_lv.to_s)
self.contents.draw_text(x + 301, y - 34, 32, 32, "Lv")
self.contents.draw_text(x + 1, y - 34, 75, 32, MOG::EL_NAME4.to_s)
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x + 160, y - 35, 50, 32, actor.element4_exp.to_s + "%",1) 
self.contents.draw_text(x + 330, y - 35, 32, 32, actor.element4_lv.to_s) 
self.contents.draw_text(x + 300, y - 35, 32, 32, "Lv")
self.contents.draw_text(x , y - 35, 75, 32, MOG::EL_NAME4.to_s)
when 4
self.contents.font.color = Color.new(0,0,0,255)  
self.contents.draw_text(x + 161, y - 34, 50, 32, actor.element5_exp.to_s + "%",1) 
self.contents.draw_text(x + 331, y - 34, 32, 32, actor.element5_lv.to_s)
self.contents.draw_text(x + 301, y - 34, 32, 32, "Lv")
self.contents.draw_text(x + 1, y - 34, 75, 32, MOG::EL_NAME5.to_s)
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x + 160, y - 35, 50, 32, actor.element5_exp.to_s + "%",1) 
self.contents.draw_text(x + 330, y - 35, 32, 32, actor.element5_lv.to_s) 
self.contents.draw_text(x + 300, y - 35, 32, 32, "Lv")
self.contents.draw_text(x , y - 35, 75, 32, MOG::EL_NAME5.to_s)
when 5
self.contents.font.color = Color.new(0,0,0,255)  
self.contents.draw_text(x + 161, y - 34, 50, 32, actor.element6_exp.to_s + "%",1) 
self.contents.draw_text(x + 331, y - 34, 32, 32, actor.element6_lv.to_s)
self.contents.draw_text(x + 301, y - 34, 32, 32, "Lv")
self.contents.draw_text(x + 1, y - 34, 75, 32, MOG::EL_NAME6.to_s)
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x + 160, y - 35, 50, 32, actor.element6_exp.to_s + "%",1) 
self.contents.draw_text(x + 330, y - 35, 32, 32, actor.element6_lv.to_s) 
self.contents.draw_text(x + 300, y - 35, 32, 32, "Lv")
self.contents.draw_text(x , y - 35, 75, 32, MOG::EL_NAME6.to_s)
when 6
self.contents.font.color = Color.new(0,0,0,255)  
self.contents.draw_text(x + 161, y - 34, 50, 32, actor.element7_exp.to_s + "%",1) 
self.contents.draw_text(x + 331, y - 34, 32, 32, actor.element7_lv.to_s)
self.contents.draw_text(x + 301, y - 34, 32, 32, "Lv")
self.contents.draw_text(x + 1, y - 34, 75, 32, MOG::EL_NAME7.to_s)
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x + 160, y - 35, 50, 32, actor.element7_exp.to_s + "%",1) 
self.contents.draw_text(x + 330, y - 35, 32, 32, actor.element7_lv.to_s) 
self.contents.draw_text(x + 300, y - 35, 32, 32, "Lv")
self.contents.draw_text(x , y - 35, 75, 32, MOG::EL_NAME7.to_s)
when 7
self.contents.font.color = Color.new(0,0,0,255)  
self.contents.draw_text(x + 161, y - 34, 50, 32, actor.element8_exp.to_s + "%",1) 
self.contents.draw_text(x + 331, y - 34, 32, 32, actor.element8_lv.to_s)
self.contents.draw_text(x + 301, y - 34, 32, 32, "Lv")
self.contents.draw_text(x + 1, y - 34, 75, 32, MOG::EL_NAME8.to_s)
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x + 160, y - 35, 50, 32, actor.element8_exp.to_s + "%",1) 
self.contents.draw_text(x + 330, y - 35, 32, 32, actor.element8_lv.to_s) 
self.contents.draw_text(x + 300, y - 35, 32, 32, "Lv")
self.contents.draw_text(x , y - 35, 75, 32, MOG::EL_NAME8.to_s)
end  
end  
end
########################
# Window_Element_Level #
########################
class Window_Element_Level < Window_Base
def initialize(actor)
super(100, 0, 440, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.z = 9999
@actor = actor
refresh
end
def refresh
self.contents.clear
self.contents.font.name = "Georgia"
self.contents.font.color = Color.new(0,0,0,255)  
self.contents.draw_text(x + 50, y - 5 , 200, 50, "ELEMENT DATA")
self.contents.draw_text(x + 50, y + 411 , 200, 50, "Press C to Status")
self.contents.font.color = Color.new(255,255,255,255)  
self.contents.draw_text(x + 51, y - 4 , 200, 50, "ELEMENT DATA")
self.contents.draw_text(x + 51, y + 410 , 200, 50, "Press C to Status")
draw_elementlv(@actor, 40, 70,0) 
draw_elementlv(@actor, 40, 120,1) 
draw_elementlv(@actor, 40, 170,2) 
draw_elementlv(@actor, 40, 220,3) 
draw_elementlv(@actor, 40, 270,4)
draw_elementlv(@actor, 40, 320,5)
draw_elementlv(@actor, 40, 370,6)
draw_elementlv(@actor, 40, 420,7)
end
end
#################
# Window_Status #
#################
class Window_Status < Window_Base
alias mog30_refresh refresh
def refresh
mog30_refresh
self.contents.font.name = "Georgia"
self.contents.font.color = Color.new(0,0,0,255)  
self.contents.draw_text(x + 200, y + 416 , 250, 50, "Press C to Elemental Data")
self.contents.font.color = Color.new(255,255,255,255)  
self.contents.draw_text(x + 201, y + 415 , 250, 50, "Press C to Elemental Data")  
end  
end  
################
# Scene_Status #
################
class Scene_Status
alias mog30_main main
def main
@actor = $game_party.actors[@actor_index]  
@element_window = Window_Element_Level.new(@actor)
@element_window.y = -550
@element_window.visible = false
mog30_main 
@element_window.dispose
end
alias mog30_update update
def update  
mog30_update
if @element_window.y < 0
@element_window.y += 20
elsif @element_window.y >= 0
@element_window.y = 0
@element_window.contents_opacity = 255
end  
if @element_window.visible == true 
if Input.trigger?(Input::B) or Input.trigger?(Input::L) or
Input.trigger?(Input::R)
for i in 1..30
@element_window.y -= 25  
Graphics.update
end
end
end
if Input.trigger?(Input::C) and @element_window.visible == true 
$game_system.se_play($data_system.decision_se)
@element_window.visible = false
elsif Input.trigger?(Input::C) and @element_window.visible == false 
$game_system.se_play($data_system.decision_se)
@element_window.visible = true
@element_window.y = -550
end
end  
end
################
# Game_Battler #
################
class Game_Battler
include MOG  
def skill_effect(user, skill)
self.critical = false
if ((skill.scope == 3 or skill.scope == 4) and self.hp == 0) or
((skill.scope == 5 or skill.scope == 6) and self.hp >= 1)
return false
end
effective = false
effective |= skill.common_event_id > 0
hit = skill.hit
if skill.atk_f > 0
hit *= user.hit / 100
end
hit_result = (rand(100) < hit)
effective |= hit < 100
if hit_result == true
power = skill.power + user.atk * skill.atk_f / 100
if power > 0
power -= self.pdef * skill.pdef_f / 200
power -= self.mdef * skill.mdef_f / 200
power = [power, 0].max
end
rate = 20
rate += (user.str * skill.str_f / 100)
rate += (user.dex * skill.dex_f / 100)
rate += (user.agi * skill.agi_f / 100)
rate += (user.int * skill.int_f / 100)
if skill.element_set.include?($data_system.elements.index(EL_NAME1)) and user.is_a?(Game_Actor)
dmg_lv = power * 100 / 20 * user.element1_lv / MAXELLV   
self.damage = dmg_lv + power * rate / 20
if EXP_TYPE == 0
valor = user.level - user.element1_lv
user.element1_exp += 1 + valor
else
user.element1_exp += EL_EXP
end  
if user.element1_exp > 99 and user.element1_lv < MAXELLV 
user.element1_exp = 0
user.element1_lv += 1
Audio.se_play("Audio/SE/" + ELE_LVSE)
user.animation_id = EL_LVANIME
$game_player.animation_id = EL_LVANIME
end
elsif skill.element_set.include?($data_system.elements.index(EL_NAME2)) and user.is_a?(Game_Actor) 
dmg_lv = power * 100 / 20 * user.element2_lv / MAXELLV   
self.damage = dmg_lv + power * rate / 20
if EXP_TYPE == 0
valor = user.level - user.element2_lv
user.element2_exp += 1 + valor
else
user.element2_exp += EL_EXP
end  
if user.element2_exp > 99 and user.element2_lv < MAXELLV 
user.element2_exp = 0
user.element2_lv += 1
Audio.se_play("Audio/SE/" + ELE_LVSE)
user.animation_id = EL_LVANIME
$game_player.animation_id = EL_LVANIME
end
elsif skill.element_set.include?($data_system.elements.index(EL_NAME3)) and user.is_a?(Game_Actor) 
dmg_lv = power * 100 / 20 * user.element3_lv / MAXELLV   
self.damage = dmg_lv + power * rate / 20
if EXP_TYPE == 0
valor = user.level - user.element3_lv
user.element3_exp += 1 + valor
else
user.element3_exp += EL_EXP
end  
if user.element3_exp > 99 and user.element3_lv < MAXELLV 
user.element3_exp = 0
user.element3_lv += 1
Audio.se_play("Audio/SE/" + ELE_LVSE)
user.animation_id = EL_LVANIME
$game_player.animation_id = EL_LVANIME
end
elsif skill.element_set.include?($data_system.elements.index(EL_NAME4)) and user.is_a?(Game_Actor)  
dmg_lv = power * 100 / 20 * user.element4_lv / MAXELLV   
self.damage = dmg_lv + power * rate / 20
if EXP_TYPE == 0
valor = user.level - user.element4_lv
user.element4_exp += 1 + valor
else
user.element4_exp += EL_EXP
end  
if user.element4_exp > 99 and user.element4_lv < MAXELLV 
user.element4_exp = 0
user.element4_lv += 1
Audio.se_play("Audio/SE/" + ELE_LVSE)
user.animation_id = EL_LVANIME
$game_player.animation_id = EL_LVANIME
end
elsif skill.element_set.include?($data_system.elements.index(EL_NAME5)) and user.is_a?(Game_Actor)
dmg_lv = power * 100 / 20 * user.element5_lv / MAXELLV   
self.damage = dmg_lv + power * rate / 20
if EXP_TYPE == 0
valor = user.level - user.element5_lv
user.element5_exp += 1 + valor
else
user.element5_exp += EL_EXP
end  
if user.element5_exp > 99 and user.element5_lv < MAXELLV 
user.element5_exp = 0
user.element5_lv += 1
Audio.se_play("Audio/SE/" + ELE_LVSE)
user.animation_id = EL_LVANIME
$game_player.animation_id = EL_LVANIME
end
elsif skill.element_set.include?($data_system.elements.index(EL_NAME6)) and user.is_a?(Game_Actor)  
dmg_lv = power * 100 / 20 * user.element6_lv / MAXELLV   
self.damage = dmg_lv + power * rate / 20
if EXP_TYPE == 0
valor = user.level - user.element6_lv
user.element6_exp += 1 + valor
else
user.element6_exp += EL_EXP
end  
if user.element6_exp > 99 and user.element6_lv < MAXELLV   
user.element6_exp = 0
user.element6_lv += 1
Audio.se_play("Audio/SE/" + ELE_LVSE)
user.animation_id = EL_LVANIME
$game_player.animation_id = EL_LVANIME
end
elsif skill.element_set.include?($data_system.elements.index(EL_NAME7)) and user.is_a?(Game_Actor)
dmg_lv = power * 100 / 20 * user.element7_lv / MAXELLV   
self.damage = dmg_lv + power * rate / 20
if EXP_TYPE == 0
valor = user.level - user.element7_lv
user.element7_exp += 1 + valor
else
user.element7_exp += EL_EXP
end  
if user.element7_exp > 99 and user.element7_lv < MAXELLV   
user.element7_exp = 0
user.element7_lv += 1
Audio.se_play("Audio/SE/" + ELE_LVSE)
user.animation_id = EL_LVANIME
$game_player.animation_id = EL_LVANIME
end
elsif skill.element_set.include?($data_system.elements.index(EL_NAME8)) and user.is_a?(Game_Actor)
dmg_lv = power * 100 / 20 * user.element8_lv / MAXELLV   
self.damage = dmg_lv + power * rate / 20
if EXP_TYPE == 0
valor = user.level - user.element8_lv
user.element8_exp += 1 + valor
else
user.element8_exp += EL_EXP
end  
if user.element8_exp > 99 and user.element8_lv < MAXELLV   
user.element8_exp = 0
user.element8_lv += 1
Audio.se_play("Audio/SE/" + ELE_LVSE)
user.animation_id = EL_LVANIME
$game_player.animation_id = EL_LVANIME
end
else
self.damage = power * rate / 20  
end  
self.damage *= elements_correct(skill.element_set)
self.damage /= 100
if self.damage > 0
if rand(100) < 4 * user.dex / self.agi and skill.element_set.include?($data_system.elements.index("Critical"))
self.damage *= 2
self.critical = true
end      
if self.guarding?
self.damage /= 2
end
end
if skill.variance > 0 and self.damage.abs > 0
amp = [self.damage.abs * skill.variance / 100, 1].max
self.damage += rand(amp+1) + rand(amp+1) - amp 
end
eva = 8 * self.agi / user.dex + self.eva
hit = self.damage < 0 ? 100 : 100 - eva * skill.eva_f / 100
hit = self.cant_evade? ? 100 : hit
hit_result = (rand(100) < hit)
effective |= hit < 100
end
if hit_result == true
if skill.power != 0 and skill.atk_f > 0
remove_states_shock
effective = true
end
last_hp = self.hp
self.hp -= self.damage
effective |= self.hp != last_hp
@state_changed = false
effective |= states_plus(skill.plus_state_set)
effective |= states_minus(skill.minus_state_set)
if skill.power == 0
self.damage = ""
unless @state_changed
self.damage = "Miss"
end
end
else
self.damage = "Miss"
end
unless $game_temp.in_battle
self.damage = nil
end
return effective
end
end

Deixe um comentário

  • Seja social e nos siga!

           
  • Páginas

  • Tags Especiais

  • Categorias

  • Parceiros

  • eXTReMe Tracker
    Copyright © 2001 - 2017 Gaming Room. Todos os Direitos Reservados - É expressamente proibida a reprodução total ou parcial deste site sem o consentimento dos autores.