Xelemeleque - 2011-04-17 07:03:50

Autorem Jest (??)
Yo! Chciałbym się z wami podzielić dość ciekawym npc, a mianowicie Królową Banshee. Skrypt nie jest mój! Jest on przeróbką, z wersji tibii 8.0 na 7.6! Orygialny temat: http://otland.net/f83/queen-banshee-100-a-85094/


1. Na początek tworzymy plik: Queen of Banshee.xml

Kod:

<?xml version="1.0"?>
<npc name="The Queen Of The Banshees" script="banshee_queen.lua" walkinterval="2000" idleinterval="30">
	<health now="100" max="100"/>
	<look type="78" head="20" body="30" legs="40" feet="50" corpse="2998"/>
</npc>

2. Następnie tworzymy w folderze scripts, plik o nazwie banshee_queen.lua
Wklejamy do niego:

Kod:

_state = 0
_delay = 750

function getNext()
	_state = 0
	
	nextPlayer = getQueuedPlayer()
	if (nextPlayer ~= nil) then
		if (getDistanceToCreature(nextPlayer) <= 4) then
			setFocus(nextPlayer)
			greet(nextPlayer, _delay * 2)
			updateIdle()
			return
		else
			getNext()
		end
	end
	
	setFocus(0)
	resetIdle()
end

function _selfSay(message)
	selfSay(message, _delay)
	updateIdle()
end

function selfSay_(message)
	selfSay(message, _delay)
	getNext()
end

function onCreatureAppear(cid)
end

function onCreatureDisappear(cid)
	if (getFocus() == cid) then
		selfSay('Yes, flee from death. But know it shall be always one step behind you.', _delay)
		getNext()
	else
		unqueuePlayer(cid)
	end
end

function onCreatureMove(cid, oldPos, newPos)
	if (getFocus() == cid) then
		faceCreature(cid)
	end
end

function onCreatureSay(cid, type, msg)
	if (getFocus() == 0) then
		if ((msgcontains(msg, 'hi') or msgcontains(msg, 'hello')) and getDistanceToCreature(cid) <= 4) then
			if (getPlayerLevel(cid) < 60) then
				selfSay('Be greeted, dear visitor. Come and stay ... a while.', _delay)
			else
				updateIdle()
				setFocus(cid)
				greet(cid, _delay)
			end
		end
		
	elseif (getFocus() ~= cid) then 
		if ((msgcontains(msg, 'hi') or msgcontains(msg, 'hello')) and getDistanceToCreature(cid) <= 4) then
			selfSay('Be greeted, dear visitor. Come and stay ... a while.', _delay)
			if (getPlayerLevel(cid) >= 60) then
				queuePlayer(cid)
			end
		end
	else
	local primeiro_selo = getPlayerStorageValue(cid, 20001)
	local segundo_selo = getPlayerStorageValue(cid, 20002)
	local terceiro_selo = getPlayerStorageValue(cid, 20003)
	local quarto_selo = getPlayerStorageValue(cid, 20004)
	local quinto_selo = getPlayerStorageValue(cid, 20005)
	local sexto_selo = getPlayerStorageValue(cid, 20006)
	local setimo_selo = getPlayerStorageValue(cid, 20007)
	local teletransporte = {x=32202, y=31812, z=8, stackpos =0}
	
	if msgcontains(msg, 'seventh') and getPlayerLevel(cid) < 60 or msgcontains(msg, 'last') and getPlayerLevel(cid) < 60 then
	selfSay('You are not experienced enough to master the challenges ahead or to receive knowledge about the seventh seal. Go and learn more before asking me again.')
	
	elseif msgcontains(msg, 'seventh') and getPlayerLevel(cid) > 59 or msgcontains(msg, 'last') and getPlayerLevel(cid) > 59 then
	selfSay('If you have passed the first six seals and entered the blue fires that lead to the chamber of the seal you might receive my kiss ... It will open the last seal. Do you think you are ready?')
	talk_state = 2
	
	elseif msgcontains(msg, 'kiss') and setimo_selo == -1 and talk_state == 8 then
	selfSay('Are you prepared to receive my kiss, even though this will mean that your death as well as a part of your soul will forever belong to me, my dear?')
	talk_state = 1
	elseif msgcontains(msg, 'kiss') and setimo_selo == -1 then
	selfSay('To receive my kiss you have to pass all other seals first.')
	talk_state = 0
	elseif msgcontains(msg, 'kiss') and setimo_selo == 1 then
	selfSay('You have already received my kiss. You should know better then to ask for it.')
	talk_state = 0
	
	elseif msgcontains(msg, 'yes') and talk_state == 1 then
	selfSay('So be it! Hmmmmmm...')
	doTeleportThing(cid, teletransporte)
	setPlayerStorageValue(cid, 20007, 1)
	elseif msgcontains(msg, 'no') and talk_state == 1 then
	selfSay('Perhaps it is the better choice for you, my dear.')
	talk_state = 0
	
	elseif msgcontains(msg, 'yes') and talk_state == 2 and quarto_selo == 1 then
	selfSay('Yessss, I can sense you have passed the seal of sacrifice. Have you passed any other seal yet?')
	talk_state = 3
	elseif msgcontains(msg, 'yes') and talk_state == 2 and quarto_selo == -1 then
	selfSay('You have not passed the seal of sacrifice yet. Return to me when you are better prepared.')
	talk_state = 0
	elseif msgcontains(msg, 'no') and talk_state == 2 then
	selfSay('Then try to be better prepared next time we meet.')
	talk_state = 0
	
	elseif msgcontains(msg, 'yes') and talk_state == 3 and primeiro_selo == 1 then
	selfSay('I sense you have passed the hidden seal as well. Have you passed any other seal yet?')
	talk_state = 4
	elseif msgcontains(msg, 'yes') and talk_state == 3 and primeiro_selo == -1 then
	selfSay('You have not found the hidden seal yet. Return when you are better prepared.')
	talk_state = 0
	elseif msgcontains(msg, 'no') and talk_state == 3 then
	selfSay('Then try to be better prepared next time we meet.')
	talk_state = 0
	
	elseif msgcontains(msg, 'yes') and talk_state == 4 and segundo_selo == 1 then
	selfSay('Oh yes, you have braved the plagueseal. Have you passed any other seal yet?')
	talk_state = 5
	elseif msgcontains(msg, 'yes') and talk_state == 4 and segundo_selo == -1 then
	selfSay('You have not faced the plagueseal yet. Return to me when you are better prepared.')
	talk_state = 0
	elseif msgcontains(msg, 'no') and talk_state == 4 then
	selfSay('Then try to be better prepared next time we meet.')
	talk_state = 0
	
	elseif msgcontains(msg, 'yes') and talk_state == 5 and terceiro_selo == 1 then
	selfSay('Ah, I can sense the power of the seal of demonrage burning in your heart. Have you passed any other seal yet?')
	talk_state = 6
	elseif msgcontains(msg, 'yes') and talk_state == 5 and terceiro_selo == -1 then
	selfSay('You are not filled with the fury of the imprisoned demon. Return when you are better prepared.')
	talk_state = 0
	elseif msgcontains(msg, 'no') and talk_state == 5 then
	selfSay('Then try to be better prepared next time we meet.')
	talk_state = 0
	
	elseif msgcontains(msg, 'yes') and talk_state == 6 and quinto_selo == 1 then
	selfSay('So, you have managed to pass the seal of the 1 path. Have you passed any other seal yet?')
	talk_state = 7
	elseif msgcontains(msg, 'yes') and talk_state == 6 and quinto_selo == -1 then
	selfSay('You have not found your 1 path yet. Return when you are better prepared.')
	talk_state = 0
	elseif msgcontains(msg, 'no') and talk_state == 6 then
	selfSay('Then try to be better prepared next time we meet.')
	talk_state = 0
	
	elseif msgcontains(msg, 'yes') and talk_state == 7 and sexto_selo == 1 then
	selfSay('I see! You have mastered the seal of logic. You have made the sacrifice, you have seen the unseen, you possess fortitude, you have filled yourself with power and found your path. You may ask me for my kiss now.')
	talk_state = 8
	elseif msgcontains(msg, 'yes') and talk_state == 7 and sexto_selo == -1 then
	selfSay('You have not found your 1 path yet. Return to meh when you are better prepared.')
	talk_state = 0
	elseif msgcontains(msg, 'no') and talk_state == 7 then
	selfSay('Then try to be better prepared next time we meet.')
	talk_state = 0
	
	elseif msgcontains(msg, 'spectral dress') then
	selfSay('Your wish for a spectral dress is silly. Allthough I will grant you the permission to take one. My maidens left one in a box in a room, directly south of here.')
	setPlayerStorageValue(cid, 327, 1)
	doPlayerAddItem(cid, 2657, 1)
	talk_state = 0
	
	elseif msgcontains(msg, 'spectral dress') and getPlayerStoraValue(cid, 327) == 1 then
	selfSay('Your wish for a spectral dress is silly. Allthough I will grant you the permission to take one. My maidens left one in a box in a room, directly south of here.')
	doPlayerAddItem(cid, 2657, 1)
	talk_state = 0
	
		
	elseif (msgcontains(msg, 'name')) then
			_selfSay('It hurts me to even think about my mortal past. Its long lost and forgotten. So don\'t ask me about it!')
	elseif (msgcontains(msg, 'job')) then
			_selfSay('It is my curse to be the eternal guardian of this ancient place.')
	elseif (msgcontains(msg, 'place')) then
			_selfSay('It served as a temple, a source of power and ... as a sender for an ancient race in time long gone by and forgotten.')
	elseif (msgcontains(msg, 'race')) then
			_selfSay('The race that built this edifice came to this place from the stars. They ran from an enemy even more horrible than even themselves. But they carried the seed of their own destruction in them.')
	elseif (msgcontains(msg, 'seed')) then
			_selfSay('This ancient race was annihilated by its own doings, that\'s all I know. Aeons have passed since then, but the sheer presence of this complex is still defiling and desecrating this area.')
	elseif (msgcontains(msg, 'destruction')) then
			_selfSay('This ancient race was annihilated by its own doings, that\'s all I know. Aeons have passed since then, but the sheer presence of this complex is still defiling and desecrating this area.')
	elseif (msgcontains(msg, 'complex')) then
			_selfSay('Its constructors were too strange for you or even me to understand. We cannot know what this ... thing they have built was supposed to be good for. All I can feel is a constant twisting and binding of souls, though that is probably only a side-effect.')
	elseif (msgcontains(msg, 'ghostlands')) then
			_selfSay('The place you know as the Ghostlands had a different name once ... and many names thereafter. Too many for me to remember them all.')
	elseif (msgcontains(msg, 'banshee')) then
			_selfSay('They are my maidens. They give me comfort in my eternal vigil over the last seal.')
	elseif (msgcontains(msg, 'seal')) then
			_selfSay('I am the guardian of the SEVENTH and final seal. The seal to open the last door before ... but perhaps it is better you see it with your own eyes.')
	
	elseif (msgcontains(msg, 'guardian')) then
			_selfSay('I am the guardian of the SEVENTH and final seal. The seal to open the last door before ... but perhaps it is better you see it with your own eyes.')
	
	
	elseif msgcontains(msg, 'bye') then
	selfSay('We will meet again.')
	talk_state = 0
	
	end
	-- Final The Queen of the Banshees NPC
	-- NPC The Queen of the Banshees feito por Rodrigo (Nottinghster)
	return true
end
end

function onThink()
	if (getFocus() ~= 0) then
		if (isIdle() or getDistanceToCreature(getFocus()) > 4) then
			selfSay('Wait as patiently as death is waiting for you!', _delay)
			getNext()
		end
	end
end

To na tyle. Mam nadzieję, że pomogłem
Zapraszam do komentowania!

www.narutek.pun.pl www.agh1rokis.pun.pl www.h2osok.pun.pl www.ricoe.pun.pl www.zrom.pun.pl