• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Working Demon Oak Quest

all is working.. less the script from the grave when I finish killing all the monsters .. could help me plz..
 
can u tell what to edit so i can only start the quest if i finished the demon task? (i use your killing in the name of...)
 
Check what storage you set as reward on the killing in the name of... example: storage 1500

And now, on actions/scripts/demonOak.lua, after:
Lua:
		if getCreatureStorage(cid, storages.done) > 0 then
			doPlayerSendCancel(cid, "You already done this quest.")
			return true
		end

add:

Lua:
		if getCreatureStorage(cid, 1500) > 0 then
			doPlayerSendCancel(cid, "You need to finish the demon task to start this quest.")
			return true
		end
 
so in that case:

Lua:
if getCreatureStorage(cid, 1539) ~= 2 then
			doPlayerSendCancel(cid, "You need to finish the demon task to start this quest.")
			return true
		end

right?
 
Last edited by a moderator:
I have a problem with funct getCreaturesInRange

Using tfs version 0.2.9 (Client 8.7)
Everithing's working except when it tries to figure out if there is any monster in range, in lua code:
Lua:
		if(k == 4) then
			if getCreaturesInRange(monster, areaPosition[1], areaPosition[2], count) > 0 then
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Please kill all monsters first.")
				doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
			end
			doTeleportThing(cid, positions.kick)
			setPlayerStorageValue(cid, storages.done, 1)
			return true
		end
I get this error in the console while using hallowed axe on demon oak (only last time):
PHP:
[15/01/2011 07:07:37] Lua Script Error: [Action Interface] 
[15/01/2011 07:07:37] data/actions/scripts/quests/demonoak/demonOak.lua:onUse
[15/01/2011 07:07:37] data/actions/scripts/quests/demonoak/demonOak.lua:145: attempt to compare number with nil
[15/01/2011 07:07:37] stack traceback:
[15/01/2011 07:07:37] 	[C]: in function '__le'
[15/01/2011 07:07:37] 	data/actions/scripts/quests/demonoak/demonOak.lua:145: in function <data/actions/scripts/quests/demonoak/demonOak.lua:94>

I will appreciate a lot your help!
 
Replace that part with this:
Lua:
		if(k == 4) then
			for x = areaPosition[1].x, areaPosition[2].x do
				for y = areaPosition[1].y, areaPosition[2].y do
					local v = getTopCreature({x=x, y=y, z=areaPosition[1].z}).uid
					if v >= 0x40000000 and v < 0x80000000 and isCreature(v) then
						doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Please kill all monsters first.")
						doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
						return true
					end
				end
			end
 
			doTeleportThing(cid, positions.kick)
			doCreatureSetStorage(cid, storages.done, 1)
			return true
		end
 
Replace that part with this:
Lua:
		if(k == 4) then
			for x = areaPosition[1].x, areaPosition[2].x do
				for y = areaPosition[1].y, areaPosition[2].y do
					local v = getTopCreature({x=x, y=y, z=areaPosition[1].z}).uid
					if v >= 0x40000000 and v < 0x80000000 and isCreature(v) then
						doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Please kill all monsters first.")
						doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
						return true
					end
				end
			end
 
			doTeleportThing(cid, positions.kick)
			doCreatureSetStorage(cid, storages.done, 1)
			return true
		end

Thanks it works man, rep 4 you!
 
All scripts were updated.
Fixed some several bugs.
Some optimitations to all scripts.
Added a lib file with new variables and functions.

Enjoy.
 
DarkHaos can you add that the player can't give the next cut (to the oak) if the monster already summon aren't killed?

edit; for some reason when the script check the last cut and still some monster the reserver get heavy for few sec.

en español, como se le podría agregar una prevención de que el player no pueda dar el siguiente corte si los monstruos que salieron del corte anterior aun siguen con vida, ya que se puede abusar con esto si un player corta varias veces dejara el respawn lleno de summon lo cual lo hará imposible de hacer hasta reset del server.

Gracias de antemano por este scripts, funciona a la perfección ya lo acabo de actualizar a la version 6 =P

edit; Por alguna razón cuando el script revisa si aun existen monstruos antes de ser expulsado del Oak el servidor se pone lento al igual que el client por unos segundos.
 
Last edited:
DarkHaos can you add that the player can't give the next cut (to the oak) if the monster already summon aren't killed?

edit; for some reason when the script check the last cut and still some monster the reserver get heavy for few sec.

en español, como se le podría agregar una prevención de que el player no pueda dar el siguiente corte si los monstruos que salieron del corte anterior aun siguen con vida, ya que se puede abusar con esto si un player corta varias veces dejara el respawn lleno de summon lo cual lo hará imposible de hacer hasta reset del server.

Gracias de antemano por este scripts, funciona a la perfección ya lo acabo de actualizar a la version 6 =P

edit; Por alguna razón cuando el script revisa si aun existen monstruos antes de ser expulsado del Oak el servidor se pone lento al igual que el client por unos segundos.

1st. Done, check the main post, lib and actions/demonOak.lua files were updated.
2nd. I know that, but i can't prevent that, it happens by the use of loops on the script.
 
2nd. I know that, but i can't prevent that, it happens by the use of loops on the script.
Then why don't you optimize the loop function? Take a look at the code I posted a few posts ago.

Instead of searching through all 253 stackpos' (which is completely unnecessary, by the way), it exits the loop as soon as it finds a monster.
 
Back
Top