[VX] VTP Multi-Drop

Started by Jragyn, September 16, 2010, 12:42:36 am

Previous topic - Next topic

Jragyn

VTP Multi-Drop
Authors: Blizzard, J
Version: 1
Type: Item Drop Editor
Key Term: Battle Add-on



Introduction

This script allows for the scripter to have a single enemy drop more than just two items at once.


Features


  • Simple Setup.
  • All setup in one area of script.
  • Enemies can drop any number of items! (haven't tested outrageous numbers, though.)



Screenshots

Screenshot is unnecessary.


Demo

Again, unnecessary.


Script
=begin
  Version::1.0

  Multi-Drop by Blizzard
  Ported to VX by J
    For use with Vampyr's ABS
 
=end

module J
 
  def self.drop_config(id)
    i,w,a = 1,2,3 # sensible variables for items,weapons,armor
    always,veryhigh,high,normal,low,verylow,onepercent = 100,85,70,50,30,15,1
    case id
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Drop Database
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
#             [item_type, item_id, %chance]

    when 1 then return [ # Slime
#      [i, 2, always],
#      [a, 15, 100],
#      [w, 4, 5]
      ]
    when 2 then return [ # Kobold
      ]
    when 3 then return [ #BOSS Ogre
      ]
    when 4 then return [ # Goop
      ]
    when 5 then return [ # Bot
      ]
    when 6 then return [ #BOSS Robox
      ]
    when 7 then return [ # Batgoyle
      ]
    when 8 then return [ # Skeleton
      ]
    when 9 then return [ # Werewolf
      ]
    when 10 then return [ #BOSS Giant Slime
      ]
    when 11 then return [ # RARE: Rogue Bot
      ]
    when 12 then return [ # Blob
      ]
    when 13 then return [ # Leg Eater
      ]
    when 14 then return [ # Thief
      ]
    when 15 then return [ # Wingbat
      ]
    when 16 then return [ # Ghast
      ]
    when 17 then return [ # Spirit
      ]
    when 18 then return [ # Alpha Werewolf
      ]
    when 19 then return [ # Azure Drake
      ]
    when 20 then return [ # Cobalt Jelly
      ]
    when 21 then return [ # Dryad
      ]
    when 22 then return [ # Leg Chomper
      ]
    when 23 then return [ # Hardy Drake
      ]
    when 24 then return [ # Mimic
      ]
    when 25 then return [ #BOSS Behemoth
      ]

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Drop Database
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
end

    for i in [$data_enemies[id].drop_item1, $data_enemies[id].drop_item2]
    dropped_items = []
        next if i.kind == 0
        next if rand(di.denominator) != 0
        if i.kind == 1
          dropped_items << $data_items[i.item_id]
        elsif i.kind == 2
          dropped_items << $data_weapons[i.weapon_id]
        elsif i.kind == 3
          dropped_items << $data_armors[i.armor_id]
        end
    return [[0, 0, 0]]
  end
end

  def self.items(enemy)
    dropped_items = []
    return if enemy.id == nil
    self.drop_config(enemy.id).each {|x|
        if rand(100) < x[2]
          case x[0]
          when 1 then dropped_items << $data_items[x[1]]
          when 2 then dropped_items << $data_weapons[x[1]]
          when 3 then dropped_items << $data_armors[x[1]]
          end
        end}
    # result
    return dropped_items
  end

end



Instructions

This script goes beneath the VTP ABS System, and above main.


Compatibility

This script is EXPLICITY COMPATIBLE WITH VERUS TEMPUS PROELIUM ABS.
If it works with other battle systems, thats great, but I haven't tested it, and doubt it does.


Credits and Thanks


  • Vampyr, as he is the one who ultimately created the ABS.
  • Blizzard, for he pretty much wrote this script.
  • Me, J! As I took the minimal effort it required to work it into this VX system.



Author's Notes

I put this together based around a a VTP+ script I put together, so if this for whatever reason doesn't work, please identify the problem and/or script error+line, and I'll see if I can't remedy it.

This is a release because I found it in my list, and this forum has a wimpy selection of VX scripts (compared to its XP selection).
A bright light can either illuminate or blind, but how will you know which until you open your eyes?

Xzygon

Doesn't drop. I set it to always, and it never drops. You forgot to alias at least one definition as well, that may have been the problem.