Ir para conteúdo

Featured Replies

Postado

Oh, i gonna try, wait, i edit here and explain for u

 

edit, @noktuno

 

TAGS in actions.xml

<action itemid="PORTALID HERE" script="townportalsystem.lua" />
<action itemid="SCROLLID HERE" script="townportalsystem.lua"/>

 

Archive townportalsystem.lua in actions/scripts/

-- Town Portal Scroll System based in Dota 2
-- by Nazo (tibiaking.com)

local config = {
	portalId = 1231,		-- change to portal item id
	portalTime = 30,		-- portal duration in seconds
	scrollId = 1232,		-- change to scroll item id
	effect = CONST_ME_POFF	-- effect id or CONST that appears at the end of time
}

local function removePortal(portal)
	portal:remove()
	portal:getPosition():sendMagicEffect(config.effect)
end

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
	if(item:getId()==config.scrollId) then
		portal = Game.createItem(config.portalId, 1, player:getPosition())
		if(player:getParty()) then
			portal:setCustomAttribute("party", player:getParty())
		else
			portal:setCustomAttribute("owner", player:getName())
		end
		addEvent(removePortal, config.portalTime * 1000, portal)
		item:remove()
	else
		if(not player:isPzLocked()) then
			if(item:getCustomAttribute("party")) then
				if(player:getParty()==item:getCustomAttribute("party")) then
					player:teleportTo(player:getTown():getTemplePosition(), true)
				else
					player:popupFYI("You do not participate in the portal creator's party.")
				end
			elseif(item:getCustomAttribute("name") and player:getName() == item:getCustomAttribute("name")) then
				player:teleportTo(player:getTown():getTemplePosition(), true)
			else
				player:popupFYI("You isn't the owner.")
			end
		else
			player:popupFYI("You are PZ locked.")
		end
	end
	return true
end

 

besides fixing the lack of pz locked, I fixed a bug without party, and only the portal's owner can use this.

Editado por Nazo
because I want!? (veja o histórico de edições)

  • Respostas 8
  • Visualizações 765
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Hi, 'meu chapa' :rofl: test this, @noktuno:   -- Town Portal Scroll System based in Dota 2 -- by Nazo (tibiaking.com) local config = { portalId = 1231, -- change to portal item id portalTime

  • Oh, i gonna try, wait, i edit here and explain for u   edit, @noktuno   TAGS in actions.xml <action itemid="PORTALID HERE" script="townportalsystem.lua" /> <action ite

  • I love u dude im trying this at night

Posted Images

Postado

Yeah, now are perfectly :p

-- Town Portal Scroll System based in Dota 2
-- by Nazo (tibiaking.com)

local config = {
	portalId = 1231,		-- change to portal item id
	portalTime = 30,		-- portal duration in seconds
	scrollId = 1232,		-- change to scroll item id
	effect = CONST_ME_POFF	-- effect id or CONST that appears at the end of time
}

local function removePortal(portal)
	portal:remove()
	portal:getPosition():sendMagicEffect(config.effect)
end

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
	if(item:getId()==config.scrollId) then
		portal = Game.createItem(config.portalId, 1, player:getPosition())
		if(player:getParty()) then
			portal:setCustomAttribute("party", player:getParty())
		else
			portal:setCustomAttribute("owner", player:getName())
		end
		addEvent(removePortal, config.portalTime * 1000, portal)
		item:remove()
	else
		if(not player:isPzLocked() and not player:getCondition(CONDITION_INFIGHT, CONDITIONID_DEFAULT)) then
			if(item:getCustomAttribute("party")) then
				if(player:getParty()==item:getCustomAttribute("party")) then
					player:teleportTo(player:getTown():getTemplePosition(), true)
				else
					player:popupFYI("You do not participate in the portal creator's party.")
				end
			elseif(item:getCustomAttribute("name") and player:getName() == item:getCustomAttribute("name")) then
				player:teleportTo(player:getTown():getTemplePosition(), true)
			else
				player:popupFYI("You isn't the owner.")
			end
		else
			player:popupFYI("You are PZ locked or in battle.")
		end
	end
	return true
end

 

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo