Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function stun(p)
- local dirs = math.random(1, 3)
- local newDir = getPosByDir(getThingPos(p), getCreatureLookDirection(p), 1)
- for loop = 1, 3 do
- addEvent(doCreatureSetLookDir, loop * 200, p, dirs)
- addEvent(doTeleportThing, loop * 220, p, getClosestFreeTile(p, newDir), false)
- doSendMagicEffect(getThingPos(p), CONST_ME_STUN)
- end
- end
- function onUse(cid, item, fromPosition, itemEx, toPosition)
- local itemName = getItemAttribute(item.uid, "description")
- local p = itemName:match("Este item serve para fazer macumba ao player (.+).")
- -- so mecha em percent e stun
- local player = getPlayerByNameWildcard(getPlayerByName(p))
- local percent = 30
- local conta = getCreatureHealth(player) / percent * 100
- local stun = true
- if player then
- if p ~= getCreatureName(cid) then
- doCreatureAddHealth(player, conta)
- doCreatureSay(player, "Ai")
- doPlayerSendTextMessage(cid, 27, "Você fez macumba contra o jogador " .. p .. ".")
- else
- doPlayerSendCancel(cid, "Você não pode fazer macumba contra sí mesmo.")
- end
- else
- doPlayerSendCancel(cid, "Este jogador esta offline.")
- end
- if stun then
- stun(player)
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement