Zonet
Web Developer
This is a very nice and short annih script!
It's not by me the credits goes 100% to dalkon!
Here is it!
In data/action/scripts make new file name it annihilator
[/SIZE]
Put this in data/action/action.xml
Thanks and again credits to Dalkon
It's not by me the credits goes 100% to dalkon!
Here is it!
In data/action/scripts make new file name it annihilator
Code:
[SIZE="2"]
function onUse(cid, item, frompos, item2, topos)
if item.uid == 5000 and item.itemid == 1945 then
leverPos = getThingPos(item.uid)
players = {}
for i = 1,4 do
if isPlayer(getThingfromPos({x=leverPos.x-i, y=leverPos.y, z=leverPos.z, stackpos=253}).uid) == TRUE then table.insert(players, getThingfromPos({x=leverPos.x-i, y=leverPos.y, z=leverPos.z, stackpos=253}).uid) end
end
if #players < 4 then doPlayerSendCancel(cid, "You need four players for this quest.") return 1 end
for i = 1,4 do
if getPlayerLevel(players[i]) < 100 then doPlayerSendCancel(cid, "You need four players that is over level 100 for this quest.") return 1 end
if getPlayerStorageValue(players[i], 5000) ~= -1 then doPlayerSendCancel(cid, "Someone has already done this quest.") return 1 end
pos = {x=700-i+1, y=702, z=13}
doSendMagicEffect(getThingPos(players[i]), 2)
doTeleportThing(players[i], pos--[[, FALSE]])
doSendMagicEffect(getThingPos(players[i]), 12)
if i == 1 then
demonPositions = { {x=pos.x+1, y=pos.y, z=pos.z}, {x=pos.x+2, y=pos.y, z=pos.z}, {x=pos.x, y=pos.y+2, z=pos.z}, {x=pos.x-1, y=pos.y-2, z=pos.z}, {x=pos.x-2, y=pos.y+2, z=pos.z}, {x=pos.x-3, y=pos.y-2, z=pos.z} }
for j = 1,#demonPositions do
doSummonCreature("Demon", demonPositions[j])
end
end
end
doTransformItem(item.uid, item.itemid+1)
elseif item.uid == 5000 and item.itemid == 1946 then
doTransformItem(item.uid, item.itemid-1)
elseif item.uid == 5001 or item.uid == 5002 or item.uid == 5003 or item.uid == 5004 then
if getPlayerStorageValue(cid, 5000) ~= -1 then doPlayerSendTextMessage(cid, 24, "It is empty.") return 1 end
if item.uid == 5001 then
doPlayerSendTextMessage(cid, 24, "You have found a demon armor.")
doPlayerAddItem(cid, 2494, 1)
elseif item.uid == 5002 then
doPlayerSendTextMessage(cid, 24, "You have found a magic sword.")
doPlayerAddItem(cid, 2400, 1)
elseif item.uid == 5003 then
doPlayerSendTextMessage(cid, 24, "You have found a stonecutter axe.")
doPlayerAddItem(cid, 2431, 1)
elseif item.uid == 5004 then
doPlayerSendTextMessage(cid, 24, "You have found an annihilation bear.")
doPlayerAddItem(cid, 2326, 1)
end
setPlayerStorageValue(cid, 5000, 1)
end
return 1
end
Put this in data/action/action.xml
Code:
[SIZE="2"]<action fromuid="5000" touid="5004" script="annihilator.lua" />[/SIZE]
Thanks and again credits to Dalkon