Skymagnum

Untitled

May 8th, 2013
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.11 KB | None | 0 0
  1. local function stun(p)
  2.  
  3. local dirs = math.random(1, 3)
  4.  
  5.     for loop = 1, 3 do
  6.         addEvent(doMoveCreature, i * 200, p, dirs)
  7.         doSendMagicEffect(getThingPos(p), CONST_ME_STUN)
  8.     end
  9.  
  10. end
  11.  
  12. function onUse(cid, item, fromPosition, itemEx, toPosition)
  13.  
  14. local itemName = getItemAttribute(item.uid, "description")
  15. local p = itemName:match("Este item serve para fazer macumba ao player (.+).")
  16.  
  17. -- so mecha em percent e stun
  18.     local player = getPlayerByNameWildcard(getPlayerByName(p))
  19.     local percent = 30
  20.     local conta = getCreatureHealth(player) / percent * 100
  21.     local stun = true
  22.  
  23.     if player then
  24.        if p ~= getCreatureName(cid) then
  25.            doCreatureAddHealth(player, conta)
  26.            doCreatureSay(player, "Ai")
  27.            doPlayerSendTextMessage(cid, 27, "Você fez macumba contra o jogador " .. p .. ".")
  28.        else
  29.            doPlayerSendCancel(cid, "Você não pode fazer macumba contra sí mesmo.")
  30.        end
  31.     else
  32.         doPlayerSendCancel(cid, "Este jogador esta offline.")
  33.     end
  34.  
  35.     if stun then
  36.        stun(player)
  37.     end
  38.  
  39.     return true
  40. end
Advertisement
Add Comment
Please, Sign In to add comment