Carontee

PIGGY BANK Cassino.

Feb 8th, 2015
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.77 KB | None | 0 0
  1.         --[[  Esse é o script do piggy bank
  2.            SCRIPT BY CARONTE
  3.          visite: tibiaking.com    ]]
  4.                                        
  5.         --[[
  6.         function onUse(cid, item, frompos, item2, topos)
  7.        
  8.         rand1 = math.random(1,100)
  9.         rand2 = math.random(1,70)
  10.         rand3 = math.random(1,15)
  11.        
  12.         local dinheiro = 5  -- Quantide de crystal coins que irá consumir
  13.         local chancedequebrar = 0 -- porcentagem da chance de se quebrar, use 0 para não quebrar
  14.        
  15.        
  16.        
  17.         dinheiro = dinheiro * 10000
  18.        
  19.              if getPlayerMoney(cid) >= dinheiro then
  20.               doPlayerRemoveMoney(cid, dinheiro)
  21.              else
  22.               doCreatureSay(cid, '~You need '..dinheiro..' golds to break it !!!~', TALKTYPE_ORANGE_1)
  23.               doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
  24.          return false
  25.         end
  26.        
  27.              if rand1 <= 50 then
  28.                 doPlayerAddItem(cid,2148,rand1)
  29.                 doCreatureSay(cid, '~Holy Shit !!! only '..rand1..' golds, my mom will kill me~', TALKTYPE_ORANGE_1)
  30.                 doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_YELLOW)
  31.               end
  32.              
  33.               if rand1 >= 51 and rand1 <= 70  then
  34.                 doPlayerAddItem(cid,2152,rand3)
  35.                 doCreatureSay(cid, '~Oh-oh '..rand3..' Platinum coins!, would i try again ?~', TALKTYPE_ORANGE_1)
  36.                 doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_BLUE)
  37.               end
  38.              
  39.               if rand1 >= 90 then
  40.                  doPlayerAddItem(cid,2160,rand2)
  41.                  doCreatureSay(cid, '~Oh My God! :D '..rand2..' Crystal coins !!!', TALKTYPE_ORANGE_1)
  42.                  doSendMagicEffect(getCreaturePosition(cid), CONST_ME_WATERSPLASH)
  43.         end
  44.            
  45.             if rand1 <= chancedequebrar then
  46.         doPlayerAddMoney(cid, dinheiro)
  47.         doTransformItem(item.uid,item.itemid+1)
  48.         end
  49.        
  50.         return 1
  51.         end
  52.         ]]
  53.        
  54.         --[[  Esse é o script do piggy bank
  55.            SCRIPT BY CARONTE
  56.          visite: tibiaking.com    ]]
  57.          
  58.              
  59.        
  60. function onUse(cid, item, frompos, item2, topos)
  61.  
  62. local chance = math.random(0,100)
  63. dinheiro = 10 -- Quantidade mínima para jogar
  64.  
  65.  
  66. dinheiro = dinheiro * 10000
  67. crystalparaapostar = dinheiro / 10000
  68.  
  69. local pos = getPlayerPosition(cid)
  70. pos = {x= posx,y= posy,z= posz}
  71.  
  72.                  --Verificar se tem crystals na--
  73.  if getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid ~= 2160 then
  74.   doCreatureSay(cid, 'You need crystal coins in your ammunition slot to play ! ', TALKTYPE_ORANGE_1)
  75.     doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
  76.    
  77.              --Verificar quantidade de cystals no ammo slot :D  
  78.     elseif getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid == 2160 and getPlayerSlotItem(cid, CONST_SLOT_AMMO).type < 10 then
  79.         doCreatureSay(cid, "You don't have "..crystalparaapostar.." crystal coins in the arrows slot to play", TALKTYPE_ORANGE_1)
  80.         doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
  81.        
  82.  
  83. end
  84.  
  85.     if getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid == 2160 and getPlayerSlotItem(cid, CONST_SLOT_AMMO).type >= 10 then
  86.         doCreatureSay(cid, 'Its time to play', TALKTYPE_ORANGE_1)
  87.         --doSendMagicEffect(getCreaturePosition(cid), CONST_ME_CRAPS)
  88.          
  89.           if chance <= 50 then
  90.        doPlayerAddItem(cid,2160,getPlayerSlotItem(cid, CONST_SLOT_AMMO).type)
  91.              
  92.        elseif chance >= 50 then
  93.        doPlayerRemoveItem(cid,2160,getPlayerSlotItem(cid, CONST_SLOT_AMMO).type)
  94.  
  95.                   --doSendDistanceShoot(frompos, topos, type)  
  96.                   doSendMagicEffect(pos,1)    
  97.        end
  98.  
  99.  
  100.  end
  101.    
  102. return true
  103. end
Add Comment
Please, Sign In to add comment