mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-12-12 12:59:47 +01:00
introduce svargrond arena quest
This commit is contained in:
@@ -13,4 +13,7 @@
|
||||
|
||||
<event type="kill" name="InquisitionUngreez" script="inquisitionQuestUngreez.lua" />
|
||||
<event type="kill" name="InquisitionBosses" script="inquisitionQuestBosses.lua" />
|
||||
|
||||
<!-- Svargrond Arena: Killing a boss -->
|
||||
<event type="kill" name="SvargrondArenaKill" script="arena_kill.lua" />
|
||||
</creaturescripts>
|
||||
|
||||
41
data/creaturescripts/scripts/arena_kill.lua
Normal file
41
data/creaturescripts/scripts/arena_kill.lua
Normal file
@@ -0,0 +1,41 @@
|
||||
function onKill(creature, target)
|
||||
local targetMonster = target:getMonster()
|
||||
if not targetMonster then
|
||||
return
|
||||
end
|
||||
|
||||
local player = creature:getPlayer()
|
||||
local pit = player:getStorageValue(1101)
|
||||
if pit < 1 or pit > 10 then
|
||||
return
|
||||
end
|
||||
|
||||
local arena = player:getStorageValue(1100)
|
||||
if arena < 1 then
|
||||
return
|
||||
end
|
||||
|
||||
if not isInArray(ARENA[arena].creatures, targetMonster:getName():lower()) then
|
||||
return
|
||||
end
|
||||
|
||||
-- Remove pillar and create teleport
|
||||
local pillarTile = Tile(PITS[pit].pillar)
|
||||
if pillarTile then
|
||||
local pillarItem = pillarTile:getItemById(SvargrondArena.itemPillar)
|
||||
if pillarItem then
|
||||
pillarItem:remove()
|
||||
|
||||
local teleportItem = Game.createItem(SvargrondArena.itemTeleport, 1, PITS[pit].tp)
|
||||
if teleportItem then
|
||||
teleportItem:setMovementId(25200)
|
||||
end
|
||||
|
||||
SvargrondArena.sendPillarEffect(pit)
|
||||
end
|
||||
end
|
||||
|
||||
player:setStorageValue(1101, pit + 1)
|
||||
player:say('Victory! Head through the new teleporter into the next room.', TALKTYPE_MONSTER_SAY)
|
||||
return true
|
||||
end
|
||||
@@ -323,6 +323,7 @@ function onLogin(player)
|
||||
player:registerEvent("RegenerateStamina")
|
||||
player:registerEvent("InquisitionUngreez")
|
||||
player:registerEvent("InquisitionBosses")
|
||||
player:registerEvent("SvargrondArenaKill")
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user