99% poi quest done. Missing bureaucrats npcs, maybe some exit tps and quest log

This commit is contained in:
ErikasKontenis
2020-05-05 17:24:05 +03:00
parent 92998c466c
commit 99ea898868
33 changed files with 1429 additions and 461 deletions

View File

@@ -0,0 +1,11 @@
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local portal = Tile(Position(32816, 32345, 13)):getItemById(1949)
if not portal then
local item = Game.createItem(1949, 1, Position(32816, 32345, 13))
item:setMovementId(17686)
else
portal:remove()
end
item:transform(item.itemid == 2772 and 2773 or 2772)
return true
end

View File

@@ -0,0 +1,30 @@
local config = {
[39511] = {
fromPosition = Position(32739, 32392, 14),
toPosition = Position(32739, 32391, 14)
},
[39512] = {
teleportPlayer = true,
fromPosition = Position(32739, 32391, 14),
toPosition = Position(32739, 32392, 14)
}
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local useItem = config[item:getActionId()]
if not useItem then
return true
end
if useItem.teleportPlayer then
player:teleportTo(Position(32712, 32392, 13))
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
player:say('Beauty has to be rewarded! Muahahaha!', TALKTYPE_MONSTER_SAY)
end
local tapestry = Tile(useItem.fromPosition):getItemById(6433)
if tapestry then
tapestry:moveTo(useItem.toPosition)
end
return true
end

View File

@@ -0,0 +1,8 @@
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if item.itemid == 2772 then
player:teleportTo(Position(32806, 32328, 15))
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
item:transform(2773)
end
return true
end

View File

@@ -0,0 +1,20 @@
local lava = {
Position(32912, 32209, 15),
Position(32913, 32209, 15),
Position(32912, 32210, 15),
Position(32913, 32210, 15)
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local lavaTile
for i = 1, #lava do
lavaTile = Tile(lava[i]):getGround()
if lavaTile and isInArray({410, 727}, lavaTile.itemid) then
lavaTile:transform(lavaTile.itemid == 727 and 410 or 727)
lava[i]:sendMagicEffect(CONST_ME_POFF)
end
end
item:transform(item.itemid == 2772 and 2773 or 2772)
return true
end

View File

@@ -0,0 +1,30 @@
local pos = { Position(32861, 32305, 11), Position(32860, 32313, 11) }
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if item:getId() ~= 2772 then
return false
end
item:transform(2773)
if item:getActionId() == 3301 then
local lava = Tile(pos[1]):getItemById(727)
if lava then
lava:transform(1771)
end
local dirtId, dirtItem = { 4797, 4799 }
for i = 1, #dirtId do
dirtItem = Tile(pos[1]):getItemById(dirtId[i])
if dirtItem then
dirtItem:remove()
end
end
elseif item:getActionId() == 3302 then
local item = Tile(pos[2]):getItemById(389)
if item then
item:remove()
end
end
return true
end

View File

@@ -0,0 +1,62 @@
local text = {
[1] = 'first', [2] = 'second', [3] = 'third', [4] = 'fourth', [5] = 'fifth',
[6] = 'sixth', [7] = 'seventh', [8] = 'eighth', [9] = 'ninth', [10] = 'tenth',
[11] = 'eleventh', [12] = 'twelfth', [13] = 'thirteenth', [14] = 'fourteenth', [15] = 'fifteenth'
}
local stonePositions = {
Position(32851, 32333, 12),
Position(32852, 32333, 12)
}
local function createStones()
for i = 1, #stonePositions do
Game.createItem(1791, 1, stonePositions[i])
end
setGlobalStorageValue(17657, 0)
end
local function revertLever(position)
local leverItem = Tile(position):getItemById(2773)
if leverItem then
leverItem:transform(2772)
end
end
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if item:getId() ~= 2772 then
return false
end
local leverCount = math.max(0, getGlobalStorageValue(17657))
if item:getActionId() > 2049 and item:getActionId() < 2065 then
local number = item:getActionId() - 2049
if leverCount + 1 ~= number then
return false
end
setGlobalStorageValue(17657, number)
player:say('You flipped the ' .. text[number] .. ' lever. Hurry up and find the next one!', TALKTYPE_MONSTER_SAY, false, player, toPosition)
elseif item:getActionId() == 2065 then
if leverCount ~= 15 then
player:say('The final lever won\'t budge... yet.', TALKTYPE_MONSTER_SAY)
return true
end
local stone
for i = 1, #stonePositions do
stone = Tile(stonePositions[i]):getItemById(1791)
if stone then
stone:remove()
stonePositions[i]:sendMagicEffect(CONST_ME_EXPLOSIONAREA)
end
end
addEvent(createStones, 15 * 60 * 1000)
end
item:transform(2773)
addEvent(revertLever, 15 * 60 * 1000, toPosition)
return true
end

View File

@@ -0,0 +1,16 @@
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if item.itemid == 2773 then
return false
end
toPosition.x = toPosition.x - 1
toPosition.y = toPosition.y + 1
local stone = Tile(toPosition):getItemById(1791)
if stone then
stone:remove()
end
item:transform(2773)
return true
end

View File

@@ -0,0 +1,12 @@
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if item.itemid == 2772 then
local stonePosition = Position(32849, 32282, 10)
local stoneItem = Tile(stonePosition):getItemById(1791)
if stoneItem then
stoneItem:remove()
stonePosition:sendMagicEffect(CONST_ME_EXPLOSIONAREA)
item:transform(2773)
end
end
return true
end

View File

@@ -0,0 +1,14 @@
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
item:transform(item.itemid == 2772 and 2773 or 2772)
if item.itemid ~= 2772 then
return true
end
local stoneItem = Tile(Position(32826, 32274, 11)):getItemById(1772)
if stoneItem then
stoneItem:remove()
end
return true
end