Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Problem with drain script form the ATOA ACBS
#1
Hello, dear forum. Im a user of the ATOA ACBS, which can be downloaded here. http://workupload.com/file/OOmU2prO. The script itself has many modifications from the the creaotr of this script which are under main, so they're uneffective until they are put above main. Well I wanted to use the drain scritpt and put it above main, but the scirpt didint do anything. I really believe, that it was coded wrong. In the script I posted, the skill 116 is meant to drain HP from the enemy, but when I use it, nothing happens. Can anyone help me by looking at the code and try it out himself? I posted this in several forums, but didint get any help...


Thanks in advance!


Code:
#==============================================================================
# Skill Drain
# By Atoa
#==============================================================================
# This script allow to create skills and equips that adds the effect 'drain'
# of HP and SP.
# That way attacks and skills can absorb part of the damage caused
#==============================================================================

module Atoa
 # Do not remove this line
 Drain_Action = {'Skill' => {}, 'Weapon' => {}, 'Item' => {}}
 # Do not remove this line

 # Drain_Action[action_type][id] = {drain_type => [success, rate, anim_id, pop, show_excedent],...}
 # action_type = action type
 #   action_type = 'Skill' for skills, 'Weapon' for weapons, 'Item' for items
 # id = ID of the skill/weapon/item
 # drain_type = drain type
 #   'hp' for HP drain, 'sp' for SP drain
 # success = absorb success rate
 # rate = % of damage converted in HP/SP
 # anim_id = ID of the animation shown when absorb HP/SP, leave nil or 0 for
 #   no animation
 #

 Drain_Action['Skill'][116] = {'hp' => [100, 50, nil, true, false],
                               'sp' =>[100, 50, 18, true, false]}

 Drain_Action['Weapon'][43] = {'hp' => [50, 50, nil, true, true]}


end

#==============================================================================
# ■ Atoa Module
#==============================================================================
$atoa_script = {} if $atoa_script.nil?
$atoa_script['Atoa Drain'] = true

#==============================================================================
# ■ Game_Battler
#------------------------------------------------------------------------------
# Esta classe gerencia os jogadores da batalha.
# Esta classe identifica os Aliados ou Heróis como (Game_Actor) e
# os Inimigos como (Game_Enemy).
#==============================================================================

class Game_Battler
 #--------------------------------------------------------------------------
 # Variáveis Públicas
 #--------------------------------------------------------------------------
 attr_accessor :base_absorb
 #--------------------------------------------------------------------------
 # Inicialização do Objeto
 #--------------------------------------------------------------------------
 alias initialize_drain initialize
 def initialize
   initialize_drain
   @base_absorb = 0
 end
end

#==============================================================================
# ■ Scene_Battle
#------------------------------------------------------------------------------
# Esta classe processa a tela de Batalha
#==============================================================================

class Scene_Battle
 #--------------------------------------------------------------------------
 # Atualização da fase 4 do personagem (parte 1)
 #     battler : Battler ativo
 #--------------------------------------------------------------------------
 alias step4_part1_drain step4_part1
 def step4_part1(battler)
   step4_part1_drain(battler)
   set_drain_damage(battler)
 end
 #--------------------------------------------------------------------------
 # Atualização da fase 4 do personagem (parte 3)
 #     battler : Battler ativo
 #--------------------------------------------------------------------------
 alias step4_part3_drain step4_part3
 def step4_part3(battler)
   step4_part3_drain(battler)
   action = battler.now_action
   if action != nil and Drain_Action[action.type_name] != nil and
      Drain_Action[action.type_name].include?(action_id(action))
     absorb_damage(battler, battler.base_absorb, Drain_Action[action.type_name][action_id(action)].dup)
   end
 end
 #--------------------------------------------------------------------------
 # Definir dano do dreno
 #     battler : Battler ativo
 #--------------------------------------------------------------------------
 def set_drain_damage(battler)
   battler.base_absorb = 0
   for target in battler.target_battlers
     battler.base_absorb += target.damage if target.damage.numeric?
   end
 end
 #--------------------------------------------------------------------------
 # Absover dano
 #     battler : Battler ativo
 #     absorb  : valor de absorção
 #     action  : Ação
 #--------------------------------------------------------------------------
 def absorb_damage(battler, absorb, action)
   for type in action.keys
     if type == 'hp' and (action[type][0] >= rand(100))
       base_absorb = ((absorb * action[type][1]) / 100).to_i
       if base_absorb > 0
         difference = battler.maxhp - battler.hp
         base_absorb = [base_absorb, difference].min
       elsif base_absorb < 0
         base_absorb = [base_absorb, - battler.hp].max
       end
       if base_absorb != 0
         battler.damage = - base_absorb
         battler.hp -= battler.damage
         battler.animation_id = action[type][2].nil? ? 0 : action[type][2]
         battler.damage_pop = action[type][3]
         wait(3) if battler.damage != 0
       end
     end
     if type == 'sp' and (action[type][0] >= rand(100))
       base_absorb = ((absorb * action[type][1]) / 100).to_i
       if base_absorb > 0
         difference = battler.maxsp - battler.sp
         base_absorb = [base_absorb, difference].min
       elsif base_absorb < 0
         base_absorb = [base_absorb, - battler.sp].max
       end
       if base_absorb != 0
         battler.damage = - base_absorb
         battler.sp -= battler.damage
         battler.animation_id = action[type][2].nil? ? 0 : action[type][2]
         battler.damage_pop = action[type][3]
         battler.sp_damage = action[type][3]
         wait(3) if battler.damage != 0
       end
     end
   end
 end
end
Reply }


Messages In This Thread
Problem with drain script form the ATOA ACBS - by Djigit - 07-12-2015, 02:58 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
   The z-space problem of displaying sprites icogil 28 7,485 03-05-2023, 03:31 AM
Last Post: DerVVulfman
   ACBS - Atoa Custom Battle System and TP System zlsl 2 3,737 10-20-2021, 05:09 AM
Last Post: zlsl
   Script compatibility help Lord Vectra 3 3,567 07-25-2021, 11:42 PM
Last Post: DerVVulfman
   Adding face script on Cogwheel's RTAB Battle Status rekkatsu 15 12,854 08-25-2020, 03:09 AM
Last Post: DerVVulfman
   "Wait" in the script Whisper 13 13,682 04-28-2020, 04:06 PM
Last Post: Whisper
   Skill Cooldown script Fenriswolf 11 14,093 12-10-2019, 11:10 AM
Last Post: Fenriswolf
   I want to add an Atoa Custom Battle System command cut-in. zlsl 11 11,843 11-11-2019, 08:55 PM
Last Post: DerVVulfman
   Question about ACBS (Atoa Custom Battle System) aeliath 10 10,876 08-08-2019, 02:50 PM
Last Post: aeliath
   Atoa Individual Battle Commands Geminil 3 6,164 08-02-2017, 03:17 AM
Last Post: DerVVulfman
   Help iwth script (RGSS Player crash) Whisper 3 6,529 06-17-2017, 05:03 PM
Last Post: Whisper



Users browsing this thread: