• 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!

GlobalEvent Last Creep Standing World Event (Darashia Journey)

Fermantor

Active Member
Joined
Dec 16, 2009
Messages
209
Solutions
4
Reaction score
33
Location
Germany
Hello everyone, I tried to script this quest, and I think I succeed. The Positions are from RL Map, but there was the main quest room missing, so some positions are called "missing".

add this in data/globalevents/globalevents.xml
Code:
<globalevent name="LastCreep" interval="14400000" script="lastcreep.lua"/>
create this file: data/globalevents/scripts/lastcreep.lua
Code:
local grounds = {13272,13273,13274,13275,13276,13277,13278,13279,13280} -- Itemid of the groundfloors that slows you


local function kickOut()
   local TopPos = { x = missing(B), y = missing(B), z = 11}
   local BotPos = { x = missing(C), y = missing(C), z = 11}
   local middle = { x = 33260, y = 33264, z = 7}
   for x = TopPos.x, BotPos.x do
     for y = TopPos.y, BotPos.y do
       local Player = getThingfromPos({x=x, y=y, z=TopPos.z, stackpos = 253})
       if isPlayer(Player.uid) then
         doTeleportThing(Player.uid, middle, TRUE)
         setPlayerStorageValue(Player.uid, 17000, -1)
       end
     end
   end
end

local function NextWave()
   local TopPos = { x = missing(D), y = missing(D), z = 11}
   local BotPos = { x = missing(E), y = missing(E), z = 11}
   local middle = { x = missing(A), y = missing(A), z = 11}
   if getGlobalStorageValue(17000) == 8 then
     middle = { x = 33260, y = 32365, z = 10}
   else
     middle = { x = missing(A), y = missing(A), z = 11}
   end
   for x = TopPos.x, BotPos.x do
     for y = TopPos.y, BotPos.y do
       local Player = getThingfromPos({x=x, y=y, z=11, stackpos = 253})
       if isPlayer(Player.uid) then
         doTeleportThing(Player.uid, middle, TRUE)
         if getGlobalStorageValue(17000) ~= 8 then
           setPlayerStorageValue(Player.uid, 17000, 1)
         end
       end
     end
   end
   if getGlobalStorageValue(17000) <= 8 then
     setGlobalStorageValue(17000, getGlobalStorageValue(17000)+1)
     addEvent(kickOut, 1000 * 13)
     addEvent(NextWave, 1000*25)
   end
end

