dsiver144

Dark's Extra Item

Mar 17th, 2016
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. #===============================================================================
  2. # ╔══════════════════════════════════╗
  3. # ║ ▼ Dark's Extra Item ║
  4. # ║ ▼ Author: Nhat Nguyen (Dark Sky) ║
  5. # ║ ▼ Release Date: March 18th 2016 ║
  6. # ║ ▼ Forum: TaoTroChoi.com ║
  7. # ╚══════════════════════════════════╝
  8. #-------------------------------------------------------------------------------
  9. # Version 1.0: Release!
  10. #-------------------------------------------------------------------------------
  11. # Yêu cầu: None
  12. #-------------------------------------------------------------------------------
  13. # Chức năng: Nhận được các item khác khi sử dụng một item.
  14. # Notetag (Items): <extra_item: x> : Nhận được item có ID là x trong Database.
  15. # Lưu ý: Có thể dùng nhiều dòng Note như vậy trong ô Note của Item. Để khi sử
  16. # dụng có thể cho ra 2,3 item phụ.
  17. #-------------------------------------------------------------------------------
  18. # Script call: None
  19. #===============================================================================
  20. Extra_ITEM_TOKEN = /<extra_item:\s*(\w+)>/i #Don't Touch!
  21. #===============================================================================
  22. class Scene_ItemBase
  23. #---------------------------------------------------------------------------
  24. # * Use Item
  25. #---------------------------------------------------------------------------
  26. alias :dark_extra_item_scene_itembase_useitem :use_item
  27. def use_item
  28. notes = item.note
  29. extra_is = []
  30. notes.split(/[\r\n]+/).each do |line|
  31. if line =~ Extra_ITEM_TOKEN
  32. extra_is.push($data_items[$1.to_i])
  33. end
  34. end
  35. dark_extra_item_scene_itembase_useitem()
  36. extra_is.each do |item|
  37. $game_party.gain_item(item,1)
  38. end
  39. extra_is.clear
  40. end
  41. end
Advertisement
Add Comment
Please, Sign In to add comment