Guys,
I'm having a problem in Elemental Spheres Quest... Let's get to the point...
: When I use the Obsidian Knigt on The Lord Of Elements in order to get the item Neutral Matter nothing happend...
elemental machine.lua
switch.lua
soil.lua
I'm having a problem in Elemental Spheres Quest... Let's get to the point...
: When I use the Obsidian Knigt on The Lord Of Elements in order to get the item Neutral Matter nothing happend...
elemental machine.lua
Code:
local aids = {
[4129] = {voc = 5, item = 8304, pos = {x = 33263, y = 31810, z = 12}},
[4130] = {voc = 6, item = 8305, pos = {x = 33263, y = 31860, z = 12}},
[4131] = {voc = 7, item = 8300, pos = {x = 33292, y = 31831, z = 12}},
[4132] = {voc = 8, item = 8306, pos = {x = 33243, y = 31831, z = 12}},
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local p = Player(cid)
local tab = aids[itemEx.actionid]
local voc = p:getVocation():getId()
if not tab or tab.voc ~= voc or tab.item ~= item.itemid or not isInArray({7913, 7914, 7911, 7912}, itemEx.itemid) then
return false
end
local p = tab.pos
if voc == 5 or voc == 6 then
local p = tab.pos
local machine1 = Tile(p):getItemById(7913)
machine1:transform(8896)
local machine2 = Tile({x = p.x, y = p.y + 1, z = p.z}):getItemById(7914)
machine2:transform(8897)
else
local p = tab.pos
local machine1 = Tile(p):getItemById(7912)
machine1:transform(8895)
local machine2 = Tile({x = p.x - 1, y = p.y, z = p.z}):getItemById(7911)
machine2:transform(8894)
end
toPosition:sendMagicEffect(12)
Item(item.uid):remove(1)
return true
end
switch.lua
Code:
local positions = {
[5] = {pos = {old = {x = 33268, y = 31833, z = 10}, new = {x = 33272, y = 31831, z = 12}}, itemid = 8304}, -- Sorcerer
[6] = {pos = {old = {x = 33268, y = 31838, z = 10}, new = {x = 33263, y = 31840, z = 12}}, itemid = 8305}, -- Druid
[7] = {pos = {old = {x = 33270, y = 31835, z = 10}, new = {x = 33263, y = 31831, z = 12}}, itemid = 8300}, -- Paladin
[8] = {pos = {old = {x = 33266, y = 31835, z = 10}, new = {x = 33263, y = 31831, z = 12}}, itemid = 8306}, -- Knight
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local p = Player(cid)
if Tile({x = 33269, y = 31837, z = 12}):getItemById(5071) then
--if getTileItemById({x = 33269, y = 31837, z = 12}, 5071).uid > 100 then
return true
end
for vocation, info in pairs(positions) do
local pid = Tile(info.pos.old):getTopCreature()
if not pid or not pid:isPlayer() or pid:getVocation() ~= vocation or pid:getItemCount(info.itemid) < 1 then
p:say("You need one player of each vocation having completed the Elemental Spheres quest and also carrying the elemental rare item.", TALKTYPE_MONSTER_SAY)
return true
end
end
if #getCreaturesInArea({x = 33241, y = 31815, z = 12}, {x = 33300, y = 31874, z = 12}, true) > 0 then
p:say("A team is facing Lord of the Elements.", TALKTYPE_MONSTER_SAY)
return true
end
for _, v in pairs(positions) do
local pid = Tile(v.pos.old):getTopCreature()
pid:getPosition():sendMagicEffect()
pid:teleportTo(v.pos.new)
Game.createMonster("Lord Of The Elements", {x = 33270, y = 31845, z = 12})
pid:getPosition():sendMagicEffect(10)
end
return false
end
soil.lua
Code:
local aids = {
[4120] = {used_id = 8299, target_id = 8573, effect = 3, transform_id = 8575, create_id = 0, sto = 40064}, -- Sorcerer
[4121] = {used_id = 8303, target_id = 8567, effect = 29, transform_id = 0, create_id = 1491, sto = 40065}, -- Knight
[4122] = {used_id = 8302, target_id = 8571, effect = 29, transform_id = 8574, create_id = 0, sto = 40066}, -- Paladin
[4123] = {used_id = 8298, target_id = 8572, effect = 29, transform_id = 8576, create_id = 0, sto = 40067}, -- Druids
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local soil = aids[itemEx.actionid]
if soil and item.itemid == soil.used_id and itemEx.itemid == soil.target_id then
if soil.create_id ~= 0 then
Game.createItem(soil.create_id, 1, toPosition)
addEvent(function()
Tile(toPosition):getItemById(soil.create_id):remove(1)
--doRemoveItem(getTileItemById(toPosition, create_id).uid, 1)
end, 30000)
else
addEvent(function(aid)
Tile(toPosition):getItemById(soil.transform_id):transform(aid)
--doTransformItem(getTileItemById(toPosition, soil.transform_id).uid, aid)
end, 30000, itemEx.itemid)
Item(itemEx.uid):transform(soil.transform_id)
--doTransformItem(itemEx.uid, soil.transform_id)
Item(item.uid):remove(1)
--doRemoveItem(item.uid, 1)
end
fromPosition:sendDistanceEffect(toPosition, soil.effect)
--doSendDistanceShoot(fromPosition, toPosition, soil.effect)
Item(item.uid):remove(1)
return true
end
return false
end