• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Problem with yakchal tomb

Eraghon

New Member
Joined
Mar 2, 2009
Messages
94
Reaction score
0
Location
Szczecin
Hey i have problem with yakchal tomb.
First - I can use frozen starlight unlimted times on sarcophagus, how can I change it to umm.. one time per 20min?
and second, frozen starlight never disappear.. it should, how can I change it?
Code:
local config = {
random = math.random(1,6), -- random of the destruction of frozen starlight
starid = 2361,  -- id of frozen starlight
tombid = 7362, -- id of the tomb (you use starlight on it)
storage = 4358, -- storage of blocking quest (one wawaking per 15 mins)
bosspos = {
{x=32295,y=31057,z=14}, -- position where yakchal first spawns
{x=32295,y=31061,z=14} -- position where yakchal is teleported (after some time)
},
effectpos = {
{x=32295,y=31061,z=14}, -- positions of effect (surrounding the sarcophagus)
{x=32296,y=31060,z=14},
{x=32294,y=31060,z=14},
{x=32295,y=31058,z=14}
},
boss = "yakchal", -- name of the boss
monsters = {
"ice witch", -- monsters which are summoned
"ice golem",
"crystal spider",
"frost dragon"
},
poses = {
{x=32293,y=31062,z=14}, -- posses of monster summons
{x=32287,y=31066,z=14},
{x=32293,y=31065,z=14},
{x=32293,y=31067,z=14},
{x=32297,y=31063,z=14},
{x=32303,y=31064,z=14}
},
poses2 = {
{x=32283,y=31066,z=14},
{x=32282,y=31068,z=14},
{x=32284,y=31070,z=14},
{x=32285,y=31064,z=14},
{x=32286,y=31069,z=14},
{x=32287,y=31065,z=14},
{x=32288,y=31067,z=14},
{x=32289,y=31061,z=14},
{x=32290,y=31063,z=14},
{x=32291,y=31060,z=14},
},
poses1 = {
{x=32293,y=31060,z=14},
{x=32294,y=31064,z=14},
{x=32295,y=31067,z=14},
{x=32296,y=31063,z=14},
{x=32297,y=31068,z=14},
{x=32298,y=31061,z=14},
{x=32299,y=31063,z=14},
{x=32300,y=31065,z=14},
{x=32301,y=31062,z=14},
{x=32302,y=31066,z=14},
{x=32303,y=31069,z=14},
{x=32304,y=31061,z=14},
{x=32305,y=31070,z=14},
{x=32306,y=31064,z=14}
},
messages = {
"The frozen starlight shattered, but you have awoken the icewitch Yakchal from her slumber! She seems not amused ...",
"You have awoken the icewitch Yakchal from her slumber! She seems not amused ..."
}
}
function FirstAttack()
    doSummonCreature(config.monsters[2], config.poses[1])
    doSummonCreature(config.monsters[2], config.poses[2])
    doSummonCreature(config.monsters[1], config.poses[3])
    doSummonCreature(config.monsters[3], config.poses[4])
    doSummonCreature(config.monsters[3], config.poses[5])
    doSummonCreature(config.monsters[1], config.poses[6])
end
function SecondAttack()
    doSummonCreature(config.monsters[2], config.poses2[1])
    doSummonCreature(config.monsters[2], config.poses2[2])
    doSummonCreature(config.monsters[1], config.poses2[3])
    doSummonCreature(config.monsters[3], config.poses2[4])
    doSummonCreature(config.monsters[3], config.poses2[5])
    doSummonCreature(config.monsters[1], config.poses2[6])
    doSummonCreature(config.monsters[2], config.poses2[7])
    doSummonCreature(config.monsters[3], config.poses2[8])
    doSummonCreature(config.monsters[1], config.poses2[9])
    doSummonCreature(config.monsters[3], config.poses2[10])
end
function ThirdAttack()
    doSummonCreature(config.monsters[4], config.poses1[1])
    doSummonCreature(config.monsters[4], config.poses1[2])
    doSummonCreature(config.monsters[1], config.poses1[3])
    doSummonCreature(config.monsters[3], config.poses1[4])
    doSummonCreature(config.monsters[3], config.poses1[5])
    doSummonCreature(config.monsters[1], config.poses1[6])
    doSummonCreature(config.monsters[2], config.poses1[7])
    doSummonCreature(config.monsters[3], config.poses1[8])
    doSummonCreature(config.monsters[1], config.poses1[9])
    doSummonCreature(config.monsters[3], config.poses1[10])
    doSummonCreature(config.monsters[2], config.poses1[11])
    doSummonCreature(config.monsters[3], config.poses1[12])
    doSummonCreature(config.monsters[1], config.poses1[13])
    doSummonCreature(config.monsters[3], config.poses1[14])
end
function YakchalAttack()
    yakchalpos = {x=32295,y=31057,z=14,stackpos= STACKPOS_TOP_CREATURE}
    getyakchal = getThingFromPos(yakchalpos)
    doTeleportThing(getyakchal.uid, config.bosspos[2], FALSE)
    doSendMagicEffect(config.bosspos[2], CONST_ME_TELEPORT)
    doSendMagicEffect(config.bosspos[1], CONST_ME_TELEPORT)
end
function doQuest()
  setGlobalStorageValue(cid, 4358, -1)
end
function onUse(cid, item, fromPosition, itemEx, toPosition)

if itemEx.itemid == config.tombid and item.itemid == config.starid then 
if getGlobalStorageValue(4358) == -1 then
    if math.random(1,6) == 6 then
        doCreatureSay(cid, config.messages[1], TALKTYPE_ORANGE_1)
        doPlayerRemoveItem(cid, config.starid, 1)
    elseif math.random(1,6) < 6 then
        doCreatureSay(cid, config.messages[2], TALKTYPE_ORANGE_1)
    end
    doSummonCreature(config.boss, config.bosspos[1])
    setGlobalStorageValue(4358, 1)
    addEvent(doQuest, 90000)
    addEvent(FirstAttack, 7000)
    addEvent(SecondAttack, 14000)
    addEvent(ThirdAttack, 19000)
    addEvent(YakchalAttack, 19500)
    for i = 1, table.maxn(config.effectpos) do
        doSendMagicEffect(config.effectpos[i], 30)
    end
else
    doPlayerSendCancel(cid,"You can not use this object.")
end
end
return TRUE
end
 
This is a great script, i used it too. but as you can see you can only awaken the ice witch one awaking per 15 min if you read.

storage = 4358, -- storage of blocking quest (one wawaking per 15 mins)

you might be able to change the value from 15 mins to 20 mins. At least you've tried :D
 
Last edited:
Back
Top