Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> ~[Kid's Luck Systems VX]~, ----> Now Update ver 1.2<-----
tonytj
post Jun 20 2008, 05:08 AM
Post #1


Level 2
Group Icon

Group: Member
Posts: 22
Type: Scripter
RM Skill: Skilled




KID's Luck Systems

By Nam Kid 9x - version 1.2


Info :
4-5-2008 ver 1.00
  • Make Luck point ( % )
  • Add Cri with Luck ( x2 damage ) and Perfect Cri ( x3 damage )
  • Add % usefull item or skill heal ( restore HP and MP )
  • Add damage of item or skill when use atk

5-5-2008 ver 1.01
  • Add Money and exp more or less with luck point

22-6-2008 ver 1.2
  • Luck up for actor ( actor ID => luck up point )
  • Add Lucky Dodges ( eva ) - not complete 100% - beta
  • Add Perfect Hit ( hit )
  • Fix Gold

Edit :
CODE
module KID
  LUCK_MAX = {1 => 100}    # Max luck ( actor ID => max luck)
  LUCK_UP = {1 => 2, 2 => 2, 3 => 1, 4 => 2} # point Luck when up level
  LUCKSTART = {1 => 3}     # Start luck ( actor ID => max luck)
end

Script :
This Script don't add to Menu , You Will add this ^^~ use "actor.luck"
[Show/Hide] version 1.2
CODE

#------------------------------------------------------------------------------
# By Nam Kid
# Luck Systems VX 1.2
# Liên Hê? : zaw.thieugia_vl@yahoo.com
# hoa?c : zaw.thieugia@gmail.com
#------------------------------------------------------------------------------

#------------------------------------------------------------------------------
# Luck Info :
# 4-5-2008 ver 1.00
# +) Make Luck point ( % )
# +) Add Cri with Luck ( x2 damage ) and Perfect Cri ( x3 damage )
# +) Add % usefull item or skill heal ( restore HP and MP )
# +) Add damage of item or skill when use atk
# 5-5-2008 ver 1.01 ( small update )
# +) Add Money and exp more or less with luck point
# 22-6-2008 ver 1.2 ( some small update )
# +) Luck up for actor ( actor ID => luck up point )
# +) Add Lucky Dodges ( eva ) - not complete 100% - beta
# +) Add Perfect Hit ( hit )
# +) Fix Gold
# ... continue update ..
#
#------------------------------------------------------------------------------

#------------------------------------------------------------------------------
# script na`y chua dc add va`o menu
#------------------------------------------------------------------------------

#------------------------------------------------------------------------------
# thanks Moghunter vo´i script Luck systems XP1.2
#------------------------------------------------------------------------------

module KID
LUCK_MAX = {1 => 100} # gio´i ha?n Luck
LUCK_UP = {1 => 2, 2 => 2, 3 => 1, 4 => 2} # diê?m luck khi tang level
LUCKSTART = {1 => 100} # lu´c khi ba´t dâ`u ( câ´u tru´c : ID actor => luck )
end
class Game_Actor < Game_Battler
alias kid_setup setup
def setup(actor_id)
maxluck = KID::LUCK_MAX[actor_id]
if maxluck == nil
@max_luck = 100
else
@max_luck = maxluck
end

if KID::LUCKSTART[actor_id] == nil
@luck = 1
else
@luck = KID::LUCKSTART[actor_id]
end

if KID::LUCK_UP[actor_id] == nil
@luckup = 1
else
@luckup = KID::LUCK_UP[actor_id]
end
kid_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 level_up
@level += 1
@luck += @luckup
for learning in self.class.learnings
learn_skill(learning.skill_id) if learning.level == @level
end
end

def level_down
@level -= 1
@luck -= @luckup
end
end


class Game_Battler

def calc_eva(user, obj = nil)
eva = self.eva
unless obj == nil # if it is a skill or an item
eva = 0 unless obj.physical_attack # 0% if not a physical attack
end
unless parriable? # If not parriable
eva = 0 # 0%
end
if user.is_a?(Game_Actor)
eva -= user.luck
eva == 0 if eva <= 0
end
unless user.is_a?(Game_Actor)
eva -= user.luck
eva == 0 if eva <= 0
end
return eva
end

def make_attack_damage_value(attacker)
damage = attacker.atk * 4 - self.def * 2
damage = 0 if damage < 0
damage *= elements_max_rate(attacker.element_set)
damage /= 100
if damage == 0
damage = rand(2)
elsif attacker.is_a?(Game_Actor) # xa´c nhâ?n Luck chi? co´ khi actor ra do`n
if rand(100) < attacker.luck # ngâ~u nhiên
damage *= 2 # dam x2
@critical = true # hiê?n cri trong ba?n battler log
end
elsif damage > 0
@critical = (rand(100) < attacker.cri)
@critical = false if prevent_critical
damage *= 3 if @critical
end
damage = apply_variance(damage, 20)
damage = apply_guard(damage)
@hp_damage = damage
end

def make_obj_damage_value(user, obj)
damage = obj.base_damage
if damage > 0
damage += user.atk * 4 * obj.atk_f / 100
damage += user.spi * 2 * obj.spi_f / 100
unless obj.ignore_defense
damage -= self.def * 2 * obj.atk_f / 100
damage -= self.spi * 1 * obj.spi_f / 100
end
damage = 0 if damage < 0
elsif user.is_a?(Game_Actor) # xa´c nhâ?n Luck chi? co´ khi actor su? du?ng
if rand(100) < user.luck # ngâ~u nhiên
damage += user.atk * 4 * obj.atk_f * user.luck / (100 + user.luck)
damage += user.spi * 2 * obj.spi_f * user.luck / (100 + user.luck)
unless obj.ignore_defense
damage -= self.def * 2 * obj.atk_f / (100 + 2*user.luck)
damage -= self.spi * 1 * obj.spi_f / (100 + 2*user.luck)
end
end
elsif damage < 0
damage -= user.atk * 4 * obj.atk_f / 100
damage -= user.spi * 2 * obj.spi_f / 100
end
damage *= elements_max_rate(obj.element_set)
damage /= 100
damage = apply_variance(damage, obj.variance)
damage = apply_guard(damage)
if obj.damage_to_mp
@mp_damage = damage
else
@hp_damage = damage
end
end

def calc_hp_recovery(user, item)
result = maxhp * item.hp_recovery_rate / 100 + item.hp_recovery
result *= 2 if user.pharmacology
result += user.luck * 2 if user.is_a?(Game_Actor)
return result
end

def calc_mp_recovery(user, item)
result = maxmp * item.mp_recovery_rate / 100 + item.mp_recovery
result *= 2 if user.pharmacology
result += user.luck * 3 if user.is_a?(Game_Actor)
return result
end

end

class Game_Enemy < Game_Battler

def exp
for actor in $game_party.members
if rand(100) < actor.luck
enemy.exp += (actor.luck + enemy.exp) / 3
end
return enemy.exp
end
end

def gold
for actor in $game_party.members
enemy.gold += (actor.luck + enemy.gold) / 3 + ( rand(100) - rand(100)) / actor.luck
return enemy.gold
end
end

end



[Show/Hide] version 1.01
CODE

#------------------------------------------------------------------------------
# By Nam Kid
# Luck Systems VX 1.01
# Liên Hê? : zaw.thieugia_vl@yahoo.com
# hoa?c : zaw.thieugia@gmail.com
#------------------------------------------------------------------------------

#------------------------------------------------------------------------------
# Luck có tác du?ng :
# 4-5-2008 ver 1.00
# +) tang kha? nang cri ( cu´ da´nh hoa`n ha?o ) nhung khi thu?c hiê?n cu´
# da´nh na`y vo´i luck thi` dam se~ chi? x2 ! co`n vo´i chê´ dô? ma?c di?nh dam x3
# +) tang kha? nang su? du?ng ca´c item, skill phu?c hô`i HP va` MP
# +) tang dam khi su? du?ng skill hay Item tâ´n công.!
# 5-5-2008 ver 1.01
# +) update tiê`n va` EXP nhâ?n dc khi giê´t qua´i vâ?t!
# ... se~ tiê´p tu?c update ..
#------------------------------------------------------------------------------

#------------------------------------------------------------------------------
# script na`y chua dc add va`o menu
#------------------------------------------------------------------------------

#------------------------------------------------------------------------------
# thanks Moghunter vo´i script Luck systems XP1.2
#------------------------------------------------------------------------------

module KID
LUCK_MAX = {1 => 100} # gio´i ha?n Luck
LUCK_UP = 2 # diê?m luck khi tang level
LUCKSTART = {1 => 3} # lu´c khi ba´t dâ`u ( câ´u tru´c : ID actor => luck )
end
class Game_Actor < Game_Battler
alias kid_setup setup
def setup(actor_id)
maxluck = KID::LUCK_MAX[actor_id]
if maxluck == nil
@max_luck = 100
else
@max_luck = maxluck
end

if KID::LUCKSTART[actor_id] == nil
@luck = 1
else
@luck = KID::LUCKSTART[actor_id]
end

if KID::LUCK_UP == nil
@luckup = 1
else
@luckup = KID::LUCK_UP
end
kid_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 level_up
@level += 1
@luck += @luckup
for learning in self.class.learnings
learn_skill(learning.skill_id) if learning.level == @level
end
end

def level_down
@level -= 1
@luck -= @luckup
end
end


class Game_Battler

def make_attack_damage_value(attacker)
damage = attacker.atk * 4 - self.def * 2
damage = 0 if damage < 0
damage *= elements_max_rate(attacker.element_set)
damage /= 100
if damage == 0
damage = rand(2)
elsif attacker.is_a?(Game_Actor) # xa´c nhâ?n Luck chi? co´ khi actor ra do`n
if rand(100) < attacker.luck # ngâ~u nhiên
damage *= 2 # dam x2
@critical = true # hiê?n cri trong ba?n battler log
end
elsif damage > 0
@critical = (rand(100) < attacker.cri)
@critical = false if prevent_critical
damage *= 3 if @critical
end
damage = apply_variance(damage, 20)
damage = apply_guard(damage)
@hp_damage = damage
end

def make_obj_damage_value(user, obj)
damage = obj.base_damage
if damage > 0
damage += user.atk * 4 * obj.atk_f / 100
damage += user.spi * 2 * obj.spi_f / 100
unless obj.ignore_defense
damage -= self.def * 2 * obj.atk_f / 100
damage -= self.spi * 1 * obj.spi_f / 100
end
damage = 0 if damage < 0
elsif user.is_a?(Game_Actor) # xa´c nhâ?n Luck chi? co´ khi actor su? du?ng
if rand(100) < user.luck # ngâ~u nhiên
damage += user.atk * 4 * obj.atk_f * user.luck / (100 + user.luck)
damage += user.spi * 2 * obj.spi_f * user.luck / (100 + user.luck)
unless obj.ignore_defense
damage -= self.def * 2 * obj.atk_f / (100 + 2*user.luck)
damage -= self.spi * 1 * obj.spi_f / (100 + 2*user.luck)
end
end
elsif damage < 0
damage -= user.atk * 4 * obj.atk_f / 100
damage -= user.spi * 2 * obj.spi_f / 100
end
damage *= elements_max_rate(obj.element_set)
damage /= 100
damage = apply_variance(damage, obj.variance)
damage = apply_guard(damage)
if obj.damage_to_mp
@mp_damage = damage
else
@hp_damage = damage
end
end

def calc_hp_recovery(user, item)
result = maxhp * item.hp_recovery_rate / 100 + item.hp_recovery
result *= 2 if user.pharmacology
result += user.luck * 2 if user.is_a?(Game_Actor)
return result
end

def calc_mp_recovery(user, item)
result = maxmp * item.mp_recovery_rate / 100 + item.mp_recovery
result *= 2 if user.pharmacology
result += user.luck * 3 if user.is_a?(Game_Actor)
return result
end

end

class Game_Enemy < Game_Battler

def exp
for actor in $game_party.members
if rand(100) < actor.luck
enemy.exp += (actor.luck + enemy.exp) / 3
end
return enemy.exp
end
end

def gold
for actor in $game_party.members
if rand(100) < actor.luck
enemy.gold += (actor.luck + enemy.gold) / 3
end
return enemy.gold
end
end

end


[Show/Hide] Help! - add script

add this script :

u can use "actor.luck" in Window_Status or use this :

CODE
class Window_Base < Window
  def draw_luck(actor,x,y)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 32, WLH, "Luck : ")
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 32, y, 24, WLH, actor.luck, 2)
  end
end


and in script : Window_Status ; in def draw_basic_info(x, y) ( line 35 ) or anything

add : draw_luck(@actor, x, y ) ( x,y : you need set it )

good luck!



Have Fun!!

This post has been edited by tonytj: Jun 29 2008, 11:31 AM


__________________________
Very Busy !!!
Very Busy !!!
Very Busy !!!
Very Busy !!!
Very Busy !!!
Very Busy !!!
Very Busy !!!
Go to the top of the page
 
+Quote Post
   
Nessiah
post Jun 20 2008, 05:10 AM
Post #2


Sleep Deprived
Group Icon

Group: Revolutionary
Posts: 548
Type: Artist
RM Skill: Advanced




Wow this is really nice biggrin.gif
I always like the perception of using luck for critical damage XD will this also be upgraded to make "lucky dodges"?


__________________________


I'm not joining any projects. The only way to make me is to either pay me or trading =v=)b

QUOTE
The way you speak about rm2k3, like "modules, arrays, pointers" sounds like you're some badass c++ programmer stuck in the past and only has rm2k3 to work with" -Gutts
Go to the top of the page
 
+Quote Post
   
tonytj
post Jun 20 2008, 06:48 AM
Post #3


Level 2
Group Icon

Group: Member
Posts: 22
Type: Scripter
RM Skill: Skilled




QUOTE (Nessiah @ Jun 20 2008, 04:24 AM) *
Wow this is really nice biggrin.gif
I always like the perception of using luck for critical damage XD will this also be upgraded to make "lucky dodges"?

oh!... "lucky dodges" . yeah..! thanks you. ^^~


__________________________
Very Busy !!!
Very Busy !!!
Very Busy !!!
Very Busy !!!
Very Busy !!!
Very Busy !!!
Very Busy !!!
Go to the top of the page
 
+Quote Post
   
tonytj
post Jun 21 2008, 08:31 PM
Post #4


Level 2
Group Icon

Group: Member
Posts: 22
Type: Scripter
RM Skill: Skilled




22-6-2008 ver 1.2

* Luck up for actor ( actor ID => luck up point )
* Add Lucky Dodges ( eva ) - not complete 100% - beta
* Add Perfect Hit ( hit )
* Fix Gold


__________________________
Very Busy !!!
Very Busy !!!
Very Busy !!!
Very Busy !!!
Very Busy !!!
Very Busy !!!
Very Busy !!!
Go to the top of the page
 
+Quote Post
   
Apkx24
post Jun 24 2008, 02:09 PM
Post #5


Level 4
Group Icon

Group: Member
Posts: 55
Type: None
RM Skill: Skilled




yea u can change this at any time right? liek when you find a certain item or at a certain point in the game, you can change your luck with variables/ script right?
o and when do u think this scripts going final? wanna get the best version
looks nice MUCH better than most other scripts that are dumb additions or liek more and more battle systems (except some that are good)
its one of those overlooked unique scripts that r actually rly good
gl on making this
Go to the top of the page
 
+Quote Post
   
YanXie
post Jun 27 2008, 09:56 AM
Post #6


Because Tomorrow Will Surely Come...
Group Icon

Group: Revolutionary
Posts: 1,137
Type: None
RM Skill: Skilled




How about making the luck affect item drop rate in battle and also add something like when the luck is higher, the random encounter will be less, that's would be pretty neat features to add smile.gif

cheers, puppeto4. smile.gif


__________________________
how make teleport to graveyard then your character die?

AWAY FOR VACATION.
NOT HERE UNTIL JAN/FEB 2010 -w-/
Go to the top of the page
 
+Quote Post
   
tonytj
post Jun 28 2008, 02:24 AM
Post #7


Level 2
Group Icon

Group: Member
Posts: 22
Type: Scripter
RM Skill: Skilled




QUOTE (puppeto4 @ Jun 27 2008, 09:10 AM) *
How about making the luck affect item drop rate in battle and also add something like when the luck is higher, the random encounter will be less, that's would be pretty neat features to add smile.gif

cheers, puppeto4. smile.gif


oh.! thanks......! biggrin.gif that good !!!

+) Item Drop Rate ( maybe add more item drop??? biggrin.gif )
+) Encounter With Luck

This post has been edited by tonytj: Jun 28 2008, 02:26 AM


__________________________
Very Busy !!!
Very Busy !!!
Very Busy !!!
Very Busy !!!
Very Busy !!!
Very Busy !!!
Very Busy !!!
Go to the top of the page
 
+Quote Post
   
C4karura
post Jun 29 2008, 04:15 AM
Post #8


Level 6
Group Icon

Group: Member
Posts: 80
Type: Developer
RM Skill: Beginner




