• 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 [Finished] Annihaltor / Annihaltor chests TFS 0.3.4

Shawak

Intermediate OT User
Joined
Sep 11, 2008
Messages
1,984
Solutions
2
Reaction score
119
Location
Germany
GitHub
Shawak
Here a usefully annihaltor script.


Credits:

100% by me

Version:
TFS 0.3.4

Annihaltor

data/actions/scrips/annihaltor.lua
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)

	-- Annihaltor by Maxi (Shawak) v1.0

	local room = {     -- room with demons
	fromX = 1100,
	fromY = 1192,
	fromZ = 10,
	toX = 1105,
	toY = 1196,
	toZ = 10
	}

	local monster_pos = {        
	[1] = {pos = {1100,1192,10}},
	[2] = {pos = {1102,1192,10}},
	[3] = {pos = {1101,1196,10}},
	[4] = {pos = {1103,1196,10}},
	[5] = {pos = {1104,1194,10}},
	[6] = {pos = {1105,1194,10}}
	}

	local players_pos = {
	{x = 1101,y = 1195,z = 7,stackpos = 253},
	{x = 1101,y = 1194,z = 7,stackpos = 253},
	{x = 1101,y = 1193,z = 7,stackpos = 253},
	{x = 1101,y = 1192,z = 7,stackpos = 253}
	}

	local new_player_pos = {
	{x = 1100, y = 1194, z = 10},
	{x = 1101, y = 1194, z = 10},
	{x = 1102, y = 1194, z = 10},
	{x = 1103, y = 1194, z = 10}
	}

	local monster = "Demon"
	local questLevel = 100


	-- don't touch ------------
	local player = {0, 0, 0, 0}
	local all_ready = 0
	---------------------------

	local player1 = getThingfromPos(players_pos[1])
	local player2 = getThingfromPos(players_pos[2])
	local player3 = getThingfromPos(players_pos[3])
	local player4 = getThingfromPos(players_pos[4])

	if item.itemid == 1945 then
		if player1.itemid > 0 and player2.itemid > 0 and player3.itemid > 0 and player4.itemid > 0 then
			for i = 1, 4 do
				player[i] = getThingfromPos(players_pos[i])
				if player[i].itemid > 0 then
					all_ready = 1
				end
			end
		else	
		doPlayerSendTextMessage(cid,19,"You need 4 players to do this quest.")
		end
		if all_ready == 1 then
			for _, area in pairs(monster_pos) do
				doSummonCreature(monster,{x=area.pos[1],y=area.pos[2],z=area.pos[3]}) 
			end
			for i = 1, 4 do
				doSendMagicEffect(players_pos[i], CONST_ME_POFF)
				doTeleportThing(player[i].uid, new_player_pos[i], FALSE)
				doSendMagicEffect(new_player_pos[i], CONST_ME_ENERGYAREA)
				all_ready = 0
			end
			doTransformItem(item.uid,1946)
		end
	elseif item.itemid == 1946 then
		local player_room = 0
		for x = room.fromX, room.toX do
			for y = room.fromY, room.toY do
				for z = room.fromZ, room.toZ do
					local pos = {x=x, y=y, z=z,stackpos = 253}
					local thing = getThingfromPos(pos)
					if thing.itemid > 0 then 
						if isPlayer(thing.uid) == TRUE then
							player_room = player_room+1
						end
					end
				end
			end
		end
		if player_room >= 1 then
			doPlayerSendTextMessage(cid,19,"There is already a team in the quest room.")		
		elseif player_room == 0 then
			for x = room.fromX, room.toX do
				for y = room.fromY, room.toY do
					for z = room.fromZ, room.toZ do
						local pos = {x=x, y=y, z=z,stackpos = 253}
						local thing = getThingfromPos(pos)
						if thing.itemid > 0 then 
							doRemoveCreature(thing.uid)
						end
					end
				end
			end
			player_room = 0
			doTransformItem(item.uid,1945)
		end
	end
	return TRUE
end

data/actions/actions.xml
HTML:
	<action uniqueid="30015" event="script" value="annihilator.lua"/>

Annihaltor Chests

data/actions/scripts/anni chest.lua

Code:
--[[
	Annihaltor Chest's	
	by Maxi (Shawak)
]]--

	config = {
		storage = 5010,
		items = { --     id,count
			item_1 = {2494,1},  -- Demon Armor 
			item_2 = {2400,1},  -- Magic Sword
			item_3 = {2431,1},  -- Stonecutter Axe
			item_4 = {2421,1}   -- Thunder Hammer
		}
	}

