Jump to content

Announcing our new website

To find out the latest about our new website, visit Game Dev Unlimited

(Thanks everyone, Solved!)Multi treasure/loot?(Solved)


  • You cannot reply to this topic
25 replies to this topic

#1 -Luke-

    Newbie

  • Member
  • 14 posts

Posted 10 March 2010 - 10:14 PM

I've posted something like this on 3 forums and searched all over the web but i can't find a good way to make multiple drops. When you go into database there's ONE treasure spot. Can i have a script or a link anyone? Or can someone make a demo? So i just want let's say a 50% chance of getting a sword and a 40% chance of getting a shield.

And don't say to do the thing where you make two troops, i have a action battle system.

~Thanks~Luke~

:D :B): :rofl:

#2 ShinyToyGuns

    Supreme Member

  • Member
  • 531 posts

Posted 10 March 2010 - 10:25 PM

Have you tried Tons of Add-ons over at Chaos Project?

There's a multi-drop script in there somewhere, as well as a bunch of other nifty scripts.

#3 RATED-RKOFRANKLIN

    Cult of Personality

  • Member
  • 2,427 posts

Posted 10 March 2010 - 10:27 PM

I never heard of that before. It's an interesting idea.

#4 -Luke-

    Newbie

  • Member
  • 14 posts

Posted 10 March 2010 - 11:01 PM

That script you gave me the link to was confusing :blink: Well i'm not good at knowing how to place them and how to use scripts..If anyone could either give me a script with easy to under stand of step-by-step, or they could make a demo =]

~Thanks~Luke~

#5 RATED-RKOFRANKLIN

    Cult of Personality

  • Member
  • 2,427 posts

Posted 10 March 2010 - 11:20 PM

Just place the scripts just like it is in the Chaos Project and it should work.

#6 -Luke-

    Newbie

  • Member
  • 14 posts

Posted 10 March 2010 - 11:22 PM

I copied all 3 scripts into my game, but i don't know how to customize it to my needs, where do i edit what enemies drop what like it's saying? Where do i add those in?

#7 ShinyToyGuns

    Supreme Member

  • Member
  • 531 posts

Posted 10 March 2010 - 11:31 PM

In the second script, just ctrl+F "Multi-drop" without the quotes, and you should be able to find it.

#8 -Luke-

    Newbie

  • Member
  • 14 posts

Posted 10 March 2010 - 11:36 PM

Okay, but when i just take the multi-script part of it, it still doesn't do anything. I copy and pasted the whole multi-script area in part2 and put it in a new script. What's the next step? What do i add or fill in to what to make the changes i need for my game?

#9 RATED-RKOFRANKLIN

    Cult of Personality

  • Member
  • 2,427 posts

Posted 10 March 2010 - 11:52 PM

Oh Yeah I forgot to say this. Welcome to the forums. It's good to see a new member.

#10 -Luke-

    Newbie

  • Member
  • 14 posts

Posted 10 March 2010 - 11:54 PM

Thanks for the welcome =]

#11 -Luke-

    Newbie

  • Member
  • 14 posts

Posted 10 March 2010 - 11:54 PM

So here's the code. I don't know where to put something like when it's saying to put 'when 1 then return [[1, 2, 50], [3, 15, 10], [2, 4, 5]]'. where do i put one of that with my customized info in it?

:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Multi-Drop by Blizzard
# Version: 1.1b
# Type: Game Alteration
# Date: 13.11.2007
# Date v1.0b: 3.4.2008
# Date v1.1b: 5.6.2008
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# 
# Compatbility:
#   
#   Compatible with RTAB and Blizz-ABS 1.70 and higher. Will most probably
#   cause problems with CBS-es that have the start_phase5 method modified.
# 
# 
# Explanation:
#   
#   This add-on allows you to make enemies that drop more than one item. The
#   drops are independent, so if an enemy drops one item, he can drop another
#   one as well. An enemy can even have a couple of drop of the same item.
#   
#   
# Instructions:
#   
#   Configure the drop database below and set up the compatibility
#   configuration. The compatibility ocnfiguration is only needed if you are
#   using RTAB. Blizz-ABS 1.70 and higher will be recognized automatically.
#   
#   
# Side note:
#   
#   This add-on could have been written in less than 100 lines of code, but
#   full RTAB compatbility takes its piece of code.
#   
#   
# If you find any bugs, please report them here:
# http://forum.chaos-project.com
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

if TONS_OF_ADDONS::MULTI_DROP

#==============================================================================
# module BlizzCFG
#==============================================================================

module BlizzCFG
  
  # set this to true if you are using RTAB
  RTAB_USE = false
  # set this to true if you are using Animated Battlers in RTAB
  RTAB_ANIMA = false
  # set this to true if you are using Battle Report v1.6 by Illustrationism
  RTAB_REPORT = false
  # limit of maximum items dropped, 0xFFFF is infinite
  ITEM_LIMIT = 0xFFFF
  
  def self.drop_configuration(id)
    case id
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Drop Database
# 
#   Use the following template for configuration:
# 
#     when ID then return [[TYPE1, I_ID1, CH1], [TYPE2, I_ID2, CH2], ...]
#   
#   ID   - enemy ID in the database
#   TYPE - the drop type; 1 for items; 2 for weapons; 3 for armors
#   I_ID - the drop item ID in the database
#   CH   - drop chance
# 
#   You can add as many drops as you want, separate them with commas. Keep in
#   mind that if you set TYPE to 0, the drop is disabled and that you MUST NOT
#   set I_ID to 0. If an enemy is not configured here, the default
#   configuration from your database will be used, otherwise the default
#   configuration from your database will be COMPLETELY OVERRIDEN.
#   
#   Example 1:
#     
#     when 1 then return [[1, 2, 50], [3, 15, 10], [2, 4, 5]]
#   
#   Monster with ID 1 can drop:
#     1 Item ID 2, chance 50%
#     1 Armor ID 15, chance 10%
#     1 Weapon ID 4, chance 5%
#     
#   Example 2:
#     
#     when 2 then return [[1, 1, 50], [1, 1, 40]]
#   
#   Monster with ID 2 can drop:
#     1 Item ID 1, chance 50%
#     1 Item ID 1, chance 40%
#   Full chances of drops because of repeating items:
#     nothing, chance 30%
#     1 Item ID 1, chance 50%
#     2 Items ID 1, chance 20%
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    when 1 then return [[1, 2, 50], [3, 15, 10], [2, 4, 5]]
      
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Drop Database
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    end
    # return normal item drop if exists
    if $data_enemies[id].item_id > 0
      return [[1, $data_enemies[id].item_id, $data_enemies[id].treasure_prob]]
    elsif $data_enemies[id].weapon_id > 0
      return [[2, $data_enemies[id].weapon_id, $data_enemies[id].treasure_prob]]
    elsif $data_enemies[id].armor_id > 0
      return [[3, $data_enemies[id].armor_id, $data_enemies[id].treasure_prob]]
    end
    # no drop
    return [[0, 0, 0]]
  end
  #----------------------------------------------------------------------------
  # dropped_items
  #  enemy - a killed enemy
  #  This method returns an array of all dropped items.
  #----------------------------------------------------------------------------
  def self.dropped_items(enemy)
    # initialize array
    items = []
    # get drops and start iteration through all drops
    self.drop_configuration(enemy.id).each {|i|
        # if got item
        if rand(100) < i[2]
          # add item, weapon or armor
          case i[0]
          when 1 then items.push($data_items[i[1]])
          when 2 then items.push($data_weapons[i[1]])
          when 3 then items.push($data_armors[i[1]])
          end
        end}
    # result
    return items
  end

end

#==============================================================================
# Scene_Battle
#==============================================================================

class Scene_Battle
  
  #----------------------------------------------------------------------------
  # start_phase5
  #  This method was completely modified to support multi-drop.
  #----------------------------------------------------------------------------
  def start_phase5
    # if RTAB and Animated Battlers in use
    if BlizzCFG::RTAB_USE && BlizzCFG::RTAB_ANIMA
      # don't end battle as long as an actor is moving around
      $game_party.actors.each {|actor| return if @spriteset.battler(actor).moving}
      # see if an actor remains alive
      $victory = true if $game_party.actors.any? {|actor| !actor.dead?}
      # see if an enemy remains alive
      $defeat = true if $game_troop.enemies.reverse.any? {|enemy| !enemy.dead?}
    end
    @phase = 5
    # set audio
    $game_system.me_play($game_system.battle_end_me)
    $game_system.bgm_play($game_temp.map_bgm)
    # initialize variables
    exp, gold, treasures = 0, 0, []
    # if using RTAB
    if BlizzCFG::RTAB_USE && !BlizzCFG::RTAB_REPORT
      # dispose and setup special things from RTAB
      @active_actor.blink = false if @active_actor != nil
      $game_temp.battle_main_phase = true
      @party_command_window.active = @party_command_window.visible =
      @actor_command_window.active = @actor_command_window.visible = false
      [@skill_window, @item_window].each {|win| win.dispose if win != nil}
      @skill_window = @item_window = nil
      @help_window.visible = false if @help_wait == 0
    end
    # iterate through all enemies
    $game_troop.enemies.each {|enemy|
        # if enemy isn't hidden
        unless enemy.hidden
          # get exp and gold
          exp += enemy.exp
          gold += enemy.gold
          # get all dropped items
          treasures += BlizzCFG.dropped_items(enemy)
        end}
    # limits treasures to a specific number
    treasures = treasures[3..BlizzCFG::ITEM_LIMIT]
    # if used battle RTAB battle report
    if BlizzCFG::RTAB_REPORT
      # used by battle report
      @exp, @gold, @treasures = exp, gold, treasures
    else
      # iterate through all actor indices
      $game_party.actors.each_index {|i|
          actor = $game_party.actors[i]
          # if actor can get EXP
          unless actor.cant_get_exp?
            # store last level
            last_level = actor.level
            actor.exp += exp
            # if level increased after adding EXP
            if actor.level > last_level
              @status_window.level_up(i)
              # if using RTAB
              if BlizzCFG::RTAB_USE
                # execute special RTAB commands
                actor.damage[[actor, -1]] = 'Level up!'
                actor.up_level = actor.level-last_level
              end
            end
          end}
      # add to party's gold
      $game_party.gain_gold(gold)
      # create result window
      @result_window = Window_BattleResult.new(exp, gold, treasures)
    end
    # iterate through all treasures
    treasures.each {|item|
        # add gained treaures to party's inventory
        case item
        when RPG::Item then $game_party.gain_item(item.id, 1)
        when RPG::Weapon then $game_party.gain_weapon(item.id, 1)
        when RPG::Armor then $game_party.gain_armor(item.id, 1)
        end}
    @phase5_wait_count = 100
  end
  
end

end


#12 Agckuu_Coceg

    If you can't beat them, join them.

  • Member
  • 328 posts

Posted 11 March 2010 - 08:38 AM

Hey, the script carefully consider it. There, everything is clear and simple.

( :blink: ) when 1 then return [[1, 2, 50], [3, 15, 10], [2, 4, 5]]

You doing like this:
when 1 then return [[Item number, Item ID, Chance]...]
when 2 then return [[Item number, Item ID, Chance]...]
when 3 then return [[Item number, Item ID, Chance]...]
...

And do this again. This is simple.

#13 -Luke-

    Newbie

  • Member
  • 14 posts

Posted 11 March 2010 - 08:50 PM

Didn't work when i did that..I'll try again i guess..

#14 -Luke-

    Newbie

  • Member
  • 14 posts

Posted 11 March 2010 - 11:33 PM

I still can't figure it out and i've posted this on many many forums all over. Thanks guys for the help but i'm still not getting this.

Now i'm requesting a demo and i will absolutely grateful to the person who can help me figure it out and i will credit them.

I am using Mr.Mo's Action Battle System so keep in mind, i don't know if that will effect how it works. I don't care if it's Tons of Addons scripts or something different.

-OOPS CAN A STAFF DELETE THE OTHER 2 OF THESE IT POSTED A BUNCH I DIDNT EVEN CLICK IT MORE THAN ONE TIME-

#15 -Luke-

    Newbie

  • Member
  • 14 posts

Posted 11 March 2010 - 11:33 PM

Staff Delete Please!

#16 -Luke-

    Newbie

  • Member
  • 14 posts

Posted 11 March 2010 - 11:44 PM

Staff Delete Please!

#17 ShinyToyGuns

    Supreme Member

  • Member
  • 531 posts

Posted 12 March 2010 - 12:48 AM

Exactly what sort of demo are you looking for? I might be able to help, as I've used Tons of Add-Ons before, and it's worked fine for me.

#18 UrHappyPlz

    Loyal Member

  • Member
  • 162 posts

Posted 12 March 2010 - 12:50 AM

Woah, please refrain from quadruple-posting...

..anyway, that sounds like a neat script to try out. I'll take a crack at it and if I figure it out, I'll let you know.

...wait, will this work with Mr. Mo's ABS? Or the default battle system?

#19 -Luke-

    Newbie

  • Member
  • 14 posts

Posted 12 March 2010 - 01:02 AM

@Shiny-A demo with working Multi-drops. I just need a simple demo with the scripts and just one map with an enemy that has 2 or 3 working drops, and they both have a chance of getting. Thanks.

@UrHappy-Thanks,I appreciate it.

#20 ShinyToyGuns

    Supreme Member

  • Member
  • 531 posts

Posted 12 March 2010 - 01:12 AM

Ok, I made a quick demo using Blizz-ABS and Tons of Add-Ons...it doesn't say when the enemy drops, but if you check your inventory after battle, you should have one of Item ID 1, 2, and 3. (I set each of them to drop 100%).

You can use default controls, and to attack, use Tab.

Mediafire Download


Edit: woot...300 posts :D

#21 -Luke-

    Newbie

  • Member
  • 14 posts

Posted 12 March 2010 - 01:16 AM

Grats on 300th post. I'm Testing right now..Thanks.

#22 ShinyToyGuns

    Supreme Member

  • Member
  • 531 posts

Posted 12 March 2010 - 01:17 AM

No problem, lemme know if it works/if you have any questions :)

#23 -Luke-

    Newbie

  • Member
  • 14 posts

Posted 12 March 2010 - 01:24 AM

I copied the exact script and used the same enemy but no positive results. I'm starting to think it has something to do with the ABS i'm using, so i'm going to try Blizz. I'll let you know how that turns out, Thanks so much guys.

#24 ShinyToyGuns

    Supreme Member

  • Member
  • 531 posts

Posted 12 March 2010 - 01:27 AM

Yea, it probably is incompatible with Mr. Mo's ABS...personally, I prefer Blizz-ABS, because it's compatible with a lot of scripts, and it's easier to understand than most other ABS systems (at least I think so).

#25 -Luke-

    Newbie

  • Member
  • 14 posts

Posted 12 March 2010 - 01:34 AM

It worked. Finally i get good results. The fact that i have to use Blizz which i'm not too used to isn't the best, but i can fiddle around with it to fit my needs. Thank so much Shiny and everyone else that helped =]. I'll credit everyone that helped into my game.

:) :D :yes: :lol: :drool: :clap: :alright: :biggrin_002:

~Thanks~Luke~

#26 ShinyToyGuns

    Supreme Member

  • Member
  • 531 posts

Posted 12 March 2010 - 01:36 AM

No problem, it was my pleasure :)

If you need any help with Blizz-ABS, just ask.

PS ~ I recommend downloading the configuration utility if you want to assign your own custom controls, etc. without fiddling with the script. It can be found in the official Blizz-ABS thread.

PPS ~ If this problem is solved, edit your first post so that it has [SOLVED] in the title :)

Edited by ShinyToyGuns, 12 March 2010 - 01:48 AM.






0 user(s) are reading this topic

members, guests, anonymous users