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

I need anti mage bomb

Jonass

Here who doesn't run, it flies.
Joined
Nov 12, 2008
Messages
216
Reaction score
3
Sorry for the inconvenience but I need a script for the mage bomb, somebody could help me?
 
Put in creaturescripts... anti.lua

Lua:
local config = {
        seconds = 3,            -- in seconds
        onlyWithSameIP = "yes"  -- will work for all players ("no"), or only check player with same IP? ("yes")
}

--DONT MODIFY
config.onlyWithSameIP = getBooleanFromString(config.onlyWithSameIP)

local m_lastLogin, m_lastIP = 0, 0

function onLogin(cid)
        local timeNow, playerIP = os.time(), getPlayerIp(cid)
        if(m_lastLogin + config.seconds >= timeNow and
                (config.onlyWithSameIP == FALSE or m_lastIP == playerIP)) then
                return FALSE
        end

        m_lastIP = playerIP
        m_lastLogin = timeNow
        return TRUE
end

Now enter in login.lua
add this...

Code:
        registerCreatureEvent(cid, "MageBomb")

Now enter in creaturescripts.xml and put this line:

Lua:
        <event type="login" name="MageBomb" event="script" value="anti.lua"/>
 
okay its anti-mc but it works like anti-magebomb

Credits to Shawak

go to data\creaturescripts\scripts
and make anew lua called
Antimagebomb

and put this
Code:
local config = {
        max = 1,
        text = "Multi-Client or Magebomb is not allowed.Bot allowed.",
        group_id = 1  -- it will only kick player whit that id (1=Players, 2=tutor, 3=seniortutors, 4=Gm's, 5=Cm's and 6=God's
}

local accepted_ip_list = ""  -- here put the Ip you whant to be allowed to use Mc/Magebomb..

local function antiMC(p)
        if #getPlayersByIp(getPlayerIp(p.pid)) >= p.max then
                doRemoveCreature(p.pid)
        end
        return TRUE
end

function onLogin(cid)
        if getPlayerGroupId(cid) <= config.group_id then
                if isInArray(accepted_ip_list,getPlayerIp(cid)) == FALSE then
                        addEvent(antiMC, 1000, {pid = cid, max = config.max+1})
                        doPlayerPopupFYI(cid, config.text)
                end
        end
        return TRUE
end


then go to data\creaturescripts\creaturescripts.xml

and add this line
Code:
	<event type="login" name="Antimagebomb" event="script" value="Antimagebomb.lua"/>
 
I am just wondering but isn't there a hardcoded anti magebomb system via attack delay? If that's not what you mean then you have to be more specific about what you want, anti magebomb could mean anything from not allowing mc to blocking the packets that a magebomb sends lol
 
Back
Top