Ir para conteúdo

The Demon Oak Quest 2.1 (tfs 0.4)


tibiaa4e

Posts Recomendados

@all

 

Essa semana vou ficar coçando e vou arrumar esses bugs ai

 

Recebi varias PMS e vou tentar arrumar todos e dizer os que eu não consegui

 

Vou tentar mudar a engine para dar menos erros...

 

Então até sexta já terão a 2.0 bem melhor.

Link para o comentário
Compartilhar em outros sites

  • Respostas 103
  • Created
  • Última resposta

Top Posters In This Topic

Não funcionou direito isso parece uma critica

Se você quiser resolver que tal colocar o erro que nós tentaremos resolver...

 

E poderá ser o mesmo erro de muitos e poderá ser concertado ou explicado...

Link para o comentário
Compartilhar em outros sites

Ei gente pq vcs no tetam esse tutorial

 

Demon Oak Quest

 

This is the script for the new Demon Oak Quest(Full). It works only on TFS 2.0(Latest revision and items.otb v.3).

 

All credits to me.

 

THE QUEST SCRIPTS

 

Don't forget to add the monsters and their positions in the script. Change "doSummonCreature("", summonmediumtwo2Position)" to for example "doSummonCreature("Demon", summonmediumtwo2Position)" . The summon positions must be inside the arena and the backpositions must be outside the arena so the player will be teleported out when he finiched the quest.

 

actions/scripts/tools/Hallowed Axe.lua :

--- Made by Mazen ---
function onUse(cid, item, fromPosition, itemEx, toPosition)

--- Config --
levelneeded = 120 --- How much level you need to enter the arena ---

--- First part ---
summonweak1Position = {x=XXX, y=XXX, z=X}
summonweak2Position = {x=XXX, y=XXX, z=X}
summonweak3Position = {x=XXX, y=XXX, z=X}
summonweak4Position = {x=XXX, y=XXX, z=X}
summonweakone1Position = {x=XXX, y=XXX, z=X}
summonweakone2Position = {x=XXX, y=XXX, z=X}
summonweakone3Position = {x=XXX, y=XXX, z=X}
summonweakone4Position = {x=XXX, y=XXX, z=X}
summonweaktwo1Position = {x=XXX, y=XXX, z=X}
summonweaktwo2Position = {x=XXX, y=XXX, z=X}
summonweaktwo3Position = {x=XXX, y=XXX, z=X}
summonweaktwo4Position = {x=XXX, y=XXX, z=X}

--- Second Part ---
summonnormal1Position = {x=XXX, y=XXX, z=X}
summonnormal2Position = {x=XXX, y=XXX, z=X}
summonnormal3Position = {x=XXX, y=XXX, z=X}
summonnormal4Position = {x=XXX, y=XXX, z=X}
summonnormalone1Position = {x=XXX, y=XXX, z=X}
summonnormalone2Position = {x=XXX, y=XXX, z=X}
summonnormalone3Position = {x=XXX, y=XXX, z=X}
summonnormalone4Position = {x=XXX, y=XXX, z=X}
summonnormaltwo1Position = {x=XXX, y=XXX, z=X}
summonnormaltwo2Position = {x=XXX, y=XXX, z=X}
summonnormaltwo3Position = {x=XXX, y=XXX, z=X}
summonnormaltwo4Position = {x=XXX, y=XXX, z=X}

--- Third Part ---
summonmedium1Position = {x=XXX, y=XXX, z=X}
summonmedium2Position = {x=XXX, y=XXX, z=X}
summonmedium3Position = {x=XXX, y=XXX, z=X}
summonmedium4Position = {x=XXX, y=XXX, z=X}
summonmediumone1Position = {x=XXX, y=XXX, z=X}
summonmediumone2Position = {x=XXX, y=XXX, z=X}
summonmediumone3Position = {x=XXX, y=XXX, z=X}
summonmediumone4Position = {x=XXX, y=XXX, z=X}
summonmediumtwo1Position = {x=XXX, y=XXX, z=X}
summonmediumtwo2Position = {x=XXX, y=XXX, z=X}
summonmediumtwo3Position = {x=XXX, y=XXX, z=X}
summonmediumtwo4Position = {x=XXX, y=XXX, z=X}

--- Fourth Part ---
summonhard1Position = {x=XXX, y=XXX, z=X}
summonhard2Position = {x=XXX, y=XXX, z=X}
summonhard3Position = {x=XXX, y=XXX, z=X}
summonhard4Position = {x=XXX, y=XXX, z=X}
summonhardone1Position = {x=XXX, y=XXX, z=X}
summonhardone2Position = {x=XXX, y=XXX, z=X}
summonhardone3Position = {x=XXX, y=XXX, z=X}
summonhardone4Position = {x=XXX, y=XXX, z=X}