function onUse(cid, item, frompos, item2, topos)

   	if getPlayerStorageValue(cid,config.storage) == -1 then
   		if item.uid == 5001 then
			newItem = config.items.item_1[1]
			count = config.items.item_1[2]
   		elseif item.uid == 5002 then
			newItem = config.items.item_2[1]
			count = config.items.item_2[2]
   		elseif item.uid == 5003 then
			newItem = config.items.item_3[1]
			count = config.items.item_3[2]
   		elseif item.uid == 5004 then
			newItem = config.items.item_4[1]
			count = config.items.item_4[2]
		end

		-- MSG  Config -----------------------------------------------------------------------------------------------------------------
		msgEmpty = "It is empty."
		msgGetItem = "You have found "..getItemArticleById(newItem).." "..getItemNameById(newItem).."."
		msgNoCap = "You have found a "..getItemNameById(newItem).." weighing "..getItemWeightById(newItem,count).." oz it is too heavy."
		--------------------------------------------------------------------------------------------------------------------------------

		if getPlayerFreeCap(cid) >= getItemWeightById(newItem,count) then
   			setPlayerStorageValue(cid,config.storage,1)
   			doPlayerAddItem(cid,newItem,count)
   			doPlayerSendTextMessage(cid,21,msgGetItem)
		else
			doPlayerSendTextMessage(cid,21,msgNoCap)
		end
   	else
   		doPlayerSendTextMessage(cid,21,msgEmpty)
   	end
   	return TRUE
end

data/actions/actions.xml
HTML:
	<!-- Anni Chest -->
	<action uniqueid="5001" event="script" value="anni chest.lua"/>
	<action uniqueid="5002" event="script" value="anni chest.lua"/>
	<action uniqueid="5003" event="script" value="anni chest.lua"/>
	<action uniqueid="5004" event="script" value="anni chest.lua"/>

Tested on TFS 0.3.4

Enjoy ^_^

Regards,
Shawak
 
Last edited:
You just need to add the unique ids of the chest in your map

Code:
<!-- Anni Chest -->
	<action uniqueid="5001" event="script" value="anni chest.lua"/>
	<action uniqueid="5002" event="script" value="anni chest.lua"/>
	<action uniqueid="5003" event="script" value="anni chest.lua"/>
	<action uniqueid="5004" event="script" value="anni chest.lua"/>

Also edit the monster and players coordinates and that's it :)
 
in the annihaltor script, should it be a action id 30015 somewhere? or should i just put that on the lever?
 
ur is not real one...

mine real one's chests

PHP:
function onUse(cid, item, frompos, item2, topos)

if item.uid == 4001 then

queststatus = getPlayerStorageValue(cid,100)

if queststatus == -1 then

 doPlayerSendTextMessage(cid,22,"Znalazles Demoniczna Zbroje.")

 doPlayerAddItem(cid,2494,1)

 setPlayerStorageValue(cid,100,1)
 setPlayerStorageValue(cid,101,1)
else

 doPlayerSendTextMessage(cid,22,"Chcialbys jeszcze?")
 setPlayerStorageValue(cid,101,1)
end

elseif item.uid == 4002 then

queststatus = getPlayerStorageValue(cid,100)

if queststatus ~= 1 then

 doPlayerSendTextMessage(cid,22,"Znalazles Magiczny Miecz.")

 doPlayerAddItem(cid,2400,1)

 setPlayerStorageValue(cid,100,1)
 setPlayerStorageValue(cid,101,1)
else

 doPlayerSendTextMessage(cid,22,"Chcialbys jeszcze?")
 setPlayerStorageValue(cid,101,1)
end

elseif item.uid == 4003 then

queststatus = getPlayerStorageValue(cid,100)

if queststatus ~= 1 then

 doPlayerSendTextMessage(cid,22,"Znalazles Lupacz Kamieni")

 doPlayerAddItem(cid,2431,100)

 setPlayerStorageValue(cid,100,1)
 setPlayerStorageValue(cid,101,1)
else

 doPlayerSendTextMessage(cid,22,"Chcialbys jeszcze?")
 setPlayerStorageValue(cid,101,1)
end

elseif item.uid == 4004 then

queststatus = getPlayerStorageValue(cid,100)

if queststatus ~= 1 then

 doPlayerSendTextMessage(cid,22,"Znalazles Prezent.")

 	reward = doCreateItemEx(1990,1)
	doAddContainerItem(reward, 2326, 1)

		local additem = doPlayerAddItemEx(cid, reward, 0)
		if additem == RETURNVALUE_NOERROR then
		setPlayerStorageValue(cid,100,1)
		else
			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'Nie masz dosc miejsca w backpacku lub udzwigu, aby uniesc ten przedmiot.')
		end

 
 setPlayerStorageValue(cid,101,1)
else

 doPlayerSendTextMessage(cid,22,"Chcialbys jeszcze?")
 setPlayerStorageValue(cid,101,1)
end

end

return 1

end
 
My chects are exact the real chests.
Put the id 30015 on lever and set the positions,
after using 1 time, it will automaticly remove the old demons, and summon new ones.

Regards,
Shawak
 
Last edited:
@up if it would be changed then you will get only anililahor bear. Just item. not box with item inside ;)

QuaS~
 
It is not like, i am looking for a hole into good thing. i think i wouldn't script it as you (using this fuc**ng thing in [],) cuz i can't YET xD


Ur script is great ;) Rep ++

QuaS~
 
This has present box with teddy bear in it.
Download: Here

Thought it might come in handy :p
 
Back
Top