• 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 Something concerned with demon oak.

EvulMastah

๏̯͡๏﴿
Premium User
Joined
Aug 19, 2007
Messages
4,941
Solutions
11
Reaction score
352
Hi.
Thats the thing about 'hitting' this demon oak thing with halowed axe.
Works with all 4 parts of it.

Code:
-- Credit is me ok
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local config = {
		actions = { 8080, 8181, 8282, 8383 },
		positions = {
			{ x = 241, y = 565, z = 5 },
			{ x = 242, y = 565, z = 5 },
			{ x = 243, y = 565, z = 5 },
			{ x = 244, y = 565, z = 5 }
		},
		monsters = {
			[8080] = { [4] = { "Crypt Shambler", 4 }, [5] = { "Crypt Shambler", 4 }, [6] = { "Lich", 4 }, [7] = { "Lich", 4 }, [8] = { "Blightwalker", 1 } },
			[8181] = { [4] = { "Crypt Shambler", 4 }, [5] = { "Crypt Shambler", 4 }, [6] = { "Lich", 4 }, [7] = { "Lich", 4 }, [8] = { "Blightwalker", 1 } },
			[8282] = { [4] = { "Crypt Shambler", 4 }, [5] = { "Crypt Shambler", 4 }, [6] = { "Banshee", 2 }, [7] = { "Banshee", 2 }, [8] = { "Diabolic Imp", 1 } },
			[8383] = { [3] = { "Crypt Shambler", 4 }, [4] = { "Crypt Shambler", 4 }, [5] = { "Bone Beast", 4 }, [6] = { "Giant Spider", 2 }, [7] = { "Lich", 2 }, [8] = { "Demon", 1 } }
		},
		rand = math.random(1, 10)
	}

	if isInArray(config.actions, itemEx.actionid) == TRUE then
		if getPlayerStorageValue(cid, itemEx.actionid) == 10 then
			doSendMagicEffect(toPosition, CONST_ME_POFF)
			return TRUE
		end
		
		if config.rand < 4 then
			if getPlayerStorageValue(cid, itemEx.actionid) < 1 then
				setPlayerStorageValue(cid, itemEx.actionid, 1)
			elseif getPlayerStorageValue(cid, itemEx.actionid) >= 1 and getPlayerStorageValue(cid, itemEx.actionid) < 10 then
				setPlayerStorageValue(cid, itemEx.actionid, getPlayerStorageValue(cid, itemEx.actionid) + 1)
			end
			
			doSendMagicEffect(toPosition, CONST_ME_HITBYPOISON)
			doTargetCombatHealth(0, cid, COMBAT_POISONDAMAGE, - 300, - 300, CONST_ME_PLANTATTACK)
			return TRUE
		elseif config.rand > 8 then
			doSendMagicEffect(toPosition, CONST_ME_HITBYPOISON)
			doTargetCombatHealth(0, cid, COMBAT_POISONDAMAGE, - 300, - 300, CONST_ME_PLANTATTACK)
			return TRUE
		end
		
		for rand, var in pairs(config.monsters[itemEx.actionid]) do
			if config.rand == rand then
				for i = 1, var[2] do
					doSummonCreature(var[1], config.positions[i])
					if i == var[2] then doSendMagicEffect(toPosition, CONST_ME_DRAWBLOOD) end
				end
			end
		end
	end
	return TRUE
end

actions.xml
Code:
	<action itemid="8293" script="demon oak.lua"/>

Ok.
 
Pff.. Nab. But it works as those four that I have sent to you right? Because for each tree part there is other neccesary storage value (8080 - 8383, 10) and other monsters are summoned.

Thanks ^^,

(you should extend your script with real tibia thingzz to demon oak like NPC (I can give it to u :S), with 6 movement tiles which should open the tree and something to close it after reaching demon oak aren)
 
Pff.. Nab. But it works as those four that I have sent to you right? Because for each tree part there is other neccesary storage value (8080 - 8383, 10) and other monsters are summoned.

Thanks ^^,

Monsters are specified in the table for each actionID of the item.
It sets player storage value same as item actionid.
 
Code:
[27/01/2009 12:01:31] Lua Script Error: [Action Interface] 
[27/01/2009 12:01:31] data/actions/scripts/demonoak/demonoak.lua:onUse

[27/01/2009 12:01:31] luaDoSummonCreature(). Can not summon monster: Lich

[27/01/2009 12:01:31] Lua Script Error: [Action Interface] 
[27/01/2009 12:01:31] data/actions/scripts/demonoak/demonoak.lua:onUse

[27/01/2009 12:01:31] luaDoSummonCreature(). Can not summon monster: Lich

[27/01/2009 12:01:31] Lua Script Error: [Action Interface] 
[27/01/2009 12:01:31] data/actions/scripts/demonoak/demonoak.lua:onUse

[27/01/2009 12:01:31] luaDoSummonCreature(). Can not summon monster: Lich

[27/01/2009 12:01:31] Lua Script Error: [Action Interface] 
[27/01/2009 12:01:31] data/actions/scripts/demonoak/demonoak.lua:onUse

[27/01/2009 12:01:31] luaDoSummonCreature(). Can not summon monster: Lich

[27/01/2009 12:01:33] Lua Script Error: [Action Interface] 
[27/01/2009 12:01:33] data/actions/scripts/demonoak/demonoak.lua:onUse

[27/01/2009 12:01:33] luaDoSummonCreature(). Can not summon monster: Lich

[27/01/2009 12:01:33] Lua Script Error: [Action Interface] 
[27/01/2009 12:01:33] data/actions/scripts/demonoak/demonoak.lua:onUse

[27/01/2009 12:01:33] luaDoSummonCreature(). Can not summon monster: Lich

[27/01/2009 12:01:33] Lua Script Error: [Action Interface] 
[27/01/2009 12:01:33] data/actions/scripts/demonoak/demonoak.lua:onUse

[27/01/2009 12:01:33] luaDoSummonCreature(). Can not summon monster: Lich

[27/01/2009 12:01:33] Lua Script Error: [Action Interface] 
[27/01/2009 12:01:33] data/actions/scripts/demonoak/demonoak.lua:onUse

[27/01/2009 12:01:33] luaDoSummonCreature(). Can not summon monster: Lich

[27/01/2009 12:01:45] Lua Script Error: [Action Interface] 
[27/01/2009 12:01:45] data/actions/scripts/demonoak/demonoak.lua:onUse

[27/01/2009 12:01:45] luaDoSummonCreature(). Can not summon monster: Crypt Shambler

[27/01/2009 12:01:45] Lua Script Error: [Action Interface] 
[27/01/2009 12:01:45] data/actions/scripts/demonoak/demonoak.lua:onUse

[27/01/2009 12:01:45] luaDoSummonCreature(). Can not summon monster: Crypt Shambler

[27/01/2009 12:01:45] Lua Script Error: [Action Interface] 
[27/01/2009 12:01:45] data/actions/scripts/demonoak/demonoak.lua:onUse

[27/01/2009 12:01:45] luaDoSummonCreature(). Can not summon monster: Crypt Shambler

[27/01/2009 12:01:45] Lua Script Error: [Action Interface] 
[27/01/2009 12:01:45] data/actions/scripts/demonoak/demonoak.lua:onUse

[27/01/2009 12:01:45] luaDoSummonCreature(). Can not summon monster: Crypt Shambler

[27/01/2009 12:01:47] Lua Script Error: [Action Interface] 
[27/01/2009 12:01:47] data/actions/scripts/demonoak/demonoak.lua:onUse

[27/01/2009 12:01:47] luaDoSummonCreature(). Can not summon monster: Lich

[27/01/2009 12:01:47] Lua Script Error: [Action Interface] 
[27/01/2009 12:01:47] data/actions/scripts/demonoak/demonoak.lua:onUse

[27/01/2009 12:01:47] luaDoSummonCreature(). Can not summon monster: Lich

[27/01/2009 12:01:47] Lua Script Error: [Action Interface] 
[27/01/2009 12:01:47] data/actions/scripts/demonoak/demonoak.lua:onUse

[27/01/2009 12:01:47] luaDoSummonCreature(). Can not summon monster: Lich

[27/01/2009 12:01:47] Lua Script Error: [Action Interface] 
[27/01/2009 12:01:47] data/actions/scripts/demonoak/demonoak.lua:onUse

[27/01/2009 12:01:47] luaDoSummonCreature(). Can not summon monster: Lich

[27/01/2009 12:02:01] Lua Script Error: [Action Interface] 
[27/01/2009 12:02:01] data/actions/scripts/demonoak/demonoak.lua:onUse

[27/01/2009 12:02:01] luaDoSummonCreature(). Can not summon monster: Crypt Shambler

[27/01/2009 12:02:01] Lua Script Error: [Action Interface] 
[27/01/2009 12:02:01] data/actions/scripts/demonoak/demonoak.lua:onUse

[27/01/2009 12:02:01] luaDoSummonCreature(). Can not summon monster: Crypt Shambler

[27/01/2009 12:02:01] Lua Script Error: [Action Interface] 
[27/01/2009 12:02:01] data/actions/scripts/demonoak/demonoak.lua:onUse

[27/01/2009 12:02:01] luaDoSummonCreature(). Can not summon monster: Crypt Shambler

[27/01/2009 12:02:01] Lua Script Error: [Action Interface] 
[27/01/2009 12:02:01] data/actions/scripts/demonoak/demonoak.lua:onUse

[27/01/2009 12:02:01] luaDoSummonCreature(). Can not summon monster: Crypt Shambler

Hmm?

One question more. Do you have GG?
 
Okay, didn't noticed that. Thought that you just copied mine parameters.
 
Actually it's one of the best scripts for demon oak fight. But still had to remake it :p
 
Back
Top Bottom