What's new

[TFS] Pomocy The Oracle

Status
Not open for further replies.
Joined
Aug 26, 2008
Messages
23
Reaction score
0
Witam mam problem z the oracle na Tfs jest w tym problem ze piszesz do niego hi > yes > carlin > knight > yes i potem on zaczyna gatke od nowa ;/ provowalem juz wklajac inne scrypty na the oracle ale to nic nie pomogle prosze o pomoc !!

/Dodano tagi.
 
Last edited by a moderator:

Chris

Senior User
Joined
Apr 5, 2008
Messages
733
Reaction score
181
Age
31
Odp: [TFS] Pomocy The Oracle

Wklej kod swojego oracle tutaj.
 

maates144

User
Joined
Nov 2, 2008
Messages
17
Reaction score
2
Odp: [TFS] Pomocy The Oracle

Siema mam ten sam problem ;/ w k??ko mo?na z nim pisa? hi thais sorcerer, hi thais sorcerer itp. oto kod
Code:
local LEVEL = 8

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)



-- OTServ event handling functions start
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
-- OTServ event handling functions end


function oracle(cid, message, keywords, parameters, node)
	if(cid ~= npcHandler.focus) then
		return false
	end
	
	local cityNode = node:getParent():getParent()
	local vocNode = node:getParent()
	
	local destination = cityNode:getParameters().destination
	local townid = cityNode:getParameters().townid
	local voc = vocNode:getParameters().voc
	
	if(destination ~= nil and voc ~= nil and townid ~= nil) then
		if(getPlayerLevel(cid) < parameters.level) then
			npcHandler:say('You must first reach level ' .. parameters.level .. '!')
		else
			if voc == 1 then
                                                     doPlayerAddItem(cid,2190,1)
                                                     doPlayerSendTextMessage(cid,22,"You are now a Sorcerer. May your new wand give you might!")
                                                     end
                                                     if voc == 2 then
                                                     doPlayerAddItem(cid,2182,1)
                                                     doPlayerSendTextMessage(cid,22,"You are now a Druid. May your new rod give you intellect!")
                                                     end
                                                     if voc == 3 then
                                                     doPlayerAddItem(cid,2456,1)
                                                     doPlayerAddItem(cid,2544,50)
                                                     doPlayerSendTextMessage(cid,22,"You are now a Paladin. May your new Bow and Arrows protect you in dangerous cases!")
                                                     end
                                                     if voc == 4 then
                                                     doPlayerAddItem(cid,2428,1)
                                                     doPlayerAddItem(cid,2531,1)
                                                     doPlayerSendTextMessage(cid,22,"You are now a Knight. May your new shield and axe give you strength!")
                                                     end
                                                     doPlayerSetVocation(cid,voc)
			doPlayerSetTown(cid,townid)
        	                                   doTeleportThing(cid,destination)
        	                                   doSendMagicEffect(destination,12)

        end
	else
		error('Destination:', destination, 'Vocation:', vocation, 'Townid:', townid)
	end
	npcHandler:resetNpc()
	return true
end


function greetCallback(cid)
	if(getPlayerLevel(cid) < LEVEL) then
		npcHandler:say('CHILD! COME BACK WHEN YOU HAVE GROWN UP!')
		return false
	else
		return true
	end
end

-- Set the greeting callback function
npcHandler:setCallback(CALLBACK_GREET, greetCallback)

-- Set the greeting message.
npcHandler:setMessage(MESSAGE_GREET, 'Hello |PLAYERNAME|. Are you prepared to face your destiny?')

-- Pre-create the yes/no nodes.
local yesNode = KeywordNode:new({'yes'}, oracle, {level = LEVEL})
local noNode = KeywordNode:new({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then what vocation do you want to become?'})

-- Create the actual keyword structure...
local node1 = keywordHandler:addKeyword({'yes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'What city do you wish to live in? Carlin, Thais or Venore?'})
	local node2 = node1:addChildKeyword({'carlin'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, townid = 2, destination = {x=32360, y=31782, z=7}, text = 'Carlin will be your home-town! So what vocation do you wish to become? Sorcerer, druid, paladin or knight?'})
		local node3 = node2:addChildKeyword({'sorcerer'}, StdModule.say, {npcHandler = npcHandler, voc = 1, onlyFocus = true, text = 'So, you wish to be a powerful magician? Are you sure about that? This decision is irreversible!'})
			node3:addChildKeywordNode(yesNode)
			node3:addChildKeywordNode(noNode)
		local node3 = node2:addChildKeyword({'druid'}, StdModule.say, {npcHandler = npcHandler, voc = 2, onlyFocus = true, text = 'A druid! Are you sure? This decision is irreversible!'})
			node3:addChildKeywordNode(yesNode)
			node3:addChildKeywordNode(noNode)
		local node3 = node2:addChildKeyword({'paladin'}, StdModule.say, {npcHandler = npcHandler, voc = 3, onlyFocus = true, text = 'A nimble paladin! Are you sure? This decision is irreversible!'})
			node3:addChildKeywordNode(yesNode)
			node3:addChildKeywordNode(noNode)
		local node3 = node2:addChildKeyword({'knight'}, StdModule.say, {npcHandler = npcHandler, voc = 4, onlyFocus = true, text = 'A valorous knight! Are you sure? This decision is irreversible!'})
			node3:addChildKeywordNode(yesNode)
			node3:addChildKeywordNode(noNode)

		local node2 = node1:addChildKeyword({'thais'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, townid = 5, destination = {x=32369, y=32241, z=7}, text = 'Thais will be your home-town! So what vocation do you wish to become? Sorcerer, druid, paladin or knight?'})
		local node3 = node2:addChildKeyword({'sorcerer'}, StdModule.say, {npcHandler = npcHandler, voc = 1, onlyFocus = true, text = 'So, you wish to be a powerful magician? Are you sure about that? This decision is irreversible!'})
			node3:addChildKeywordNode(yesNode)
			node3:addChildKeywordNode(noNode)
		local node3 = node2:addChildKeyword({'druid'}, StdModule.say, {npcHandler = npcHandler, voc = 2, onlyFocus = true, text = 'A mighty druid! Are you sure? This decision is irreversible!'})
			node3:addChildKeywordNode(yesNode)
			node3:addChildKeywordNode(noNode)
		local node3 = node2:addChildKeyword({'paladin'}, StdModule.say, {npcHandler = npcHandler, voc = 3, onlyFocus = true, text = 'A nimble paladin! Are you sure? This decision is irreversible!'})
			node3:addChildKeywordNode(yesNode)
			node3:addChildKeywordNode(noNode)
		local node3 = node2:addChildKeyword({'knight'}, StdModule.say, {npcHandler = npcHandler, voc = 4, onlyFocus = true, text = 'A valorous knight! Are you sure? This decision is irreversible!'})
			node3:addChildKeywordNode(yesNode)
			node3:addChildKeywordNode(noNode)

	local node2 = node1:addChildKeyword({'venore'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, townid = 6, destination = {x=32957, y=32076, z=7}, text = 'Venore will be your home-town! So what vocation do you wish to become? Sorcerer, druid, paladin or knight?'})
		local node3 = node2:addChildKeyword({'sorcerer'}, StdModule.say, {npcHandler = npcHandler, voc = 1, onlyFocus = true, text = 'So, you wish to be a powerful magician? Are you sure about that? This decision is irreversible!'})
			node3:addChildKeywordNode(yesNode)
			node3:addChildKeywordNode(noNode)
		local node3 = node2:addChildKeyword({'druid'}, StdModule.say, {npcHandler = npcHandler, voc = 2, onlyFocus = true, text = 'A mighty druid! Are you sure? This decision is irreversible!'})
			node3:addChildKeywordNode(yesNode)
			node3:addChildKeywordNode(noNode)
		local node3 = node2:addChildKeyword({'paladin'}, StdModule.say, {npcHandler = npcHandler, voc = 3, onlyFocus = true, text = 'A nimble paladin! Are you sure? This decision is irreversible!'})
			node3:addChildKeywordNode(yesNode)
			node3:addChildKeywordNode(noNode)
		local node3 = node2:addChildKeyword({'knight'}, StdModule.say, {npcHandler = npcHandler, voc = 4, onlyFocus = true, text = 'A valorous knight! Are you sure? This decision is irreversible!'})
			node3:addChildKeywordNode(yesNode)
			node3:addChildKeywordNode(noNode)

keywordHandler:addKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Then come back when you are ready.'})

-- Make it react to hi/bye etc.
npcHandler:addModule(FocusModule:new())

Mam TFS By Eclipse ;/ Pom??cie bardzo mi zale?y
 

maates144

User
Joined
Nov 2, 2008
Messages
17
Reaction score
2
Odp: [TFS] Pomocy The Oracle

@Refresh

Pls Pom??cie :/

Czy nikt nie zrobi? oracle na tfs????

@Edit

Ok po ci??kim boju z tym skryptem oracle, uda?o mi si? ,zrobi?em ,?e zmienia profeske i teleportuje do miasta, ale teraz kolejny problem :) A mianowicie po dedzie wracam na rooka, wie kto? jak ustawi? zmiane temple? (przypominam tfs)

Oto kod
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

function oracle(cid, message, keywords, parameters, node)
	if(not npcHandler:isFocused(cid)) then
		return false
	end

	local cityNode = node:getParent():getParent()
	local vocNode = node:getParent()

	local destination = cityNode:getParameters().destination
	local town = cityNode:getParameters().town
	local vocation = vocNode:getParameters().vocation

	if(destination ~= nil and vocation ~= nil and town ~= nil) then
		if(getPlayerLevel(cid) < parameters.level) then
			npcHandler:say('You must first reach level ' .. parameters.level .. '!', cid)
		else
			if getPlayerVocation(cid) > 0 then
				npcHandler:say('Sorry, You already have a vocation!')
			else
				doPlayerSetVocation(cid, vocation)
				doPlayerSetTown(cid, town)
	        	doTeleportThing(cid, destination)
				doSendMagicEffect(destination, CONST_ME_MAGIC_BLUE)
			end
        end
	end
	npcHandler:resetNpc()
	return true
end

function greetCallback(cid)
	if(getPlayerLevel(cid) < 8) then
		npcHandler:say('COME BACK WHEN YOU GROW UP, CHILD!')
		return false
	else
		return true
	end
end
npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setMessage(MESSAGE_GREET, 'Hello |PLAYERNAME|. Are you prepared to face your destiny?')

local yesNode = KeywordNode:new({'yes'}, oracle, {level = 8})
local noNode = KeywordNode:new({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then what vocation do you want to become?'})

local node1 = keywordHandler:addKeyword({'yes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'What city do you wish to live in? Carlin, Thais or Venore?'})
	local node2 = node1:addChildKeyword({'carlin'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, town = 1, destination = {x=32360, y=31782, z=7}, text = 'Carlin?, eh? So what vocation do you wish to become? {Sorcerer}, {druid}, {paladin} or {knight}?'})
		local node3 = node2:addChildKeyword({'sorcerer'}, StdModule.say, {npcHandler = npcHandler, vocation = 1, onlyFocus = true, text = 'So, you wish to be a powerful magician? Are you sure about that? This decision is irreversible!'})
			node3:addChildKeywordNode(yesNode)
			node3:addChildKeywordNode(noNode)
		local node3 = node2:addChildKeyword({'druid'}, StdModule.say, {npcHandler = npcHandler, vocation = 2, onlyFocus = true, text = 'Are you sure that a druid is what you wish to become? This decision is irreversible!'})
			node3:addChildKeywordNode(yesNode)
			node3:addChildKeywordNode(noNode)
		local node3 = node2:addChildKeyword({'paladin'}, StdModule.say, {npcHandler = npcHandler, vocation = 3, onlyFocus = true, text = 'A ranged marksman. Are you sure? This decision is irreversible!'})
			node3:addChildKeywordNode(yesNode)
			node3:addChildKeywordNode(noNode)
		local node3 = node2:addChildKeyword({'knight'}, StdModule.say, {npcHandler = npcHandler, vocation = 4, onlyFocus = true, text = 'A mighty warrior. Is that your final decision? This decision is irreversible!'})
			node3:addChildKeywordNode(yesNode)
			node3:addChildKeywordNode(noNode)
	local node2 = node1:addChildKeyword({'thais'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, town = 1, destination = {x=32369, y=32241, z=7}, text = 'Thais, eh? So what vocation do you wish to become? {Sorcerer}, {druid}, {paladin} or {knight}?'})
		local node3 = node2:addChildKeyword({'sorcerer'}, StdModule.say, {npcHandler = npcHandler, vocation = 1, onlyFocus = true, text = 'So, you wish to be a powerful magician? Are you sure about that? This decision is irreversible!'})
			node3:addChildKeywordNode(yesNode)
			node3:addChildKeywordNode(noNode)
		local node3 = node2:addChildKeyword({'druid'}, StdModule.say, {npcHandler = npcHandler, vocation = 2, onlyFocus = true, text = 'Are you sure that a druid is what you wish to become? This decision is irreversible!'})
			node3:addChildKeywordNode(yesNode)
			node3:addChildKeywordNode(noNode)
		local node3 = node2:addChildKeyword({'paladin'}, StdModule.say, {npcHandler = npcHandler, vocation = 3, onlyFocus = true, text = 'A ranged marksman. Are you sure? This decision is irreversible!'})
			node3:addChildKeywordNode(yesNode)
			node3:addChildKeywordNode(noNode)
		local node3 = node2:addChildKeyword({'knight'}, StdModule.say, {npcHandler = npcHandler, vocation = 4, onlyFocus = true, text = 'A mighty warrior. Is that your final decision? This decision is irreversible!'})
			node3:addChildKeywordNode(yesNode)
			node3:addChildKeywordNode(noNode)
	local node2 = node1:addChildKeyword({'venore'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, town = 1, destination = {x=32957, y=32079, z=7}, text = 'Venore, eh? So what vocation do you wish to become? {Sorcerer}, {druid}, {paladin} or {knight}?'})
		local node3 = node2:addChildKeyword({'sorcerer'}, StdModule.say, {npcHandler = npcHandler, vocation = 1, onlyFocus = true, text = 'So, you wish to be a powerful magician? Are you sure about that? This decision is irreversible!'})
			node3:addChildKeywordNode(yesNode)
			node3:addChildKeywordNode(noNode)
		local node3 = node2:addChildKeyword({'druid'}, StdModule.say, {npcHandler = npcHandler, vocation = 2, onlyFocus = true, text = 'Are you sure that a druid is what you wish to become? This decision is irreversible!'})
			node3:addChildKeywordNode(yesNode)
			node3:addChildKeywordNode(noNode)
		local node3 = node2:addChildKeyword({'paladin'}, StdModule.say, {npcHandler = npcHandler, vocation = 3, onlyFocus = true, text = 'A ranged marksman. Are you sure? This decision is irreversible!'})
			node3:addChildKeywordNode(yesNode)
			node3:addChildKeywordNode(noNode)
		local node3 = node2:addChildKeyword({'knight'}, StdModule.say, {npcHandler = npcHandler, vocation = 4, onlyFocus = true, text = 'A mighty warrior. Is that your final decision? This decision is irreversible!'})
			node3:addChildKeywordNode(yesNode)
			node3:addChildKeywordNode(noNode)
keywordHandler:addKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Then come back when you are ready.'})

npcHandler:addModule(FocusModule:new())

Czy m?g?by kto? doda? do tego ,?eby zmienia?o spawn/temple :) By?bym naprawd? wdzi?czny!
 
Last edited:

Magic

3+3=3!
Joined
Aug 4, 2008
Messages
1,338
Reaction score
180
Odp: [TFS] Pomocy The Oracle

Mam TFS By Eclipse ;/ Pom??cie bardzo mi zale?y
Rotfl.:eek::eek: TFS jest tworzony przez Elf'a, Talaturen'a, Kiper'a, Kornholijon'a, Jonern'a, Lithium'a, slawekens'a. Jak co to edited by kto? tam -.-
A co do wyroczni, ja posiadam z OTLand.net ;-) I dzia?a ! ;D
 

maates144

User
Joined
Nov 2, 2008
Messages
17
Reaction score
2
Odp: [TFS] Pomocy The Oracle

Rotfl.:eek::eek: TFS jest tworzony przez Elf'a, Talaturen'a, Kiper'a, Kornholijon'a, Jonern'a, Lithium'a, slawekens'a. Jak co to edited by kto? tam -.-

Omg... o to mi chodzi?o........ :rolleyes: Nie twierdze ,?e tfs'a robi eclipse.. -.-


A co do tego oracle, sprawdzi?em ju? pare kod?w oracle z otland.net i ?aden nie dzia?a -.- (wogle nie teleportuj?!)

Czy m?g?by? wklei? sw?j kod?

@Edit

Kur*a ! Przez ostatnie 10000 godzin pierdziele si? z tym g?upim oracle ;/ najpierw pierwsze 3-4 godziny pr?bowa?em naprawi? go sam, nic... Napisa?em tutaj, nikt nie pom?g?(jak narazie) w mi?dzy czasie szuka?em na necie nic... Wko?cu na otladzie by?o tego sporo! Wypr?bowa?em ka?dy skrypt oracle jaki tam by? i ?aden ?ADEN nie dzia?a :/ :/ :/
 
Last edited:

Xart Irok

Senior User
Joined
Sep 7, 2008
Messages
2,925
Reaction score
419
Age
32
Odp: [TFS] Pomocy The Oracle

a korzystales z tego oracle looknij
link:
 

maates144

User
Joined
Nov 2, 2008
Messages
17
Reaction score
2
Odp: [TFS] Pomocy The Oracle

Ta pr?bowa?em wklei?em the oracle.xml, oracle.lua, (nic nie edytowa?em) wbijam. Hi, yes, derelin, sorcerer yes, derelin, sorcerer, yes .....
 
Status
Not open for further replies.
Top