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