Heatblade12
Member
- Joined
- Aug 12, 2013
- Messages
- 24
- Reaction score
- 6
Well, i got my server up, i placed the NPCs found in the folder, but there where no weapon/armor traders, no tanner to make money from, ect.
i tried making a custom NPC based on Tom the tanner, just changed the name because i needed to reload it in a map editor blah blah blah
Code's below.
what i would really like is if there was NPC's that i just paste into the npc folder in the TFS 1.2 Server that work the basics in the game. ie: Tanner to make money for players, and Weapon and armor smiths to buy gear with the cash.
the problem i met with the NPC below, is that i cant sell any items to him. tried both wold corpse and rabbit corpse. the npc just wont take them.
what can i do to improve myself here?
XML
LUA
Note: im new the forums, my goal is the make a server i can host and just play singleplayer on it with no one else. otherwise i would just go play on the actual servers. a Vanilla map with all the npcs, monsters, ect, with no premium restrictions is the dream, but for now, im just using the TFS 1.2 Server since its the first one i tried.
Edit: Code credit to QuaS. pulled from https://otland.net/threads/rookgard-npcs-100-real-will-be-updated.50750/
i tried making a custom NPC based on Tom the tanner, just changed the name because i needed to reload it in a map editor blah blah blah
Code's below.
what i would really like is if there was NPC's that i just paste into the npc folder in the TFS 1.2 Server that work the basics in the game. ie: Tanner to make money for players, and Weapon and armor smiths to buy gear with the cash.
the problem i met with the NPC below, is that i cant sell any items to him. tried both wold corpse and rabbit corpse. the npc just wont take them.
what can i do to improve myself here?
XML
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Harld" script="Harld.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="144" head="113" body="115" legs="58" feet="115" addons="1"/>
<parameters>
<parameter key="message_greet" value="Hey there, |PLAYERNAME|. I'm Harld the tanner. If you have fresh corpses, leather or paws, trade with me."/>
<parameter key="message_farewell" value="Good bye."/>
<parameter key="message_walkaway" value="D'oh?"/>
<parameter key="message_idletimeout" value="D'oh?"/>
<parameter key="message_sendtrade" value="Sure, check what I buy."/>
<parameter key="module_shop" value="1"/>
<parameter key="shop_buyable" value="" />
<parameter key="shop_sellable" value="bear paw,5896,50;dead rabbit,2992,25;dead rat,2813,25;dead wolf,2826,50;minotaur leather,5878,100;wolf paw,5897,15" />
</parameters>
</npc>
LUA
Code:
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
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if msgcontains(msg,'oracle') then
selfSay('It\'s in the academy, just above {Seymour}. Go there once you are level 8 to leave this place.', cid)
elseif msgcontains(msg,'seymour') then
selfSay('He sticks his nose too much in books.', cid)
elseif msgcontains(msg,'cipfried') then
selfSay('I\'m not what you\'d call a \'believer\'.', cid)
elseif msgcontains(msg,'Harld') then
selfSay('Yep.', cid)
elseif msgcontains(msg,'tanner') then
selfSay('That\'s my job. It can be dirty at times but it provides enough income for my living.', cid)
elseif msgcontains(msg,'corpses') then
selfSay('I\'m buying fresh {corpses} of rats, rabbits and wolves. I don\'t buy half-decayed ones. If you have any for sale, {trade} with me.', cid)
elseif msgcontains(msg,'monster') then
selfSay('Good monsters to start with are rats. They live in the {sewers} under the village of {Rookgaard}.', cid)
elseif msgcontains(msg,'sewers') then
selfSay('The nearest sewer entrance is just to the right of this building.', cid)
elseif msgcontains(msg,'corpse') then
selfSay('I\'m buying fresh {corpses} of rats, rabbits and wolves. I don\'t buy half-decayed ones. If you have any for sale, {trade} with me.', cid)
elseif msgcontains(msg,'sewer') then
selfSay('The nearest sewer entrance is just to the right of this building.', cid)
elseif msgcontains(msg,'troll') then
selfSay('Troll leather stinks. Can\'t use it.', cid)
elseif msgcontains(msg,'orc') then
selfSay('I don\'t buy orcs. Their skin is too scratchy.', cid)
elseif msgcontains(msg,'dallheim') then
selfSay('He\'s okay.', cid)
elseif msgcontains(msg,'Amber') then
selfSay('Now that\'s an interesting woman.', cid)
elseif msgcontains(msg,'rookgaard') then
selfSay('This island has its own problems, but all in all it\'s a decent place to live.', cid)
elseif msgcontains(msg,'main') then
selfSay('You can go there once you are level 8 and have talked to the {oracle}.', cid)
elseif msgcontains(msg,'mainland') then
selfSay('You can go there once you are level 8 and have talked to the {oracle}.', cid)
elseif msgcontains(msg,'obi') then
selfSay('He is such a hypocrite.', cid)
elseif msgcontains(msg,'dixi') then
selfSay('She buys my fine leather clothes.', cid)
elseif msgcontains(msg,'lily') then
selfSay('She always comes and preaches about how one should not wear animal skin.', cid)
elseif msgcontains(msg,'al dee') then
selfSay('He\'s an apple polisher.', cid)
elseif msgcontains(msg,'wares') then
selfSay('I\'m buying fresh {corpses} of rats, rabbits and wolves. I don\'t buy half-decayed ones. If you have any for sale, {trade} with me.', cid)
elseif msgcontains(msg,'job') then
selfSay('I\'m the local {tanner}. I buy fresh animal {corpses}, tan them, and convert them into fine leather clothes which I then sell to {merchants}.', cid)
elseif msgcontains(msg,'merchant') then
selfSay('{Dixi} and {Lee\'Delle} sell my leather clothes in their shops.', cid)
elseif msgcontains(msg,'merchants') then
selfSay('{Dixi} and {Lee\'Delle} sell my leather clothes in their shops.', cid)
elseif msgcontains(msg,'lee\'delle') then
selfSay('Her nose is a little high in the air, I think. She never shakes my hand.', cid)
elseif msgcontains(msg,'weapon') then
selfSay('Nope, sorry, don\'t sell that. Ask {Obi} or {Lee\'Delle}.', cid)
elseif msgcontains(msg,'shields') then
selfSay('Nope, sorry, don\'t sell that. Ask {Dixi} or {Lee\'Delle}.', cid)
elseif msgcontains(msg,'willie') then
selfSay('I kinda like him. At least he says what he thinks.', cid)
elseif msgcontains(msg,'billy') then
selfSay('He\'s a better cook than his cousin {Willie}, actually.', cid)
elseif msgcontains(msg,'trade') then
selfSay('Sure, check what I buy.', cid)
elseif msgcontains(msg,'norma') then
selfSay('I like her beer.', cid)
elseif msgcontains(msg,'human') then
selfSay('Are you crazy?!', cid)
npcHandler:releaseFocus(cid)
end
return TRUE
end
function thinkCallback()
talk = math.random(1,200)
if talk == 1 then
doCreatureSay(getNpcCid(), "Oh yeah, I'm also interested in wolf paws and bear paws.", TALKTYPE_YELL)
elseif talk == 2 then
doCreatureSay(getNpcCid(), "Also buying minotaur leather.", TALKTYPE_YELL)
elseif talk == 3 then
doCreatureSay(getNpcCid(), "Buying fresh corpses of rats, rabbits and wolves.", TALKTYPE_YELL)
end
return TRUE
end
npcHandler:setCallback(CALLBACK_ONTHINK, thinkCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Note: im new the forums, my goal is the make a server i can host and just play singleplayer on it with no one else. otherwise i would just go play on the actual servers. a Vanilla map with all the npcs, monsters, ect, with no premium restrictions is the dream, but for now, im just using the TFS 1.2 Server since its the first one i tried.
Edit: Code credit to QuaS. pulled from https://otland.net/threads/rookgard-npcs-100-real-will-be-updated.50750/