найди все х и у положения окон и добавь 48 по х и 32 по у
Вид для печати
найди все х и у положения окон и добавь 48 по х и 32 по уЦитата:
Суп, кто может перекарнать этот скрипт https://falcaorgss.wordpress.com/201...s-enchantment/ под 640*480, у меня не получилось все окна подогнать.
время будет, поковыряюсь
собсна вопрос, в чем проблема? :)
у меня окна ровно по центру, или нужно его во весь экран сделать?
Вот объясните глупому, неразумному, как делаются навыки на скриптах через навыки пустышки или иначе.
Меня интересует именно структура и то какие функции за что отвечают..... (ибо я нуб)
К примеру я хотел бы сделать чтоб при применении на крага навыков класса "молнии" на враге накапливался статический заряд, и от уровней накопления заряда открывался доступ к новым навыкам навыкам использующим электричество.
Выглядет это так: У героя имеется 3 навыка класса молнии, "молния", "цепь молний", "Шаровая молния". Навык молния кастуется при уровне статического заряда 0, цепь молний, при накоплении заряда в 25 ед, а шаровая при накоплении 50. и пока на враге нет хотя бы 25 ед. статического заряда цепь молний и шаровая молнии остаются невозможными для применения.
Так же хотел бы узнать как делаются различные действия в бою. К примеру действие, что когда у героя манна равно 0, ему наносится урон по формуле из стат врага. Урон наносится сразу после того как уровень МП опускается до 0.
Далее к слову, хочу сказать что логические цепочки я понимаю как делаются для создания подобных навыков, но у меня совершенно нет практических знаний в скриптовании, посему прошу,того кто объяснит мне, сделать ещё демочку где я смогу наглядно увидеть готовый скрипт и разобрать его, чтоб понять.
Спойлер :PHP код:
#==============================================================================#
# #*****************# #
# #*** By Falcao ***# * Falcao Mana Stones Enchants 1.6 #
# #*****************# This script allows you to enchants, weapons and#
# armors in order to increase the actor stats. #
# RMVXACE #
# Date: October 22 2012 #
# #
# Falcao RGSS site: [url]http://falcaorgss.wordpress.com[/url] #
# Falcao Forum site: [url]http://makerpalace.com[/url] #
#==============================================================================#
# 1.6 change log
# - Fixed crash when mana stones are destroyed before the socketing process
#
# 1.5 change log
# - Added new stand alone GUI
# - Fixed bug when you set the DefaultSockets to cero and unequipp a weapon/armo
# - Mana stones container expanded on more line
#-------------------------------------------------------------------------------
# * Installation
# Copy and paste the script above main, no methods where overwritten so
# compatibility is very hight.
#-------------------------------------------------------------------------------
# * Features
# - Weapons and Armors enchantment enabled
# - Weapons and armors can have as many mana stones slots you want.
# - When soketing the actor stats increase according to especified mana stone
# - Mana stones are created with a simple note tag
# - Chance to Fail the enchantment process
# - If mana stones enchants fail all socketed mana stones are destroyed.
# - A user friendly GUI.
#
# Note: weapons and armors are concidered uniques, so if you have more than one
# weapon of the same id, the mana stones apply to all of them
#
#-------------------------------------------------------------------------------
# * Usage
#
# Mana stones are socketed in the equippment window scene by pressing 'A' key,
# weapon / armor must be equipped in order to start enchanting
#
# Tag weapons and armors with
# <sockets: x> - Change x for the number of sockets you want
#
# Tag Items with (this items would be the mana stones)
# <mana_mhp: x>
# <mana_mmp: x>
# <mana_atk: x>
# <mana_def: x> => Change x for the param amount to add
# <mana_mat: x>
# <mana_mdf: x>
# <mana_agi: x>
# <mana_luk: x>
#
# <socket_chance: x> Change x for the socket chance, it may be a number between
# 0 and 100. if you dont especified this defaults apply.
#
# Note: the chance is measured from a number between 0 and 100, you cannot
# put a number greater than 100. where 100 = 100% chance, when 0 = 0 %chance
#-------------------------------------------------------------------------------
# * License
# For non-comercial games only, for comercial games contact me:
# [email]falmc99@gmail.com[/email]
#-------------------------------------------------------------------------------
module FalMana
# Deafault sockets for weapons and armors, set 0 if you dont want defaults
DefaultSockets = 1
# Default enchantsment chance (a percent between 0 and 100)
DefaultChance = 80
# Sound played while socketing mana stones
SoketingSe = "Heal6"
# Sound played when success socketing
SocketSuccessSe = "Decision2"
# Sound played when fail socketing
SocketFailSe = "Down1"
# Sound played when clearing socket
ClearSocketSe = "Equip3"
#-------------------------------------------------------------------------------
def self.stones(actor)
@actor = actor
SceneManager.call(Scene_ManaStones)
end
def self.actor ; @actor ; end
def self.socket_manastone(item, index, value, actor)
item.manaslots[index] = value
actor.add_param(value.manastone_param[0], value.manastone_param[1])
end
def self.remove_manastone(item, index, value, actor)
item.manaslots[index] = nil
actor.add_param(value.manastone_param[0], - value.manastone_param[1])
end
def self.clear_manastones(item, actor)
item.manaslots.each {|m| actor.add_param(m.manastone_param[0],
- m.manastone_param[1]) unless m.nil?}
item.manaslots.size.times {|i| item.manaslots[i] = nil}
end
def self.add_param(actor, item, sub=false)
return if item.nil?
return if item.manaslots.nil?
item.manaslots.each {|m| actor.add_param(m.manastone_param[0],
sub ? - m.manastone_param[1] : m.manastone_param[1]) unless m.nil?}
end
end
# Game system: Register mana stones values
class Game_System
attr_reader :weapon_slots, :armor_slots
alias falcaomana_slots_ini initialize
def initialize
@weapon_slots = {}
@armor_slots = {}
dataslots_ini(@weapon_slots, $data_weapons)
dataslots_ini(@armor_slots, $data_armors)
falcaomana_slots_ini
end
def dataslots_ini(operand, item)
for kind in item
next if kind.nil?
if kind.given_sl != nil
data = []
kind.given_sl.times {|i| data.push(nil)}
operand[kind.id] = data
end
end
end
end
# Scene_Equip: main mana stones socketing system
class Scene_Equip < Scene_MenuBase
def update
super
update_manacalling
end
def update_manacalling
update_enchant_help
if Input.trigger?(:X)
FalMana.stones(@actor)
Sound.play_ok
end
end
def update_enchant_help
@help_window.contents.font.size = Font.default_size
@help_window.refresh
@help_window.contents.font.size = 24
@help_window.draw_text(-22,22,@help_window.width,32, 'Press A to enchant',2)
end
end
# RPG::EquipItem: get slots data for each weapon and armor
class RPG::EquipItem < RPG::BaseItem
def given_sl
@note =~ /<sockets: (.*)>/i ? n = $1.to_i : n = nil
n = FalMana::DefaultSockets if n.nil? and FalMana::DefaultSockets > 0
return n
end
def manaslots
self.is_a?(RPG::Weapon) ? i = $game_system.weapon_slots[self.id] :
i = $game_system.armor_slots[self.id]
return i
end
end
# RPG::Item: Mana stones item definition
class RPG::Item < RPG::UsableItem
def socket_chance
@note =~ /<socket_chance: (.*)>/i ? n = $1.to_i : n = FalMana::DefaultChance
return n
end
def manastone_param
param = [0, $1.to_i] if @note =~ /<mana_mhp: (.*)>/i
param = [1, $1.to_i] if @note =~ /<mana_mmp: (.*)>/i
param = [2, $1.to_i] if @note =~ /<mana_atk: (.*)>/i
param = [3, $1.to_i] if @note =~ /<mana_def: (.*)>/i
param = [4, $1.to_i] if @note =~ /<mana_mat: (.*)>/i
param = [5, $1.to_i] if @note =~ /<mana_mdf: (.*)>/i
param = [6, $1.to_i] if @note =~ /<mana_agi: (.*)>/i
param = [7, $1.to_i] if @note =~ /<mana_luk: (.*)>/i
return param
end
end
#-------------------------------------------------------------------------------
# Window mana slots
class Window_ItemSlots < Window_Selectable
def initialize(x=0, y=0, w=360, h=124)
super(x, y, w, h)
unselect
end
def item() return @data[self.index] end
def line_height() return 24 end
def spacing() return 6 end
def col_max() return 2 end
def refresh(object)
self.contents.clear if self.contents != nil
@data = []
return if object.manaslots.nil? rescue return
object.manaslots.each {|i| @data.push(i)}
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 26)
for i in 0...@item_max
draw_item(i)
end
end
end
def draw_item(index)
item = @data[index]
x, y = index % col_max * (171), index / col_max * 24
self.contents.font.size = 24
self.contents.draw_text(x + 2, y - 2, 212, 32, 's:', 0)
draw_icon(item.icon_index, x, y) rescue nil
param = Vocab.param(item.manastone_param[0]) rescue nil
value = item.manastone_param[1] rescue nil
self.contents.draw_text(x + 24,y,212,32, param + " +#{value}") rescue nil
end
def item_max
return @item_max.nil? ? 0 : @item_max
end
end
#-------------------------------------------------------------------------------
# Window mana stones
class Window_ManaStones < Window_Selectable
def initialize(x=0, y=124, w=361, h=266)
super(x, y, w, h)
refresh ; unselect
end
def item() return @data[self.index] end
def refresh
self.contents.clear if self.contents != nil
@data = []
for it in $data_items
next if it.nil?
@data.push(it) if $game_party.has_item?(it) and !it.manastone_param.nil?
end
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 26)
for i in 0...@item_max
draw_item(i)
end
end
end
def draw_item(index)
item = @data[index]
x, y = index % col_max * (90), index / col_max * 24
self.contents.font.size = 24
draw_icon(item.icon_index, x, y)
param = Vocab.param(item.manastone_param[0])
value = item.manastone_param[1]
number = $game_party.item_number(item)
contents.draw_text(x + 24,y,212,32, item.name + " #{param} +#{value}")
contents.draw_text(x -30, y, self.width, 32, ':' + number.to_s, 2)
end
def item_max
return @item_max.nil? ? 0 : @item_max
end
end
class Game_Actor < Game_Battler
alias falcaomanastones_change change_equip
def change_equip(slot_id, item)
FalMana.add_param(self, @equips[slot_id].object, true)
FalMana.add_param(self, item)
falcaomanastones_change(slot_id, item)
end
end
#-------------------------------------------------------------------------------
# Window actor equipped
class Window_Equippedwa < Window_Selectable
def initialize(x=0, y=0)
super(x, y, 279, 214)
refresh(FalMana.actor) ; activate ; select(0)
end
def item() return @data[self.index] end
def refresh(actor)
self.contents.clear if self.contents != nil
@data = []
actor.equips.each {|equips| @data.push(equips) if !equips.nil?}
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 26)
for i in 0...@item_max
draw_item(i)
end
end
end
def draw_item(index)
item = @data[index]
x, y = index % col_max * (90), index / col_max * 24
self.contents.font.size = 24
draw_icon(item.icon_index, x, y)
contents.draw_text(x + 24,y,212,32, item.name)
end
def item_max
return @item_max.nil? ? 0 : @item_max
end
end
# Scene mana stones
class Scene_ManaStones < Scene_MenuBase
def start
super
w = Graphics.width ; h = Graphics.height ; @actor = FalMana.actor
@slot_window = Window_Equippedwa.new(0, 0)
@param_window = Window_Base.new(@slot_window.x,@slot_window.y + 214,279,280)
refresh_param
@socket_window = Window_Base.new(279, 0, 360, 90)
@col = [Color.new(180, 225, 245), Color.new(20, 160, 225), Color.new(0,0,0)]
@itemslots = Window_ItemSlots.new(@socket_window.x, @socket_window.y + 90)
@manastones = Window_ManaStones.new(@itemslots.x, @itemslots.y + 124)
@result = '' ; @meter = 0
update_indexes
end
def refresh_param
@param_window.contents.clear
@param_window.contents.font.size = 24
@param_window.contents.font.color = @param_window.normal_color
@param_window.contents.fill_rect(0, 0, 256, 44, Color.new(0, 0, 0, 60))
@param_window.draw_character(@actor.character_name,
@actor.character_index, 20, 42)
@param_window.draw_text(50, -6, 190, 32, @actor.name)
@param_window.draw_text(50, 18, 190, 32, 'Equippment')
y = 0
for i in 0...8
y += 24
@param_window.contents.font.color = @param_window.normal_color
@param_window.draw_text(0, y + 28, 190, 32, Vocab.param(i))
@param_window.contents.font.color = @param_window.system_color
@param_window.draw_text(70, y + 28, 190, 32, "=> #{@actor.param(i)}")
end
end
def refresh_socketing
@socket_window.contents.clear
@socket_window.contents.font.size = 24
if @slot_window.item.nil? || @slot_window.item.manaslots.nil?
@socket_window.draw_text(-16, 0, 280, 32, 'No sockets', 1)
return
end
@socket_window.draw_icon(@slot_window.item.icon_index, 0, 0)
@socket_window.draw_text(26, 0, @socket_window.width, 32,
@slot_window.item.name + " sockets: #{@slot_window.item.manaslots.size}")
@socket_window.draw_text(-20, 44, 280, 32, 'S = clear socket', 2)
if @meter > 0 and @meter < 100
x, y = 78, 34
@socket_window.draw_text(0, 22, 212, 32, 'Socketing:')
@socket_window.contents.fill_rect(x, y, 152, 12, @col[2])
@socket_window.contents.fill_rect(x+1, y+1, 150 *@meter / 100, 5, @col[0])
@socket_window.contents.fill_rect(x+1, y+6, 150 *@meter / 100, 5, @col[1])
elsif @meter > 100
@socket_window.draw_text(0, 22, @socket_window.width, 32, @result)
elsif @meter == 0
@itemslots.item.nil? ? @result = 'Socket ready' : @result = 'Socket busy'
@socket_window.draw_text(0, 22, @socket_window.width, 32, @result)
end
end
def terminate
super
@itemslots.dispose
@manastones.dispose
@socket_window.dispose
@slot_window.dispose
@param_window.dispose
end
def update
super
update_selection if Input.trigger?(:C)
update_cancel if Input.trigger?(:B)
update_clear_socket if Input.trigger?(:Y)
start_socketing
update_indexes
end
def update_indexes
if @equipp_slot != @slot_window.index
@itemslots.refresh(@slot_window.item)
refresh_socketing
@equipp_slot = @slot_window.index
elsif @slots_index != @itemslots.index and @itemslots.visible
@slots_index = @itemslots.index
refresh_socketing
end
end
def start_socketing
return if @soketing.nil?
@meter += 1 ; refresh_socketing
if @meter == 100
r = rand(101)
r <= @manastones.item.socket_chance ? success_socketing : fail_socketing
elsif @meter == 200
@soketing = nil ; @meter = 0 ; @manastones.activate
refresh_socketing
end
end
def update_selection
return if @meter > 0 || !@itemslots.visible
if !@itemslots.item.nil? || @slot_window.item.nil? ||
@slot_window.item.manaslots.nil?
if !@slot_window.active
Sound.play_buzzer; return
elsif @slot_window.active and @slot_window.item.nil?
Sound.play_buzzer; return
elsif @slot_window.item.manaslots.nil?
Sound.play_buzzer; return
end
end
if @slot_window.active and !@itemslots.active
@itemslots.select(0)
@itemslots.activate
@slot_window.deactivate ; Sound.play_ok
elsif @itemslots.active and !@manastones.active
@itemslots.deactivate
@manastones.activate ; @manastones.select(0)
Sound.play_ok
elsif @manastones.active and !@manastones.item.nil?
@manastones.deactivate
RPG::SE.new(FalMana::SoketingSe, 80,).play
@soketing = true
end
end
def fail_socketing
FalMana.clear_manastones(@slot_window.item, @actor)
@itemslots.refresh(@slot_window.item)
refresh_param
@result = 'Mana stones destroyed!'
RPG::SE.new(FalMana::SocketFailSe, 80,).play
destroy_manastone
end
def success_socketing
FalMana.socket_manastone(@slot_window.item, @itemslots.index,
@manastones.item, @actor)
@itemslots.refresh(@slot_window.item)
refresh_param
@result = 'Socketing successful!'
RPG::SE.new(FalMana::SocketSuccessSe, 80,).play
destroy_manastone
end
def destroy_manastone
$game_party.lose_item(@manastones.item, 1)
@manastones.refresh
end
def update_cancel
return if @meter > 0
Sound.play_cancel
if @slot_window.active
SceneManager.return
elsif @itemslots.active
@slot_window.activate
@itemslots.unselect
@itemslots.deactivate
elsif @manastones.active
@manastones.unselect ; @manastones.deactivate
@itemslots.activate
end
end
def update_clear_socket
return if @itemslots.item.nil? || !@itemslots.active
RPG::SE.new(FalMana::ClearSocketSe, 80,).play
FalMana.remove_manastone(@slot_window.item, @itemslots.index,
@itemslots.item, @actor)
@itemslots.refresh(@slot_window.item)
refresh_param
refresh_socketing
end
end
текст, думаю, сама сможешь отредактировать и передвинуть? :)
Спасибочки ОцО дальше сама)Цитата:
Спойлер :PHP код:
#==============================================================================#
# #*****************# #
# #*** By Falcao ***# * Falcao Mana Stones Enchants 1.6 #
# #*****************# This script allows you to enchants, weapons and#
# armors in order to increase the actor stats. #
# RMVXACE #
# Date: October 22 2012 #
# #
# Falcao RGSS site: [url]http://falcaorgss.wordpress.com[/url] #
# Falcao Forum site: [url]http://makerpalace.com[/url] #
#==============================================================================#
# 1.6 change log
# - Fixed crash when mana stones are destroyed before the socketing process
#
# 1.5 change log
# - Added new stand alone GUI
# - Fixed bug when you set the DefaultSockets to cero and unequipp a weapon/armo
# - Mana stones container expanded on more line
#-------------------------------------------------------------------------------
# * Installation
# Copy and paste the script above main, no methods where overwritten so
# compatibility is very hight.
#-------------------------------------------------------------------------------
# * Features
# - Weapons and Armors enchantment enabled
# - Weapons and armors can have as many mana stones slots you want.
# - When soketing the actor stats increase according to especified mana stone
# - Mana stones are created with a simple note tag
# - Chance to Fail the enchantment process
# - If mana stones enchants fail all socketed mana stones are destroyed.
# - A user friendly GUI.
#
# Note: weapons and armors are concidered uniques, so if you have more than one
# weapon of the same id, the mana stones apply to all of them
#
#-------------------------------------------------------------------------------
# * Usage
#
# Mana stones are socketed in the equippment window scene by pressing 'A' key,
# weapon / armor must be equipped in order to start enchanting
#
# Tag weapons and armors with
# <sockets: x> - Change x for the number of sockets you want
#
# Tag Items with (this items would be the mana stones)
# <mana_mhp: x>
# <mana_mmp: x>
# <mana_atk: x>
# <mana_def: x> => Change x for the param amount to add
# <mana_mat: x>
# <mana_mdf: x>
# <mana_agi: x>
# <mana_luk: x>
#
# <socket_chance: x> Change x for the socket chance, it may be a number between
# 0 and 100. if you dont especified this defaults apply.
#
# Note: the chance is measured from a number between 0 and 100, you cannot
# put a number greater than 100. where 100 = 100% chance, when 0 = 0 %chance
#-------------------------------------------------------------------------------
# * License
# For non-comercial games only, for comercial games contact me:
# [email]falmc99@gmail.com[/email]
#-------------------------------------------------------------------------------
module FalMana
# Deafault sockets for weapons and armors, set 0 if you dont want defaults
DefaultSockets = 1
# Default enchantsment chance (a percent between 0 and 100)
DefaultChance = 80
# Sound played while socketing mana stones
SoketingSe = "Heal6"
# Sound played when success socketing
SocketSuccessSe = "Decision2"
# Sound played when fail socketing
SocketFailSe = "Down1"
# Sound played when clearing socket
ClearSocketSe = "Equip3"
#-------------------------------------------------------------------------------
def self.stones(actor)
@actor = actor
SceneManager.call(Scene_ManaStones)
end
def self.actor ; @actor ; end
def self.socket_manastone(item, index, value, actor)
item.manaslots[index] = value
actor.add_param(value.manastone_param[0], value.manastone_param[1])
end
def self.remove_manastone(item, index, value, actor)
item.manaslots[index] = nil
actor.add_param(value.manastone_param[0], - value.manastone_param[1])
end
def self.clear_manastones(item, actor)
item.manaslots.each {|m| actor.add_param(m.manastone_param[0],
- m.manastone_param[1]) unless m.nil?}
item.manaslots.size.times {|i| item.manaslots[i] = nil}
end
def self.add_param(actor, item, sub=false)
return if item.nil?
return if item.manaslots.nil?
item.manaslots.each {|m| actor.add_param(m.manastone_param[0],
sub ? - m.manastone_param[1] : m.manastone_param[1]) unless m.nil?}
end
end
# Game system: Register mana stones values
class Game_System
attr_reader :weapon_slots, :armor_slots
alias falcaomana_slots_ini initialize
def initialize
@weapon_slots = {}
@armor_slots = {}
dataslots_ini(@weapon_slots, $data_weapons)
dataslots_ini(@armor_slots, $data_armors)
falcaomana_slots_ini
end
def dataslots_ini(operand, item)
for kind in item
next if kind.nil?
if kind.given_sl != nil
data = []
kind.given_sl.times {|i| data.push(nil)}
operand[kind.id] = data
end
end
end
end
# Scene_Equip: main mana stones socketing system
class Scene_Equip < Scene_MenuBase
def update
super
update_manacalling
end
def update_manacalling
update_enchant_help
if Input.trigger?(:X)
FalMana.stones(@actor)
Sound.play_ok
end
end
def update_enchant_help
@help_window.contents.font.size = Font.default_size
@help_window.refresh
@help_window.contents.font.size = 24
@help_window.draw_text(-22,22,@help_window.width,32, 'Press A to enchant',2)
end
end
# RPG::EquipItem: get slots data for each weapon and armor
class RPG::EquipItem < RPG::BaseItem
def given_sl
@note =~ /<sockets: (.*)>/i ? n = $1.to_i : n = nil
n = FalMana::DefaultSockets if n.nil? and FalMana::DefaultSockets > 0
return n
end
def manaslots
self.is_a?(RPG::Weapon) ? i = $game_system.weapon_slots[self.id] :
i = $game_system.armor_slots[self.id]
return i
end
end
# RPG::Item: Mana stones item definition
class RPG::Item < RPG::UsableItem
def socket_chance
@note =~ /<socket_chance: (.*)>/i ? n = $1.to_i : n = FalMana::DefaultChance
return n
end
def manastone_param
param = [0, $1.to_i] if @note =~ /<mana_mhp: (.*)>/i
param = [1, $1.to_i] if @note =~ /<mana_mmp: (.*)>/i
param = [2, $1.to_i] if @note =~ /<mana_atk: (.*)>/i
param = [3, $1.to_i] if @note =~ /<mana_def: (.*)>/i
param = [4, $1.to_i] if @note =~ /<mana_mat: (.*)>/i
param = [5, $1.to_i] if @note =~ /<mana_mdf: (.*)>/i
param = [6, $1.to_i] if @note =~ /<mana_agi: (.*)>/i
param = [7, $1.to_i] if @note =~ /<mana_luk: (.*)>/i
return param
end
end
#-------------------------------------------------------------------------------
# Window mana slots
class Window_ItemSlots < Window_Selectable
def initialize(x=0, y=0, w=360, h=124)
super(x, y, w, h)
unselect
end
def item() return @data[self.index] end
def line_height() return 24 end
def spacing() return 6 end
def col_max() return 2 end
def refresh(object)
self.contents.clear if self.contents != nil
@data = []
return if object.manaslots.nil? rescue return
object.manaslots.each {|i| @data.push(i)}
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 26)
for i in 0...@item_max
draw_item(i)
end
end
end
def draw_item(index)
item = @data[index]
x, y = index % col_max * (171), index / col_max * 24
self.contents.font.size = 24
self.contents.draw_text(x + 2, y - 2, 212, 32, 's:', 0)
draw_icon(item.icon_index, x, y) rescue nil
param = Vocab.param(item.manastone_param[0]) rescue nil
value = item.manastone_param[1] rescue nil
self.contents.draw_text(x + 24,y,212,32, param + " +#{value}") rescue nil
end
def item_max
return @item_max.nil? ? 0 : @item_max
end
end
#-------------------------------------------------------------------------------
# Window mana stones
class Window_ManaStones < Window_Selectable
def initialize(x=0, y=124, w=361, h=266)
super(x, y, w, h)
refresh ; unselect
end
def item() return @data[self.index] end
def refresh
self.contents.clear if self.contents != nil
@data = []
for it in $data_items
next if it.nil?
@data.push(it) if $game_party.has_item?(it) and !it.manastone_param.nil?
end
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 26)
for i in 0...@item_max
draw_item(i)
end
end
end
def draw_item(index)
item = @data[index]
x, y = index % col_max * (90), index / col_max * 24
self.contents.font.size = 24
draw_icon(item.icon_index, x, y)
param = Vocab.param(item.manastone_param[0])
value = item.manastone_param[1]
number = $game_party.item_number(item)
contents.draw_text(x + 24,y,212,32, item.name + " #{param} +#{value}")
contents.draw_text(x -30, y, self.width, 32, ':' + number.to_s, 2)
end
def item_max
return @item_max.nil? ? 0 : @item_max
end
end
class Game_Actor < Game_Battler
alias falcaomanastones_change change_equip
def change_equip(slot_id, item)
FalMana.add_param(self, @equips[slot_id].object, true)
FalMana.add_param(self, item)
falcaomanastones_change(slot_id, item)
end
end
#-------------------------------------------------------------------------------
# Window actor equipped
class Window_Equippedwa < Window_Selectable
def initialize(x=0, y=0)
super(x, y, 279, 214)
refresh(FalMana.actor) ; activate ; select(0)
end
def item() return @data[self.index] end
def refresh(actor)
self.contents.clear if self.contents != nil
@data = []
actor.equips.each {|equips| @data.push(equips) if !equips.nil?}
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 26)
for i in 0...@item_max
draw_item(i)
end
end
end
def draw_item(index)
item = @data[index]
x, y = index % col_max * (90), index / col_max * 24
self.contents.font.size = 24
draw_icon(item.icon_index, x, y)
contents.draw_text(x + 24,y,212,32, item.name)
end
def item_max
return @item_max.nil? ? 0 : @item_max
end
end
# Scene mana stones
class Scene_ManaStones < Scene_MenuBase
def start
super
w = Graphics.width ; h = Graphics.height ; @actor = FalMana.actor
@slot_window = Window_Equippedwa.new(0, 0)
@param_window = Window_Base.new(@slot_window.x,@slot_window.y + 214,279,280)
refresh_param
@socket_window = Window_Base.new(279, 0, 360, 90)
@col = [Color.new(180, 225, 245), Color.new(20, 160, 225), Color.new(0,0,0)]
@itemslots = Window_ItemSlots.new(@socket_window.x, @socket_window.y + 90)
@manastones = Window_ManaStones.new(@itemslots.x, @itemslots.y + 124)
@result = '' ; @meter = 0
update_indexes
end
def refresh_param
@param_window.contents.clear
@param_window.contents.font.size = 24
@param_window.contents.font.color = @param_window.normal_color
@param_window.contents.fill_rect(0, 0, 256, 44, Color.new(0, 0, 0, 60))
@param_window.draw_character(@actor.character_name,
@actor.character_index, 20, 42)
@param_window.draw_text(50, -6, 190, 32, @actor.name)
@param_window.draw_text(50, 18, 190, 32, 'Equippment')
y = 0
for i in 0...8
y += 24
@param_window.contents.font.color = @param_window.normal_color
@param_window.draw_text(0, y + 28, 190, 32, Vocab.param(i))
@param_window.contents.font.color = @param_window.system_color
@param_window.draw_text(70, y + 28, 190, 32, "=> #{@actor.param(i)}")
end
end
def refresh_socketing
@socket_window.contents.clear
@socket_window.contents.font.size = 24
if @slot_window.item.nil? || @slot_window.item.manaslots.nil?
@socket_window.draw_text(-16, 0, 280, 32, 'No sockets', 1)
return
end
@socket_window.draw_icon(@slot_window.item.icon_index, 0, 0)
@socket_window.draw_text(26, 0, @socket_window.width, 32,
@slot_window.item.name + " sockets: #{@slot_window.item.manaslots.size}")
@socket_window.draw_text(-20, 44, 280, 32, 'S = clear socket', 2)
if @meter > 0 and @meter < 100
x, y = 78, 34
@socket_window.draw_text(0, 22, 212, 32, 'Socketing:')
@socket_window.contents.fill_rect(x, y, 152, 12, @col[2])
@socket_window.contents.fill_rect(x+1, y+1, 150 *@meter / 100, 5, @col[0])
@socket_window.contents.fill_rect(x+1, y+6, 150 *@meter / 100, 5, @col[1])
elsif @meter > 100
@socket_window.draw_text(0, 22, @socket_window.width, 32, @result)
elsif @meter == 0
@itemslots.item.nil? ? @result = 'Socket ready' : @result = 'Socket busy'
@socket_window.draw_text(0, 22, @socket_window.width, 32, @result)
end
end
def terminate
super
@itemslots.dispose
@manastones.dispose
@socket_window.dispose
@slot_window.dispose
@param_window.dispose
end
def update
super
update_selection if Input.trigger?(:C)
update_cancel if Input.trigger?(:B)
update_clear_socket if Input.trigger?(:Y)
start_socketing
update_indexes
end
def update_indexes
if @equipp_slot != @slot_window.index
@itemslots.refresh(@slot_window.item)
refresh_socketing
@equipp_slot = @slot_window.index
elsif @slots_index != @itemslots.index and @itemslots.visible
@slots_index = @itemslots.index
refresh_socketing
end
end
def start_socketing
return if @soketing.nil?
@meter += 1 ; refresh_socketing
if @meter == 100
r = rand(101)
r <= @manastones.item.socket_chance ? success_socketing : fail_socketing
elsif @meter == 200
@soketing = nil ; @meter = 0 ; @manastones.activate
refresh_socketing
end
end
def update_selection
return if @meter > 0 || !@itemslots.visible
if !@itemslots.item.nil? || @slot_window.item.nil? ||
@slot_window.item.manaslots.nil?
if !@slot_window.active
Sound.play_buzzer; return
elsif @slot_window.active and @slot_window.item.nil?
Sound.play_buzzer; return
elsif @slot_window.item.manaslots.nil?
Sound.play_buzzer; return
end
end
if @slot_window.active and !@itemslots.active
@itemslots.select(0)
@itemslots.activate
@slot_window.deactivate ; Sound.play_ok
elsif @itemslots.active and !@manastones.active
@itemslots.deactivate
@manastones.activate ; @manastones.select(0)
Sound.play_ok
elsif @manastones.active and !@manastones.item.nil?
@manastones.deactivate
RPG::SE.new(FalMana::SoketingSe, 80,).play
@soketing = true
end
end
def fail_socketing
FalMana.clear_manastones(@slot_window.item, @actor)
@itemslots.refresh(@slot_window.item)
refresh_param
@result = 'Mana stones destroyed!'
RPG::SE.new(FalMana::SocketFailSe, 80,).play
destroy_manastone
end
def success_socketing
FalMana.socket_manastone(@slot_window.item, @itemslots.index,
@manastones.item, @actor)
@itemslots.refresh(@slot_window.item)
refresh_param
@result = 'Socketing successful!'
RPG::SE.new(FalMana::SocketSuccessSe, 80,).play
destroy_manastone
end
def destroy_manastone
$game_party.lose_item(@manastones.item, 1)
@manastones.refresh
end
def update_cancel
return if @meter > 0
Sound.play_cancel
if @slot_window.active
SceneManager.return
elsif @itemslots.active
@slot_window.activate
@itemslots.unselect
@itemslots.deactivate
elsif @manastones.active
@manastones.unselect ; @manastones.deactivate
@itemslots.activate
end
end
def update_clear_socket
return if @itemslots.item.nil? || !@itemslots.active
RPG::SE.new(FalMana::ClearSocketSe, 80,).play
FalMana.remove_manastone(@slot_window.item, @itemslots.index,
@itemslots.item, @actor)
@itemslots.refresh(@slot_window.item)
refresh_param
refresh_socketing
end
end
текст, думаю, сама сможешь отредактировать и передвинуть? :)
Вопрос. Имеется GALV'S RANDOM LOOT , в нём меня не устраивают те сообщения,что появляются при получении предмета, подскажите что надо дописать чтоб при получении предмета выводилось сообщение, которое не мешает дальнейшим действиям и висит некоторое время.
Спойлер :PHP код:
#===============================================================================
# +++ GALV'S RANDOM LOOT +++
#===============================================================================
# + Original Script by Galv
# + Extended by Fhizban (also known as Malagar)
# + Version 1.4
# + Updated August 2015
# + For RPGMaker VX Ace
# + Free for Non-Commercial and Commercial use
# + Requires no other scripts
#===============================================================================
# DESCRIPTION
#===============================================================================
# This script allows you to have a script call to gain random loot from chests.
# Add notetags to items to specify level requirements and rarity values.
# A notetag can also be added to items that you want to increase the chance to
# find rarer loot. Random loot can be limited to certain types of items too.
#===============================================================================
# INSTALLATION
#===============================================================================
# + Put this script after Material but before main.
# + Add some of the notetags (described below) to the items in the database.
# + Add a new event that represents a chest or other container to your map.
# + Add a script call to the event that will generate random loot (see below).
#===============================================================================
# DOCUMENTATION
#===============================================================================
# You are required to setup two different parts to make this script work:
# 1) Add Notetags to your items in the database.
# 2) Add the script call to your events (chests).
# 3) Optionally you can change the configuration below to your taste.
#
# 1) Editing Notetags:
# You must specify the following notetags for all ITEMS, WEAPONS and ARMOR that
# you want to randomly appear in your events (chests). If any items do not have
# these tags, they will just not appear in a random chest at all.
#
# <family: x> # The group or family the item belongs to
# # You define these families yourself (1-99)
# <rarity: x> # The rarity value (1+ higher is rarer)
# <level-min: x> # Min level of player for item to show (1-99)
# <level-max: x> # Max level of player for item to show (1-99)
#
# Optional notetag for ARMORS and WEAPONS only:
#
# <lucky: x> # All equipped lucky items of the party are added to
# # calculate the total chance to get rarer items.
#
# 2) Using the script call:
# By using this script call, you can randomly obtain an item. Go to your event and add
# a new command to it, choose script from the very last command tab and insert the
# following line.
#
# EXAMPLE:
#
# random_item(0, 1, 10, 50, 1, 1)
#
# SYNTAX:
#
# random_item(type, rarity_min, rarity_max, subtype=0, monster_id=0, family=0)
#
# type # The type of item to be found:
# # 0 = Random/any type (you can also use numbers 4+)
# # 1 = Item
# # 2 = Armor
# # 3 = Weapon
#
# rarity_min # Min and Max Rareness determine the item rarity that
# rarity_max # the script call will obtain when successful. You can
# # state any number that you also use on the notetags
# # of your items. Example:
# # rarity_min=10, rarity_max=50
# # The script call will generate a random number 1-50.
# # An item can only be obtained if it has a rarity
# # EQUAL or LESS than the generated number.
#
# subtype # OPTIONAL. This only applies to WEAPONS or ARMOR and
# # will be ignored otherwise. Filters the random loot
# # to drop only items of the stated type.
# # (e.g. 1 = General Armour)
#
# monster_id # OPTIONAL. This ID is used to decide what TROPP id
# # will be used when a monster-in-a-box is encountered.
# # Otherwise the standard troop will be used. Ignored
# # if encounter chance is set to zero.
#
# family # OPTIONAL. Family can be any number or 0.
# # 0 = drops any item of the stated type/subtype
# # x = drops only items of the stated type/subtype that
# # share the family.
#
# Using a clever combination of type, subtype and families - you can tailor the random
# loot spawn to create only items of a very specific type. Like only Armors of the Small
# Shield type, or just Weapons of the Sword type and so on.
#===============================================================================
$imported = {} if $imported.nil?
$imported["Random_Loot"] = true
module Random_Loot
#===============================================================================
# CONFIGURATION
#===============================================================================
GET_MESSAGE = "Found " # Text before item name.
GET_MESSAGE_AFTER = "!" # Text after item name.
FAIL_MESSAGE = "It's empty!" # Text when random item comes up nothing.
SOUND_EFFECT = ["Coin", 90, 100] # Sound effect of gaining an item.
# ["SE Name", volume, pitch]
# Make "SE Name" = "" for no sound.
DEFAULT_MONSTER = 1 # Default Monster ID if none stated.
MONSTER_CHANCE = 10 # % Chance that if no item is found, a
# battle will happen instead.
ESCAPE_MONSTER = true # Can you escape it? true or false
MONSTER_MESSAGE = "Monster in a box!" # Message when a monster appears.
# Make it "" to disable.
#===============================================================================
# END CONFIGURATION
#===============================================================================
end
#===============================================================================
module Random_Loot_Notetags
def loot_rarity
if @loot_rarity.nil?
if @note =~ /<rarity: (.*)>/i
@loot_rarity = $1.to_i
else
@loot_rarity = 0
end
end
@loot_rarity
end
def loot_level_min
if @loot_level_min.nil?
if @note =~ /<level-min: (.*)>/i
@loot_level_min = $1.to_i
else
@loot_level_min = 0
end
end
@loot_level_min
end
def loot_level_max
if @loot_level_max.nil?
if @note =~ /<level-max: (.*)>/i
@loot_level_max = $1.to_i
else
@loot_level_max = 0
end
end
@loot_level_max
end
def loot_lucky
if @loot_lucky.nil?
if @note =~ /<lucky: (.*)>/i
@loot_lucky = $1.to_i
else
@loot_lucky = 0
end
end
@loot_lucky
end
def loot_family
if @loot_family.nil?
if @note =~ /<family: (.*)>/i
@loot_family = $1.to_i
else
@loot_family = 0
end
end
@loot_family
end
end # Random_Loot_Notetags
#===============================================================================
class RPG::Item
include Random_Loot_Notetags
end
class RPG::Armor
include Random_Loot_Notetags
end
class RPG::Weapon
include Random_Loot_Notetags
end
#===============================================================================
class Game_Interpreter
def random_item(type, rarity_min, rarity_max, subtype=0, monster_id=0, family=0)
#--- Determine Type
if type == 1
@loot = $data_items
subtype = 0
elsif type == 2
@loot = $data_armors
elsif type == 3
@loot = $data_weapons
else
@loot = $data_items | $data_armors | $data_weapons
subtype = 0
end
#--- Preperations
@loot.shuffle
if rarity_max < rarity_min
rarity_max = rarity_min
end
if subtype < 0 || subtype > 99
subtype = 0
end
if family < 0 || family > 99
subtype = 0
end
if monster_id < 1
monster_id = Random_Loot::DEFAULT_MONSTER
end
#--- Determine Party Luck Bonus
mem = 0
eqs = 0
luck_bonus = 0
i = 0
no_equips = $game_party.members.count * $game_party.members[0].equips.count
$game_party.members.each do |mem|
mem.equips.each do |eq|
next if eq.nil?
luck_bonus += eq.loot_lucky
end
end
#--- Determine Rarity Chance
checked = 0
restart = false
continue = true
no_items = @loot.count - 1
rare_chance = rand(rarity_max - rarity_min) + rarity_min + luck_bonus + 1
random_item = rand(no_items) + 1
begin_count = rand(no_items) + 1
#--- Determine Random Item
no_items.times do |i|
i = i + random_item
begin_count += 1 if restart
if i > no_items
i = i - i + rand(no_items) + 1
restart = true
end
#--- Get Random Item
if family != 0 && @loot[i].loot_family != family
continue = false
end
if subtype != 0 && type == 2
if @loot[i].atype_id == subtype
continue = false
end
end
if subtype != 0 && type == 3
if @loot[i].wtype_id == subtype
continue = false
end
end
if continue
if @loot[i].loot_level_max >= $game_party.leader.level && @loot[i].loot_level_min <= $game_party.leader.level
if @loot[i].loot_rarity <= rare_chance
if rand(1) <= 0 #--- Dirty Hack to skip some items
$game_party.gain_item(@loot[i], 1)
RPG::SE.new(Random_Loot::SOUND_EFFECT[0], Random_Loot::SOUND_EFFECT[1], Random_Loot::SOUND_EFFECT[2]).play
@event_window.add_text(text)
#$game_message.add(Random_Loot::GET_MESSAGE + "\\I[" + @loot[i].icon_index.to_s + "]" + @loot[i].name.to_s + Random_Loot::GET_MESSAGE_AFTER)
#wait_for_message
return
end
end
end
end
checked += 1
#--- Trigger Monster-in-a-Box Battle
if checked == no_items
monster_chance = rand(100) + 1
if monster_chance <= Random_Loot::MONSTER_CHANCE
if Random_Loot::MONSTER_MESSAGE != ""
@event_window.add_text(text)
#$game_message.add("\\>" + Random_Loot::MONSTER_MESSAGE + "\\.\\.\\.\\^")
wait_for_message
end
BattleManager.setup(monster_id, Random_Loot::ESCAPE_MONSTER, false)
SceneManager.call(Scene_Battle)
else
#$game_message.add(Random_Loot::FAIL_MESSAGE)
wait_for_message
end
end
end
end
end # Game_Interpreter
#===============================================================================
# END OF SCRIPT
#===============================================================================
Ты про стандартное окно мейкера? Его вроде никак не сделать параллельным.