--- Teleport Back Positions ---
back1Position = {x=XXX, y=XXX, z=X}
back2Position = {x=XXX, y=XXX, z=X}
back3Position = {x=XXX, y=XXX, z=X}
back4Position = {x=XXX, y=XXX, z=X}
back5Position = {x=XXX, y=XXX, z=X}

--- End Config ---

demonoak = {8288, 8289, 8290, 8291}

if itemEx.itemid == 2709 and itemEx.uid == 32193 and getPlayerLevel(cid) >= levelneeded then
if getPlayerStorageValue(cid, 21545) <= 1 and getPlayerStorageValue(cid,29061) == 1 then
	doTransformItem(itemEx.uid, 3669)
	doTeleportThing(cid, toPosition, TRUE)
else
	doSendMagicEffect(toPosition, 2)
end
elseif itemEx.itemid == 8288 or itemEx.itemid == 8289 or itemEx.itemid == 8290 or itemEx.itemid == 8291 then
if getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == -1 then
	if math.random(1, 2) == 1 then
		setPlayerStorageValue(cid, 21541, 1)
		doSendMagicEffect(toPosition, 0)
		doSummonCreature("", summonweak1Position)
		doSummonCreature("", summonweak2Position)
		doSummonCreature("", summonweak3Position)
		doSummonCreature("", summonweak4Position)
		doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
	elseif math.random(1, 2) == 2 then
		doSendMagicEffect(toPosition, 0)
		doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
	end
elseif getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 1 then
	if math.random(1, 2) == 1 then
		setPlayerStorageValue(cid, 21541, 2)
		doSendMagicEffect(toPosition, 0)
		doSummonCreature("", summonweakone1Position)
		doSummonCreature("", summonweakone2Position)
		doSummonCreature("", summonweakone3Position)
		doSummonCreature("", summonweakone4Position)
		doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
	elseif math.random(1, 2) == 2 then
		doSendMagicEffect(toPosition, 0)
		doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
	end
elseif getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 2 then
	if math.random(1, 2) == 1 then
		setPlayerStorageValue(cid, 21541, 3)
		doSendMagicEffect(toPosition, 0)
		doSummonCreature("", summonweaktwo1Position)
		doSummonCreature("", summonweaktwo2Position)
		doSummonCreature("", summonweaktwo3Position)
		doSummonCreature("", summonweaktwo4Position)
		doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
		if itemEx.itemid == 8288 then
			setPlayerStorageValue(cid, itemEx.itemid, 1)
		elseif itemEx.itemid == 8289 then
			setPlayerStorageValue(cid, itemEx.itemid, 1)
		elseif itemEx.itemid == 8290 then
			setPlayerStorageValue(cid, itemEx.itemid, 1)
		elseif itemEx.itemid == 8291 then
			setPlayerStorageValue(cid, itemEx.itemid, 1)
		end
	elseif math.random(1, 2) == 2 then
		doSendMagicEffect(toPosition, 0)
		doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
	end
elseif getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == -1 then
	if math.random(1, 2) == 1 then
		setPlayerStorageValue(cid, 21542, 1)
		doSendMagicEffect(toPosition, 0)
		doSummonCreature("", summonnormal1Position)
		doSummonCreature("", summonnormal2Position)
		doSummonCreature("", summonnormal3Position)
		doSummonCreature("", summonnormal4Position)
		doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
	elseif math.random(1, 2) == 2 then
		doSendMagicEffect(toPosition, 0)
		doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
	end
elseif getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == 1 then
	if math.random(1, 2) == 1 then
		setPlayerStorageValue(cid, 21542, 2)
		doSendMagicEffect(toPosition, 0)
		doSummonCreature("", summonnormalone1Position)
		doSummonCreature("", summonnormalone2Position)
		doSummonCreature("", summonnormalone3Position)
		doSummonCreature("", summonnormalone4Position)
		doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
	elseif math.random(1, 2) == 2 then
		doSendMagicEffect(toPosition, 0)
		doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
	end
elseif getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == 2 then
	if math.random(1, 2) == 1 then
		setPlayerStorageValue(cid, 21542, 3)
		doSendMagicEffect(toPosition, 0)
		doSummonCreature("", summonnormaltwo1Position)
		doSummonCreature("", summonnormaltwo2Position)
		doSummonCreature("", summonnormaltwo3Position)
		doSummonCreature("", summonnormaltwo4Position)
		doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
		if itemEx.itemid == 8288 then
			setPlayerStorageValue(cid, itemEx.itemid, 1)
		elseif itemEx.itemid == 8289 then
			setPlayerStorageValue(cid, itemEx.itemid, 1)
		elseif itemEx.itemid == 8290 then
			setPlayerStorageValue(cid, itemEx.itemid, 1)
		elseif itemEx.itemid == 8291 then
			setPlayerStorageValue(cid, itemEx.itemid, 1)
		end
	elseif math.random(1, 2) == 2 then
		doSendMagicEffect(toPosition, 0)
		doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
	end
elseif getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == 3 and getPlayerStorageValue(cid, 21543) == -1 then
	if math.random(1, 2) == 1 then
		setPlayerStorageValue(cid, 21543, 1)
		doSendMagicEffect(toPosition, 0)
		doSummonCreature("", summonmedium1Position)
		doSummonCreature("", summonmedium2Position)
		doSummonCreature("", summonmedium3Position)
		doSummonCreature("", summonmedium4Position)
		doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
	elseif math.random(1, 2) == 2 then
		doSendMagicEffect(toPosition, 0)
		doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
	end
elseif getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == 3 and getPlayerStorageValue(cid, 21543) == 1 then
	if math.random(1, 2) == 1 then
		setPlayerStorageValue(cid, 21543, 2)
		doSendMagicEffect(toPosition, 0)
		doSummonCreature("", summonmediumone1Position)
		doSummonCreature("", summonmediumone2Position)
		doSummonCreature("", summonmediumone3Position)
		doSummonCreature("", summonmediumone4Position)
		doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
	elseif math.random(1, 2) == 2 then
		doSendMagicEffect(toPosition, 0)
		doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
	end
elseif getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == 3 and getPlayerStorageValue(cid, 21543) == 2 then
	if math.random(1, 2) == 1 then
		setPlayerStorageValue(cid, 21543, 3)
		doSendMagicEffect(toPosition, 0)
		doSummonCreature("", summonmediumtwo1Position)
		doSummonCreature("", summonmediumtwo2Position)
		doSummonCreature("", summonmediumtwo3Position)
		doSummonCreature("", summonmediumtwo4Position)
		doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
		if itemEx.itemid == 8288 then
			setPlayerStorageValue(cid, itemEx.itemid, 1)
		elseif itemEx.itemid == 8289 then
			setPlayerStorageValue(cid, itemEx.itemid, 1)
		elseif itemEx.itemid == 8290 then
			setPlayerStorageValue(cid, itemEx.itemid, 1)
		elseif itemEx.itemid == 8291 then
			setPlayerStorageValue(cid, itemEx.itemid, 1)
		end
	elseif math.random(1, 2) == 2 then
		doSendMagicEffect(toPosition, 0)
		doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
	end
elseif getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == 3 and getPlayerStorageValue(cid, 21543) == 3 and getPlayerStorageValue(cid, 21544) == -1 then
	if math.random(1, 2) == 1 then
		setPlayerStorageValue(cid, 21544, 1)
		doSendMagicEffect(toPosition, 0)
		doSummonCreature("", summonmedium1Position)
		doSummonCreature("", summonmedium2Position)
		doSummonCreature("", summonmedium3Position)
		doSummonCreature("", summonmedium4Position)
		doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)

	elseif math.random(1, 2) == 2 then
		doSendMagicEffect(toPosition, 0)
		doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
	end
elseif getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == 3 and getPlayerStorageValue(cid, 21543) == 3 and getPlayerStorageValue(cid, 21544) == 1 then
	if math.random(1, 2) == 1 then
		setPlayerStorageValue(cid, 21544, 2)
		doSendMagicEffect(toPosition, 0)
		doSummonCreature("", summonmediumone1Position)
		doSummonCreature("", summonmediumone2Position)
		doSummonCreature("", summonmediumone3Position)
		doSummonCreature("", summonmediumone4Position)
		doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
	elseif math.random(1, 2) == 2 then
		doSendMagicEffect(toPosition, 0)
		doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
	end
elseif getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == 3 and getPlayerStorageValue(cid, 21543) == 3 and getPlayerStorageValue(cid, 21544) == 2 then
	if math.random(1, 2) == 1 then
		setPlayerStorageValue(cid, 21544, 3)
		doSendMagicEffect(toPosition, 0)
		doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
		if itemEx.itemid == 8288 then
			setPlayerStorageValue(cid, itemEx.itemid, 1)
			setPlayerStorageValue(cid, 21545, 1)
			if getPlayerStorageValue(cid, 8288) == 1 then
				setPlayerStorageValue(cid, 21545, 1)
				if math.random(1, 5) == 1 then
					doSendMagicEffect(fromPosition, 10)
					doTeleportThing(cid,back1Position)
				elseif math.random(1, 5) == 2 then
					doSendMagicEffect(fromPosition, 10)
					doTeleportThing(cid,back2Position)
				elseif math.random(1, 5) == 3 then
					doSendMagicEffect(fromPosition, 10)
					doTeleportThing(cid,back3Position)
				elseif math.random(1, 5) == 4 then
					doSendMagicEffect(fromPosition, 10)
					doTeleportThing(cid,back4Position)
				elseif math.random(1, 5) == 5 then
					doSendMagicEffect(fromPosition, 10)
					doTeleportThing(cid,back5Position)
				end
			end
		elseif itemEx.itemid == 8289 then
			setPlayerStorageValue(cid, itemEx.itemid, 1)
			if getPlayerStorageValue(cid, 8289) == 1 then
				setPlayerStorageValue(cid, 21545, 1)
				if math.random(1, 5) == 1 then
					doSendMagicEffect(fromPosition, 10)
					doTeleportThing(cid,back1Position)
				elseif math.random(1, 5) == 2 then
					doSendMagicEffect(fromPosition, 10)
					doTeleportThing(cid,back2Position)
				elseif math.random(1, 5) == 3 then
					doSendMagicEffect(fromPosition, 10)
					doTeleportThing(cid,back3Position)
				elseif math.random(1, 5) == 4 then

					doSendMagicEffect(fromPosition, 10)
					doTeleportThing(cid,back4Position)
				elseif math.random(1, 5) == 5 then
					doSendMagicEffect(fromPosition, 10)
					doTeleportThing(cid,back5Position)
				end
			end
		elseif itemEx.itemid == 8290 then
			setPlayerStorageValue(cid, itemEx.itemid, 1)
			if getPlayerStorageValue(cid, 8290) == 1 then
				setPlayerStorageValue(cid, 21545, 1)
				if math.random(1, 5) == 1 then
					doSendMagicEffect(fromPosition, 10)
					doTeleportThing(cid,back1Position)
				elseif math.random(1, 5) == 2 then
					doSendMagicEffect(fromPosition, 10)
					doTeleportThing(cid,back2Position)
				elseif math.random(1, 5) == 3 then
					doSendMagicEffect(fromPosition, 10)
					doTeleportThing(cid,back3Position)
				elseif math.random(1, 5) == 4 then
					doSendMagicEffect(fromPosition, 10)
					doTeleportThing(cid,back4Position)
				elseif math.random(1, 5) == 5 then
					doSendMagicEffect(fromPosition, 10)
					doTeleportThing(cid,back5Position)
				end
			end
		elseif itemEx.itemid == 8291 then
			setPlayerStorageValue(cid, itemEx.itemid, 1)
			if getPlayerStorageValue(cid, 8291) == 1 then
				setPlayerStorageValue(cid, 21545, 1)
				if math.random(1, 5) == 1 then
					doSendMagicEffect(fromPosition, 10)
					doTeleportThing(cid,back1Position)
				elseif math.random(1, 5) == 2 then
					doSendMagicEffect(fromPosition, 10)
					doTeleportThing(cid,back2Position)
				elseif math.random(1, 5) == 3 then
					doSendMagicEffect(fromPosition, 10)
					doTeleportThing(cid,back3Position)
				elseif math.random(1, 5) == 4 then
					doSendMagicEffect(fromPosition, 10)
					doTeleportThing(cid,back4Position)
				elseif math.random(1, 5) == 5 then
					doSendMagicEffect(fromPosition, 10)
					doTeleportThing(cid,back5Position)
				end
			end
		end
	elseif math.random(1, 2) == 2 then
		doSendMagicEffect(toPosition, 0)
		doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
	end
else
doSendMagicEffect(toPosition, 2)
end
end
return TRUE
end

 

Add this to creaturescripts\scripts\login.lua :

 

Under:

function onLogin(cid)

 

Add this:

setPlayerStorageValue(cid,29061,1)

 

Add this in the actions.xml file:

		  <action itemid="8293" script="tools/Hallowed Axe.lua"/>

 

Add DOQ.lua to movments :

--- Mazen ---
function onStepOut(cid, item, position, fromPosition)
if item.uid == 32193 then
	doTransformItem(item.uid, 2709)
end
if getPlayerStorageValue(cid,29061) >= 1 and getPlayerStorageValue(cid,21545) <= 2 then
	if getPlayerStorageValue(cid,21541) == 1 or getPlayerStorageValue(cid,21541) == 2 or getPlayerStorageValue(cid,21541) == 3 then
		setPlayerStorageValue(cid,21541,-1)
	end
	if getPlayerStorageValue(cid,21542) == 1 or getPlayerStorageValue(cid,21542) == 2 or getPlayerStorageValue(cid,21542) == 3 then
		setPlayerStorageValue(cid,21542,-1)
	end
	if getPlayerStorageValue(cid,21543) == 1 or getPlayerStorageValue(cid,21543) == 2 or getPlayerStorageValue(cid,21543) == 3 then
		setPlayerStorageValue(cid,21543,-1)
	end
	if getPlayerStorageValue(cid,21544) == 1 or getPlayerStorageValue(cid,21544) == 2 or getPlayerStorageValue(cid,21544) == 3 then
		setPlayerStorageValue(cid,21544,-1)
	end
	if getPlayerStorageValue(cid,21545) == 1 or getPlayerStorageValue(cid,21545) == 2 then
		setPlayerStorageValue(cid,21545,-1)
	end
	if getPlayerStorageValue(cid,8288) == 1 then
		setPlayerStorageValue(cid,8288,-1)
	end
	if getPlayerStorageValue(cid,8289) == 1 then
		setPlayerStorageValue(cid,8289,-1)
	end
	if getPlayerStorageValue(cid,8290) == 1 then
		setPlayerStorageValue(cid,8290,-1)
	end
	if getPlayerStorageValue(cid,8291) == 1 then
		setPlayerStorageValue(cid,8291,-1)
	end
end
return TRUE
end

function onStepIn(cid, item, position, fromPosition)
if getPlayerStorageValue(cid,29061) >= 1 and getPlayerStorageValue(cid,21545) <= 2 then
	if getPlayerStorageValue(cid,21541) == 1 or getPlayerStorageValue(cid,21541) == 2 or getPlayerStorageValue(cid,21541) == 3 then
		setPlayerStorageValue(cid,21541,-1)
	end
	if getPlayerStorageValue(cid,21542) == 1 or getPlayerStorageValue(cid,21542) == 2 or getPlayerStorageValue(cid,21542) == 3 then
		setPlayerStorageValue(cid,21542,-1)
	end
	if getPlayerStorageValue(cid,21543) == 1 or getPlayerStorageValue(cid,21543) == 2 or getPlayerStorageValue(cid,21543) == 3 then
		setPlayerStorageValue(cid,21543,-1)
	end
	if getPlayerStorageValue(cid,21544) == 1 or getPlayerStorageValue(cid,21544) == 2 or getPlayerStorageValue(cid,21544) == 3 then
		setPlayerStorageValue(cid,21544,-1)
	end
	if getPlayerStorageValue(cid,21545) == 1 or getPlayerStorageValue(cid,21545) == 2 then
		setPlayerStorageValue(cid,21545,-1)
	end
	if getPlayerStorageValue(cid,8288) == 1 then
		setPlayerStorageValue(cid,8288,-1)
	end
	if getPlayerStorageValue(cid,8289) == 1 then
		setPlayerStorageValue(cid,8289,-1)
	end
	if getPlayerStorageValue(cid,8290) == 1 then
		setPlayerStorageValue(cid,8290,-1)
	end
	if getPlayerStorageValue(cid,8291) == 1 then
		setPlayerStorageValue(cid,8291,-1)
	end
end
return TRUE
end

 

Add demon oak area.lua to movments:

--- Made by Mazen ---
function onStepIn(cid, item, position, fromPosition)
if isPlayer(cid) == TRUE then
	if getPlayerStorageValue(cid, 29061) == 1 then
		setPlayerStorageValue(cid, 29061, -1)
	end
end
if isPlayer(cid) == TRUE and math.random(1, 24) == 1 then
	doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
end
return TRUE
end

function onStepOut(cid, item, position, fromPosition)
if isPlayer(cid) == TRUE and getPlayerStorageValue(cid,29061) <= 1 then
	setPlayerStorageValue(cid,29061,1)
end
return TRUE
end

 

Add this on movments.xml :

<movevent event="StepOut" uniqueid="32193" script="DOQ.lua" />
<movevent event="StepIn" uniqueid="32193" script="DOQ.lua" />
<movevent event="StepIn" itemid="8292" script="[color="#FF0000"]demon oak[/color] area.lua" />
<movevent event="StepOut" itemid="8292" script="[color="#FF0000"]demon oak[/color] area.lua" />

 

IMAGE OF THE QUEST:

02160111490db2a7baddd.jpg

 

The 5 rings is the yelling areas of the Demon Oak.

1. "What a nice shiny golden armor. Come to me and you can have it!"

2. "What is that? Demon Legs lying here? Someone might have lost them."

3. "You can have my demon set, if you help me get out of here!"

4. "I can bring your beloved back from the dead, just release me!"

5. "Release me and you will be rewarded greatefully!"

 

THE REWARD:

 

This is the reward script, quests/DOQChests.lua :

--- Made by Mazen ---
function onUse(cid, item, fromPosition, itemEx, toPosition)

   if item.uid == 12901 then
	   queststatus = getPlayerStorageValue(cid,50090)
	   if queststatus == -1 then
		   doPlayerSendTextMessage(cid,22,"You have found a [color="#FF0000"]Demon[/color] Legs.")
		   doPlayerAddItem(cid,2495,1)
		   setPlayerStorageValue(cid,50090,1)
	   else
		   doPlayerSendTextMessage(cid,22,"It is empty.")
	   end
   elseif item.uid == 12902 then
	   queststatus = getPlayerStorageValue(cid,50090)
	   if queststatus == -1 then
		   doPlayerSendTextMessage(cid,22,"You have found a Rainbow Shield.")
		   doPlayerAddItem(cid,8905,1)
		   setPlayerStorageValue(cid,50090,1)
	   else
		   doPlayerSendTextMessage(cid,22,"It is empty.")
	   end
   elseif item.uid == 12903 then
	   queststatus = getPlayerStorageValue(cid,50090)
	   if queststatus == -1 then
		   doPlayerSendTextMessage(cid,22,"You have found a Spellbook of Dark Mysteries.")
		   doPlayerAddItem(cid,8918,1)
		   setPlayerStorageValue(cid,50090,1)
	   else
		   doPlayerSendTextMessage(cid,22,"It is empty.")
	   end
   elseif item.uid == 12904 then
	   queststatus = getPlayerStorageValue(cid,50090)
	   if queststatus == -1 then
		   doPlayerSendTextMessage(cid,22,"You have found a Royal Crossbow.")
		   doPlayerAddItem(cid,8851,1)
		   setPlayerStorageValue(cid,50090,1)
	   else
		   doPlayerSendTextMessage(cid,22,"It is empty.")
	   end
end
   return 1
end

 

Add this on actions.xml :

<action uniqueid="12901" script="quests/DOQChest.lua.lua" /> --- [color="#FF0000"]Demon[/color] Legs ---
<action uniqueid="12902" script="quests/DOQChest.lua.lua" /> --- Rainbow Shield ---
<action uniqueid="12903" script="quests/DOQChest.lua.lua" /> --- Spellbook of Dark Mysteries ---
<action uniqueid="12904" script="quests/DOQChest.lua.lua" /> --- Royal Crossbow ---

 

THE GRAVESTONE:

 

This is the gravestone script. The gravestone that you have to use to teleport to the reward room.

 

The gravestone uniqueid must be "55100".

 

Add this action script, DOQgravestone.lua :

--- Made by Mazen ---

function onUse(cid, item, fromPosition, itemEx, toPosition)

	newnPosition  = {x=XXX, y=XXX, z=X} --- Reward Room Position ---

if getPlayerStorageValue(cid,21545) == 2 then
	doTeleportThing(cid,newnPosition)
	doSendMagicEffect(newnPosition,10)
else
	return FALSE
end
return TRUE
end

 

Add this on actions.xml :

		 <action uniqueid="55100" script="DOQgravestone.lua" />

 

THE NPC:

 

Here is the npc that is selling you the hallowed axe.

 

oldrak.lua :

-- WAS NOT Made by Coltain13 // Coltain, I only made it work for TFS --


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 creatureSayCallback(cid, type, msg)
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
if (not npcHandler:isFocused(cid)) then
	return false
end

	player_gold = getPlayerItemCount(cid,2148)
	player_plat = getPlayerItemCount(cid,2152)*100
	player_crys = getPlayerItemCount(cid,2160)*10000
	player_money = player_gold + player_plat + player_crys
	playerCap = getPlayerFreeCap(cid)
	item = 8293 --Hallowed Axe
	itemweight = getItemWeight(item, 1)

	if msgcontains(msg, 'hallowed axe') then
			if getPlayerItemCount(cid,2386) >= 1 and player_money >= 3500000 then
				npcHandler:say('Do you want to buy a Hallowed Axe from me?', cid)
				talk_state = 1
			else
				npcHandler:say('You have to bring me an axe and 1000 gp first.', cid)
				talk_state = 0
			end
	elseif msgcontains(msg, 'yes') and talk_state == 1 then
		talk_state = 0
		if getPlayerItemCount(cid,2386) >= 1 and player_money >= 3500000 then
				if doPlayerTakeItem(cid,2386,1) == 1 and pay(cid,3500000) and playerCap >= itemweight then
					npcHandler:say('Here you are. You can now defeat the [color="#FF0000"]demon oak[/color] with this axe.', cid)
					doPlayerAddItem(cid,item,1)
					talk_state = 0
				else
					npcHandler:say('The Hallowed Axe is too heavy for you. Make sure that you have enough capacity.', cid)
					talk_state = 0
				end
		else
			npcHandler:say('Please bring with you an axe and enough with money.', cid)
			talk_state = 0
		end
	elseif msgcontains(msg, '[color="#FF0000"]demon oak[/color]') then
		if getPlayerItemCount(cid,2386) >= 1 and player_money >= 3500000 then
			npcHandler:say('Did you defeat the [color="#FF0000"]demon oak[/color]?', cid)
			talk_state = 2
		else
			npcHandler:say('Go defeat the [color="#FF0000"]demon oak[/color].', cid)
			talk_state = 0
		end
	elseif msgcontains(msg, 'yes') and talk_state == 2 then
		talk_state = 0
		if getPlayerStorageValue(cid,21545) == 1 then
			npcHandler:say('Good job!', cid)
			setPlayerStorageValue(cid,21545,2)
		end
------------------------------------------------ confirm no ------------------------------------------------
	elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 1) then
		npcHandler:say('Ok thanks.', cid)
		talk_state = 0
	end
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())[/codebox]

[b]Oldrak.xml :[/b]
[codebox]<npc name="Oldrak" script="data/npc/scripts/oldrak.lua" walkinterval="2000" floorchange="0" access="3" level="1" maglevel="1">
<health now="150" max="150"/>
<look type="57" head="115" body="113" legs="31" feet="38" addons="3" corpse="2212"/>
<parameters>
	<parameter key="message_greet" value="Hello, |PLAYERNAME|!" />
	<parameter key="message_needmoremoney" value="Try again when you have more money."/>
	<parameter key="message_decline" value="Why would you tease me like that?"/>
</parameters>
</npc>

 

Updates:

1.0 Script released!

1.1 Fixed the NPC and the axe scripts. Added anti-cheat system.

1.2 Fixed a bug in the anti-cheat system.(Players can now enter the arena after they died there)

1.3 Fixed the NPC Oldrak. He wont ignore you now when you say "demon oak" or "hallowed axe".

 

REMEMBER: REPORT BUGS IF YOU FIND ANY!

 

Enjoy!

 

 

OBS.: Copiado do otfans

Link Oficial: http://otfans.net/showthread.php?t=123816&...light=Demon+Oak

Editado por ivan-filho
Link para o comentário
Compartilhar em outros sites

FOI MAL AE

 

ontem eu fiz as coisas meio com preça e tals...

hoje peguei seu mapa .. converti para 8.4

e tals

 

e funciono...

agora fui testa deu um erro enorme quando o player usa o axe na arvore...

meu client travou inteiro !

nun sei se é problema do meu pc.. mais eu nunca tive problemas assim...

olha só a Ss:

errodoak.jpg

Editado por pinguyn
Link para o comentário
Compartilhar em outros sites

aki funciono tudo certinho ;]

 

unica coisa q tive q arruma algumas parte do script mais saum detalhes pikenos nd critico e tbm num fikaria melhor c fizec assim (num sei minha opnião posso entar errado)

 

depois de "function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)"

 

-- demon oak script

if getPlayerStorageValue(cid, 15005) <=7 then

setPlayerMultiplyStorageValues (cid,{15001,15002,15003,15004},1)

setPlayerStorageValue(cid,15005,3)

end

-- end demon oak script

 

ai e como c ele tivec passado no portal tpw como escapado da demon oak e tbm ele num precisa i la no npc dinovo pega a Hallowed Axe dinovo e tal e tbm pra quem usa o TFS Beta ou RC nao tem na pasta data o global.lua se nao me engano vc colok essa parte

 

function doCreatureSayWithDistance(cid, position, text, type)

oldPosX = setPlayerStorageValue(cid, 10000, getCreaturePosition(cid).x)

oldPosY = setPlayerStorageValue(cid, 10001, getCreaturePosition(cid).y)

oldPosZ = setPlayerStorageValue(cid, 10002, getCreaturePosition(cid).z)

oldPos = { x = getPlayerStorageValue(cid, 10000), y = getPlayerStorageValue(cid, 10001), z = getPlayerStorageValue(cid, 10002) }

doTeleportThing(cid, position, 0)

doCreatureSay(cid, text, type)

doTeleportThing(cid, oldPos, 0)

return

end

 

function doSummonCreatures (monsters,positions)

 

for _, positions in pairs (positions) do

doSummonCreature(monsters, positions)

end

end

 

function setPlayerMultiplyStorageValues(cid, storage, value)

for _, storage in pairs(storage) do

setPlayerStorageValue(cid, storage, value)

end

end

 

no final da linha em data/lib/data.lua

 

acho q a maioria dos erros da turma aki é quando eles passando no portal ele reseta o Value 15005 para 1 ai entaum para a quest de certa ele teria q volta ao npc e compra a axe dinovo para q o Value 15005 isse de 1 para 3

 

ai como a tree base precisa soh disso pra abri-la

if item2.itemid == 2717 and item2.uid == 32193 then

if getPlayerLevel(cid) >= 120 then

 

eles taum saindo da quest e entrando dinovo sem i ao npc ai quando vc termina de mata tudo o Value 15005 ficara 4~5 c vc nao i fala com o npc dinovo, ai quando vc passa no portal pensando q termino a quest, ele reseta tudo.

 

esse e um dos errado q tava dando aki

 

arrumei fazendo assim no portal

doPlayerSendTextMessage(cid,21,"You have escaped of Demon Oak.")

setPlayerMultiplyStorageValues (cid,{15001,15002,15003,15004},1)

setPlayerStorageValue(cid, 15006,0)

setPlayerStorageValue(cid,15005,3)

 

esse Value 15006 e dessa parte aki

local yell = getPlayerStorageValue(cid, 15006)

 

e la na tree base colokei assim

value_check = getPlayerStorageValue(cid, 15006)

if item2.itemid == 2717 and item2.uid == 32193 and value_check == 5 then

if getPlayerLevel(cid) >= 120 then

 

com isso ele precisara passa nas 5 parte em volta antes de i la e abri a demon oak e quando ele passa no portal reseta tudo menos o Value 15005 q vai pra 3

 

@Tibiaa4e

c eu estive errado ou falei alguma coisa q nao gosto desculpa veio o/ soh to tentando ajuda

Editado por awarkener
Link para o comentário
Compartilhar em outros sites

@up

 

Hm se me deu boas ideias xD

 

E não falo nada errado eu vou dar uma reorganizada xD

 

E vlw pela ajuda

 

Os principais erros de um script sempre veem de um usuario eu só testo ela umas 2x

Editado por tibiaa4e
Link para o comentário
Compartilhar em outros sites

ninguem sabe resolver esse problema aqui não?

 

isso acontece logo após o player usar o Hallowed axe na tree base!

o client trava inteiro e este erro aparece no console.

errodoak.jpg

Editado por pinguyn
Link para o comentário
Compartilhar em outros sites

  • 2 weeks later...

Uso tfs 0.2, funciona?

A deadtree aquela arvore q impede a entrada, num ta saindo quando agente da use com axe, npc num ta dando certo... PQ?

Por favor, simplifique em passos para mim entender melhor. eu fiz tudo direitinho!

Link para o comentário
Compartilhar em outros sites

Olá pessoal!

 

Eu tenho um problema, aqui uma foto

post-233027-1237697500_thumb.jpg

 

 

Alguém pode me ajudar por favor?

 

Thanks in advance

 

PS: Desculpem-me por o meu Português, eu ainda estou aprendendo ^ ^

Link para o comentário
Compartilhar em outros sites

O cara abandonou o topico , tentei instalar no tfs 0.3 e não rola a arvore da 5 gritos mais na verdade de vez de sair os gritos na arvore sai no char , e depois dos 5 gritos vc vai no npc ele não te vende a axe , vc fala demon oak ele não responde , ai a gente cria o machado não adianta nada pq não pegou algum uid que precisa então não adianta entrar na oak com o gm puxando que não funciona , se alguem conseguiu arrumar todos os bugs que o script tem por gentileza posta pra galera ai.

 

Desde ja obrigado.

Link para o comentário
Compartilhar em outros sites

  • 3 months later...

×
×
  • Criar Novo...