• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

TFS 0.X [hunting room] lever spawn monster -- based on /MOD hunting arena

tuduras

Well-Known Member
Joined
Jun 4, 2017
Messages
341
Solutions
2
Reaction score
58
Hello Otlanders , everythink good?
________________________________________________
Is possible to make lever that spawn monster based on MOD/hunting arena from 0.4 memsoria datapack?
HERE post /MOD

LUA:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Hunting Arena" version="0.1" author="Cris" contact="[email protected]" enabled="yes">
<config name="HuntingConfig"><![CDATA[
pozycje =
{
                {x=447, y=22, z=14,stackpos=STACKPOS_TOP_CREATURE},
 
}
huntingArena =
{
    {x=437,y=7,z=14},
    {x=579,y=68,z=14}
}

templepos = {x=129, y=61, z=6}
temple2pos = {x=129, y=61, z=6}
level_min = 4000
cycki = {}
wybierzcycki = {}
czekajcycki1 = {}
czekajcycki2 = {}
tajmtujus = 1
]]></config>


<movevent type="StepIn" actionid="10001" event="script"><![CDATA[
domodlib("HuntingConfig")
function onStepIn(cid, item, position, fromPosition)
    if getPlayerLevel(cid)<level_min then
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Your level has to be at least "..level_min..".")
        doTeleportThing(cid, templepos)
        doSendMagicEffect(templepos, CONST_ME_TELEPORT)
        return true
    end
    if not isPlayer(cid) then
        print('[HUNTINGARENA]: COS CO NIE JEST GRACZEM PROBOWALO WBIC NA ARENE')
        return true
    end
    if not isCreature(cid) then
        print('[HUNTINGARENA]: COS CO NIE JEST POSTACIA STANELO NA TP')
        return true
    end
    if isPlayerGhost(cid) then
        doPlayerSendTextMessage(cid,20,'Gdzie z tymi syrami na ghoscie sie tu pakujesz?...')
        return true
    end
    function kickOut(cid)
        if isCreature(cid) and getPlayerStorageValue(cid, 156661) ~= -1 then
            doTeleportThing(cid, templepos)
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
            doCreatureSetStorage(cid, 156661, -1)
            doCreatureSay(cid, "You have been kicked out from hunting room.", TALKTYPE_ORANGE_1, false, cid, getThingPos(cid))
            doCreatureSetNoMove(cid, false)
        end
    end

    if (getPlayerItemCount(cid, 11230)>0) or getPlayerStorageValue(cid, 482933) == 1 then
        for i=1, #pozycje do
            local wolne_miejsce = getThingFromPos(pozycje[i])
            if not(isCreature(wolne_miejsce.uid)) then
                doPlayerRemoveItem(cid, 11230, 1)
                doTeleportThing(cid, pozycje[i])
                doCreatureSetStorage(cid, 156661, i)
                stopEvent(cycki[cid])
                cycki[cid] = addEvent(kickOut, 1000 * 60 * 20, cid)
                doSendMagicEffect(getCreaturePosition(cid), 61)
                doPlayerSendTextMessage(cid,20,'Welcome to Hunting Arena! You will be kicked after 20 minutes! ')
                doCreatureSetStorage(cid, 156667, os.time())
                doCreatureSetStorage(cid, 156666, (os.time()+1200))
                doSendMagicEffect(position, 10)
                return true
            else
                if (i==#pozycje) then
                    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "All hunting places are busy.")
                    doTeleportThing(cid, templepos)
                    doSendMagicEffect(templepos, CONST_ME_TELEPORT)
                    return true
                end
            end
        end
    else

        doTeleportThing(cid, templepos)
        doSendMagicEffect(getThingPos(cid), 2)
        doPlayerPopupFYI(cid, '-English Version-\n\nSorry, you do not have Ivory Bone which is necessary.\nYou can buy it from SMS Shop or get from many Quests.\n\nAt Hunting Arena you can spawn every monster on Memsoria.\nMore information on memsoria.pl/arena')
        doPlayerPopupFYI(cid, '-Polska Wersja-\n\nWybacz, nie posiadasz Ivory Bone, ktory jest konieczny.\nMozesz kupic go w SMS Shop lub zdobyc z wielu Questow.\n\nNa Hunting Arenie mozesz stworzyc kazdego potwora na Memsoria.\nWiecej informacji na memsoria.pl/arena')
    end
end
]]></movevent>
<movevent type="StepIn" actionid="6666" event="script"><![CDATA[
domodlib("HuntingConfig")
function onStepIn(cid, item, position, fromPosition)
    local wejscia = getPlayerStorageValue(cid, 156668)
    print(os.time())
    if (wejscia<0) then
        doCreatureSetStorage(cid, 156668, 1)
    else
        doCreatureSetStorage(cid, 156668, (wejscia+1))
    end
    if not isPlayer(cid) then
        doRemoveCreature(cid, true)
        return true
    end
    if not isCreature(cid) then
        print('[HUNTINGARENA]: COS CO NIE JEST POSTACIA STANELO NA TP')
        return true
    end
    if isPlayerGhost(cid) then
        doPlayerSendTextMessage(cid,20,'...')
        return true
    end
    if (getPlayerAccess(cid)>4) then
        return true
    end
    doPlayerSendTextMessage(cid,20,'Uwaga! Aby zapobiec debugom na Hunting Arenie, radzimy ustawic skrypt jedynie w iconach (nie w hotkeyach czy cave hotkeyach)! Ponadto minimalna wartosc w Elf Bocie musi wynosic 800 ms.')
    doPlayerSendTextMessage(cid,20,'1. /arena monster name, example: /arena Demon\n       2. !spawn - spawning monsters in arena \n       3. !huntexit - if u want to leave hunting arena\n       4. !arena info - some data gathered by arena\n (!!!) Remember than you can create monsters available only for your current level.')
    doCreatureSetNoMove(cid, true)
    local spec = getSpectators(getThingPosition(cid), 8, 8)
            if spec ~= nil then
                for _, s in pairs(spec) do
                    if isMonster(s) then
                        doRemoveCreature(s)
                    end
                end
            end
    doSendMagicEffect(getCreaturePosition(cid), 10)
    doSendMagicEffect(getCreaturePosition(cid), 13)
end
]]></movevent>
<talkaction words="!huntexit" hidden="no" event="script"><![CDATA[
domodlib("HuntingConfig")
function onSay(cid, words, param)
    if isCreature(cid) and getPlayerStorageValue(cid, 156661) > 0 then
        doCreatureSetNoMove(cid, false)
        doTeleportThing(cid, templepos)
        doSendMagicEffect(templepos, CONST_ME_TELEPORT)
        doCreatureSetStorage(cid, 156661, -1)
        stopEvent(cycki[cid])
    end
    return true
end
]]></talkaction>
<talkaction words="/arena" hidden="yes" event="script"><![CDATA[
domodlib("HuntingConfig")
function onSay(cid, words, param, channel)
    if(param == '') then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
        return true
    end
    local p = getThingPosition(cid)
    if p.z == huntingArena[1].z and (p.x > huntingArena[1].x and p.x < huntingArena[2].x) and (p.y > huntingArena[1].y and p.y < huntingArena[2].y) then
        doCreatureSetStorage(cid, 156662, 0)
        local m = {"Gostir", "Isildur", "Khamul", "Delicia", "Christmas Queen", "Chester", "Pandora The Summon", "Christmas Island", "Malvegil", "Hailee", "Eliot", "Sauron", "Smaug", "Pandrodor", "Feomathar", "Halloween", "Zayn", "Cecilia", "Irdorath", "Gate", "Undead Mummy", "Santa Helper", "Resident Hydra", "Gostir", "Warg", "Smaug", "Uruk Hai", "Isildur", "Khamul", "Malvegil", "Szeloba", "Talion", "Turin", "Witch King", "Killer", "Feomathar", "Irdorath", "Pandrodor", "Mikolaj",
        "Szeloba", "Talion", "Turin", "Uruk Hai", "Vandal", "Red Goblin", "Bojack", "Warg", "Witch King", "Undead Jester", "EXP Bug", "Apocalypse", "omen", "Vojanix", "Maxie", "baranek", "dragonus", "jesien", "apollyon", "adrian", "Super Addoner", "brick wall", "Ice Wall", "Adept Weza", "Adrian", "Wind Stone", "Metal Wall", "Flame Stone", "Stone of Madness", "Stone Of Craziness",  "Devil Stone", "Ice Stone", "Earth Stone", "Boogeyman", "Water Stone", "Jocker", "Sinister", "Carie", "Aldo", "Aledr", "Aol Seller", "Abbadon", "Archangel Messenger", "Ariane", "Eddeard Stark", "Cecilia", "Celest", "Poluck", "A Sweaty Cyclops", "Dark Rodo", "Deruno", "Seller", "Donald", "Easter Hare", "Eddard Stark", "Eryn", "EXP", "Fiona", "Frodo", "Ghar'thol", "Miner", "grizzly adams", "Guardian", "Halvar", "Hana Adams", "Harmor", "Haroun", "Harry", "Helmut", "Hugo", "Hunting Arena", "John", "King Tibianus", "Lily", "Lola", "Lua82Example Merchant", "Mailman Maily", "Marina", "Mariola", "Marlick", "Merchant Glut", "Morpel", "Nyxic", "Nag'Bob", "Nathil", "Nimral", "Oliver", "The Oracle", "The Oracle", "Peter", "Pythius The Rotten", "Rabadan", "Rashid", "Redward", "Riona", "Ruby", "Rybak Harry", "Rybak Tom", "Santa Claus", "Secret Blesser", "Serafin", "Sluga Diabla", "Soilance", "Soya", "Starzec", "Steven", "Super Accesser", "Sylvester", "Temple", "Boleslaw Chrobry", "The Gambling Man", "The Sweet Girl", "Timral", "Tormir", "Training Room", "Triss", "Tyoric", "Varkhal", "Varkkhal", "Vip Zone", "Warchief Wo'buff", "Wounded Archangel", "XML82Example Merchant", "Reborn System", "Yaman", "Zlowrogi Duch", "Zombie", "Zonya", "pandora", "undead warrior", "zombie event", "gorlic", "fire stone", "black hero", "death", "training coach", "ice demon", "ice guard", "Devil Stone", "easter hare", "the mutated pumpkin", "toxiros", "kriegerin", "kujon", "bazir", "stone wall", "ochrona"}
        if isCreature(cid) and getPlayerStorageValue(cid, 156661) > 0 then
            if isInArray(m, param) then
                doPlayerSendCancel(cid, "The chosen monster is forbidden!")
                doPlayerSendTextMessage(cid,20,"The chosen monster is forbidden!")
                return true
            else
                doCreatureSay(cid, "You choose: " .. param .. ".", TALKTYPE_ORANGE_1)
                wybierzcycki[cid] = param
            end
        else
            doPlayerSendTextMessage(cid, 19,"You are not inside hunting arena!")
        end
    end
    return true
end
]]></talkaction>
<talkaction words="!spawn" hidden="yes" event="script"><![CDATA[
domodlib("HuntingConfig")
function onSay(cid, words, param, channel)
    if not checkExhausted(cid, 156665, 1) or not isCreature(cid) then
        return true
    end
    local p = getThingPosition(cid)
    if p.z == huntingArena[1].z and (p.x > huntingArena[1].x and p.x < huntingArena[2].x) and (p.y > huntingArena[1].y and p.y < huntingArena[2].y) then
        local wartosc = getPlayerStorageValue(cid, 156661)
        local area = getArea(pozycje[wartosc], 5, 5)
        if (getPlayerStorageValue(cid, 156661)>0) then
            if (getPlayerStorageValue(cid, 156662)==5) then
                for i = 1, #area do
                    position = area[i]
                    doCleanTile(position)
                end
                doCreatureSetStorage(cid, 156662, 0)
            else
                doCreatureSetStorage(cid, 156662, ((getPlayerStorageValue(cid, 156662))+1))
                doCreateMonster(wybierzcycki[cid], {x=pozycje[wartosc].x, y=pozycje[wartosc].y+2, z=pozycje[wartosc].z}, false, false, false)
                doCreateMonster(wybierzcycki[cid], {x=pozycje[wartosc].x, y=pozycje[wartosc].y-2, z=pozycje[wartosc].z}, false, false, false)
            end
        end
    else
            doPlayerSendTextMessage(cid, 19,"You are not inside hunting arena!")
    end
    return true
end
]]></talkaction>
<talkaction words="!arena" hidden="yes" event="script"><![CDATA[
domodlib("HuntingConfig")
function onSay(cid, words, param, channel)
    local enter_count = getPlayerStorageValue(cid, 156668)
    local enter_data = os.date("%X",tonumber(getPlayerStorageValue(cid, 156667)))
    local current_time = os.time()
    local data1 = tonumber(getPlayerStorageValue(cid, 156667))
    local data2 = tonumber(getPlayerStorageValue(cid, 156666))
    local time_left = os.date("%X",tonumber(data2-os.time()))
    if(param == '') then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
        doPlayerSendTextMessage(cid, 19,"Available arena's commands: !spawn, /arena monstername, !arena info")
        return true
    end
    if (getPlayerStorageValue(cid,156661)==-1) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You aren\'t inside hunting arena!")
        return true
    end
    if(param == 'info') then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Hunting arena data for player "..getCreatureName(cid)..":")
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[STATS]\nEnter count: "..enter_count.."\nEnter time: "..enter_data.."\nTime left: "..time_left.."")
        if wybierzcycki[cid]~=nil then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[CONFIG]\nChosen monster: "..wybierzcycki[cid].."\nAuto prolongation: currently unavailable\nAuto spawning: currently unavailable")
        end
    end
    return true
end
]]></talkaction>
</mod>

best regards
I used otx 2.16 based on 0.3.7 and mod doesn't work. Works with 0.4
 
Last edited:

Similar threads

Back
Top