Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Buenas, TK!

Um mano gringo aí pediu algo do tipo, e eu precisava me familiarizar melhor com a orientação a objetos usada em Lua do TFS 1.3, então fiz esse action, onde o player que possui um scroll pode fazer um portal para seu templo, que é usado dando USE mesmo, e sua party inteira pode ir junto para seus respectivos templos se não estiverem pz locked ou com battle, e caso o player não esteja em uma party, apenas o mesmo pode entrar no portal.

 

Tags XML:

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

 

Arquivo townportalsystem.lua em 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)
    if(portal)
		portal:remove()
		portal:getPosition():sendMagicEffect(config.effect)
    else
		print("Admin excluiu o portal, parabéns")
    end
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

 

Programador PHP, Lua, Java, database administrator.

 

"Nada é verdade, tudo é permitido."

Requiescat in pace.

Link para o post
Compartilhar em outros sites

Parabéns, seu tópico de conteúdo foi aprovado!
Muito obrigado pela sua contribuição, nós do Tibia King agradecemos.
Seu conteúdo com certeza ajudará à muitos outros, você recebeu +1 REP.

Spoiler

Congratulations, your content has been approved!
Thank you for your contribution, we of Tibia King we are grateful.
Your content will help many other users, you received +1 REP.

 

ichigo.gif
https://github.com/Cjaker/

  , _ ,
 ( o o )
/'` ' `'\                     ESTOU TE OBSERVANDO O_O
|'''''''|
|\\'''//|
   """

 

Link para o post
Compartilhar em outros sites

Coloca uma verificação na função removePortal para verificar se existe o userdata do item no qual foi enviado no parâmetro. Evita possíveis bugs, e crashs.

discord.pngDiscord: vankk #7765

Precisando de ajuda? Entre em contato comigo via Discord.

 

Muitos vêm seus muitos dias de glória, mas poucos vêm seus muitos dias de luta.

Link para o post
Compartilhar em outros sites
7 minutos atrás, vankk disse:

Coloca uma verificação na função removePortal para verificar se existe o userdata do item no qual foi enviado no parâmetro. Evita possíveis bugs, e crashs.

Evita que dê algum bug caso o admin de muita inteligência dar /r no portal, mas como você tá acostumado habituado com tal tipo de erros, tá feito <3 

Programador PHP, Lua, Java, database administrator.

 

"Nada é verdade, tudo é permitido."

Requiescat in pace.

Link para o post
Compartilhar em outros sites
5 horas atrás, noktuno disse:

Im mexican!  Nice script btw

Haha, gringo = is a different country u.u

Editado por Nazo (veja o histórico de edições)

Programador PHP, Lua, Java, database administrator.

 

"Nada é verdade, tudo é permitido."

Requiescat in pace.

Link para o post
Compartilhar em outros sites
Agora, noktuno disse:

Learning Br with @Nazo, es muy parecido al español.

 

Yo se, haha

Programador PHP, Lua, Java, database administrator.

 

"Nada é verdade, tudo é permitido."

Requiescat in pace.

Link para o post
Compartilhar em outros sites
  • 1 year later...

Olá, bom dia a todos!

 

Coloquei a script exatamente como está aqui, apenas coloquei o ID do portal e o ID do item na script, quando abri o console já deu este erro. E ao usar o item, (de se esperar por causa do erro), não funcionou.

image.thumb.png.396951443a859f8f7b2aa9fa36d869fa.png

 

Eu uso TFS 1.3

image.thumb.png.781b6fee74bdfedbdd94410ccaf963b0.png

 

Valeu clan!

Editado por Trayron1 (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
-- Town Portal Scroll System based in Dota 2
-- by Nazo (tibiaking.com)

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

local function removePortal(portal)
    if(portal)
		portal:remove()
		portal:getPosition():sendMagicEffect(config.effect)
    else
		print("The portal has been undone.")
    end
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
	<action itemid="11796" script="other/townportalsystem.lua"/>
	<action itemid="14324" script="other/townportalsystem.lua"/>	

 

Editado por Trayron1 (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
-- Town Portal Scroll System based in Dota 2
-- by Nazo (tibiaking.com)

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

local function removePortal(portal)
    if portal then
		portal:remove()
		portal:getPosition():sendMagicEffect(config.effect)
    else
		print("The portal has been undone.")
    end
end

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
	if item:getId() == config.scrollId then
		local 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

 

Link para o post
Compartilhar em outros sites
2 horas atrás, luanluciano93 disse:

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

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

local function removePortal(portal)
    if portal then
		portal:remove()
		portal:getPosition():sendMagicEffect(config.effect)
    else
		print("The portal has been undone.")
    end
end

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
	if item:getId() == config.scrollId then
		local 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

 

 

Copiei e colei a sua, mas no console deu este erro agora:

image.thumb.png.50ad3128dd88096eb353f4c4ec0678e7.png

Link para o post
Compartilhar em outros sites
-- Town Portal Scroll System based in Dota 2
-- by Nazo (tibiaking.com)

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

local function removePortal(portal)
    if portal then
		portal:remove()
		portal:getPosition():sendMagicEffect(config.effect)
    else
		print("The portal has been undone.")
    end
end

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
	if item:getId() == config.scrollId then
		local 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

 

Link para o post
Compartilhar em outros sites

Boa tarde nobre sayajin.

 

Ainda sigo com erro.

Assim que dei use no item pra abrir o portal, deu este erro:

image.thumb.png.533ddfe0bb658b6f27ab61222f9b293d.png

 

Alguns segundos depois, acredito que após os 30 segundos para o portal sumir, deu este erro também e o portal não sumiu.

image.thumb.png.30786ab4fc6680c70100680f3b5f9bc0.png

 

Obrigado por toda ajuda!

Link para o post
Compartilhar em outros sites
-- Town Portal Scroll System based in Dota 2

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

local function checkPortal(uid, pos)
    local position = Position(pos)
	if position then
		local tile = Tile(position)
		if tile then
		local item = tile:getItemById(config.portalId)
		if item then
			item:remove()
			item:getPosition():sendMagicEffect(config.effect)
		else
			local playerId = Player(uid)
			if playerId then
				local portal = Game.createItem(config.portalId, 1, position)
				if portal then
					if playerId:getParty() then
						portal:setCustomAttribute("party", playerId:getParty())
					else
						portal:setCustomAttribute("owner", playerId:getName())
					end
				end
				addEvent(checkPortal, config.portalTime * 1000, uid, pos)
			end
		end
	end
end

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
	if item:getId() == config.scrollId then
		checkPortal(player:getGuid(), player:getPosition())
	else
		if not player:isPzLocked() and not player:getCondition(CONDITION_INFIGHT, CONDITIONID_DEFAULT) then
			local itemParty = item:getCustomAttribute("party")
			local itemName = item:getCustomAttribute("name")
			if itemParty then
				if player:getParty() == itemParty or then
					player:teleportTo(player:getTown():getTemplePosition(), true)
				else
					player:popupFYI("You do not participate in the portal creator's party.")
				end
			elseif itemName then
				if player:getName() == itemName then
					player:teleportTo(player:getTown():getTemplePosition(), true)
				else
					player:popupFYI("You isn't the owner.")
				end
			else
				player:popupFYI("You isn't the owner.")
			end
		else
			player:popupFYI("You are PZ locked or in battle.")
		end
	end
	return true
end

 

Link para o post
Compartilhar em outros sites
-- Town Portal Scroll System based in Dota 2

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

local function checkPortal(uid, pos)
    local position = Position(pos)
	if position then
		local tile = Tile(position)
		if tile then
		local item = tile:getItemById(config.portalId)
		if item then
			item:remove()
			item:getPosition():sendMagicEffect(config.effect)
		else
			local playerId = Player(uid)
			if playerId then
				local portal = Game.createItem(config.portalId, 1, position)
				if portal then
					if playerId:getParty() then
						portal:setCustomAttribute("party", playerId:getParty())
					else
						portal:setCustomAttribute("owner", playerId:getName())
					end
				end
				addEvent(checkPortal, config.portalTime * 1000, uid, pos)
			end
		end
	end
end

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
	if item:getId() == config.scrollId then
		checkPortal(player:getGuid(), player:getPosition())
	else
		if not player:isPzLocked() and not player:getCondition(CONDITION_INFIGHT, CONDITIONID_DEFAULT) then
			local itemParty = item:getCustomAttribute("party")
			local itemName = item:getCustomAttribute("name")
			if itemParty then
				if player:getParty() == itemParty then
					player:teleportTo(player:getTown():getTemplePosition(), true)
				else
					player:popupFYI("You do not participate in the portal creator's party.")
				end
			elseif itemName then
				if player:getName() == itemName then
					player:teleportTo(player:getTown():getTemplePosition(), true)
				else
					player:popupFYI("You isn't the owner.")
				end
			else
				player:popupFYI("You isn't the owner.")
			end
		else
			player:popupFYI("You are PZ locked or in battle.")
		end
	end
	return true
end

 

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.


  • Conteúdo Similar

    • Por Bagon
      Bom, hoje venho trazer á vocês um sistema de Pet System DIFERENCIADO de alguns presentes no fórum. Este sistema tem diversos comandos diferenciados, como: 
       
      !pet nomedopet este comando irá sumonar o pet. 
      !remove irá remover o pet.
      !fale eu sou lindo o pet falará "eu sou lindo"
      !conversar o pet irá conversar com vc. 
       
      Então sem mais delongas vamos ao script.
       
      OBS: SCRIPT TESTADO SOMENTE EM TFS 0.4/0.3, e este script foi feito com a intenção de ser vendido no site do ot ou em poderá usar como quest usando o item selecionado como premio. fique ao seu critério.
       
      Primeiro vá até a pasta talkaction/script e crie um arquivo chamado petsystem.lua, depois coloque o seguinte script:
       
       
      Agora em talkactions/talkactions.xml adicione a seguinte tag:
       
      <talkaction words="!pet;!remove;!fale;!conversar" event="script" value="petsystem.lua" />  
      EXPLICAÇÂO:
      As partes em Negrito, são os pets. Você pode alterar ou criar monstros para fazer eles como pets. (Recomendo criar um monstro para que seja somente pet.)
       
      Exemplo: ["dog"]= {stor=78552},      
       
       
      Lembrando que é necessário mudar esta parte no script do monstro colocado a cima.
       
      <flag attackable="1" /> para :
       
      <flag attackable="0" />  
      agora vá em action/script e crie um arquivo chamado pet com o seguinte script:
       
       
      e vá em action.xml e adiciona a seguinte tag:
       
      <action itemid="10063" script="pet.lua"/> Explicação: Na tag da action o itemid é o item que deverá ser usado para ganhar a storage 78552, e assim podera sumonar o monstro com esta storage.
       
                                              
                                                         CRIE UMA ACTION COM A TAG A CIMA PARA CADA MONSTRO COLOCADO NA TALKACTION,
                                                         BASTA VC ALTERAR A STORAGE DO SCRIPT DA ACTION
                                                         EXEMPLO: em action altere as storage que estão em vermelho, como mostra abaixo
       
                                                              if getPlayerStorageValue(cid, 78552) < 1 then
                                                              setPlayerStorageValue(cid, 78552, 1)
       
                                                         aonde tem 78552 altere para 78553 que no caso é a storage do cyclops escolhido lá no script da talkaction
                                                         e assim susecivelmente.
       
       
       
      CREDITOS:
      Mulizeu
      Smartbox
      Bagon 
       
    • Por Imperius
      Olá, pessoal! Acabei encontrando um script que tinha feito a um tempo atrás. Estou compartilhando aqui para quem quiser usar ou melhorar.
       
      É bem parecido com os outros sistemas de roleta, igual deste tópico: https://tibiaking.com/forums/topic/101557-action-cassino-roleta-de-items/
       
      Como funciona?
       
      O "Treasure Chest" é um item custom, onde o jogador têm a possibilidade de ganhar itens raros ou bem meia boca. Tudo dependerá da sorte.
       
      O jogador precisa tacar o treasure chest na bancada e acionar a alavanca. O treasure chest irá se transformar em vários itens de forma randômica no qual o jogador poderá ou não ganhar. No final, apenas um item é entregue ao jogador.
       
      Para entender melhor o seu funcionamento, segue o GIF abaixo:
       

       
       
      em data > actions > actions.xml
       
       
      em data > actions > scripts > crie um arquivo chamado leverTreasureChest.lua
       
       
      no banco de dados do servidor, adicione o seguinte código em "SQL":
       
       
       

      Também estou disponibilizando uma página PHP, para quem quiser usar no site do servidor. Na página tem informações sobre o funcionamento, quais são os possíveis prêmios e a lista de jogadores que ganharam os itens raros.
       

       
       
      Espero ter ajudado de alguma forma! : )
       
      treasure_chest.php
    • Por PokemonXdemon
      [Quest System]
       
       
      Estava ontem analisando minha base, aonde tinha várias quests em arquivos separados.
      Então, pq não organizar tudo em apenas um arquivo exemplo:
      Então fiz esse script, meio simples mas útil para organizar tudo.
       
       
      Agora vamos entender oq precisamos fazer!
       
       Uma pequena atualização,  agora fica em um lugar separado a configuração para ficar mais  fácil modificar.
      Agora pode adicionar o boost que voce deseja no pokemon.
       
      Bem é isso.
    • Por Anderson Sacani
      Venho publicar uma alteração que eu e minha equipe fizemos no script já existente do Canary.
      O arquivo do script se chama quest_system1.lua.
      Fizemos essa alteração, porque o sistema original não entregava chave com actionid ao jogador. A chave vinha com o código 0000, ou seja, não abria nenhuma porta.
      A alteração que fizemos foi justamente para arrumar esse bug, por tanto, agora quando o quest ter uma chave com actionid dentro do baú, o jogador receberá essa mesma chave com o actionid definido.
       
      local specialQuests = { -- {x = 32752, y = 32343, z = 14} [52167] = Storage.DreamersChallenge.Reward, -- {x = 32806, y = 32230, z = 11} [52003] = Storage.PitsOfInferno.WeaponReward, -- {x = 32311, y = 32211, z = 8} [51400] = Storage.ThievesGuild.Reward, [51324] = Storage.WrathoftheEmperor.mainReward, -- {x = 32232, y = 31066, z = 7} [51715] = Storage.SvargrondArena.RewardGreenhorn, -- {x = 32232, y = 31059, z = 7} [51716] = Storage.SvargrondArena.RewardScrapper, -- {x = 32232, y = 31052, z = 7} [51717] = Storage.SvargrondArena.RewardWarlord } local questsExperience = { [3101] = 1 -- dummy values } local questLog = { [8213] = Storage.HiddenCityOfBeregar.DefaultStart } local tutorialIds = { [50080] = 5, [50082] = 6, [50084] = 10, [50086] = 11 } local hotaQuest = { 50950, 50951, 50952, 50953, 50954, 50955 } local questSystem1 = Action() function questSystem1.onUse(player, item, fromPosition, target, toPosition, isHotkey) local storage = specialQuests[item.actionid] if not storage then storage = item.uid if storage > 65535 then return false end end if storage == 23644 or storage == 24632 or storage == 14338 then player:setStorageValue(Storage.SvargrondArena.PitDoor, -1) end if player:getStorageValue(storage) > 0 and player:getAccountType() < ACCOUNT_TYPE_GOD then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'The ' .. ItemType(item.itemid):getName() .. ' is empty.') return true end local function copyContainer(originalContainer, newContainer) for i = 0, originalContainer:getSize() - 1 do local originalItem = originalContainer:getItem(i) local newItem = Game.createItem(originalItem.itemid, originalItem.type) newItem:setActionId(originalItem:getActionId()) newItem:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, originalItem:getAttribute(ITEM_ATTRIBUTE_DESCRIPTION)) if originalItem:isContainer() then copyContainer(Container(originalItem.uid), Container(newItem.uid)) end newContainer:addItemEx(newItem) end end local items, reward = {} local size = item:isContainer() and item:getSize() or 0 if size == 0 then local actionId = item:getActionId() reward = Game.createItem(item.itemid, item.type) reward:setActionId(actionId) reward:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, item:getAttribute(ITEM_ATTRIBUTE_DESCRIPTION)) else local container = Container(item.uid) for i = 0, container:getSize() - 1 do local originalItem = container:getItem(i) local newItem = Game.createItem(originalItem.itemid, originalItem.type) newItem:setActionId(originalItem:getActionId()) newItem:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, originalItem:getAttribute(ITEM_ATTRIBUTE_DESCRIPTION)) if originalItem:isContainer() then copyContainer(Container(originalItem.uid), Container(newItem.uid)) end items[#items + 1] = newItem end if size == 1 then reward = items[1] end end local result = '' if reward then local ret = ItemType(reward.itemid) if ret:isRune() then result = ret:getArticle() .. ' ' .. ret:getName() .. ' (' .. reward.type .. ' charges)' elseif ret:isStackable() and reward:getCount() > 1 then result = reward:getCount() .. ' ' .. ret:getPluralName() elseif ret:getArticle() ~= '' then result = ret:getArticle() .. ' ' .. ret:getName() else result = ret:getName() end else if size > 20 then reward = Game.createItem(item.itemid, 1) elseif size > 8 then reward = Game.createItem(2854, 1) else reward = Game.createItem(2853, 1) end for i = 1, size do local tmp = items[i] if reward:addItemEx(tmp) ~= RETURNVALUE_NOERROR then Spdlog.warn("[questSystem1.onUse] - Could not add quest reward to container") end end local ret = ItemType(reward.itemid) result = ret:getArticle() .. ' ' .. ret:getName() end if player:addItemEx(reward) ~= RETURNVALUE_NOERROR then local weight = reward:getWeight() if player:getFreeCapacity() < weight then player:sendCancelMessage(string.format('You have found %s weighing %.2f oz. You have no capacity.', result, (weight / 100))) else player:sendCancelMessage('You have found ' .. result .. ', but you have no room to take it.') end return true end if questsExperience[storage] then player:addExperience(questsExperience[storage], true) end if questLog[storage] then player:setStorageValue(questLog[storage], 1) end if tutorialIds[storage] then player:sendTutorial(tutorialIds[storage]) if item.uid == 50080 then player:setStorageValue(Storage.RookgaardTutorialIsland.SantiagoNpcGreetStorage, 3) end end if isInArray(hotaQuest, item.uid) then if player:getStorageValue(Storage.TheAncientTombs.DefaultStart) ~= 1 then player:setStorageValue(Storage.TheAncientTombs.DefaultStart, 1) end end player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have found ' .. result .. '.') player:setStorageValue(storage, 1) return true end for index, value in pairs(specialQuests) do questSystem1:aid(index) end questSystem1:aid(2000) questSystem1:register()  
    • Por Anderson Sacani
      local config = { scrollId = 14758, premiumDays = 30, } local days = config.premiumDays local premiumScroll = Action() function premiumScroll.onUse(player, item, fromPosition, target, toPosition, isHotkey) player:addPremiumDays(days) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Voce recebeu " .. days .. " dias de conta premium.") item:remove(1) addEvent(function() if player:isPlayer() then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "No total voce tem " .. player:getPremiumDays() .. " dias de conta premium.") end end, 2500) return true end premiumScroll:id(config.scrollId) premiumScroll:register() Percebi que alguns servidores estão vindo sem o script do premium scroll, então criei esse script para adicionar 30 dias de premium na conta do jogador que usar o premium scroll.
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo