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

Turn this Talkaction into Spell

gabriel28

Active Member
Joined
Mar 16, 2012
Messages
200
Solutions
6
Reaction score
25
Someone can do it for me?

Code:
local storage = 79845 --storage for exhaustion
local tempo = 5 --in seconds

local monsters = {
[1] = {summons = {["rat"] = {level = 10, mana = 20}, ["dragon"] = {level = 100, mana = 200} }, maxSummons = 2  },
[2] = {summons = {["rat"] = {level = 10, mana = 20}, ["dragon"] = {level = 100, mana = 200} }, maxSummons = 4  },
[5] = {summons = {["rat"] = {level = 10, mana = 20}, ["dragon"] = {level = 100, mana = 200} }, maxSummons = 4  },
[6] = {summons = {["rat"] = {level = 10, mana = 20}, ["dragon"] = {level = 100, mana = 200} }, maxSummons = 6  },
[9] = {summons = {["rat"] = {level = 10, mana = 20}, ["dragon"] = {level = 100, mana = 200} }, maxSummons = 6  },
[10] = {summons = {["rat"] = {level = 10, mana = 20}, ["dragon"] = {level = 100, mana = 200} }, maxSummons = 8  },
}

function onSay(cid, words, param, channel)
if exhaustion.check(cid, storage) then
doPlayerSendTextMessage(cid, 22, "You are exhausted.")
return true
end

    --Player Status
    local playerpos = getPlayerPosition(cid)
    param = string.lower(param)
    local loop = 0
 
    function checkSummon()
        for k, v in pairs(monsters[getPlayerVocation(cid)].summons) do
            if param == k then
                return true
            end
        end
        return false
    end
 
    if not checkSummon() then
        doPlayerSendCancel(cid, "You can't summon this monster.")
        return true
    end
 
    for k, v in pairs(monsters[getPlayerVocation(cid)].summons) do
        if (param == k) then
            if (monsters[getPlayerVocation(cid)]) and #getCreatureSummons(cid) >= monsters[getPlayerVocation(cid)].maxSummons then
                return doPlayerSendCancel(cid, "Você já tem sumons demais.")
            else
            --Summon
                if getPlayerLevel(cid) < v.level then
                    return doPlayerSendCancel(cid, "Você não possui level suficiente.")
                elseif getCreatureMana(cid) < v.mana then
                    return doPlayerSendCancel(cid, "Você não possui mana suficiente.")
                end
                    doConvinceCreature(cid, doCreateMonster(param, playerpos))
                    doPlayerAddMana(cid, -v.mana, false)
                    exhaustion.set(cid, storage, tempo)
                    doSendMagicEffect(playerpos, 2)
                return true
            end
        end
    end
    return true
end
 
Change:
Code:
function onSay(cid, words, param, channel)
With:
Code:
onCastSpell(cid, param)
Then in data/spells/spells.xml add params="1" in that spell's line.
From now, you have to say:
Code:
exurablabla "rat
 
Change:
Code:
function onSay(cid, words, param, channel)
With:
Code:
onCastSpell(cid, param)
Then in data/spells/spells.xml add params="1" in that spell's line.
From now, you have to say:
Code:
exurablabla "rat


No error, but nothing happened, don't summon anything.

Sorry for the dalay to answer. I was busy with University.
 
Back
Top