Stat Distribution System
Version: 1.71
Author: Lettuce
Date: November 23, 2008
Version History
- 2-May-08 : Version 1.0 increases atk (base atk and weapon bonus), max stat counts weapons bonus too. Now in version 1.1, the script only increase the base atk value, ignoring all weapon bonus (so if your max stat in game is 99, base atk 23 and weapon atk is 30; you can increase the base atk to 99. and with weapon bonus, you have total atk of 129!)
- 3-May-08 : Version 1.2; showing much more info, including equiped items and their stats bonus, max attack power, evasion, hit and critical rate
- 5-May-2008 : Version 1.3, now showing "Unequiped message" for unequiped slot rather than leaving it blank, 2 layout modes (for those who use very long Vocab for the 4 attributes), plays sound etc~
- 8-May-2008 : Feature update, now with exp bar, states display and lets you set a starting points [points given at the beginning of the game]
- 13-May-2008 : Feature update, now you can increase hit rate, evasion rate and critical rate. Points needed for each and increment amount for each are customizable
- 20-May-2008 : Two handed weapon now displays correctly.
- 23-Nov-2008 : Fixed to support dual wielding.
Planned Future Versions
Description
If you have played online game before, you will notice that some of them give you points upon level up and let you increase your stat as you like instead of having a pre-determined stats. This script mimics that system.
This script have 2 modes, regular mode where you get a fixed number of stats upon leveling up and 1 point will give you 1 stat increase.
Then there's RO (Ragnarok online) mode, where you gain a few points upon level up at lower level, but at higher level, you get more points per level up (calculated by formula)
and each stat will require more points for 1 increase at higher value. For example, you need 10 points to increase from 90 SPI to 91 SPI, but only 2 points to increase ATK from 2 to 3 (meaning, you can sacrify the points needed for the high stat and get several lower stats with the same amount of points :D)
Features
- Give you the ability to increase hp, mp, atk, def, spi, agi, hit, eva and crit o.O
- Mode toggle (normal and RO)
- Can easily give your actors points
- Does not interfere with normal character's growth (set the stat curve in database to 1 all the way from 1 to 99; this will disable natural growth
- SHOULD work with any party switching / more than 4 actor per party scripts
- Customizable maximum stats
- Customizable starting points
- Customizable stat increment
- Replace the status menu?
- Displays max atk, hit rate, evasion rate, critical rate
- Displays actor name, class, states, exp, equipments, attributes etc.
- Customizable font -_-;; (running out of feature)
Screenshots
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi40.photobucket.com%2Falbums%2Fe218%2FKian666%2Fscreenie-4.jpg&hash=e557b60b10352e1a9d28b29d87b25ed3e1aaf6a0)
Instructions
Calling the script:You can use call script event and this code
$scene = Scene_Stat_Dist.new(0)Or edit your menu scene
Giving Points: $game_party.members[<member ID>].points += <amount of points>
#$game_party.members[0].points += 5 <- this would give your first actor in the party 5 pointsor if you want to give point upon level up
under
Game_Actor, in def
change_exp, under the line
level_up ; paste this
difference = @level - last_level
$game_actors[@actor_id].points += <amount of points>If you want to give points upon level up the same way as RO does, use this this one
difference = @level - last_level
$game_actors[@actor_id].points += ((@level/5).floor+2).floor*differenceScript
Script (http://naturallyartificial.net/wp-content/uploads/2009/02/statdist_script.txt)
Credit
Thanks
- Akin (improvement suggestions)
- GoldenShadow (advices)
Support
Just PM me :0
Known Compatibility Issues
*Compatible with Akin's Weapon upgrade Script
Demo
Demo here~ (http://naturallyartificial.net/wp-content/uploads/2009/02/statdist.exe)
Author's Notes
This script will part of my Ragnarok Online package, includes this script, RO style damage calculations etc etc
FAQs
Q: How do i get unequiped icons like the ones in your screenshot!?
A: Replace your default iconset with this ICONSET (http://naturallyartificial.net/?attachment_id=125) Credit goes to Whitecat and Twilight (I just add 5 more icons). Then search for draw_icon and remove the # infront
Q: I found a bug! What do I do?
A: Post here :D! Though I have tested this script, I can't guarantee that it is bug free.
Q: I can't see any text!!
A: Change Fontname at the beginning of the script, to something like "Verdana" or "Arial"
Q: I love you
A: Yes, lets make babies
Restrictions
Do whatever you like as long as you leave my name it it <3 Would be nice if you inform me about it though ^^
Me likey this script. Me no understand why you no script more scripties! Me would like more scripties from you. But me also come with suggestions:
(Now being serious)
The text is a bit "cludded" and mashed together. Whilst I like it, not many might. It looks messy, though I personally loove the idea of having smaller text than usual for once.
I felt it's a bit crammed too, but it can't be helped because VX have even smaller window size ;_;
I suppose I could add (yet another) option to get rid of stuff~
>.<~
lol, well don't do something you don't want to do with a script you like. This rox! Please do make more of them (and put links to them in your sig?)!
Ooo sweet. ;8
This looks very nice. It's nice to see another scripter haunting the forum
;) Once again, how and where excactly should we insert
difference = @level - last_level
$game_actors[@actor_id].points += <amount of points>
? I've tried this kind of stuff before, and I did what it said in the first post, but I get an error... I will get a screen soonest
Like this~~
def change_exp(exp, show)
last_level = @level
last_skills = skills
@exp = [[exp, 9999999].min, 0].max
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
level_up
#---------------------add the code here
difference = @level - last_level
$game_actors[@actor_id].points += ((@level/5).floor+2).floor*difference
#----------------------- :D
end
while @exp < @exp_list[@level]
level_down
end
@hp = [@hp, maxhp].min
@mp = [@mp, maxmp].min
if show and @level > last_level
display_level_up(skills - last_skills)
end
end
Oh, the spacing... well, thanks ;)
EDIT: That won't work anymore, (not in the most up-to-date version it seems) but it's okay, I edited the menu Status instead ;)
For those who wish to do the same:
Search for (ctrl + F)
when 3 # status
and underneath it, have it say
$scene = Scene_Stat_Dist.new(0)
instead of what is already there.
It probably only works with the first actor in the party though...
This will open stat dist window for the actor that currently have the cursor on ;8
$scene = Scene_Stat_Dist.new(@status_window.index)
This is a really sexi mod. I think you should add more different modes to your stat system, but my creative juices are a little dry at the moment so I can't give you any ideas :)
Oh and, where did you get that party screen design? It looks really cool...
Whoa, very nice. How did I miss this here ???
Hey guys why can't I download the demo? ??? and the site lettuce provided isn't working! "roxburian.com"
Can anyone who has the demo e-mail it to me? Tnx alot. ;8
great work on the script i wish i could download it though.how about ragnarok online style skill learning system?
Quote from: helloion on November 19, 2008, 04:45:01 AM
Hey guys why can't I download the demo? ??? and the site lettuce provided isn't working! "roxburian.com"
Can anyone who has the demo e-mail it to me? Tnx alot. ;8
great work on the script i wish i could download it though.how about ragnarok online style skill learning system?
yellow text us unreadable and just try PM'ing him on the forum or directly emailing him at:
broccolicappuccino@gmail.com
remember to ask nice :)
oh,sorry about that. thanks for the help! ^^
@ OfficerTJHooker : I made the layout myself :P I had a lot of info to display and they all happen to fit together~
Script updated and the links are working again (I hope) :bean:
I have searched the script for the place to post:
difference = @level - last_level
$game_actors[@actor_id].points += ((@level/5).floor+2).floor*difference
What line is it at that I have to paste that?
Quote from: Adrien. on November 23, 2008, 11:48:55 PM
I have searched the script for the place to post:
difference = @level - last_level
$game_actors[@actor_id].points += ((@level/5).floor+2).floor*difference
What line is it at that I have to paste that?
At line 526 in Game_Actor like so (https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg265.imageshack.us%2Fimg265%2F3562%2Fexamplehr7.th.png&hash=dd0cd68ec5d23be6072cc94a907909591e44b55d) (http://img265.imageshack.us/my.php?image=examplehr7.png)(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg265.imageshack.us%2Fimages%2Fthpix.gif&hash=3d6be7083762203c5a8b373202912f36a1dd79f5) (http://g.imageshack.us/thpix.php)
Also glad to see this got updated to work with dual wield, only after spending a couple hours myself doing the same thing today. :(
Tnx for fixing the link! :tpg:
that's alot of icons whooaaa!! :lol:
A small bug occurs when you set maxstat to a really high amount (880+) when the script checks to see if your stat is maxed. when 2 #ATK
if actor.points < 1
Sound.play_cancel
elsif (actor.atk-bonus.atk) >= MaxStat
Sound.play_cancel
else
Sound.play_use_item
$game_party.members[@menu_index].atk += IncreaseBy
if ($game_party.members[@menu_index].atk-bonus_atk) >= MaxStat
$game_party.members[@menu_index].atk = MaxStat+bonus_atk
end
actor.points -= 1
@changes += 1
$position = 1
end
While it works fine when your have nothing being added to your stats from any equipment, once it goes over 999 by even +1 from equipment, it'll allow you to add infinite stat points to that parameter, since (actor.atk - bonus.atk) will never equal or be greater then maxstat. At least that's what I believe is causing this problem. Try giving Ralph in your demo a King's Sword and setting maxstats to a high value to see what I mean.
Also when a character can dual weild, yet only has a second weapon equipped but not a first,
it causes this error: (https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg368.imageshack.us%2Fimg368%2F4458%2Ferroronline259vs5.th.png&hash=75452d899633f4d3e9ed5ff4e9a6223c2ffc72cc) (http://img368.imageshack.us/my.php?image=erroronline259vs5.png)
Since I don't much of scripting, this is how I handled it in the previous version before I saw your update..[spoiler] weapon = $data_weapons[actor.weapon_id]
if actor.two_swords_style == true
weapon2 = $data_weapons[actor.armor1_id]
else
shield = $data_armors[actor.armor1_id]
end
helm =$data_armors[actor.armor2_id]
body =$data_armors[actor.armor3_id]
accessory =$data_armors[actor.armor4_id]
bonus_atk = 0
bonus_def = 0
bonus_spi = 0
bonus_agi = 0
evasion = 0
crit = 0
if $data_actors[actor.id].critical_bonus
crit +=4
end
if weapon
bonus_atk += weapon.atk
bonus_def += weapon.def
bonus_spi += weapon.spi
bonus_agi += weapon.agi
if weapon.critical_bonus
crit += 4
end
end
if weapon2
bonus_atk += weapon2.atk
bonus_def += weapon2.def
bonus_spi += weapon2.spi
bonus_agi += weapon2.agi
if weapon2.critical_bonus
crit += 4
end
end
if shield
bonus_atk += shield.atk
bonus_def += shield.def
bonus_spi += shield.spi
bonus_agi += shield.agi
evasion += shield.eva
end
if helm
bonus_atk += helm.atk
bonus_def += helm.def
bonus_spi += helm.spi
bonus_agi += helm.agi
evasion += helm.eva
end
if body
bonus_atk += body.atk
bonus_def += body.def
bonus_spi += body.spi
bonus_agi += body.agi
evasion += body.eva
end
if accessory
bonus_atk += accessory.atk
bonus_def += accessory.def
bonus_spi += accessory.spi
bonus_agi += accessory.agi
evasion += accessory.eva
end[/spoiler]
the link is dead, does anyone have a copy of this that they will post here or pm to me? i think this looks really good, and would compliment my game really well
Great Script! Thankfully the link is back!
Wow this is one of the coolest scripts I've seen.
It's actually pretty easy to customize and to call up.
And if I can use it, then, yeah, it's real easy to use lol.
Thanks for the script, I might use it.
But I doubt I'm gonna be releasing any complete games anytime soon.
The script must be really good, not yet downloaded the demo but still want to congratulate you for the great script.
For the SS has you realize that the "interface" it is very nice ~ = D
How can i integrate with the menu? What i need to modify?
ah! thank you very much :3
user3k: here is how you can integrate it into your menu (someone asked me the same thing 2 weeks ago, and here is what I told him~)
In class Scene_Menu < Scene_Base under def create_command_window method, you can see variables called s1, s2, s3 etc. Just under those, you need to add s9 = "WhatYouWantItToShowUpAs".
Then right under that, you will see @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6]) This line defines which menu items are displayed in which order~ (s1 will be items and s8 is end game etc.)
You need to put your s9 somewhere in there, so that it will look something like this:
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s9, s5, s6])
This will make the stat dist. appear just under status
now comes the confusing bit :P You must remember that the index (or order) of these menu starts from 0 (just like everything else in programming) so the index of s1 (or item menu) is 0, index of s2 (skill menu) is 1. So in the above example, the stat dist. menu is in the 5th position so its index is 4. What you must not forget is that the index of s5 and s6 has shifted because you put s9 in front of them.
Then under def update_command_selection, you have to edit this bit
case @command_window.index
when 0 # Item
$scene = Scene_Item.new
when 1,2,3 # Skill, equipment, status
start_actor_selection
when 4 # Save
$scene = Scene_File.new(true, false, false)
when 5 # End Game
$scene = Scene_End.new
end
That code will check the position of the cursor in the command_window box (which corresponds to the index of your menu items) What it does is then check if the position is at 0 index (when 0), if it is, open item page ($scene = Scene_Item.new) etc.
I assume that when you select the stat dist menu, you want the player to be able to select which player you should open the stat dist page for. So with the stat dist. in the menu, your code should look something like this:
case @command_window.index
when 0 # Item
$scene = Scene_Item.new
when 1,2,3,4 # Skill, equipment, status, stat_dist
start_actor_selection
when 5 # Save <-- index of "save" shifted~
$scene = Scene_File.new(true, false, false)
when 6 # End Game <-- so is the index of "end game"
$scene = Scene_End.new
end
In def update_actor_selection, it will let player select the character which the command will execute for. After that it will open the scene, depending on the position of the cursor in command box. So you have to edit:
case @command_window.index
when 1 # skill
$scene = Scene_Skill.new(@status_window.index)
when 2 # equipment
$scene = Scene_Equip.new(@status_window.index)
when 3 # status
$scene = Scene_Status.new(@status_window.index)
end
and change it to:
case @command_window.index
when 1 # skill
$scene = Scene_Skill.new(@status_window.index)
when 2 # equipment
$scene = Scene_Equip.new(@status_window.index)
when 3 # status
$scene = Scene_Status.new(@status_window.index)
when 4
$scene = Scene_Stat_Dist.new(@status_window.index)
end
and that should do it XD
;9 hay lettuce.... i love the script i realy do.. but the menu part isnt workin for me....
ive been sittin here for half an hour tryin to get it right im wantin to bash my screen in.. :mad:
..... well here is my setup so you can see what im doin wrong... im not seein it...
#------------------------------------------------------------------------------
# This class performs the menu screen processing.
#==============================================================================
class Scene_Menu < Scene_Base
#--------------------------------------------------------------------------
# * Object Initialization
# menu_index : command cursor's initial position
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
super
create_menu_background
create_command_window
@gold_window = Window_Gold.new(0, 360)
@status_window = Window_MenuStatus.new(160, 0)
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
super
dispose_menu_background
@command_window.dispose
@gold_window.dispose
@status_window.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
update_menu_background
@command_window.update
@gold_window.update
@status_window.update
if @command_window.active
update_command_selection
elsif @status_window.active
update_actor_selection
end
end
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
s1 = Vocab::item
s2 = Vocab::skill
s3 = Vocab::equip
s4 = Vocab::status
s9 = Vocab::stats
@command_window = Window_Command.new(160, [s1, s2, s3, s9, s4])
@command_window.index = @menu_index
if $game_party.members.size == 0 # If number of party members is 0
@command_window.draw_item(0, false) # Disable item
@command_window.draw_item(1, false) # Disable skill
@command_window.draw_item(2, false) # Disable equipment
@command_window.draw_item(3, false) # Disable status
@command_window.draw_item(4, false)
end
if $game_system.save_disabled # If save is forbidden
@command_window.draw_item(5, false) # Disable save
end
end
#--------------------------------------------------------------------------
# * Update Command Selection
#--------------------------------------------------------------------------
def update_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
if $game_party.members.size == 0 and @command_window.index < 4
Sound.play_buzzer
return
elsif $game_system.save_disabled and @command_window.index == 4
Sound.play_buzzer
return
end
Sound.play_decision
case @command_window.index
when 0 # Item
$scene = Scene_Item.new
when 1,2,3,4 # Skill, equipment, status, stat_dist
start_actor_selection
when 5 # Save <-- index of "save" shifted~
$scene = Scene_File.new(true, false, false)
when 6 # End Game <-- so is the index of "end game"
$scene = Scene_End.new
end
end
end
#--------------------------------------------------------------------------
# * Start Actor Selection
#--------------------------------------------------------------------------
def start_actor_selection
@command_window.active = false
@status_window.active = true
if $game_party.last_actor_index < @status_window.item_max
@status_window.index = $game_party.last_actor_index
else
@status_window.index = 0
end
end
#--------------------------------------------------------------------------
# * End Actor Selection
#--------------------------------------------------------------------------
def end_actor_selection
@command_window.active = true
@status_window.active = false
@status_window.index = -1
end
#--------------------------------------------------------------------------
# * Update Actor Selection
#--------------------------------------------------------------------------
def update_actor_selection
if Input.trigger?(Input::B)
Sound.play_cancel
end_actor_selection
elsif Input.trigger?(Input::C)
$game_party.last_actor_index = @status_window.index
Sound.play_decision
case @command_window.index
when 1 # skill
$scene = Scene_Skill.new(@status_window.index)
when 2 # equipment
$scene = Scene_Equip.new(@status_window.index)
when 3 # status
$scene = Scene_Status.new(@status_window.index)
when 4
$scene = Scene_Stat_Dist.new(@status_window.index)
end
end
end
end
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi179.photobucket.com%2Falbums%2Fw313%2FAarius_paro%2Fgameerror.jpg&hash=337d90dac39e95921e64366bcf9f4fca860a29e8)
Line 58: s9 = Vocab::stats
if that helps....
EDIT: well i think ihave officialy found a bug... lol. im sorry i must be annoying right about now arnt i? i dont mean to be... but neways if a stat is set to a negative do to an item if you try to add pluses to the stat it will give you points and drop the stat even further instead of raising it and loosing points. ill post a screenshot shortly..
EDIT2: sorry screenshot will halfto wait.... not at my comp... wont be till sunday...
this mod is great!
one thing is missing, the sound when you switch between characters pages... nothing important, but i miss it...
Hey,
I really love this script. However, I have a slight problem. It seems that when I cycle to a certain character of mine (it doesn't matter what order he's in) the test play crashes because apparently, it tried to divide by zero. Has anyone else encountered this?
have you made sure to update the characters class? if you dont have anything for what class he will advance too it may crash... it did a few times for me same problem deviding by zero.... idk what else it may be....
Hey, I used this and just wanted to say thanks.
Ok so I love this script and I do want to use it. Unfortunately I can't seem to figure out how the hell to add stat points to my characters.
I have tryied to use the command you put at the start of this post.
#$game_party.members[0].points += 5
If someone could post an event that can help me or knows what I am doing wrong I would be grateful.
Kill the #. The # makes it a comment and tells the game to ignore that line.
Wow I feel really stupied. Would of thought that you would help me with this too choas lol. Thanks that fixed it.
I can't seem to get this script to show in my menu. I want it to be between Skill and Equip.
When I try to follow the instructions above I get the same error that nevious had:
Quote from: nevious on February 14, 2009, 07:15:08 AM
;9 hay lettuce.... i love the script i realy do.. but the menu part isnt workin for me....
ive been sittin here for half an hour tryin to get it right im wantin to bash my screen in.. :mad:
..... well here is my setup so you can see what im doin wrong... im not seein it...
#------------------------------------------------------------------------------
# This class performs the menu screen processing.
#==============================================================================
class Scene_Menu < Scene_Base
#--------------------------------------------------------------------------
# * Object Initialization
# menu_index : command cursor's initial position
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
super
create_menu_background
create_command_window
@gold_window = Window_Gold.new(0, 360)
@status_window = Window_MenuStatus.new(160, 0)
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
super
dispose_menu_background
@command_window.dispose
@gold_window.dispose
@status_window.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
update_menu_background
@command_window.update
@gold_window.update
@status_window.update
if @command_window.active
update_command_selection
elsif @status_window.active
update_actor_selection
end
end
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
s1 = Vocab::item
s2 = Vocab::skill
s3 = Vocab::equip
s4 = Vocab::status
s9 = Vocab::stats
@command_window = Window_Command.new(160, [s1, s2, s3, s9, s4])
@command_window.index = @menu_index
if $game_party.members.size == 0 # If number of party members is 0
@command_window.draw_item(0, false) # Disable item
@command_window.draw_item(1, false) # Disable skill
@command_window.draw_item(2, false) # Disable equipment
@command_window.draw_item(3, false) # Disable status
@command_window.draw_item(4, false)
end
if $game_system.save_disabled # If save is forbidden
@command_window.draw_item(5, false) # Disable save
end
end
#--------------------------------------------------------------------------
# * Update Command Selection
#--------------------------------------------------------------------------
def update_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
if $game_party.members.size == 0 and @command_window.index < 4
Sound.play_buzzer
return
elsif $game_system.save_disabled and @command_window.index == 4
Sound.play_buzzer
return
end
Sound.play_decision
case @command_window.index
when 0 # Item
$scene = Scene_Item.new
when 1,2,3,4 # Skill, equipment, status, stat_dist
start_actor_selection
when 5 # Save <-- index of "save" shifted~
$scene = Scene_File.new(true, false, false)
when 6 # End Game <-- so is the index of "end game"
$scene = Scene_End.new
end
end
end
#--------------------------------------------------------------------------
# * Start Actor Selection
#--------------------------------------------------------------------------
def start_actor_selection
@command_window.active = false
@status_window.active = true
if $game_party.last_actor_index < @status_window.item_max
@status_window.index = $game_party.last_actor_index
else
@status_window.index = 0
end
end
#--------------------------------------------------------------------------
# * End Actor Selection
#--------------------------------------------------------------------------
def end_actor_selection
@command_window.active = true
@status_window.active = false
@status_window.index = -1
end
#--------------------------------------------------------------------------
# * Update Actor Selection
#--------------------------------------------------------------------------
def update_actor_selection
if Input.trigger?(Input::B)
Sound.play_cancel
end_actor_selection
elsif Input.trigger?(Input::C)
$game_party.last_actor_index = @status_window.index
Sound.play_decision
case @command_window.index
when 1 # skill
$scene = Scene_Skill.new(@status_window.index)
when 2 # equipment
$scene = Scene_Equip.new(@status_window.index)
when 3 # status
$scene = Scene_Status.new(@status_window.index)
when 4
$scene = Scene_Stat_Dist.new(@status_window.index)
end
end
end
end
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi179.photobucket.com%2Falbums%2Fw313%2FAarius_paro%2Fgameerror.jpg&hash=337d90dac39e95921e64366bcf9f4fca860a29e8)
Line 58: s9 = Vocab::stats
I attempted to add a line to the Vocab area but I, apparently, don't know how to. =(
Any help would be appriceated!
Well, don't put Vocab:stats, just put what you want it to be. So try:
s9 = "Stats"
When I try that I get another error
"
Script "Scene_Menu' line 60: NameError occured.
undefined local variable or method 'stats' for
#<Scene_Menu:0x44eba28>
"
Which from I can tell means that I have to define 'stats' in the Vocab but I don't know how.
Well, you have to put quotes around it - "Stats", not stats.
Thank you, I don't know why I missed that. It is showing up in the menu now, but it won't pull up a new scene.
I'm sorry if I'm annoying you, I am new to this.
Can you post the exact modifications you've made, because the script nevious posted has a bunch of other problems.
Yours should look more like this:
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
# This class performs the menu screen processing.
#==============================================================================
class Scene_Menu < Scene_Base
#--------------------------------------------------------------------------
# * Object Initialization
# menu_index : command cursor's initial position
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
super
create_menu_background
create_command_window
@gold_window = Window_Gold.new(0, 360)
@status_window = Window_MenuStatus.new(160, 0)
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
super
dispose_menu_background
@command_window.dispose
@gold_window.dispose
@status_window.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
update_menu_background
@command_window.update
@gold_window.update
@status_window.update
if @command_window.active
update_command_selection
elsif @status_window.active
update_actor_selection
end
end
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
s1 = Vocab::item
s2 = Vocab::skill
s3 = Vocab::equip
s4 = Vocab::status
s5 = Vocab::save
s6 = Vocab::game_end
s9 = "Stats"
@command_window = Window_Command.new(160, [s1, s2, s3, s9, s4, s5, s6])
@command_window.index = @menu_index
if $game_party.members.size == 0 # If number of party members is 0
@command_window.draw_item(0, false) # Disable item
@command_window.draw_item(1, false) # Disable skill
@command_window.draw_item(2, false) # Disable equipment
@command_window.draw_item(3, false) # Disable status
end
if $game_system.save_disabled # If save is forbidden
@command_window.draw_item(4, false) # Disable save
end
end
#--------------------------------------------------------------------------
# * Update Command Selection
#--------------------------------------------------------------------------
def update_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
if $game_party.members.size == 0 and @command_window.index < 4
Sound.play_buzzer
return
elsif $game_system.save_disabled and @command_window.index == 4
Sound.play_buzzer
return
end
Sound.play_decision
case @command_window.index
when 0 # Item
$scene = Scene_Item.new
when 1,2,3,4 # Skill, equipment, status, stat dist
start_actor_selection
when 4 # Save
$scene = Scene_File.new(true, false, false)
when 5 # End Game
$scene = Scene_End.new
end
end
end
#--------------------------------------------------------------------------
# * Start Actor Selection
#--------------------------------------------------------------------------
def start_actor_selection
@command_window.active = false
@status_window.active = true
if $game_party.last_actor_index < @status_window.item_max
@status_window.index = $game_party.last_actor_index
else
@status_window.index = 0
end
end
#--------------------------------------------------------------------------
# * End Actor Selection
#--------------------------------------------------------------------------
def end_actor_selection
@command_window.active = true
@status_window.active = false
@status_window.index = -1
end
#--------------------------------------------------------------------------
# * Update Actor Selection
#--------------------------------------------------------------------------
def update_actor_selection
if Input.trigger?(Input::B)
Sound.play_cancel
end_actor_selection
elsif Input.trigger?(Input::C)
$game_party.last_actor_index = @status_window.index
Sound.play_decision
case @command_window.index
when 1 # skill
$scene = Scene_Skill.new(@status_window.index)
when 2 # equipment
$scene = Scene_Equip.new(@status_window.index)
when 3 # Stat Distribution
$scene = Scene_Stat_Dist.new(@status_window.index)
when 4 # status
$scene = Scene_Status.new(@status_window.index)
end
end
end
end
I actually just got it working right before I read your response. My Scene_Menu code look like this:
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
# This class performs the menu screen processing.
#==============================================================================
class Scene_Menu < Scene_Base
#--------------------------------------------------------------------------
# * Object Initialization
# menu_index : command cursor's initial position
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
super
create_menu_background
create_command_window
@gold_window = Window_Gold.new(0, 360)
@status_window = Window_MenuStatus.new(160, 0)
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
super
dispose_menu_background
@command_window.dispose
@gold_window.dispose
@status_window.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
update_menu_background
@command_window.update
@gold_window.update
@status_window.update
if @command_window.active
update_command_selection
elsif @status_window.active
update_actor_selection
end
end
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
s1 = Vocab::item
s2 = Vocab::skill
s3 = Vocab::equip
s4 = Vocab::status
s5 = Vocab::save
s6 = Vocab::game_end
s9 = "Level Up"
@command_window = Window_Command.new(160, [s1, s9, s2, s3, s4, s5, s6])
@command_window.index = @menu_index
if $game_party.members.size == 0 # If number of party members is 0
@command_window.draw_item(0, false) # Disable item
@command_window.draw_item(1, false) # Disable skill
@command_window.draw_item(2, false) # Disable equipment
@command_window.draw_item(3, false) # Disable status
end
if $game_system.save_disabled # If save is forbidden
@command_window.draw_item(4, false) # Disable save
end
end
#--------------------------------------------------------------------------
# * Update Command Selection
#--------------------------------------------------------------------------
def update_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
if $game_party.members.size == 0 and @command_window.index < 4
Sound.play_buzzer
return
elsif $game_system.save_disabled and @command_window.index == 4
Sound.play_buzzer
return
end
Sound.play_decision
case @command_window.index
when 0 # Item
$scene = Scene_Item.new
when 1,2,3,4 # Skill, equipment, status, stat_dist
start_actor_selection
when 5 # Save <-- index of "save" shifted~
$scene = Scene_File.new(true, false, false)
when 6 # End Game <-- so is the index of "end game"
$scene = Scene_End.new
end
end
end
#--------------------------------------------------------------------------
# * Start Actor Selection
#--------------------------------------------------------------------------
def start_actor_selection
@command_window.active = false
@status_window.active = true
if $game_party.last_actor_index < @status_window.item_max
@status_window.index = $game_party.last_actor_index
else
@status_window.index = 0
end
end
#--------------------------------------------------------------------------
# * End Actor Selection
#--------------------------------------------------------------------------
def end_actor_selection
@command_window.active = true
@status_window.active = false
@status_window.index = -1
end
#--------------------------------------------------------------------------
# * Update Actor Selection
#--------------------------------------------------------------------------
def update_actor_selection
if Input.trigger?(Input::B)
Sound.play_cancel
end_actor_selection
elsif Input.trigger?(Input::C)
$game_party.last_actor_index = @status_window.index
Sound.play_decision
case @command_window.index
when 1
$scene = Scene_Stat_Dist.new(@status_window.index)
when 2 # skill
$scene = Scene_Skill.new(@status_window.index)
when 3 # equipment
$scene = Scene_Equip.new(@status_window.index)
when 4 # status
$scene = Scene_Status.new(@status_window.index)
end
end
end
end
I hope this helps anyone else who wants to use this script but is having trouble with it. It is a VERY good script.
Thank you MA.
umm, sorry for my bad english but.. i already follow your instruction
like this
def change_exp(exp, show)
last_level = @level
last_skills = skills
@exp = [[exp, 9999999].min, 0].max
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
level_up
difference = @level - last_level
$game_actors[@actor_id].points += [5]
end
while @exp < @exp_list[@level]
level_down
end
@hp = [@hp, maxhp].min
@mp = [@mp, maxmp].min
if show and @level > last_level
display_level_up(skills - last_skills)
end
end
but everytime i level up, it won't give any stats, help please :tpg:
Quote from: Rukkha on May 27, 2011, 10:56:50 AM
umm, sorry for my bad english but.. i already follow your instruction
like this
def change_exp(exp, show)
last_level = @level
last_skills = skills
@exp = [[exp, 9999999].min, 0].max
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
level_up
difference = @level - last_level
$game_actors[@actor_id].points += [5]
end
while @exp < @exp_list[@level]
level_down
end
@hp = [@hp, maxhp].min
@mp = [@mp, maxmp].min
if show and @level > last_level
display_level_up(skills - last_skills)
end
end
but everytime i level up, it won't give any stats, help please :tpg:
I couldn't find the def change_exp so I inserted this entire thing into line 1117 under ( alias Lettuce_Game_Actor_Ini initialize ) and it worked for me
def change_exp(exp, show)
last_level = @level
last_skills = skills
@exp = [[exp, 9999999].min, 0].max
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
level_up
#---------------------add the code here
difference = @level - last_level
$game_actors[@actor_id].points += ((@level/5).floor+2).floor*difference
#----------------------- :D
end
while @exp < @exp_list[@level]
level_down
end
@hp = [@hp, maxhp].min
@mp = [@mp, maxmp].min
if show and @level > last_level
display_level_up(skills - last_skills)
end
end I also have a question, when my actor's hp is in 4 digits it juts into the (HP) character on the left, how do I move the HP digits to the right?
It won't give me points when I level up.... ;-;
here's my def change_exp
def change_exp(exp, show)
last_level = @level
last_skills = skills
@exp = [[exp, 9999999].min, 0].max
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
level_up
$game_actors[@actor_id].points += 10
end
while @exp < @exp_list[@level]
level_down
end
@hp = [@hp, maxhp].min
@mp = [@mp, maxmp].min
if show and @level > last_level
display_level_up(skills - last_skills)
end
end
I really hate to necropost or bump this, but I've got a huge issue while trying to use this script. I see a few other people with this problem, as well.
I can't seem to get the points to come to me as my actors level... I've tried everything I see on this post to make it happen, but to no avail (I did get the menu part to work though!)... It's really making me sad... :( So, if anyone could pretty please share their success story (a specific code would make my day xD) or help clarify this, I would be really, really grateful. It's been bothering me for hours now. Perhaps I have the used the wrong spacing, but I usually don't have problems following script instructions... maybe I missed something??
Once again, sorry for the necropost, but I really urgently need help on this...
How to make your actors gain points by leveling
Sorry 'bout that. Me and my sister (Dr. MC) got it working, we tried Scalinger2's idea. Originally, I tried it and didn't think it worked because I copied the spacing wrong... ^^; So, I went back and copied one of the older posts to get the right spacing and everything for the script. Scalinger2 was totally right xD So, thank you for the help! :) (Even though I'm very late to say that lol) The answer was right before us the whole time we just messed up the spacing lol :) Anyways, for anyone else who ever has this problem, I've got that part of the code with the spacing and such. Just copy & paste this starting at line 1097 on this awesome script :)
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# Giving game actor a point attribute
# -> $game_party.member[x].points
#==============================================================================
class Game_Actor < Game_Battler
attr_accessor :points
attr_accessor :hit_bonus
attr_accessor :eva_bonus
attr_accessor :cri_bonus
attr_accessor :hitr
attr_accessor :evar
attr_accessor :crir
#attr_accessor :current_lvl_exp
#attr_accessor :next_lvl_exp
alias Lettuce_Game_Actor_Ini initialize
def change_exp(exp, show)
last_level = @level
last_skills = skills
@exp = [[exp, 9999999].min, 0].max
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
level_up
#---------------------add the code here
difference = @level - last_level
$game_actors[@actor_id].points += ((@level/5).floor+2).floor*difference
#----------------------- :D
end
while @exp < @exp_list[@level]
level_down
end
@hp = [@hp, maxhp].min
@mp = [@mp, maxmp].min
if show and @level > last_level
display_level_up(skills - last_skills)
end
end
def initialize(actor_id)
Lettuce_Game_Actor_Ini(actor_id)
@points = StartPoints
@hitr = 0
@evar = 0
@crir = 0
#@current_lvl_exp = @exp_list[@level-1]
#@next_lvl_exp = @exp_list[@level]
end
def points
return @points
end
Thanks again everyone & Lettuce for the awesome script!
[sse]I like your script, but I made some edits that make it more user freindly. I tested these and they work. Now you can change some of the text in the Stat Distribution Menu.
[spoiler]
=begin
+------------------------------------------------------------------------------+
# ** Stat points distribution system 1.71 #
# By Lettuce. #
# Edits by InfinateX #
# #
# #
#Some help: #
# - Position wasn't stored properly in mode 1 (Thanks Akin) #
# - Some sort of notification to player (Thanks Akin) #
# - Player switch now supports LEFT and RIGHT arrow (Thanks Akin) #
# - Advice on using class attr instead of global var (Thanks GoldenShadow) #
# #
#------------------------------------------------------------------------------#
# This script lets you distribute points onto your actor's stats #
# #
# Call scene using this: $scene = Scene_Stat_Dist.new(0) #
# #
# #
# You can give points to your actors by using this code #
# #
# $game_party.members[<member ID>].points += <amount of points> #
# #
# If you want your actor to get points after leveling: #
# Under Game_Actor, in def change_exp, under the line level_up; paste this #
# #
# difference = @level - last_level #
# $game_actors[@actor_id].points += <amount of points> #
# #
# OR (if you want RO mode; explained below) #
# #
# difference = @level - last_level #
# $game_actors[@actor_id].points += ((@level/5).floor+2).floor*difference #
# #
# # It seems the game returns non 0 based array if we use game_party >.<; #
# #
# **Note** #
# This script does not stop your actors from gaining stats points defined in #
# the database. It will just add to it. #
# Set the stats to 1 all the way in the database to disable growth :0 #
# #
# **Modes** #
# 1 : Add one point to the attribute per point #
# 2 : Use RO system, attribute with value needs more points to increase. #
# Explanation: In RO, if you got high stats, you need more points to #
# increase it. So if you have 90 ATK and 5 INT...You can #
# choose to use 10 points for 1 more ATK OR use that 10 points #
# to get 6 INT #
+------------------------------------------------------------------------------+
=end
############################### Configuration ##################################
#Starting points; how many points to give to actor at the beginning of the game
StartPoints = 100
#Maximum attribute point you allowed in your game
MaxStat = 100
MaxHP = 40
MaxMP = 0
#Max hit, eva and crit rate are all in percentage
MaxHIT = 0 # 100 means never miss
MaxEVA = 0 #100 means ALWAYS dodge; very illogical ^^. 50-70 is good rate
MaxCRIT = 0 #100 means always crit o.O
#How many points needed per increase
PointsPerHP = 1
PointsPerMP = 1
PointsPerHIT = 1
PointsPerEVA = 1
PointsPerCRIT = 1
#How many stats will increase per point?
IncreaseBy = 1
HPIncreaseBy = 4
MPIncreaseBy = 0
HITIncreaseBy = 0
EVAIncreaseBy = 0
CRITIncreaseBy = 0
#1 for normal mode, 2 or RO mode [points required calculated through formula]
Mode = 1
#You can chage font family and size here
Fontname = Font.default_name
Fontsize = 20
#Layout mode, if you use long words for atk,spi,def or agi ; set LayoutMode to 2
LayoutMode = 2
#------------------------------------------------------------------------
# These are the phrases/Abrv. used in the Stat Distribution menu.
#------------------------------------------------------------------------
DIST_NAME = "Stat Distribution Menu"
CHAR_CHANGE_TEXT = "Press left or right to change character"
POINT_TEXT = "Points: "
CLASS_TEXT = "Class: "
LVL_TEXT = "Lv. "
#========================== End Configuration ==================================
OFFSET = -10 #moves equipment part up and down XD
#==============================================================================
# ** Lettuce_Window_Top
#------------------------------------------------------------------------------
# This window displays Title message
#==============================================================================
class Lettuce_Window_Top < Window_Base
def initialize
super(0,0,544,70)
self.contents = Bitmap.new(width-32,height-32)
self.contents.font.name = Fontname
self.contents.font.size = Fontsize
refresh
end
def refresh
self.contents.clear
self.contents.draw_text(0,-10,544-32,32,DIST_NAME,1)
self.contents.font.size = Fontsize-4
self.contents.draw_text(0,10,544-32,32,CHAR_CHANGE_TEXT,1)
end
end
#==============================================================================
# ** Lettuce_Window_Points
#------------------------------------------------------------------------------
# This window displays the attributes of a party member
#==============================================================================
class Lettuce_Window_Points < Window_Base
def initialize(member_index)
super(401,320,144,52)
self.contents = Bitmap.new(width-32,height-32)
self.contents.font.name = Fontname
self.contents.font.size = Fontsize
refresh(member_index)
end
def refresh(member_index)
actor = $game_party.members[member_index]
points = actor.points
self.contents.clear
self.contents.draw_text(0,0,162,20,POINT_TEXT+points.to_s)
end
end
#==============================================================================
# ** Lettuce_Window_Info
#------------------------------------------------------------------------------
# This window displays the attributes of a party member
#==============================================================================
class Lettuce_Window_Info < Window_Base
def initialize(member_index)
super(0,71,400,346)
self.contents = Bitmap.new(width-32,height-32)
self.contents.font.name = Fontname
self.contents.font.size = Fontsize
@exo = 25 #equipment section X coordinate offset
@exo2 = 35 #equipment section X coordinate offset
@eyo = -10 #equipment section Y coordinate offset
refresh(member_index)
end
def refresh(member_index)
actor = $game_party.members[member_index]
self.contents.clear
self.contents.font.size = Fontsize
draw_actor_face(actor,10,10,92)
draw_actor_name(actor,120,10)
self.contents.font.size = Fontsize
self.contents.draw_text(190,30,200,20,CLASS_TEXT+actor.class.name)
self.contents.draw_text(120,30,200,20,LVL_TEXT+actor.level.to_s)
if LayoutMode == 1
draw_actor_state(actor,200,280,168)
elsif LayoutMode == 2
draw_actor_state(actor,220,10)
end
s1 = actor.exp_s #total exp
s2 = actor.current_lvl_exp #exp to get to this level
if s1.is_a?(Numeric)
s3 = s1-s2 #progress in this level
s4 = actor.next_lvl_exp #exp needed for next level
self.contents.font.size = Fontsize - 5
self.contents.draw_text(230,74,90,20,"EXP: "+s3.to_s+"/"+s4.to_s,0)
self.contents.font.size = Fontsize
else
self.contents.draw_text(230,74,85,20,"-----/-----",2)
end
#Preparing bar colours
back_color = Color.new(39, 58, 83, 255)
str_color1 = Color.new(229, 153, 73, 255)
str_color2 = Color.new(255, 72, 0, 255)
def_color1 = Color.new(210, 255, 0, 255)
def_color2 = Color.new(85, 129, 9, 255)
spi_color1 = Color.new(99, 133, 161, 255)
spi_color2 = Color.new(10, 60,107, 255)
agi_color1 = Color.new(167, 125, 180, 255)
agi_color2 = Color.new(90, 11, 107, 255)
hp_color1 = Color.new(66, 114, 164, 255)
hp_color2 = Color.new(122, 175, 229, 255)
mp_color1 = Color.new(93, 50, 158, 255)
mp_color2 = Color.new(145, 122, 229, 255)
exp_color1 = Color.new(246, 243, 224, 255)
exp_color2 = Color.new(255, 182, 0, 255)
if s1.is_a?(Numeric)
self.contents.fill_rect(230,90,89,7,back_color)
self.contents.gradient_fill_rect(232,92,(85*s3)/s4,3,exp_color1,exp_color2)
else
self.contents.fill_rect(230,60,89,7,back_color)
end
self.contents.fill_rect(120,67,104,7,back_color)
self.contents.gradient_fill_rect(122,69,100*actor.hp/actor.maxhp,3,hp_color1,hp_color2)
self.contents.draw_text(120,44,100,30,"HP",0)
self.contents.draw_text(120,44,100,30,actor.hp.to_s + "/" + actor.maxhp.to_s,2)
self.contents.fill_rect(120,90,104,7,back_color)
self.contents.gradient_fill_rect(122,92,100*actor.mp/actor.maxmp,3,mp_color1,mp_color2)
self.contents.draw_text(120,67,100,30,"MP",0)
self.contents.draw_text(120,67,100,30,actor.mp.to_s + "/" + actor.maxmp.to_s,2)
##weapons
dual_w = true if actor.two_swords_style == true
weapon = $data_weapons[actor.weapon_id]
shield = $data_armors[actor.armor1_id]
shield = dual_w ? $data_weapons[actor.armor1_id] : $data_armors[actor.armor1_id]
helm =$data_armors[actor.armor2_id]
body =$data_armors[actor.armor3_id]
accessory =$data_armors[actor.armor4_id]
bonus_atk = 0
bonus_def = 0
bonus_spi = 0
bonus_agi = 0
evasion = 0
crit = 4
if $data_actors[actor.id].critical_bonus
crit +=4
end
if weapon
bonus_atk += weapon.atk
bonus_def += weapon.def
bonus_spi += weapon.spi
bonus_agi += weapon.agi
if weapon.critical_bonus
crit += 4
end
end
if dual_w && shield
bonus_atk += shield.atk
bonus_def += shield.def
bonus_spi += shield.spi
bonus_agi += shield.agi
if weapon.critical_bonus
crit += 4
end
end
if shield && !dual_w
bonus_atk += shield.atk
bonus_def += shield.def
bonus_spi += shield.spi
bonus_agi += shield.agi
evasion += shield.eva
end
if helm
bonus_atk += helm.atk
bonus_def += helm.def
bonus_spi += helm.spi
bonus_agi += helm.agi
evasion += helm.eva
end
if body
bonus_atk += body.atk
bonus_def += body.def
bonus_spi += body.spi
bonus_agi += body.agi
evasion += body.eva
end
if accessory
bonus_atk += accessory.atk
bonus_def += accessory.def
bonus_spi += accessory.spi
bonus_agi += accessory.agi
evasion += accessory.eva
end
if LayoutMode == 1
draw_item_name(weapon,160+@exo,125+@eyo,true)
if weapon
two_hand = true if weapon.two_handed == true
end
if two_hand
draw_item_name(weapon,160+@exo,155+@eyo,true)
elsif dual_w
dweapon = $data_weapons[actor.armor1_id]
draw_item_name(dweapon,160+@exo,155+@eyo,true)
else
draw_item_name(shield,160+@exo,155+@eyo,true)
end
draw_item_name(helm,160+@exo,185+@eyo,true)
draw_item_name(body,160+@exo,215+@eyo,true)
draw_item_name(accessory,160+@exo,245+@eyo,true)
#Testing area for Weapon upgrade script
#self.contents.font.size = Fontsize - 7
#self.contents.draw_text(160+@exo,135,30,20,"[+"+weapon.level.to_s+"]",0)
self.contents.font.color = Color.new(87,87,87,255)
if !weapon
#draw_icon(216,160+@exo,125+@eyo,true)
self.contents.draw_text(184+@exo,127+@eyo,200,20,"Unequipped")
end
if !shield
#draw_icon(217,160+@exo,155+@eyo,true)
if !two_hand
self.contents.draw_text(184+@exo,157+@eyo,200,20,"Unequipped")
end
end
if !helm
#draw_icon(218,160+@exo,185+@eyo,true)
self.contents.draw_text(184+@exo,187+@eyo,200,20,"Unequipped")
end
if !body
#draw_icon(219,160+@exo,215+@eyo,true)
self.contents.draw_text(184+@exo,217+@eyo,200,20,"Unequipped")
end
if !accessory
#draw_icon(220,160+@exo,245+@eyo,true)
self.contents.draw_text(184+@exo,247+@eyo,200,20,"Unequipped")
end
self.contents.font.color = Color.new(255,255,255,255)
elsif LayoutMode == 2
draw_item_name(weapon,160+@exo2,125+OFFSET+@eyo,true)
#if weapon
if weapon
two_hand = true if weapon.two_handed
end
if two_hand
draw_item_name(weapon,160+@exo2,165+OFFSET+@eyo,true)
else
draw_item_name(shield,160+@exo2,165+OFFSET+@eyo,true)
end
#end
=begin
if weapon.two_handed == true
draw_item_name(weapon,160+@exo2,165+OFFSET+@eyo,true)
else
draw_item_name(shield,160+@exo2,165+OFFSET+@eyo,true)
end
=end
draw_item_name(helm,160+@exo2,205+OFFSET+@eyo,true)
draw_item_name(body,160+@exo2,245+OFFSET+@eyo,true)
draw_item_name(accessory,160+@exo2,285+OFFSET+@eyo,true)
self.contents.font.color = Color.new(87,87,87,255)
if !weapon
#draw_icon(216,160+@exo2,125+OFFSET+@eyo,true)
self.contents.draw_text(184+@exo2,127+OFFSET+@eyo,200,20,"Unequipped")
end
if weapon
if !shield and weapon.two_handed == false
#draw_icon(217,160+@exo2,165+OFFSET+@eyo,true)
self.contents.draw_text(184+@exo2,167+OFFSET+@eyo,200,20,"Unequipped")
end
else
if !shield
#draw_icon(217,160+@exo2,165+OFFSET+@eyo,true)
self.contents.draw_text(184+@exo2,167+OFFSET+@eyo,200,20,"Unequipped")
end
end
if !helm
#draw_icon(218,160+@exo2,205+OFFSET+@eyo,true)
self.contents.draw_text(184+@exo2,207+OFFSET+@eyo,200,20,"Unequipped")
end
if !body
#draw_icon(219,160+@exo2,245+OFFSET+@eyo,true)
self.contents.draw_text(184+@exo2,247+OFFSET+@eyo,200,20,"Unequipped")
end
if !accessory
#draw_icon(220,160+@exo2,285+OFFSET+@eyo,true)
self.contents.draw_text(184+@exo2,287+OFFSET+@eyo,200,20,"Unequipped")
end
self.contents.font.color = Color.new(255,255,255,255)
end
self.contents.font.size = Fontsize - 5
self.contents.draw_text(10,120,100,20,Vocab::atk+": ")
self.contents.draw_text(10,120,100,20,(actor.atk-bonus_atk).to_s+" + "+bonus_atk.to_s,2)
self.contents.fill_rect(10,140,104,7,back_color)
self.contents.gradient_fill_rect(12,142,((actor.atk-bonus_atk)*100)/MaxStat,3,str_color1,str_color2)
self.contents.draw_text(10,150,100,20,Vocab::def+": ")
self.contents.draw_text(10,150,100,20,(actor.def-bonus_def).to_s+" + "+bonus_def.to_s,2)
self.contents.fill_rect(10,170,104,7,back_color)
self.contents.gradient_fill_rect(12,172,((actor.def-bonus_def)*100)/MaxStat,3,def_color1,def_color2)
self.contents.draw_text(10,180,100,20,Vocab::spi+": ")
self.contents.draw_text(10,180,100,20,(actor.spi-bonus_spi).to_s+" + "+bonus_spi.to_s,2)
self.contents.fill_rect(10,200,104,7,back_color)
self.contents.gradient_fill_rect(12,202,((actor.spi-bonus_spi)*100)/MaxStat,3,spi_color1,spi_color2)
self.contents.draw_text(10,210,100,20,Vocab::agi+": ")
self.contents.draw_text(10,210,100,20,(actor.agi-bonus_agi).to_s+" + "+bonus_agi.to_s,2)
self.contents.fill_rect(10,230,104,7,back_color)
self.contents.gradient_fill_rect(12,232,((actor.agi-bonus_agi)*100)/MaxStat,3,agi_color1,agi_color2)
if weapon
hit_rate = weapon.hit
else
hit_rate = 95
end
self.contents.font.size = Fontsize - 5
self.contents.font.color = Color.new(162,212,98,255)
self.contents.draw_text(1,245,100,20,"Maximum ATK :",2)
self.contents.draw_text(1,260,100,20,"Hit rate (%) :",2)
self.contents.draw_text(1,275,100,20,"Evasion rate (%) :",2)
self.contents.draw_text(1,290,100,20,"Critical Rate (%) :",2)
self.contents.draw_text(105,245,60,20,(actor.atk*4).to_s,0)
self.contents.draw_text(105,260,60,20,actor.base_hit.to_s + "+" + actor.hitr.to_s,0)
self.contents.draw_text(105,275,60,20,actor.base_eva.to_s + "+" +actor.evar.to_s,0)
self.contents.draw_text(105,290,60,20,actor.base_cri.to_s + "+" + actor.crir.to_s,0)
self.contents.font.size = Fontsize-6
self.contents.font.color = text_color(16)
self.contents.draw_text(135,260,60,20,"[Req:"+PointsPerHIT.to_s+"pt.]",2)
self.contents.draw_text(135,275,60,20,"[Req:"+PointsPerEVA.to_s+"pt.]",2)
self.contents.draw_text(135,290,60,20,"[Req:"+PointsPerCRIT.to_s+"pt.]",2)
#self.contents.draw_text(120,260,60,20,(hit_rate+actor.hit_bonus).to_s,0)
#self.contents.draw_text(120,275,60,20,(evasion+actor.eva).to_s,0)
#self.contents.draw_text(120,290,60,20,(crit+actor.cri_bonus).to_s,0)
if LayoutMode == 1
self.contents.font.color = Color.new(155,199,206,255)
self.contents.font.size = Fontsize - 8
if weapon
self.contents.draw_text(185+@exo,140+@eyo,100,20,Vocab::atk+"+"+weapon.atk.to_s)
self.contents.draw_text(219+@exo,140+@eyo,100,20,Vocab::def+"+"+weapon.def.to_s)
self.contents.draw_text(253+@exo,140+@eyo,100,20,Vocab::spi+"+"+weapon.spi.to_s)
self.contents.draw_text(287+@exo,140+@eyo,100,20,Vocab::agi+"+"+weapon.agi.to_s)
end
if shield
self.contents.draw_text(185+@exo,170+@eyo,100,20,Vocab::atk+"+"+shield.atk.to_s)
self.contents.draw_text(219+@exo,170+@eyo,100,20,Vocab::def+"+"+shield.def.to_s)
self.contents.draw_text(253+@exo,170+@eyo,100,20,Vocab::spi+"+"+shield.spi.to_s)
self.contents.draw_text(287+@exo,170+@eyo,100,20,Vocab::agi+"+"+shield.agi.to_s)
end
if helm
self.contents.draw_text(185+@exo,200+@eyo,100,20,Vocab::atk+"+"+helm.atk.to_s)
self.contents.draw_text(219+@exo,200+@eyo,100,20,Vocab::def+"+"+helm.def.to_s)
self.contents.draw_text(253+@exo,200+@eyo,100,20,Vocab::spi+"+"+helm.spi.to_s)
self.contents.draw_text(287+@exo,200+@eyo,100,20,Vocab::agi+"+"+helm.agi.to_s)
end
if body
self.contents.draw_text(185+@exo,230+@eyo,100,20,Vocab::atk+"+"+body.atk.to_s)
self.contents.draw_text(219+@exo,230+@eyo,100,20,Vocab::def+"+"+body.def.to_s)
self.contents.draw_text(253+@exo,230+@eyo,100,20,Vocab::spi+"+"+body.spi.to_s)
self.contents.draw_text(287+@exo,230+@eyo,100,20,Vocab::agi+"+"+body.agi.to_s)
end
if accessory
self.contents.draw_text(185+@exo,260+@eyo,100,20,Vocab::atk+"+"+accessory.atk.to_s)
self.contents.draw_text(219+@exo,260+@eyo,100,20,Vocab::def+"+"+accessory.def.to_s)
self.contents.draw_text(253+@exo,260+@eyo,100,20,Vocab::spi+"+"+accessory.spi.to_s)
self.contents.draw_text(287+@exo,260+@eyo,100,20,Vocab::agi+"+"+accessory.agi.to_s)
end
end
if Mode == 2
self.contents.font.size = Fontsize - 8
self.contents.font.color = Color.new(155,199,206,255)
self.contents.draw_text(23,100,125,20,"POINTS",2)
self.contents.draw_text(29,110,125,20,"REQUIRED",2)
self.contents.font.size = Fontsize - 4
self.contents.draw_text(20,125,115,20,required(actor.atk-bonus_atk).to_s,2)
self.contents.draw_text(20,155,115,20,required(actor.def-bonus_def).to_s,2)
self.contents.draw_text(20,185,115,20,required(actor.spi-bonus_spi).to_s,2)
self.contents.draw_text(20,215,115,20,required(actor.agi-bonus_agi).to_s,2)
end
if LayoutMode == 2
self.contents.font.color = Color.new(155,199,206,255)
self.contents.font.size = Fontsize - 8
if weapon
self.contents.draw_text(185+@exo2,140+OFFSET+@eyo,100,20,Vocab::atk+"+"+weapon.atk.to_s)
self.contents.draw_text(185+@exo2,150+OFFSET+@eyo,100,20,Vocab::def+"+"+weapon.def.to_s)
self.contents.draw_text(253+@exo2,140+OFFSET+@eyo,100,20,Vocab::spi+"+"+weapon.spi.to_s)
self.contents.draw_text(253+@exo2,150+OFFSET+@eyo,100,20,Vocab::agi+"+"+weapon.agi.to_s)
end
if shield
self.contents.draw_text(185+@exo2,180+OFFSET+@eyo,100,20,Vocab::atk+"+"+shield.atk.to_s)
self.contents.draw_text(185+@exo2,190+OFFSET+@eyo,100,20,Vocab::def+"+"+shield.def.to_s)
self.contents.draw_text(253+@exo2,180+OFFSET+@eyo,100,20,Vocab::spi+"+"+shield.spi.to_s)
self.contents.draw_text(253+@exo2,190+OFFSET+@eyo,100,20,Vocab::agi+"+"+shield.agi.to_s)
end
if helm
self.contents.draw_text(185+@exo2,220+OFFSET+@eyo,100,20,Vocab::atk+"+"+helm.atk.to_s)
self.contents.draw_text(185+@exo2,230+OFFSET+@eyo,100,20,Vocab::def+"+"+helm.def.to_s)
self.contents.draw_text(253+@exo2,220+OFFSET+@eyo,100,20,Vocab::spi+"+"+helm.spi.to_s)
self.contents.draw_text(253+@exo2,230+OFFSET+@eyo,100,20,Vocab::agi+"+"+helm.agi.to_s)
end
if body
self.contents.draw_text(185+@exo2,260+OFFSET+@eyo,100,20,Vocab::atk+"+"+body.atk.to_s)
self.contents.draw_text(185+@exo2,270+OFFSET+@eyo,100,20,Vocab::def+"+"+body.def.to_s)
self.contents.draw_text(253+@exo2,260+OFFSET+@eyo,100,20,Vocab::spi+"+"+body.spi.to_s)
self.contents.draw_text(253+@exo2,270+OFFSET+@eyo,100,20,Vocab::agi+"+"+body.agi.to_s)
end
if accessory
self.contents.draw_text(185+@exo2,300+OFFSET+@eyo,100,20,Vocab::atk+"+"+accessory.atk.to_s)
self.contents.draw_text(185+@exo2,310+OFFSET+@eyo,100,20,Vocab::def+"+"+accessory.def.to_s)
self.contents.draw_text(253+@exo2,300+OFFSET+@eyo,100,20,Vocab::spi+"+"+accessory.spi.to_s)
self.contents.draw_text(253+@exo2,310+OFFSET+@eyo,100,20,Vocab::agi+"+"+accessory.agi.to_s)
end
end
end
def required(base)
return (((base-1)/10)+2).floor
end
end
#==============================================================================
# ** Lettuce_Window_Help
#------------------------------------------------------------------------------
# This window displays property of each attribute
#==============================================================================
class Lettuce_Window_Help < Window_Base
def initialize(index)
super(401,372,144,44)
self.contents = Bitmap.new(width-32,height-32)
self.contents.font.size = Fontsize - 6
refresh(index)
end
def refresh(index)
self.contents.clear
self.contents.font.color = text_color(16)
case index
when 0
self.contents.draw_text(0,-5,112,20,"HP + "+HPIncreaseBy.to_s)
when 1
self.contents.draw_text(0,-5,112,20,"MP + "+MPIncreaseBy.to_s)
when 2
self.contents.draw_text(0,-5,112,20,Vocab::atk+" + "+IncreaseBy.to_s)
when 3
self.contents.draw_text(0,-5,112,20,Vocab::def+" + "+IncreaseBy.to_s)
when 4
self.contents.draw_text(0,-5,112,20,Vocab::spi+" + "+IncreaseBy.to_s)
when 5
self.contents.draw_text(0,-5,112,20,Vocab::agi+" + "+IncreaseBy.to_s)
when 6
self.contents.draw_text(0,-5,112,20,"HIT + "+HITIncreaseBy.to_s)
when 7
self.contents.draw_text(0,-5,112,20,"EVA + "+EVAIncreaseBy.to_s)
when 8
self.contents.draw_text(0,-5,112,20,"CRIT + "+CRITIncreaseBy.to_s)
end
end
end
#==============================================================================
# ** Scene_Stat_Dist
#------------------------------------------------------------------------------
# Performs stat distribution process :)
#==============================================================================
class Scene_Stat_Dist < Scene_Base
def initialize(menu_index)
@menu_index = menu_index
end
def start
super
create_menu_background
ihp = Vocab::hp
imp = Vocab::mp
i1 = Vocab::atk
i2 = Vocab::def
i3 = Vocab::spi
i4 = Vocab::agi
i5 = "HIT"
i6 = "EVA"
i7 = "CRIT"
@window_select = Window_Command.new(144,[ihp,imp,i1,i2,i3,i4,i5,i6,i7])
if $position
@window_select.index = $position - 1
else
@window_select.index = 0
end
@window_select.active = true
@window_select.x = 401
@window_select.y = 71
@window_top = Lettuce_Window_Top.new
@window_points = Lettuce_Window_Points.new(@menu_index)
@window_info = Lettuce_Window_Info.new(@menu_index)
@window_help = Lettuce_Window_Help.new(@window_select.index)
end
def terminate
super
dispose_menu_background
@window_top.dispose
@window_points.dispose
@window_info.dispose
@window_help.dispose
@window_select.dispose
end
def update
update_menu_background
#@window_points.refresh(@menu_index)
@window_select.update
#@window_help.refresh(@window_select.index)
if Input.trigger?(Input::UP) or Input.trigger?(Input::DOWN)
@window_help.refresh(@window_select.index)
end
@changes = 0
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::R) or Input.trigger?(Input::RIGHT)
@menu_index += 1
@menu_index %= $game_party.members.size
$scene = Scene_Stat_Dist.new(@menu_index)
elsif Input.trigger?(Input::L) or Input.trigger?(Input::LEFT)
@menu_index += $game_party.members.size - 1
@menu_index %= $game_party.members.size
$scene = Scene_Stat_Dist.new(@menu_index)
elsif Input.trigger?(Input::C)
#Points addition begins
#which attribute
if Mode == 1
do_point_reg
elsif Mode == 2
do_point_rag
end
end
end
def do_point_reg
@att = @window_select.index
actor = $game_party.members[@menu_index]
##weapons
weapon = $data_weapons[actor.weapon_id]
shield = $data_armors[actor.armor1_id]
helm =$data_armors[actor.armor2_id]
body =$data_armors[actor.armor3_id]
accessory =$data_armors[actor.armor4_id]
bonus_atk = 0
bonus_def = 0
bonus_spi = 0
bonus_agi = 0
if weapon
bonus_atk += weapon.atk
bonus_def += weapon.def
bonus_spi += weapon.spi
bonus_agi += weapon.agi
end
if shield
bonus_atk += shield.atk
bonus_def += shield.def
bonus_spi += shield.spi
bonus_agi += shield.agi
end
if helm
bonus_atk += helm.atk
bonus_def += helm.def
bonus_spi += helm.spi
bonus_agi += helm.agi
end
if body
bonus_atk += body.atk
bonus_def += body.def
bonus_spi += body.spi
bonus_agi += body.agi
end
if accessory
bonus_atk += accessory.atk
bonus_def += accessory.def
bonus_spi += accessory.spi
bonus_agi += accessory.agi
end
case @att
when 0 #HP
if actor.points < PointsPerHP
Sound.play_cancel
elsif actor.maxhp >= MaxHP
Sound.play_cancel
else
Sound.play_use_item
$game_party.members[@menu_index].maxhp += HPIncreaseBy
if $game_party.members[@menu_index].maxhp > MaxHP
$game_party.members[@menu_index].maxhp = MaxHP
end
actor.points -= PointsPerHP
@changes += 1
$position = 1
end
when 1 #MP
if actor.points < PointsPerMP
Sound.play_cancel
elsif actor.maxmp >= MaxMP
Sound.play_cancel
else
Sound.play_use_item
$game_party.members[@menu_index].maxmp += MPIncreaseBy
if $game_party.members[@menu_index].maxmp > MaxMP
$game_party.members[@menu_index].maxmp = MaxMP
end
actor.points -= PointsPerMP
@changes += 1
$position = 1
end
when 2 #ATK
if actor.points < 1
Sound.play_cancel
elsif (actor.atk-bonus_atk) >= MaxStat
Sound.play_cancel
else
Sound.play_use_item
$game_party.members[@menu_index].atk += IncreaseBy
if ($game_party.members[@menu_index].atk-bonus_atk) > MaxStat
$game_party.members[@menu_index].atk = MaxStat+bonus_atk
end
actor.points -= 1
@changes += 1
$position = 1
end
when 3 #DEF
if actor.points < 1
Sound.play_cancel
elsif (actor.def-bonus_def) >= MaxStat
Sound.play_cancel
else
Sound.play_use_item
$game_party.members[@menu_index].def += IncreaseBy
if ($game_party.members[@menu_index].def-bonus_def) > MaxStat
$game_party.members[@menu_index].def = MaxStat+bonus_def
end
actor.points -= 1
@changes += 1
$position = 2
end
when 4 #SPI
if actor.points < 1
Sound.play_cancel
elsif (actor.spi-bonus_spi) >= MaxStat
Sound.play_cancel
else
Sound.play_use_item
$game_party.members[@menu_index].spi += IncreaseBy
if ($game_party.members[@menu_index].spi-bonus_spi) > MaxStat
$game_party.members[@menu_index].spi = MaxStat+bonus_spi
end
actor.points -= 1
@changes += 1
$position = 3
end
when 5 #AGI
if actor.points < 1
Sound.play_cancel
elsif (actor.agi-bonus_agi) >= MaxStat
Sound.play_cancel
else
Sound.play_use_item
$game_party.members[@menu_index].agi += IncreaseBy
if ($game_party.members[@menu_index].agi-bonus_agi) > MaxStat
$game_party.members[@menu_index].agi = MaxStat+bonus_agi
end
actor.points -= 1
@changes += 1
$position = 4
end
when 6 #HIT
if actor.points < PointsPerHIT
Sound.play_cancel
elsif actor.hitr >= MaxHIT
Sound.play_cancel
else
Sound.play_use_item
$game_party.members[@menu_index].hitr += HITIncreaseBy
if $game_party.members[@menu_index].hitr > MaxHIT
$game_party.members[@menu_index].hitr = MaxHIT
end
actor.points -= PointsPerHIT
@changes += 1
$position = 1
end
when 7 #EVA
if actor.points < PointsPerEVA
Sound.play_cancel
elsif actor.evar >= MaxEVA
Sound.play_cancel
else
Sound.play_use_item
$game_party.members[@menu_index].evar += EVAIncreaseBy
if $game_party.members[@menu_index].evar > MaxEVA
$game_party.members[@menu_index].evar = MaxEVA
end
actor.points -= PointsPerEVA
@changes += 1
$position = 1
end
when 8 #CRIT
if actor.points < PointsPerCRIT
Sound.play_cancel
elsif actor.crir >= MaxCRIT
Sound.play_cancel
else
Sound.play_use_item
$game_party.members[@menu_index].crir += CRITIncreaseBy
if $game_party.members[@menu_index].crir > MaxCRIT
$game_party.members[@menu_index].crir = MaxCRIT
end
actor.points -= PointsPerCRIT
@changes += 1
$position = 1
end
end
if @changes > 0
@window_info.refresh(@menu_index)
@window_points.refresh(@menu_index)
#$scene = Scene_Stat_Dist.new(@menu_index)
end
end
def do_point_rag
@att = @window_select.index
actor = $game_party.members[@menu_index]
##weapons
weapon = $data_weapons[actor.weapon_id]
shield = $data_armors[actor.armor1_id]
helm =$data_armors[actor.armor2_id]
body =$data_armors[actor.armor3_id]
accessory =$data_armors[actor.armor4_id]
bonus_atk = 0
bonus_def = 0
bonus_spi = 0
bonus_agi = 0
if weapon
bonus_atk += weapon.atk
bonus_def += weapon.def
bonus_spi += weapon.spi
bonus_agi += weapon.agi
end
if shield
bonus_atk += shield.atk
bonus_def += shield.def
bonus_spi += shield.spi
bonus_agi += shield.agi
end
if helm
bonus_atk += helm.atk
bonus_def += helm.def
bonus_spi += helm.spi
bonus_agi += helm.agi
end
if body
bonus_atk += body.atk
bonus_def += body.def
bonus_spi += body.spi
bonus_agi += body.agi
end
if accessory
bonus_atk += accessory.atk
bonus_def += accessory.def
bonus_spi += accessory.spi
bonus_agi += accessory.agi
end
case @att
when 0 #HP
if actor.points < PointsPerHP
Sound.play_cancel
elsif actor.maxhp >= MaxHP
Sound.play_cancel
else
Sound.play_use_item
$game_party.members[@menu_index].maxhp += HPIncreaseBy
if $game_party.members[@menu_index].maxhp > MaxHP
$game_party.members[@menu_index].maxhp = MaxHP
end
actor.points -= PointsPerHP
@changes += 1
$position = 1
end
when 1 #MP
if actor.points < PointsPerMP
Sound.play_cancel
elsif actor.maxmp >= MaxMP
Sound.play_cancel
else
Sound.play_use_item
$game_party.members[@menu_index].maxmp += MPIncreaseBy
if $game_party.members[@menu_index].maxmp > MaxMP
$game_party.members[@menu_index].maxmp = MaxMP
end
actor.points -= PointsPerMP
@changes += 1
$position = 1
end
when 2 #ATK
base_value = actor.atk-bonus_atk
points = actor.points
if enough_point(base_value,points)
Sound.play_cancel
elsif (actor.atk-bonus_atk) >= MaxStat
Sound.play_cancel
else
Sound.play_use_item
$game_party.members[@menu_index].atk += IncreaseBy
if ($game_party.members[@menu_index].atk-bonus_atk) > MaxStat
$game_party.members[@menu_index].atk = MaxStat+bonus_atk
end
actor.points -= required(base_value)
@changes += 1
$position = 1
end
when 3 #DEF
base_value = actor.def-bonus_def
points = actor.points
if enough_point(base_value,points)
Sound.play_cancel
elsif (actor.def-bonus_def) >= MaxStat
Sound.play_cancel
else
Sound.play_use_item
$game_party.members[@menu_index].def += IncreaseBy
if ($game_party.members[@menu_index].def-bonus_def) > MaxStat
$game_party.members[@menu_index].def = MaxStat+bonus_def
end
actor.points -= required(base_value)
@changes += 1
$position = 2
end
when 4 #SPI
base_value = actor.spi-bonus_spi
points = actor.points
if enough_point(base_value,points)
Sound.play_cancel
elsif (actor.spi-bonus_spi) >= MaxStat
Sound.play_cancel
else
Sound.play_use_item
$game_party.members[@menu_index].spi += IncreaseBy
if ($game_party.members[@menu_index].spi-bonus_spi) > MaxStat
$game_party.members[@menu_index].spi = MaxStat+bonus_spi
end
actor.points -= required(base_value)
@changes += 1
$position = 3
end
when 5 #AGI
base_value = actor.agi-bonus_agi
points = actor.points
if enough_point(base_value,points)
Sound.play_cancel
elsif (actor.agi-bonus_agi) >= MaxStat
Sound.play_cancel
else
Sound.play_use_item
$game_party.members[@menu_index].agi += IncreaseBy
if ($game_party.members[@menu_index].agi-bonus_agi) > MaxStat
$game_party.members[@menu_index].agi = MaxStat+bonus_agi
end
actor.points -= required(base_value)
@changes += 1
$position = 4
end
when 6 #HIT
if actor.points < PointsPerHIT
Sound.play_cancel
elsif actor.hitr >= MaxHIT
Sound.play_cancel
else
Sound.play_use_item
$game_party.members[@menu_index].hitr += HITIncreaseBy
if $game_party.members[@menu_index].hitr > MaxHIT
$game_party.members[@menu_index].hitr = MaxHIT
end
actor.points -= PointsPerHIT
@changes += 1
$position = 1
end
when 7 #EVA
if actor.points < PointsPerEVA
Sound.play_cancel
elsif actor.evar >= MaxEVA
Sound.play_cancel
else
Sound.play_use_item
$game_party.members[@menu_index].evar += EVAIncreaseBy
if $game_party.members[@menu_index].evar > MaxEVA
$game_party.members[@menu_index].evar = MaxEVA
end
actor.points -= PointsPerEVA
@changes += 1
$position = 1
end
when 8 #CRIT
if actor.points < PointsPerCRIT
Sound.play_cancel
elsif actor.crir >= MaxCRIT
Sound.play_cancel
else
Sound.play_use_item
$game_party.members[@menu_index].crir += CRITIncreaseBy
if $game_party.members[@menu_index].crir > MaxCRIT
$game_party.members[@menu_index].crir = MaxCRIT
end
actor.points -= PointsPerCRIT
@changes += 1
$position = 1
end
end
if @changes > 0
@window_points.refresh(@menu_index)
@window_info.refresh(@menu_index)
#$scene = Scene_Stat_Dist.new(@menu_index)
end
end
def enough_point(base,points)
required = (((base-1)/10)+2).floor
if required > points
return true
elsif required <= points
return false
end
end
def required(base)
return (((base-1)/10)+2).floor
end
end
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# Giving game actor a point attribute
# -> $game_party.member[x].points
#==============================================================================
class Game_Actor < Game_Battler
attr_accessor :points
attr_accessor :hit_bonus
attr_accessor :eva_bonus
attr_accessor :cri_bonus
attr_accessor :hitr
attr_accessor :evar
attr_accessor :crir
#attr_accessor :current_lvl_exp
#attr_accessor :next_lvl_exp
alias Lettuce_Game_Actor_Ini initialize
def initialize(actor_id)
Lettuce_Game_Actor_Ini(actor_id)
@points = StartPoints
@hitr = 0
@evar = 0
@crir = 0
#@current_lvl_exp = @exp_list[@level-1]
#@next_lvl_exp = @exp_list[@level]
end
def points
return @points
end
#--------------------------------------------------------------------------
# * Get Hit Rate
#--------------------------------------------------------------------------
def hit
if two_swords_style
n1 = weapons[0] == nil ? 95 : weapons[0].hit
n2 = weapons[1] == nil ? 95 : weapons[1].hit
n = [n1, n2].min
else
n = weapons[0] == nil ? 95 : weapons[0].hit
end
if n+@hitr <= MaxHIT
return n+@hitr
else return MaxHIT
end
end
#--------------------------------------------------------------------------
# * Get Evasion Rate
#--------------------------------------------------------------------------
def eva
n = 5
for item in armors.compact do n += item.eva end
if n+@evar <= MaxEVA
return n+@evar
else return MaxEVA
end
end
#--------------------------------------------------------------------------
# * Get Critical Ratio
#--------------------------------------------------------------------------
def cri
n = 4
n += 4 if actor.critical_bonus
for weapon in weapons.compact
n += 4 if weapon.critical_bonus
end
if n+@crir <= MaxCRIT
return n+@crir
else return MaxCRIT
end
end
#--------------------------------------------------------------------------
# * Get Hit Rate
#--------------------------------------------------------------------------
def base_hit
if two_swords_style
n1 = weapons[0] == nil ? 95 : weapons[0].hit
n2 = weapons[1] == nil ? 95 : weapons[1].hit
n = [n1, n2].min
else
n = weapons[0] == nil ? 95 : weapons[0].hit
end
return n
end
#--------------------------------------------------------------------------
# * Get Evasion Rate
#--------------------------------------------------------------------------
def base_eva
n = 5
for item in armors.compact do n += item.eva end
return n
end
#--------------------------------------------------------------------------
# * Get Critical Ratio
#--------------------------------------------------------------------------
def base_cri
n = 4
n += 4 if actor.critical_bonus
for weapon in weapons.compact
n += 4 if weapon.critical_bonus
end
return n
end
#--------------------------------------------------------------------------
# * bonus rates
#--------------------------------------------------------------------------
def hitr
return @hitr
end
def evar
return @evar
end
def crir
return @crir
end
def current_lvl_exp
return @exp_list[@level]
end
def next_lvl_exp
return @exp_list[@level+1]-@exp_list[@level]
end
end[/spoiler]
[/sse]
Are you allowed to edit someone else's script :o? I think it's fine, but I'm not sure...
In any case, I'm sure they will be helpful, I'll test them out, too.
EDIT: I saw another post do it, so I'm sure it's fine. Just don't take my word for anything script related ^^;
EDIT (Again): Okay, it works perfectly. Good job :)