I got inspired by the hookshot-script by Molinero, and since I love the Zelda-series I decided to make a Boomerang script, almost a pure copy of the one in the Zelda-games.
How it works:
You use the boomerang like a rune. When you use it on an area, a boomerang-effect will appear. Then, if there is a player in that area, he will lose health. Else, if there is an item there, your boomerang will pick up the item and fly it back to you! The boomerang will of course fly back to you too!
Video from Zelda:Ocarina of Time: http://www.youtube.com/watch?v=rqJmK4mpXRk
Of course, I fixed so you cannot use the boomerang in PZ, and you can also not pick up items from houses and such!
The script:
[tools/boomerang.lua]
actions.xml:
If you dont have the warnPlayer function, add this to your global.lua:
All credits to the 1337 server, made by Penis Pumpe!
Please keep credits if used. Thanks to Molinero for the inspiration!
Hope you like it!
Ps: This is my first released script, and I would appriciate constructive critics. Feel free to post configurations, since im not a pro scripter.
How it works:
You use the boomerang like a rune. When you use it on an area, a boomerang-effect will appear. Then, if there is a player in that area, he will lose health. Else, if there is an item there, your boomerang will pick up the item and fly it back to you! The boomerang will of course fly back to you too!
Video from Zelda:Ocarina of Time: http://www.youtube.com/watch?v=rqJmK4mpXRk
Of course, I fixed so you cannot use the boomerang in PZ, and you can also not pick up items from houses and such!
The script:
[tools/boomerang.lua]
PHP:
--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:
PHP:
<action itemid="7423" allowfaruse="1" script="tools/boomerang.lua"/>
If you dont have the warnPlayer function, add this to your global.lua:
PHP:
function warnPlayer(cid, msg)
-- Function by Colandus
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return doPlayerSendCancel(cid, msg)
end
All credits to the 1337 server, made by Penis Pumpe!
Please keep credits if used. Thanks to Molinero for the inspiration!
Hope you like it!
Ps: This is my first released script, and I would appriciate constructive critics. Feel free to post configurations, since im not a pro scripter.
Last edited: