What's new

0.3.6 roxor

Status
Not open for further replies.

manko123

User
Joined
Oct 30, 2010
Messages
36
Reaction score
0
otoz mam taki blad w silniku i nie moge sobie z nim poradzi probowalem juz przelozyc folder lib z czystego tfa ale nic nie daje


[01/11/2010 22:27:13] [Error - Npc interface]
[01/11/2010 22:27:13] data/npc/scripts/loot.lua
[01/11/2010 22:27:13] Description:
[01/11/2010 22:27:13] data/lib/050-function.lua:222: attempt to index a boolean value
[01/11/2010 22:27:13] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/loot.lua

[01/11/2010 22:27:13] [Warning] NpcSystem:
[01/11/2010 22:27:13] Parameter(s) missing for item:
[01/11/2010 22:27:13] throwing knife2410
[01/11/2010 22:27:13] 25
 

imdrox

Senior User
Joined
May 5, 2008
Messages
518
Reaction score
24
Odp: 0.3.6 roxor

No Wiec Tak
1 problem tkwi w skrypcie loot.lua (podmien z innego tfs) powinno pomoc
 

Arts18

Signed...
Joined
May 7, 2009
Messages
2,888
Reaction score
231
Age
33
Odp: 0.3.6 roxor

Podaj ca?y schemat tego skrypta lua.

Pozdrawiam.
 

manko123

User
Joined
Oct 30, 2010
Messages
36
Reaction score
0
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
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
keywordHandler:addKeyword({'helmets'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy royal (40k), warrior (6k), crusader (9k), crown (5k), devil (4k), chain (35gp) and iron helmets (30gp), also mystic turbans (500gp).'})
keywordHandler:addKeyword({'boots'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden boots (100k), steel boots (40k) and boots of haste (40k).'})
keywordHandler:addKeyword({'armors'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden (30k), crown (20k), knight (5k), lady (7,5k), plate (400gp), brass (200gp) and chain armors (100gp), also mpa (100k), dsm (60k) and blue robes (15k).'})
keywordHandler:addKeyword({'legs'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden (80k), crown (15k), knight (6k), plate (500gp) and brass legs (100gp).'})
keywordHandler:addKeyword({'shields'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy blessed (150k), great (100k), demon (40k), vampire (25k), medusa (8k), amazon (4k), crown (5k), tower (4k), dragon (3k), guardian (2k), beholder (1k), and dwarven shields (100gp), also mms (80k).'})
keywordHandler:addKeyword({'swords'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy giant (10k), bright (6k), fire (3k) serpent (1.5k), spike (800gp) and two handed swords (400gp), also ice rapiers (4k), magic longswords (150k), magic swords (90k), warlord swords (100k) broad swords (70gp), short swords (30gp), sabres (25gp) and swords (25gp).'})
keywordHandler:addKeyword({'axes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy fire (10k), guardian halberds (7,5k) knight (2k), double (200gp) and battle axes (100gp), also dragon lances (10k), stonecutters axes (90k), halberds (200gp) and hatchets (20gp).'})
keywordHandler:addKeyword({'clubs'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy thunder hammers (90k), war (6k), dragon (2k) and battle hammers (60gp), also skull staffs (10k) and clerical maces (200gp).'})
npcHandler:addModule(FocusModule:new())
refresh

Notka moderatorska:
Po??czone.
 
Last edited by a moderator:

imdrox

Senior User
Joined
May 5, 2008
Messages
518
Reaction score
24
Odp: 0.3.6 roxor

Spr?buj Mojego Skryptu na loot.lua
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

-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
keywordHandler:addKeyword({'helmets'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy royal (40k), warrior (6k), crusader (9k), crown (5k), devil (4k), chain (35gp) and iron helmets (30gp), also mystic turbans (500gp).'})
keywordHandler:addKeyword({'boots'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden boots (100k), steel boots (40k) and boots of haste (40k).'})
keywordHandler:addKeyword({'armors'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden (30k), crown (20k), knight (5k), lady (7,5k), plate (400gp), brass (200gp) and chain armors (100gp), also mpa (100k), dsm (60k) and blue robes (15k).'})
keywordHandler:addKeyword({'legs'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden (80k), crown (15k), knight (6k), plate (500gp) and brass legs (100gp).'})
keywordHandler:addKeyword({'shields'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy blessed (150k), great (100k), demon (40k), vampire (25k), medusa (8k), amazon (4k), crown (5k), tower (4k), dragon (3k), guardian (2k), beholder (1k), and dwarven shields (100gp), also mms (80k).'})
keywordHandler:addKeyword({'swords'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy giant (10k), bright (6k), fire (3k) serpent (1.5k), spike (800gp) and two handed swords (400gp), also ice rapiers (4k), magic longswords (150k), magic swords (90k), warlord swords (100k) broad swords (70gp), short swords (30gp), sabres (25gp) and swords (25gp).'})
keywordHandler:addKeyword({'axes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy fire (10k), guardian halberds (7,5k) knight (2k), double (200gp) and battle axes (100gp), also dragon lances (10k), stonecutters axes (90k), halberds (200gp) and hatchets (20gp).'})
keywordHandler:addKeyword({'clubs'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy thunder hammers (90k), war (6k), dragon (2k) and battle hammers (60gp), also skull staffs (10k) and clerical maces (200gp).'})

npcHandler:addModule(FocusModule:new())
 

manko123

User
Joined
Oct 30, 2010
Messages
36
Reaction score
0
Odp: 0.3.6 roxor

[03/11/2010 13:20:47] [Error - Npc interface]
[03/11/2010 13:20:47] data/npc/scripts/loot.lua
[03/11/2010 13:20:47] Description:
[03/11/2010 13:20:47] data/lib/050-function.lua:222: attempt to index a boolean value
[03/11/2010 13:20:47] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/loot.lua

[03/11/2010 13:20:47] [Warning] NpcSystem:
[03/11/2010 13:20:47] Parameter(s) missing for item:
[03/11/2010 13:20:47] throwing knife2410
[03/11/2010 13:20:47] 25



to samo ;/

mam takze 2 npc sprzedajacego loot i jest takze ten sam blad POMOCY :<<
 

imdrox

Senior User
Joined
May 5, 2008
Messages
518
Reaction score
24
Odp: 0.3.6 roxor

PHP:
-- Advanced NPC System (Created by Jiddo),
-- Modified by Talaturen.

if(NpcSystem == nil) then
	-- Loads the underlying classes of the npcsystem.
	dofile(getDataDir() .. 'npc/lib/npcsystem/keywordhandler.lua')
	dofile(getDataDir() .. 'npc/lib/npcsystem/queue.lua')
	dofile(getDataDir() .. 'npc/lib/npcsystem/npchandler.lua')
	dofile(getDataDir() .. 'npc/lib/npcsystem/modules.lua')

	-- Global npc constants:

	-- Keyword nestling behavior. For more information look at the top of keywordhandler.lua
	KEYWORD_BEHAVIOR = BEHAVIOR_NORMAL_EXTENDED

	-- Greeting and unGreeting keywords. For more information look at the top of modules.lua
	FOCUS_GREETWORDS = {'hi', 'hello', 'hey'}
	FOCUS_FAREWELLWORDS = {'bye', 'farewell', 'cya'}

	-- The word for requesting trade window. For more information look at the top of modules.lua
	SHOP_TRADEREQUEST = {'offer', 'trade'}

	-- The word for accepting/declining an offer. CAN ONLY CONTAIN ONE FIELD! For more information look at the top of modules.lua
	SHOP_YESWORD = {'yes'}
	SHOP_NOWORD = {'no'}

	-- Pattern used to get the amount of an item a player wants to buy/sell.
	PATTERN_COUNT = '%d+'

	-- Talkdelay behavior. For more information, look at the top of npchandler.lua.
	NPCHANDLER_TALKDELAY = TALKDELAY_ONTHINK

	-- Conversation behavior. For more information, look at the top of npchandler.lua.
	NPCHANDLER_CONVBEHAVIOR = CONVERSATION_PRIVATE

	-- Constant strings defining the keywords to replace in the default messages.
	--	For more information, look at the top of npchandler.lua...
	TAG_PLAYERNAME = '|PLAYERNAME|'
	TAG_ITEMCOUNT = '|ITEMCOUNT|'
	TAG_TOTALCOST = '|TOTALCOST|'
	TAG_ITEMNAME = '|ITEMNAME|'
	TAG_QUEUESIZE = '|QUEUESIZE|'

	NpcSystem = {}

	-- Gets an npcparameter with the specified key. Returns nil if no such parameter is found.
	function NpcSystem.getParameter(key)
		local ret = getNpcParameter(tostring(key))
		if((type(ret) == 'number' and ret == 0) or ret == nil) then
			return nil
		else
			return ret
		end
	end

	-- Parses all known parameters for the npc. Also parses parseable modules.
	function NpcSystem.parseParameters(npcHandler)
		local ret = NpcSystem.getParameter('idletime')
		if(ret ~= nil) then
			npcHandler.idleTime = tonumber(ret)
		end
		local ret = NpcSystem.getParameter('talkradius')
		if(ret ~= nil) then
			npcHandler.talkRadius = tonumber(ret)
		end
		local ret = NpcSystem.getParameter('message_greet')
		if(ret ~= nil) then
			npcHandler:setMessage(MESSAGE_GREET, ret)
		end
		local ret = NpcSystem.getParameter('message_farewell')
		if(ret ~= nil) then
			npcHandler:setMessage(MESSAGE_FAREWELL, ret)
		end
		local ret = NpcSystem.getParameter('message_decline')
		if(ret ~= nil) then
			npcHandler:setMessage(MESSAGE_DECLINE, ret)
		end
		local ret = NpcSystem.getParameter('message_needmorespace')
		if(ret ~= nil) then
			npcHandler:setMessage(MESSAGE_NEEDMORESPACE, ret)
		end
		local ret = NpcSystem.getParameter('message_needspace')
		if(ret ~= nil) then
			npcHandler:setMessage(MESSAGE_NEEDSPACE, ret)
		end
		local ret = NpcSystem.getParameter('message_sendtrade')
		if(ret ~= nil) then
			npcHandler:setMessage(MESSAGE_SENDTRADE, ret)
		end
		local ret = NpcSystem.getParameter('message_noshop')
		if(ret ~= nil) then
			npcHandler:setMessage(MESSAGE_NOSHOP, ret)
		end
		local ret = NpcSystem.getParameter('message_oncloseshop')
		if(ret ~= nil) then
			npcHandler:setMessage(MESSAGE_ONCLOSESHOP, ret)
		end
		local ret = NpcSystem.getParameter('message_onbuy')
		if(ret ~= nil) then
			npcHandler:setMessage(MESSAGE_ONBUY, ret)
		end
		local ret = NpcSystem.getParameter('message_onsell')
		if(ret ~= nil) then
			npcHandler:setMessage(MESSAGE_ONSELL, ret)
		end
		local ret = NpcSystem.getParameter('message_missingmoney')
		if(ret ~= nil) then
			npcHandler:setMessage(MESSAGE_MISSINGMONEY, ret)
		end
		local ret = NpcSystem.getParameter('message_needmoney')
		if(ret ~= nil) then
			npcHandler:setMessage(MESSAGE_NEEDMONEY, ret)
		end
		local ret = NpcSystem.getParameter('message_missingitem')
		if(ret ~= nil) then
			npcHandler:setMessage(MESSAGE_MISSINGITEM, ret)
		end
		local ret = NpcSystem.getParameter('message_needitem')
		if(ret ~= nil) then
			npcHandler:setMessage(MESSAGE_NEEDITEM, ret)
		end
		local ret = NpcSystem.getParameter('message_idletimeout')
		if(ret ~= nil) then
			npcHandler:setMessage(MESSAGE_IDLETIMEOUT, ret)
		end
		local ret = NpcSystem.getParameter('message_walkaway')
		if(ret ~= nil) then
			npcHandler:setMessage(MESSAGE_WALKAWAY, ret)
		end
		local ret = NpcSystem.getParameter('message_alreadyfocused')
		if(ret ~= nil) then
			npcHandler:setMessage(MESSAGE_ALREADYFOCUSED, ret)
		end
		local ret = NpcSystem.getParameter('message_placedinqueue')
		if(ret ~= nil) then
			npcHandler:setMessage(MESSAGE_PLACEDINQUEUE, ret)
		end
		local ret = NpcSystem.getParameter('message_buy')
		if(ret ~= nil) then
			npcHandler:setMessage(MESSAGE_BUY, ret)
		end
		local ret = NpcSystem.getParameter('message_sell')
		if(ret ~= nil) then
			npcHandler:setMessage(MESSAGE_SELL, ret)
		end
		local ret = NpcSystem.getParameter('message_bought')
		if(ret ~= nil) then
			npcHandler:setMessage(MESSAGE_BOUGHT, ret)
		end
		local ret = NpcSystem.getParameter('message_sold')
		if(ret ~= nil) then
			npcHandler:setMessage(MESSAGE_SOLD, ret)
		end

		-- Parse modules.
		for parameter, module in pairs(Modules.parseableModules) do
			local ret = NpcSystem.getParameter(parameter)
			if(ret ~= nil) then
				local number = tonumber(ret)
				if(number ~= 0 and module.parseParameters ~= nil) then
					local instance = module:new()
					npcHandler:addModule(instance)
					instance:parseParameters()
				end
			end
		end
	end
end

Spr?buj To da? w folder lib>npc system
 

manko123

User
Joined
Oct 30, 2010
Messages
36
Reaction score
0
Odp: 0.3.6 roxor

kk dzieki :> zaraz oblukam
teraz mam taki problem

gdy otwieram skrzynke questowa , item zamiast ladowac w plecaku jest w skrzynce i go widac i mozna wziasc :<< help

i jeszcze jeden problem , po dedzie gdy sie loguje pisze ze wrong temple position ;/ i gdy sprawdzam w bazie temple zmienia sie na 0 0 0 ;///
 
Last edited:

Find3R

Active User
Joined
Nov 2, 2010
Messages
52
Reaction score
1
Odp: 0.3.6 roxor

i jeszcze jeden problem , po dedzie gdy sie loguje pisze ze wrong temple position ;/ i gdy sprawdzam w bazie temple zmienia sie na 0 0 0 ;///
1)Sprawd?:http://tibia.net.pl/pomoc-z-ot/288557-rozwiazanie-temple-position-wrong.html
2)
pomoc1.png

pomoc2w.png




gdy otwieram skrzynke questowa , item zamiast ladowac w plecaku jest w skrzynce i go widac i mozna wziasc :<< help
W skrzynce gdzie wpisa?e? ID?
W ActionID , czy UniqeID?
 
Last edited:

manko123

User
Joined
Oct 30, 2010
Messages
36
Reaction score
0
Odp: 0.3.6 roxor

nic nie ruszalem , questy byly od poczatku RoXoR 8.54 legendary

dobrze jest wpisane , drzwi takze nie dzialaly ale naprawilem je brakowalo w nich jednej linijki i mysle ze tu bedzie tak samo ;/
 

Find3R

Active User
Joined
Nov 2, 2010
Messages
52
Reaction score
1
Odp: 0.3.6 roxor

Je?eli posiadasz map edytor to odpal map? znajd? ten quest i tak jak na obrazku zobacz czy tam gdzie ja mam crystal coins ty nie masz jakiego? itemu jak jest usu?.
23roo05.png
 

manko123

User
Joined
Oct 30, 2010
Messages
36
Reaction score
0
Odp: 0.3.6 roxor

jesli jest mam usunac i poprostu dodac jego id do action id?

tego itemu
 

Find3R

Active User
Joined
Nov 2, 2010
Messages
52
Reaction score
1
Odp: 0.3.6 roxor

Nie ,
Je?eli znajduj? si? tam item , to usuwasz go remove item , czy jako? tak z tych czarnych kwadrat?w.
2) w Unique ID - wpisujesz np. 2626
po czym w data/action/script robisz plik o nazwie dowolnej i wklejasz do niego:
function onUse(cid, item, frompos, item2, topos)
if item.uid == xxxx then
queststatus = getPlayerStorageValue(cid,ccc)
if queststatus == -1 then
doPlayerSendTextMessage(cid,22,"You have found Items")
doPlayerAddItem(cid,zzz,1)
setPlayerStorageValue(cid,ccc,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
else
return false
end
return true
end
xxxx-ID jakie wpisa?e? w Uniqe id skrzyni.
ccc-Wpisujesz takie samo w dw?ch ccc np. 353
zzz-Id itema
Potem w data/actions.xml dodajesz linijk?:
<action uniqueid="2626" event="script" value="theend/quests/nazwaitema.lua" />
 
Status
Not open for further replies.
Top