I'm using Nekiros downgraded 7.72 and when I go to launch all the .xml and .lua scripts for NPCS will not load. These are the errors. Maybe the pathing is incorrect?
These are the scripts.
default.lua
xml of npc
and lua of npc
any help is appreciated. thank you
Lua:
[Warning - NpcScript::NpcScript] Can not load script: data/npc/scripts/default.lua
cannot open data/npc/scripts/data/npc/scripts/default.lua: No such file or directory
[Warning - NpcScript::NpcScript] Can not load script: oracle.lua
cannot open data/npc/scripts/data/npc/scripts/chester.lua: No such file or directory
[Error - Npc::loadFromXml] Failed to load data/npc/Gregor.xml: File was not found
These are the scripts.
default.lua
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
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
function onPlayerEndTrade(cid) npcHandler:onPlayerEndTrade(cid) end
function onPlayerCloseChannel(cid) npcHandler:onPlayerCloseChannel(cid) end
npcHandler:addModule(FocusModule:new())
xml of npc
Code:
<?xml version="1.0"?>
<npc name="A Prisoner" script="data/npc/scripts/A Prisoner.lua" access="3" lookdir="1" walkinterval="2500">
<health now="1" max="1"/>
<look type="130" head="62" body="2" legs="22" feet="76" addons="0"/>
<parameters>
<parameter key="message_greet" value="Huh? What? I can see! Wow! A non-mino. Did they capture you as well?" />
<parameter key="message_farewell" value="Next time we should talk about my surreal numbers." />
</parameters>
</npc>
and lua of npc
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
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
function creatureSayCallback(cid, type, msg)
if(npcHandler.focus ~= cid) then
return false
end
local key = "PD-D-KS-P-PD"
local queststate1 = getPlayerStorageValue(cid,6667)
if msgcontains(msg, 'math') and queststate1 == 1 then
npcHandler:say('My surreal numbers are based on astonishing facts. Are you interested in learning the secret of mathemagics?')
talk_state = 1
elseif msgcontains(msg, 'yes') and talk_state == 1 then
npcHandler:say('But first tell me your favourite colour please!')
talk_state = 2
elseif msgcontains(msg, 'green') and talk_state == 2 then
npcHandler:say('Very interesting. So are you ready to proceed in you lesson in mathemagics?')
doPlayerRemoveMoney(cid,1000)
talk_state = 3
elseif msgcontains(msg, 'yes') and talk_state == 3 then
npcHandler:say('So know that everthing is based on the simple fact that 1 + 1 = 2!')
setPlayerStorageValue(cid,6668,1)
talk_state = 4
elseif msgcontains(msg, 'bye') and (talk_state >= 1 and talk_state <= 4) then
npcHandler:say('Next time we should talk about my surreal numbers.')
talk_state = 0
elseif msgcontains(msg, 'key') then
npcHandler:say('Do you want a key to the mad mage room?')
talk_state = 5
elseif msgcontains(msg, 'yes') and talk_state == 5 then
npcHandler:say('Here you are a special key.')
key = doPlayerAddItem(cid, 2088, 1)
doSetItemActionId(key,3666)
talk_state = 0
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
any help is appreciated. thank you
Last edited: