Increase Item cost (Solved)

Started by Jackolas, October 28, 2009, 03:55:43 pm

Previous topic - Next topic

Jackolas

October 28, 2009, 03:55:43 pm Last Edit: November 02, 2009, 03:02:05 am by Jackolas
working on a script atm.
but I wane know how I can add a number to the cost of an item
the reason for this is because the database is limited to max 99999G for an item.
I want to increase this by adding for example 100000G so the item would cost 199999G in a shop

how can I do this true a script?

G_G

$data_items[x].price += price

that would add but if you just want to set it do this
$data_items[x].price = price

Jackolas

October 28, 2009, 05:14:56 pm #2 Last Edit: October 29, 2009, 03:17:00 am by Jackolas
nvm.. just found out that your Equipment Stat Breaker works like a dream for this :P
(is the code you just linked up)

EDIT: (new problem)

I know how I can add new prices etc.. but it would require the user of the script to add loads of lines somewhere middle in the script.
is it possible for example to link it to a configuration part of the script

for example.

somewhere in a script I have:

$data_items[x].price = y
x = my_script_config::x_price
y = my_script_config::y_price


and than in my configuration of my script:

config something[x,y]{
[1,100],
[2,200]
[etc,etc]}


it is possible... just can't figure out how to do it with my limited scripting knowledge.

G_G

use it like this or something
class RPG::Item
 def price
   case @id
   when 1 then return 100
   end
   return 10
 end
end

Jackolas

October 29, 2009, 07:42:25 am #4 Last Edit: October 29, 2009, 09:13:43 am by Jackolas
yeah.. that should work.

but how do I change the weapon price and the armor price than?

G_G

Here you go
module RPG
  class Item
    def price
      case @id
      when 1 then return 100
      end
      return @price
    end
  end
  class Weapon
    def price
      case @id
      when 1 then return 100
      end
      return @price
    end
  end
  class Armor
    def price
      case @id
      when 1 then return 100
      end
      return @price
    end
  end
end

Jackolas