vakacjus
Lua & C++ Study.
- Joined
- Oct 23, 2008
- Messages
- 255
- Solutions
- 1
- Reaction score
- 26
Hi Otlanders,
I have script oracle and its working fine but TFS 0.3.6 v5 sending me this :
\
I have script oracle and its working fine but TFS 0.3.6 v5 sending me this :
PHP:
[28/06/2012 15:26:16] [Error - Npc interface]
[28/06/2012 15:26:16] data/npc/scripts/ooracle.lua
[28/06/2012 15:26:16] Description:
[28/06/2012 15:26:16] (luaGetCreatureStorage) Creature not found
PHP:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
local sv = 76542
local prof = getPlayerStorageValue(cid, sv)
function creatureSayCallback(cid, type, msg)
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if(not npcHandler:isFocused(cid)) then
return false
elseif msgcontains(msg, "prepared") and getPlayerVocation(cid) == 0 then
npcHandler:say("So what vocation do you wish to become? {elect sorcerer}, {elect druid}, {elect paladin} or {elect knight}?", cid)
setPlayerStorageValue(cid,sv,0)
talkState[talkUser] = 2
elseif msgcontains(msg, "prepared") and getPlayerVocation(cid) ~= 0 then
npcHandler:say("Go Away!!", cid)
talkState[talkUser] = 0
elseif msgcontains(msg, "yes") and getPlayerVocation(cid) == 0 and talkState[talkUser] == 3 and getPlayerStorageValue(cid,sv) > 0 then
local prof = getPlayerStorageValue(cid,sv)
destination = {x=1004, y=370, z=7}
doTeleportThing(cid, destination)
doPlayerSetVocation(cid,prof)
elseif msgcontains(msg, "elect druid") then
npcHandler:say("Are you sure that a druid is what you wish to become? This decision is irreversible! If you are sure say {yes}.", cid)
setPlayerStorageValue(cid,sv,2)
talkState[talkUser] = 3
elseif msgcontains(msg, "elect sorcerer") then
npcHandler:say("So, you wish to be a powerful magician? Are you sure about that? This decision is irreversible! If you are sure say {yes}.", cid)
setPlayerStorageValue(cid,sv,1)
talkState[talkUser] = 3
elseif msgcontains(msg, "elect paladin") then
npcHandler:say("'A ranged marksman. Are you sure? This decision is irreversible! If you are sure say {yes}.", cid)
setPlayerStorageValue(cid,sv,3)
talkState[talkUser] = 3
elseif msgcontains(msg, "elect knight") then
npcHandler:say("A mighty warrior. Is that your final decision? This decision is irreversible! If you are sure say {yes}.", cid)
setPlayerStorageValue(cid,sv,4)
talkState[talkUser] = 3
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())