B} # # A = ID del personaggio # B = valore massimo di fortuna per ogni personaggio. # # Se non definito il valore massimo sarà pari a 100%. MAX_LUCK = { 1=>60, 2=>45, 7=>23 } #_________________________________________________ #Definizione del valore iniziale di fortuna per ogni personaggio. # INILUCK = {A =>B} # # A = ID del personaggio. # B = valore iniziale della fortuna. # #Se non definito il valore sarà pari a 1. INILUCK = { 1 =>5, 2 =>3, 7 =>2 } #_________________________________________________ #Definizione dell'aumento di fortuna per ogni livello. #LKUP = {A =>B} # # A = ID del personaggio # B = Valore dell'incremento. # #Se non definito il valore sarà pari a 1. LKUP = {1 =>2, 2 =>3 } #_________________________________________________ #Calcolo della probabilità di vincere oggetti. # # false = Il calcolo della probabilità si basa sul valore più alto del gruppo. # true = Il calcolo della probabilità si basa sul valore medio del gruppo. LKITEMEDIA = true #_________________________________________________ #Quantittà % di HP recuperati. LKHPRECPER = 10 end #_________________________________________________ $mogscript = {} if $mogscript == nil $xrxs = {} if $xrxs == nil $mogscript[\"luck_system\"] = true ############## # Game Actor # ############## class Game_Actor < Game_Battler alias mog23_setup setup def setup(actor_id) iniluck = MOG::INILUCK[actor_id] maxluck = MOG::MAX_LUCK[actor_id] if maxluck == nil @max_luck = 100 else @max_luck = maxluck end if MOG::INILUCK[actor_id] == nil @luck = 1 else @luck = iniluck end if MOG::LKUP[actor_id] == nil @luckup = 1 else @luckup = MOG::LKUP[actor_id] end mog23_setup(actor_id) end def max_luck return @max_luck end def luck if @max_luck != nil and @luck > @max_luck @luck = @max_luck else if @luck > 100 @luck = 100 end return @luck end end def exp=(exp) @exp = [[exp, 9999999].min, 0].max while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0 @level += 1 @luck += @luckup for j in $data_classes[@class_id].learnings if j.level == @level learn_skill(j.skill_id) end end end while @exp < @exp_list[@level] @level -= 1 @luck -= @luckup end @hp = [@hp, self.maxhp].min @sp = [@sp, self.maxsp].min end end ############### # Game_Enemy # ############### class Game_Enemy < Game_Battler def treasure_prob for i in 0...$game_party.actors.size actor = $game_party.actors[i] if MOG::LKITEMEDIA == true return actor.luck / $game_party.actors.size else return actor.luck end end end end ################ # Game_Battler # ################ class Game_Battler def attack_effect(attacker) self.critical = false hit_result = (rand(100) < attacker.hit) if hit_result == true atk = [attacker.atk - self.pdef / 2, 0].max self.damage = atk * (20 + attacker.str) / 20 self.damage *= elements_correct(attacker.element_set) self.damage /= 100 if self.damage > 0 if attacker.is_a?(Game_Actor) if rand(100) < attacker.luck self.damage *= 2 self.critical = true end else if rand(100) < 4 * attacker.dex / self.agi self.damage *= 2 self.critical = true end end if self.guarding? self.damage /= 2 end end if self.damage.abs > 0 amp = [self.damage.abs * 15 / 100, 1].max self.damage += rand(amp+1) + rand(amp+1) - amp end eva = 8 * self.agi / attacker.dex + self.eva hit = self.damage < 0 ? 100 : 100 - eva hit = self.cant_evade? ? 100 : hit hit_result = (rand(100) < hit) end if hit_result == true remove_states_shock self.hp -= self.damage @state_changed = false states_plus(attacker.plus_state_set) states_minus(attacker.minus_state_set) else self.damage = \"Miss\" self.critical = false end return true end end ############### # Window Base # ############### class Window_Base < Window def draw_actor_luck(actor, x, y) self.contents.font.color = normal_color self.contents.draw_text(x, y, 120, 32, \"Luck \" + actor.luck.to_s + \"%\") if $mogscript[\"menu_eva\"] == true back = RPG::Cache.picture(\"STBAR_Back\") cw = back.width ch = back.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x , y - ch + 40, back, src_rect) meter = RPG::Cache.picture(\"STBAR.png\") cw2 = meter.width * actor.luck / actor.max_luck ch2 = meter.height src_rect2 = Rect.new(0, 0, cw2, ch2) self.contents.blt(x , y - ch + 40, meter, src_rect2) end end end ################# # Window Status # ################# class Window_Status < Window_Base alias mog23_refresh refresh def refresh mog23_refresh if $mogscript[\"menu_eva\"] == true draw_actor_luck(@actor, 520,210) else draw_actor_luck(@actor, 325,120) end end end ################ # Scene Battle # ################ class Scene_Battle alias mog23_start_phase5 start_phase5 def start_phase5 mog23_start_phase5 for actor in $game_party.actors if rand(100) < actor.luck lkhprec = actor.maxhp * MOG::LKHPRECPER / 100 actor.hp += lkhprec actor.damage_pop = true actor.damage = -lkhprec end end @status_window.refresh end end" />

