• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Action [RELEASE] The Boomerang (like in the Zelda series)

Tufte

Member
Joined
Nov 19, 2007
Messages
652
Reaction score
24
Location
Norway
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

bomberang.jpg


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:
looks like a nice script lol but, it would be bad in some circumstances such as showing off some things and you boomerang it to you o.0

i have a muesuem like thing in mine which would be robbed like none other lol but nice script :)
 
add a check is the target pos inside depo, else players can grab items from depots or hit them in depo.

Ok, I will add it... but is there any way to check if the boomerang is flying over a non-moveable item? Because now you can for instance teleport annihilator reward and such :p

edit: fixed so you cant throw the boomerang from pvp area to pz zones, so the depot problem should be solved.
 
Last edited:
yeah, but the problem isnt that it teleport non-movable items, the problem is that it will "fly" over non-moveable items... how to I fix a check for that? Loop all things from creaturepos to topos?
 
PHP:
    elseif isSightClear(getCreaturePosition(cid), toPosition, nil) == FALSE then
		warnPlayer(cid, "You cannot throw the boomerang over this item.")
	else

dosent work, can still shoot it over non moveable items, water tiles etc
 
In the zelda video it locks on, and follows the target.
Does that happen here?

Because if it does, you can make sprites for missiles...etc.
 
Anyway to slow it?
That would be cool, to be able to run away from an "attack"
 
well, the only way to take items from a depot, is if you have depot outside PZ, which i've never seen in my whole life...
 
@ up
he wrote that he fixed the depot problem a few posts down on the first page..

@ topic
Nice idea.. might try it and use it on my server for a quest or reward for something..
Makes a nice gift xD
 
I added this to my server it works and everything but i get this error in my server window. can you help me out.

untitled.JPG
 
Back
Top