iPhone App Directory
RPG Maker VX
 
Gallery Members Search Calendar Help


Welcome Guest ( Log In | Register )

Collapse

>Announcement

The 2nd Quarter Contest has arrived! Go check it out in the Community Announcements now!
 
Reply to this topicStart new topic
> Sell Limiter and merchentile skill, Make some items not sell by a note tag not value
jesse120
post Oct 5 2011, 12:43 AM
Post #1


Master Eventer, Novice scripter, pathetic spriter
Group Icon


Type: Designer
Alignment: Chaotic Good




search number 10519195120
Sell Limiter and mercantile skill
This script is designed to make it so you can sell 0 value items and not sell items worth 4, 7, 8, ect
this script also adds a mercantile skill to the status menu.
Credit is not necessary but would be appreciated

future updates include but are not limited to:
Making it so you can program a custom message to be played when you try to sell a 0 value item. Like "give away..." yes, no.

Version list:
Spoiler:

Version ID Date Released New Features bugs
CODE
Version ID      Date Released     New Featurs            bugs
  1.0                10/4/11      *Alows you to set       none yet
                                  items to not be      
                                  able to be sold      
                                  using a tag.
  1.1                10/6/11      *Alows you to set       none yet
                                 the sell rate and      
                                  buy rate with out
                                  having to search
                                  the script.
  2.0                10/13/11     *Alows player to        Game Crashes if
                                  have a Mercentily       Level is 0
                                  skill attached to
                                  a variable negates
                                  version 1.1
  2.1                12/4/11      *same as version        Game crashes if
                                  2.0 except you          Level is 0
                                  can choose to have
                                  sell rate in menu
  2.2                3/29/12      *Fixed bug that         None yet
                                  crashes game if level
                                  is 0 from version
                                  2.0 and 2.1
  2.3                       5/13/12     *Fixed bug with          None yet
                                my menu unlimater
                                script


script
Spoiler:

CODE
#================================================================================
#      Maker: jesse120
#      Version: 2.0
#        Date: 11/13/11
#===============================================================================
#             Credit:
#Credit for me is not necesary
#just dont clame to have made this script your self
#credit would be nice.
#thanks to but not nececary.
#feal free to make changes to this script or use parts of it in your other scripts.
#How ever I would like to request that any upgrads you make off this script be posted
#to its topic so I can see it and mady get a new idea from it.  Not necesary but if
#you do this I will add you name to the Special Thanks to list in this script.
#================================================================================
#Special thanks to:
#================================================================================
#Futuer updates:
#*Set custom mesage for selling a item worth nothing
#
#===============================================================================
#Version list:
#Version ID      Date Released     New Featurs            bugs
#1.0                10/4/11      *Alows you to set       none yet
#                                items to not be      
#                                able to be sold      
#                                using a tag.
#1.1                10/6/11      *Alows you to set       none yet
#                                the sell rate and      
#                                buy rate with out
#                                having to search
#                                the script.
#2.0                10/13/11     *Alows player to        Game Crashes if
#                                have a Mercentily       Level is 0
#                                skill attached to
#                                a variable negates
#                                version 1.1
#2.1                12/4/11      *same as version        Game crashes if
#                                2.0 except you          Level is 0
#                                can choose to have
#                                sell rate in menu
#2.2                3/29/12      *Fixed bug that         None yet
#                                crashes game if level
#                                is 0 from version
#                                2.0 and 2.1
#2.3                5/13/12     *Fixed bug with          None yet
#                                my menu unlimaiter
#                                script
#==============================================================================
# Curent Features:
# *Alows you to set items to not be able to be sold
# *Uses a tag in item notes
# *Has a Merchentily skill avalable in status menu.
#==============================================================================
#Incompatibilitys: none found yet inform me if you find one
#==============================================================================
#Instructions:  
#Insert under Materials and above Main
#to make an item so it will not sell add <nosell> to the item/weapon/armor notes

#to make the sell variable show in your invintory set this to true
MENU_SHOW = true

#This is the level you are at buying / selling.  100 is base price sell/ buy, 50 is *2 buy and /2 sell
#This is ment to be increaced durng the game.
MERCANTILE_LEVEL = 8 #this is the variable that your level is drawn from do not excede 99
#to change the menu vocab find <menu_name> in the script and edit the two lines

#if using my menu unlimater with this script place this script on bottom and set
#this constant to true
MENU_UNLIMATER = true #default false
#==============================================================================

   #======================================================================#
   #End custimisation Dont touch this enless you know what you are doing  #
   #======================================================================#

class Scene_Shop < Scene_Base
  attr_accessor :merchentily_skill

  def initialize
    @merchentily_skill = $game_variables[MERCANTILE_LEVEL]
  end
  def buy_modifier
   return @item.price * ( 100 / (@merchentily_skill + 1))
  end
  def sell_modifier
    return @item.price / (100 / (@merchentily_skill + 1))
   end
   #--------------------------------------------------------------------------
  # * Update Buy Item Selection
  #--------------------------------------------------------------------------
  def update_buy_selection
    if MENU_UNLIMATER == true
      item_max_update
    @status_window.item = @buy_window.item
    if Input.trigger?(Input::B)
      Sound.play_cancel
      @command_window.active = true
      @dummy_window.visible = true
      @buy_window.active = false
      @buy_window.visible = false
      @status_window.visible = false
      @status_window.item = nil
      @help_window.set_text("")
      return
    end
    if Input.trigger?(Input::C)
      @item = @buy_window.item
      number = $game_party.item_number(@item)
      if @item_max == -1
      if @item == nil or buy_modifier > $game_party.gold or number < 0
        Sound.play_buzzer
      else
        Sound.play_decision
        max = @item.price == 0 ? number + n : $game_party.gold / @item.price
        @buy_window.active = false
        @buy_window.visible = false
        @number_window.set(@item, max, buy_modifier)
        @number_window.active = true
        @number_window.visible = true
      end
      else
          if @item == nil or buy_modifier > $game_party.gold or number == @item_max
        Sound.play_buzzer
      else
        Sound.play_decision
        max = @item.price == 0 ? @item_max : $game_party.gold / buy_modifier
        max = [max, @item_max - number].min
        @buy_window.active = false
        @buy_window.visible = false
        @number_window.set(@item, max, buy_modifier)
        @number_window.active = true
        @number_window.visible = true
      end
      end
    end
  else
    @status_window.item = @buy_window.item
    if Input.trigger?(Input::B)
      Sound.play_cancel
      @command_window.active = true
      @dummy_window.visible = true
      @buy_window.active = false
      @buy_window.visible = false
      @status_window.visible = false
      @status_window.item = nil
      @help_window.set_text("")
      return
    end
    if Input.trigger?(Input::C)
      @item = @buy_window.item
      number = $game_party.item_number(@item)
      if @item == nil or buy_modifier > $game_party.gold or number == 99
        Sound.play_buzzer
      else
        Sound.play_decision
        max = buy_modifier == 0 ? 99 : $game_party.gold / buy_modifier
        max = [max, 99 - number].min
        @buy_window.active = false
        @buy_window.visible = false
        @number_window.set(@item, max, buy_modifier)
        @number_window.active = true
        @number_window.visible = true
      end
    end
  end
end

  #--------------------------------------------------------------------------
  # * Update Sell Item Selection
  #--------------------------------------------------------------------------
  def update_sell_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      @command_window.active = true
      @dummy_window.visible = true
      @sell_window.active = false
      @sell_window.visible = false
      @status_window.item = nil
      @help_window.set_text("")
    elsif Input.trigger?(Input::C)
      @item = @sell_window.item
      @status_window.item = @item
      if @item == nil or @item.note.include? "<nosell>"
        Sound.play_buzzer
      else
        Sound.play_decision
        max = $game_party.item_number(@item)
        @sell_window.active = false
        @sell_window.visible = false
        @number_window.set(@item, max, sell_modifier)
        @number_window.active = true
        @number_window.visible = true
        @status_window.visible = true
      end
    end
  end
  def decide_number_input
    Sound.play_shop
    @number_window.active = false
    @number_window.visible = false
    case @command_window.index
    when 0  # Buy
      $game_party.lose_gold(@number_window.number * buy_modifier)
      $game_party.gain_item(@item, @number_window.number)
      @gold_window.refresh
      @buy_window.refresh
      @status_window.refresh
      @buy_window.active = true
      @buy_window.visible = true
    when 1  # sell
      $game_party.gain_gold(@number_window.number * sell_modifier)
      $game_party.lose_item(@item, @number_window.number)
      @gold_window.refresh
      @sell_window.refresh
      @status_window.refresh
      @sell_window.active = true
      @sell_window.visible = true
      @status_window.visible = false
    end
  end
end
#==============================================================================
# ** Window_Status
#------------------------------------------------------------------------------
#  This window displays full status specs on the status screen.
#==============================================================================

class Window_Status < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     actor : actor
  #--------------------------------------------------------------------------
  def initialize(actor)
    super(0, 0, 544, 416)
    @actor = actor
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    draw_actor_name(@actor, 4, 0)
    draw_actor_class(@actor, 128, 0)
    draw_actor_face(@actor, 8, 32)
    draw_basic_info(128, 32)
    draw_parameters(32, 160)
    draw_exp_info(288, 32)
    draw_equipments(288, 160)
    if MENU_SHOW == true
    self.contents.draw_text(56, 359, 168, 24, $game_variables[MERCANTILE_LEVEL])
    self.contents.draw_text(15, 314, 264, 24, 'Mercantile')  #<menu_name>
    self.contents.draw_text(39, 333, 120, 24, 'Level')
  else
    end
  end
end
class Window_ShopBuy < Window_Selectable
#--------------------------------------------------------------------------
  # * Draw Item
  #     index : item number
  #--------------------------------------------------------------------------
  def initialize(x, y)
    super(x, y, 304, 304)
    @shop_goods = $game_temp.shop_goods
    @merchentily_skill = $game_variables[MERCANTILE_LEVEL]
    refresh
    self.index = 0
  end
  def draw_item(index)
    if MENU_UNLIMATER == true
      item_max_update
    item = @data[index]
    number = $game_party.item_number(item)
    if @item_max == -1
    enabled = (item.price * ( 100 / (@merchentily_skill + 1)) <= $game_party.gold and number >= 0)
    else
     enabled = (item.price * ( 100 / (@merchentily_skill + 1)) <= $game_party.gold and number < @item_max)
     end
    rect = item_rect(index)
    self.contents.clear_rect(rect)
    draw_item_name(item, rect.x, rect.y, enabled)
    rect.width -= 4
    self.contents.draw_text(rect, item.price * ( 100 / (@merchentily_skill + 1)), 2)
  else
    item = @data[index]
    number = $game_party.item_number(item)
    enabled = (item.price * ( 100 / (@merchentily_skill + 1)) <= $game_party.gold and number < 99)
    rect = item_rect(index)
    self.contents.clear_rect(rect)
    draw_item_name(item, rect.x, rect.y, enabled)
    rect.width -= 4
    self.contents.draw_text(rect, item.price * ( 100 / (@merchentily_skill + 1)), 2)
  end
end
end

class Window_ShopSell < Window_Item
  attr_accessor :disabled
  #--------------------------------------------------------------------------
  # * Whether or not to display in enabled state
  #     item : item
  #--------------------------------------------------------------------------

  def enable?(item)

   if (item.note.include? "<nosell>")
    disabled = false
  else
    disabled = true
    end
     return (disabled == true)
  end
end



Demo
Spoiler:
Attached File  Sell_item_limater.zip ( 244.02K ) Number of downloads: 76


This post has been edited by jesse120: May 13 2012, 09:40 PM


--------------------
I might not post anything for a while, but I am still here, watching. You may not see me, but I see you.
Still taking event requests. Still watching topics. I will see comments to my posts and respond.
I will probably not update any of my scripts for a while.

I have not gone!!!

Spoiler:

Master eventer
Need an unusual event call me and i might be able to make it
ex vehicle, pet
search number
I do take event requests
search number 10519195120
Please don't put this number on any of your own posts or topics
note: the search number will be on any post I make to aid in searching by author. If I forget to put it on a topic please notify me.

I will try to check any posts/PMs around 7:30 AM, 3:00 PM, and after 6 PM most days (time in Pacific Time)

The ultimate video game

Legend of, Elder, Fear, of Fabled, Fallout, Call, of Modern, Gears, of Halo, Metal, Ghost, Assassin, Mass, Homicide, Fantasy, 5
That stands for
Legend of Zelda, Elder Scrolls, ?????, Fable, Fallout, Call of Duty, Modern Warfare, Gears of War, Halo, Metal Gears, Ghost Recon, Assassin's Creed, Mass Effect, Auto Homicide, Final Fantasy, 5
Let me know if you want a game added to the list

If you are a believer of Jesus Christ, believe he is the only way to heaven, and are 100% proud of it, put this in your sig.
Go to the top of the page
 
+Quote Post
   
FenixFyreX
post Oct 5 2011, 01:28 PM
Post #2


I'm on fire 24/7 >:3
Group Icon


Type: Coder
Alignment: Lawful Good




Can you move the script into [ script ] tags, within [ spoiler ] tags? Codebox tags don't work so well, and there are smileys in your code...

Also, looking at your script, you don't need two scripts to accomplish your price difference. Don't hard-code stuff like that in. Simply have a constant variable at the top, say Price_Fix, and have the user set it to 1 for normal selling rate, 2 for half price.

PS. Don't post your topic twice. We'll get to it when we can.
Go to the top of the page
 
+Quote Post
   
fmjpr
post Oct 5 2011, 02:41 PM
Post #3



Group Icon


Type: Writer
Alignment: Chaotic Neutral




And you spelled limiter wrong. I fixed it in the topic title.


--------------------
Trailer for It Came From Yesterday: Click Me

This was made by a dear friend of mine. Any support is appreciated! Also, Like the Facebook page while you're at it: It Came From Yesterday

New and improved official site: ICFY

Swagbucks referral link: http://www.swagbucks.com/refer/jbart321
Go to the top of the page
 
+Quote Post
   
jesse120
post Oct 6 2011, 05:49 PM
Post #4


Master Eventer, Novice scripter, pathetic spriter
Group Icon


Type: Designer
Alignment: Chaotic Good




QUOTE (Oozonicus Slime @ Oct 5 2011, 07:41 AM) *
And you spelled limiter wrong. I fixed it in the topic title.

Thank you I am bad at selling.


--------------------
I might not post anything for a while, but I am still here, watching. You may not see me, but I see you.
Still taking event requests. Still watching topics. I will see comments to my posts and respond.
I will probably not update any of my scripts for a while.

I have not gone!!!

Spoiler:

Master eventer
Need an unusual event call me and i might be able to make it
ex vehicle, pet
search number
I do take event requests
search number 10519195120
Please don't put this number on any of your own posts or topics
note: the search number will be on any post I make to aid in searching by author. If I forget to put it on a topic please notify me.

I will try to check any posts/PMs around 7:30 AM, 3:00 PM, and after 6 PM most days (time in Pacific Time)

The ultimate video game

Legend of, Elder, Fear, of Fabled, Fallout, Call, of Modern, Gears, of Halo, Metal, Ghost, Assassin, Mass, Homicide, Fantasy, 5
That stands for
Legend of Zelda, Elder Scrolls, ?????, Fable, Fallout, Call of Duty, Modern Warfare, Gears of War, Halo, Metal Gears, Ghost Recon, Assassin's Creed, Mass Effect, Auto Homicide, Final Fantasy, 5
Let me know if you want a game added to the list

If you are a believer of Jesus Christ, believe he is the only way to heaven, and are 100% proud of it, put this in your sig.
Go to the top of the page
 
+Quote Post
   
jesse120
post Oct 6 2011, 06:28 PM
Post #5


Master Eventer, Novice scripter, pathetic spriter
Group Icon


Type: Designer
Alignment: Chaotic Good




QUOTE (FuneralPyreX @ Oct 5 2011, 06:28 AM) *
Can you move the script into [ script ] tags, within [ spoiler ] tags? Codebox tags don't work so well, and there are smileys in your code...

I didn't know that there was a diferent version of the code box so I just used what I knew thank you for informing me of that. I think I got the box right on this one.

QUOTE (FuneralPyreX @ Oct 5 2011, 06:28 AM) *
Also, looking at your script, you don't need two scripts to accomplish your price difference. Don't hard-code stuff like that in. Simply have a constant variable at the top, say Price_Fix, and have the user set it to 1 for normal selling rate, 2 for half price.

I originaly tried that with variables and didn't even think of a constant thanks.

QUOTE (FuneralPyreX @ Oct 5 2011, 06:28 AM) *
PS. Don't post your topic twice. We'll get to it when we can.

Sorry about that.

This post has been edited by jesse120: Oct 27 2011, 11:13 PM


--------------------
I might not post anything for a while, but I am still here, watching. You may not see me, but I see you.
Still taking event requests. Still watching topics. I will see comments to my posts and respond.
I will probably not update any of my scripts for a while.

I have not gone!!!

Spoiler:

Master eventer
Need an unusual event call me and i might be able to make it
ex vehicle, pet
search number
I do take event requests
search number 10519195120
Please don't put this number on any of your own posts or topics
note: the search number will be on any post I make to aid in searching by author. If I forget to put it on a topic please notify me.

I will try to check any posts/PMs around 7:30 AM, 3:00 PM, and after 6 PM most days (time in Pacific Time)

The ultimate video game

Legend of, Elder, Fear, of Fabled, Fallout, Call, of Modern, Gears, of Halo, Metal, Ghost, Assassin, Mass, Homicide, Fantasy, 5
That stands for
Legend of Zelda, Elder Scrolls, ?????, Fable, Fallout, Call of Duty, Modern Warfare, Gears of War, Halo, Metal Gears, Ghost Recon, Assassin's Creed, Mass Effect, Auto Homicide, Final Fantasy, 5
Let me know if you want a game added to the list

If you are a believer of Jesus Christ, believe he is the only way to heaven, and are 100% proud of it, put this in your sig.
Go to the top of the page
 
+Quote Post
   
jesse120
post Mar 29 2012, 11:54 PM
Post #6


Master Eventer, Novice scripter, pathetic spriter
Group Icon


Type: Designer
Alignment: Chaotic Good




Version 2.2 is out and now the variable can be left at 0. Just please don't set it to -1!


--------------------
I might not post anything for a while, but I am still here, watching. You may not see me, but I see you.
Still taking event requests. Still watching topics. I will see comments to my posts and respond.
I will probably not update any of my scripts for a while.

I have not gone!!!

Spoiler:

Master eventer
Need an unusual event call me and i might be able to make it
ex vehicle, pet
search number
I do take event requests
search number 10519195120
Please don't put this number on any of your own posts or topics
note: the search number will be on any post I make to aid in searching by author. If I forget to put it on a topic please notify me.

I will try to check any posts/PMs around 7:30 AM, 3:00 PM, and after 6 PM most days (time in Pacific Time)

The ultimate video game

Legend of, Elder, Fear, of Fabled, Fallout, Call, of Modern, Gears, of Halo, Metal, Ghost, Assassin, Mass, Homicide, Fantasy, 5
That stands for
Legend of Zelda, Elder Scrolls, ?????, Fable, Fallout, Call of Duty, Modern Warfare, Gears of War, Halo, Metal Gears, Ghost Recon, Assassin's Creed, Mass Effect, Auto Homicide, Final Fantasy, 5
Let me know if you want a game added to the list

If you are a believer of Jesus Christ, believe he is the only way to heaven, and are 100% proud of it, put this in your sig.
Go to the top of the page
 
+Quote Post
   
jesse120
post Apr 14 2012, 12:06 AM
Post #7


Master Eventer, Novice scripter, pathetic spriter
Group Icon


Type: Designer
Alignment: Chaotic Good




Incompatibility located. This script must be placed bellow DRIACS chest inventory system they will both work fully if placed in that order.


--------------------
I might not post anything for a while, but I am still here, watching. You may not see me, but I see you.
Still taking event requests. Still watching topics. I will see comments to my posts and respond.
I will probably not update any of my scripts for a while.

I have not gone!!!

Spoiler:

Master eventer
Need an unusual event call me and i might be able to make it
ex vehicle, pet
search number
I do take event requests
search number 10519195120
Please don't put this number on any of your own posts or topics
note: the search number will be on any post I make to aid in searching by author. If I forget to put it on a topic please notify me.

I will try to check any posts/PMs around 7:30 AM, 3:00 PM, and after 6 PM most days (time in Pacific Time)

The ultimate video game

Legend of, Elder, Fear, of Fabled, Fallout, Call, of Modern, Gears, of Halo, Metal, Ghost, Assassin, Mass, Homicide, Fantasy, 5
That stands for
Legend of Zelda, Elder Scrolls, ?????, Fable, Fallout, Call of Duty, Modern Warfare, Gears of War, Halo, Metal Gears, Ghost Recon, Assassin's Creed, Mass Effect, Auto Homicide, Final Fantasy, 5
Let me know if you want a game added to the list

If you are a believer of Jesus Christ, believe he is the only way to heaven, and are 100% proud of it, put this in your sig.
Go to the top of the page
 
+Quote Post
   
jesse120
post May 13 2012, 09:43 PM
Post #8


Master Eventer, Novice scripter, pathetic spriter
Group Icon


Type: Designer
Alignment: Chaotic Good




version 2.3 is now compatible with my menu unlimiter


--------------------
I might not post anything for a while, but I am still here, watching. You may not see me, but I see you.
Still taking event requests. Still watching topics. I will see comments to my posts and respond.
I will probably not update any of my scripts for a while.

I have not gone!!!

Spoiler:

Master eventer
Need an unusual event call me and i might be able to make it
ex vehicle, pet
search number
I do take event requests
search number 10519195120
Please don't put this number on any of your own posts or topics
note: the search number will be on any post I make to aid in searching by author. If I forget to put it on a topic please notify me.

I will try to check any posts/PMs around 7:30 AM, 3:00 PM, and after 6 PM most days (time in Pacific Time)

The ultimate video game

Legend of, Elder, Fear, of Fabled, Fallout, Call, of Modern, Gears, of Halo, Metal, Ghost, Assassin, Mass, Homicide, Fantasy, 5
That stands for
Legend of Zelda, Elder Scrolls, ?????, Fable, Fallout, Call of Duty, Modern Warfare, Gears of War, Halo, Metal Gears, Ghost Recon, Assassin's Creed, Mass Effect, Auto Homicide, Final Fantasy, 5
Let me know if you want a game added to the list

If you are a believer of Jesus Christ, believe he is the only way to heaven, and are 100% proud of it, put this in your sig.
Go to the top of the page
 
+Quote Post
   
jesse120
post Sep 10 2013, 02:33 AM
Post #9


Master Eventer, Novice scripter, pathetic spriter
Group Icon


Type: Designer
Alignment: Chaotic Good




I might not post anything for a while, but I am still here, watching. You may not see me, but I see you.
Still taking event requests. Still watching topics. I will see comments to my posts and respond.
I will probably not update any of my scripts for a while.

I have not gone!!!


--------------------
I might not post anything for a while, but I am still here, watching. You may not see me, but I see you.
Still taking event requests. Still watching topics. I will see comments to my posts and respond.
I will probably not update any of my scripts for a while.

I have not gone!!!

Spoiler:

Master eventer
Need an unusual event call me and i might be able to make it
ex vehicle, pet
search number
I do take event requests
search number 10519195120
Please don't put this number on any of your own posts or topics
note: the search number will be on any post I make to aid in searching by author. If I forget to put it on a topic please notify me.

I will try to check any posts/PMs around 7:30 AM, 3:00 PM, and after 6 PM most days (time in Pacific Time)

The ultimate video game

Legend of, Elder, Fear, of Fabled, Fallout, Call, of Modern, Gears, of Halo, Metal, Ghost, Assassin, Mass, Homicide, Fantasy, 5
That stands for
Legend of Zelda, Elder Scrolls, ?????, Fable, Fallout, Call of Duty, Modern Warfare, Gears of War, Halo, Metal Gears, Ghost Recon, Assassin's Creed, Mass Effect, Auto Homicide, Final Fantasy, 5
Let me know if you want a game added to the list

If you are a believer of Jesus Christ, believe he is the only way to heaven, and are 100% proud of it, put this in your sig.
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 23rd April 2014 - 06:41 PM

RPGMakerVX.net is an Privacy Policy, Legal.