KaiMonkey's MP types 5.0by KaiMonkeyIntroductionThis template will help you to make a better presentation for your script. This is purely optional but will help to create a standard which in return will help user to quickly find the required info on your script.
Features- Change the name of each classes MP
- Change the colour to make MP represent
anything from stamina to ammo!
- Can be diffenrent for every class
- Have in increase or decrease on attack or block
- Make only the right potions and items regain the right MP (no more gunners getting ammo from potions and mages from clips!)
Screenshots
version 2

How to UsePost above main, duh....
e
Well at the top there is seven configuration lines
MP_Types = ["RAGE","N/A","HOLY","MP","","DARK","EG","EG"]
MP_Colour = [[18,0],[18,10],[6,14],[22,23],[22,23],[15,19],[18,10],[18,10]]
Dont_Have = [2,5]
MP_TO_DECREASE_Attacking = [0,0,5,2,0,0,0,0]
MP_TO_DECREASE_Blocking= [15,0,0,0,0,0,0,0]
MP_TO_INCREASE_Attacking = [5,0,0,0,0,0,0,0]
MP_TO_INCREASE_Blocking= [0,0,5,0,0,0,0,0]
It looks complex, but don't worry, its very simple
First MP_Types repristents the types of Mp for each class, in the order they come in the database. So the first thing in the databases uses RAGE, the second is N/A (see dont_have), but 3rd has holy, 4th uses MP 5th uses nothing (again see dont_have). The 6th uses DARK!, and the last two use EG again. Make sence? Good.
Now MP_Colour (English spelling, sorry

) this is quite complex, but it just shows the two colours in the bar, the first one fading into the second one. If you want a certain colour Look at the part of you window skin that looks abit like

Now, The top one (white) is 0, the one next to that is 1, 2 ,3 ,4 ,5 and once a new row starts you just read across like reading a page of a book! Easy? Well once you worked out the colors you want, you put them in, in the same place as they are in MP_Types. So EG is 18,10, which is Red fading into lighter red, MP, is 22,23 which is the normal blues, and DARK is 15,19, which is black and grey!
Here are some simple colour samples to use if you don't want to work it out. These wont work with all WindowSkins!
Blue [22,23]
Red [18,10]
Black [15,19]
Green [3,11]
White/grey [0,8]
Pink/purple [30,31]
Also make sure they all have commars after them exept the last one!

Any problems post those three lines here and I'll sort it out!
Version 2 helpthe new line Dont_Have = [2,5] is simply the list of classes' ids that their MP is never shown. When you wright their MP_Type, but "N/A" , "None" or just "" and for MP_Colour, put anything it doesn't matter. In this case classes 2 and 5 don't show anything, exept their MP_Type!
Version 3 helpThe new line MP_TO_DECREASE_Attacking = [5,0,5,0,0,0,0,0]
this is a list of all classes, and how much to decrese the "MP" (or ammo or energy) by when they attack, to say they don't lost any, just put 0. On this class 1 and 3 lose 5 every attack and no other classes lose any thing! this can be used to represent ammo and such.
Version 4 helpThen theres MP_TO_DECREASE_Blocking= [15,0,0,0,0,0,0,0]
this is a list of all classes (in order they are in in the database) and how much there "MP" (or ammo, or enegy) is decreased when the user blocks. So the first class, loses 15 when they block, this can be used to represent rage.
MP_TO_INCREASE_Blocking works just like Decreaing, expept makes it higher, so
MP_TO_INCREASE_Blocking= [0,0,5,0,0,0,0,0]
means that the 3rd class gains 5 "mp" when ever they guard.
MP_TO_INCREASE_Attacking = [5,0,0,0,0,0,0,0]
this works just works like the MP_TO_DECREASE_Attacking , expets adds, so the first class gains 5 "mp" whenever they attack, this can also be used as rage.
Version 5 help (wow)New feature is setting up the potions.This is easy, just look at the part where it says
$Potions_effect ={
# item id => [list of classes]
# so 5 => [1,3] means class 1 and 3 can use item 5
4 => [4],
21 => [1,7,8],
22 => [3],
23 => [6]
}
As it states, you can set up potions that only heals MP for monks and preasts, and stop charactures with no MP drinking potions!
ScriptCODE
MP_Types = ["RAGE","N/A","HOLY","MP","","DARK","EG","EG"]
MP_Colour = [[18,0],[18,10],[6,14],[22,23],[22,23],[15,19],[18,10],[18,10]]
Dont_Have = [2,5]
MP_TO_DECREASE_Attacking = [0,0,5,2,0,0,0,0]
MP_TO_DECREASE_Blocking= [15,0,0,0,0,0,0,0]
MP_TO_INCREASE_Attacking = [5,0,0,0,0,0,0,0]
MP_TO_INCREASE_Blocking= [0,0,5,0,0,0,0,0]
#####Potion config#############
$Potions_effect ={
# item id => [list of classes]
# so 5 => [1,3] means class 1 and 3 can use item 5
4 => [4],
21 => [1,7,8],
22 => [3],
23 => [6]
}
class Window_Base < Window
#--------------------------------------------------------------------------
# * Draw MP
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : Width
#--------------------------------------------------------------------------
def draw_actor_mp(actor, x, y, width = 120)
have_or_not = 0
work = 0
while have_or_not == 0
if actor.class.id == Dont_Have[work]
have_or_not = 1
break
else
work += 1
if work == Dont_Have.size
break
end
end
end
if have_or_not == 1
final_word = MP_Types[actor.class.id - 1]
self.contents.draw_text(x, y, 30, WLH, final_word)
else
draw_actor_mp_gauge(actor, x, y, width)
self.contents.font.color = system_color
final_word = MP_Types[actor.class.id - 1]
self.contents.draw_text(x, y, 30, WLH, final_word)
self.contents.font.color = mp_color(actor)
last_font_size = self.contents.font.size
xr = x + width
if width < 120
self.contents.draw_text(xr - 44, y, 44, WLH, actor.mp, 2)
else
self.contents.draw_text(xr - 99, y, 44, WLH, actor.mp, 2)
self.contents.font.color = normal_color
self.contents.draw_text(xr - 55, y, 11, WLH, "/", 2)
self.contents.draw_text(xr - 44, y, 44, WLH, actor.maxmp, 2)
end
end
end
#~ #--------------------------------------------------------------------------
#~ # * Draw MP Gauge
#~ # actor : actor
#~ # x : draw spot x-coordinate
#~ # y : draw spot y-coordinate
#~ # width : Width
#~ #--------------------------------------------------------------------------
def draw_actor_mp_gauge(actor, x, y, width = 120)
gw = width * actor.mp / [actor.maxmp, 1].max
gc1 = mp_gauge_color1(actor)
gc2 = mp_gauge_color2(actor)
self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
end
#--------------------------------------------------------------------------
# * Get MP Gauge Color 1
#--------------------------------------------------------------------------
def mp_gauge_color1(actor)
return text_color(MP_Colour[actor.class.id - 1][0])
end
#--------------------------------------------------------------------------
# * Get MP Gauge Color 2
#--------------------------------------------------------------------------
def mp_gauge_color2(actor)
return text_color(MP_Colour[actor.class.id - 1][1])
end
end
#######################
# CREDIT TO KAIMONKEY #
#######################
class Scene_Battle < Scene_Base
def update_item_selection
@item_window.active = true
@item_window.update
@help_window.update
if Input.trigger?(Input::B)
Sound.play_cancel
end_item_selection
elsif Input.trigger?(Input::C)
@item = @item_window.item
if @item != nil
$game_party.last_item_id = @item.id
end
if $Potions_effect[@item.id] != nil
if $game_party.item_can_use?(@item)&& $Potions_effect[@item.id].include?(@active_battler.class.id)
Sound.play_decision
determine_item
else
Sound.play_buzzer
end
else
if $game_party.item_can_use?(@item)
Sound.play_decision
determine_item
else
Sound.play_buzzer
end
end
end
end
def execute_action_attack
if MP_TO_DECREASE_Attacking[@active_battler.id - 1] != nil
if @active_battler.mp >= MP_TO_DECREASE_Attacking[@active_battler.class.id - 1]
text = sprintf(Vocab::DoAttack, @active_battler.name)
@message_window.add_instant_text(text)
targets = @active_battler.action.make_targets
display_attack_animation(targets)
wait(20)
for target in targets
target.attack_effect(@active_battler)
display_action_effects(target)
end
@active_battler.mp -= MP_TO_DECREASE_Attacking[@active_battler.class.id - 1]
else
text1= " hasn't enough "
text = @active_battler.name + text1 + MP_Types[@active_battler.class.id - 1] + " to attack!"
@message_window.add_instant_text(text)
wait(200)
end
if MP_TO_INCREASE_Attacking[@active_battler.class.id - 1] != nil
#~ p @active_battler.name
#~ p @active_battler.mp
#~ p MP_TO_INCREASE_Attacking[@active_battler.class.id - 1]
text = sprintf(Vocab::DoAttack, @active_battler.name)
@message_window.add_instant_text(text)
targets = @active_battler.action.make_targets
display_attack_animation(targets)
wait(20)
for target in targets
target.attack_effect(@active_battler)
display_action_effects(target)
end
@active_battler.mp += MP_TO_INCREASE_Attacking[@active_battler.class.id - 1]
#~ p @active_battler.mp
#~ p MP_TO_INCREASE_Attacking[@active_battler.id - 1]
end
else
text = sprintf(Vocab::DoAttack, @active_battler.name)
@message_window.add_instant_text(text)
targets = @active_battler.action.make_targets
display_attack_animation(targets)
wait(20)
for target in targets
target.attack_effect(@active_battler)
display_action_effects(target)
end
end
end
#~
def execute_action_guard
if MP_TO_INCREASE_Blocking[@active_battler.class.id - 1] != nil
if MP_TO_INCREASE_Blocking[@active_battler.class.id - 1] != 0
@active_battler.mp += MP_TO_INCREASE_Blocking[@active_battler.class.id - 1]
text = sprintf(Vocab::DoGuard, @active_battler.name)
@message_window.add_instant_text(text)
wait(45)
text = "So " + @active_battler.name + "'s " + MP_Types[@active_battler.class.id - 1] + " increased!"
@message_window.add_instant_text(text)
wait(45)
elsif MP_TO_INCREASE_Blocking[@active_battler.id - 1] != 0
@active_battler.mp -= MP_TO_DECREASE_Blocking[@active_battler.class.id - 1]
text = sprintf(Vocab::DoGuard, @active_battler.name)
@message_window.add_instant_text(text)
wait(45)
text = "So " + @active_battler.name + "'s " + MP_Types[@active_battler.class.id - 1] + " was Lost!"
@message_window.add_instant_text(text)
wait(45)
end
else
text = sprintf(Vocab::DoGuard, @active_battler.name)
@message_window.add_instant_text(text)
wait(45)
end
end
end
#~ #=============================================================================
#~ # ** Scene_Item
#~ #------------------------------------------------------------------------------
#~ # This class performs the item screen processing.
#~ #==============================================================================
class Scene_Item < Scene_Base
def determine_target
used = false
if @item.for_all?
for target in $game_party.members
target.item_effect(target, @item)
used = true unless target.skipped
end
else
$game_party.last_target_index = @target_window.index
target = $game_party.members[@target_window.index]
class_needed = $Potions_effect[@item.id]
if class_needed.include?(target.class.id)
target.item_effect(target, @item)
used = true unless target.skipped
end
end
if used
use_item_nontarget
else
Sound.play_buzzer
end
end
end
FAQQ: Who should i credit?
A: KaiMonkey
Q: I'm finding it hard to configure, can you do it for me?
A: Of coause (spelt wrong <_< )
Credit and Thanks
- KaiMonkey
- BigEd, for annoying me so much I starting scripting.....