Jump to content
Close
Sign in to follow this  
Deletera

Scripting TFS 1.2 - Store Itens

Recommended Posts

Para quem usa o OTX 11+ do Erick Nunes/Malucoo, vem tudo certo com os itens da store, no entanto, quando você puxa eles pelo store no jogo o package não transforma no item, arrumei o script que faz com que o pacote se torne o item desejado. Espero ajudar quem tiver com o mesmo problema, pois não havia encontrado a solução pelos foruns.

 

Crie na pasta other/actions um arquivo chamado store_houses

local constructionKits = {
    [27850] = 27850, [27728] = 27728, [26075] = 26075, [26059] = 26059, [26083] = 26083,
    [26073] = 26073, [26077] = 26077, [26063] = 26063, [26079] = 26079, [26067] = 26067,
    [26356] = 26356, [26349] = 26349, [26358] = 26358, [26354] = 26354, [27897] = 27897,
    [27905] = 27905, [27901] = 27901, [27893] = 27893, [27892] = 27892, [27894] = 27894,
    [27895] = 27895, [27896] = 27896, [26109] = 26109, [26110] = 26110, [26111] = 26111,
    [26371] = 26371, [26372] = 26372, [26373] = 26373, [26374] = 26374, [26375] = 26375,
    [27084] = 27084, [27085] = 27085, [27086] = 27086, [27087] = 27087, [27088] = 27088,
    [27089] = 27089, [27090] = 27090, [27091] = 27091, [26370] = 26370, [26347] = 26347,
    [26364] = 26364, [26098] = 26098, [26107] = 26107, [26100] = 26100, [27100] = 27100,
    [27889] = 27889, [26094] = 26094, [26090] = 26090, [27102] = 27102, [27886] = 27886,
    [26057] = 26057, [26055] = 26055, [26104] = 26104, [26105] = 26105, [26106] = 26106,
    [26379] = 26379, [26380] = 26380, [26381] = 26381
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local kit = constructionKits[item.actionid]
    if not kit then
        return false
    end

    if fromPosition.x == CONTAINER_POSITION then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, "Put the construction kit on the floor first.")
    elseif not fromPosition:getTile():getHouse() then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, "You may construct this only inside a house.")
    else
        item:transform(kit)
        item:setActionId(0)
        fromPosition:sendMagicEffect(CONST_ME_POFF)
    end

    return true
end

Adicione no actions.xml

 


	<action actionid="27850" script="other/store_house.lua" />
	<action actionid="26347" script="other/store_house.lua" />
	<action actionid="27100" script="other/store_house.lua" />
	<action actionid="27886" script="other/store_house.lua" />
	<action actionid="26106" script="other/store_house.lua" />
	<action actionid="26109" script="other/store_house.lua" />
	<action actionid="26373" script="other/store_house.lua" />
	<action actionid="27086" script="other/store_house.lua" />
	<action actionid="27091" script="other/store_house.lua" />
	<action actionid="26107" script="other/store_house.lua" />
	<action actionid="26090" script="other/store_house.lua" />
	<action actionid="26104" script="other/store_house.lua" />
	<action actionid="26381" script="other/store_house.lua" />
	<action actionid="26059" script="other/store_house.lua" />
	<action actionid="26079" script="other/store_house.lua" />
	<action actionid="26354" script="other/store_house.lua" />
	<action actionid="27892" script="other/store_house.lua" />
	<action actionid="26110" script="other/store_house.lua" />
	<action actionid="26374" script="other/store_house.lua" />
	<action actionid="27087" script="other/store_house.lua" />
	<action actionid="26370" script="other/store_house.lua" />
	<action actionid="26100" script="other/store_house.lua" />
	<action actionid="27102" script="other/store_house.lua" />
	<action actionid="26105" script="other/store_house.lua" />
	<action actionid="26083" script="other/store_house.lua" />
	<action actionid="26067" script="other/store_house.lua" />
	<action actionid="27897" script="other/store_house.lua" />
	<action actionid="27894" script="other/store_house.lua" />
	<action actionid="26111" script="other/store_house.lua" />
	<action actionid="26375" script="other/store_house.lua" />
	<action actionid="27088" script="other/store_house.lua" />
	<action actionid="26356" script="other/store_house.lua" />
	<action actionid="27905" script="other/store_house.lua" />
	<action actionid="27895" script="other/store_house.lua" />
	<action actionid="26371" script="other/store_house.lua" />
	<action actionid="27084" script="other/store_house.lua" />
	<action actionid="27089" script="other/store_house.lua" />
	<action actionid="26057" script="other/store_house.lua" />
	<action actionid="26379" script="other/store_house.lua" />
	<action actionid="27728" script="other/store_house.lua" />
	<action actionid="26077" script="other/store_house.lua" />
	<action actionid="26349" script="other/store_house.lua" />
	<action actionid="27901" script="other/store_house.lua" />
	<action actionid="27896" script="other/store_house.lua" />
	<action actionid="26372" script="other/store_house.lua" />
	<action actionid="27085" script="other/store_house.lua" />
	<action actionid="27090" script="other/store_house.lua" />
	<action actionid="26098" script="other/store_house.lua" />
	<action actionid="26094" script="other/store_house.lua" />
	<action actionid="26055" script="other/store_house.lua" />
	<action actionid="26380" script="other/store_house.lua" />
	<action actionid="26075" script="other/store_house.lua" />
	<action actionid="26063" script="other/store_house.lua" />
	<action actionid="26358" script="other/store_house.lua" />
	<action actionid="27893" script="other/store_house.lua" />
	<action actionid="26073" script="other/store_house.lua" />
	<action actionid="26364" script="other/store_house.lua" />

 





Share this post


Link to post
Share on other 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.

 





Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

Open Tibia Server

Quer aprender a criar seu próprio servidor de Tibia? Então está no lugar certo, aqui você encontrará milhares de tutorias, scripts, códigos, mapas e utilitários para que você possa fazer o seu próprio servidor de Tibia começando do zero.

Redes Sociais

Anuncie no Tibia King

Precisa de mais visibilidade em seus projetos? Quer fazer um plano publicitário para o seu servidor? Anuncie no Tibia King e faça sua divulgação, possuímos centenas de acessos simultâneos e milhares diários, com certeza será a sua solução!

×
×
  • Create New...