serpentine tower event almost completed

This commit is contained in:
ErikasKontenis 2020-03-12 20:51:37 +02:00
parent f8de994f4b
commit 5869fba58f
6 changed files with 246 additions and 1 deletions

View File

@ -1 +1 @@
next: 17596 next: 17597

View File

@ -390,4 +390,10 @@
<missionstate id="2" description="You returned Fugio's Diary. Costello was very thankful about your help and gave you a blessed ankh as reward." /> <missionstate id="2" description="You returned Fugio's Diary. Costello was very thankful about your help and gave you a blessed ankh as reward." />
</mission> </mission>
</quest> </quest>
<quest name="The Serpentine Tower" startstorageid="17596" startstoragevalue="1">
<mission name="The Ankrahmun Academy of Magic Arts Disaster" storageid="17596" endvalue="999">
<missionstate id="1" description="The earthquake destroyed the Serpentine Tower. There must be a way to get in the undergrouds." />
<missionstate id="2" description="Everything makes sense. Until now..." />
</mission>
</quest>
</quests> </quests>

View File

@ -407,6 +407,7 @@
<movevent event="AddItem" movementid="17580" tileitem="1" script="misc/raid_sacrifice.lua" /> <movevent event="AddItem" movementid="17580" tileitem="1" script="misc/raid_sacrifice.lua" />
<movevent event="StepIn" movementid="17581" script="misc/raid_sacrifice.lua" /> <movevent event="StepIn" movementid="17581" script="misc/raid_sacrifice.lua" />
<movevent event="AddItem" movementid="17581" tileitem="1" script="misc/raid_sacrifice.lua" /> <movevent event="AddItem" movementid="17581" tileitem="1" script="misc/raid_sacrifice.lua" />
<movevent event="AddItem" movementid="17596" tileitem="1" script="misc/serpentine_tower_hole.lua" />
<!-- Goroma --> <!-- Goroma -->
<movevent event="StepIn" frommovementid="17506" tomovementid="17508" script="goroma/energy_barrier.lua" /> <movevent event="StepIn" frommovementid="17506" tomovementid="17508" script="goroma/energy_barrier.lua" />

View File

@ -0,0 +1,14 @@
function onAddItem(item, tileitem, position)
if item:getId() == 5898 then
tileitem:getPosition():sendMonsterSay("MORE! MORE!")
item:remove(-1)
return true
elseif item:getId() == 5776 then
tileitem:getPosition():sendMonsterSay("OHHH! WILL USE IT LATER!")
item:remove(-1)
return true
end
tileitem:getPosition():sendMonsterSay("I WANT EYES!")
item:remove(-1)
end

View File

@ -0,0 +1,223 @@
local area = {
fromPos = {x = 33140, y = 32859, z = 7},
toPos = {x = 33155, y = 32874, z = 4}
}
local availablePlayerTeleportPositions = {
Position(33139, 32859, 7),
Position(33139, 32860, 7),
Position(33139, 32861, 7),
Position(33139, 32862, 7),
Position(33139, 32863, 7),
Position(33139, 32864, 7),
Position(33139, 32865, 7),
Position(33139, 32866, 7),
Position(33139, 32867, 7),
Position(33139, 32868, 7),
Position(33139, 32869, 7),
Position(33139, 32870, 7),
Position(33139, 32871, 7),
Position(33139, 32872, 7),
Position(33139, 32873, 7),
Position(33139, 32874, 7),
Position(33139, 32875, 7),
Position(33140, 32875, 7),
Position(33143, 32875, 7),
Position(33144, 32875, 7),
Position(33146, 32875, 7),
Position(33148, 32875, 7),
Position(33149, 32875, 7),
Position(33150, 32875, 7),
Position(33155, 32875, 7),
Position(33156, 32875, 7),
Position(33156, 32874, 7),
Position(33156, 32873, 7),
Position(33156, 32872, 7),
Position(33156, 32871, 7),
Position(33156, 32870, 7),
Position(33156, 32869, 7),
Position(33156, 32868, 7),
Position(33156, 32867, 7),
Position(33156, 32866, 7),
Position(33156, 32865, 7),
Position(33156, 32864, 7),
Position(33156, 32863, 7),
Position(33156, 32862, 7),
Position(33156, 32861, 7),
Position(33156, 32860, 7),
Position(33156, 32859, 7),
Position(33156, 32858, 7)
}
local downstairsIds = {451, 466, 465, 467}
local earthquakeEffects = {CONST_ME_POFF, CONST_ME_EXPLOSIONHIT, CONST_ME_EXPLOSIONAREA, CONST_ME_FIREAREA, CONST_ME_ENERGYHIT, CONST_ME_BLOCKHIT}
function onSay(player, words, param)
if not player:getGroup():getAccess() then
return true
end
if player:getAccountType() < ACCOUNT_TYPE_GOD then
return false
end
-- TODO: Implement that all people are teleported near serpentine tower and after event finish all teleported to temple and then server save
addEvent(wave1, 10000)
addEvent(wave2, 30000)
addEvent(wave3, 90000)
addEvent(wave4, 150000)
addEvent(wave5, 160000)
addEvent(wave6, 165000)
addEvent(wave7, 170000)
return false
end
function wave1()
broadcastMessage("LOOK AT MY EYES! ... THE EYES! ... LET ME OUT! ...", MESSAGE_STATUS_WARNING)
earthquakeTower(area.fromPos, area.toPos)
end
function wave2()
broadcastMessage("Ankrahmun: The Academy of Magic Arts are reporting that Ankrahmun city is experiencing issues! Please stay safe in the protection zones, NOW!", MESSAGE_STATUS_WARNING)
earthquakeTower(area.fromPos, area.toPos)
end
function wave3()
broadcastMessage("Ankrahmun: All Sabrehaven PEOPLE. THIS IS NOT A PRACTICE. Leave our city NOW!", MESSAGE_STATUS_WARNING)
earthquakeTower(area.fromPos, area.toPos)
end
function wave4()
broadcastMessage("THE EYES ARE EVERYWHERE!", MESSAGE_STATUS_WARNING)
earthquakeTower(area.fromPos, area.toPos)
end
function wave5()
Position(33149, 32868, 7):sendMonsterSay("accersi Tothdral")
local tothdral = Creature("Tothdral")
tothdral:teleportTo(Position(33149, 32867, 7))
tothdral:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
end
function wave6()
Position(33147, 32870, 7):sendMonsterSay("The Serpentine Tower Secret Is Real!")
Position(33151, 32870, 7):sendMonsterSay("The Serpentine Tower Secret Is Real!")
Position(33151, 32866, 7):sendMonsterSay("The Serpentine Tower Secret Is Real!")
Position(33147, 32866, 7):sendMonsterSay("The Serpentine Tower Secret Is Real!")
local tile = Tile(Position(33149, 32868, 7))
if tile then
local obelisk = tile:getItemById(2199)
if obelisk ~= nil then
obelisk:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
obelisk:remove()
local hole = Game.createItem(5731, 1, tile:getPosition())
hole:setAttribute(ITEM_ATTRIBUTE_MOVEMENTID, 17596)
end
end
end
function wave7()
Position(33147, 32870, 7):sendMonsterSay("The Serpentine Tower Secret Is Real!")
Position(33151, 32870, 7):sendMonsterSay("The Serpentine Tower Secret Is Real!")
Position(33151, 32866, 7):sendMonsterSay("The Serpentine Tower Secret Is Real!")
Position(33147, 32866, 7):sendMonsterSay("The Serpentine Tower Secret Is Real!")
Position(33149, 32868, 7):sendMonsterSay("LET ME OUT!")
end
function earthquakeTower(frompos, topos)
for zz = frompos.z, topos.z, -1 do
if zz == 6 then
topos.x = topos.x + 1
topos.y = topos.y + 1
end
for xx = frompos.x, topos.x do
for yy = frompos.y, topos.y do
local position = Position(xx, yy, zz)
removeFloorItems(position)
copyHigherFloorItems(position)
end
end
if zz == 6 then
topos.x = topos.x - 1
topos.y = topos.y - 1
end
end
end
function removeFloorItems(position)
local tile = Tile(position)
if tile then
-- If any creature is in area then teleport it to safe zone to properly work with tile items
local creature = tile:getTopCreature()
if creature then
local teleportPosition = availablePlayerTeleportPositions[math.random(#availablePlayerTeleportPositions)]
doRelocate(creature:getPosition(), teleportPosition)
creature:getPosition():sendMonsterSay("The Gods Protecting You!")
Game.sendMagicEffect(teleportPosition, 11)
if creature:isPlayer() then
if creature:getStorageValue(17596) ~= 1 then
creature:setStorageValue(17596, 1)
end
end
end
local currentFloorItem = tile:getItemByType(0)
while currentFloorItem ~= nil do
currentFloorItem:remove()
currentFloorItem = tile:getItemByType(0)
end
local items = tile:getItems()
if items ~= nil then
for _, item in pairs(items) do
item:remove()
end
end
-- Create sand floor only for ground level
if position.z == 7 then
Game.createTile(position)
Game.createItem(231, 1, position)
end
end
end
function copyHigherFloorItems(position)
local higherFloorPosition = {x = position.x, y = position.y, z = position.z - 1}
local tile = Tile(higherFloorPosition)
if tile then
local higherFloorItem = tile:getItemByType(0)
while(higherFloorItem ~= nil) do
if position.z ~= 7 or isInArray(downstairsIds, higherFloorItem:getId()) == false then
Game.createItem(higherFloorItem:getId(), 1, position)
end
higherFloorItem:remove()
higherFloorItem = tile:getItemByType(0)
end
local items = tile:getItems()
if items ~= nil then
for _, item in pairs(items) do
if position.z ~= 7 or isInArray(downstairsIds, item:getId()) == false then
Game.createItem(item:getId(), 1, position)
end
item:remove()
end
end
local effectRandomness = math.random(5)
if effectRandomness == 5 then
local earthquakeEffect = earthquakeEffects[math.random(#earthquakeEffects)]
tile:getPosition():sendMagicEffect(earthquakeEffect)
end
end
end
-- TODO: Implement that bitch npc is busy and says that I don't understand what is happening. The Academy of Magic Arts are not commenting the current situation.

View File

@ -40,6 +40,7 @@
<talkaction words="/removehouse" separator=" " script="remove_house.lua" /> <talkaction words="/removehouse" separator=" " script="remove_house.lua" />
<talkaction words="/globalboost" separator=" " script="global_rate_boost.lua" /> <talkaction words="/globalboost" separator=" " script="global_rate_boost.lua" />
<talkaction words="/loottest" script="loot_test.lua" /> <talkaction words="/loottest" script="loot_test.lua" />
<talkaction words="/event" script="serpentine_tower_event.lua" />
<!-- player talkactions --> <!-- player talkactions -->
<talkaction words="!buypremium" script="buyprem.lua"/> <talkaction words="!buypremium" script="buyprem.lua"/>