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

The Forgotten Server v0.2 (Mystic Spirit)

Status
Not open for further replies.
Selling

When i'm trying to sell for example 1 dragon scale mail at the shop and i've 2 dragon scale mails on me, then both of them gets sold.
This happens when i use "trade" not when i say sell dragon scale mail.

i'm using SHOPMODULE_MODE = SHOPMODULE_MODE_BOTH
 
There are problems with this version still.
Hopefully they will be all fixed soon.
 
Try this script:
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 shopModule = ShopModule:new()
npcHandler:addModule(shopModule)

shopModule:addBuyableItemContainer({'bp sd'}, 2003, 2268, 6500, 6, 'backpack of sudden death')
shopModule:addBuyableItemContainer({'bp uh'}, 2002, 2273, 3500, 2, 'backpack of ultimate healing')

npcHandler:addModule(FocusModule:new())

[19/08/2008 20:57:39] luaDoTransformItem(). Item not found
[19/08/2008 20:57:50] [Notice - Npc::Npc] NPC Name: Alakazam - autowalk has been deprecated, use walkinterval.

[19/08/2008 20:57:50] Lua Script Error: [Npc interface]
[19/08/2008 20:57:50] data/npc/scripts/ala.lua

[19/08/2008 20:57:50] data/npc/lib/npcsystem/modules.lua:608: attempt to index field 'npcHandler' (a nil value)
[19/08/2008 20:57:50] [Warning - NpcScript::NpcScript] Can not load script: data/npc/scripts/ala.lua

Now im getting these errors?
 
Last edited:
I made a new group id (ID 4) for tutors, but every time a tutor logs in, he is with gm outfit. Is there any way to make tutors log in with their normal outfit?
 
it is me, or i can logout, having the swords?
nevermind, it was my acc type, sorry.
Elox, thx anyway ;]

PS: Another patch plx =) nice server Tala~.
 
Last edited:
hi i dont know much of programing but i cant make npc using the 8.21+ npc system sell more than 1 item at the time i dont know if its a bug of the ot? or my scrip is not working...

my scrip is:

local focuses = {}
local function isFocused(cid)
for i, v in pairs(focuses) do
if(v == cid) then
return true
end
end
return false
end

local function addFocus(cid)
if(not isFocused(cid)) then
table.insert(focuses, cid)
end
end
local function removeFocus(cid)
for i, v in pairs(focuses) do
if(v == cid) then
table.remove(focuses, i)
break
end
end
end
local function lookAtFocus()
for i, v in pairs(focuses) do
if(isPlayer(v) == TRUE) then
doNpcSetCreatureFocus(v)
return
end
end
doNpcSetCreatureFocus(0)
end

local itemWindow = {
{id=8473, subtype=1, buy=310},
{id=8472, subtype=1, buy=190},
{id=7591, subtype=1, buy=190},
{id=7588, subtype=1, buy=100},
{id=7618, subtype=1, buy=40},
{id=7590, subtype=1, buy=120},
{id=7589, subtype=1, buy=80},
{id=7620, subtype=1, buy=50},
{id=7634, subtype=1, sell=5},
{id=7635, subtype=1, sell=5},
{id=7636, subtype=1, sell=5},
{id=2182, subtype=1, buy=500, sell=100},
{id=2186, subtype=1, buy=1000, sell=500},
{id=2185, subtype=1, buy=5000, sell=1000},
{id=8911, subtype=1, buy=8000, sell=1500},
{id=2181, subtype=1, buy=10000, sell=2000},
{id=2183, subtype=1, buy=15000, sell=3000},
{id=8912, subtype=1, buy=18000, sell=3700},
{id=8910, subtype=1, buy=22000, sell=4200},
{id=2190, subtype=1, buy=500, sell=100},
{id=2191, subtype=1, buy=1000, sell=500},
{id=2188, subtype=1, buy=5000, sell=1000},
{id=8921, subtype=1, buy=8000, sell=1500},
{id=2189, subtype=1, buy=10000, sell=2000},
{id=2187, subtype=1, buy=15000, sell=3000},
{id=8920, subtype=1, buy=18000, sell=3700},
{id=8922, subtype=1, buy=22000, sell=4200},
{id=2268, subtype=100, buy=320},
{id=2273, subtype=100, buy=175},
{id=2271, subtype=100, buy=150},
{id=2274, subtype=100, buy=180},
{id=2302, subtype=100, buy=150},
{id=2304, subtype=100, buy=180},
{id=2292, subtype=100, buy=120},
{id=2288, subtype=100, buy=150},
{id=2311, subtype=100, buy=120},
{id=2315, subtype=100, buy=150},
{id=2313, subtype=100, buy=190},
{id=2293, subtype=100, buy=350},
{id=2261, subtype=100, buy=45},
{id=2278, subtype=100, buy=700},
{id=2260, subtype=1, buy=10},
}

local items = {}
for _, item in ipairs(itemWindow) do
items[item.id] = {buyPrice = item.buy, sellPrice = item.sell, subtype = item.subtype}
end

local function getPlayerMoney(cid)
return ((getPlayerItemCount(cid, 2160) * 10000) +
(getPlayerItemCount(cid, 2152) * 100) +
getPlayerItemCount(cid, 2148))
end

local onBuy = function(cid, item, subtype, amount)
if(items[item] == nil) then
selfSay("Ehm.. sorry... this shouldn't be there, I'm not selling it.", cid)
return
end

if(getPlayerMoney(cid) >= amount*items[item].buyPrice) then
local itemz, i = doPlayerAddItem(cid, item, subtype, amount)
if(i < amount) then
if(i == 0) then
selfSay("Sorry, but you don't have space to take it.", cid)
else
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, i*items[item].buyPrice)
end
else
selfSay("Thanks for the money!", cid)
doPlayerRemoveMoney(cid, amount*items[item].buyPrice)
end
else
selfSay("Stfu noob, you don't have money.", cid)
end
end

local onSell = function(cid, item, subtype, amount)
if(items[item] == nil) then
selfSay("Ehm.. sorry... this shouldn't be there, I'm not buying it.", cid)
end

if(subtype < 1) then
subtype = -1
end
if(doPlayerRemoveItem(cid, item, amount, subtype) == TRUE) then
doPlayerAddMoney(cid, items[item].sellPrice*amount)
selfSay("Here you are.", cid)
else
selfSay("No item, no deal.", cid)
end
end

function onCreatureAppear(cid)
end

function onCreatureDisappear(cid)
if(isFocused(cid)) then
selfSay("Hmph!")
removeFocus(cid)
if(isPlayer(cid) == TRUE) then --Be sure he's online
closeShopWindow(cid)
end
end
end

function onCreatureSay(cid, type, msg)
if((msg == "hi") and not (isFocused(cid))) then
selfSay("Welcome, ".. getCreatureName(cid) ..".", cid, TRUE)
selfSay("Do you want to see my {wares}?", cid)
addFocus(cid)
elseif((isFocused(cid)) and (msg == "wares" or msg == "trade")) then
selfSay("Pretty nice, right?", cid)
openShopWindow(cid, itemWindow, onBuy, onSell)
elseif((isFocused(cid)) and (msg == "bye" or msg == "goodbye" or msg == "cya")) then
selfSay("Goodbye!", cid, TRUE)
closeShopWindow(cid)
removeFocus(cid)
end
end

function onPlayerCloseChannel(cid)
if(isFocused(cid)) then
selfSay("Hmph!")
closeShopWindow(cid)
removeFocus(cid)
end
end

function onPlayerEndTrade(cid)
selfSay("It was a pleasure doing business with you.", cid)
end

function onThink()
for i, focus in pairs(focuses) do
if(isCreature(focus) == FALSE) then
removeFocus(focus)
else
local distance = getDistanceTo(focus) or -1
if((distance > 4) or (distance == -1)) then
selfSay("Hmph!")
closeShopWindow(focus)
removeFocus(focus)
end
end
end
lookAtFocus()
end
 
does anyone have a premium npc that works for this? mine dosent seem to answer back to anything after asking if u want premium
 
Is anyone else having problems with level quest doors?

From time to time, with doors that have level requirements on them. (Action Id 1000 + Level) The door wont allow the player to pass.

The player will open the door, and then it will very quickly shut pushing the player back to their position before using the door. Has anyone else experienced this problem?

@Above

Here is my promotion / premium NPC

Code:
<npc name="Kringle" script="data/npc/scripts/firstpromotion.lua" walkinterval="2000*999999" floorchange="0" access="5" level="1" maglevel="1">
	<health now="150" max="150"/>
	<look type="132" head="140" body="64" legs="121" feet="76" addon="2" corpse="2212"/>
	<parameters>
		<parameter key="message_farewell" value="Farewell |PLAYERNAME|!" />
	</parameters>
</npc>

Code:
local focus = 0
local talk_start = 0
local target = 0
local days = 0

function onThingMove(creature, thing, oldpos, oldstackpos)

end


function onCreatureAppear(creature)

end


function onCreatureDisappear(cid, pos)
  	if focus == cid then
          selfSay('Good bye then.')
          focus = 0
          talk_start = 0
  	end
end


function onCreatureTurn(creature)

end


function msgcontains(txt, str)
  	return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end


function onCreatureSay(cid, type, msg)
  	msg = string.lower(msg)

  	if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
 		selfSay('Hello ' .. getPlayerName(cid) .. '! I sell premium and promotions (First promotion).')
 		focus = cid
 		talk_start = os.clock()

	elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
  		selfSay('Sorry, ' .. getPlayerName(cid) .. '! I will talk to you in a minute.')

  	elseif focus == cid then
		talk_start = os.clock()

		if msgcontains(msg, 'first promotion') or msgcontains(msg, 'first promote') then
 			if getPlayerVocation(cid) > 4 then
 				selfSay('Sorry, you are already promoted.')
 				talk_state = 0
 			elseif getPlayerLevel(cid) < 100 then
				selfSay('Sorry, you need level 100 to buy the first promotion.')
				talk_state = 0
			elseif not isPremium(cid) then
				selfSay('Sorry, you must be premium to buy promotion.')
				talk_state = 0
			else
				selfSay('Do you want to buy promotion for 20k?')
				talk_state = 1
			end

		elseif msgcontains(msg, 'premium') or msgcontains(msg, 'premmy') then
			selfSay('Do you want to buy 7 days of premium for 2k?')
			talk_state = 2

		elseif talk_state == 1 then
			if msgcontains(msg, 'yes') then
				if doPlayerRemoveMoney(cid,20000) == TRUE then
					doPlayerSetVocation(cid, getPlayerVocation(cid)+4)
					selfSay('You are now promoted!')
				else
					selfSay('Sorry, you do not have enough money.')
				end
 			end
			talk_state = 0

		elseif talk_state == 2 then
			if msgcontains(msg, 'yes') then
				if doPlayerRemoveMoney(cid,2000) == TRUE then
					doPlayerAddPremiumDays(cid, 7)
					selfSay('You have 7 days of premium more!')
				else
					selfSay('Sorry, you do not have enough money.')
				end
			end
			talk_state = 0

  		elseif msgcontains(msg, 'bye')  and getDistanceToCreature(cid) < 4 then
  			selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
  			focus = 0
  			talk_start = 0
  		end
  	end
end


function onCreatureChangeOutfit(creature)

end


function onThink()
	doNpcSetCreatureFocus(focus)
  	if (os.clock() - talk_start) > 30 then
  		if focus > 0 then
  			selfSay('Next Please...')
  		end
  			focus = 0
  	end
 	if focus ~= 0 then
 		if getDistanceToCreature(focus) > 5 then
 			selfSay('Good bye then.')
 			focus = 0
 		end
 	end
end
 
Last edited:
@ name report

i have the last version of forgotten but still namelock dont work :/

when i log in to a name locked char its only comes up "youre char is namelocked!"

what can i do??
 
Well, does anyone know how to set
Paladin Armor, to increase skill by 2 at skills
while taking it on and off?
 
Please Talaturen, pole the server complete compiled with last patch and folder monsters, if will be able is thankful.

:p
 
i have the last version of forgotten but still namelock dont work :/

when i log in to a name locked char its only comes up "youre char is namelocked!"

what can i do??


use your phpmyadmin and edit the players name or /unban name and deal with the name chosen on your server.


Well, does anyone know how to set
Paladin Armor, to increase skill by 2 at skills
while taking it on and off?


I don't believe this option works with TFS 0.2 yet. But, i hear it's going to work in TFS 0.3. please wait it should be out after a few more weeks.
 
Thank YOu!! , But one questions , How can player's do a account ? , and how can i do a GM ACcount ? , Thank YOu // Raffe
 
Thank YOu!! , But one questions , How can player's do a account ? , and how can i do a GM ACcount ? , Thank YOu // Raffe

it's SLQ in case you didn't already know.

Now, for a GM acct you make Acct type 4 and player group type 2.

CM is acct type 5 group 3
 
Hello, TFS have secruity for edition packiets, because evolution have this bug and players can crashing server and copy items.
 
Something strange.. the winconsole version is closing after a few seconds
edit: I figured out the problem. :)
 
Last edited:
Does this version support 8.22 or not? of not, Where I can find the Tibia821.exe to download? thanks :)
 
Status
Not open for further replies.
Back
Top