Advertisement
mikb89

[Ace] Custom Sell Price v1.0

Jan 6th, 2013
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.56 KB | None | 0 0
  1. # Custom Sell Price v. 1.0
  2. # VX Ace version
  3. # by mikb89
  4.  
  5. # Dettagli:
  6. #  Questo script permette di avere un prezzo di vendita (quindi guadagno per il
  7. #   giocatore) personalizzato per ogni oggetto, arma e armatura del database.
  8. #  Può essere abilitato e disabilitato con uno switch. I prezzi vanno impostati
  9. #   nei notebox.
  10.  
  11. # Configurazioni:
  12. module SELLPRICE
  13.   SALES_SWITCH = 81
  14.    # Switch da mettere ON/OFF per attivare/disattivare lo script
  15. end
  16. #  Nei rispettivi notebox scrivere ad esempio:
  17. #  <prezzo vendita: 10>
  18. #  Per avere un guadagno di 10 monete alla vendita dell'oggetto/arma
  19.  
  20. #Codename: sellprice
  21.  
  22. ($imported ||= {})[:mikb89_sellprice] = true
  23.  
  24. # License:
  25. # - You can ask me to include support for other scripts as long as these scripts
  26. #   use the $imported[script] = true;
  27. # - You can modify and even repost my scripts, after having received a response
  28. #   by me. For reposting it, anyway, you must have done heavy edit or porting,
  29. #   you can't do a post with the script as is;
  30. # - You can use my scripts for whatever you want, from free to open to
  31. #   commercial games. I'd appreciate by the way if you let me know about what
  32. #   you're doing;
  33. # - You must credit me, if you use this script or part of it.
  34.  
  35. class Scene_Shop < Scene_MenuBase
  36.   alias_method(:sell_price_b4_sellprice, :selling_price) unless method_defined?(:sell_price_b4_sellprice)
  37.   def selling_price
  38.     if $game_switches[SELLPRICE::SALES_SWITCH] && @item.note =~ /<prezzo vendita[:]?[ ]*([0-9]+)>/i
  39.       return $1.to_i
  40.     end
  41.     sell_price_b4_sellprice
  42.   end
  43. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement