script para arremessar itens

Ver o tópico anterior Ver o tópico seguinte Ir em baixo

script para arremessar itens

Mensagem  roberto em Sab Mar 13, 2010 6:24 pm

Script criado pelo site XMS.

Created by XMS site.

Tradução e tutorial por Moghunter.

Spoiler:
################################################################################
################################### XMS ########################################
################################################################################
=begin
WEAPON TROWN
(Habilidade arremessar itens)

--------------------------------------------------------------------------------
Script criado pelo site XMS.
Created by XMS site.
Tradução e tutorial por Moghunter.
--------------------------------------------------------------------------------

CARACTERíSTICAS
Permite arremessar itens ou armas no alvo inimigo.

UTILIZAÇÃO
Crie os atributos abaixo e atribua as suas armas.
Para arremessar itens.
----------------------
WT0
----------------------
Para arremessar armas.
----------------------
WT1
----------------------

CALCULO DE DANO.
O dano padrão será o dobro do valor em dinheiro do item ou da arma.

DEFININDO % DE DANO ESPECíFICO.
Crie o atributo abaixo abaixo e ao lado do nome do atributo coloque a % de
dano que causará calculado no valor do dinheiro.
----------------------
WTP
----------------------
Exemplo de Uso
----------------------
WTP500%
----------------------

=end
#-------------------------------------------------------------------------------

class Game_Battler
alias xrxs27wt_skill_effect skill_effect
def skill_effect(user, skill)
last_hp = self.hp
last_sp = self.sp
save_in_battle = $game_temp.in_battle
$game_temp.in_battle = true
bool = xrxs27wt_skill_effect(user, skill)
$game_temp.in_battle = save_in_battle
if skill != nil and skill.power < 0 and !user.current_action.sp_damage
bool = false if (last_hp == self.maxhp)
end
damage = self.damage
if skill != nil and XRXS.element_include?(skill.element_set, "WT")
self.hp += damage if bool
throw_item = user.current_action.basic
case throw_item
when RPG::Weapon
$game_party.lose_weapon(throw_item.id, 1)
damage = throw_item.atk
returnar = XRXS.element_check(throw_item.element_set, "WTP")
when RPG::Armor
damage = throw_item.pdef * 5
returnar = XRXS.element_check(throw_item.guard_element_set, "WTP")
when RPG::Item
damage = throw_item.price * 2
returnar = XRXS.element_check(throw_item.element_set, "WTP")
end
if returnar[0] and returnar[2] != 0
damage = (damage * returnar[2] / 100.0).floor
end
bool = true
end
if damage.is_a?(Numeric)
self.hp = last_hp - damage
self.damage = damage
else
self.hp = last_hp
self.damage = nil
end
return bool
end
end
class Window_Item < Window_Selectable
attr_reader :data # @data
def set_itemkind(itemkind)
@itemkind = itemkind
refresh
end
alias xrxs27wt_refresh refresh
def refresh
if @itemkind != 1 and @itemkind != 11
xrxs27wt_refresh
return
end
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
case @itemkind
when 1
set_own_weapon_data
when 11
set_own_throw_weapons_data
end
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i)
end
end
end
def set_own_weapon_data
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0
@data.push($data_weapons[i])
end
end
end
def set_own_throw_weapons_data
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0
if XRXS.element_include?($data_weapons[i].element_set, "WTP")
@data.push($data_weapons[i])
end
end
end
end
end
class Scene_Battle
alias xrxs27wt_update_phase3 update_phase3
def update_phase3
if @item_window_for_skill != nil and @item_window_for_skill.visible
update_phase3_item_window_weapons
return
end
xrxs27wt_update_phase3
end
def update_phase3_item_window_weapons
@item_window_for_skill.visible = true
@item_window_for_skill.update
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
end_item_select_from_skill
return
end
if Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
@item = @item_window_for_skill.item
@active_battler.current_action.basic = @item
@item_window_for_skill.visible = false
if @skill.scope == 1
start_enemy_select
elsif @skill.scope == 3 or @skill.scope == 5
start_actor_select
else
end_item_select_from_skill
phase3_next_actor
end
return
end
end
alias xrxs27wt_update_phase3_skill_select update_phase3_skill_select
def update_phase3_skill_select
if Input.trigger?(Input::C) and @active_battler.skill_can_use?(@skill_window.skill.id)
@skill = @skill_window.skill
returnar = XRXS.element_check(@skill.element_set, "WT")
if returnar[0]
if @skill == nil or
not @active_battler.skill_can_use?(@skill.id)
$game_system.se_play($data_system.buzzer_se)
return
end
itemkind_num = returnar[1].to_i
@item_window_for_skill = Window_Item.new
@item_window_for_skill.visible = false
@item_window_for_skill.set_itemkind(itemkind_num)
if @item_window_for_skill.data.size == 0
$game_system.se_play($data_system.buzzer_se)
@item_window_for_skill.dispose
@item_window_for_skill = nil
@help_window.visible = false
return
end
$game_system.se_play($data_system.decision_se)
@active_battler.current_action.skill_id = @skill.id
@item_window_for_skill.help_window = @help_window
start_item_select_from_skill
return
end
end
xrxs27wt_update_phase3_skill_select
end
def start_item_select_from_skill
@item_window_for_skill.visible = true
@skill_window.active = true
@skill_window.active = false
@skill_window.visible = false
end
def end_item_select_from_skill
@item_window_for_skill.dispose
@item_window_for_skill = nil
@help_window.visible = false
@skill_window.active = true
@skill_window.visible = true
end
alias xrxs27wt_update_phase4_step4 update_phase4_step4
def update_phase4_step4
if @skill != nil and XRXS.element_include?(@skill.element_set, "WT")
case @active_battler.current_action.basic
when RPG::Weapon
@animation2_id = @active_battler.current_action.basic.animation2_id
end
end
xrxs27wt_update_phase4_step4
end
end
avatar
roberto
Admin

Mensagens : 75
Pontos : 204
Reputação : 3
Data de inscrição : 03/03/2010

Ver perfil do usuário http://morpgmaker.mo-rpg.com

Voltar ao Topo Ir em baixo

Ver o tópico anterior Ver o tópico seguinte Voltar ao Topo


 
Permissão deste fórum:
Você não pode responder aos tópicos neste fórum