1function onUse(player, item, fromPosition, target, toPosition, isHotkey)
2 if fromPosition.x ~= CONTAINER_POSITION then
3 fromPosition:sendMagicEffect(math.random(CONST_ME_FIREWORK_YELLOW, CONST_ME_FIREWORK_BLUE))
4 else
5 local position = player:getPosition()
6 position:sendMagicEffect(CONST_ME_FIREAREA)
7 player:say("Ouch! Rather place it on the ground next time.", TALKTYPE_MONSTER_SAY)
8 player:addAchievementProgress("Rocket in Pocket", 3)
9 doTargetCombat(0, player, COMBAT_PHYSICALDAMAGE, -10, -10, CONST_ME_EXPLOSIONAREA)
10 end
11 player:addAchievementProgress("Fireworks in the Sky", 250)
12 item:remove()
13 return true
14end
15