Rizz
Quited with Tibia/OT
Updated, Bug Fixed, Optimized
Movements\scripts\yalahar_azerus_quest.lua
actions\scripts\yalahar_azerus_quest.lua
Also Required the following monster
Azerus Immortal.xml
monsters.xml
Movements\scripts\yalahar_azerus_quest.lua
Lua:
--Config--
local starting = {x = XXXXX, y = XXXXX, z = XXXXX, stackpos = 253} -- Top Left of the Final Room
local ending = {x = XXXXX, y = XXXXX, z = XXXXX, stackpos = 253} -- Bottom Right of the Final Romm
local checking = {x = starting.x, y = starting.y, z = starting.z, stackpos = starting.stackpos} -- Don't touch
local player_pos_entrada = {x = XXXXX, y = XXXXX, z = XXXXX} -- Where player spawns when entering the tp to the final room
local storageID = XXXXX --Storage ID, used for the door to the reward room
local canBeEnteredAgain = false -- Can you enter the place where you defeat Azerus many times? true/false
--End Config--
function onStepIn(cid, item, position, fromPosition)
local queststatus = getPlayerStorageValue(cid, storageID)
if item.actionid == 1974 and queststatus == -1 then
doCreatureSay(cid, "It seems by defeating Azarus you have stopprd this army from entering your world! Better leave this ghastly place forever.", TALKTYPE_ORANGE_1)
setPlayerStorageValue(cid, storageID, 1)
return TRUE
end
if item.actionid == 1973 and (queststatus == -1 or canBeEnteredAgain) then
totalmonsters = 0
monster = {}
repeat
creature = getThingfromPos(checking)
if creature.itemid > 0 then
if getPlayerAccess(creature.uid) ~= 0 and getPlayerAccess(creature.uid) ~= 3 then
totalmonsters = totalmonsters + 1
monster[totalmonsters] = creature.uid
end
end
checking.x = checking.x + 1
if checking.x > ending.x then
checking.x = starting.x
checking.y = checking.y + 1
end
until checking.y > ending.y
if totalmonsters ~= 0 then
current = 0
repeat
current = current + 1
doRemoveCreature(monster[current])
until current >= totalmonsters
end
doTeleportThing(cid, player_pos_entrada)
doSendMagicEffect(player_pos_entrada, 10)
else
doTeleportThing(cid, fromPosition, false)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You have already defeated Azarus, and decided to stay out of this haunted place.')
end
end
actions\scripts\yalahar_azerus_quest.lua
Lua:
--Config--
local statue_pos = {x = XXXXX, y = XXXXX, z = XXXXX} -- Place of the thing in the middle
local portal_quest01_pos = {x = XXXXX, y = XXXXX, z = XXXXX, stackpos = 2} -- Where the tp to the room is
local portal_quest02_pos = {x = XXXXX, y = XXXXX, z = XXXXX, stackpos = 2} -- Where the tp out of the room is
local new_portal_pos = {x = XXXXX, y = XXXXX, z = XXXXX, stackpos = 1} -- Where the tp to final final room is
local new_pos = {x = XXXXX, y = XXXXX, z = XXXXX} -- Where the tp ^ leads too
--End Config--
function onUse(cid, item, frompos, item2, topos)
if item.uid == 1968 and getThingfromPos(portal_quest01_pos).itemid ~= 9772 then
doCreateItem(9772,1,portal_quest01_pos)
doCreateItem(9772,1,portal_quest02_pos)
Potwory1()
else
doPlayerSendTextMessage(cid,22,"Sorry, not possible.")
end
return TRUE
end
local function Potwory1()
if math.random (1,8) ~= 8 then
doCreateMonster('Azerus Immortal', {x = statue_pos.x, y = statue_pos.y, z = statue_pos.z})
end
doCreateMonster('Rift Brood', {x = statue_pos.x+1, y = statue_pos.y+1, z = statue_pos.z})
doCreateMonster('Rift Brood', {x = statue_pos.x-1, y = statue_pos.y+1, z = statue_pos.z})
doCreateMonster('Rift Brood', {x = statue_pos.x, y = statue_pos.y-1, z = statue_pos.z})
doCreateMonster('Rift Worm', {x = statue_pos.x-1, y = statue_pos.y, z = statue_pos.z})
doCreateMonster('Rift Worm', {x = statue_pos.x+1, y = statue_pos.y, z = statue_pos.z})
doCreateMonster('Rift Worm', {x = statue_pos.x+1, y = statue_pos.y-1, z = statue_pos.z})
doCreateMonster('Rift Worm', {x = statue_pos.x-1, y = statue_pos.y-1, z = statue_pos.z})
addEvent(Potwory2, 30 * 1000)
end
local function Potwory2()
doCreateMonster('Rift Brood', {x = statue_pos.x-1, y = statue_pos.y+1, z = statue_pos.z})
doCreateMonster('Rift Brood', {x = statue_pos.x, y = statue_pos.y-1, z = statue_pos.z})
doCreateMonster('Rift Worm', {x = statue_pos.x-1, y = statue_pos.y, z = statue_pos.z})
doCreateMonster('Rift Worm', {x = statue_pos.x+1, y = statue_pos.y, z = statue_pos.z})
addEvent(Potwory3, 35 * 1000)
end
local function Potwory3()
doCreateMonster('Rift Scythe', {x = statue_pos.x-1, y = statue_pos.y, z = statue_pos.z})
doCreateMonster('Rift Scythe', {x = statue_pos.x+1, y = statue_pos.y, z = statue_pos.z})
doCreateMonster('Rift Scythe', {x = statue_pos.x+1, y = statue_pos.y-1, z = statue_pos.z})
doCreateMonster('Rift Scythe', {x = statue_pos.x-1, y = statue_pos.y-1, z = statue_pos.z})
addEvent(Potwory4, 40 * 1000)
end
local function Potwory4()
-- Not sure which one it will detect, so let's remove both ;) However we only need it looking for the first one if that monster exists.
if getCreatureName("Azerus Immortal") == TRUE then
doRemoveCreature(monster)
elseif monster = getCreatureName("Azerus") == TRUE then
doRemoveCreature(monster)
end
doCreateMonster('Azerus', {x = statue_pos.x, y = statue_pos.y+1, z = statue_pos.z})
doCreateMonster('War Golem', {x = statue_pos.x+1, y = statue_pos.y+1, z = statue_pos.z})
doCreateMonster('War Golem', {x = statue_pos.x-1, y = statue_pos.y+1, z = statue_pos.z})
doCreateMonster('War Golem', {x = statue_pos.x, y = statue_pos.y-1, z = statue_pos.z})
doCreateMonster('War Golem', {x = statue_pos.x-1, y = statue_pos.y, z = statue_pos.z})
addEvent(NewPortal, 90 * 1000)
end
local function NewPortal()
doCreateTeleport(1387, new_pos, new_portal_pos)
addEvent(RemoveAll, 60 * 1000)
end
local function RemoveAll()
doRemoveItem(getThingfromPos(portal_quest01_pos).uid,1)
doRemoveItem(getThingfromPos(portal_quest02_pos).uid,1)
doRemoveItem(getThingfromPos(new_portal_pos).uid,1)
end
Also Required the following monster
Azerus Immortal.xml
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Azerus" nameDescription="azerus" race="blood" experience="6000" speed="268" manacost="0">
<health now="8000" max="8000"/>
<look type="309" head="20" body="30" legs="40" feet="50" corpse="6080"/>
<targetchange interval="5000" chance="8"/>
<strategy attack="100" defense="0"/>
<flags>
<flag summonable="0"/>
<flag attackable="1"/>
<flag hostile="1"/>
<flag illusionable="0"/>
<flag convinceable="0"/>
<flag pushable="0"/>
<flag canpushitems="1"/>
<flag canpushcreatures="1"/>
<flag targetdistance="1"/>
<flag staticattack="90"/>
<flag runonhealth="0"/>
</flags>
<attacks>
<attack name="melee" interval="2000" min="-0" max="-900"/>
<attack name="manadrain" interval="2000" chance="10" range="7" min="-0" max="-2000">
<attribute key="shootEffect" value="energy"/>
<attribute key="areaEffect" value="poff"/>
</attack>
<attack name="manadrain" interval="2000" chance="15" range="7" radius="7" target="1" min="-0" max="-800">
<attribute key="shootEffect" value="fire"/>
<attribute key="areaEffect" value="bigclouds"/>
</attack>
<attack name="death" interval="2000" chance="20" range="7" min="-0" max="-524">
<attribute key="shootEffect" value="suddendeath"/>
<attribute key="areaEffect" value="mortarea"/>
</attack>
<attack name="lifedrain" interval="1000" chance="10" length="8" spread="0" min="-100" max="-500">
<attribute key="areaEffect" value="sleep"/>
</attack>
</attacks>
<defenses armor="30" defense="20">
<defense name="healing" interval="1000" chance="15" min="150" max="500">
<attribute key="areaEffect" value="blueshimmer"/>
</defense>
</defenses>
<elements>
<element energyPercent="100"/>
<element icePercent="100"/>
<element firePercent="100"/>
<element holyPercent="100"/>
<element earthPercent="100"/>
<element physicalPercent="100"/>
<element deathPercent="100"/>
</elements>
<immunities>
<immunity paralyze="1"/>
<immunity invisible="1"/>
</immunities>
<voices interval="5000" chance="10">
<voice sentence="The ultimate will finally consume this unworthy existence!" yell="1"/>
<voice sentence="My masters and I will tear down barriers and join the ultimate in its realm!" yell="1"/>
<voice sentence="The power of the Yalahari will all be mine!" yell="1"/>
<voice sentence="We will open the rift for a new time to come!"/>
<voice sentence="He who has returned from beyond has taught me secrets you can't even grasp!"/>
<voice sentence="The end of times has come!"/>
<voice sentence="The great machinator will make his entrance soon!"/>
<voice sentence="You might scratch my shields but they will never break!"/>
<voice sentence="You can't hope to penetrate my shields!"/>
<voice sentence="Do you really think you could beat me?"/>
</voices>
<loot>
</loot>
</monster>
monsters.xml
PHP:
<monster name="Azerus Immortal" file="Azerus Immortal.xml"/>