Chaos Project

RPG Maker => RPG Maker Scripts => Script Requests => Topic started by: Holyrapid on December 16, 2009, 09:40:19 am

Title: Edit of g_g's skill shop
Post by: Holyrapid on December 16, 2009, 09:40:19 am
So, i want someone to make me a small(ish) edit of game_guy's awesome Skill Shop.
First, i want to be able to set it one of the follwoing six:
Regular Skill Shop
Overdrive shop (i use EOS)
Both at the same time

Then, the same, but you use exp. instead of gold. This may seem strange, but i´m using Blizzards FF2-style leveling (CSGS)
Here are my scripts in order:

*Parallax Background by Dubleaux of CA
Ccoas UMS
Skill Shop
Tons 1-3
FF2 leveling
STCMS
EOS

So, it needs to be comtabli with those. And, i´m pretty sure that Blizzard said in the topic for the FF2 leveling that exp can be used for something else, since it´s not used for leveling up...
Title: Re: Edit of g_g's skill shop
Post by: Holyrapid on December 17, 2009, 11:29:20 am
BUMP!?
Title: Re: Edit of g_g's skill shop
Post by: G_G on December 17, 2009, 11:40:14 am
I can do this easily. Except the part where you can both buy overdrive skills and normal skills. But I can make it where you can buy overdrive skills and do you still even get experience with the FF2 Leveling System?
Title: Re: Edit of g_g's skill shop
Post by: Holyrapid on December 17, 2009, 01:05:00 pm
Like i said, i´m pretty sure that blizz said so in the first post... Yes, exp is still gained, or at least usable. Here´s a quote from Blizz, from the first post of the FF2 leveling script topic:
Quote from: Blizzard on January 09, 2008, 05:15:51 pm
Custom Stat Growing System
This script disables the abiliy to gain levels, although EXP are still being received and can be used for another purpose. It also will allow to raise the character stats by other meanings than level ups. This kind of stat growing system can be encountered in "Final Fantasy 2".

Features


  • stats are growing through "stimulation" instead of level ups
  • no more level ups!
    • use EXP for any other purpose

Title: Re: Edit of g_g's skill shop
Post by: G_G on December 18, 2009, 01:02:17 pm
K I'll try and get the shop that sells overdrives, then I'll see if I can make it where you can spend exp as well.
Title: Re: Edit of g_g's skill shop
Post by: Holyrapid on December 19, 2009, 03:36:35 am
Ok, thanks Ronnie :) You´re great. (BTW, i´ve added you to my MSN contacts, if you don´t mind. it´s the gamil address)
I really hope you can do this, since it would be great to be able to buy overdrives, and with exp. instead of gold would be great, and a bit unique. Yet again thanks :)
Title: Re: Edit of g_g's skill shop
Post by: Holyrapid on December 27, 2009, 09:00:12 am
How is this coming along? At least the overdrive buying?
Title: Re: Edit of g_g's skill shop
Post by: Eternal on January 05, 2010, 10:32:57 am
Bump?
Title: Re: Edit of g_g's skill shop
Post by: G_G on January 05, 2010, 10:36:14 am
Been busy, it'll be worked on little by little though.
Title: Re: Edit of g_g's skill shop
Post by: Holyrapid on January 06, 2010, 05:11:09 am
Good to know you´re still working on this, and looks like someone else wants this too.
Title: Re: Edit of g_g's skill shop
Post by: G_G on January 06, 2010, 11:20:33 am
Here's the first part. It sells Overdrive skills. Just follow the instructions like usual.
Place below Easy Overdrive System
#===============================================================================
# Skill Shop
# Author: Game_guy
# Date: June 7th, 2009
# Version: 2.2
#===============================================================================
#
# Intro:
# What this script does is act as a shop but sells skills instead.
#
# Instructions:
# 1: First how do you want it setup? Theres two ways
#    1: -Any person can learn any skill
#    or
#    2: -Classes learn different skills then other classes
#
#    Go down to UseClasses and set it to false for 1: or true for 2:
#
# 2: Ok now that thats over lets move onto price. Go down to CONFIG PRICE and
#    follow the instructions there.
#   
# 3: Skip this step if you set UseClasses to false.
#    Go to CONFIG CLASS SKILLS and follow the instructions there.
#   
# 4: Ok so everythings setup now. Time to actually find out how to open the
#    skillshop right? You use this line
#    $scene = Scene_ODShop.new([skill id's go here])
#    example
#    $scene = Scene_ODShop.new([1, 2]) will make a shop with the skills
#    Heal and Great Heal
#
# 5: Ok the script now is able to make it where only skills are learnable at
#    certain levels. Go to CONFIG LEVEL and follow instructions there.
#
# 6: Ok so now there's a new option that sorts the skills in the following.
#    Alphabetical
#    Reverse Alphabetical
#    Numeric (Sorts it by Id)
#    Reverse Numberic
#    Price
#    Reverse price
#    At default its at numeric but to change it use this,
#    $game_system.ssort = 0,1,2, or 3.
#    0 = Numeric, 1 = Reverse Numeric, 2 = Alphabetical,
#    3 = Reverse Alphabetical, 4 = Price, 5 = Reverse Price.
#===============================================================================
module GameGuy
  #==========================
  # BEGIN CONFIG
  #==========================
  UseClasses = false # if false anyone can learn any skill
                     # if true only classes can learn the defined skills
