• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Demon Oak Quest script help.

Hermes

dziwki kola gramy w lola
Joined
Nov 17, 2007
Messages
1,867
Reaction score
14
Location
Poland
Hi there! I have written script for demon oak quest, and there is small problem. Script is in four parts (each for each piece of tree). To prevent duplicating id of hallowed axe I have put into actions four actionids of a tree. Now this script is working like that:

you are USING tree and it works, like you have used hallowed axe.

How can I make this script only works if I use hallowed axe on on of tree parts?

Here is the script (all are almost the same):

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

local randomizer = math.random(1,10)
local queststatus = getPlayerStorageValue(cid,8080)
local monster1 = {x=1067, y=1230, z=7}
local monster2 = {x=1074, y=1231, z=7}
local monster3 = {x=1066, y=1236, z=7}
local monster4 = {x=1074, y=1236, z=7}

if(queststatus == 10) then
	doSendMagicEffect(toPosition, CONST_ME_POFF)
elseif(queststatus < 10) then
	if(itemEx.itemid == 8288 and itemEx.actionid == 8080 and randomizer == 1 or randomizer == 2 or randomizer == 3) then
		doSendMagicEffect(toPosition, 0)
		doSendMagicEffect(fromPosition, 50)
		doCreatureAddHealth(cid, -300)
		doSendAnimatedText(fromPosition, '300', TEXTCOLOR_LIGHTGREEN)
		if queststatus < 1 then
			setPlayerStorageValue(cid,8080,1)
		elseif queststatus == 1 then
			setPlayerStorageValue(cid,8080,2)
		elseif queststatus == 2 then
			setPlayerStorageValue(cid,8080,3)
		elseif queststatus == 3 then
			setPlayerStorageValue(cid,8080,4)
		elseif queststatus == 4 then
			setPlayerStorageValue(cid,8080,5)
		elseif queststatus == 5 then
			setPlayerStorageValue(cid,8080,6)
		elseif queststatus == 6 then
			setPlayerStorageValue(cid,8080,7)
		elseif queststatus == 7 then
			setPlayerStorageValue(cid,8080,8)
		elseif queststatus == 8 then
			setPlayerStorageValue(cid,8080,9)
		elseif queststatus == 9 then
			setPlayerStorageValue(cid,8080,10)
		end
	elseif(itemEx.itemid == 8288 and itemEx.actionid == 8080 and randomizer == 4 or randomizer == 5) then
		doSummonCreature("Crypt Shambler", monster1)
		doSummonCreature("Crypt Shambler", monster2)
		doSummonCreature("Crypt Shambler", monster3)
		doSummonCreature("Crypt Shambler", monster4)
		doSendMagicEffect(toPosition, 0)
	elseif(itemEx.itemid == 8288 and itemEx.actionid == 8080 and randomizer == 6 or randomizer == 7) then
		doSummonCreature("Lich", monster1)
		doSummonCreature("Lich", monster2)
		doSummonCreature("Lich", monster3)
		doSummonCreature("Lich", monster4)
		doSendMagicEffect(toPosition, 0)
	elseif(itemEx.itemid == 8288 and itemEx.actionid == 8080 and randomizer == 8) then
		doSummonCreature("Blightwalker", monster1)
		doSendMagicEffect(toPosition, 0)
	elseif(itemEx.itemid == 8288 and itemEx.actionid == 8080 and randomizer == 9 or randomizer == 10) then
		doSendMagicEffect(toPosition, 16)
		doSendMagicEffect(fromPosition, 54)
		doCreatureAddHealth(cid, -300)
		doSendAnimatedText(fromPosition, '300', TEXTCOLOR_LIGHTGREEN)
	end
end
end

Note. If you are looking at this thread just to take script to your OT as a working one, you should know that this script is not RL yet, and I have to improve it a bit. Also this script is one of about 10~ pieces of a full quest (RL!).

Regards,
Hermes

PS. OMGOMGOMG! I have 2 rep++ bars o.O
 
Last edited:
Hihoi......

is very nobak scripting :S:S:S:S:S

Why making it soooooo long :O:O
Code:
		if queststatus < 1 then
			setPlayerStorageValue(cid,8080,1)
		elseif queststatus == 1 then
			setPlayerStorageValue(cid,8080,2)
		elseif queststatus == 2 then
			setPlayerStorageValue(cid,8080,3)
		elseif queststatus == 3 then
			setPlayerStorageValue(cid,8080,4)
		elseif queststatus == 4 then
			setPlayerStorageValue(cid,8080,5)
		elseif queststatus == 5 then
			setPlayerStorageValue(cid,8080,6)
		elseif queststatus == 6 then
			setPlayerStorageValue(cid,8080,7)
		elseif queststatus == 7 then
			setPlayerStorageValue(cid,8080,8)
		elseif queststatus == 8 then
			setPlayerStorageValue(cid,8080,9)
		elseif queststatus == 9 then
			setPlayerStorageValue(cid,8080,10)
		end

=
Code:
			if queststatus < 1 then
				setPlayerStorageValue(cid,8080,1)
			elseif queststatus > 0 and queststatus < 10 then
				setPlayerStorageValue(cid, 8020, queststatus + 1)
			end

Code:
		doSummonCreature("Crypt Shambler", monster1)
		doSummonCreature("Crypt Shambler", monster2)
		doSummonCreature("Crypt Shambler", monster3)
		doSummonCreature("Crypt Shambler", monster4)

=
Code:
			for i = 1, table.maxn(monsterPositions) do
				doSummonCreature("Crypt Shambler", monsterPosition[i])
			end
+
Code:
	local monsterPositions = {
		{x=1067, y=1230, z=7},
		{x=1074, y=1231, z=7},
		{x=1066, y=1236, z=7},
		{x=1074, y=1236, z=7}
	}

Is ok :)
 
Thanks.. But how to fix this to use hallowed axe on tree, not just use a tree?

Compile all of your 4 scripts into 1 and register as the hollowed axe script in actions.xml ^^

@
Spakuj je i poslij mi na priv, to moze mi sie bedzie chcialo... Chyba ze sa brzydko napisane :f
 
Back
Top