Vai al contenuto


Toggle Chat RM - Chat Apri la Chat in un popup

E' severamente vietato richiedere supporto su RPG Maker in chat!
@  MihaChan : (23 May 2012 - 09:19 PM) a parte i denti -che stanno decidendo di darmi noia in questi giorni-, tutto okay~
@  Melosx : (23 May 2012 - 09:18 PM) bene ^.^ ... Tu??
@  MihaChan : (23 May 2012 - 09:17 PM) come va? xD
@  MihaChan : (23 May 2012 - 09:16 PM) okay
@  MihaChan : (23 May 2012 - 09:16 PM) ah
@  Melosx : (23 May 2012 - 09:14 PM) ciao miha... ai dont spic inglisc
@  MihaChan : (23 May 2012 - 09:12 PM) how'sa goin'?
@  MihaChan : (23 May 2012 - 09:12 PM) ciao Mel!
@  Melosx : (23 May 2012 - 09:07 PM) ciao
@  MihaChan : (23 May 2012 - 09:06 PM) salve D:
@  Pech93 : (23 May 2012 - 08:05 PM) MIk?
@  Melosx : (23 May 2012 - 07:51 PM) VIENI SU MSN!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@  Melosx : (23 May 2012 - 07:51 PM) MIIIIIIIIIIIIIIIIIIIKKKKKKKKKKKK!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@  Melosx : (23 May 2012 - 07:46 PM) *iù
@  Melosx : (23 May 2012 - 07:38 PM) iu spin mi rai rau bebi rai rau laic a record bebi rau rau rau rau
@  Melosx : (23 May 2012 - 07:37 PM) lalalallalallalallallllllllllalalalallaaaaaaaaaaaaaaaaaaaaaa!!!!!!!!!!!!!!!!!!
@  Melosx : (23 May 2012 - 07:37 PM) lalalalala
@  Melosx : (23 May 2012 - 07:37 PM) naoinvaoèvpodlnvvrovnovnondpppppppppmvdgdvjomvmvpe
@  Melosx : (23 May 2012 - 07:36 PM) che coa che robaé
@  Abadon : (23 May 2012 - 07:34 PM) dopo che il forum è andato fuori servizio si è persa un po' la chat D:

Mog luck system


  • Per cortesia connettiti per rispondere
3 risposte a questa discussione

#1 OFFLINE   Ally

Ally

    Fondatori

  • Amministratori
  • 5558 Messaggi:
  • Localitàrpgmkr
  • Ruolo:
    Scripter
  • Progetto VX:
    Essence
  • Tool:
    RM2k/2k3

Inviato 14 April 2010 - 01:59 PM

Titolo: Mog luck system
Versione: N/D
Autore/i: Moghunter, Loste

Informazioni:
Script che associa la 'fortuna' al vostro PG nel:
- Recuperare HP a fine battaglia
- Causare danni critici
- Vincere Oggetti

Istruzioni:
Inserire lo script sopra Main

Script:
#_________________________________________________
# MOG_Luck System V1.2           
#_________________________________________________
# By Moghunter     
# http://www.atelier-rgss.com
#
#Traduzione in italiano by Loste -http://rpgmkr.net
#_________________________________________________
#Aggiunge l'attributo "fortuna", che interagisce con la
#possibilità di vincere oggetti o causare danni critici.
#_________________________________________________
module MOG
# Limite massimo di fortuna.
# I Valori magiori di 100% saranno limitati a questo valore.
# MAX_LUCK = {A=>B}
#
# A = ID del personaggio
# B = valore massimo di fortuna per ogni personaggio.
#
# Se non definito il valore massimo sarà pari a 100%.
MAX_LUCK = {
     1=>60,
     2=>45,
     7=>23
           }
