gr33nd3v1l
You see a Green Devil.
Here i am again with my npc errors and mistakes...
I don't know whats the problem now because i have added a million ends where the server requested and it still wants me to 'end' the function
This is the console:
This is my npc script;
I don't know whats the problem now because i have added a million ends where the server requested and it still wants me to 'end' the function
This is the console:
Code:
[18/02/2008 10:31:48] The Forgotten Server - Version 0.2rc9 (Mystic Spirit).
[18/02/2008 10:31:48] A server developed by Talaturen, Kiper, Kornholijo, Jonern, Lithium & slawkens.
[18/02/2008 10:31:48] Visit our forum for updates, support and resources: http://otland.net/.
[18/02/2008 10:31:48] >> Loading config
[18/02/2008 10:31:48] >> Loading RSA key
[18/02/2008 10:31:48] >> Testing SQL connection... MySQL.
[18/02/2008 10:31:48] >> Loading bans
[18/02/2008 10:31:48] >> Loading vocations
[18/02/2008 10:31:48] >> Loading commands
[18/02/2008 10:31:48] >> Loading items
[18/02/2008 10:31:48] >> Loading script systems
[18/02/2008 10:31:49] >> Loading monsters
[18/02/2008 10:31:49] >> Loading quests
[18/02/2008 10:31:49] >> Loading outfits
[18/02/2008 10:31:49] >> Loading admin protocol config
[18/02/2008 10:31:49] >> Loading experience stages
[18/02/2008 10:31:49] >> Checking world type... PVP
[18/02/2008 10:31:49] >> Loading map
[18/02/2008 10:31:50] > Map size: 1061x1049.
[18/02/2008 10:31:55] > Map loading time: 5.265 seconds.
[18/02/2008 10:31:55] Warning: [NpcScript::NpcScript] Can not load script. data/npc/scripts/boat.lua
[18/02/2008 10:31:55] data/npc/scripts/boat.lua:33: 'end' expected (to close 'function' at line 18) near 'elseif'
[18/02/2008 10:31:55] Warning: [NpcScript::NpcScript] Can not load script. data/npc/scripts/boat.lua
[18/02/2008 10:31:55] data/npc/scripts/boat.lua:33: 'end' expected (to close 'function' at line 18) near 'elseif'
[18/02/2008 10:31:55] Warning: [NpcScript::NpcScript] Can not load script. data/npc/scripts/boat.lua
[18/02/2008 10:31:55] data/npc/scripts/boat.lua:33: 'end' expected (to close 'function' at line 18) near 'elseif'
[18/02/2008 10:31:55] Warning: [NpcScript::NpcScript] Can not load script. data/npc/scripts/boat.lua
[18/02/2008 10:31:55] data/npc/scripts/boat.lua:33: 'end' expected (to close 'function' at line 18) near 'elseif'
[18/02/2008 10:32:04] >> Loading raids
[18/02/2008 10:32:04] >> All modules has been loaded, server starting up...
[18/02/2008 10:32:06] >> Genesis Server Online!
This is my npc script;
Code:
Anselth_pos = {x= 507, y= 857, z= 6}
Revansith_pos = {x= 820, y= 686, z= 6}
Karnak_pos = {x= 593, y= 700, z= 6}
Snowmoore_pos = {x= 951, y= 616, z= 6}
Island_pos = {x= 593, y= 700, z= 6}
Darthmoore_pos = {x= 918, y= 950, z= 6}
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- OTServ event handling functions start
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
-- OTServ event handling functions end
function creatureSayCallback(cid, type, msg)
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
if(npcHandler.focus ~= cid) then
return false
end
addon_need_premium = 'Sorry, you need a premium account to get addons.'
addon_have_already = 'Sorry, you already have this addon.'
addon_have_not_items = 'Sorry, you don\'t have these items.'
addon_give = 'Here you are.'
player_gold = getPlayerItemCount(cid,2148)
player_plat = getPlayerItemCount(cid,2152)*100
player_crys = getPlayerItemCount(cid,2160)*10000
player_money = player_gold + player_plat + player_crys
------------------------------------------------ destination ------------------------------------------------
elseif msgcontains(msg, 'anselth') then
if isPremium(cid) then
if player_money >= 1500 then
selfSay('Do you want to go to Anselth for 1500 gold pieces?')
talk_state = 1
else
selfSay('You don't seem to have enough money to pay for the trip.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 1 then
talk_state = 0
if player_money >= 1500 then
if doPlayerRemoveMoney(cid,1500) == 1 then
doTeleportThing(cid, Anselth_pos)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ destination ------------------------------------------------
elseif msgcontains(msg, 'revansith') then
if isPremium(cid) then
if player_money >= 1400 then
selfSay('Do you want to go to Castle Revansith for 1400 gold pieces?')
talk_state = 2
else
selfSay('You don't seem to have enough money to pay for the trip.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 2 then
talk_state = 0
if player_money >= 1400 then
if doPlayerRemoveMoney(cid,1400) == 1 then
doTeleportThing(cid, Revansith_pos)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ destination ------------------------------------------------
elseif msgcontains(msg, 'karnak') then
if isPremium(cid) then
if player_money >= 1400 then
selfSay('Do you want to go to Fort Karnak for 1400 gold pieces?')
talk_state = 3
else
selfSay('You don't seem to have enough money to pay for the trip.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 3 then
talk_state = 0
if player_money >= 1400 then
if doPlayerRemoveMoney(cid,1400) == 1 then
doTeleportThing(cid, Karnak_pos)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ destination ------------------------------------------------
elseif msgcontains(msg, 'snowmoore') then
if isPremium(cid) then
if player_money >= 1000 then
selfSay('Do you want to go to Snowmoore for 1000 gold pieces?')
talk_state = 4
else
selfSay('You don't seem to have enough money to pay for the trip.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 4 then
talk_state = 0
if player_money >= 1000 then
if doPlayerRemoveMoney(cid,1000) == 1 then
doTeleportThing(cid, Snowmoore_pos)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ destination ------------------------------------------------
elseif msgcontains(msg, 'island') then
if isPremium(cid) then
if player_money >= 1400 then
selfSay('Do you want to go to Fort Island for 1400 gold pieces?')
talk_state = 5
else
selfSay('You don't seem to have enough money to pay for the trip.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 5 then
talk_state = 0
if player_money >= 1400 then
if doPlayerRemoveMoney(cid,1400) == 1 then
doTeleportThing(cid, Island_pos)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ destination ------------------------------------------------
elseif msgcontains(msg, 'darthmoore') then
if isPremium(cid) then
if player_money >= 0 then
selfSay('Are you serious? You want me to take you to Darthmoore?')
talk_state = 6
else
selfSay('You are completely broke my man.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 6 then
talk_state = 0
if player_money >= 0 then
selfSay('This IS Darthmoore you fool!')
else
selfSay(addon_have_not_items)
end
------------------------------------------------ confirm negative ------------------------------------------------
elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 38) then
selfSay('Ok then.')
talk_state = 0
end
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())