mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2026-01-11 08:21:29 +01:00
introduce svargrond arena quest
This commit is contained in:
25
data/movements/scripts/svargrond_arena/arenaTrophy.lua
Normal file
25
data/movements/scripts/svargrond_arena/arenaTrophy.lua
Normal file
@@ -0,0 +1,25 @@
|
||||
function onStepIn(creature, item, position, fromPosition)
|
||||
if not creature:isPlayer() then
|
||||
return true
|
||||
end
|
||||
|
||||
local arenaId = item:getMovementId() - 23200
|
||||
if arenaId >= creature:getStorageValue(1100) then
|
||||
return true
|
||||
end
|
||||
|
||||
local cStorage = ARENA[arenaId].reward.trophyStorage
|
||||
if creature:getStorageValue(cStorage) ~= 1 then
|
||||
local rewardPosition = creature:getPosition()
|
||||
rewardPosition.y = rewardPosition.y - 1
|
||||
|
||||
local rewardItem = Game.createItem(ARENA[arenaId].reward.trophy, 1, rewardPosition)
|
||||
if rewardItem then
|
||||
rewardItem:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, string.format(ARENA[arenaId].reward.desc, creature:getName()))
|
||||
end
|
||||
|
||||
creature:setStorageValue(cStorage, 1)
|
||||
creature:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
|
||||
end
|
||||
return true
|
||||
end
|
||||
Reference in New Issue
Block a user