hey, can someone tell me ..how do i add this script to my rpg...and exactly where? do i add this..


__________________________

~~~~~~~~~
[Show/Hide] click here for game projects

RPGCONNECT3

[Show/Hide] future game projects in the hybrid fantasy title
Hybrid fantasy :
Jeffs quest
progress: still in draft stages
Hybrid fantasy:
hero chronicles
Mugen platform
progress: still in draft stages
Hybrid fantasy:
hero chronicles EX
Mugen platform

progress: still in draft stahes
Go to the top of the page
 
+Quote Post
   
tonytj
post Jun 29 2008, 11:27 AM
Post #9


Level 2
Group Icon

Group: Member
Posts: 22
Type: Scripter
RM Skill: Skilled




u can use "actor.luck" in Window_Status or use this :

CODE
class Window_Base < Window
  def draw_luck(actor,x,y)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 32, WLH, "Luck : ")
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 32, y, 24, WLH, actor.luck, 2)
  end
end


and in script : Window_Status ; in def draw_basic_info(x, y) ( line 35 ) or anything

add : draw_luck(@actor, x, y ) ( x,y : you need set it )

good luck!






__________________________
Very Busy !!!
Very Busy !!!
Very Busy !!!
Very Busy !!!
Very Busy !!!
Very Busy !!!
Very Busy !!!
Go to the top of the page
 
+Quote Post
   
tonytj
post Jun 29 2008, 12:54 PM
Post #10


Level 2
Group Icon

Group: Member
Posts: 22
Type: Scripter
RM Skill: Skilled




I will Make The Next Version With :

# +) Fix Exp ( perfect )
# +) Fix Gold ( perfect )
# +) Item Drop Rate
# +) Map Encounter With Luck Effect
# +) Add Higt Lv Actor in Game_Party
# +) Add Script to Menu_Status

This post has been edited by tonytj: Jun 29 2008, 12:55 PM


__________________________
Very Busy !!!
Very Busy !!!
Very Busy !!!
Very Busy !!!
Very Busy !!!
Very Busy !!!
Very Busy !!!
Go to the top of the page
 
+Quote Post
   
ThePhantomCorrec...
post Nov 21 2008, 11:27 AM
Post #11



Group Icon

Group: Member
Posts: 1
Type: Event Designer
RM Skill: Skilled




sad.gif It's all going onto one line.
Go to the top of the page
 
+Quote Post
   
susys
post Jan 5 2009, 05:17 AM
Post #12



Group Icon

Group: Member
Posts: 2
Type: Event Designer
RM Skill: Intermediate




yeah, this happens to me to, can you make a demo, whenever i copy a script from here and paste it in my project it goes on one line.
Go to the top of the page
 
+Quote Post
   
KAZRCRW_ME
post Jan 5 2009, 07:06 AM
Post #13


new stuff, I'll play around with it later...
Group Icon

Group: Revolutionary
Posts: 132
Type: None
RM Skill: Undisclosed




With name of God who He is Loving and Compassionate..

It is very useful

How about Thief? Which they stealing item from enemies.

More luck, more the stealing to be success.
Less luck, more the stealing to be failed.


Hmmm.Maybe it hard.(I think)^^

QUOTE
yeah, this happens to me to, can you make a demo, whenever i copy a script from here and paste it in my project it goes on one line.


I think maybe with the demo it become better.
At least,give a screenshoot.

May God Bless us thumbsup.gif


__________________________
Looking for the one with the glass slipper



[Show/Hide] Click me If you dare..




[Show/Hide] My Name



[Show/Hide] Avatars

Diligent Ying and Yang OMG_RAWR!

[Show/Hide] Vincent



Go to the top of the page
 
+Quote Post
   
susys
post Jan 5 2009, 02:38 PM
Post #14



Group Icon

Group: Member
Posts: 2
Type: Event Designer
RM Skill: Intermediate




well i need someone to at least make a download of the script in notepad or something becouse i cant add it to my project.
Go to the top of the page
 
+Quote Post
   
Mickadell
post Jan 17 2009, 03:26 AM
Post #15


Level 5
Group Icon

Group: Member
Posts: 71
Type: Event Designer
RM Skill: Masterful




Comment
Rate: Ok

I think it's good alittle useful. But it may be useful for some.
Attached File(s)
Attached File  Admin_Icon2.png ( 2.14K ) Number of downloads: 1
 
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 21st May 2013 - 09:36 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker