Shinmaru
エロルアー Scripter!
ok, I'm making a spell system using talkactions as the base,
now before you say this is useless, let me explain, the reason
on this is that i want to make it that if you say the magical words
they will do the actions that are stated in another lua script, this
helps me in some special vocations that I plan to make, so
here is the script so far and i want to know if commands can be
executed from a lua script using dofile('lua name here.lua') :
will really appreciate your cooperation on this.
now before you say this is useless, let me explain, the reason
on this is that i want to make it that if you say the magical words
they will do the actions that are stated in another lua script, this
helps me in some special vocations that I plan to make, so
here is the script so far and i want to know if commands can be
executed from a lua script using dofile('lua name here.lua') :
LUA:
local customSpell = {
[words = "helgana"] = {spellName = "Hell's Release", spend1 = 100, spend2 = 200, vocation = {4, 8}, file = 'helgana.lua'}
}
function onSay(cid, words)
for spell, info in pairs(customSpell) do
if words == spell.words then
if isInArray(info.vocation, getPlayerVocation(cid)) then
if info.spend1 ~= 0 then
doCreatureAddHealth(cid, -info.spend1)
end
if info.spend2 ~= 0 then
doCreatureAddMana(cid, -info.spend2)
end
if info.file ~= ('') then
dofile(info.file)
else
doPlayerSendTextMessage(cid, 25, "No file specified.")
end
else
doPlayerSendCancel(cid, "You can't use this spell due to your vocation.")
end
end
return true
end