daily pastebin goal
76%
SHARE
TWEET

Untitled

a guest Jun 14th, 2018 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local anvilId = 2555
  2. local config = {
  3.                 {itemsList = {2128, 1, 2487, 1, 4847, 1, 3968, 1, 2492, 1, 2500, 1, 6095, 1, 8982, 100}, toCreate = {8865}}, -- espada haori 8
  4.                 {itemsList = {2493, 1, 8980, 100, 2652, 1, 9004, 100, 4864, 5}, toCreate = {8866}}, -- tessai tsukabishi robe 5
  5.                 {itemsList = {2485, 1, 5924, 1, 4864, 3, 8982, 15, 4867, 15}, toCreate = {2657}}, -- yylfordt mask 5
  6.                 {itemsList = {5924, 1, 2466, 1, 4864, 5, 8982, 25, 4867, 25}, toCreate = {7898}}, -- hueco mundo crown 5
  7.                 {itemsList = {2467, 1, 2484, 1, 2666, 100, 2671, 100, 4865, 30}, toCreate = {7899}}, -- animal king helmet 5
  8.                 {itemsList = {7459, 1, 2457, 1, 9004, 25, 8982, 25, 4867, 25}, toCreate = {2128}}, -- aizen coat 5
  9.                 {itemsList = {2458, 1, 7885, 1, 9004, 25, 8982, 25, 4867, 25}, toCreate = {2342}}, -- aizen legs 5
  10.                 {itemsList = {7903, 1, 2459, 1, 9004, 25, 8982, 25, 4867, 25}, toCreate = {2343}}, -- aizen boots 5
  11.                 {itemsList = {5924, 1, 7458, 1, 9004, 25, 8982, 25, 4867, 25}, toCreate = {2486}}, -- tousen mask 5
  12.                 {itemsList = {2457, 1, 7459, 1, 9004, 25, 8982, 25, 4867, 25}, toCreate = {2487}}, -- tousen coat 5
  13.                 {itemsList = {7459, 1, 2457, 1, 9004, 25, 4867, 25}, toCreate = {2650}}, -- ichigo haori 4
  14.                 {itemsList = {5924, 1, 7458, 1, 9004, 25, 4867, 25}, toCreate = {2651}}, -- ichigo mask 4
  15.                 {itemsList = {5924, 1, 8982, 25, 4867, 25, 4864, 3}, toCreate = {2659}}, -- ulquiorra mask 4
  16.                 {itemsList = {2457, 1, 8982, 40, 4867, 40, 4864, 5}, toCreate = {4847}}, -- neriel armor 4
  17.                 {itemsList = {5924, 1, 8982, 40, 4867, 40, 4864, 5}, toCreate = {2655}}, -- neriel mask 4
  18.                 {itemsList = {7458, 1, 2665, 1, 9004, 25, 9003, 25}, toCreate = {9927}}, -- yoruichi mask 4
  19.                 {itemsList = {7459, 1, 3967, 1, 9004, 25, 9003, 25}, toCreate = {2463}}, -- yoruichi haori 4
  20.                 {itemsList = {7885, 1, 3969, 1, 9004, 25, 9003, 25}, toCreate = {2464}}, -- yoruichi legs 4
  21.                 {itemsList = {7903, 1, 3970, 1, 9004, 25, 9003, 25}, toCreate = {2465}}, -- yoruichi boots 4
  22.                 {itemsList = {5741, 1, 8985, 25, 4863, 5}, toCreate = {2498}}, -- legendary samurai helmet 3
  23.                 {itemsList = {6096, 1, 8985, 25, 4863, 5}, toCreate = {2499}}, -- legendary samurai armor 3
  24.                 {itemsList = {7461, 1, 8985, 25, 4863, 5}, toCreate = {2501}}, -- legendary samurai legs 3
  25.                 {itemsList = {7462, 1, 8985, 25, 4863, 5}, toCreate = {2502}}, -- legendary samurai boots 3
  26.                 {itemsList = {2480, 1, 8982, 100, 4867, 100}, toCreate = {9778}}, -- vasto lorde mask 3
  27.                 {itemsList = {2457, 1, 8982, 75, 4867, 75}, toCreate = {3968}}, -- halibel armor 3
  28.                 {itemsList = {2458, 1, 8982, 50, 4867, 50}, toCreate = {2489}}, -- stark ressurection legs 3
  29.                 {itemsList = {2457, 1, 8982, 50, 4867, 50}, toCreate = {2492}}, -- stark ressurection coat 3
  30.                 {itemsList = {2457, 1, 8982, 40, 4867, 40}, toCreate = {2500}}, -- nnoitra haori 3
  31.                 {itemsList = {2458, 1, 8982, 40, 4867, 40}, toCreate = {2503}}, -- nnoitra legs 3
  32.                 {itemsList = {2459, 1, 8982, 40, 4867, 40}, toCreate = {2505}}, -- nnoitra boots 3
  33.                 {itemsList = {7459, 1, 9004, 100, 4867, 100}, toCreate = {7897}}, -- ichigo robe 3
  34.                 {itemsList = {7459, 1, 9004, 50}, toCreate = {2656}}, -- zaraki haori 2
  35.                 {itemsList = {2457, 1, 4867, 50}, toCreate = {6095}}, -- grimmjow haori 2
  36.                 {itemsList = {2472, 1, 2346, 25}, toCreate = {2660}}, -- shawlong mask 2
  37.                 {itemsList = {7459, 1, 9004, 100}, toCreate = {2664}}, -- byakuya haori 2
  38.                 {itemsList = {7458, 1, 9004, 100}, toCreate = {7884}} -- byakuyan kenseikan 2
  39.                 }
  40.  
  41. function onUse(cid, item, fromPosition, itemEx, toPosition)
  42.     if anvilId ~= 0 and getTileItemById(toPosition, anvilId).uid == 0 then
  43.         doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Anvil not found.')
  44.         return false
  45.     end
  46.    
  47.     local id = 0
  48.     for i = 1, #config do
  49.         local var = config[i]
  50.         local amount = 0
  51.         for v = 1, #var.itemsList / 2 do
  52.             local it = getTileItemById(toPosition, var.itemsList[v * 2 - 1])
  53.             if it.uid == 0 or it.type < var.itemsList[v * 2] then
  54.                 break
  55.             end
  56.            
  57.             amount = amount + 1
  58.         end
  59.        
  60.         if amount >= #var.itemsList / 2 then
  61.             id = var
  62.             break
  63.         end
  64.     end
  65.    
  66.     if id == 0 then
  67.         doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Wrong items on anvil.')
  68.         return false
  69.     end
  70.    
  71.     local description = ''
  72.     local size = #id.itemsList / 2
  73.     for i = 1, size do
  74.         local itemId, count = id.itemsList[i * 2 - 1], id.itemsList[i * 2]
  75.         local it = getTileItemById(toPosition, itemId)
  76.         if it.uid > 0 then
  77.             doRemoveItem(it.uid, count)
  78.            
  79.             description = description .. getItemInfo(itemId).name .. ' (' .. count .. ')'
  80.             if size > 1 and i < size - 1 then
  81.                 description = description .. ', '
  82.             elseif i < size then
  83.                 description = description .. ' and '
  84.             else
  85.                 description = description .. '.'
  86.             end
  87.         end
  88.     end
  89.    
  90.     doSendMagicEffect(toPosition, CONST_ME_215)
  91.    
  92.     local toItem = choose(id.toCreate)
  93.     doCreateItem(toItem, 1, toPosition)
  94.     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have successfully created ' .. getItemInfo(toItem).name .. ' by used ' .. description)
  95.     return false
  96. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top