• 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!

Action Very short annih!

Zonet

Web Developer
Joined
Sep 1, 2008
Messages
4,393
Reaction score
52
Location
Tibia VS RL-life, guess whos back?
This is a very nice and short annih script!
It's not by me the credits goes 100% to dalkon!

Here is it!


:DIn 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
[/SIZE]

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
 
where u need to set ur preposites?

I guess you mean positions... Well, they'll teleport the players to a lower level I guess (didn't look at the script), and this is why I dislike this script, it's totally not configureable ;p
 
This script doesn't work properly, if there are four players but one of them (the player behind the player who is at the front) is below level 100. Only the player in the front will be teleported, or if player who is third in line is below Level 100, then the two first players will only be teleported (not fourth). The script could be optimized a bit too.
 
i have to agree with colandus, if you want to use a really good anni, deffinatly just stick with grizmos from ot fans its the best ive seen so far :)
 
Back
Top