#_________________________________________________
#Definizione del valore iniziale di fortuna per ogni personaggio.
# INILUCK = {A =>B}
#
# A = ID del personaggio.
# B = valore iniziale della fortuna.
#
#Se non definito il valore sarà pari a 1.
INILUCK = {
           1 =>5,
           2 =>3,
           7 =>2
          }
#_________________________________________________         
#Definizione dell'aumento di fortuna per ogni livello.
#LKUP = {A =>B}
#
# A = ID del personaggio
# B = Valore dell'incremento.
#
#Se non definito il valore sarà pari a 1.
LKUP = {1 =>2,
        2 =>3
       }
#_________________________________________________         
#Calcolo della probabilità di vincere oggetti.
#
# false = Il calcolo della probabilità si basa sul valore più alto del gruppo.
# true  = Il calcolo della probabilità si basa sul valore medio del gruppo.
LKITEMEDIA = true
#_________________________________________________         
#Quantittà % di HP recuperati.
LKHPRECPER = 10
end
#_________________________________________________
$mogscript = {} if $mogscript == nil
$xrxs = {} if $xrxs == nil
$mogscript[\"luck_system\"] = true
##############
# Game Actor #
##############
class Game_Actor < Game_Battler
alias mog23_setup setup
def setup(actor_id)
iniluck = MOG::INILUCK[actor_id]
maxluck = MOG::MAX_LUCK[actor_id]
if maxluck == nil
@max_luck = 100
else
@max_luck = maxluck
end
if MOG::INILUCK[actor_id] == nil
@luck = 1
else
@luck = iniluck
end
if MOG::LKUP[actor_id] == nil
@luckup = 1
else
@luckup = MOG::LKUP[actor_id]
end
mog23_setup(actor_id)
end
def max_luck
return @max_luck
end
def luck
if @max_luck != nil and @luck > @max_luck
@luck = @max_luck
else
if @luck > 100
@luck = 100
end
return @luck
end
end
def exp=(exp)
@exp = [[exp, 9999999].min, 0].max
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
@level += 1
@luck += @luckup
for j in $data_classes[@class_id].learnings
if j.level == @level
learn_skill(j.skill_id)
end
end
end
while @exp < @exp_list[@level]
@level -= 1
@luck  -= @luckup
end
@hp = [@hp, self.maxhp].min
@sp = [@sp, self.maxsp].min
end
end
###############
# Game_Enemy  #
###############
class Game_Enemy < Game_Battler
def treasure_prob
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
if MOG::LKITEMEDIA == true
return actor.luck / $game_party.actors.size
else
return actor.luck   
end
end
end
end
################
# Game_Battler #
################
class Game_Battler
def attack_effect(attacker)
self.critical = false
hit_result = (rand(100) < attacker.hit)
if hit_result == true
atk = [attacker.atk - self.pdef / 2, 0].max
self.damage = atk * (20 + attacker.str) / 20
self.damage *= elements_correct(attacker.element_set)
self.damage /= 100
if self.damage > 0
if attacker.is_a?(Game_Actor)
if rand(100) < attacker.luck
self.damage *= 2
self.critical = true
end
else
if rand(100) < 4 * attacker.dex / self.agi
self.damage *= 2
self.critical = true
end
end
if self.guarding?
self.damage /= 2
end
end
if self.damage.abs > 0
amp = [self.damage.abs * 15 / 100, 1].max
self.damage += rand(amp+1) + rand(amp+1) - amp
end
eva = 8 * self.agi / attacker.dex + self.eva
hit = self.damage < 0 ? 100 : 100 - eva
hit = self.cant_evade? ? 100 : hit
hit_result = (rand(100) < hit)
end
if hit_result == true
remove_states_shock
self.hp -= self.damage
@state_changed = false
states_plus(attacker.plus_state_set)
states_minus(attacker.minus_state_set)
else
self.damage = \"Miss\"
self.critical = false
end
return true
end
end
###############
# Window Base #
###############
class Window_Base < Window
def draw_actor_luck(actor, x, y)
self.contents.font.color = normal_color
self.contents.draw_text(x, y, 120, 32, \"Luck  \" + actor.luck.to_s + \"%\")
if $mogscript[\"menu_eva\"] == true
back = RPG::Cache.picture(\"STBAR_Back\")   
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)   
self.contents.blt(x , y - ch + 40, back, src_rect)
meter = RPG::Cache.picture(\"STBAR.png\")   
cw2 = meter.width * actor.luck / actor.max_luck
ch2 = meter.height
src_rect2 = Rect.new(0, 0, cw2, ch2)   
self.contents.blt(x , y - ch + 40, meter, src_rect2)
end
end
end
#################
# Window Status #
#################
class Window_Status < Window_Base
alias mog23_refresh refresh
def refresh
mog23_refresh
if $mogscript[\"menu_eva\"] == true
draw_actor_luck(@actor, 520,210)
else
draw_actor_luck(@actor, 325,120)   
end
end
end
################
# Scene Battle #
################
class Scene_Battle
alias mog23_start_phase5 start_phase5
def start_phase5
mog23_start_phase5   
for actor in $game_party.actors
if rand(100) < actor.luck
lkhprec = actor.maxhp * MOG::LKHPRECPER / 100
actor.hp += lkhprec
actor.damage_pop = true
actor.damage = -lkhprec
end
end
@status_window.refresh
end
end

Immagine inserita
Spoiler

#2 OFFLINE   .:: Tidus 00 ::.

.:: Tidus 00 ::.

    Maker Viandante

  • Utenti RM
  • 183 Messaggi:
  • LocalitàSalerno
  • Progetto XP:
    Legend's Land

Inviato 14 April 2010 - 03:46 PM

io lo usavo, ma ho scoperto che con i CBS, se non hai la fortuna molto alta non droppi mai nessun oggetto... >_>
Immagine inseritaImmagine inserita

Citazione

"Non è forte chi non cade, ma chi cade ed ha la forza di rialzarsi!"
Immagine inseritaImmagine inseritaImmagine inserita

#3 OFFLINE   Loste

Loste

    RM Avanzato

  • Utenti RM
  • StellettaStellettaStelletta
  • 54 Messaggi:

Inviato 14 July 2011 - 08:36 AM

per chi volesse lo ho tradotto in italiano ^^ (non che ci fosse molto da fare!eheh)
#_________________________________________________
# MOG_Luck System V1.2           
#_________________________________________________
# By Moghunter     
# http://www.atelier-rgss.com
#
#Traduzione in italiano by Loste -http://rpgmkr.net
#_________________________________________________
#Aggiunge l'attributo "fortuna", che interagisce con la
#possibilità di vincere oggetti o causare danni critici.
#_________________________________________________
module MOG
# Limite massimo di fortuna.
# I Valori magiori di 100% saranno limitati a questo valore.
# MAX_LUCK = {A=>B}
#
# A = ID del personaggio
# B = valore massimo di fortuna per ogni personaggio.
#
# Se non definito il valore massimo sarà pari a 100%.
MAX_LUCK = {
     1=>60,
     2=>45,
     7=>23
           }
#_________________________________________________
#Definizione del valore iniziale di fortuna per ogni personaggio.
# INILUCK = {A =>B}
#
# A = ID del personaggio.
# B = valore iniziale della fortuna.
#
#Se non definito il valore sarà pari a 1.
INILUCK = {
           1 =>5,
           2 =>3,
           7 =>2
          }
#_________________________________________________         
#Definizione dell'aumento di fortuna per ogni livello.
#LKUP = {A =>B}
#
# A = ID del personaggio
# B = Valore dell'incremento.
#
#Se non definito il valore sarà pari a 1.
LKUP = {1 =>2,
        2 =>3
       }
#_________________________________________________         
#Calcolo della probabilità di vincere oggetti.
#
# false = Il calcolo della probabilità si basa sul valore più alto del gruppo.
# true  = Il calcolo della probabilità si basa sul valore medio del gruppo.
LKITEMEDIA = true
#_________________________________________________         
#Quantittà % di HP recuperati.
LKHPRECPER = 10
end 
#_________________________________________________
$mogscript = {} if $mogscript == nil
$xrxs = {} if $xrxs == nil
$mogscript[\"luck_system\"] = true
##############
# Game Actor #
##############
class Game_Actor < Game_Battler
alias mog23_setup setup
def setup(actor_id) 
iniluck = MOG::INILUCK[actor_id]
maxluck = MOG::MAX_LUCK[actor_id]
if maxluck == nil
@max_luck = 100
else
@max_luck = maxluck 
end
if MOG::INILUCK[actor_id] == nil
@luck = 1 
else
@luck = iniluck
end
if MOG::LKUP[actor_id] == nil
@luckup = 1
else
@luckup = MOG::LKUP[actor_id]
end 
mog23_setup(actor_id)
end
def max_luck
return @max_luck
end
def luck 
if @max_luck != nil and @luck > @max_luck
@luck = @max_luck
else
if @luck > 100
@luck = 100
end
return @luck 
end
end 
def exp=(exp)
@exp = [[exp, 9999999].min, 0].max
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
@level += 1
@luck += @luckup
for j in $data_classes[@class_id].learnings
if j.level == @level
learn_skill(j.skill_id)
end
end
end
while @exp < @exp_list[@level]
@level -= 1
@luck  -= @luckup
end
@hp = [@hp, self.maxhp].min
@sp = [@sp, self.maxsp].min
end
end
###############
# Game_Enemy  #
###############
class Game_Enemy < Game_Battler
def treasure_prob
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
if MOG::LKITEMEDIA == true
return actor.luck / $game_party.actors.size
else
return actor.luck   
end
end
end
end
################
# Game_Battler #
################
class Game_Battler
def attack_effect(attacker)
self.critical = false
hit_result = (rand(100) < attacker.hit)
if hit_result == true
atk = [attacker.atk - self.pdef / 2, 0].max
self.damage = atk * (20 + attacker.str) / 20
self.damage *= elements_correct(attacker.element_set)
self.damage /= 100
if self.damage > 0
if attacker.is_a?(Game_Actor)
if rand(100) < attacker.luck
self.damage *= 2
self.critical = true
end
else
if rand(100) < 4 * attacker.dex / self.agi
self.damage *= 2
self.critical = true
end 
end 
if self.guarding?
self.damage /= 2
end
end
if self.damage.abs > 0
amp = [self.damage.abs * 15 / 100, 1].max
self.damage += rand(amp+1) + rand(amp+1) - amp
end
eva = 8 * self.agi / attacker.dex + self.eva
hit = self.damage < 0 ? 100 : 100 - eva
hit = self.cant_evade? ? 100 : hit
hit_result = (rand(100) < hit)
end
if hit_result == true
remove_states_shock
self.hp -= self.damage
@state_changed = false
states_plus(attacker.plus_state_set)
states_minus(attacker.minus_state_set)
else
self.damage = \"Miss\"
self.critical = false
end
return true
end
end
###############
# Window Base #
###############
class Window_Base < Window
def draw_actor_luck(actor, x, y)
self.contents.font.color = normal_color
self.contents.draw_text(x, y, 120, 32, \"Luck  \" + actor.luck.to_s + \"%\") 
if $mogscript[\"menu_eva\"] == true
back = RPG::Cache.picture(\"STBAR_Back\")   
cw = back.width 
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)   
self.contents.blt(x , y - ch + 40, back, src_rect) 
meter = RPG::Cache.picture(\"STBAR.png\")   
cw2 = meter.width * actor.luck / actor.max_luck
ch2 = meter.height
src_rect2 = Rect.new(0, 0, cw2, ch2)   
self.contents.blt(x , y - ch + 40, meter, src_rect2)
end
end 
end
#################
# Window Status #
#################
class Window_Status < Window_Base
alias mog23_refresh refresh
def refresh
mog23_refresh
if $mogscript[\"menu_eva\"] == true
draw_actor_luck(@actor, 520,210)
else
draw_actor_luck(@actor, 325,120)   
end 
end 
end
################
# Scene Battle #
################
class Scene_Battle
alias mog23_start_phase5 start_phase5
def start_phase5
mog23_start_phase5   
for actor in $game_party.actors
if rand(100) < actor.luck
lkhprec = actor.maxhp * MOG::LKHPRECPER / 100
actor.hp += lkhprec
actor.damage_pop = true
actor.damage = -lkhprec
end
end
@status_window.refresh
end
end


#4 OFFLINE   Ally

Ally

    Fondatori

  • Amministratori
  • 5558 Messaggi:
  • Localitàrpgmkr
  • Ruolo:
    Scripter
  • Progetto VX:
    Essence
  • Tool:
    RM2k/2k3

Inviato 14 July 2011 - 03:28 PM

Grazie Loste, anche se dici che è poco, hai sempre contribuito ^^
Lo inserisco al primo post ;)
Immagine inserita
Spoiler




1 utente(i) stanno leggendo questa discussione

0 utenti, 1 ospiti, 0 utenti anonimi