Ir para conteúdo

Posts Recomendados

Po, to precisando de uma alavanca da Aannihi, alguem manda ae pelo amor?

 

Tipo do script: Action

Protocolo (versão do Tibia):Tibia 8.54

Servidor utilizado: TFS 0.3.6

Nível de experiência: medio

Adicionais/Informações: aeaeaeae

Link para o comentário
https://xtibia.com/forum/topic/146710-alavanca-annihi/
Compartilhar em outros sites

aew man eu nao sou muito bom de intender scripts, sou apenas um curioso futucador, entao vou te mandar os scripts da minha anihi:

 

Server: Real Server 3.1 by doidin e real team!

Protocolo: 8.60

versao do console: 0.3.6

 

vamus la em actions.xml acrecente isso:

 

<!-- Anihilator Quest -->
<action actionid="5006" script="anni/chest.lua" />
<action actionid="5007" script="anni/chest.lua" />
<action actionid="5008" script="anni/chest.lua" />
<action actionid="5009" script="anni/chest.lua" />
<action actionid="7000" script="anni/annichest.lua"/>

 

agora vamus aos scripts:

 

annichest.lua

 

   	local room = { 	-- room with demons
   	fromX = 33229,
   	fromY = 31697,
   	fromZ = 14,

   	toX = 33224,
   	toY = 31697,
   	toZ = 14
   	}

   	local monster_pos = {
   	[1] = {pos = {33224, 31695, 14}, monster = "Demon"},
   	[2] = {pos = {33226, 31695, 14}, monster = "Demon"},
   	[3] = {pos = {33228, 31697, 14}, monster = "Demon"},
   	[4] = {pos = {33229, 31697, 14}, monster = "Demon"},
   	[5] = {pos = {33227, 31699, 14}, monster = "Demon"},
   	[6] = {pos = {33225, 31699, 14}, monster = "Demon"}
   	}

   	local players_pos = {
   	{x = 33224, y =31671, z = 13, stackpos = 253},
   	{x = 33223, y =31671, z = 13, stackpos = 253},
   	{x = 33222, y =31671, z = 13, stackpos = 253},
   	{x = 33221, y =31671, z = 13, stackpos = 253}
   	}

   	local new_player_pos = {
   	{x = 33227, y = 31697, z = 14},
   	{x = 33226, y = 31697, z = 14},
   	{x = 33225, y = 31697, z = 14},
   	{x = 33224, y = 31697, z = 14}
   	}

   	local playersOnly = "no"
   	local questLevel = 101

function onUse(cid, item, fromPosition, itemEx, toPosition)
   	local all_ready, monsters, player, level = 0, 0, {}, 0
   	if item.itemid == 1945 then
           	for i = 1, #players_pos do
                   	table.insert(player, 0)
           	end
           	for i = 1, #players_pos do
                   	player[i] = getThingfromPos(players_pos[i])
                   	if player[i].itemid > 0 then
                           	if string.lower(playersOnly) == "yes" then
                                   	if isPlayer(player[i].uid) == TRUE then
                                           	all_ready = all_ready+1
                                   	else
                                           	monsters = monsters+1
                                   	end
                           	else
                                   	all_ready = all_ready+1
                           	end
                   	end
           	end
           	if all_ready == #players_pos then
                   	for i = 1, #players_pos do
                           	player[i] = getThingfromPos(players_pos[i])
                           	if isPlayer(player[i].uid) == TRUE then
                                   	if getPlayerLevel(player[i].uid) >= questLevel then
                                           	level = level+1
                                   	end
                           	else
                                   	level = level+1
                           	end
                   	end
                   	if level == #players_pos then
                           	if string.lower(playersOnly) == "yes" and monsters == 0 or string.lower(playersOnly) == "no" then
                                   	for _, area in pairs(monster_pos) do
                                                   	doSummonCreature(area.monster,{x=area.pos[1],y=area.pos[2],z=area.pos[3]})
                                   	end
                                   	for i = 1, #players_pos 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)
                                           	doTransformItem(item.uid,1946)
                                   	end
                           	else
                                   	doPlayerSendTextMessage(cid,19,"Only players can do this quest.")
                           	end
                   	else
                           	doPlayerSendTextMessage(cid,19,"All Players have to be level "..questLevel.." to do this quest.")
                   	end
           	else
                   	doPlayerSendTextMessage(cid,19,"You need "..table.getn(players_pos).." players to do this quest.")
           	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
                   	doTransformItem(item.uid,1945)
           	end
   	end
   	return TRUE
end

 

chest.lua

 

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

  	if item.uid == 5006 then
  		queststatus = getPlayerStorageValue(cid,5010)
  		if queststatus == -1 then
  			doPlayerSendTextMessage(cid,22,"You have found a Demon Armor.")
  			doPlayerAddItem(cid,2494,1)
  			setPlayerStorageValue(cid,5010,1)
  		else
  			doPlayerSendTextMessage(cid,22,"It is empty.")
  		end
  	elseif item.uid == 5007 then
  		queststatus = getPlayerStorageValue(cid,5010)
  		if queststatus == -1 then
  			doPlayerSendTextMessage(cid,22,"You have found a Magic Sword.")
  			doPlayerAddItem(cid,2400,1)
  			setPlayerStorageValue(cid,5010,1)
  		else
  			doPlayerSendTextMessage(cid,22,"It is empty.")
  		end
  	elseif item.uid == 5008 then
  		queststatus = getPlayerStorageValue(cid,5010)
  		if queststatus == -1 then
  			doPlayerSendTextMessage(cid,22,"You have found a Stonecutter Axe.")
  			doPlayerAddItem(cid,2431,1)
  			setPlayerStorageValue(cid,5010,1)
  		else
  			doPlayerSendTextMessage(cid,22,"It is empty.")
  		end
  	elseif item.uid == 5009 then
  		queststatus = getPlayerStorageValue(cid,5010)
  		if queststatus == -1 then
  			doPlayerSendTextMessage(cid,22,"You have found a Thunder Hammer.")
  			doPlayerAddItem(cid,2421,1)
  			setPlayerStorageValue(cid,5010,1)
  		else
  			doPlayerSendTextMessage(cid,22,"It is empty.")
  		end
else
	return 0
  	end

  	return 1
end

 

bem nao explicarei pois como ja disse eu sou apenas futucador e aprendiz de scripts eu so recomento mudar a gosto as ids das action, storages e posiçoes de cada sumon a gosto!

 

espero te de alguma forma ajudado!

 

fuiz!

Link para o comentário
https://xtibia.com/forum/topic/146710-alavanca-annihi/#findComment-973679
Compartilhar em outros sites

×
×
  • Criar Novo...