Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - KK20

61
So Google searches proved to be of no help. I thought someone would have done this by now: allow the user to have more than 7 autotiles for their maps. I've been thinking it over, but couldn't come up with a great idea.

In my Advance Wars engine, I have a lot of tiles that need to animate. I still want to be able to access these tiles with tile_id. Also note that I would like this to be easily editted (I plan to release the engine for others to tweak and play with it).

My original idea was to create a graphic that contained all the animated tiles and their respective animating frames, then, when drawing the map, check each tile_id for a specific ID and draw the 32x32 graphic onto the Map's bitmap. Then, animate these graphics every 0.5 seconds (how would I even know what tiles need updating? Store the information into an array?). I thought about editting someone's Tilemap class and change how autotiles worked, but wasn't sure if something like this could be easily done that way.

Grateful for any ideas (or a script if you somehow found one).
62
Entertainment / Reading of Fifty Shades of Grey
September 17, 2012, 02:12:26 pm
NSFW or for younger audience.
Youtube Video Here

Couldn't stop laughing throughout the video.  :rofl:
63
RMXP Script Database / [XP] Organized Quest System
August 15, 2012, 02:04:59 pm
Organized Quest System
Authors: KK20
Version: 1.22
Type: Quest Log
Key Term: Misc System



Introduction

Partly influenced from Final Fantasy Tactics Advance's Quest System and Maplestory, this script is a complete quest system in itself. It organizes quests based on acceptance and completion and uses icons for the user interface.


Features


  • 4 tabs for organizing quests (All, New, Accepted, and Completed)

  • Somewhat unique user interface

  • Lots of customization

  • A quest information window that will display the location, NPC name, rewards, and description

  • Repeatable quests




Screenshots




Demo

Download


Script

If too lazy to check demo, place this script above Main and under Scene_Debug.
Spoiler: ShowHide

=begin
================================================================================
Organized Quest System                                         Version 1.22
Author: KK20                                                   [1/29/2018]
--------------------------------------------------------------------------------

  This script is a full-fledged quest system that uses pictures to represent the
  different types of quests in the User Interface.
 
  Includes:
    ~ Different page tabs to organize which quests to display (the four tabs
      used are 'All', 'New' (not accepted), 'Accepted', and 'Completed'), which
      can be accessed by pressing the 'Shift' key.
    ~ Player rank determined by number of quests completed
    ~ A window displaying the quest's information when selected
    ~ Repeatable quests
    ~ Some customizable features
--------------------------------------------------------------------------------
[[ Version History ]]
1.22[1/29/2018]
   - Fixed an error when changing quest tabs to an empty list, causing a
     "can't convert nil into Integer" error (seems to only occur in Ruby 1.9)
1.21[10/14/2015]
   - Fixed regular expression used in writing the quest description
1.2 [11/24/13]
   - Descriptions now use \n and \v[n] and no longer need to be spaced apart
   - Added new features:
     * Repeatable Quests
     * Can check quest's acceptance status more precisely
     * Rewards can have strings in them
1.1 [1/27/13]
   - Cleaned up code
   - Added new features:
     * Map background
     * More quest descriptions and use of game variables
   - Removed storing data into a Game System variable
1.0 [8/15/12]
   - Released script

********************************************************************************
*                         I N S T R U C T I O N S                              *
********************************************************************************
-----------------
-Getting Started-
-----------------
  To call the quest window, use the following in a script call:
> $scene = Scene_Quest.new
 
  To add quests that are available and can be accepted, use the script call:
> Quest.new(quest_id)
 
  To change the quest to being accepted, use the script call:
> Quest.accept(quest_id)
 
  To complete the quest, use the script call:
> Quest.complete(quest_id)
  (Doing this will automatically give the rewards to the player--This includes
  the items, EXP, and Gold. No need to event that in!
  If you still want to use events to reward, this can be configured below.)
 
  To make a quest repeatable, use the script call:
> Quest.repeat(quest_id)
  (In order for a quest to be repeated, the player must complete the quest
  at least once. Repeated quests are still considered completed quests,
  regardless if the player is accepting it or not.)
 
  ######[ NOTE ]################################################################
  A quest cannot be accepted if the quest is not currently available. A quest
  cannot be completed unless the quest is currently being accepted.
  Example: Quest.new(1)
           Quest.complete(1)
  Result: Quest 1 is still considered "new". The player has completed nothing.
  ##############################################################################
 
  For conditional branch needs:

  To check if the quest is repeatable, use the script call:
> Quest.repeat?(quest_id)
  Returns 'true' if the quest is repeatable, 'false' otherwise.
 
  To check if the quest is completed, use the script call:
> Quest.complete?(quest_id)
  Returns 'true' if the quest is completed or repeatable, 'false' otherwise.

  To check if the quest is currently being accepted, use the script call:
> Quest.accept?(quest_id)
  Returns 'true' if the quest is accepted, completed, or repeatable,
  'false' otherwise.
 
  To check if the quest can be accepted, use the script call:
> Quest.new?(quest_id)
  Returns 'true' if the quest is new, accepted, completed, or repeatable,
  'false' otherwise.
 
  ######[ NOTE ]################################################################
  In the last three commands (thus, excluding Quest.repeat?), you can put a
  second parameter to check if the quest is CURRENTLY new, accepted, or
  completed. All you have to put is true after your quest ID.
 
  Example: Quest.new?(1, true)
  Result: Returns true ONLY if the quest is considered new. If it has been
          accepted or completed, it will return false.
  ##############################################################################
 
  To check how many quests have been completed, use the script call:
> Quest.done
  This will return an integer. If you want to, for example, give a reward for
  completing 7 quests, use a 'Conditional Branch', select 'Script' and
  type in 'Quest.done >= 7' (without the quotes).

---------- 
-Controls-
----------
  Arrow keys to move the cursor around
  'C'/'Enter' to view the quest's information
  'X'/'Esc' to close the Scene_Quest
  'Shift' to change tabs (All -> New -> Accepted -> Completed -> All)
 
  When the quest's information window is being displayed:
  You can still use the Arrow keys to view different quests
  'C'/'Enter' and 'Shift' have no use.
  'X'/'Esc' to remove the quest's information window

----------
-Graphics-
----------
  This script uses images stored in 'Graphics/Pictures' to represent the quests.
  The script was written in support for 48 x 48 graphics. Your images must be
  of this size (no less, no bigger). To configure what graphics you wish to use,
  look below for the configuration.
 
---------------
-Configuration-
---------------
  Located below. All the instructions are there.

================================================================================
Credits:
KK20 -> Making this script
game_guy -> Used his 'Quest Log System' as a basis for this script
Blizzard -> Method to turn a long string into a paragraph
================================================================================
=end
module QuestData
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
#@             S T A R T          O F         C O N F I G U R A T I O N        @
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  #=============================================================================
  # NPCPicture - Set to 'true' if you want the NPC graphic to be displayed in
  #              the quest's information window. Set to 'false' if you don't
  #              want to.
  #
  # HideReward - Hides the rewards in the quest description until the player has
  #              completed that quest. Set the quest IDs in the array to use this
  #              feature. Delete the array and put 'true' to apply this to all
  #              quests. Create an empty array if you do not wish to use this
  #              feature. An empty array looks like this-->  []
  #
  # RewardOnComplete - Set to 'true' if you want the player to be rewarded at the
  #                    instance of 'Quest.complete(quest_id)'. 'false' otherwise.
  #
  # ShowMapBackGround - Sets the opacity of the windows to allow viewing of the
  #                     map. Set to 'true' if you want this option. 'false' otherwise.
  #
  # ExitScene - Set to the scene you wish to view upon exiting quest scene.
  #
  # PageTurnSound - Sound effect that plays when player shifts the quest page.
  #=============================================================================
  NPCPicture        = true
  HideReward        = [1, 5]
  RewardOnComplete  = true
  ShowMapBackGround = true
  ExitScene         = Scene_Menu.new(0)
  PageTurnSound     = RPG::AudioFile.new("005-System05", 80)
  #=============================================================================
  # EXPicon - The graphic used when the quest's information window is brought up.
  #           It represents EXP gained from the quest. Name it the same as it is
  #           found in 'Graphics/Icons'.
  #
  # GoldIcon - Same as above. Represents the gold gained from the quest.
  #
  # ** If you do not want graphics, simply use an empty string ---> ""
  #    If you do opt to not use icons, the text will fill in the words for you.
  #    These are ICONS, so the graphics must be 24 x 24.
  #=============================================================================
  EXPicon   = "exp"
  GoldIcon  = "gold"
  #=============================================================================
  # NewQuestPic - The picture you want to represent a quest that hasn't been
  #               accepted. Name it the same as it is in 'Graphics/Pictures'.
  #
  # AcceptedQuestPic - Same as above. Represents a quest that has been accepted.
  #
  # CompletedQuestPic - Same as above. Represents a quest that is complete.
  #
  # RepeatQuestPic - Same as above. Represents a repeatable quest.
  #
  #             Remember: Graphics must be of size 48 x 48.
  #=============================================================================
  NewQuestPic = "quest_new"
  AcceptedQuestPic = "quest_accepted"
  CompletedQuestPic = "quest_complete"
  RepeatQuestPic = "quest_repeat"
 
  def self.name(id)
    case id
    #===========================================================================
    # Quest Name - The name of the quest.
    # Configure:
    #     when x then return "name"
    # x = Quest ID
    # name = Quest name. Use "quotes".
    #===========================================================================
    when 1 then return "Red Chest of Wonders"
    when 2 then return "Spectral Hunter"
    when 3 then return "Forever New"
    when 4 then return "Dead Weight"
    when 5 then return "Stoney Blight"
    end
    return ""
  end
 
  def self.new_description(id)
    case id
    #===========================================================================
    # New Quest Description - Paragraph of the quest's description. This is for
    #   when the quest is new for the player to accept. If the description
    #   is really lengthy, the program will adjust the text into paragraph format.
    #
    #   You may use '\n' to create a new line (e.g. "Hello World!\nYou Rock!").
    #   You may also use '\v[id]' to show a variable in the description. Thus,
    #   doing something like "Found \v[3] out of \v[4]" will replace the
    #   instances with the game variables 3 and 4.
    #
    #   Any quests that are not configured will result in using the message
    #   located between the [] brackets. This text will be centered in the window.
    #   Do note you cannot use \n or \v to format this text.
    #
    # Configure:
    #     when x then return "description"
    # x = Quest ID
    # description = Quest's description. Use "quotes". Can be quite lengthy.
    #===========================================================================
    when 1 then return "I just magically spawned on this weird island and this guy is waving at me. There's some red chest sitting next to him. I guess I should say hello..."
    when 2 then return "Justin has been shifting his eyes frantically. There must be something troubling him."
    when 4 then return "This strong-looking man is grinning a bit too much. Actually...he looks weird. I hope he doesn't--\n\nCrap, he's looking at me."
    when 5 then return "*huff* Why...was I so foolish enough...to carry that many rocks?\nWHAT WAS THE POINT?"
    end
    return ["?   ?   ?"]
  end
 
  def self.accepted_description(id)
    case id
    #===========================================================================
    # Accepted Quest Description - Paragraph of the quest's description. If the
    #   description is really lengthy, the program will adjust the text into
    #   paragraph format.
    #
    #   You may use '\n' to create a new line (e.g. "Hello World!\nYou Rock!").
    #   You may also use '\v[id]' to show a variable in the description. Thus,
    #   doing something like "Found \v[3] out of \v[4]" will replace the
    #   instances with the game variables 3 and 4.
    #
    # Configure:
    #     when x then return "description"
    # x = Quest ID
    # description = Quest's description. Use "quotes". Can be quite lengthy.
    #===========================================================================
    when 1 then return "A guy named Justin wanted us to find a key to open up the red chest he recently found. He isn't sure where this key could be, but I have a strange hunch that it can't be too hard to find. \n \n Let's try checking an obvious place."
    when 2 then return "Justin is quite scared of all the ghosts around the area. To make him feel better, we should probably kill a few for him. I think 5 should be good enough. \n \n Killed: \v[1]/5"
    when 3 then return "Um, there's no way you can be viewing this description right now. You modded the demo!"
    when 4 then return "Strong guy here wants us to find a rock for him.\nTo smash.\nI...\n...why?!"
    when 5 then return "\v[3]"
    end
    return ""
  end
 
  def self.completed_description(id)
    case id
    #===========================================================================
    # New Quest Description - Paragraph of the quest's description. This is for
    #   when the quest has been completed by the player. If the description
    #   is really lengthy, the program will adjust the text into paragraph format.
    #
    #   You may use '\n' to create a new line (e.g. "Hello World!\nYou Rock!").
    #   You may also use '\v[id]' to show a variable in the description. Thus,
    #   doing something like "Found \v[3] out of \v[4]" will replace the
    #   instances with the game variables 3 and 4.
    #
    #   Any quests that are not configured will result in using the accepted
    #   quest description (the ones you wrote above).
    #
    # Configure:
    #     when x then return "description"
    # x = Quest ID
    # description = Quest's description. Use "quotes". Can be quite lengthy.
    #===========================================================================
    when 2 then return "I killed 5 ghosts for Justin. He looks much happier now that there's nothing to scare him anymore. \n \n But now he's just standing there, being a 'useless' NPC. \n What's an NPC anyways?"
    when 4 then return "Okay, I was actually stupid enough to bring him back a rock to smash. I don't see the point in all of this.\n\nRocks Smashed: \v[2]"
    when 5 then return "Well, that settles that. Glad I got something out of all of this.\n\nBut that's the last time I ever help a pompous braggart."
    end
    return nil
  end
 
  def self.location(id)
    case id
    #===========================================================================
    # Quest Location - Place where the player received the quest.
    # Configure:
    #     when x then return "location"
    # x = Quest ID
    # location = Map's name. Use "quotes".
    #===========================================================================
    when 1..5 then return "Mystery Isle"
    when 6 then return "Traudsbogen"
    end
    return "?????"
  end
 
  def self.NPC(id)
    case id
    #===========================================================================
    # Quest NPC - The NPC that the player got the quest from. This can be
    #   displayed in both "string" and/or "picture" format. If using the picture
    #   format (NPCPicture = true), you must name the NPC the same as the
    #   image stored in the 'Graphics/Characters' folder. Otherwise, an error
    #   will occur while running the game.
    # Configure:
    #     when x then return "NPC"
    # x = Quest ID
    # NPC = Name of the NPC as well as the name of the NPC graphic
    #===========================================================================
    when 1..2 then return "Justin"    # Even though these character graphics are
    when 3 then return "Some Woman"   # part of the RTP, you still need to copy
    when 4..5 then return "Stonemason"# and rename the graphics and put them in
    end                               # your Graphics/Characters folder
    return nil
  end
 
  def self.exp(id)
    case id
    #===========================================================================
    # Quest Experience - The amount of EXP given for completing the quest.
    # Configure:
    #     when x then return EXP
    # x = Quest ID
    # EXP = Amount of experience (Player EXP)
    #===========================================================================
    when 1 then return 5
    when 2 then return 50
    when 3 then return 69
    end
    return 0
  end
 
  def self.gold(id)
    case id
    #===========================================================================
    # Quest Gold - The amount of gold given (or lost) for completing the quest.
    # Configure:
    #     when x then return Gold
    # x = Quest ID
    # Gold = Amount of gold given/taken. Use a '-' for lost gold (e.g. -500)
    #===========================================================================
    when 1 then return 20
    when 2 then return 300
    when 3 then return 9001
    end
    return 0
  end
 
  def self.reward(id)
    case id
    #===========================================================================
    # Quest Reward - The items given for completing the quest. The amount of
    #   different items that can be earned should not be more than 5.
    #
    #   You can also put in string values to represent a unique kind of reward.
    #   If RewardOnComplete is true, the game will ignore rewarding string-
    #   based values.
    #
    # Configure:
    #     when x then return [[item_type, item_id, amount], ...] (max size of 5)
    # x = Quest ID
    # item_type = Type of item. Refer below:
    #             1 = Normal Items (potions, key items, medicine, etc.)
    #             2 = Weapon
    #             3 = Armor
    # item_id = Item's ID located in the database
    # amount = Number of items given for completion
    #
    #   For inputing string values, you can copy one of these examples:
    #     when x then return ["String"]
    #     when x then return [[1,2,3], "Your Message"]
    #     when x then return ["You got", [1,1,1], "Nice potion!"]
    #===========================================================================
    when 1 then return [[1,2,5], "New Quest: Spectral Hunter"] #5 High Potions
    when 2 then return [[2,3,1]] #1 Steel Sword
    when 3 then return ["This is", "how you", "skip lines", "", "See?"]
    when 5 then return [[3,25,1]] #1 Ring of Strength
    end
    return nil
  end
 
  def self.rank(value)
    return ''
    case value
    #===========================================================================
    # Quest Rank - The player's rank in terms of completed quests.
    #     Of course, if you do not wish to use this, simply delete the 'when's
    #     and the 'end' directly after, leaving only the 'return' left. Then,
    #     put an empty string after the return like this -->  return ""
    # Configure:
    #     when x then return "rank"
    # x = The number of completed quests. Use (x..y) for all values in between
    #     x and y (for example, (3..6) applies for IDs 3, 4, 5, and 6
    # rank = The rank of the party. Use "quotes".
    #===========================================================================
    when 1 then return "Neophyte"
    when 2..5 then return "Amateur"
    end
    return "Beginner"
  end # <-- Don't delete this 'end' !
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
#@             E N D          O F         C O N F I G U R A T I O N            @
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
end

#===============================================================================
module Quest
  #Adds the quest under "New", meaning the player has yet to accept it
  def self.new(id)
    $game_party.add_newquest(id)
  end
  #Adds the quest under "Accepted", meaning the player is doing the quest
  def self.accept(id)
    $game_party.accept_quest(id)
  end
  #Adds the quest under "Completed", meaning the quest is finished. Gives reward.
  def self.complete(id)
    $game_party.complete(id)
  end
  #Adds the quest under "New" and "Completed", meaning the quest can be redone
  def self.repeat(id)
    $game_party.repeat(id)
  end
  #Checks if the quest is repeatable
  def self.repeat?(id)
    return $game_party.repeating?(id)
  end
  #Checks if the quest is completed
  def self.complete?(id, only=false)
    return $game_party.completed?(id, only)
  end
  #Checks if the quest is accepted
  def self.accept?(id, only=false)
    return $game_party.has_quest?(id, only)
  end
  #Checks if the quest is unaccepted
  def self.new?(id, only=false)
    return $game_party.has_available?(id, only)
  end
  #Returns quests completed
  def self.done
    return ($game_party.quests_completed.dup | $game_party.quests_repeating).size
  end
 
end
#===============================================================================
# Game_Party Class
#   : Adds the quest data
#===============================================================================
class Game_Party
 
  attr_accessor :quests_new
  attr_accessor :quests_accepted
  attr_accessor :quests_completed
  attr_accessor :quests_repeating
 
  alias kk20_initialize_again initialize
  def initialize
    kk20_initialize_again
    @quests_new = []
    @quests_accepted = []
    @quests_completed = []
    @quests_repeating = []
  end
 
  def add_newquest(id)
    unless has_available?(id)
      @quests_new.push(id)
    end
  end
 
  def accept_quest(id)
    if !@quests_accepted.include?(id) and @quests_new.include?(id)
      @quests_new.delete(id)
      @quests_accepted.push(id)
    end
  end
 
  def complete(id)
    if !completed?(id, true) and @quests_accepted.include?(id)
      @quests_accepted.delete(id)
      @quests_repeating.delete(id)
      @quests_completed.push(id)
      if QuestData::RewardOnComplete
        $game_party.gain_gold(QuestData.gold(id))
        $game_party.actors.each{|actor|
          unless actor.cant_get_exp?
            actor.exp += QuestData.exp(id)
          end
        }
        rewards = QuestData.reward(id)
        return if rewards.nil?
        #~~begin loop~~
        rewards.each{|reward|
          next if reward.is_a?(String)
          case reward[0]
          when 1 then $game_party.gain_item(reward[1], reward[2])
          when 2 then $game_party.gain_weapon(reward[1], reward[2])
          when 3 then $game_party.gain_armor(reward[1], reward[2])
          end
        }
        #~~end loop~~
      end
    end
  end
 
  def repeat(id)
    if completed?(id, true)
      @quests_completed.delete(id)
      @quests_repeating.push(id)
      @quests_new.push(id)
    end
  end
 
  def repeating?(id)
    return @quests_repeating.include?(id)
  end
 
  def completed?(id, only=false)
    if only
      return @quests_completed.include?(id)
    else
      return (@quests_completed.include?(id) or @quests_repeating.include?(id))
    end
  end
 
  def has_quest?(id, only=false)
    if only
      return @quests_accepted.include?(id)
    else
      return (@quests_accepted.include?(id) or @quests_completed.include?(id) or
              @quests_repeating.include?(id))
    end
  end
 
  def has_available?(id, only=false)
    if only
      return @quests_new.include?(id)
    else
      return (@quests_new.include?(id) or @quests_accepted.include?(id) or
              @quests_completed.include?(id) or @quests_repeating.include?(id))
    end
  end
 
end
#===============================================================================
# Window_Base Class
#   : Modified method provided by Blizzard
#===============================================================================
class Window_Base < Window
 
  def draw_even_text(x, y, width, height, text, align = 0)
    # Replace all instances of \v[n] to the game variable's value
    text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
    text.gsub!(/[\V\v]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
    # Break up the text into lines
    if text["\n"] != nil
      lines = text.split("\n")
    else
      lines = text.split("\\n")
    end
    result = []
    # For each line generated from \n
    lines.each{|text_line|
      # Divide text into each individual word
      words = text_line.split(' ')
      current_text = words.shift
      # If there were less than two words in that line, just push the text
      if words.empty?
        result.push(current_text == nil ? "" : current_text)
        next
      end
      # Evaluate each word and determine when text overflows to a new line
      words.each_index {|i|
        if self.contents.text_size("#{current_text} #{words[i]}").width > width
          result.push(current_text)
          current_text = words[i]
        else
          current_text = "#{current_text} #{words[i]}"
        end
        result.push(current_text) if i >= words.size - 1
      }
    }
    # Draw results to the window
    result.each_index {|i|
        self.contents.draw_text(x, y + i*height, width, height, result[i], align)}
  end
     
end
#*******************************************************************************
#===============================================================================
# Window for displaying the party's rank and number of new/available/completed quests
#===============================================================================
class Window_QuestRank < Window_Base
 
  def initialize
    super (0, 0, 640, 64)
    self.contents = Bitmap.new(width-32, height-32)
    refresh
  end
 
  def refresh
    self.contents.clear
    quest_rank = QuestData.rank($game_party.quests_completed.size)
    self.contents.draw_text(0, 0, 640, 32, "#{quest_rank}")
   
    new = sprintf("%5s", $game_party.quests_new.size.to_s)
    accepted = sprintf("%5s", $game_party.quests_accepted.size.to_s)
    completed = sprintf("%5s", ($game_party.quests_completed.dup | $game_party.quests_repeating).size.to_s)
    self.contents.draw_text(0, 0, 608, 32, "New:#{new}    " +
      "Accepted:#{accepted}    Completed:#{completed}", 2)
  end
end
#===============================================================================
# Window for displaying the quest's ID and title
#===============================================================================
class Window_QuestTitle < Window_Base
 
  #Type determines what window to view (0 = All, 1 = New, 2 = Accepted, 3 = Complete)
  def initialize(type=0)
    super (0, 64, 640, 64)
    self.contents = Bitmap.new(width-32,height-32)
    @quest_num = 0
    @quest_title = ""
    @type = type
    refresh
  end
 
  #Updates the quest /value/'s ID and name
  alias kk20_update_quest update
  def update(value)
    kk20_update_quest
    return if @quest_num == value
    @quest_num = value
    @quest_title = QuestData.name(value)
    refresh
  end
 
  #Method is called when user shifts the quest tab
  def next_page
    @type = (@type + 1) % 4
    refresh
  end
 
  def refresh
    self.contents.clear
    quest_tab = ""
    case @type
    when 0 then quest_tab = "ALL"
    when 1 then quest_tab = "NEW"
    when 2 then quest_tab = "ACCEPTED"
    when 3 then quest_tab = "COMPLETED"
    end
    if @quest_num != 0 and @quest_num != nil
      quest_number = sprintf("%03d", @quest_num)
      self.contents.draw_text(0, 0, 640, 32, "No. #{quest_number}")
    else
      self.contents.draw_text(0, 0, 640, 32, "There are no quests here.")
    end
    self.contents.draw_text(80, 0, 640, 32, "#{@quest_title}")
    self.contents.draw_text(0, 0, 600, 32, "<#{quest_tab}>", 2)
  end
end
#===============================================================================
# Window for displaying all the quests as pictures
#===============================================================================
class Window_QuestList < Window_Selectable
 
  #Type determines what window to view (0 = All, 1 = New, 2 = Accepted, 3 = Complete)
  def initialize(type=0)
    super (0, 128, 640, 352)
    @column_max = 5
    @type = type
    refresh
    self.index = 0
  end
 
  #For information window
  def quest
    return @data[self.index]
  end
 
  #When the player shifts to next page. Also places cursor to new index if nil.
  def next_page
    @type = (@type + 1) % 4
    refresh
    if (@data[self.index].nil?)
      self.index = [@data.size-1, 0].max
    end
  end
 
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end   
    @data = []
    if [0,1].include?(@type)
      for i in 0...$game_party.quests_new.size
        @data.push($game_party.quests_new[i])
      end
    end
    if [0,2].include?(@type)
      for i in 0...$game_party.quests_accepted.size
        @data.push($game_party.quests_accepted[i])
      end
    end
    if [0,3].include?(@type)
      total = $game_party.quests_completed.dup | $game_party.quests_repeating
      for i in 0...total.size
        @data.push(total[i]) unless @data.include?(total[i])
      end
    end
    @data.sort! if @data.size > 1
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 64, row_max * 64)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end

  def draw_item(index)
    quest_number = @data[index]
    if $game_party.quests_repeating.include?(quest_number)
      bitmap = RPG::Cache.picture(QuestData::RepeatQuestPic)
    elsif $game_party.quests_new.include?(quest_number)
      bitmap = RPG::Cache.picture(QuestData::NewQuestPic)
    elsif $game_party.quests_accepted.include?(quest_number)
      bitmap = RPG::Cache.picture(QuestData::AcceptedQuestPic)
    elsif $game_party.quests_completed.include?(quest_number)
      bitmap = RPG::Cache.picture(QuestData::CompletedQuestPic)
    end
    x = 8 + index % @column_max * (self.width / @column_max)
    y = 8 + index / @column_max * 64
    self.contents.blt(x, y, bitmap, Rect.new(0, 0, 48, 48), 255)
  end
          #####################################################
          # Modified methods to allow 64x64 selection windows #
          #####################################################
  def page_row_max
    return (self.height) / 64
  end
 
  def top_row
    return self.oy / 64
  end

  def top_row=(row)
    if row < 0
      row = 0
    end
    if row > row_max - 1
      row = row_max - 1
    end
    self.oy = row * 64
  end
 
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
      return
    end
    row = @index / @column_max
    if row < self.top_row
      self.top_row = row
    end
    if row > self.top_row + (self.page_row_max - 1)
      self.top_row = row - (self.page_row_max - 1)
    end
    # Calculate cursor coordinates
    x = @index % @column_max * (640 / @column_max)
    y = @index / @column_max * 64 - self.oy
    # Update cursor rectangle
    self.cursor_rect.set(x, y, 64, 64)
  end
end
#===============================================================================
# Window to display quest's information
#===============================================================================
class Window_QuestInfo < Window_Base
 
  def initialize(quest_id)
    super (0, 0, 640, 480)
    self.z = 1000
    self.contents = Bitmap.new(width-32,height-32)
    @quest = quest_id
    refresh
  end
 
  def update_quest(quest_id)
    if @quest != quest_id
      @quest = quest_id
      refresh
    end
  end
 
  def refresh
    # Titles of important text------------------------------
    self.contents.clear
    quest_number = sprintf("%03d", @quest)
    self.contents.font.color = system_color
    self.contents.draw_text(0, 0, 640, 32, "No. #{quest_number}")
    self.contents.draw_text(80, 0, 640, 32, QuestData.name(@quest))
    # If quest is completed OR quest is repeatable but not currently accepted
    if Quest.repeat?(@quest) && Quest.accept?(@quest, true)
      self.contents.font.color = Color.new(0, 230, 255)
      self.contents.draw_text(0, 0, 600, 32, "-REPEATING-", 2)
      self.contents.font.color = system_color
    elsif Quest.complete?(@quest, true) || (Quest.repeat?(@quest) && !Quest.accept?(@quest, true))
      self.contents.font.color = Color.new(233, 188, 10)
      self.contents.draw_text(0, 0, 600, 32, "-COMPLETED-", 2)
      self.contents.font.color = system_color
    end
    self.contents.draw_text(0, 200, 280, 32, "Requester:")
    self.contents.draw_text(0, 360, 280, 32, "Location:")
    self.contents.draw_text(320, 200, 280, 32, "Reward(s):")
    # Description------------------------------
    self.contents.font.color = normal_color
    self.contents.fill_rect(0, 40, 640, 5, Color.new(24,184,231,128))
    self.contents.font.size = 18
    if Quest.complete?(@quest, true) || (Quest.repeat?(@quest) && !Quest.accept?(@quest, true))
      unless QuestData.completed_description(@quest).nil?
        draw_even_text(0, 58, 640-32, 18, QuestData.completed_description(@quest))
      else
        draw_even_text(0, 58, 640-32, 18, QuestData.accepted_description(@quest))
      end
    elsif Quest.accept?(@quest)
      draw_even_text(0, 58, 640-32, 18, QuestData.accepted_description(@quest))
    else
      unless QuestData.new_description(@quest).is_a?(Array)
        draw_even_text(0, 58, 640-32, 18, QuestData.new_description(@quest))
      else
        self.contents.draw_text(0, 103, 640-32, 18, QuestData.new_description(@quest)[0], 1)
      end
    end
    self.contents.fill_rect(0, 180, 640, 5, Color.new(24,184,231,128))
    self.contents.fill_rect(300, 180, 5, 320, Color.new(24,184,231,128))
    # NPC and Location------------------------------
    self.contents.font.size = Font.default_size
    if QuestData::NPCPicture and QuestData.NPC(@quest) != nil
      bitmap = RPG::Cache.character(QuestData.NPC(@quest), 0)
      h = bitmap.height/4
      w = bitmap.width/4
      self.contents.blt(0, 240, bitmap, Rect.new(0, 0, w, h))
      self.contents.draw_text(w+20, h+240, 280, 32, QuestData.NPC(@quest))
    else
      if QuestData.NPC(@quest) != nil
        self.contents.draw_text(20, 240, 280, 32, QuestData.NPC(@quest))
      end
    end
    self.contents.draw_text(20, 400, 280, 32, QuestData.location(@quest))
    # Rewards------------------------------
    if !((QuestData::HideReward == true or QuestData::HideReward.include?(@quest)) and !Quest.complete?(@quest))
      y = 225
      exp_string = ""
      if QuestData.exp(@quest) != 0
        if QuestData::EXPicon != nil and QuestData::EXPicon != ""
          bitmap = RPG::Cache.icon(QuestData::EXPicon)
          self.contents.blt(340, y, bitmap, Rect.new(0, 0, 32, 32))
        else
          exp_string = "EXP"
        end
        self.contents.draw_text(370, y, 280, 32, QuestData.exp(@quest).to_s + " " + exp_string)
        y += 24
      end
      gold_string = ""
      if QuestData.gold(@quest) != 0
        if QuestData::GoldIcon != nil and QuestData::GoldIcon != ""
          bitmap = RPG::Cache.icon(QuestData::GoldIcon)
          self.contents.blt(340, y, bitmap, Rect.new(0, 0, 32, 32))
        else
          gold_string = $data_system.words.gold
        end
        self.contents.draw_text(370, y, 280, 32, QuestData.gold(@quest).to_s + " " + gold_string)
        y += 32
      end
      if QuestData.reward(@quest) != nil
        #~~being loop~~
        QuestData.reward(@quest).each_index{|i|
        item = QuestData.reward(@quest)[i]
        # If string value
        if item.is_a?(String)
          self.contents.draw_text(370, y, 280, 32, item)
          y += 32
          next
        end
        # An actual item
        case item[0]
        when 1
          bitmap = RPG::Cache.icon($data_items[item[1]].icon_name)
          self.contents.draw_text(370, y, 280, 32, $data_items[item[1]].name + " x " + item[2].to_s)
        when 2
          bitmap = RPG::Cache.icon($data_weapons[item[1]].icon_name)
          self.contents.draw_text(370, y, 280, 32, $data_weapons[item[1]].name + " x " + item[2].to_s)
        when 3
          bitmap = RPG::Cache.icon($data_armors[item[1]].icon_name)
          self.contents.draw_text(370, y, 280, 32, $data_armors[item[1]].name + " x " + item[2].to_s)
        end
        self.contents.blt(340, y, bitmap, Rect.new(0, 0, 32, 32))
        y += 32
        }
        #~~end loop~~
      end
      if QuestData.exp(@quest) == 0 and QuestData.gold(@quest) == 0 and QuestData.reward(@quest) == nil
        self.contents.draw_text(370, 225, 280, 32, "None")
      end
    else #If Quest Reward is hidden
      self.contents.draw_text(370, 225, 280, 32, "Unknown")
    end
  end
 
end
#\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
# The actual quest scene
#\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
class Scene_Quest

  def main
    #Creates the windows
    @quests_rank = Window_QuestRank.new
    @quests_title = Window_QuestTitle.new(0)
    @quests_list = Window_QuestList.new(0)
    @quest_info = Window_QuestInfo.new(@quests_list.quest)
    @quest_info.visible = false
    @quests_title.update(@quests_list.quest)
    if QuestData::ShowMapBackGround
      @map = Spriteset_Map.new
      [@quests_rank,@quests_title,@quests_list,@quest_info].each{|win| win.back_opacity = 128}
    end
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @map.dispose unless @map.nil?
    @quests_rank.dispose
    @quests_title.dispose
    @quests_list.dispose
  end
  #------------------------------------------------------------
  def update
    @map.update unless @map.nil?
    @quests_title.update(@quests_list.quest)
    @quests_list.update
    @quest_info.update_quest(@quests_list.quest) unless !@quest_info.visible
    update_controls
  end
  #------------------------------------------------------------
  def update_controls
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      # If quest information is not displayed, exit scene
      if !@quest_info.visible
        $scene = QuestData::ExitScene
      else #If quest info is displayed, return to quest list
        @quest_info.visible = false
        [@quests_title,@quests_list,@quests_rank].each{|win| win.visible = true}
      end
    elsif Input.trigger?(Input::C)
      #Works only if quest info isn't displayed
      if !@quest_info.visible and !@quests_list.quest.nil?
        $game_system.se_play($data_system.decision_se)
        @quest_info.update_quest(@quests_list.quest)
        @quest_info.visible = true
        [@quests_title,@quests_list,@quests_rank].each{|win| win.visible = false}
      end
    elsif Input.trigger?(Input::SHIFT) and !@quest_info.visible
      $game_system.se_play(QuestData::PageTurnSound)
      @quests_title.next_page
      @quests_list.next_page
    end
  end
 
end

If you want save files to work, add this to the end of this script:
Spoiler: ShowHide

# NOTE: this assumes default RMXP Scene_File/Save/Load classes are used.
# Modified/custom versions of these classes may not work with script below.
class Scene_Load < Scene_File
  alias load_kk20_quest_variables read_save_data
  def read_save_data(file)
    load_kk20_quest_variables(file)
    $game_party.quests_new ||= []
    $game_party.quests_accepted ||= []
    $game_party.quests_completed ||= []
    $game_party.quests_repeating ||= []
  end
end

For RMX-OS, add this bit of code at the end of this script:
Spoiler: ShowHide

if !defined?(RMXOS) || RMXOS::VERSION < 1.09
  raise 'ERROR: The "Organized Quest System" requires RMX-OS 1.09 or higher.'
end
module RMXOS
  module Options
    SAVE_DATA[Game_Party].push('@quests_new')
    SAVE_DATA[Game_Party].push('@quests_accepted')
    SAVE_DATA[Game_Party].push('@quests_completed')
    SAVE_DATA[Game_Party].push('@quests_repeating')
  end
end



Instructions

Should all be there in the script, right near the beginning of it.


Compatibility

Aliased Game_Party methods, but I think there shouldn't be any incompatibility problems. Obviously won't work with another quest system.


Credits and Thanks


  • KK20 - For making the script

  • game_guy - For using his 'Quest Log' script as a template

  • Blizzard - For the slice_text method




Author's Notes

This was my first-ever script, back before I even joined Chaos Project and back when I was still learning the basics of RGSS. This script is a bit messy as a result. I am willing to make improvements if necessary.
64
Skill Damage Over Time for Blizz-ABS
Authors: KK20
Version: 1.02
Type: DoT Damage Modification
Key Term: Blizz-ABS Plugin



Introduction

States that applied damage over time (DoT) always dealt damage that was equal to some percentage amount of the player's HP. In Blizz ABS, any state that had 'slip damage' checked as true would always do damage equal to 2% of the battler's max HP every second (40 frames).
 
This script modifies that and allows some customizable DoT amounts. States with 'slip damage' will now be associated with a skill. In other words, every time DoT takes place, the affected battler will now take damage as if it was attacked by a skill. Essentially, you can make a DoT state called "Burn" and assign it to the skill "Fire". Instead of the battler taking 2% of max HP damage, it will now take damage as if it were being hit by "Fire".
 
Also, you can assign how many times DoT will take place during the duration of the state. No longer will DoT have to take place every second of gameplay. You can make DoT take place once every 3 seconds, only once in 20 seconds, or even 3 times every second.


Features


  • Damage over time can be represented with skill damage rather than being a set number.

  • Damage can take place a number of ticks during its duration rather than every second.

  • Because damage over time is a skill, damage is based on the battler's stats (if configured in the database as such). As the battler gets stronger, so does the damage over time.

  • Retains Blizz-ABS original damage over time method.



Screenshots

None.


Demo

Download


Script

Below the Blizz-ABS scripts (and above Main of course)
Spoiler: ShowHide

=begin
===============================================================================
Skill Damage Over Time (Blizz ABS add-on)                             Ver. 1.02
- By KK20                                                             [8/12/12]
===============================================================================
                                  [Change Log]
Version
  1.02 :
    <> If the battler increased or decreased its stats after applying a DoT
       state, the DoT damage was adjusted to this change. This has been fixed
  1.01 :
    <> If DoT state was applied through an event, Nil Error was thrown
    <> Added the option to make DoT damage pop up
===============================================================================

[Description]
  States that applied damage over time (DoT) always dealt damage that was equal
  to some percentage amount of the player's HP. In Blizz ABS, any state that had
  'slip damage' checked as true would always do damage equal to 2% of the
  battler's max HP every second (40 frames).
 
  This script modifies that and allows some customizable DoT amounts. States
  with 'slip damage' will now be associated with a skill. In other words, every
  time DoT takes place, the affected battler will now take damage as if it was
  attacked by a skill. Essentially, you can make a DoT state called "Burn" and
  assign it to the skill "Fire". Instead of the battler taking 2% of max HP
  damage, it will now take damage as if it were being hit by "Fire".
 
  Also, you can assign how many times DoT will take place during the duration of
  the state. No longer will DoT have to take place every second of gameplay. You
  can make DoT take place once every 3 seconds, only once in 20 seconds, or even
  3 times every second.
 
 
[Features]
  - Assign skills to states that deal DoT
  - Customize how many times DoT takes place
  - Maintains Blizz ABS's original slip_damage_effect, just in case you want to
    use the original "2% of max HP damage every second" somewhere
  - Can display DoT damage as pop up damage
   
 
[Instructions]
  > In order for skills to deal damage over time, check the box "Slip Damage"
 
  > If you want the state to wear off after so many seconds, check the box
    "Release at the end of battle".
    If you want the state to remain forever until it is cured, don't check it.
   
  > How frequent DoT takes place is based on the following formula:
        FREQUENCY = TURNS / TICKS
    where TURNS is the value you put in "After [ x ] turns" in the database
    and   TICKS is the number of times you want DoT to take place (config below)

===============================================================================
[Credits]
  KK20 : Writing the script
  sasofrass : For requesting
===============================================================================
=end

#~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
# B E G I N     C O N F I G U R A T I O N
#~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
module Skills_DoT
 
  #-----------------------------------------------------------------------------
  # DISPLAY_DOT_DAMAGE - Set to true if you want the damage values to pop up
  #                      during battle when affected by a DoT state.
  #-----------------------------------------------------------------------------
  DISPLAY_DOT_DAMAGE = true
 
  def self.dot_states(state_id)
    return nil unless $data_states[state_id].slip_damage
    case state_id
    #--------------------------------------------------------------------------
    # self.dot_states(state_id)
    #   Configure what skill you would like to associate to the DoT state here.
    #   Also, configure how frequent the DoT takes place during the duration of
    #   the state.
    # Format:
    #     When STATE_ID then return [SKILL_ID, TICKS]
    #     
    #   STATE_ID: The state's ID value located within the database
    #   SKILL_ID: The skill's ID value located within the database
    #   TICKS   : The number of times DoT will take place
    #--------------------------------------------------------------------------
    when 3 then return [7, 5] # when Venom, then use skill 'Fire' 5 times
    when 8 then return [13, 1] # when Paralyzed, then use skill 'Thunder' 1 time
    else
      return nil
    end
  end

end
#~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
# E N D     C O N F I G U R A T I O N
#~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*

#=============================================================================
# Map_Battler < Game_Character                                (Blizz ABS class)
#   Aliased:
#     slip_damage_effect
#   Rewrite:
#     count_states
#     additional_states
#=============================================================================
class Map_Battler < Game_Character
  #----------------------------------------------------------------------------
  # count_states
  #  Changes the state time counters.
  #----------------------------------------------------------------------------
  def count_states
    # check each state
    battler.state_time.each_key {|id|
        # decrease counter if fading state
        battler.state_time[id] -= 1
        # if 1 second has passed and probability that the state gets removed
        ### ADDED '$data_states[id].battle_only' CONDITION ###
        if $data_states[id].battle_only && battler.state_time[id] <= 0 &&
          battler.state_time[id] % 40 == 0 && rand(100) < $data_states[id].auto_release_prob
          # remove state and counter
          battler.remove_state(id)
          battler.state_time.delete(id)
        # If this state cannot be removed after a while and reached end of timer
        elsif !$data_states[id].battle_only && battler.state_time[id] <= 0
          # Reset the state's timer
          battler.state_time[id] = $data_states[id].hold_turn * 40
        end
    }
  end
  #----------------------------------------------------------------------------
  # additional_states
  #  Handles poison and paralyze effects as well as additional status effects.
  #
  #  This method has been REWRITTEN by KK20.
  #----------------------------------------------------------------------------
  def additional_states
    # temporary variable
    slip_damage = battler.slip_damage?
    # if Tons of Add-ons is there and using Regen Status
    if $tons_version != nil && $tons_version >= 5.98 &&
        $game_system.REGEN_STATUS
      # modify slip damage flag
      slip_damage |= (HP_REGEN_IDS + SP_REGEN_IDS + SP_POISON_IDS).any? {|i|
          battler.states.include?(i)}
    end
    # if not dead and getting slip damage
    ### MOVED THE 'PER SECOND' CONDITION TO 'slip_damage_effect' ###
    if valid? && slip_damage
      # apply the slip damage
      slip_damage_effect
    end
    # if old direction fix was stored
    if @old_direction_fix != nil
      # if able to move again
      if self.restriction < 4
        # reset everything
        @direction_fix, @old_direction_fix = @old_direction_fix, nil
      end
    # if paralyzed
    elsif self.restriction == 4
      # store old direction fix and set new direction fix
      @direction_fix, @old_direction_fix = true, @direction_fix
      # reset movement
      @force_move = []
      # reset action if valid and not charging
      self.reset_action if self.valid? && !self.charging?(BlizzABS::CHARGEFreeze)
    end
  end
  #----------------------------------------------------------------------------
  # slip_damage_effect
  #
  #  This method has been EDITTED by KK20. (but only slightly)
  #----------------------------------------------------------------------------
  def slip_damage_effect
    # store hpdamage and spdamage
    hpdamage, spdamage = battler.hpdamage, battler.spdamage
    # store current hp and sp
    old_hp, old_sp = battler.hp, battler.sp
    # if Tons of Add-ons is there and using Regen Status
    if $tons_version != nil && $tons_version >= 5.98 &&
        $game_system.REGEN_STATUS
      # calculate HP damage
      damage_hp = battler.maxhp / 50
      damage_hp = 1 if damage_hp < 1
      # if HP damaging state
      if !(HP_REGEN_IDS.any? {|i| battler.states.include?(i)}) &&
          battler.slip_damage?
        # decrease HP by 2%
        battler.hp -= damage_hp
      # if HP regenarating state
      elsif HP_REGEN_IDS.any? {|i| battler.states.include?(i)} &&
          !battler.slip_damage?
        # increase HP by 2%
        battler.hp += damage_hp
      end
      # calculate SP damage
      damage_sp = battler.maxsp / 50
      damage_sp = 1 if damage_sp < 1
      # if SP damaging state
      if SP_POISON_IDS.any? {|i| battler.states.include?(i)}
        # decrease SP by 2%
        battler.sp -= damage_sp
      end
      # if SP regenarating state
      if SP_REGEN_IDS.any? {|i| battler.states.include?(i)}
        # increase SP by 2%
        battler.sp += damage_sp
      end
    else
      # decrease HP by 2%
      dam = battler.maxhp / 50
      dam = 1 if dam < 1
      battler.hp -= dam
      # set attacker and target data
    end
    # request damage sprite
    $BlizzABS.util.request_damage_sprite(@body == nil ? self : @body) if Skills_DoT::DISPLAY_DOT_DAMAGE
    # set last hit by
    if (@battler.hp < old_hp || @battler.sp < old_sp)
      slip_atk_size = @battler.last_slip_attackers.size
       slip_atk_size > 0
      @battler.last_hit_by = @battler.last_slip_attackers[slip_atk_size - 1]
    end
    # restore hpdamage and spdamage
    battler.hpdamage, battler.spdamage = hpdamage, spdamage
  end
  #----------------------------------------------------------------------------
  # slip_damage_effect
  #  Applies slip damage effect.
  # 
  #  This method has been ALIASED and EDITTED by KK20.
  #---------------------------------------------------------------------------- 
  alias babs_slip_damage_effect_original slip_damage_effect
  def slip_damage_effect
    ids = []
    @battler.states.each{|state_id|
      # skip this state if it isn't a slip_damage or configured
      next unless Skills_DoT.dot_states(state_id) != nil
      # Calculate on what frame to apply the DoT
      frame = ($data_states[state_id].hold_turn * 40) / Skills_DoT.dot_states(state_id)[1]
      # Only do DoT damage if correct frame
      next if battler.state_time[state_id] % frame != 0
      # Prepare to calculate damage
      user = @battler.states_caused_by_characters_list[state_id]
      skill = $data_skills[Skills_DoT.dot_states(state_id)[0]]
      # Begin DoT damage calculation...
      unless user.nil?
        # Calculate power
        power = skill.power + user.atk * skill.atk_f / 100
        if power > 0
          power -= @battler.pdef * skill.pdef_f / 200
          power -= @battler.mdef * skill.mdef_f / 200
          power = [power, 1].max
        end
        # Calculate rate
        rate = 20
        rate += (user.str * skill.str_f / 100)
        rate += (user.dex * skill.dex_f / 100)
        rate += (user.agi * skill.agi_f / 100)
        rate += (user.int * skill.int_f / 100)
        # Calculate basic damage
        damage = power * rate / 20
      else
        # Calculate damage if no battler caused this status ailment
        power = skill.power
        if power > 0
          power -= @battler.pdef * skill.pdef_f / 200
          power -= @battler.mdef * skill.mdef_f / 200
          power = [power, 1].max
        end
        damage = power
      end
      # Element correction
      damage *= @battler.elements_correct(skill.element_set)
      damage /= 100
      # Dispersion
      if skill.variance > 0 and damage.abs > 0
        amp = [damage.abs * skill.variance / 100, 1].max
        damage += rand(amp+1) + rand(amp+1) - amp
      end
      # Damage will always do at least 1 HP
      damage = (damage <= 0 ? 1 : damage)
      # Apply the damage
      @battler.hp -= damage
      # request damage sprite
      $BlizzABS.util.request_damage_sprite(@body == nil ? self : @body) if Skills_DoT::DISPLAY_DOT_DAMAGE
    }
    # Call BABS original slip damage method afterwards
    if Graphics.frame_count % 40 == 0
      @battler.states.each{|state_id|
        if $data_states[state_id].slip_damage and Skills_DoT.dot_states(state_id) == nil
          babs_slip_damage_effect_original
          break
        end
      }
    end
  end
