NoobKing
that ot guy
- Joined
- Feb 21, 2009
- Messages
- 33
- Reaction score
- 0
i need to know which server runs these type of scripts
- - - Updated - - -
its a npc script from a npc pack i downloaded and i wanna try to run a server which allows this type of script
or where i can get a 9.60 rl tibia npc pack
LUA:
_delay = 1000
_topic = 0
_index = 0
_count = 0
_price = 0
_type = 0
_stack = false
_sub = -1
function getNext() nextPlayer = getQueuedPlayer() if (nextPlayer ~= nil) then if (getDistanceToCreature(nextPlayer) <= 3) then updateNpcIdle() setNpcFocus(nextPlayer) greet(nextPlayer) return else getNext() end end setNpcFocus(0) resetNpcIdle() end
function _selfSay(message) selfSay(message, _delay) updateNpcIdle() end
local function greet(cid)
_selfSay("Hello, hello, " .. getCreatureName(cid) .. "! Please come in, look, and buy!")
end
function onCreatureDisappear(cid)
if (getNpcFocus() == cid) then
_selfSay("Bye, bye.")
getNext()
else
unqueuePlayer(cid)
end
end
function onCreatureMove(cid, oldPos, newPos) if (getNpcFocus() == cid) then faceCreature(cid) end end
function onCreatureSay(cid, type, msg)
local messages =
{
{"how are you", "I am fine. I'm so glad to have you here as my customer."},
{"sell", "I sell much. Just read the blackboards for my awesome wares or just ask me."},
{"job", "I am a merchant. What can I do for you?"},
{"name", "My name is Al Dee, but you can call me Al. Do you want to buy something?"},
{"time", "It is about %T. I am so sorry, I have no watches to sell. Do you want to buy something else?"},
{"help", "I sell stuff to prices that low, that all other merchants would mock at my stupidity."},
{"monster", "If you want to challenge the monsters, you need some weapons and armor I sell. You need them definitely!"},
{"dungeon", "If you want to explore the dungeons, you have to equip yourself with the vital stuff I am selling. It's vital in the deepest sense of the word."},
{"sewer", "Oh, our sewer system is very primitive; so primitive it's overrun by rats. But the stuff I sell is save from them. Do you want to buy some of it?"},
{"king", "The king encouraged salesmen to travel here, but only I dared to take the risk, and a risk it was!"},
{"dallheim", "Some call him a hero."},
{"bug", "Bugs plague this isle, but my wares are bugfree, totally bugfree."},
{"stuff", "I sell equipment of all kinds, all kind available on this isle. Just ask me about my wares if you are interested."},
{"tibia", "One day I will return to the continent as a rich, a very rich man!"},
{"thais", "Thais is a crowded town."},
{"wares|offer", "I sell weapons, shields, armor, helmets, and equipment. For what do you want to ask?"},
{"weapon", "I sell spears, rapiers, sabres, daggers, hand axes, axes, and short swords. Just tell me what you want to buy."},
{"armor", "I sell jackets, coats, doublets, leather armor, and leather legs. Just tell me what you want to buy."},
{"helmet", "I sell leather helmets, studded helmets, and chain helmets. Just tell me what you want to buy."},
{"shield", "I sell wooden shields and studded shields. Just tell me what you want to buy."},
{"equipment", "I sell torches, bags, scrolls, shovels, picks, backpacks, sickles, scythes, ropes, fishing rods and sixpacks of worms. Just tell me what you want to buy."},
{"do you sell|do you have", "What do you need? I sell weapons, armor, helmets, shields, and equipment."}
}
local shop =
{
{"spear", 2389, true, 3, 10, -1, "a", "s", "Do you want to sell this garbage? I give you %P gold, ok?"},
{"rapier", 2384, false, 5, 15, -1, "a", "s"},
{"sabre", 2385, false, 12, 25, -1, "a", "s"},
{"dagger", 2379, false, 2, 5, -1, "a", "s", "Do you want to sell this garbage? I give you %P gold, ok?"},
{"sickle", 2405, false, -1, 8, -1, "a", "s"},
{"hand axe", 2380, false, 4, 8, -1, "a", "s"},
{"axe", 2386, false, 7, 20, -1, "an", "s"},
{"short sword", 2406, false, 10, 30, -1, "a", "s"},
{"jacket", 2650, false, -1, 10, -1, "a", "s"},
{"coat", 2651, false, -1, 8, -1, "a", "s"},
{"doublet", 2485, false, 3, 16, -1, "a", "s"},
{"leather armor", 2467, false, 5, 25, -1, "a", "s"},
{"leather legs", 2649, false, -1, 10, -1, "a", "s"},
{"leather helmet", 2461, false, 3, 12, -1, "a", "s"},
{"studded helmet", 2482, false, 20, 63, -1, "a", "s"},
{"chain helmet", 2458, false, 12, 52, -1, "a", "s"},
{"wooden shield", 2512, false, 3, 15, -1, "a", "s"},
{"studded shield", 2526, false, 16, 50, -1, "a", "s"},
{"torch", 2050, false, -1, 2, -1, "a", "s"},
{"bag", 1987, false, -1, 4, -1, "a", "s"},
{"scroll", 1949, false, -1, 5, -1, "a", "s"},
{"shovel", 2554, false, -1, 10, -1, "a", "s"},
{"backpack", 1988, false, -1, 10, -1, "a", "s"},
{"scythe", 2550, false, -1, 12, -1, "a", "s"},
{"rope", 2120, false, 8, 50, -1, "a", "s"},
{"fishing|rod", 2580, false, -1, 150, -1, "a", "s"},
{"hatchet", 2388, false, 25, -1, -1, "a", "s"},
{"mace", 2398, false, 30, -1, -1, "a", "s"},
{"brass armor", 2465, false, 150, -1, -1, "a", "s"},
{"chain armor", 2464, false, 40, -1, -1, "a", "s"},
{"brass shield", 2511, false, 25, -1, -1, "a", "s"},
{"plate shield", 2510, false, 40, -1, -1, "a", "s"},
{"copper shield", 2530, false, 50, -1, -1, "a", "s"},
{"leather boots", 2643, false, 2, -1, -1, "a", "s"}
}
if (getNpcFocus() == 0) then
if ((isMsg("hi|hello", msg) and getDistanceToCreature(cid) <= 3)) then
updateNpcIdle()
setNpcFocus(cid)
greet(cid)
end
elseif (getNpcFocus() ~= cid) then
if ((isMsg("hi|hello", msg) and getDistanceToCreature(cid) <= 3)) then
_selfSay("I'll be with you in a moment, " .. getCreatureName(cid) .. ".")
queuePlayer(cid)
end
else
if (isMsg("bye|farewell", msg)) then
_selfSay("Bye, bye.")
getNext()
return false
end
if msgcontains(msg, "sell") and msgcontains(msg, "club") then
_selfSay("I don't buy this garbage!")
end
if not msgcontains(msg, "buy") and not msgcontains(msg, "sell") then
for i, a in ipairs(messages) do
if isMsg(a[1], msg) then
_selfSay(a[2])
return true
end
end
end
if msgcontains(msg, "worm") then
_selfSay("I sell worms only in sixpacks for 5 gold each, how many sixpacks of worms do you want to buy?")
_topic = 5
return true
end
if getCount(msg) > 0 and _topic == 5 then
pcount = getCount(msg)
_type = 3976
if pcount == nil or pcount < 1 then pcount = 1 end
_count = 6*pcount
_stack = true
_sub = -1
_price = 5*pcount
_topic = 1
_selfSay("So you want to buy some of my sixpacks with altogether " .. 6*pcount .." worms for " ..5*pcount.. " gold?")
return true
end
if msgcontains(msg, "pick") then
_selfSay("Picks are hard to come by. I trade them only for high quality small axes. Do you want to trade?.")
_topic = 4
return true
end
if msgcontains(msg, "yes") and _topic == 4 then
if getPlayerItemCount(cid, 2559) >= 1 then
if doPlayerRemoveItem(cid, 2559, 1) >= 1 then
_selfSay("Splendid! Here take your pickaxe.")
doPlayerAddItem(cid, 2553, 1)
_topic = 0
return true
end
else
_selfSay("Sorry, I am looking for a SMALL axe.")
_topic = 0
return true
end
elseif _topic == 4 then
_selfSay("Well, then not.")
_topic = 0
return true
end
for i, a in ipairs(shop) do
if msgcontains(msg, a[1]) and not msgcontains(msg, "sell") and a[5] > 0 then
if getCount(msg) > 1 then
_count = getCount(msg)
_type = a[2]
_price = a[5] * _count
_stack = a[3]
_sub = a[6]
txt = "Do you want to buy " .. _count .. " " .. a[1] .. a[8] .. " for " .. _price .. " gold?"
elseif getCount(msg) == nil or getCount(msg) < 2 then
_count = 1
_type = a[2]
_price = a[5]
_stack = a[3]
_sub = a[6]
txt = "Do you want to buy " .. a[7] .. " " .. a[1] .. " for " .. a[5] .. " gold?"
end
_index = i
_topic = 1
_selfSay(txt)
return true
elseif msgcontains(msg, a[1]) and msgcontains(msg, "sell") and a[4] > 0 then
if getCount(msg) > 1 then
_count = getCount(msg)
_type = a[2]
_price = a[4] * _count
_stack = a[3]
_sub = a[6]
if a[9] == nil or a[9] == "" then
txt = "Do you want to sell " .. _count .. " " .. a[1] .. a[8] .." for " .. _count * a[4] .. " gold?"
else
txt = string.gsub(a[9], "%%P", _price)
end
elseif getCount(msg) == nil or getCount(msg) < 2 then
_count = 1
_type = a[2]
_price = a[4]
_stack = a[3]
_sub = a[6]
if a[9] == nil or a[9] == "" then
txt = "Do you want to sell " .. a[7] .. " " .. a[1] .. " for " .. a[4] .. " gold?"
else
txt = string.gsub(a[9], "%%P", _price)
end
end
_index = i
_topic = 2
_selfSay(txt)
return true
end
end--end loop
if _topic == 1 or _topic == 2 then
if _topic == 1 and msgcontains(msg, "yes") then
if doPlayerRemoveMoney(cid, _price) == 1 then
if _stack then
doPlayerAddItem(cid, _type, _count)
else
for i = 1, _count do
doPlayerAddItem(cid, _type, 1)
end
end
_selfSay("Thank you. Here it is.")
_topic = 0
return true
else
_selfSay("Sorry, you do not have enough gold.")
_topic = 0
return false
end
elseif _topic == 2 and msgcontains(msg, "yes") then
if getPlayerItemCount(cid, _type) >= _count then
if doPlayerRemoveItem(cid, _type, _count) == 1 then
doPlayerAddMoney(cid, _price)
_selfSay("Ok. Here is your money.")
_topic = 0
end
return false
elseif (_count == 1 and getPlayerItemCount(cid, _type) < 1) then
_selfSay("Sorry, you do not have one.")
_topic = 0
return false
else
_selfSay("Sorry, you do not have so many.")
_topic = 0
return false
end
elseif _topic == 1 then
_selfSay("Maybe you will buy it another time.")
_topic = 0
elseif _topic == 2 then
_selfSay("Maybe next time.")
_topic = 0
elseif _topic == 3 then
_selfSay("Well, then not.")
_topic = 0
end
end
end
end
function onThink()
if (getNpcFocus() ~= 0) then
if (isNpcIdle() or getDistanceToCreature(getNpcFocus()) > 3) then
_selfSay("Bye, bye.")
getNext()
end
- - - Updated - - -
its a npc script from a npc pack i downloaded and i wanna try to run a server which allows this type of script
or where i can get a 9.60 rl tibia npc pack
Last edited by a moderator: