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

Talkaction script auto

Exactly

New Member
Joined
Jul 14, 2014
Messages
119
Reaction score
4
Hello i need make metin stone automatic this is talkaction script

My script:

Code:
local stones = {
            [1] = {name="Earth Stone"},
            [2] = {name="Icy Stone"},
            [3] = {name="Fire Stone"},
            [4] = {name="Wind Stone"},
    }

local pos = {
        [1] = {pos={x=1015, y=1086, z=7}},
            [2] = {pos={x=1089, y=1063, z=7}},
            [3] = {pos={x=1042, y=1102, z=7}},
            [4] = {pos={x=962, y=1053, z=7}},
    }



function onSay()
    local monst = stones[math.random(1, #stones)]
    local poss = pos[math.random(1, #pos)]
    print(monst, poss)
    if not(monst) then return TRUE end
    doCreateMonster(monst.name,poss.pos)
    doBroadcastMessage('[Event Stones]\n '.. monst.name ..' have been spawn. Find and defeat it!', 22)
    return TRUE
end
 
globalevents.xml
Code:
<globalevent name="metinStoneStart" interval="1000" event="script" value="event.lua"/>

event.lua
Code:
local stones = {
            [1] = {name="Earth Stone"},
            [2] = {name="Icy Stone"},
            [3] = {name="Fire Stone"},
            [4] = {name="Wind Stone"},
    }

local pos = {
        [1] = {pos={x=1015, y=1086, z=7}},
            [2] = {pos={x=1089, y=1063, z=7}},
            [3] = {pos={x=1042, y=1102, z=7}},
            [4] = {pos={x=962, y=1053, z=7}},
    }
  
local days = {['Monday'] = {'18:55:00'},
                ['Thursday'] = {'16:28:20'},
                }

local daysOpen = {}
local monst = stones[math.random(1, #stones)]
local poss = pos[math.random(1, #pos)]

            for k, v in pairs(days) do
                table.insert(daysOpen, k)
            end

            function onThink(interval)
                if isInArray(daysOpen, os.date('%A')) then
                    if isInArray(days[os.date('%A')], os.date('%X', os.time())) then
                        print(monst, poss)
                        if not(monst) then return TRUE end
                        doCreateMonster(monst.name,poss.pos)
                        doBroadcastMessage('[Event Stones]\n '.. monst.name ..' have been spawn. Find and defeat it!', 22)
                    end
                end
                return true
            end



Or MOD if you want
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Stones_Event Items" enabled="yes">
<config name="Stones_config"><![CDATA[

    names = {'earth stone', 'icy stone', 'fire stone', 'wind stone'}
   
    stones_name = {
            [1] = {name="Earth Stone"},
            [2] = {name="Icy Stone"},
            [3] = {name="Fire Stone"},
            [4] = {name="Wind Stone"},
    }

    pos = {
        [1] = {pos={x=1015, y=1086, z=7}},
            [2] = {pos={x=1089, y=1063, z=7}},
            [3] = {pos={x=1042, y=1102, z=7}},
            [4] = {pos={x=962, y=1053, z=7}},
    }
   
    days = {['Monday'] = {'18:55:00'}, 
                ['Sunday'] = {'03:46:20'}, 
                }
   
    stones = {
    ["earth stone"] = {
              [90] = {m = {'carniphila','earth elemental','bog raider'}, n = {6, 7}},
                    [80] = {m = {'bog raider','earth elemental'}, n = {6, 7}},
                  [70] = {m = {'giant spider','bog raider'}, n = {6, 7}},
                    [60] = {m = {'hydra','lich','giant spider','bog raider'}, n = {6, 7}},
                  [50] = {m = {'hydra','bog raider','serpent spawn'}, n = {6, 7}},
                  [40] = {m = {'hydra','defiler','serpent spawn'}, n = {6, 7}},
                    [30] = {m = {'medusa','hydra','serpent spawn','defiler'}, n = {6, 7}},
                  [20] = {m = {'medusa','lost soul','hydra','serpent spawn'}, n = {6, 7}},
                         [10] = {m = {'juggernaut','son of verminor','medusa'}, n = {5, 6}},
                          [1] = {m = {'medusa','juggernaut'}, n = {5,7}}z

    },

    ["icy stone"] = {
    [90] = {m = {'ice golem','frost dragon'}, n = {6, 7}},
                    [80] = {m = {'frost dragon','frost dragon hatchling'}, n = {6, 7}},
                  [70] = {m = {'frost dragon','crystal spider'}, n = {6, 7}},
                    [60] = {m = {'frost dragon','crystal spider'}, n = {7, 7}},
                  [50] = {m = {'frost dragon','crystal spider'}, n = {7, 7}},
                  [40] = {m = {'frost dragon'}, n = {7, 7}},
                    [30] = {m = {'frost dragon'}, n = {7, 8}},
                  [20] = {m = {'frost dragon'}, n = {7, 8}},
                         [10] = {m = {'yeti','frost dragon'}, n = {5, 7}},
                          [1] = {m = {'yeti'}, n = {2,3}}

    },

    ["fire stone"] = {
   
    [90] = {m = {'fire elemental','dragon','dragon lord','    dragon lord hatchling'}, n = {6, 7}},
                    [80] = {m = {'dragon lord hatchling','dragon lord'}, n = {6, 7}},
                  [70] = {m = {'dragon lord','diabolic imp'}, n = {6, 7}},
                    [60] = {m = {'dragon lord','diabolic imp'}, n = {6, 7}},
                  [50] = {m = {'dragon lord','demodras','diabolic imp'}, n = {6, 7}},
                  [40] = {m = {'dragon lord','diabolic imp','hellfire fighter'}, n = {5, 7}},
                    [30] = {m = {'diabolic imp','hellfire fighter','demon'}, n = {6, 7}},
                  [20] = {m = {'hellfire fighter','demon'}, n = {5, 6}},
                         [10] = {m = {'demon','hellhound'}, n = {5, 5}},
                          [1] = {m = {'demon'}, n = {5,5}}
    },
   
    ["wind stone"] = {
    [90] = {m = {'gargoyle','stone golem','black knight'}, n = {6, 7}},
                    [80] = {m = {'black knight','behemoth'}, n = {5, 7}},
                    [70] = {m = {'black knight','behemoth'}, n = {6, 7}},
                    [60] = {m = {'behemoth','destroyer'}, n = {6, 7}},
                    [50] = {m = {'behemoth','destroyer','betrayed wraith'}, n = {6, 7}},
                    [40] = {m = {'behemoth','destroyer','betrayed wraith'}, n = {6, 7}},
                    [30] = {m = {'dark torturer','betrayed wraith'}, n = {3, 5}},
                    [20] = {m = {'dark torturer','grim reaper'}, n = {5, 6}},
                            [10] = {m = {'blightwalker','undead dragon','grim reaper'}, n = {5, 6}},
                            [1] = {m = {'undead dragon'}, n = {5,5}}
    }

                }
               
                function getPercent(number, all)
    return (number / all) * 100
end

function choose(arg)
    return arg[math.random(#arg)]
end
]]></config>


<event type="combat" name="Kamulec" event="script"><![CDATA[
domodlib("Stones_config")
function onCombat(cid, target)

if isMonster(target) then
    registerCreatureEvent(target, 'Kamulec')
end

local t = getPercent(getCreatureHealth(target), getCreatureMaxHealth(target))
if isMonster(target) and isInArray(names, getCreatureName(target):lower()) then
    if t > 90 then doCreatureSetStorage(target, 1000, 91) end
    for k, v in pairs(stones[getCreatureName(target):lower()]) do
        if k >= t and getCreatureStorage(target, 1000) > k then
            local pos = getThingPos(target)
            for i = 1, math.random(v.n[1], v.n[2]) do
                local s = {x=pos.x,y=pos.y,z=pos.z}
                s.x = pos.x + math.random(-2,2)
                s.y = pos.y + math.random(-2,2)

                doCreateMonster(choose(v.m), pos, false, false, false)
            end
            return doCreatureSetStorage(target, 1000, k)
        end
    end
end
return TRUE
end  
]]></event>

<talkaction log="yes" words="!metin" access="4" event="script">
<![CDATA[
         domodlib("Stones_config")
function onSay()
    local monst = stones_name[math.random(1, #stones_name)]
    local poss = pos[math.random(1, #pos)]
    print(monst, poss)
    if not(monst) then return TRUE end
    doCreateMonster(monst.name,poss.pos)
    doBroadcastMessage('[Event Stones]\n '.. monst.name ..' have been spawn. Find and defeat it!', 22)
    return TRUE
end 
]]>
</talkaction>
<globalevent name="metinStoneStart" interval="1000" event="script"><![CDATA[
domodlib("Stones_config")
local daysOpen = {}
local monst = stones_name[math.random(1, #stones_name)]
local poss = pos[math.random(1, #pos)]

            for k, v in pairs(days) do
                table.insert(daysOpen, k)
            end

            function onThink(interval)
                if isInArray(daysOpen, os.date('%A')) then
                    if isInArray(days[os.date('%A')], os.date('%X', os.time())) then
                        print(monst, poss)
                        if not(monst) then return TRUE end
                        doCreateMonster(monst.name,poss.pos)
                        doBroadcastMessage('[Event Stones]\n '.. monst.name ..' have been spawn. Find and defeat it!', 22)
                    end
                end
                return true
            end
        ]]></globalevent>
<event type="login" name="metinStoneLogin" event="buffer"><![CDATA[
registerCreatureEvent(cid, 'Kamulec')
]]></event>

</mod>
 
Last edited:
Back
Top