end
#=============================================================================
# Game_Battler
#   Aliased:
#     initialize
#     attack_effect
#     skill_effect
#   Rewrite:
#     add_state
#     remove_state
#=============================================================================
class Game_Battler
  #-----------------------
  # Create 'set' and 'get'
  #-----------------------
  attr_accessor :state_giver_attacker
  attr_accessor :states_caused_by_characters_list
  #---------------------------------------------------------------------------
  # The following three methods have been ALIASED and EDITTED by KK20.
  #---------------------------------------------------------------------------
  alias call_orig_init_again initialize
  def initialize
    @state_giver_attacker ||= nil
    @states_caused_by_characters_list ||= {}
    call_orig_init_again
  end
 
  alias call_original_attack_effect attack_effect
  def attack_effect(attacker)
    @state_giver_attacker = attacker
    call_original_attack_effect(attacker)
  end
 
  alias call_original_skill_effect skill_effect
  def skill_effect(user, skill)
    @state_giver_attacker = user
    call_original_skill_effect(user, skill)
  end
 
  #--------------------------------------------------------------------------
  # Add State
  #
  # This method has been EDITTED by KK20.
  #--------------------------------------------------------------------------
  def add_state(state_id, force = false)
    # For an ineffective state
    if $data_states[state_id] == nil
      # End Method
      return
    end
    # If not forcefully added
    unless force
      # A state loop already in existance
      for i in @states
        # If a new state is included in the state change (-) of an existing
        # state, and that state is not included in the state change (-) of
        # a new state (example: an attempt to add poison during dead)
        if $data_states[i].minus_state_set.include?(state_id) and
           not $data_states[state_id].minus_state_set.include?(i)
          # End Method
          return
        end
      end
    end
    # If this state is not added
    unless state?(state_id)
      # Add state ID to @states array
      @states.push(state_id)
      # If this state does Skill DoT, find the actor that caused this state
      if Skills_DoT.dot_states(state_id) != nil
        if @state_giver_attacker.nil?
          @states_caused_by_characters_list[state_id] = nil
        else
          @states_caused_by_characters_list[state_id] = Battler_Stats_Array.new(@state_giver_attacker)
        end
      end
      # If option [regarded as HP 0]is effective
      if $data_states[state_id].zero_hp
        # Change HP to 0
        @hp = 0
      end
      # All state loops
      for i in 1...$data_states.size
        # Dealing with a state change (+)
        if $data_states[state_id].plus_state_set.include?(i)
          add_state(i)
        end
        # Dealing with a state change (-)
        if $data_states[state_id].minus_state_set.include?(i)
          remove_state(i)
        end
      end
      # line change to a large rating order (if value is the same, then a
      # strong restriction order)
      @states.sort! do |a, b|
        state_a = $data_states[a]
        state_b = $data_states[b]
        if state_a.rating > state_b.rating
          -1
        elsif state_a.rating < state_b.rating
          +1
        elsif state_a.restriction > state_b.restriction
          -1
        elsif state_a.restriction < state_b.restriction
          +1
        else
          a <=> b
        end
      end
    end
    # If added forcefully
    if force
      # Set the natural removal's lowest number of turns to -1
      @states_turn[state_id] = -1
    end
    # If not added forcefully
    unless  @states_turn[state_id] == -1
      # Set the natural removal's lowest number of turns
      @states_turn[state_id] = $data_states[state_id].hold_turn
    end
    # If unable to move
    unless movable?
      # Clear action
      @current_action.clear
    end
    # Check the maximum value of HP and SP
    @hp = [@hp, self.maxhp].min
    @sp = [@sp, self.maxsp].min
  end
  #--------------------------------------------------------------------------
  # Remove State
  #
  # This method has been EDITTED by KK20.
  #--------------------------------------------------------------------------
  def remove_state(state_id, force = false)
    # If this state is added
    if state?(state_id)
      # If a forcefully added state is not forcefully removed
      if @states_turn[state_id] == -1 and not force
        # End Method
        return
      end
      # If current HP is at 0 and options are effective [regarded as HP 0]
      if @hp == 0 and $data_states[state_id].zero_hp
        # Determine if there's another state [regarded as HP 0] or not
        zero_hp = false
        for i in @states
          if i != state_id and $data_states[i].zero_hp
            zero_hp = true
          end
        end
        # Change HP to 1 if OK to remove incapacitation.
        if zero_hp == false
          @hp = 1
        end
      end
      # Delete state ID from @states and @states_turn hash array
      @states.delete(state_id)
      @states_turn.delete(state_id)
      # Clear the state-causing-actor value from hash
      @states_caused_by_characters_list.delete(state_id)
    end
    # Check maximum value for HP and SP
    @hp = [@hp, self.maxhp].min
    @sp = [@sp, self.maxsp].min
  end
  #--------------------------------------------------------------------------
  # State Change (+) Application
  #
  # This method has yet been EDITTED by KK20.
  #--------------------------------------------------------------------------
  def states_plus(plus_state_set)
    # Clear effective flag
    effective = false
    # Loop (added state)
    for i in plus_state_set
      # If this state is not guarded
      unless self.state_guard?(i)
        # Set effective flag if this state is not full
        effective |= self.state_full?(i) == false
        # If states offer [no resistance]
        if $data_states[i].nonresistance
          # Set state change flag
          @state_changed = true
          # Add a state
          add_state(i)
        # If this state is not full
        elsif self.state_full?(i) == false
          # Convert state effectiveness to probability,
          # compare to random numbers
          if rand(100) < [0,100,80,60,40,20,0][self.state_ranks[i]]
            # Set state change flag
            @state_changed = true
            # Add a state
            add_state(i)
          end
        end
      end
    end
    # Reset variable
    @state_giver_attacker = nil
    # End Method
    return effective
  end
end

#=============================================================================
# * Battler_Stats_Array
# This class was added as of Version 1.02
#
# Created to fix DoT damage when the state-giving battler changed its stats
#=============================================================================
class Battler_Stats_Array
  def initialize(battler)
    @array = [battler.atk, battler.str, battler.dex, battler.agi, battler.int]
  end
  def atk; return @array[0]; end;
  def str; return @array[1]; end;
  def dex; return @array[2]; end;
  def agi; return @array[3]; end;
  def int; return @array[4]; end;
end



Instructions

Instructions in the script. Configuration help is also there.
Don't forget to set the states' duration in the database!


Compatibility

Modified/aliased some methods in Map_Battler and Game_Battler. Might be best not to combine this with another DoT system.


Credits and Thanks


  • KK20 - Creating the script

  • sasofrass - For requesting




Author's Notes

Always looking for them bugs. Enjoy~
65
RMXP Script Database / [XP] Skill Use Limitation
August 12, 2012, 06:17:22 pm
Skill Use Limitation
Authors: KK20
Version: 1.00
Type: Custom Skill System
Key Term: Custom Skill System



Introduction

Certain skills cannot be used when the battler has a certain state applied to them or if a Game Switch is ON.
Likewise, certain skills cannot be used unless the actor has a certain state on or a Game Switch is ON.


Features


  • Option to make certain skills not be used if the battler is affected by a specific status ailment or if a Game Switch is on.

  • Option to make certain skills only be used if the battler is affected by a specific status ailment or if a Game Switch is on.




Screenshots

None.


Demo

None.


Script

Below the default scripts and above main. To be safe, place right before main.
Spoiler: ShowHide

=begin
===============================================================================
Skill Use Limitations                                                 Ver. 1.00
- By KK20                                                            [8/12/12]
===============================================================================

[Information]
  Certain skills cannot be used when the battler has a certain state applied to
  them or if a Game Switch is ON. Likewise, certain skills cannot be used
  unless the actor has a certain state on or a Game Switch is ON.
   
   
[How to Use]
  Configuration instructions can be found below. Examples also posted.
 
 
[Notes]
  * The script will check if the skill cannot be used BEFORE checking if a
    certain state/switch is on to allow the use of the skill
    (prevention takes higher priority than enabling)
  * If a skill can only be used when either applied with a certain state and if
    a certain switch is on, only one or the other must be satisfied to enable use
 
===============================================================================
Credits
- KK20        : For the script
- Raziel 0128 : For requesting/idea
===============================================================================
=end


#==============================================================================
# Class Game_Battler
#==============================================================================
class Game_Battler
 
  #~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
  #         B E G I N        C O N F I G U R A T I O N
  #~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
 
  def state_prevent_skill_use(skill_id)
    #----------------------------
    # Define an array of state IDs that prevent the skill in question from
    # being used.
    #    when skill_id then return [array of state IDs]
    #----------------------------
    case skill_id
    when 1 then return [4,5,6] #Can't use Heal if Dazzle,Mute,or Confused
    when 2 then return [5,6] #Can't use Greater Heal if Mute or Confused
    when 3 then return [5] #Can't use Mass Heal if Mute
    else
      return []
    end
  end
 
  def state_enable_skill_use(skill_id)
    #----------------------------
    # Define an array of state IDs that enables the skill in question to
    # be used.
    #    when skill_id then return [array of state IDs]
    #----------------------------
    case skill_id
    when 4 then return [14,15,16] #Can use Remedy if Barrier,Resist,or Blink
    when 5 then return [15,16] #Can use Greater Remedy if Resist or Blink
    when 6 then return [15] #Can use Raise if Resist
    else
      return []
    end
  end
 
  def switch_prevent_skill_use(skill_id)
    #----------------------------
    # Define an array of switch IDs that prevent the skill in question from
    # being used.
    #    when skill_id then return [array of switch IDs]
    #----------------------------
    case skill_id
    when 1 then return [1,2,3] #Heal can't be used if Switch 1,2,or 3 is ON
    when 2 then return [2,3] #Greater Heal can't be used if Switch 2 or 3 is ON
    when 3 then return [3] #Mass Heal can't be used if Switch 3 is ON
    else
      return []
    end
  end
 
  def switch_enable_skill_use(skill_id)
    #----------------------------
    # Define an array of switch IDs that enables the skill in question to
    # be used.
    #    when skill_id then return [array of switch IDs]
    #----------------------------
    case skill_id
    when 4 then return [4,5,6] #Remedy can be used if Switch 4,5,or 6 is ON
    when 5 then return [5,6] #Greater Remedy can be used if Switch 5 or 6 is ON
    when 6 then return [6] #Raise can be used if Switch 6 is ON
    else
      return []
    end
  end
 
  #~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
  #         E N D       C O N F I G U R A T I O N
  #~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
   
  alias call_skill_can_use_orig_method skill_can_use?
  #--------------------------------------------------------------------------
  # * Determine Usable Skills
  #     skill_id : skill ID
  #--------------------------------------------------------------------------
  def skill_can_use?(skill_id)
    # Check if a switch is on that prevents this skill from use
    unless switch_prevent_skill_use(skill_id) == []
      switch_prevent_skill_use(skill_id).each{|id| return false if $game_switches[id]}
    end
    # Check if a state is applied that prevents this skill from use
    unless state_prevent_skill_use(skill_id) == []
      state_prevent_skill_use(skill_id).each{|id| return false if self.state?(id)}
    end
    # Check if state or switch must be on to allow the skill's use
    unless switch_enable_skill_use(skill_id) == [] and state_enable_skill_use(skill_id) == []
      switch_enable_skill_use(skill_id).each{|id| return true if $game_switches[id]}
      state_enable_skill_use(skill_id).each{|id| return true if self.state?(id)}
      # Because neither a switch or state was on, the skill can't be used
      return false
    end
    # Call original 'skill_can_use?' method
    call_skill_can_use_orig_method(skill_id)
  end
 
end



Instructions

Instructions in the script. Configuration help is also there.


Compatibility

Alias of Game_Battler method skill_can_use?
Works with Blizz-ABS (and probably all other CBS's).
Should be highly compatible otherwise.


Credits and Thanks


  • KK20 - Creating the script

  • Raziel 0128 - For requesting/idea




Author's Notes

A quick browse through the database and I could only find one script that did half what this script does. Think of this as an add-on/revival script. Also quite surprised something like this doesn't exist around here despite being so easy...
Have fun! :)
66
Enemy Event Trigger Condition Checking
Authors: KK20
Version: 1.01
Type: Event Modification
Key Term: Blizz-ABS Plugin



Introduction

Blizz-ABS allows the creator to make event triggers for map battlers. It was possible for players to allow multiple triggers for one event page, meaning that the events would run if any ONE of those triggers was satisfied. With this script, the creator can now make conditional branches for each trigger.


Features


  • Allows enemy events with multiple custom event triggers to have conditional branches, meaning more diverse event customization

  • No configuration required!




Screenshots
https://www.youtube.com/watch?v=PORaXNi4yiI



Demo

None.


Script

Post below the Blizz-ABS scripts.
Spoiler: ShowHide

=begin
===============================================================================
Enemy Event Trigger Condition Checking                                Ver. 1.01
- By KK20                                                            [10/26/12]
===============================================================================
                                  [ Updates ]
Version:

  1.01                                                               [10/26/12]
  -  There was an issue with running events when enemies died

===============================================================================
[Information]
  Blizzard ABS allows the creator to make event triggers for map battlers. It
  was possible for players to allow multiple triggers for one event page,
  meaning that the events would run if any ONE of those triggers was satisfied.
  With this script, the creator can now make conditional branches for each
  trigger.
 
 
[Example]
  The event can be triggered via ActionButton and Weapon. If player presses
  ActionButton, the event will say "Hi." If the player attacks with his weapon,
  the event says "Ouch!"
 
-------------------------------------------------------------------------------

[How to Use]
  Create triggers as you would normally (at the top of the event list as a
  comment line--read the BlizzABS manual for details). In a conditional branch,
  use the 'Script' option. Then, type this line:
 
      $game_map.events[@SELF].triggered?(trigger_id, object_id)
     
  >> trigger_id : The ID of the trigger type (i.e. CETPlayerTouch, CETWeapon)
   [[** NOTE **]]
   If you want to learn more of the types of triggers, refer to the manual.
   Also, it is MANDATORY to add this code before the trigger variable:
                                 
                                 BlizzABS::
   
  >> object_id  : The ID of the object (i.e weapon ID, skill ID, item ID)
  [[** NOTE **]]
  This parameter is 'nil' by default. Thus, this parameter can be entirely
  skipped. Only specify a value if necessary.
 
 
[Examples of Usage]
  $game_map.events[@SELF].triggered?(BlizzABS::CETActionButton)
    => If the player pressed the ActionButton to trigger the event
   
  $game_map.events[@SELF].triggered?(BlizzABS::CETWeapon, 5)
    => If the player attacked with the weapon of ID 5
   
  $game_map.events[@SELF].triggered?(BlizzABS::CETSkill)
    => If the player attacked with any skill
   
===============================================================================
Credits
  KK20      : Creating this script edit
  Blizzard  : So that you can use this script in BlizzABS (duh :P)
  Sin86     : For the idea and bug report
===============================================================================
=end

class Map_Enemy < Map_Battler
  #----------------------------------------------------------------------------
  # triggered?
  #  trigger_id : The ID of the trigger type (i.e. CETPlayerTouch, CETWeapon)
  #  object_id  : The ID of the object (i.e weapon ID, skill ID, item ID)
  #  Returns if the event was triggered by a certain trigger.
  #----------------------------------------------------------------------------
  def triggered?(trigger_id, object_id = nil)
    return (@event_trigger[0] == trigger_id) if object_id.nil?
    return @event_trigger == [trigger_id, object_id]
  end
  #----------------------------------------------------------------------------
  # Initialization
  # ** Initialize variable 'event_trigger'
  #----------------------------------------------------------------------------
  alias init_map_enemy_after initialize
  def initialize(map_id, event, id = 0, group = 0, attributes = 0x00,
                 move = false, immortal = false, full_passable = false,
                 custom = false, delay = 40, view = 5, hear = 40, nojump = false)
    @event_trigger = [-1, -1]
    init_map_enemy_after(map_id, event, id, group, attributes,
                 move, immortal, full_passable,
                 custom, delay, view, hear, nojump)
  end
               
  #----------------------------------------------------------------------------
  # start
  #  Setups the starting event code.
  #  ** Removed the line -> @trigger = 1 **
  #----------------------------------------------------------------------------
  def start
    # if event code exists
    return if @list.size <= 1
    # set starting and execution flag
    @starting = @execute = true
  end
  #----------------------------------------------------------------------------
  # event_execution?
  #  Tests if the enemy died and is executing an event now.
  #  ** Added @event_trigger = [-1, -1] **
  #----------------------------------------------------------------------------
  def event_execution?
    # stop if not executing
    return false if !@execute
    # if about to start or running already
    if @starting || $game_system.map_interpreter.running?
      # reset blending type
      @blend_type = 0 if @starting
      # reset moving route
      @force_move = []
      # executing event
      return true
    end
    # if enemy revived with event command
    if valid? && !battler.dead?
      # reset opacity
      @opacity = 255
      # reset blending type
      @blend_type = 0
      # reset execute flag
      @execute = false
      # recreate data pack for new enemy
      @ai = BlizzABS::AI::Data_Enemy.new(self, @ai.group, @ai.attributes,
          @ai.custom, @ai.delay_time, @ai.view_range, @ai.hearing_range_ratio)
      # reset moving route
      @force_move = []
    # if opacity is 0
    elsif (!valid? || battler.dead?) && @opacity == 0
      # set execute flag and erased flag
      @execute, @erased = false, true
      # refresh
      refresh
    end
    @event_trigger = [-1, -1]
    # not executing event
    return false
  end
  #----------------------------------------------------------------------------
  # attack_effect
  #  character - the character that holds attack data (can be projectile)
  #  _battler  - the attacking battler
  #  Executes attack upon a map character.
  #----------------------------------------------------------------------------
  def attack_effect(character, _battler)
    # call superclass method
    result = super
    # if actor
    if _battler.is_a?(Game_Actor)
      # get weapon ID and custom event trigger type
      id, cet = _battler.weapon_id, BlizzABS::CETWeapon
    # if enemy
    elsif _battler.is_a?(Game_Enemy)
      # get weapon ID and custom event trigger type
      id, cet = _battler.id, BlizzABS::CETEnemy
    end
    # if can be activated by this weapon / enemy
    if result && @custom_triggers.has_key?(cet) &&
        (@custom_triggers[cet].size == 0 ||
        @custom_triggers[cet].include?(id))
      # run this enemy as event
      @event_trigger = [cet, id]
      self.start
    end
    # return result
    return result
  end
  #----------------------------------------------------------------------------
  # skill_effect
  #  character - the character that holds skill use (can be projectile)
  #  _battler  - the skill using battler
  #  skill     - the skill
  #  Executes skill use upon a map character.
  #----------------------------------------------------------------------------
  def skill_effect(character, _battler, skill)
    # call superclass method
    result = super
    # if can be activated by this skill
    if result && @custom_triggers.has_key?(BlizzABS::CETSkill) &&
        (@custom_triggers[BlizzABS::CETSkill].size == 0 ||
        @custom_triggers[BlizzABS::CETSkill].include?(skill.id))
      # run this enemy as event
      @event_trigger = [BlizzABS::CETSkill, id]
      self.start
    end
    # return result
    return result
  end
  #----------------------------------------------------------------------------
  # item_effect
  #  character - the character that holds item use (can be projectile)
  #  item      - the item
  #  Executes item use upon a map character.
  #----------------------------------------------------------------------------
  def item_effect(character, _battler, item)
    # call superclass method
    result = super
    # if can be activated by this item
    if result && @custom_triggers.has_key?(BlizzABS::CETItem) &&
        (@custom_triggers[BlizzABS::CETItem].size == 0 ||
        @custom_triggers[BlizzABS::CETItem].include?(item.id))
      # run this enemy as event
      @event_trigger = [BlizzABS::CETItem, id]
      self.start
    end
    # return result
    return result
  end
  #----------------------------------------------------------------------------
  # check_event_trigger_touch
  #  x - x-coordinate
  #  y - y-coordinate
  #  Checks event touching. Called when event moves into player.
  #----------------------------------------------------------------------------
  def check_event_trigger_touch(x, y)
    # get pixel movement rate
    pix = $BlizzABS.pixel
    # stop if an event is being executed already
    return false if $game_system.map_interpreter.running?
    # if any battler in the way
    if @trigger == BlizzABS::CETEventTouch && !jumping? && !over_trigger? &&
        !$game_player.through && $game_player.character_name != '' &&
        $BlizzABS.util.rect_intersection(Rect.new(x, y, pix, pix),
            Rect.new($game_player.x, $game_player.y, pix, pix))
      # start
      @event_trigger = [BlizzABS::CETEventTouch, id]
      start
      # started
      return true
    end
    # not started
    return false
  end
  #----------------------------------------------------------------------------
  # check_event_trigger_at
  #  x - x-coordinate
  #  y - y-coordinate
  #  Check event if it was triggered at a specific position. (pixel movement)
  #  Called when player presses action button or walks into event.
  #----------------------------------------------------------------------------
  def check_event_trigger_at(x, y)
    # get pixel movement rate
    pix = $BlizzABS.pixel
    # if player touched this event and not jumping and not over_trigger
    if !jumping? && !over_trigger? && $BlizzABS.util.rect_intersection(
        Rect.new(@x, @y, pix, pix), Rect.new(x, y, pix, pix))
      # start
      @event_trigger = Input.trigger?(Input::C) ? [BlizzABS::CETActionButton, -1] : [BlizzABS::CETPlayerTouch, -1]
      start
      # started
      return true
    end
    # not started
    return false
  end
end

#==============================================================================
# ** Interpreter
#------------------------------------------------------------------------------
#  This interpreter runs event commands. This class is used within the
#  Game_System class and the Game_Event class.
#==============================================================================
class Interpreter
  #--------------------------------------------------------------------------
  # * Starting Event Setup
  #   Editted 'if event.trigger < 3' to be '!= 3'
  #--------------------------------------------------------------------------
  def setup_starting_event
    # Refresh map if necessary
    if $game_map.need_refresh
      $game_map.refresh
    end
    # If common event call is reserved
    if $game_temp.common_event_id > 0
      # Set up event
      setup($data_common_events[$game_temp.common_event_id].list, 0)
      # Release reservation
      $game_temp.common_event_id = 0
      return
    end
    # Loop (map events)
    for event in $game_map.events.values
      # If running event is found
      if event.starting
        # If not auto run
        if event.trigger != 3 # if event.trigger < 3
          # Clear starting flag
          event.clear_starting
          # Lock
          event.lock
        end
        # Set up event
        setup(event.list, event.id)
        return
      end
    end
    # Loop (common events)
    for common_event in $data_common_events.compact
      # If trigger is auto run, and condition switch is ON
      if common_event.trigger == 1 and
         $game_switches[common_event.switch_id] == true
        # Set up event
        setup(common_event.list, 0)
        return
      end
    end
  end
end



Instructions

Details found in the script. Primary script call is
$game_map.events[@SELF].triggered?(trigger_id, object_id)

where 'trigger_id' is the trigger type (BlizzABS::CETActionButton, BlizzABS::CETWeapon, etc.)
      'object_id' is the ID of the item in the database (Weapon ID, Item ID, Skill ID, Enemy ID)


Compatibility

This is for Blizz-ABS, so make sure to have Blizz-ABS!
Written during the time of Blizz-ABS Version 2.84.
Overwrites a few methods in Map_Enemy regarding to event activation. I'm pretty sure there aren't any scripts out there that modify these methods, so it should be fairly compatible. 


Credits and Thanks


  • KK20 - For creating the script

  • Sin86 - For the idea/inspiration/bug report




Author's Notes

dat script name :V: Also my first ever submitted script here. Wooo!
Feedback or ideas are appreciated. If winkio approves it, this might be an official feature for Blizz-ABS in the future. Until then, have fun with this. :)
67
Welcome! / Been meaning to do this
February 11, 2012, 04:14:08 pm
As you can see from my post count, I have been here for a while, but I never really introduced myself. The username, KK20, is actually short for Kirbykid20, a name that I have used for years across the internet. My real name is Tyler, a tall and scrawny, half-white half-Japanese, 19-year-old. I live near the coast in Southern California. I am an INTJ according to the MBTI test. I'm getting my AA this semester and transferring over this fall. Computer Science is my major.

I've wanted to be in game design since the age of four or five. It wasn't until around my freshman year that I discovered RPG Maker and turned my dream into a reality. It also wasn't until my junior year that I took my first programming class. When I found out that I was pretty good at it (5 on the AP test), Computer Science was my "for-sure" major. However, I'm probably one of the most technology-illiterate computer majors out there.  :^_^':

Anyways, I have been working on RMXP for about 3 years now and am still learning how to write Ruby. Thanks to some of your scripts, I was able to teach myself a bit! My current project is to recreate Advance Wars into Ruby. It's been about half a year now, and I think I've done a pretty good job so far. You can find my current progress on it here: http://www.youtube.com/watch?v=saST5gPnE5k

I needed to find a community that I could fit in with, and I thought that this was a great first place. I didn't grow up with people that have the same interests as I do, so it has been pretty tough finding support. Nevertheless, I hope that I can be somewhat recognized by the community despite my almost hermit-like personality. So with that all said and done, hello people! :V: