Ir para conteúdo
  • Cadastre-se

(Resolvido)!akatsuki


Ir para solução Resolvido por Storm,

Posts Recomendados

Ola pessoal do tibia king,preciso de uma Talkaction para quando o player falar !akatsuki ele fica com a roupa da akatsuki,porque eu adicionei o talkaction do Reverter para todas as vocations,se voce for akatsuki e falar Reverter voce perde a transformação!,Quero uma talkaction que o player só pode utilizar se ele tiver a storage da quest  akatsuki,Obrigado a todos que poderem ajudar <3 RP+

Link para o post
Compartilhar em outros sites

@REI DAVID 

local storage = 43455

local t = {
    
    [1] = {lookType = 203}, -- [vocation ID] = {lookType = outfit id}
    [2] = {lookType = 204},
    
}

function onSay(cid, words, param, channel)
    if getPlayerStorageValue(cid, storage) == 1 then
        local outfit = t[getPlayerVocation(cid)]
        if outfit then
            if outfit ~= getCreatureOutfit(cid).lookType then
                doChangeCreatureOutfit(cid, outfit)
                db.executeQuery("UPDATE `players` SET `looktype`=".. outfit .." WHERE `players`.`id`= ".. getPlayerGUID(cid) .."")
                doSendMagicEffect(pos, 10)
                doCreatureSay(cid, "AKATSUKI!!", TALKTYPE_MONSTER)
                return true
            else
                doPlayerSendTextMessage(cid, 27, "Voce ja esta transformado!")
                doSendMagicEffect(pos, 4)
                return true
            end
        else
            doPlayerSendTextMessage(cid, 27, "Sua vocacao nao se transformar em akatsuki")
            doSendMagicEffect(pos, 4)
            return true 
        end
    else
        doPlayerSendTextMessage(cid, 27, "Voce nao tem a storage")
        doSendMagicEffect(pos, 4)
        return true 
    end
    return true
end

 

Link para o post
Compartilhar em outros sites

Nao funcionou mano "voce nao tem a storage" e eu mudei para a storage da script da akatsuki 

Citar

-- Script Akatsuki System Advance 1.0 --
-- By RigBy --
-- Xtibia.com --
 
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
 
