Ir para conteúdo

Featured Replies

Postado

Olá galera,estou precisando de 1 script pra virar Akatsuki...

Exemplo:Juntar 1 tanto de corações e ir no npc e virar Akatsuki com a Outfit...

 

  • Respostas 16
  • Visualizações 1.5k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • data/npc crei um arquivo .xml e coloque o nome de Tobi e coloque essa script dentro   Agora vai em data/npc/scripts e crie um arquivo chamado AkatsukiSystem.lua e coloque essa sc

  • Tente usar esse XML: <?xml version="1.0" encoding="UTF-8"?> <npc name="Tobi" script="data/npc/scripts/AkatsukiSystem.lua" walkinterval="2000" speed="0" floorchange="0"> <health now=

  • Tente trocar o LUA por esse:  

Postado

data/npc crei um arquivo .xml e coloque o nome de Tobi

e coloque essa script dentro

Spoiler

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Tobi" script="data/npc/scripts/AkatsukiSystem.lua" walkinterval="2000" speed="0" floorchange="0">
<health now="999999999" max="999999999"/>
<look type="489" head="0" body="0" legs="0" feet="0" addons="0"/>
<parameters>
<parameter key="message_greet" value="Huum, então você quer se tornar um membro da {akatsuki}?"/>
								<parameter key="message_farewell" value="Até mais!" />

								<parameter key="message_walkaway" value="Até mais!" />
</parameters>
</npc>

 

 

Agora vai em data/npc/scripts e crie um arquivo chamado AkatsukiSystem.lua

e coloque essa script dentro 

Spoiler

-- Script Akatsuki System Advance 1.0 --
-- By RigBy --
-- tibiaking.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 = 1 -- Level preciso pra entra para akatsuki
local itemid = 5943 -- id do coração
local quantidade = 6 -- quantos hearts e preciso
local bonushp = 300000 -- quanto de bonus de life vai ganha
local bonusmp = 30000 -- quanto de bonus de mana vai ganha
local experience = 20 -- Experience rates no caso 2x a experiencia do seu servidor.
local config = {
--[Vocation] = ( Nova Vocation, New Outfit )
[1] = { 5, 549},
[13] = { 14, 550},
[25] = { 26, 555},
[34] = { 35, 551},
[50] = { 51, 563},
[70] = { 71, 556},
}
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, 89745) == -1 then
            if getPlayerLevel(cid) >= level then
                selfSay('Kkkk. Para ser da Membro da Akatsuki, você terá que matar alguns Shinobi, até mesmo seus amigos. Tem certeza que quer ser da 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('KKkkkkkkkkkkkk, acha que é tão simples ? Para ser da Akatsuki você terá que me trazer '..quantidade..' {coraçao} para provar que merece ser da Akatsuki.', cid)
    talkState[talkUser] = 2
end
 
if talkState[talkUser] == 2 and msgcontains(msg, 'coraçao') then
    if getPlayerItemCount(cid, 5943) >= 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, 5943, 6)
        doCreatureAddMana(cid, getCreatureMaxMana(cid))
        setPlayerStorageValue(cid,89745,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())

 

 

Editando a Script:

local level =  1-- Level preciso pra entra para akatsuki 
local itemid = 5943 -- id do coração
local quantidade = 6 -- quantos coração e preciso
local bonushp = 300000 -- quanto de bonus de life vai ganha
local bonusmp = 30000 -- quanto de bonus de mana vai ganha
local experience = 20 -- Experience rates no caso 2x a experiencia do seu servidor.
 
--[Vocation] = ( Nova Vocation, New Outfit )  
[1] = { 5, 549},
[13] = { 14, 550},
[25] = { 26, 555},
[34] = { 35, 551},
[50] = { 51, 563},
[70] = { 71, 556},
}
Essa parte não precisa eu explicar pois está bem claro né ? Rsrs
 
OBS: Se quiser colocar para que quando algum player der Look em um player da akatsuki, " Esse é o player Tibiaking. Ele é Membro da Akatsuki "
Para fazer isso, basta ir em: data/creaturescripts/scripts abra o arquivo showvoc.lua e coloque isso dentro
Spoiler

function onLook(cid, thing, position, lookDistance)
if isPlayer(thing.uid) then
local type = getPlayerStorageValue(thing.uid, 89745)
doPlayerSetSpecialDescription(thing.uid, "\n "..(getPlayerSex(cid) == 0 and "She" or "He").." are "..(type < 0 and "Shinobi" or type == 1 and "Genin" or type == 2 and "Chunin" or type == 3 and "Jounin" or type == 4 and "Anbu" or type == 5 and "Captain Anbu" or type == 6 and "Membro da Akatsuki"))
end
return true
end

 

 

Ta ae a System Akatsuki, bom uso dela! xD

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

Postado

MMHUCMQ.png  Esta é uma mensagem automática, este tópico foi movido para a área correta.
  Regras do fórum: http://www.tibiaking.com/forum/topic/1281-regras-gerais/#comment-7680

Este tópico foi movido:
De: Tibia King > Atendimento Geral
Para: Suporte OTServ > OTServ > Suporte de Scripts

Postado
11 horas atrás, KotZletY disse:

data/npc crei um arquivo .xml e coloque o nome de Tobi

e coloque essa script dentro

  Mostrar conteúdo oculto


<?xml version="1.0" encoding="UTF-8"?>
<npc name="Tobi" script="data/npc/scripts/AkatsukiSystem.lua" walkinterval="2000" speed="0" floorchange="0">
<health now="999999999" max="999999999"/>
<look type="489" head="0" body="0" legs="0" feet="0" addons="0"/>
<parameters>
<parameter key="message_greet" value="Huum, então você quer se tornar um membro da {akatsuki}?"/>
								<parameter key="message_farewell" value="Até mais!" />

								<parameter key="message_walkaway" value="Até mais!" />
</parameters>
</npc>

 

 

Agora vai em data/npc/scripts e crie um arquivo chamado AkatsukiSystem.lua

e coloque essa script dentro 

  Mostrar conteúdo oculto


-- Script Akatsuki System Advance 1.0 --
-- By RigBy --
-- tibiaking.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 = 1 -- Level preciso pra entra para akatsuki
local itemid = 5943 -- id do coração
local quantidade = 6 -- quantos hearts e preciso
local bonushp = 300000 -- quanto de bonus de life vai ganha
local bonusmp = 30000 -- quanto de bonus de mana vai ganha
local experience = 20 -- Experience rates no caso 2x a experiencia do seu servidor.
local config = {
--[Vocation] = ( Nova Vocation, New Outfit )
[1] = { 5, 549},
[13] = { 14, 550},
[25] = { 26, 555},
[34] = { 35, 551},
[50] = { 51, 563},
[70] = { 71, 556},
}
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, 89745) == -1 then
            if getPlayerLevel(cid) >= level then
                selfSay('Kkkk. Para ser da Membro da Akatsuki, você terá que matar alguns Shinobi, até mesmo seus amigos. Tem certeza que quer ser da 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('KKkkkkkkkkkkkk, acha que é tão simples ? Para ser da Akatsuki você terá que me trazer '..quantidade..' {coraçao} para provar que merece ser da Akatsuki.', cid)
    talkState[talkUser] = 2
end
 
if talkState[talkUser] == 2 and msgcontains(msg, 'coraçao') then
    if getPlayerItemCount(cid, 5943) >= 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, 5943, 6)
        doCreatureAddMana(cid, getCreatureMaxMana(cid))
        setPlayerStorageValue(cid,89745,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())

 

 

Editando a Script:

local level =  1-- Level preciso pra entra para akatsuki 
local itemid = 5943 -- id do coração
local quantidade = 6 -- quantos coração e preciso
local bonushp = 300000 -- quanto de bonus de life vai ganha
local bonusmp = 30000 -- quanto de bonus de mana vai ganha
local experience = 20 -- Experience rates no caso 2x a experiencia do seu servidor.
 
--[Vocation] = ( Nova Vocation, New Outfit )  
[1] = { 5, 549},
[13] = { 14, 550},
[25] = { 26, 555},
[34] = { 35, 551},
[50] = { 51, 563},
[70] = { 71, 556},
}
Essa parte não precisa eu explicar pois está bem claro né ? Rsrs
 
OBS: Se quiser colocar para que quando algum player der Look em um player da akatsuki, " Esse é o player Tibiaking. Ele é Membro da Akatsuki "
Para fazer isso, basta ir em: data/creaturescripts/scripts abra o arquivo showvoc.lua e coloque isso dentro
  Mostrar conteúdo oculto


function onLook(cid, thing, position, lookDistance)
if isPlayer(thing.uid) then
local type = getPlayerStorageValue(thing.uid, 89745)
doPlayerSetSpecialDescription(thing.uid, "\n "..(getPlayerSex(cid) == 0 and "She" or "He").." are "..(type < 0 and "Shinobi" or type == 1 and "Genin" or type == 2 and "Chunin" or type == 3 and "Jounin" or type == 4 and "Anbu" or type == 5 and "Captain Anbu" or type == 6 and "Membro da Akatsuki"))
end
return true
end

 

 

Ta ae a System Akatsuki, bom uso dela! xD

 

 

 

quando eu vou criar o NPC Tobi da esse erro

 

[28/02/2016 00:49:10] [Warning - Npc::loadFromXml] Cannot load npc file (data/npc/Tobi.xml).
[28/02/2016 00:49:10] Line: 6, Info: Input is not proper UTF-8, indicate encoding !
[28/02/2016 00:49:10] Bytes: 0xE3 0x6F 0x20 0x76

Postado

Tente usar esse XML:

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Tobi" script="data/npc/scripts/AkatsukiSystem.lua" walkinterval="2000" speed="0" floorchange="0">
<health now="100" max="100"/>
<look type="489" head="0" body="0" legs="0" feet="0" addons="0"/>
    <parameters>
        <parameter key="message_greet" value="Huum, entao voce quer se tornar um membro da {akatsuki}?"/>
        <parameter key="message_farewell" value="Ate mais!" />
        <parameter key="message_walkaway" value="Ate mais!" />
    </parameters>
</npc>

 

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