• 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.4] The Forgotten Server v0.3 beta 2

Status
Not open for further replies.
in config i have
Code:
	-- Rates
	-- NOTE: experienceStages configuration is located in data/XML/stages.xml.
	rateExp = 1
	rateSkill = 50
	rateLoot = 5
	rateMagic = 10
	rateSpawn = 2
	extraPartyExpLimit = 20
	extraPartyExpPercent = 5
	experienceStages = "yes"

and

in stages.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<stages>
	<stage minlevel="1" maxlevel="9" multiplier="10"/>
	<stage minlevel="10" maxlevel="100" multiplier="15"/>
	<stage minlevel="101" maxlevel="200" multiplier="20"/>
	<stage minlevel="201" maxlevel="300" multiplier="25"/>
	<stage minlevel="301" multiplier="30"/>
</stages>

i dont think windows has anything to do with it.

Go to data/config.lua

In rateExp write stages... like this...

Code:
rateExp = stages
 
Beta 3 - 17th January 2009, 20:00 CET

19 days to next realase, cant wait for it :)
 
When premmy go to free, not lose the promotion!! Why?

How make to premmy accounts lose promotion when finish the premmy ??

In mysql promotion continues 1....

ty
 
Why this happen?

I've a Testserver Asistant in my server, when i say "hi" this happen:

Code:
[29/12/2008 12:05:21] Lua Script Error: [Npc interface] 
[29/12/2008 12:05:21] data/npc/scripts/test_server.lua:onCreatureSay

[29/12/2008 12:05:21] data/npc/scripts/test_server.lua:39: attempt to compare nil with number
[29/12/2008 12:05:21] stack traceback:
[29/12/2008 12:05:21] 	data/npc/scripts/test_server.lua:39: in function <data/npc/scripts/test_server.lua:36>

:S
 
is a simple script =D

Code:
local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false

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 ' .. getCreatureName(cid) .. '! I can help you with some {money}.', cid)
  		focus = cid
  		talk_start = os.clock()

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

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

		if msgcontains(msg, 'money') or msgcontains(msg, 'gold') then
			doPlayerAddItem(cid,2160,10)
			selfSay('Here you are', cid)
				talk_state = 0

			elseif msgcontains(msg, 'no') and getDistanceToCreature(cid) < 4 then
				selfSay('Ok, then not.', cid)
				talk_state = 0

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

function onCreatureChangeOutfit(creature)

end


function onThink()
  	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) > 4 then
 			selfSay('Good bye then.', cid)
 			focus = 0
 		end
 	end
end

Help please!! >.<
 
Lol, so simple and outdated, I'll update it to new NPC system right now.

Here: (tested, working on TFS 0.2.22, should work on 0.3 too.)
PHP:
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

function gold(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end
	
            npcHandler:say('Here you are.', cid)
			doPlayerAddItem(cid,2160,10)
			npcHandler:resetNpc()
    end


local node1 = keywordHandler:addKeyword({'gold'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want 10 crystal coins?'})
    node1:addChildKeyword({'yes'}, gold, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then not.', reset = true})
	
	local node2 = keywordHandler:addKeyword({'money'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want 10 crystal coins?'})
    node2:addChildKeyword({'yes'}, gold, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then not.', reset = true})

npcHandler:addModule(FocusModule:new())
 
Last edited:
@Cykotitan

I've the same problem with this npc (works in v0.2 but not in v0.3)

Code:
local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false

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 ' .. getCreatureName(cid) .. '!, I can give you the first Demon Hunter Addon.', cid)
  		focus = cid
  		talk_start = os.clock()

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

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

	if msgcontains(msg, 'help') then
			selfSay('I can give you the first Demon Hunter Addon', cid)


	elseif msgcontains(msg, 'addon') then
                 if getPlayerStorageValue(cid,35417) == 2 then
					selfSay('You already have the first Demon Hunter addon.', cid)
					talk_state = 0
		else
				selfSay('Do you have done The Inquisition Quest?.', cid)
					talk_state = 1
	end
	elseif msgcontains(msg, 'yes') and talk_state == 1 then
                 if getPlayerStorageValue(cid,35417) == -1 then
		  			selfSay('Sorry, i can not give you the present.', cid)
					talk_state = 0
                 elseif getPlayerStorageValue(cid,35417) == 2 then  
					selfSay('You already have the first Demon Hunter addon.', cid)
					talk_state = 0
		else
			selfSay('Congratulations, here is your reward.', cid)
			if getPlayerSex(cid) == 0 then
		    doPlayerAddOutfit(cid, 288, 1)
			doPlayerAddOutfit(cid, 289, 1)
		    setPlayerStorageValue(cid,35417,2)
			else
			doPlayerAddOutfit(cid, 289, 1)
		    doPlayerAddOutfit(cid, 288, 1)
			setPlayerStorageValue(cid,35417,2)
			end
        end	
  	

        elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
            selfSay('Good Bye ' .. getCreatureName(cid) .. '', 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
        talk_start = 0
    end
    if focus ~= 0 then
        if getDistanceToCreature(focus) > 5 then
            selfSay('Good Bye', cid)
            focus = 0
            talk_start = 0
        end
    end
end
 
I'm so bored waiting for this update, so bored I actualy have to play real tibia! How sad and f'd up is that =/
 
When premmy go to free, not lose the promotion!! Why?

How make to premmy accounts lose promotion when finish the premmy ??

In mysql promotion continues 1....

help me pls...

premmyfor promotion is seted yes, and only premium buy promotion... But when the loose your premium, they continues promotion, and can enter in doors for premium....
 
Status
Not open for further replies.
Back
Top