Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Closed TopicStart new topic
> Basic Attack Commont Event
DrDhoom
post May 23 2011, 08:46 PM
Post #1


Level 2
Group Icon

Group: Member
Posts: 29
Type: Scripter
RM Skill: Intermediate




Introduction

With this script, you can call commont event when executing basic attack like executing skill. Can be used for enemy too.

Script

CODE
#===============================================================================
#---------------------=• Basic Attack Common Event •=---------------------------
#---------------------------=• by: DrDhoom •=-----------------------------------
# Version: 1.0
# Date Published: 19 - 05 - 2011
# RPGMakerID Community
#-------------------------------------------------------------------------------
# Introduction:
# Call commont event when using basic attack
#-------------------------------------------------------------------------------
# How to use:
#  - Insert this script above Main
#===============================================================================
module Dhoom
  module CEW
    COMMON_WEAPON = [] #<--- Don't Delete this line

    #COMMON_WEAPON[Weapon ID] = Common Event ID
    COMMON_WEAPON[1] = 4
    COMMON_WEAPON[2] = 1
    COMMON_WEAPON[3] = 2

    ENEMY = [] #<--- Don't Delete this line

    #ENEMY[enemy id] = common event id
    ENEMY[1] = 1

    #ENE_ACTIVE = [enemy id]  : call commont event before attacking, if not include call after attacking
    ENE_ACTIVE = [1]

    #ACTIVE = [weapon id] : call commont event before attacking, if not include call after attacking
    ACTIVE = [1,2]
  end
end

class Game_Enemy
  def enemy?
    return true
  end
end

class Game_Actor
  def enemy?
    return false
  end
end

class Scene_Battle
  alias dhoom_basic_action make_basic_action_result
  def make_basic_action_result
    dhoom_basic_action
    if @active_battler.current_action.basic == 0
      if Dhoom::CEW::COMMON_WEAPON[@active_battler.weapon_id] != nil
        if Dhoom::CEW::ACTIVE.include?(@active_battler.weapon_id)
          common_event = $data_common_events[Dhoom::CEW::COMMON_WEAPON[@active_battler.weapon_id]]
          $game_system.battle_interpreter.setup(common_event.list, 0)
        else
          @common_event_id = Dhoom::CEW::COMMON_WEAPON[@active_battler.weapon_id]
        end
      elsif @active_battler.enemy? and Dhoom::CEW::ENEMY[@active_battler.id] != nil
        if Dhoom::CEW::ENE_ACTIVE.include?(@active_battler.id)
          common_event = $data_common_events[Dhoom::CEW::ENEMY[@active_battler.id]]
          $game_system.battle_interpreter.setup(common_event.list, 0)
        else
          @common_event_id = Dhoom::CEW::ENEMY[@active_battler.id]
        end
      end
    end
  end
end


__________________________
Need a Scripter? PM me!
Go to the top of the page
 
+Quote Post
   

Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 24th May 2013 - 02:41 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker