Ir para conteúdo

Featured Replies

Postado

TFS 0.4 8.60

 

 

image.png.4f260c2e3be6200b2f08f563dc00c07a.png 4 PERGAMINHOS que ao comprar no SHOP você tem que entregar pra x NPC que vai te da a EPIC PROMOTION  É AO ACABAR A PREMIUM ACCOUNT voltar a ser a 2 vocação EX Elite Knight ....

 

Citar

    <vocation id="9" name="Epic Feiticeiro" description="an epic feiticeiro" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="1" gainmanaamount="2" manamultiplier="1.1" attackspeed="270" soulmax="200" gainsoulticks="15" fromvoc="5" lessloss="50">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="10" name="Epic Druida" description="an epic druida" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="1" gainmanaamount="2" manamultiplier="1.1" attackspeed="270" soulmax="200" gainsoulticks="15" fromvoc="6" lessloss="50">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="11" name="Epic Paladino" description="an epic paladino" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="3" gainhpamount="1" gainmanaticks="2" gainmanaamount="2" manamultiplier="1.4" attackspeed="300" soulmax="200" gainsoulticks="15" fromvoc="7" lessloss="50">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="12" name="Epic Cavaleiro" description="an epic cavaleiro" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="3.0" attackspeed="300" soulmax="200" gainsoulticks="15" fromvoc="8" lessloss="50">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>

 

Postado

@ADM Mayk on BaiakME Não deu pra entender nada pelo tópico, então fiz essa gambiarra;

 

NPCS

XML

<?xml version="1.0"?>
<npc name="Promoter" script="data/npc/scripts/Promoter.lua" walkinterval="5000" floorchange="0">
<health now="100" max="100"/>
<look type="12" head="95" body="116" legs="121" feet="115" addons="0"/>
<parameters>
<parameter key="message_greet" value="Hi |PLAYERNAME|. I carry out promotions. {promotion} {list}" />
</parameters>
</npc>

Script

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
    local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid
    
    local config = {
        
        item = {{2155, 1}, {2160, 100}, {2150, 1}, {2349, 1}}, -- Lista de itens necessarios
        
        voc = 9, -- Vocation em q o player irá se transformar
        storage = 432211,
        storage2 = 43221,
        
    }
    
    if (msgcontains(msg, 'list')) then
        local str = ""
        str = str .. "Bring to me: "
        for name, pos in pairs(t) do
            str = str.." {".. pos[2] .."} {".. getItemInfo(pos[1]).name .."},"
        end
        str = str .. "."
        npcHandler:say(str, cid)  
    end  
    
    if (msgcontains(msg, 'promotion')) then
        
        if not isPremium(cid) then
            selfSay("Only premium account can do the promotion", cid)
            return true
        end
        
        if getPlayerVocation(cid) == config.voc then
            selfSay("You already held your promotion", cid)
            return true
        end
        
        for _, var in pairs(config.item) do
            if getPlayerItemCount(cid, var[1]) >= var[2] then
                if getCreatureStorage(cid, config.storage) == -1 then
                    doCreatureSetStorage(cid, config.storage, 1)
                else
                    doCreatureSetStorage(cid, config.storage, getCreatureStorage(cid, config.storage) + 1)
                end
            else
                doCreatureSetStorage(cid, config.storage, 0)
                selfSay("You do not have the necessary items, say {list} to know the required items", cid)
                return true 
            end 
        end
        
        if getCreatureStorage(cid, config.storage) > 0 and getCreatureStorage(cid, config.storage) < table.manx(config.item) then
            doCreatureSetStorage(cid, config.storage, 0)
            selfSay("You do not have the necessary items, say {list} to know the required items", cid)
            return true
        end
        
        if getCreatureStorage(cid, config.storage) >= table.maxn(config.item) then 
            doCreatureSetStorage(cid, config.storage2, getPlayerVocation(cid))
            doCreatureSetStorage(cid, config.storage, 0)
            for k, pid in pairs(config.item) do
                doPlayerRemoveItem(cid, pid[1], pid[2])
            end
            doPlayerSetVocation(cid, config.voc)
            selfSay("Congratulations!! You have realized your promotion !!", cid)       
        end  
    end
    return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())


CreatureScripts/scripts/Login.lua

local config_promot = {

promotion_vocs = {9, 10, 11, 12}, -- Vocaçoes de promotion PREMIUM
storage2 = 43221        

}

if not isPremium(cid) and isInArray(config_promot.promotion_vocs, getPlayerVocation(cid)) then
   doPlayerSetVocation(cid, getCreatureStorage(cid, config_promot.storage2))
   doPlayerSendTextMessage(cid, 27, "Sua P.A acabou e sua promotion também!!")
end

 

Postado
  • Autor
1 hora atrás, Sttorm disse:

@ADM Mayk on BaiakME Não deu pra entender nada pelo tópico, então fiz essa gambiarra;

 

NPCS

XML


<?xml version="1.0"?>
<npc name="Promoter" script="data/npc/scripts/Promoter.lua" walkinterval="5000" floorchange="0">
<health now="100" max="100"/>
<look type="12" head="95" body="116" legs="121" feet="115" addons="0"/>
<parameters>
<parameter key="message_greet" value="Hi |PLAYERNAME|. I carry out promotions. {promotion} {list}" />
</parameters>
</npc>

Script


local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
    local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid
    
    local config = {
        
        item = {{2155, 1}, {2160, 100}, {2150, 1}, {2349, 1}}, -- Lista de itens necessarios
        
        voc = 9, -- Vocation em q o player irá se transformar
        storage = 432211,
        storage2 = 43221,
        
    }
    
    if (msgcontains(msg, 'list')) then
        local str = ""
        str = str .. "Bring to me: "
        for name, pos in pairs(t) do
            str = str.." {".. pos[2] .."} {".. getItemInfo(pos[1]).name .."},"
        end
        str = str .. "."
        npcHandler:say(str, cid)  
    end  
    
    if (msgcontains(msg, 'promotion')) then
        
        if not isPremium(cid) then
            selfSay("Only premium account can do the promotion", cid)
            return true
        end
        
        if getPlayerVocation(cid) == config.voc then
            selfSay("You already held your promotion", cid)
            return true
        end
        
        for _, var in pairs(config.item) do
            if getPlayerItemCount(cid, var[1]) >= var[2] then
                if getCreatureStorage(cid, config.storage) == -1 then
                    doCreatureSetStorage(cid, config.storage, 1)
                else
                    doCreatureSetStorage(cid, config.storage, getCreatureStorage(cid, config.storage) + 1)
                end
            else
                doCreatureSetStorage(cid, config.storage, 0)
                selfSay("You do not have the necessary items, say {list} to know the required items", cid)
                return true 
            end 
        end
        
        if getCreatureStorage(cid, config.storage) > 0 and getCreatureStorage(cid, config.storage) < table.manx(config.item) then
            doCreatureSetStorage(cid, config.storage, 0)
            selfSay("You do not have the necessary items, say {list} to know the required items", cid)
            return true
        end
        
        if getCreatureStorage(cid, config.storage) >= table.maxn(config.item) then 
            doCreatureSetStorage(cid, config.storage2, getPlayerVocation(cid))
            doCreatureSetStorage(cid, config.storage, 0)
            for k, pid in pairs(config.item) do
                doPlayerRemoveItem(cid, pid[1], pid[2])
            end
            doPlayerSetVocation(cid, config.voc)
            selfSay("Congratulations!! You have realized your promotion !!", cid)       
        end  
    end
    return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())


CreatureScripts/scripts/Login.lua


local config_promot = {

promotion_vocs = {9, 10, 11, 12}, -- Vocaçoes de promotion PREMIUM
storage2 = 43221        

}

if not isPremium(cid) and isInArray(config_promot.promotion_vocs, getPlayerVocation(cid)) then
   doPlayerSetVocation(cid, getCreatureStorage(cid, config_promot.storage2))
   doPlayerSendTextMessage(cid, 27, "Sua P.A acabou e sua promotion também!!")
end

 

 

Uma Promoção (Promotion) é uma espécie de segunda vocação em Tibia. Todos os personagens com uma Premium Time e level 20 podem comprar uma promoção por 100 000 gps e obter algumas vantagens especiais.
Ao comprar uma promoção, a sua vocação ganhará um novo nome: Elder Druis tornar-se-ão Epic Druida, Master Sorcerer passarão a ser Epic Feiticeiro, Elite Knights virarão Epic Cavaleiro e Royal Paladins serão Epic Paladin...
Você não perde uma promoção ao morrer, mas ela é suspensa caso o seu personagem vire Free Account, no entanto, ao ativar novamente uma Premium Time você já volta com a promoção.

 

consegui achar esse aqui porem no lugar do dinheiro quero que seja por item .... ou até mesmo clickar no item 6090 SAIR X EFFECT é ganha a PROMOTION Epic Druida que no caso vai ser 4 items pra cada item uma promotion....

 

Citar

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end

function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end

local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid


local a = {
[5] = {new_voc = 9,need_level = true,level = 60,cobrar = true,price = 100000,need_premium = true},
[6] = {new_voc = 10,need_level = true,level = 60,cobrar = true,price = 100000,need_premium = true},
[7] = {new_voc = 11,need_level = true,level = 60,cobrar = true,price = 100000,need_premium = true},
[8] = {new_voc = 12,need_level = true,level = 60,cobrar = true,price = 100000,need_premium = true}
}
local b = a[getPlayerVocation(cid)]
if(msgcontains(msg, 'vip promotion') or msgcontains(msg, 'vip promote')) then
if(not b) then
selfSay('Você não tem a second promote, então não poderá ser promovido!.', cid)
talkState[talkUser] = 0
else
selfSay('Deseja virar ' .. getVocationInfo(b.new_voc).name .. ' por '..b.price..' gold coins? {yes}', cid)
talkState[talkUser] = 1
end
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
if b.need_premium == true and not isPremium(cid) then
selfSay('Você precisa ser Premium para ser promovido!.', cid)
talkState[talkUser] = 0
elseif b.need_level == true and getPlayerLevel(cid) < b.level then
selfSay('Você deve ter pelo menos level '.. b.level ..' para ser promovido!.', cid)
talkState[talkUser] = 0
elseif b.cobrar == true and doPlayerRemoveMoney(cid, b.price) == TRUE then
doPlayerSetVocation(cid,b.new_voc)
selfSay('Você foi promovido com sucesso.', cid)
talkState[talkUser] = 0
else
selfSay('Você não tem '..b.price..' gold coins Suficientes.', cid)
doSendMagicEffect(getPlayerPosition(cid), 2)
end
end
return TRUE
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

Editado por ADM Mayk on BaiakME (veja o histórico de edições)

  • 3 weeks later...
Postado

@ADM Mayk on BaiakME Você precisa ser mais direto no seus tópicos amigo, já que são 4 itens, já envie todos os IDs para que possamos fazer seu script e deixar 100% para você instalá-lo.

Qual a sua preferência? NPC ou usar o item?

 

Com as informações que eu tenho, consegui fazer para dar use em determinado item e ele dar a vocação.

Crie um arquivo chamado addVoc.lua na pasta data/actions/scripts e coloque esse script:

local config = {
	tableVoc = {
	--	[ID da vocação antiga] = {newVoc = ID da nova vocação, id = ID do item, magicEffect = Efeito no jogador}
		[5] = {newVoc = 9, id = 2190, magicEffect = CONST_ME_FIREATTACK},
		[6] = {newVoc = 10, id = 2182, magicEffect = CONST_ME_ICEATTACK},
		[7] = {newVoc = 11, id = 2456, magicEffect = CONST_ME_HOLYDAMAGE},
		[8] = {newVoc = 12, id = 2403, magicEffect = CONST_ME_BLOCKHIT}
	},
	premium = true, -- true = Premium Account / false = Free Account
	needLevel = true, -- true = Precisa de level / false = Não precisa de level
	level = 20 -- Nível necessário para adquirir a promoção
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	for voc, x in pairs(config.tableVoc) do
		if(item.itemid == x.id) then
			if(getPlayerVocation(cid) == x.newVoc) then
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You already belong to the family of "..getVocationInfo(x.newVoc).name..".") -- Mensagem de erro caso já tenha recebido a promotion
			elseif(getPlayerVocation(cid) ~= voc) then
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You do not belong to the family of "..getVocationInfo(voc).name..".") -- Mensagem de erro caso não sejá da mesma classe
			elseif(config.premium == true and not isPremium(cid)) then
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You must be premium to receive this promotion.") -- Mensagem de erro caso não tenha Premium Time
			elseif(config.needLevel == true and getPlayerLevel(cid) < config.level) then
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You need to reach level "..config.level.." first.") -- Mensagem de erro caso não tenha nível necessário
			elseif(doRemoveItem(item.uid, 1)) then
				doPlayerSetVocation(cid, x.newVoc)
				doSendMagicEffect(fromPosition , CONST_ME_POFF)
				doSendMagicEffect(getCreaturePosition(cid), x.magicEffect) 
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have been promoted to "..getVocationInfo(x.newVoc).name..".") -- Mensagem de sucesso caso seja promovido
			end
		end
	end
	return true
end

 

Agora no arquivo actions.xml adicione a seguinte tag:

<action itemid="2190;2182;2456;2403" event="script" value="addVoc.lua"/>

Na tag em itemid adicione os IDs dos itens configurados no addVoc.lua

 

TESTADO NO TFS 0.4, PORÉM MEU TFS DEVE ESTAR BUGADO, ELE DA A VOCAÇÃO, MAS AO DESLOGAR RETORNA A VOCAÇÃO ANTIGA.

TESTE E ME RETORNE O QUE ACONTECEU.

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

Spoiler

local config = {
	delrey = getPlayerCarValue(cid, DELREY),
	cigarro = getPlayerCancer(cid, DERBY),
	prostituta = getPlayerAIDS(cid, cracuda),
	tresOitao = getPlayerRevorvi(cid, 38)
}

if(delrey == "Ligado" and cigarro == "Aceso" and prostituta == "No Colo" and tresOitao == "Carregado") then
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Começou o fim de semana. #PAS")
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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo