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

NPC Testserver Assistant for beta servers

Szafi

www.rookwar.pl
Joined
Mar 2, 2009
Messages
165
Reaction score
10
Location
Poland
Hello, its my first npc in my life. Sorry for language errors, my from poland.

Test on TFS 0.4 and 8.60 Tibia client.

Npc info: http://tibia.wikia.com/wiki/Testserver_Assistant

testserver_assistant.gif

NPC in script:
-Add 10 crystal coins
-Add 254237300 exp (only one)

Install:

/*/data/npc create Testserver Assistant.xml and add

Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Testserver Assistant" script="testserver_assistant.lua" walkinterval="4000" floorchange="0">
    <health now="100" max="100"/>
    <look type="73" />
  <parameters>
        <parameter key="message_greet" value="Hey |PLAYERNAME|. I'm Testserver Assistant and can give {money} and {experience} which will be useful for testing on Exodum server."/>
        <parameter key="message_farewell" value="Good bye!"/>
        <parameter key="message_walkaway" value="Good bye!" />
</parameters>
</npc>

/*/data/npc/scripts create testserver_assistant.lua and add

Code:
--EXODUM OTS
--BY SZAFI (Old Sessam)
--http://tibia.net.pl/members/156613-Old-Sessam
--http://otland.net/members/szafi.32524/
--skype: sessam5

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

--DAWANIE 10 CRYSTAL COINS
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if msgcontains(msg, "money") then
selfSay("Do you want 10 crystal coins?", cid)
talkState[talkUser] = 1
elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then
selfSay("Here you are.", cid)
doPlayerAddItem(cid, 2160, 10)
talkState[talkUser] = 0
if(not npcHandler:isFocused(cid)) then
return false
end

--DAWANIE 254237300 EXPA
elseif msgcontains(msg, "experience") then
selfSay("Do you want experience?", cid)
talkState[talkUser] = 2
elseif msgcontains(msg, "yes") and talkState[talkUser] == 2 and getPlayerStorageValue(cid, 15211) == 1 then
selfSay("Sorry. Experience I can add only one time per character.", cid)
elseif
getPlayerStorageValue(cid, 15211) == -1 then
selfSay("Here you are.", cid)
doPlayerAddExp(cid, 254237300)
doCreatureSetStorage(cid, 15211, 1)
talkState[talkUser] = 0
if(not npcHandler:isFocused(cid)) then
return false
end
end
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

You can edit items and exp here:
config.png
Cyan color - Edit ITEMID (2160 = crystal coins)
Green color - Edit count (example 10 crystal coins)
Red color - Edit exp (254237300 = 250 level)
 
Last edited:
good npc :) i don't know how to rep ++ people
i saw a post for how to reb people but when i go to profile any one
i don't find This ( Star ) That men Rep++
 
Last edited:
config.png
Cyan color - Edit ITEMID (2160 = crystal coins)
Green color - Edit count (example 10 crystal coins)
Red color - Edit exp (254237300 = 250 level)

What program are you using? It looks so clear
 
Mhhhh who can convert this great npc for tfs systems 1.x ??

Thnx for helpp :DD
 
What notepad software are you using to script this? I need a better notepad cuz mines removes line of codes when i reload stuff
 
Back
Top