I have a script (Talkaction) made by a member of another forum. It consists of the following: Allows vocations summon different amounts of monsters.
Is working perfectly, the only problem is that summons all the monsters at the same level and using the same amount of mana. I wanted someone fix it to me, putting in a table where would be the name of the monsters with your level and amount of mana to summon.
Ex:
And if possible, turn into magic.
If anyone can help, thank you.
Here the script:
Is working perfectly, the only problem is that summons all the monsters at the same level and using the same amount of mana. I wanted someone fix it to me, putting in a table where would be the name of the monsters with your level and amount of mana to summon.
Ex:
Code:
{bear, wolf, polar bear: MinLevel = 20, mana = 100},
{dragon, giant spider, orc warlord: MinLevel = 80, mana 700}
And if possible, turn into magic.
If anyone can help, thank you.
Here the script:
Code:
local mana = 50 --custo de mana
local storage = 79845 --storage para o exhaustion
local tempo = 5 --em segundos
local monsters = {
[1] = {summons = {"rat", "dragon"}, maxSummons = 2, minLevel = 10},
[2] = {summons = {"rat", "dragon"}, maxSummons = 4, minLevel = 10},
[5] = {summons = {"rat", "dragon"}, maxSummons = 4, minLevel = 10},
[6] = {summons = {"rat", "dragon"}, maxSummons = 6, minLevel = 10}
}
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)
for k, v in pairs(monsters[getPlayerVocation(cid)].summons) do
if (param == v)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) < monsters[getPlayerVocation(cid)].minLevel then
return doPlayerSendCancel(cid, "Level insuficiente.")
else
doConvinceCreature(cid, doCreateMonster(param, playerpos))
doPlayerAddMana(cid, -mana, false)
exhaustion.set(cid, storage, tempo)
doSendMagicEffect(playerpos, 2)
end
return true
end
else
doPlayerSendCancel(cid, "You can't summon this monster.")
end
end
return true
end
Last edited by a moderator: