Advertisement
adrianoswatt

Hunters Knife.lua

Jan 24th, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.47 KB | None | 0 0
  1. local corpseact = 21012
  2. local SKINS = {
  3.     -- Beholder  [OK]
  4.     [2908] = {chance = 20, reward = 5778},
  5.  
  6.     -- Black Sheep [OK]
  7.     [2914] = {chance = 20, reward = 5779},
  8.  
  9.     -- Dwarf Beard [OK]
  10.     [2960] = {chance = 20, reward = 5780},
  11.  
  12.     -- Elf Ear [OK]
  13.     [2945] = {chance = 20, reward = 5781},
  14.  
  15.     -- Tear of Nature [OK]
  16.     [2979] = {chance = 20, reward = 5782},
  17.  
  18.     -- Fire devil [OK]
  19.     [6035] = {chance = 20, reward = 5783},
  20.  
  21.     -- Blue hair Frost Troll [OK]
  22.     [2928] = {chance = 20, reward = 5784},
  23.  
  24.     -- Lion mane  [OK]
  25.     [5849] = {chance = 20, reward = 5785},
  26.  
  27.     -- Minotaur horn all minos [OK]
  28.     [2830] = {chance = 20, reward = 5786},
  29.     [2866] = {chance = 20, reward = 5786},
  30.     [2876] = {chance = 20, reward = 5786},
  31.     [2871] = {chance = 20, reward = 5786},
  32.  
  33.     -- Orc warrior iron piece [OK]
  34.     [6039] = {chance = 20, reward = 5787},
  35.  
  36.     -- orc skin [OK]
  37.     [6032] = {chance = 20, reward = 5788},
  38.  
  39.     -- orc spearman blue bear [OK]
  40.     [5855] = {chance = 20, reward = 5789},
  41.  
  42.     -- Pig tail Pig [OK]
  43.     [2935] = {chance = 20, reward = 5790},
  44.  
  45.     -- Sheep Wool [OK]
  46.     [2905] = {chance = 20, reward = 5791},
  47.  
  48.     -- Snake Tongue [OK]
  49.     [2817] = {chance = 20, reward = 5792},
  50.  
  51.     -- Spider reaming [OK]
  52.     [2807] = {chance = 20, reward = 5793},
  53.  
  54.     -- swamp troll [OK]
  55.     [5858] = {chance = 20, reward = 5794},
  56.  
  57.     -- troll [OK]
  58.     [2806] = {chance = 20, reward = 5795},
  59.  
  60.     -- Orc Bowman [OK]
  61.     [5926] = {chance = 20, reward = 5787},
  62.  
  63.     -- Minotaur Gladiator [OK]
  64.     [5908] = {chance = 20, reward = 5786},
  65.  
  66.     -- Minotaur Furious [Ok]
  67.     [5911] = {chance = 20, reward = 5786},
  68.  
  69.     --Minotaur Leader [Ok]
  70.     [5905] = {chance = 20, reward = 5786},
  71. }
  72.  
  73. function onUse(cid, item, fromPosition, itemEx, toPosition)
  74.     local skin = SKINS[itemEx.itemid]
  75.     if not skin then
  76.         doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
  77.         return true
  78.     end
  79.     getAction = itemEx.actionid
  80.     if getAction == corpseact then
  81.         doPlayerSendCancel(cid, "You can't use this item in a summon corpse.")
  82.     return true
  83.     end
  84.     local random = math.random(1, 100)
  85.     local effect = CONST_ME_GROUNDSHAKER
  86.     if random <= skin.chance then
  87.         doPlayerAddItem(cid, skin.reward, 1)
  88.     else
  89.         effect = CONST_ME_POFF
  90.     end
  91.     doSendMagicEffect(toPosition, effect)
  92.     doTransformItem(itemEx.uid, getItemInfo(itemEx.itemid).decayTo)
  93.     return true
  94. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement