Como funciona:
Você utiliza o bumerangue como uma runa. Quando você usá-lo em uma área, um efeito bumerangue irá aparecer. então, se há um jogador nessa área, ele vai perder a saúde. Caso contrário, se há um item lá, o Boomerang vai pegar o item e voar de volta para você! O bumerangue, naturalmente voar de volta para você também!
Claro, eu fixo para que você não pode usar o bumerangue no PZ, e você também não pode pegar itens das casas e tal!
O script:
[actions/boomerang.lua]
--100 PERCENT CREDITS TO PENIS PUMPE----1337.hopto.org--
--Please keep credits if used--
function target (stuff)
local cid = stuff.cid
local thing = getThingfromPos(stuff.toPosition)
if (stuff.counter == 2) then
if getTileHouseInfo(stuff.toPosition) > 0 then
warnPlayer(cid, "You cannot teleport items out of a house.")
elseif isCreature(thing.uid) == FALSE then
doTeleportThing(thing.uid, getCreaturePosition(stuff.cid))
end
return TRUE
end
doSendDistanceShoot(stuff.toPosition, getCreaturePosition(stuff.cid), CONST_ANI_WHIRLWINDAXE)
doAreaCombatHealth(0, COMBAT_HOLYDAMAGE, stuff.toPosition, 0, -100, -200, CONST_ME_HOLYDAMAGE)
stuff.counter = stuff.counter + 1
addEvent(target, 200, stuff)
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getTilePzInfo(getCreaturePosition(cid)) == TRUE or getTilePzInfo(toPosition) == TRUE then
warnPlayer(cid, "You cannot use this weapon in a protection zone.")
else
doSendDistanceShoot(getCreaturePosition(cid), toPosition, CONST_ANI_WHIRLWINDAXE)
local stuff = {cid = cid, toPosition = toPosition, counter = 1}
addEvent(target, 300, stuff)
end
return TRUE
end
actions.xml:
<action itemid="7423" allowfaruse="1" script="tools/boomerang.lua"/>
Se você não tem a função warnPlayer, adicione isso ao seu global.lua:
function warnPlayer(cid, msg)-- Function by Colandus
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return doPlayerSendCancel(cid, msg)
end
A maioria dos créditos para o servidor de 1337, feita por Penis Pumpe! e o restinho para mim,por ter concertado alguns bugs !