local function FloorChange()
   local TopPos = { x = missing(B), y = missing(B), z = 11}
   local BotPos = { x = missing(C), y = missing(C), z =11}
   for x = TopPos.x, BotPos.x do
     for y = TopPos.y, BotPos.y do
       local Floor = getThingfromPos({x=x, y=y, z=11, stackpos = 0})
       if Floor.itemid == grounds[getGlobalStorageValue(17001)] then
         doTransformItem(Floor.uid, grounds[zufallZahl(1,#grounds)])
       end
     end
   end
   if getGlobalStorageValue(17001) == 9 then
     setGlobalStorageValue(17001,1)
   else
     setGlobalStorageValue(17001,getGlobalStorageValue(17001)+1)
   end
   if getGlobalStorageValue(17000) == 9 then
     return TRUE
   else
     addEvent(FloorChange, 1000)
   end
end

local function LastCreepStand()
   local TopPos = { x = 33254, y = 32354, z = 9}
   local BotPos = { x = 33268, y = 32366, z = 9}
   local middle = { x = missing(A), y = missing(A), z = 11}
   for x = TopPos.x, BotPos.x do
     for y = TopPos.y, BotPos.y do
       local Player = getThingfromPos({x=x, y=y, z=9, stackpos = 253})
       if isPlayer(Player.uid) then
         doRemoveCondition(Player.uid, CONDITION_OUTFIT)
         doTeleportThing(Player.uid, middle, TRUE)
         setPlayerStorageValue(Player.uid, 17000, 1)
       end
     end
   end
   setGlobalStorageValue(17001, 1)
   setGlobalStorageValue(17000, 1)
   addEvent(kickOut, 1000 * 15)
   addEvent(FloorChange, 1000)
   addEvent(NextWave, 1000*25)
end

function onThink(cid, interval)
   if os.date("%a") == "Wed" then -- Event starts only on Wednesday
     if getGlobalStorageValue(17000) <= 0 or getGlobalStorageValue(17000) == 9 then
       broadcastMessage("The darashia journey will start in 15 minutes!", 18)
       addEvent(LastCreepStand, 1000 * 15 * 60)
     end
   end
   return TRUE
end
data/movements/movements.xml
Code:
   <movevent event="StepIn" uniqueid="17001" script="event/lastcreep.lua"/>
   <movevent event="StepIn" uniqueid="17002" script="event/lastcreep.lua"/>
   <movevent event="StepIn" uniqueid="17003" script="event/lastcreep.lua"/>
   <movevent event="StepIn" uniqueid="17004" script="event/lastcreep.lua"/>
   <movevent event="StepIn" uniqueid="17005" script="event/lastcreep.lua"/>
   <movevent event="StepIn" uniqueid="17006" script="event/lastcreep.lua"/>
   <movevent event="StepIn" uniqueid="17007" script="event/lastcreep.lua"/>
   <movevent event="StepIn" uniqueid="17008" script="event/lastcreep.lua"/>
data/movements/scripts/event/lastcreep.lua
Code:
local looktypes =
{
   [1] = {looktype = 120, teleport = { x = missing(1), y = missing(1), z = 11}}, -- Carniphila
   [2] = {looktype = 47, teleport = { x = missing(2), y = missing(2), z = 11}}, -- Quara Hydromancer
   [3] = {looktype = 232, teleport = { x = missing(3),  y = missing(3), z = 11}}, -- Lost Soul
   [4] = {looktype = 246, teleport = { x = missing(4), y = missing(4), z = 11}}, -- Blightwalker
   [5] = {looktype = 305, teleport = { x = missing(5), y = missing(5), z = 11}}, -- Mutated Rat
   [6] = {looktype = 311, teleport = { x = missing(6), y = missing(6), z = 11}}, -- Zombie
   [7] = {looktype = 320, teleport = { x = missing(7), y = missing(7), z = 11}}, -- Nightstalker
   [8] = {looktype = 86, teleport = { x = missing(8), y = missing(8), z = 11}}  -- Pharao (Thalas)
}


function onStepIn(cid, item, position, fromPosition)
   doSendMagicEffect(position, 10)
   if getCreatureOutfit(cid).lookType == looktypes[item.uid-17000].looktype then
     doTeleportThing(cid, looktypes[item.uid-17000].teleport)
     doSendMagicEffect(looktypes[item.uid-17000].teleport, 10)
     setPlayerStorageValue(cid, 17000, -1)
   else
     doTeleportThing(cid, fromPosition)
     doSendMagicEffect(fromPosition, 10)
   end
   return TRUE
end
data/actions/actions.xml
Code:
<action itemid="13238" script="event/Shapechanger/wand.lua"/>
data/actions/scripts/event/Shapechanger/wand.lua
Code:
local names = {"Carniphila","Quara Hydromancer","Lost Soul","Blightwalker","Mutated Rat","Zombie","Nightstalker","Pharao"}

function onUse(cid, item, fromPosition, itemEx, toPosition)
   if getPlayerStorageValue(cid, 17000) == 1 then
     local rand = zufallZahl(1,8)
     doRemoveCondition(cid, CONDITION_OUTFIT)
     doSetMonsterOutfit(cid, names[rand], 1000 * 23)
     doPlayerSendTextMessage(cid, 18, names[rand])
   else
     return FALSE
   end
   return TRUE
end

Plz tell me, if there are any errors, or something is missing, I don't have much time now, to double check everything ;)
LastCreepStanding.png
 
Back
Top