Sign in to follow this  
Followers 0
Dragon Call

Script para lanzar objetos en batalla

7 posts in this topic

Este script te permite lanzar objetos de tu inventario a los enemigos

Coloquen esto encima de main
[SPOILER]
CODE
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
[/SPOILER]

Instrucciones
-Crear un atributo llamado WT0 (para arrojar items)
-Crear un atributo llamado WT1 (para arrojar de armas)

-Calculo de dano
-Se calcula por el doble del valor del objeto
-Crear un atributo llamado WTP( agregarle el % deseado que se calculado por el valor del items)
- Ejemplo: WTP%500
0

Share this post


Link to post
Share on other sites
impresionado.gif impresionado.gif Un script bastante raro... pero puede ser curioso verlo en un juego.
0

Share this post


Link to post
Share on other sites
Hmm... Interesante para un Action RPG. Bastante bueno. icon13.gif
0

Share this post


Link to post
Share on other sites
Me parece que no te funcionará en un Action RPG... necesita la batalla completa.
0

Share this post


Link to post
Share on other sites
... Espera... ahhhh. Ahh ya ya. Ya entiendo. No recuerdo que juego tenia esta funcion pero es buena. O sea que se le puede tirar objetos al enemigo mientras se batalla... puede venir útil en cualquier momento.
0

Share this post


Link to post
Share on other sites
Uno de los juegos que tenía esta función era el Final Fantasy Tactics y el FFT Advance. En el FFX, Rikku lanzaba guiles, aunque después podían usarlo más personajes.
Y no está mal el script, no.
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0