local level = 610 -- Level preciso pra entra para akatsuki
local itemid = 4569 -- id do coração
local quantidade = 6 -- quantos hearts e preciso
local bonushp = 40000 -- quanto de bonus de life vai ganha
local bonusmp = 40000 -- quanto de bonus de mana vai ganha
local config = {
--[Vocation] = ( Nova Vocation, New Outfit )
-- Naruto --
[1] = { 11, 300},
[2] = { 11, 300},
[3] = { 11, 300},
[4] = { 11, 300},
[5] = { 11, 300},
[6] = { 11, 300},
[7] = { 11, 300},
[8] = { 11, 300},
[9] = { 11, 300},
-- Sasuke --
[17] = { 26, 315},
[18] = { 26, 315},
[19] = { 26, 315},
[20] = { 26, 315},
[21] = { 26, 315},
[22] = { 26, 315},
[23] = { 26, 315},
[24] = { 26, 315},
[25] = { 26, 315},
-- Sakura --
[27] = { 36, 312},
[28] = { 36, 312},
[29] = { 36, 312},
[30] = { 36, 312},
[31] = { 36, 312},
[32] = { 36, 312},
[33] = { 36, 312},
[34] = { 36, 312},
[35] = { 36, 312},
-- Lee --
[37] = { 46, 294},
[38] = { 46, 294},
[39] = { 46, 294},
[40] = { 46, 294},
[41] = { 46, 294},
[42] = { 46, 294},
[43] = { 46, 294},
[44] = { 46, 294},
[45] = { 46, 294},
-- Gaara --
[47] = { 56, 262},
[48] = { 56, 262},
[49] = { 56, 262},
[50] = { 56, 262},
[51] = { 56, 262},
[52] = { 56, 262},
[53] = { 56, 262},
[54] = { 56, 262},
[55] = { 56, 262},
-- Neji --
[57] = { 66, 302},
[58] = { 66, 302},
[59] = { 66, 302},
[60] = { 66, 302},
[61] = { 66, 302},
[62] = { 66, 302},
[63] = { 66, 302},
[64] = { 66, 302},
[65] = { 66, 302},
-- Hinata --
[67] = { 76, 268},
[68] = { 76, 268},
[69] = { 76, 268},
[70] = { 76, 268},
[71] = { 76, 268},
[72] = { 76, 268},
[73] = { 76, 268},
[74] = { 76, 268},
[75] = { 76, 268},
-- Shikamaru --
[77] = { 86, 317},
[78] = { 86, 317},
[79] = { 86, 317},
[80] = { 86, 317},
[81] = { 86, 317},
[82] = { 86, 317},
[83] = { 86, 317},
[84] = { 86, 317},
[85] = { 86, 317},
-- Kakashi --
[87] = { 96, 282},
[88] = { 96, 282},
[89] = { 96, 282},
[90] = { 96, 282},
[91] = { 96, 282},
[92] = { 96, 282},
[93] = { 96, 282},
[94] = { 96, 282},
[95] = { 96, 282},
-- Madara --
[97] = { 106, 296},
[98] = { 106, 296},
[99] = { 106, 296},
[100] = { 106, 296},
[101] = { 106, 296},
[102] = { 106, 296},
[103] = { 106, 296},
[104] = { 106, 296},
[105] = { 106, 296},
-- Kisame --
[107] = { 426, 746},
[108] = { 116, 292},
[109] = { 116, 292},
[110] = { 116, 292},
[111] = { 116, 292},
[112] = { 116, 292},
[113] = { 116, 292},
[114] = { 116, 292},
[115] = { 116, 292},
-- Shisui --
[117] = { 126, 319},
[118] = { 126, 319},
[119] = { 126, 319},
[120] = { 126, 319},
[121] = { 126, 319},
[122] = { 126, 319},
[123] = { 126, 319},
[124] = { 126, 319},
[125] = { 126, 319},
-- Kabuto --
[127] = { 136, 280},
[128] = { 136, 280},
[129] = { 136, 280},
[130] = { 136, 280},
[131] = { 136, 280},
[132] = { 136, 280},
[133] = { 136, 280},
[134] = { 136, 280},
[135] = { 136, 280},
-- Minato --
[137] = { 146, 298},
[138] = { 146, 298},
[139] = { 146, 298},
[140] = { 146, 298},
[141] = { 146, 298},
[142] = { 146, 298},
[143] = { 146, 298},
[144] = { 146, 298},
[145] = { 146, 298},
-- Tobirama --
[147] = { 156, 666},
[148] = { 156, 666},
[149] = { 156, 666},
[150] = { 156, 666},
[151] = { 156, 666},
[152] = { 156, 666},
[153] = { 156, 666},
[154] = { 156, 666},
[155] = { 156, 666},
-- Hidan --
[157] = { 166, 266},
[158] = { 166, 266},
[159] = { 166, 266},
[160] = { 166, 266},
[161] = { 166, 266},
[162] = { 166, 266},
[163] = { 166, 266},
[164] = { 166, 266},
[165] = { 166, 266},
-- guy --
[167] = { 176, 264},
[168] = { 176, 264},
[169] = { 176, 264},
[170] = { 176, 264},
[171] = { 176, 264},
[172] = { 176, 264},
[173] = { 176, 264},
[174] = { 176, 264},
[175] = { 176, 264},
-- Itachi --
[177] = { 186, 276},
[178] = { 186, 276},
[179] = { 186, 276},
[180] = { 186, 276},
[181] = { 186, 276},
[182] = { 186, 276},
[183] = { 186, 276},
[184] = { 186, 276},
[185] = { 186, 276},
-- Ino --
[187] = { 196, 270},
[188] = { 196, 270},
[189] = { 196, 270},
[190] = { 196, 270},
[191] = { 196, 270},
[192] = { 196, 270},
[193] = { 196, 270},
[194] = { 196, 270},
[195] = { 196, 270},
-- Hashirama --
[197] = { 206, 275},
[198] = { 206, 275},
[199] = { 206, 275},
[200] = { 206, 275},
[201] = { 206, 275},
[202] = { 206, 275},
[203] = { 206, 275},
[204] = { 206, 275},
[205] = { 206, 275},
-- chouji --
[207] = { 216, 266},
[208] = { 216, 266},
[209] = { 216, 266},
[210] = { 216, 266},
[211] = { 216, 266},
[212] = { 216, 266},
[213] = { 216, 266},
[214] = { 216, 266},
[215] = { 216, 266},
-- Kimimaro --
[217] = { 226, 266},
[218] = { 226, 266},
[219] = { 226, 266},
[220] = { 226, 266},
[221] = { 226, 266},
[222] = { 226, 266},
[223] = { 226, 266},
[224] = { 226, 266},
[225] = { 226, 266},
-- Kiba --
[227] = { 236, 288},
[228] = { 236, 288},
[229] = { 236, 288},
[230] = { 236, 288},
[231] = { 236, 288},
[232] = { 236, 288},
[233] = { 236, 288},
[234] = { 236, 288},
[235] = { 236, 288},
-- Obito --
[237] = { 246, 304},
[238] = { 246, 304},
[239] = { 246, 304},
[240] = { 246, 304},
[241] = { 246, 304},
[242] = { 246, 304},
[243] = { 246, 304},
[244] = { 246, 304},
[245] = { 246, 304},
-- Jiraya --
[247] = { 256, 351},
[248] = { 256, 351},
[249] = { 256, 351},
[250] = { 256, 351},
[251] = { 256, 351},
[252] = { 256, 351},
[253] = { 256, 351},
[254] = { 256, 351},
[255] = { 256, 351},
-- Kurenai --
[257] = { 266, 342},
[258] = { 266, 342},
[259] = { 266, 342},
[260] = { 266, 342},
[261] = { 266, 342},
[262] = { 266, 342},
[263] = { 266, 342},
[264] = { 266, 342},
[265] = { 266, 342},
-- Bee --
[267] = { 276, 290},
[268] = { 276, 290},
[269] = { 276, 290},
[270] = { 276, 290},
[271] = { 276, 290},
[272] = { 276, 290},
[273] = { 276, 290},
[274] = { 276, 290},
[275] = { 276, 290},
-- Tenten --
[277] = { 286, 323},
[278] = { 286, 323},
[279] = { 286, 323},
[280] = { 286, 323},
[281] = { 286, 323},
[282] = { 286, 323},
[283] = { 286, 323},
[284] = { 286, 323},
[285] = { 286, 323},
-- Tsunade --
[287] = { 296, 325},
[288] = { 296, 325},
[289] = { 296, 325},
[290] = { 296, 325},
[291] = { 296, 325},
[292] = { 296, 325},
[293] = { 296, 325},
[294] = { 296, 325},
[295] = { 296, 325},
}
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
 return false
end
 
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
 
 
if msgcontains(msg, 'akatsuki') then
    if getPlayerVocation(cid) ~= config then
        if getPlayerStorageValue(cid, 8974555) == -1 then
            if getPlayerLevel(cid) >= level then
                selfSay('Tem certeza de que quer se juntar a Akatsuki?.', cid)
                talkState[talkUser] = 1
            else
                selfSay('Você nem sabe o nível que é pra entrar na akatsuki, suma da minha frente seu idiota.', cid)
            end
        else
            selfSay('Você já faz parte da Akatsuki!', cid)
        end
    else
        selfSay('Não preciso de você agora!', cid)
    end
end
 
if talkState[talkUser] == 1 and msgcontains(msg, 'yes') then
    selfSay('Para provar a sua lealdade, você tem que trazer '..quantidade..' {coraçao}.', cid)
    talkState[talkUser] = 2
end
 
if talkState[talkUser] == 2 and msgcontains(msg, 'coracao') then
    if getPlayerItemCount(cid, 4569) >= 6 then
    local voc = config[getPlayerVocation(cid)]
        doPlayerSetVocation(cid, voc[1])
    local outfit = {lookType = voc[2]}
        doCreatureChangeOutfit(cid, outfit)
        setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+bonushp)
        setCreatureMaxMana(cid, getCreatureMaxMana(cid)+bonusmp)
        doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
        doPlayerRemoveItem(cid, 4569, 6)
        doCreatureAddMana(cid, getCreatureMaxMana(cid))
        setPlayerStorageValue(cid,8974555,6)
        doPlayerSetExperienceRate(cid, experience) 
        selfSay('Parabéns agora você faz parte da Akatsuki.', cid)
        talkState[talkUser] = 0
    else
        selfSay('Não adianta me enganar, você não tem '..quantidade..' corações, vai atrás, e só volte com eles.', cid)
    end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

Link para o post
Compartilhar em outros sites
  • Solução

@REI DAVID 

local storage = 43455

local t = {
    
    [1] = {lookType = 203}, -- [vocation ID] = {lookType = outfit id}
    [2] = {lookType = 204},
    
}

function onSay(cid, words, param, channel)
  local pos = getCreaturePosition(cid)
    if getPlayerStorageValue(cid, storage) == 1 then
        local outfit = t[getPlayerVocation(cid)]
        if outfit then
            if outfit ~= getCreatureOutfit(cid).lookType then
                doChangeCreatureOutfit(cid, outfit)
                db.executeQuery("UPDATE `players` SET `looktype`=".. outfit .." WHERE `players`.`id`= ".. getPlayerGUID(cid) .."")
                doSendMagicEffect(pos, 10)
                doCreatureSay(cid, "AKATSUKI!!", TALKTYPE_MONSTER)
                return true
            else
                doPlayerSendTextMessage(cid, 27, "Voce ja esta transformado!")
                doSendMagicEffect(pos, 4)
                return true
            end
        else
            doPlayerSendTextMessage(cid, 27, "Sua vocacao nao se transformar em akatsuki")
            doSendMagicEffect(pos, 4)
            return true 
        end
    else
        doPlayerSendTextMessage(cid, 27, "Voce nao tem a storage")
        doSendMagicEffect(pos, 4)
        return true 
    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.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo