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

Solved TFS 1.0 talkaction !spells help

me

New Member
Joined
Aug 25, 2014
Messages
40
Reaction score
2
I cant seem to get the !spells to work. I have little exp in scripts, any help is greatly appreciated
The Forgotten Server - Version 1.0
Compilied on Sep 1 2014 11:28:15 for arch x64
A server developed by Mark Samman
Visit our forum for updates, support, and resources: http://otland.net/.
>> Loading config
>> Establishing database connection... MySQL 5.5.38
>> Running database manager
>> Loading vocations
>> Loading items
>> Loading script systems
>> Loading monsters
>> Loading outfits
>> Checking world type... PVP
>> Loading map
> Map size: 33760x33023.
> Map loading time: 51.513 seconds.
> Loaded house items in: 0.021 s
>> Initializing gamestate
>> Loaded 721 npcs, spawned 46411 monsters.
>> Loaded all modules, server starting up...
>> Forgotten Server Online!
Druidcakes has logged in.
Lua Script Error: [TalkAction Interface]
data/talkactions/scripts/spellbook.lua:eek:nSay
data/talkactions/scripts/spellbook.lua:27: attempt to call global 'doShowTextDialog' (a nil value)
stack traceback:
[C]: in function 'doShowTextDialog'
data/talkactions/scripts/spellbook.lua:27: in function <data/talkactions/scripts/spellbook.lua:1>
<?xml version="1.0" encoding="UTF-8"?>
<talkactions>
<!-- commands -->
<talkaction words="/ban" separator=" " script="ban.lua" />
<talkaction words="/ipban" separator=" " script="ipban.lua" />
<talkaction words="/unban" separator=" " script="unban.lua" />
<talkaction words="/up" script="up.lua" />
<talkaction words="/down" script="down.lua" />
<talkaction words="/c" separator=" " script="teleport_creature_here.lua" />
<talkaction words="/goto" separator=" " script="teleport_to_creature.lua" />
<talkaction words="/owner" separator=" " script="owner.lua" />
<talkaction words="/t" script="teleport_home.lua" />
<talkaction words="/town" separator=" " script="teleport_to_town.lua" />
<talkaction words="/a" separator=" " script="teleport_ntiles.lua" />
<talkaction words="/pos" separator=" " script="position.lua" />
<talkaction words="/info" separator=" " script="info.lua" />
<talkaction words="/r" separator=" " script="removething.lua" />
<talkaction words="/kick" separator=" " script="kick.lua" />
<talkaction words="/openserver" script="openserver.lua" />
<talkaction words="/closeserver" separator=" " script="closeserver.lua" />
<talkaction words="/B" separator=" " script="broadcast.lua" />
<talkaction words="/m" separator=" " script="place_monster.lua" />
<talkaction words="/i" separator=" " script="create_item.lua" />
<talkaction words="/s" separator=" " script="place_npc.lua" />
<talkaction words="/addtutor" separator=" " script="add_tutor.lua" />
<talkaction words="/removetutor" separator=" " script="remove_tutor.lua" />
<talkaction words="/looktype" separator=" " script="looktype.lua" />
<talkaction words="/summon" separator=" " script="place_summon.lua" />
<talkaction words="/chameleon" separator=" " script="chameleon.lua" />
<talkaction words="/addskill" separator=" " script="add_skill.lua" />
<talkaction words="/mccheck" script="mccheck.lua" />
<talkaction words="/ghost" script="ghost.lua" />
<talkaction words="/clean" script="clean.lua" />
<talkaction words="/hide" script="hide.lua" />
<!-- player talkactions -->
<talkaction words="!buypremium" script="buyprem.lua"/>
<talkaction words="!buyhouse" script="buyhouse.lua"/>
<talkaction words="!leavehouse" script="leavehouse.lua"/>
<talkaction words="!changesex" script="changesex.lua"/>
<talkaction words="!uptime" script="uptime.lua"/>
<talkaction words="!deathlist" script="deathlist.lua"/>
<talkaction words="!kills" script="kills.lua"/>
<talkaction words="!online" script="online.lua"/>
<talkaction words="!serverinfo" script="serverinfo.lua"/>
<talkaction words="!spells" script="spellbook.lua" />
<!-- test talkactions -->
<talkaction words="!z" separator=" " script="magiceffect.lua"/>
<talkaction words="!x" separator=" " script="animationeffect.lua"/>
</talkactions>
function onSay(cid, words, param)
local count = getPlayerInstantSpellCount(cid)
local text = ""
local t = {}
for i = 0, count - 1 do
local spell = getPlayerInstantSpellInfo(cid, i)
if spell.level ~= 0 then
if spell.manapercent > 0 then
spell.mana = spell.manapercent .. "%"
end
table.insert(t, spell)
end
end
table.sort(t, function(a, b) return a.level < b.level end)
local prevLevel = -1
for i, spell in ipairs(t) do
local line = ""
if prevLevel ~= spell.level then
if i ~= 1 then
line = "\n"
end
line = line .. "Spells for Level " .. spell.level .. "\n"
prevLevel = spell.level
end
text = text .. line .. " " .. spell.words .. " - " .. spell.name .. " : " .. spell.mana .. "\n"
end
doShowTextDialog(cid, 2175, text)
return TRUE
end
 
In the folder data there is a file called compat.lua.
You can add that function there and if there are more functions missing add them aswell or replace the whole compat.lua with the latest one I linked.
 
In the folder data there is a file called compat.lua.
You can add that function there and if there are more functions missing add them aswell or replace the whole compat.lua with the latest one I linked.
Oh i was looking at the wrong file, I had complied it and was searching the pre complie file to change, oopsiy.
Your fix fixs the problem it now displays the spell book,
thank you for the fix, and telling to me,
apologies for my mistake still new:)
 
Back
Top Bottom