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

[8.70] OTServ (0.6.3) r.6052

you can find it in forums lol every npc will work you just have to change path to script in .xml script because it's diffrent in OTServ than in TFS.

Yes that's also the one thing that OTServ doesn't have and I'm not sure when this will be implemented since some developers doesn't agree to implement this example : Remere.
But you can add that easily by yourself.

its just come up bugs when i put in a npc from 0.3 server? :O
 
yea what bugs?
post the errors I'm not an mentalist ^^
hah, i think you were a mentalist :d, its says:
( npc soya )
warning: [npcscript: :npcscript] can not load script. data/npc/script/data/npc/scripts/loot.lua
cannot open data/npc/scripts/data/npc/scripts/loot.lua

here is the script: XML
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Soya" script="data/npc/scripts/loot.lua" walkinterval="2000" floorchange="0">
<health now="150" max="150"/>
<look type="139" head="132" body="79" legs="97" feet="132" corpse="2212"/>
<parameters>
<parameter key="module_shop" value="1"/>
<parameter key="message_greet" value="Hello |PLAYERNAME|. I buy swords, clubs, axes, helmets, boots, legs, shields and armors."/>
<parameter key="shop_sellable" value="royal helmet,2498,40000;warrior helmet,2475,6000;crusader helmet,2497,9000;crown helmet,2491,5000;devil helmet,2462,4000;mystic turban,2663,500;chain helmet,2458,35;iron helmet,2459,30;steel boots,2645,400000;boots of haste,2195,40000;golden boots,2646,100000;magic plate armor,2472,100000;dragon scale mail,2492,60000;demon armor,2494,90000;golden armor,2466,30000;crown armor,2487,20000;knight armor,2476,5000;blue robe,2656,15000;lady armor,2500,2500;plate armor,2463,400;brass armor,2465,200;chain armor,2464,100;golden legs,2470,80000;crown legs,2488,15000;knight legs,2477,6000;plate legs,2647,500;brass legs,2487,100;mastermind shield,2514,80000;demon shield,2520,40000;blessed shield,2523,150000;great shield,2522,100000;vampire shield,2534,25000;medusa shield,2536,8000;amazon shield,2537,4000;crown shield,2519,5000;tower shield,2528,4000;guardian shield,2515,200;beholder shield,2518,1500;dwarven shield,2525,100;magic longsword,2390,150000;warlord sword,2408,100000;magic sword,2400,90000;giant sword,2393,10000;bright sword,2407,6000;ice rapier,2396,4000;fire sword,2392,3000;serpent sword,2409,1500;spike sword,2383,800;two handed sword,2377,400;broad sword,2413,70;short sword,2406,30;sword,2376,25;dragon lance,2414,10000;stonecutter axe,2431,90000;guardian halberd,2427,7500;fire axe,2432,10000;knight axe,2430,2000;double axe,2387,200;halberd,2381,200;battle axe,2378,100;hatchet,2388,20;war hammer,2391,6000;thunder hammer,2421,90000;skull staff,2436,1000;dragon hammer,2434,2000;clerical mace,2423,200;battle hammer,2417,60;mace,2398,30;"/>
</parameters>
</npc>

and lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid) npcHandler:eek:nCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:eek:nCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:eek:nCreatureSay(cid, type, msg) end
function onThink() npcHandler:eek:nThink() end

-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
keywordHandler:addKeyword({'helmets'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy royal (40k), warrior (6k), crusader (9k), crown (5k), devil (4k), chain (35gp) and iron helmets (30gp), also mystic turbans (500gp).'})
keywordHandler:addKeyword({'boots'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden boots (100k), steel boots (40k) and boots of haste (40k).'})
keywordHandler:addKeyword({'armors'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden (30k), crown (20k), knight (5k), lady (7,5k), plate (400gp), brass (200gp) and chain armors (100gp), also mpa (100k), dsm (60k) and blue robes (15k).'})
keywordHandler:addKeyword({'legs'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden (80k), crown (15k), knight (6k), plate (500gp) and brass legs (100gp).'})
keywordHandler:addKeyword({'shields'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy blessed (150k), great (100k), demon (40k), vampire (25k), medusa (8k), amazon (4k), crown (5k), tower (4k), dragon (3k), guardian (2k), beholder (1k), and dwarven shields (100gp), also mms (80k).'})
keywordHandler:addKeyword({'swords'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy giant (10k), bright (6k), fire (3k) serpent (1.5k), spike (800gp) and two handed swords (400gp), also ice rapiers (4k), magic longswords (150k), magic swords (90k), warlord swords (100k) broad swords (70gp), short swords (30gp), sabres (25gp) and swords (25gp).'})
keywordHandler:addKeyword({'axes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy fire (10k), guardian halberds (7,5k) knight (2k), double (200gp) and battle axes (100gp), also dragon lances (10k), stonecutters axes (90k), halberds (200gp) and hatchets (20gp).'})
keywordHandler:addKeyword({'clubs'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy thunder hammers (90k), war (6k), dragon (2k) and battle hammers (60gp), also skull staffs (10k) and clerical maces (200gp).'})

npcHandler:addModule(FocusModule:new())

And here is ur npc systems: ( merchant_glut )
<?xml version="1.0"?>
<npc name="Merchant Glut" floorchange="0" walkinterval="4000" speed="220">
<health now="150" max="150"/>
<look type="100" head="0" body="0" legs="0" feet="0"/>

<interaction range="3" idletimeout="30" defaultpublic="0">
<!--This will include the bankman interaction, in this way several npc can use the same interaction-->
<include file="merchant.xml"/>

<interact keywords="hi" focus="1">
<!--These are the alternative keywords-->
<keywords>hello</keywords>

<response text="Hello. How may I help you |NAME|?"/>
</interact>

<interact keywords="bye" focus="0">
<!--These are the alternative keywords-->
<keywords>farewell</keywords>

<response text="It was a pleasure to help you."/>
</interact>

<!--
<interact event="onBusy">
<response text="One moment please, |NAME|.">
<action name="addqueue" value="|PLAYER|"/>
</response>
</interact>
-->

<interact event="onPlayerLeave" focus="0">
<response text="It was a pleasure to help you |NAME|."/>
</interact>

<interact keywords="name">
<response text="My name is |NPCNAME|."/>
</interact>

<interact keywords="job">
<response text="I am a merchant, my job is to serve you!"/>
</interact>

<interact keywords="wares">
<list>runes</list>
<list>tapestry</list>
<list>food</list>
<list>vials</list>
<list>backpack</list>
<response>
<action name="script">
<![CDATA[
openShopWindow(cid, itemlist, -1, -1)
]]>
</action>
</response>
</interact>

<interact event="onPlayerShopSell">
<response>
<action name="price" value="|SELLPRICE|"/>
<action name="script">
<![CDATA[
if(doPlayerRemoveItem(cid, _state.itemid, _state.amount, _state.subtype) == TRUE) then
doPlayerAddMoney(cid, _state.price * _state.amount)
selfSay("Here you are.", cid)
else
selfSay("Sorry, you do not have one.", cid)
end
]]>
</action>
</response>
</interact>

<interact event="onPlayerShopBuy">
<response>
<action name="price" value="|BUYPRICE|"/>
<action name="script">
<![CDATA[
if(getPlayerMoney(cid) >= _state.amount * _state.price) then
--doSellItem(cid, itemid, amount, <optional> subtype, <optional> actionid, <optional: default: 1> canDropOnMap)
local sellAmount = doSellItem(cid, _state.itemid, _state.amount, _state.subtype, 0, 0)

if(sellAmount ~= _state.amount) then
if(sellAmount == 0) then
selfSay("Sorry, but you don't have room to take it.", cid)
return
elseif(sellAmount > 0) then
selfSay("I've sold some for you, but it seems you can't carry more than this. I won't take more money than necessary.", cid)
doPlayerRemoveMoney(cid, sellAmount * _state.price)
return
end
end

selfSay("Here you are.", cid)
doPlayerRemoveMoney(cid, _state.price * _state.amount)
else
selfSay("Sorry, you do not have enough gold.", cid)
end
]]>
</action>
</response>
</interact>

<interact event="onPlayerShopClose">
<response text="It was a pleasure to help you."/>
</interact>

<interact keywords="sell;|AMOUNT|;|LIST|">
<!-- See merchant.xml to add more items/lists-->
<list>runes</list>
<list>tapestry</list>
<list>food</list>
<list>vials</list>
<list>backpack</list>

<response>
<action name="amount" value="|AMOUNT|"/>
<action name="price" value="|SELLPRICE|"/>

<action name="script">
<![CDATA[
if(_state.amount > 1) then
selfSay("Do you want to sell " .. _state.amount .. " " .. _state.listpname .. " for " .. _state.price * _state.amount .. " gold?", cid)
else
selfSay("Do you want to sell " .. _state.listname .. " for " .. _state.price .. " gold?", cid)
end
]]>
</action>

<interact keywords="yes">
<response param="noamount" text="Sorry, you do not have one."/>
<response param="lowamount" text="Sorry, you do not have that many."/>
<response text="Ok. Here is your money.">
<action name="sell" value="|PRICE|"/>
</response>
</interact>

</response>
</interact>

<interact keywords="buy;|AMOUNT|;|LIST|">
<!-- See merchant.xml to add more items/lists-->
<list>runes</list>
<list>tapestry</list>
<list>food</list>
<list>vials</list>
<list>backpack</list>

<response>
<action name="amount" value="|AMOUNT|"/>
<action name="price" value="|BUYPRICE|"/>

<action name="script">
<![CDATA[
if(_state.price == 0) then
selfSay("Sorry, I do not sell that.", cid)
return
end

if(_state.amount > 1) then
selfSay("Do you want to buy " .. _state.amount .. " " .. _state.listpname .. " for " .. _state.price * _state.amount .. " gold?", cid)
else
selfSay("Do you want to buy " .. _state.listname .. " for " .. _state.price .. " gold?", cid)
end
]]>
</action>

<interact keywords="yes">
<response param="lowmoney" text="Sorry, you do not have enough gold."/>
<response text="Thank you. Here it is.">
<action name="buy" value="|PRICE|"/>
</response>
</interact>

</response>
</interact>
</interaction>

</npc>

and, (merchant)
<?xml version="1.0"?>

<interaction>
<!--armor list-->
<itemlist listid="armor">
<item keywords="brass;armor" id="2465" sellprice="200" buyprice="200"/>
<item keywords="golden;armor" id="2466" sellprice="200" buyprice="200"/>
<item keywords="leather;armor" id="2467" sellprice="10" buyprice="100"/>
<item keywords="magic;plate;armor" id="2472" sellprice="50000" buyprice="100"/>
</itemlist>

<itemlist listid="helmet">
<item keywords="crown" id="2128" sellprice="100000" buyprice="1000"/>
<item keywords="steel;helmet" id="2457" sellprice="165" buyprice="1000"/>
<item keywords="demon;helmet" id="2493" sellprice="1000" buyprice="200"/>
<item keywords="horned;helmet" id="2496" sellprice="10" buyprice="300"/>
<item keywords="mystic;turban" id="2663" sellprice="200" buyprice="5000"/>
</itemlist>

<!--food list-->
<itemlist listid="food">
<item keywords="meat" id="2666" sellprice="8" buyprice="2"/>
<item keywords="ham" id="2671" sellprice="10" buyprice="2"/>
<item keywords="dragon;ham" id="2672" sellprice="20" buyprice="5"/>
</itemlist>

<!--tapestry list-->
<itemlist listid="tapestry">
<item keywords="purple;tapestry" id="1857" sellprice="40" buyprice="10"/>
<item keywords="green;tapestry" id="1860" sellprice="40" buyprice="10"/>
<item keywords="yellow;tapestry" id="1863" sellprice="40" buyprice="10"/>
<item keywords="orange;tapestry" id="1866" sellprice="40" buyprice="10"/>
<item keywords="red;tapestry" id="1869" sellprice="40" buyprice="10"/>
</itemlist>

<!--vial list-->
<itemlist listid="vials">
<!--If no name tag is used the default name from items.xml is used.-->
<!--With fluid containers it would be "vial", so we override that description here-->
<item keywords="vial;water" id="2006" subtype="1" sellprice="100" name="a vial of water" pname="vials of water"/>
<item keywords="vial;blood" id="2006" subtype="2" sellprice="100" name="a vial of blood" pname="vials of blood"/>
<item keywords="vial;beer" id="2006" subtype="3" sellprice="100" name="a vial of beer" pname="vials of beer"/>
<item keywords="vial;slime" id="2006" subtype="4" sellprice="100" name="a vial of slime" pname="vials of slime"/>
<item keywords="vial;lemonade" id="2006" subtype="5" sellprice="100" name="a vial of lemonade" pname="vials of lemonade"/>
</itemlist>

<!--backpack list-->
<itemlist listid="backpack">
<!--If no name tag is used the default name from items.xml is used.-->
<!--With backpacks it would be just "backpack" regardless of color, so we override that description here-->
<item keywords="brown;backpack" id="1988" sellprice="20" buyprice="40" name="a brown backpack" pname="brown backpacks"/>
<item keywords="green;backpack" id="1998" sellprice="20" buyprice="40" name="a green backpack" pname="green backpacks"/>
<item keywords="red;backpack" id="2000" sellprice="20" buyprice="40" name="a red backpack" pname="red backpacks"/>
<item keywords="purple;backpack" id="2001" sellprice="20" buyprice="40" name="a purple backpack" pname="purple backpacks"/>
<item keywords="blue;backpack" id="2002" sellprice="20" buyprice="40" name="a blue backpack" pname="blue backpacks"/>
<item keywords="yellow;backpack" id="2004" sellprice="20" buyprice="40" name="a yellow backpack" pname="green backpacks"/>
</itemlist>

<!-- Rune list -->
<itemlist listid="runes">
<!--If no name tag is used the default name from items.xml is used.-->
<!--With runes it would be "rune spell", so we override that description here-->
<item keywords="sudden;death" id="2268" subtype="100" sellprice="600" buyprice="600" name="a sudden death rune" pname="sudden death runes"/>
<item keywords="heavy;magic;missile" id="2311" sellprice="400" buyprice="400" name="a heavy magic missile" pname="heavy magic missiles"/>
<item keywords="ultimate;healing;rune" id="2273" sellprice="400" buyprice="400" name="an ultimate healing rune" pname="ultimate healing runes"/>
</itemlist>

</interaction>

I dont get it, rep+ for help ;)
 
Firstly the npcs in /npcs of otserv are very highly outdated you shouldn't use them.
Secondly read the freaking error:
cannot open data/npc/scripts/data/npc/scripts/loot.lua
instead of
data/npc/scripts/loot.lua
should be
loot.lua
 
Firstly the npcs in /npcs of otserv are very highly outdated you shouldn't use them.
Secondly read the freaking error:
cannot open data/npc/scripts/data/npc/scripts/loot.lua
instead of
data/npc/scripts/loot.lua
should be
loot.lua

i dont see any problem in data/npc/scripts/loot.lua, there is loot.lua
 
One thing more, its says:
Lua script error: [npc interface]
<unknown scriptfile>
luascriptinterface::popboolean<>. error: expected boolean type parameter.
, when i sell items to the npc
 
there is an bless system here, because idont find some working talkactions..
 
One thing more, its says: , when i sell items to the npc
well you are missing return somewhere if you want to turn these errors off
when i try to run it says Error: Database Connection Failed! i tried to import to xampp but i get an error
You are doing something wrong.
there is an bless system here, because idont find some working talkactions..
Yes there is look functions.lua for proper functions .
 
Does gesior and modern not work for this? because im just getting endless errors..
 
wich one AAC should i use for this, does 0.2 or 0.3 gesior work for this ot?
 
wich one AAC should i use for this, does 0.2 or 0.3 gesior work for this ot?

@Dramix Nicaw ACC works great with this OT, except for one error when accessing guilds.owner_id. Easily fixable though




I can't seem to get promotion NPC to work with this server. Ive tried soo many things, even using Libs from other servers such as TFS. With default provided Libs, NPC just doesn't do anything but say hi back, no error in console.
Other Libs from places such as TFS, it returns errors with functions used
"npchandler.lua:558: attempt to call global 'getDistanceTo'
 
wgl to da sie to komplikować ?
yes.
Does gesior and modern not work for this? because im just getting endless errors..
They are not supporting it by default you have to make some changes to make it work on otserv database but you can easy use TFS db and then add things which otserv db needs.
wich one AAC should i use for this, does 0.2 or 0.3 gesior work for this ot?
As up
@Dramix Nicaw ACC works great with this OT, except for one error when accessing guilds.owner_id. Easily fixable though




I can't seem to get promotion NPC to work with this server. Ive tried soo many things, even using Libs from other servers such as TFS. With default provided Libs, NPC just doesn't do anything but say hi back, no error in console.
Other Libs from places such as TFS, it returns errors with functions used
"npchandler.lua:558: attempt to call global 'getDistanceTo'
try that:
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

local node1 = keywordHandler:addKeyword({'promot'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can promote you for 20000 gold coins. Do you want me to promote you?'})
	node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 20000, level = 20, promotion = 1, premium = false, text = 'Congratulations! You are now promoted.'})
	node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})
--[[
local node2 = keywordHandler:addKeyword({'epic'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can epicize you for 200000 gold coins. Do you want me to epicize you?'})
	node2:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 200000, level = 120, promotion = 2, text = 'Congratulations! You are now epicized.'})
	node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})
]]--

npcHandler:addModule(FocusModule:new())
 
yes.

They are not supporting it by default you have to make some changes to make it work on otserv database but you can easy use TFS db and then add things which otserv db needs.

Ok thanks, but could you possibly help me out on that one? I am forced to use tfs right now, because I lack the knowledge of making changes to the database
 
@Pietia
Well I feel dumb:S I swear I tried that script with provided libs. I guess I did not. Works, thank you!
 
can you link a working aac for this?, i have tried thousands.. but noone work -.-?, rep++ for helping me.
 
@Dramix
Nicawwwwwwwww, only requires 1 minor modification. I can send you the working version if you'd like.
 
If anyone would like to write (simple copy paste spells from TFS 0.2.10 (they have already made it but they have diffrent format)) spells.xml to OTServ 8.70 please private message me.
I mean spells.xml entries:
icon="62" exhaustion="30000" groupicons="1" groupexhaustions="4000"
 
Back
Top