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

NPC Wizard Outfit Quest (100% Real Tibia)

Leon Zawo

New Member
Joined
Sep 4, 2011
Messages
36
Reaction score
2
Hello,

I was borred and i created 100% Wizard Outfit Quest.

Lugri.xml
XML:
<?xml version="1.0"?>
<npc name="Lugri" script="data/npc/scripts/wizard1.lua" lookdir="2" walkinterval="2000">
    <mana now="800" max="800"/>
    <health now="200" max="200"/>
<look type="151" head="115" body="76" legs="35" feet="117" addons="1" corpse="6080"/>
 <parameters>
  <parameter key="message_greet" value="What do you want, |PLAYERNAME| ?"/>
    </parameters>
</npc>

wizard1.lua
Lua:
	-- Made by Leon Zawodowiec --
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

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 creatureSayCallback(cid, type, msg)
	if(not npcHandler:isFocused(cid)) then
		return false
	end

	local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
	
	local outfit = {
			[1] = {2536}, -- Medusa Shield
			[2] = {2492}, -- Dragon Scale Mail
			[3] = {2488}, -- Crown Legs
			[4] = {2123}  -- Ring of The Sky
				   }	
	
	if msgcontains(msg, "outfit") and getPlayerStorageValue(cid, 10222) ~= 1 then
		npcHandler:say("This skull shows that you are a true follower of Zathroth and the glorious gods of darkness. Are you willing to prove your loyalty ?", cid)
		talkState[talkUser] = 1
	
	elseif msgcontains(msg, "yes") and getPlayerStorageValue(cid, 10222) ~= 1 and talkState[talkUser] == 1 then
		npcHandler:say("It will be a hard task which requires many sacrifices. Do you still want to proceed ?", cid)
		talkState[talkUser] = 2
		
	elseif msgcontains(msg, "yes") and getPlayerStorageValue(cid, 10222) ~= 1 and talkState[talkUser] == 2 then
		npcHandler:say("Good decision, ".. getPlayerName(cid) ..". Your first sacrifice will be a {medusa shield}. Bring it to me and do give it happily.", cid)
		setPlayerStorageValue(cid, 10222, 1)
		setPlayerStorageValue(cid, 10223, 1)
		talkState[talkUser] = 0		
	
	elseif msgcontains(msg, "medusa shield") and getPlayerStorageValue(cid, 10223) == 1 then
		if getPlayerItemCount(cid, 2536) >= 1 then
			npcHandler:say("Is it your true wish to sacrifice a medusa shield to Zathroth ?", cid)
			talkState[talkUser] = 1
		else
			npcHandler:say("Sorry, but You don\'t have {Medusa Shield} !", cid)
			talkState[talkUser] = 0
		end
	
	elseif msgcontains(msg, "yes") and getPlayerStorageValue(cid, 10223) == 1 and talkState[talkUser] == 1 then
		if (doPlayerRemoveItem(cid, 2536, 1) == TRUE) then
			npcHandler:say("Good. I accept your sacrifice. The second sacrifice I require from you is a {dragon scale mail}. Bring it to me and do give it happily.", cid)
			setPlayerStorageValue(cid, 10223, 2)
			talkState[talkUser] = 0
		else
			npcHandler:say("Sorry, but you don\'t have {Medusa Shield} !", cid)
			talkState[talkUser] = 0
		end
	
	elseif msgcontains(msg, "dragon scale mail") and getPlayerStorageValue(cid, 10223) == 2 then
		if getPlayerItemCount(cid, 2492) >= 1 then
			npcHandler:say("Is it your true wish to sacrifice a dragon scale mail to Zathroth ?", cid)
			talkState[talkUser] = 1
		else
			npcHandler:say("Sorry, but You don\'t have {Dragon Scale Mail} !", cid)
			talkState[talkUser] = 0
		end
		
	elseif msgcontains(msg, "yes") and getPlayerStorageValue(cid, 10223) == 2 and talkState[talkUser] == 1 then
		if (doPlayerRemoveItem(cid, 2492, 1) == TRUE) then
			npcHandler:say("Good. I accept your sacrifice. The third sacrifice I require from you are {crown legs}. Bring them to me and do give them happily.", cid)
			setPlayerStorageValue(cid, 10223, 3)
			talkState[talkUser] = 0
		else
			npcHandler:say("Sorry, but you don\'t have {Dragon Scale Mail} !", cid)
			talkState[talkUser] = 0
		end
	
	elseif msgcontains(msg, "crown legs") and getPlayerStorageValue(cid, 10223) == 3 then
		if getPlayerItemCount(cid, 2488) >= 1 then
			npcHandler:say("Is it your true wish to sacrifice crown legs to Zathroth ?", cid)
			talkState[talkUser] = 1
		else
			npcHandler:say("Sorry, but you don\'t have {Crown Legs} !", cid)
			talkState[talkUser] = 0
		end
		
	elseif msgcontains(msg, "yes") and getPlayerStorageValue(cid, 10223) == 3 and talkState[talkUser] == 1 then
		if (doPlayerRemoveItem(cid, 2488, 1) == TRUE) then
			npcHandler:say("Good. I accept your sacrifice. The last sacrifice I require from you is a {ring of the sky}. Bring it to me and do give it happily.", cid)
			setPlayerStorageValue(cid, 10223, 4)
			talkState[talkUser] = 0
		else
			npcHandler:say("Sorry, but you don\'t have {Crown Legs} !", cid)
			talkState[talkUser] = 0
		end

	elseif msgcontains(msg, "ring of the sky") and getPlayerStorageValue(cid, 10223) == 4 then
		if getPlayerItemCount(cid, 2123) >= 1 then
			npcHandler:say("Is it your true wish to sacrifice a ring of the sky to Zathroth ?", cid)
			talkState[talkUser] = 1
		else
			npcHandler:say("Sorry, but you don\'t have {Ring of The Sky} !", cid)
			talkState[talkUser] = 0
		end
		
	elseif msgcontains(msg, "yes") and getPlayerStorageValue(cid, 10223) == 4 and talkState[talkUser] == 1 then
		if (doPlayerRemoveItem(cid, 2123, 1) == TRUE) then
			npcHandler:say("Good. I accept your sacrifice. You have proven that you are a true follower of Zathroth and do not hesitate to sacrificeworldly goods. Thus, I will reward you with this headgear.", cid)
				if getPlayerSex(cid) == 0 then
					doPlayerAddOutfit(cid, 149, 1)
				else
					doPlayerAddOutfit(cid, 145, 1)
				end
			setPlayerStorageValue(cid, 10223, 5)
			talkState[talkUser] = 0
		else
			npcHandler:say("Sorry, but you don\'t have {Ring of The Sky} !", cid)
			talkState[talkUser] = 0
		end
	else
		if msgcontains(msg, "outfit") then
			if getPlayerStorageValue(cid, 10223) <= 4 then
				item = getItemNameById(outfit[getPlayerStorageValue(cid, 10223)][1])
				npcHandler:say("Bring me ".. item .." !", cid)
			else
				npcHandler:say("You have already this outfit !", cid)
			end
		end
	end
return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

The Queen Of The Banshees.xml
XML:
<?xml version="1.0"?>
<npc name="The Queen Of The Banshees" script="data/npc/scripts/wizard2.lua" lookdir="2" walkinterval="2000">
    <mana now="800" max="800"/>
    <health now="200" max="200"/>
<look type="151" head="115" body="76" legs="35" feet="117" addons="2" corpse="6080"/>
 <parameters>
  <parameter key="message_greet" value="Be greeted, dear visitor. Ahhh... I can sense darkness inside your soul... are you a follower of Zathroth ?"/>
    </parameters>
</npc>

wizard2.lua
Lua:
	-- Made by Leon Zawodowiec --
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

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 creatureSayCallback(cid, type, msg)
	if(not npcHandler:isFocused(cid)) then
		return false
	end

	local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
	
	if msgcontains(msg, "addon") and getPlayerStorageValue(cid, 10223) ~= 5 then
		npcHandler:say("Sorry, but you don\'t have Wizard Outfit !", cid)
		return true
	end
	
	if msgcontains(msg, "addon") and getPlayerStorageValue(cid, 10224) ~= 1 and getPlayerStorageValue(cid, 10223) == 5 then
		npcHandler:say("Say... I have been longing for something for an eternity now... if you help me retrieve it, I will reward you. Do you consent to this arrangement ?", cid)
		talkState[talkUser] = 1
	
	elseif msgcontains(msg, "yes") and getPlayerStorageValue(cid, 10224) ~= 1 and getPlayerStorageValue(cid, 10223) == 5 and talkState[talkUser] == 1 then
		npcHandler:say("Listen... there are no blooming flowers down here and the only smell present is that of death and decay. ...", cid)
		npcHandler:say("I wish that I could breathe the lovely smell of beautiful flowers just one more time, especially those which elves cultivate. ...", cid)
		npcHandler:say("Could you please bring me 50 {Holy Orchids} ?", cid)
		talkState[talkUser] = 2		

	elseif msgcontains(msg, "yes") and getPlayerStorageValue(cid, 10224) ~= 1 and getPlayerStorageValue(cid, 10223) == 5 and talkState[talkUser] == 2 then
		npcHandler:say("Thank you. I will wait for your return.", cid)
		setPlayerStorageValue(cid, 10224, 1)
		setPlayerStorageValue(cid, 10225, 1)
		talkState[talkUser] = 0	
		
	elseif msgcontains(msg, "holy orchid") and getPlayerStorageValue(cid, 10225) == 1 then
		npcHandler:say("Have you really brought me 50 Holy Orchids ?", cid)
		talkState[talkUser] = 1
		
	elseif msgcontains(msg, "yes") and getPlayerStorageValue(cid, 10225) == 1 and talkState[talkUser] == 1 then
		if (doPlayerRemoveItem(cid, 5922, 50) == TRUE) then
			npcHandler:say("Thank you! You have no idea what that means to me. As promised, here is your reward... as a follower of Zathroth, I hope that you will like this accessory.", cid)
				if getPlayerSex(cid) == 0 then
					doPlayerAddOutfit(cid, 149, 2)
				else
					doPlayerAddOutfit(cid, 145, 2)
				end
			setPlayerStorageValue(cid, 10225, 2)
			talkState[talkUser] = 0
		else
			npcHandler:say("Sorry, but you don\'t have 50 {Holy Orchids} !", cid)
			talkState[talkUser] = 0
		end
	else
		if msgcontains(msg, "addon") then
			if getPlayerStorageValue(cid, 10225) <= 1 then
				npcHandler:say("Bring me 50x {Holy Orchid} !", cid)
			else
				npcHandler:say("You have already this addon !", cid)
			end
		end
	end
return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Last edited:
for first:
it isn't 100% like real tibia

change:
getPlayerStorageValue(cid, 10222) ~= 1

to
getPlayerStorageValue(cid, 10222) == -1


btw. po co uzywasz google translate by przetlumaczyc jedna linijke? jestes az tak tempy?
 
for first:
it isn't 100% like real tibia

change:
getPlayerStorageValue(cid, 10222) ~= 1

to
getPlayerStorageValue(cid, 10222) == -1


btw. po co uzywasz google translate by przetlumaczyc jedna linijke? jestes az tak tempy?

Maybe tell us why its not 100% ?

getPlayerStorageValue(cid, 10222) ~= 1 is better in use. WHY? read it: Średni Jak zrobić Quest'a Skrzynkowego - Forum Tibia.tv - Polski Support Tibia & Open Tibia (OTS - Otserv)

btw. Co tu masz z Google Translatora? Wszystkie dialogi masz z wiki, deklu. :)
 
100% will be when u add banshee quest like rl tibia, because u haven't talk about addons with queen before complete 7 seals :)


# Leon Zawo
Zedytowałeś posta, ale wcześniej miałeś 100% Wizard Outfit Questa. zamiast 100% Wizard Outfit Quest. bo poprostu google translate nie przetłumaczyło.
Jak masz sprawdzanie czy jest -1 to jest sprawdzenie czy gracz ma jakikolwiek storage, hmm po przeczytaniu tego tematu co dałeś to wystarczy zrobić warunek
< 0 :)
A warunek różny to każdy inny, więc to debilizm dawać to w npc'ach, wgl testowałeś to? Bo tak ułożyłeś kolejność warunków, że na samym starcie sprawdza czy jest różny od 1... Co ciekawe.. Dalej w skrypcie masz sprawdzanie czy storage jest = 2, ale to się nie wykona, bo najpierw sprawdziłeś czy jest inny niż 1, a 2 jest i wykona się pierwsze zapytanie.
Jeśli już dajesz warunek różny od 1 to dawaj go na samym końcu, a nie na początku.
Przeczytałeś tutorial, który odnosi się do questu skrzynkowego, w którym wykorzystuje się tylko 1 value storaga, a tutaj w npc wykorzystujesz ich wiele, myśl czasem.

//edit

Sorry nie przeczytałem dokładnie skryptu, bo jest tam taki syf, że trudno się to czyta, akurat dobrze chyba dałeś te warunki, sry.

Ale po co robisz 20x elseif msg('yes') and talkstate ==

lepiej robić:
Code:
if msgcontatins('yes') then
    if talk == 1 then
    ,,,
    elseif talk == 2 then
    ,,,
[code]
itd.
 
100% will be when u add banshee quest like rl tibia, because u haven't talk about addons with queen before complete 7 seals :)


# Leon Zawo
Zedytowałeś posta, ale wcześniej miałeś 100% Wizard Outfit Questa. zamiast 100% Wizard Outfit Quest. bo poprostu google translate nie przetłumaczyło.
Jak masz sprawdzanie czy jest -1 to jest sprawdzenie czy gracz ma jakikolwiek storage, hmm po przeczytaniu tego tematu co dałeś to wystarczy zrobić warunek
< 0 :)
A warunek różny to każdy inny, więc to debilizm dawać to w npc'ach, wgl testowałeś to? Bo tak ułożyłeś kolejność warunków, że na samym starcie sprawdza czy jest różny od 1... Co ciekawe.. Dalej w skrypcie masz sprawdzanie czy storage jest = 2, ale to się nie wykona, bo najpierw sprawdziłeś czy jest inny niż 1, a 2 jest i wykona się pierwsze zapytanie.
Jeśli już dajesz warunek różny od 1 to dawaj go na samym końcu, a nie na początku.
Przeczytałeś tutorial, który odnosi się do questu skrzynkowego, w którym wykorzystuje się tylko 1 value storaga, a tutaj w npc wykorzystujesz ich wiele, myśl czasem.

//edit

Sorry nie przeczytałem dokładnie skryptu, bo jest tam taki syf, że trudno się to czyta, akurat dobrze chyba dałeś te warunki, sry.

Ale po co robisz 20x elseif msg('yes') and talkstate ==

lepiej robić:
Code:
if msgcontatins('yes') then
    if talk == 1 then
    ,,,
    elseif talk == 2 then
    ,,,
[code]
itd.[/QUOTE]

Rzadko kiedy używam translatora, to ręcznie tłumaczyłem z polskiego i nie zmieniłem końcówki.
http://www.tibia-wiki.net/index.php?title=Wizard_Addons_Quest/Spoiler&oldid=250281#Wymagania
Ja w tym artykule nie widzę żadnych innych wymagań na Addon'a.

A co do tutorialu, "Przeczytałeś tutorial".., sorry ale ja go napisałem. >.<
Warunki w tym skrypcie dałem jak najbardziej poprawne, wystarczy pomyśleć.
A co do syfu, po prostu to forum psuje formatowanie.

A elseif'a mógłbym wykorzystać, ale na storage value a nie msgconatins, a potem sprawdzać talkstate`a.
Nie zamierzam się kłócić, jest skrypt? Działa? Cieszcie się, że postanowiłem go opublikować. =]

Jeżeli ktoś chciałby dodać coś innego do banshee to wtedy sprawdzanie storagevalu`a na początku, lub osobną funkcje i wykorzystać "node". :)

@Up
Thanks.
 
Back
Top