- 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.
actions.xml
Ok.
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.