end
module RPG
  class Skill
    def price
      case id
      #==========================
      # CONFIG PRICE
      #==========================
      # use
      # when skill_id then return price
      when 1 then return 50
      when 57 then return 75
      end
      return 10
    end
    def llevel
      case id
      #==========================
      # CONFIG LEVEL
      #==========================
      # use
      # when skill_id then return level
      when 57 then return 2
      end
      return 1
    end
  end
  class Class
    def learnskills
      case id
      #==========================
      # CONFIG CLASS SKILLS
      #==========================
      # use
      # when class_id then return [skill id's here]
      when 1 then return [57, 58, 59, 60]
      when 2 then return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 81]
      when 7 then return [69, 70, 71, 72, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80]
      when 8 then return [30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56]
      end
      return []
    end
  #==========================
  # END CONFIG
  #==========================
  end
end
class Game_System
  attr_accessor :ssort
  alias sort_me_skillz initialize
  def initialize
    @ssort = 0
    sort_me_skillz
  end
end
class Window_SkillCommand < Window_Selectable
  def initialize
    super(0, 64, 480, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    @item_max = 2
    @column_max = 2
    @commands = ["Learn", "Exit"]
    refresh
    self.index = 0
  end
  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i)
    end
  end
  def draw_item(index)
    x = 4 + index * 240
    self.contents.draw_text(x, 0, 128, 32, @commands[index])
  end
end

class Window_SkillBuy < Window_Selectable
  def initialize(shop_goods)
    super(0, 128, 368, 352)
    @skill_shop_goods = shop_goods
    self.active = false
    refresh
    self.index = 0
  end
  def skill
    return @data[self.index]
  end
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    for i in 0...@skill_shop_goods.size
      skill = $data_skills[@skill_shop_goods[i]]
      if skill != nil
        @data.push(skill)
      end
    end
    case $game_system.ssort
    when 0
      [@data].each {|ary| ary.sort! {|a, b| a.id <=> b.id}}
    when 1
      [@data].each {|ary| ary.sort! {|a, b| a.id <=> b.id}}
      [@data].each {|ary| ary.reverse!}
    when 2
      [@data].each {|ary| ary.sort! {|a, b| a.name <=> b.name}}
    when 3
      [@data].each {|ary| ary.sort! {|a, b| a.name <=> b.name}}
      [@data].each {|ary| ary.reverse!}
    when 4
      [@data].each {|ary| ary.sort! {|a, b| a.price <=> b.price}}
    when 5
      [@data].each {|ary| ary.sort! {|a, b| a.price <=> b.price}}
      [@data].each {|ary| ary.reverse!}
    else
      [@data].each {|ary| ary.sort! {|a, b| a.id <=> b.id}}
    end
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
  def draw_item(index)
    skill = @data[index]
    price = skill.price
    enabled = (price <= $game_party.gold)
    if enabled
      self.contents.font.color = normal_color
    else
      self.contents.font.color = disabled_color
    end
    x = 4
    y = index * 32
    rect = Rect.new(x, y, self.width - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(skill.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 28, y, 212, 32, skill.name, 0)
    self.contents.draw_text(x + 240, y, 88, 32, price.to_s, 2)
  end
  def update_help
    @help_window.set_text(skill == nil ? "" : skill.description)
  end
end

class Window_SkillStatus2 < Window_Selectable
  def initialize
    super(368, 128, 272, 352)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
    self.z = 200
    self.active = false
    self.index = -1
  end
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      x = 64
      y = i * 80
      actor = $game_party.actors[i]
      classs = $data_classes[$game_actors[actor.id].class_id]
      draw_actor_graphic(actor, x - 40, y + 60)
      draw_actor_name(actor, x - 13, y + 10)
      if actor.overdrive_skills.include?($thing.id)
        self.contents.font.color = crisis_color
        $text = "Aquired"
      elsif GameGuy::UseClasses
        if classs.learnskills.include?($thing.id) && $thing.llevel <= actor.level
          self.contents.font.color = normal_color
          $text = "Can Learn"
        elsif classs.learnskills.include?($thing.id) && $thing.llevel > actor.level
          self.contents.font.color = disabled_color
          $text = "Can Learn At Level " + $thing.llevel.to_s
        else
          self.contents.font.color = disabled_color
          $text = "Can't Learn"
        end
      else
        if actor.level >= $thing.llevel
          self.contents.font.color = normal_color
          $text = "Can Learn"
        else
          self.contents.font.color = disabled_color
          $text = "Can Learn At Level " + $thing.llevel.to_s
        end
      end
      self.contents.draw_text(x - 13, y + 40, 200, 32, $text)
    end
  end
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
    else
      self.cursor_rect.set(0, @index * 80, self.width - 32, 80)
    end
  end
end

class Scene_ODShop
  def initialize(skills)
    @skills = skills
  end
  def main
    @command = Window_SkillCommand.new
    @help_window = Window_Help.new
    @skillbuy = Window_SkillBuy.new(@skills)
    @skillbuy.active = false
    @skillbuy.help_window = @help_window
    $thing = @skillbuy.skill
    @status = Window_SkillStatus2.new
    #@status.visible = false
    @gold = Window_Gold.new
    @gold.x = 480
    @gold.y = 64
   
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @gold.dispose
    @skillbuy.dispose
    @help_window.dispose
    @command.dispose
    @status.dispose
  end
  def update
    @gold.update
    @status.update
    @gold.refresh
    @command.update
    @skillbuy.update
    @help_window.update
    $thing = @skillbuy.skill
    @status.refresh
    if @command.active
      update_command
      return
    end
   
    if @status.active
      update_status
      return
    end
   
    if @skillbuy.active
      update_buy
      return
    end
  end
 
  def update_buy
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @skillbuy.active = false
      @skillbuy.index = -1
      @command.active = true
      @command.index = 0
      return
    end
    if Input.trigger?(Input::C)
      $game_system.se_play($data_system.decision_se)
      @skillbuy.active = false
      @status.active = true
      @status.visible = true
      @status.index = 0 if @status.index == -1
    end
  end
 
  def update_command
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Map.new
      return
    end
    if Input.trigger?(Input::C)
      $game_system.se_play($data_system.decision_se)
      case @command.index
      when 0
        @command.active = false
        @command.index = -1
        @skillbuy.active = true
        @skillbuy.index = 0
      when 1
        $game_system.se_play($data_system.cancel_se)
        $scene = Scene_Map.new
      end
      return
    end
  end
 
  def update_status
    if Input.trigger?(Input::B)
      @status.active = false
      @status.index = -1
      @skillbuy.active = true
      return
    end
    if Input.trigger?(Input::C)
      price = @skillbuy.skill.price
      @actort = $game_party.actors[@status.index]
      enabled = (price <= $game_party.gold)
     
      if enabled
        if @actort.overdrive_skills.include?(@skillbuy.skill.id)
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        if GameGuy::UseClasses
          if $data_classes[@actort.class_id].learnskills.include?(@skillbuy.skill.id) && @actort.level >= @skillbuy.skill.llevel
            return if @actort.overdrive_skills.include?(@skillbuy.skill.id)
            @actort.learn_overdrive(@skillbuy.skill.id)
            $game_party.lose_gold(@skillbuy.skill.price)
            $game_system.se_play($data_system.decision_se)
            @status.refresh
            @skillbuy.refresh
            return
          else
            $game_system.se_play($data_system.buzzer_se)
            return
          end
        else
          if @actort.level >= @skillbuy.skill.llevel
            return if @actort.overdrive_skills.include?(@skillbuy.skill.id)
            @actort.learn_overdrive(@skillbuy.skill.id)
            $game_party.lose_gold(@skillbuy.skill.price)
            $game_system.se_play($data_system.decision_se)
            @status.refresh
            @skillbuy.refresh
          else
            $game_system.se_play($data_system.buzzer_se)
            return
          end
          return
        end
       
      else
        $game_system.se_play($data_system.buzzer_se)
        return
      end
    end
  end

end
class Game_Actor
 
  attr_accessor :overdrive
  attr_accessor :overdrive_skills
 
end

if you have any bugs please report them.
Title: Re: Edit of g_g's skill shop
Post by: Eternal on January 10, 2010, 04:41:51 am
looks great xD