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

Solved A few fixes or help.

DukeeH

Active Member
Joined
Dec 6, 2010
Messages
550
Solutions
3
Reaction score
39
First one is like anihilator but a custom quest, it's allowing people to go after the first team and get the room without the respawns.
Code:
local summon={
    {'Orshabaal', {x=145, y=74, z=14}},
    {'Orshabaal', {x=144, y=74, z=14}},
    {'Lavahole', {x=140, y=72, z=14}},
    {'Lavahole', {x=141, y=72, z=14}},
    {'Lavahole', {x=142, y=72, z=14}},
    {'Lavahole', {x=143, y=72, z=14}},
    {'Lavahole', {x=140, y=76, z=14}},
    {'Lavahole', {x=141, y=76, z=14}},
    {'Lavahole', {x=142, y=76, z=14}},
    {'Lavahole', {x=143, y=76, z=14}}
}

local playerA={
    {x=141, y=39, z=14},
    {x=140, y=39, z=14},
    {x=139, y=39, z=14},
    {x=138, y=39, z=14}
}
local playerB={
    {x=143, y=74, z=14},
    {x=142, y=74, z=14},
    {x=141, y=74, z=14},
    {x=140, y=74, z=14}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local t = {}
    if item.itemid == 1945 then
        for i = 1, #playerA do
            t=getTopCreature(playerA).uid
            if t == 0 or not isPlayer(t) then
                return doPlayerSendCancel(cid, 'You need 4 players for this quest.')
            elseif getPlayerLevel(t) < 200 then
                return doPlayerSendCancel(cid, 'All players need to have level 200 or higher.')
            end
        end
        for i = 1, #summon do
            doCreateMonster(summon[1], summon[2])
        end
        for i=1, #t do
            doTeleportThing(t, playerB)
            doSendMagicEffect(playerA, CONST_ME_POFF)
            doSendMagicEffect(playerB, CONST_ME_ENERGYAREA)
        end
    else
        for x = 139, 150 do
            for y = 71, 77 do
                local v = getTopCreature({x=x, y=y, z=14}).uid
                if v ~= 0 then
                    if isPlayer(v) then
                        return doPlayerSendCancel(cid, 'There is already a team in the quest room.')
                    elseif isMonster(v) then
                        table.insert(t, v)
                    end
                end
            end
        end
        for i = 1, #t do
            doRemoveCreature(t)
        end
    end
    return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end

Second one is a player broadcast talkaction, it doesn't have cooldown, I wanna set 5 minutes between two broadcasts from the same player.

Solved, Thanks @Xikini.

Thanks!
 
Last edited:
Green texted the parts I added, so you can see what was added.
Code:
local levelReq = 150 -- Level needed to use the command.
local minChars = 3 -- How many characters may you write as minumum?
local basePrice = 25000 -- Base price, will be multiplied by the players level.
--[[
local exstorage = 45001 -- any empty storage
local time = 24*60*60 -- h*m*s (5 min = 5*60)
]]--
function onSay(cid, words, param, channel)
   local broadcastPrice = basePrice
   --[[
   if exhaustion.check(cid, exstorage) then
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Sorry, you need to wait 5 minutes before broadcasting again.")
     return TRUE
   end
   ]]--
   if getPlayerLevel(cid) < levelReq then
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Sorry, you need to be atleast level " .. levelReq .. " to use this command.")
     return TRUE
   end
   if string.len(param) < minChars then
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you need to enter atleast " .. minChars .. " characters.")
     return TRUE
   end
   if doPlayerRemoveMoney(cid, broadcastPrice) == TRUE then
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Broadcast successfully sent.")
     broadcastMessage("Player's Broadcast: \n " .. getPlayerName(cid) .. " [" .. getPlayerLevel(cid) .. "]: \n " .. param .. "", MESSAGE_STATUS_WARNING)
     --[[
     exhaustion.set(cid, exstorage, time)
     ]]--
   else
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you have not enough money. This message costs " .. broadcastPrice .. " gold coins.")
   end
   return true
end
 
Green texted the parts I added, so you can see what was added.
Code:
local levelReq = 150 -- Level needed to use the command.
local minChars = 3 -- How many characters may you write as minumum?
local basePrice = 25000 -- Base price, will be multiplied by the players level.
--[[
local exstorage = 45001 -- any empty storage
local time = 24*60*60 -- h*m*s (5 min = 5*60)
]]--
function onSay(cid, words, param, channel)
   local broadcastPrice = basePrice
   --[[
   if exhaustion.check(cid, exstorage) then
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Sorry, you need to wait 5 minutes before broadcasting again.")
     return TRUE
   end
   ]]--
   if getPlayerLevel(cid) < levelReq then
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Sorry, you need to be atleast level " .. levelReq .. " to use this command.")
     return TRUE
   end
   if string.len(param) < minChars then
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you need to enter atleast " .. minChars .. " characters.")
     return TRUE
   end
   if doPlayerRemoveMoney(cid, broadcastPrice) == TRUE then
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Broadcast successfully sent.")
     broadcastMessage("Player's Broadcast: \n " .. getPlayerName(cid) .. " [" .. getPlayerLevel(cid) .. "]: \n " .. param .. "", MESSAGE_STATUS_WARNING)
     --[[
     exhaustion.set(cid, exstorage, time)
     ]]--
   else
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you have not enough money. This message costs " .. broadcastPrice .. " gold coins.")
   end
   return true
end
Perfect, thanks. Do you have any idea about the other one? it should remove the monsters and create it again on the next team as it's on the script.
 
I don't think we fully understand the issue your having. Can you explain in more detail?
 
If two teams go to the quest (anihilator like quest) in a small period of time, the second team doesn't get the monsters spawn. So you wait for a team to do and clean, then the quest is empty and they can just do it without monsters.
 
As far as I can tell the script summons a couple orshabaals, and some lava things.. Is there 'regular spawned' monsters inside? If so, delete them from map editor, and add their positions & names to the spawned monster list in the script.
 
As far as I can tell the script summons a couple orshabaals, and some lava things.. Is there 'regular spawned' monsters inside? If so, delete them from map editor, and add their positions & names to the spawned monster list in the script.
no, the monsters are created by the script. i don't know why it doesn't create the monsters sometimes if the teleport players always work.
 
I've looked at this script probably 7 or 8 times, and I still believe there is nothing wrong with it.
Can you replicate the problem yourself? Consistently?
Are the bodies of the monsters blocking the creation of them?
Is only some monsters being spawned?
None at all?
Also, try making the thread as 'not solved' maybe more people will look in.
 
Back
Top