mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-10-14 14:44:55 +02:00
finish 7.92 items
This commit is contained in:
17
data/actions/scripts/misc/fireworks_rocket.lua
Normal file
17
data/actions/scripts/misc/fireworks_rocket.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
|
||||
if fromPosition.x ~= CONTAINER_POSITION then
|
||||
fromPosition:sendMagicEffect(math.random(CONST_ME_FIREWORK_YELLOW, CONST_ME_FIREWORK_BLUE))
|
||||
else
|
||||
local pos = player:getPosition()
|
||||
pos:sendMagicEffect(CONST_ME_HITBYFIRE)
|
||||
pos:sendMagicEffect(CONST_ME_EXPLOSIONAREA)
|
||||
player:say("Ouch! Rather place it on the ground next time.", TALKTYPE_MONSTER_SAY)
|
||||
if (player:getHealth() > 10) then
|
||||
player:addHealth(-10)
|
||||
end
|
||||
end
|
||||
|
||||
item:remove()
|
||||
|
||||
return true
|
||||
end
|
Reference in New Issue
Block a user