Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #=======BERRY TREES By Maurili(Derek)======#
- #to call this use berrytree(berry1,berry2,berry3) were BERRY is the name of the items#
- #you wish the tree to drop#
- #you need to add an encounter type "BerryTree" in PField_Encounters otherwise#
- #the script will break!#
- #==========================================#
- def berrytree(berry1,berry2,berry3)
- #===================#
- drops1 = 0
- drops2 = 0
- drops3 = 0
- total1 = 0
- total2 = 0
- total3 = 0
- #===============================#
- pbMessage(_INTL("Berries are in the tree!"))
- if pbConfirmMessage(_INTL("Would you like to shake this tree?"))
- loop do
- #============================#
- drops1 = 1 + rand(3)
- drops2 = 1 + rand(2)
- drops3 = 1 + rand(1)
- #=============================#
- if drops2 >0 && drops3 >0
- pbMessage(_INTL("The tree droped {1} x {2} , {3} x {4} , {5} x {6}",PBItems.getName(getID(PBItems,berry1)),drops1,PBItems.getName(getID(PBItems,berry2)),drops2 ,PBItems.getName(getID(PBItems,berry3)),drops3))
- elsif drops2 >0
- pbMessage(_INTL("The tree droped {1} x {2} , {3} x {4} ",PBItems.getName(getID(PBItems,berry1)),drops1,PBItems.getName(getID(PBItems,berry2)),drops2))
- else
- pbMessage(_INTL("The tree droped {1} x {2}. ",PBItems.getName(getID(PBItems,berry1)),drops1))
- end
- #Pick all beries and generate agession#
- total1 = total1+drops1
- total2 = total2+drops2
- total3 = total3+drops3
- #===========#
- agression = rand(50)
- #============#
- if agression >= 10
- pbMessage(_INTL("The tree is shaking... maybe there's something in the tree?"))
- end
- if pbConfirmMessage(_INTL("Would you like to continue shaking the tree?"))
- #Shake tree
- if agression >= 30
- pbMessage(_INTL("A pokemon jumped from the tree!"))
- pbEncounter(:BerryTree)
- total1/2
- total2/2
- total3/2
- pbMessage(_INTL("The pokemon stole most of the berries..."))
- if total2 >0 && total3 >0
- pbMessage(_INTL("You pick up the leftover berries..."))
- #pbMessage(_INTL("{1} x {2} , {3} x {4} , {5} x {6}",PBItems.getName(getID(PBItems,berry1)),total1,PBItems.getName(getID(PBItems,berry2)),total2 ,PBItems.getName(getID(PBItems,berry3)),total3))
- pbItemBall(berry1,total1)
- pbItemBall(berry2,total2)
- pbItemBall(berry3,total3)
- return true
- elsif total2 >0
- pbMessage(_INTL("You pick up the leftover berries..."))
- #pbMessage(_INTL("{1} x {2} , {3} x {4} ",PBItems.getName(getID(PBItems,berry1)),total1,PBItems.getName(getID(PBItems,berry2)),total2))
- pbItemBall(berry1,total1)
- pbItemBall(berry2,total2)
- return true
- else
- pbMessage(_INTL("You pick up the leftover berries..."))
- #pbMessage(_INTL("{1} x {2}. ",PBItems.getName(getID(PBItems,berry1)),total1))
- pbItemBall(berry1,total1)
- return true
- end
- else
- #Nothing Here
- end
- else
- #Quit shaking
- if total2 >0 && total3 >0
- pbMessage(_INTL("You pick up the berries"))
- #pbMessage(_INTL("{1} x {2} , {3} x {4} , {5} x {6}",PBItems.getName(getID(PBItems,berry1)),total1,PBItems.getName(getID(PBItems,berry2)),total2 ,PBItems.getName(getID(PBItems,berry3)),total3))
- pbItemBall(berry1,total1)
- pbItemBall(berry2,total2)
- pbItemBall(berry3,total3)
- return true
- elsif total2 >0
- pbMessage(_INTL("You pick up the berries"))
- #pbMessage(_INTL("{1} x {2} , {3} x {4} ",PBItems.getName(getID(PBItems,berry1)),total1,PBItems.getName(getID(PBItems,berry2)),total2))
- pbItemBall(berry1,total1)
- pbItemBall(berry2,total2)
- return true
- else
- pbMessage(_INTL("You pick up the berries"))
- #pbMessage(_INTL("{1} x {2}. ",PBItems.getName(getID(PBItems,berry1)),total1))
- pbItemBall(berry1,total1)
- return true
- loop end
- end
- end
- end
- return false
- end
- #===============================#
Add Comment
Please, Sign In to add comment