RI
npc

Akatsuki System Advance 1.0 + Heart System

Por RigBy, 05 de mar. de 2014 em NPCs, monsters e raids

otserv
tibia
script
17
6.4k
RigByR
05 de março de 2014 às 17:07

Akatsuki System

+

Heart System

Introdução

- tava vendo muitas pessoas precisando desses dois sistema então resolvi criar o meu próprio.

- Não ta igual ao do NTOUltimate pois nunca joguei esse servidor.

 

O que tem no Akatsuki system 1.0?

- Verifica se sua vocação pode fazer parte da akatsuki

- Verificar sua vocação e adiciona outra diferente?

- Troca de outfit dependendo da sua vocação

- Da bonus de hp e mp

- Adicionar o nome [Akatsuki] no seu nick exemplo [Akatsuki] RigBy

- Aplica uma storage quando você entra pra akatsuki (com isso da pra você fazer bonusXp)

- storage é 85798723243 valor 1

 

O que tem no Heart System

- Ele só te da o coração se você for acima de tal level

- adiciona o nome da pessoa no coração

 

Vamos la a script

 

Npc.xml

<?xml version="1.0" encoding="UTF-8"?>
<npc name="[Akatsuki] Tobi" script="data/npc/scripts/AkatsukiSystem.lua" walkinterval="2000" speed="0" floorchange="0">
<health now="100" max="100"/>
<look type="128" head="0" body="0" legs="0" feet="0" addons="0"/>
<parameters>
<parameter key="message_greet" value="Hello You who joins {akatsuki}?"/>
</parameters>
</npc>
Npc/Script/AkatsukiSystem.lua
-- Do not remove the credits --
-- [NPC] Akatsuki System --
-- developed by Rigby --
-- Especially for the 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 = 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 config = {
--[Vocation] = ( Nova Vocation, New Outfit )
[1] = { 5, 128},
[2] = { 6, 129},
[3] = { 7, 130},
[4] = { 8, 131},
}
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, 85798723243) == -1 then
            if getPlayerLevel(cid) >= level then
                selfSay('Are you sure you want to join the Akatsuki?.', cid)
                talkState[talkUser] = 1
            else
                selfSay('You there and very weak, vain talk to you when you have level '..level..'.', cid)
            end
        else
            selfSay('You already part of the akatsuki!', cid)
        end
    else
        selfSay('Do not need you now!', cid)
    end
end
 
if talkState[talkUser] == 1 and msgcontains(msg, 'yes') then
    selfSay('To prove their loyalty, you have to bring '..quantidade..' {hearts}.', cid)
    talkState[talkUser] = 2
end
 
if talkState[talkUser] == 2 and msgcontains(msg, 'hearts') 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,85798723243,1)
        db.executeQuery("UPDATE `players` SET `name` = '[Akatsuki] "..getCreatureName(cid).."' WHERE `id` = "..getPlayerGUID(cid)..";")
        addEvent(doRemoveCreature, 5*1000, cid, true) 
        doPlayerSendTextMessage(cid,25,'You will be kicked in 5 seconds to enter the akatsuki!')  
        selfSay('Congratulations now you are part of akatsuki.', cid)
        talkState[talkUser] = 0
    else
        selfSay('No use to fool me, you do not have '..quantidade..' hearts, goes behind.', cid)
    end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Heart System
Creaturescript/script/heartsystem
-- Do not remove the credits --
-- [CREATURESCRIPT] Heart System --
-- developed by Rigby --
-- Especially for the Xtibia.com --
 
function onKill(cid, target, lastHit)
    local item = 5943 -- id do coração
    local level = 300 -- level necessário para tira o coração
    if isPlayer(cid) and isPlayer(target) then
        if getPlayerLevel(target) >= level then
            local add = doPlayerAddItem(cid, item, 1)
            doItemSetAttribute(add, "description","Esse coração é de "..getPlayerName(target).." que foi morto no level "..getPlayerLevel(target).." por "..getPlayerName(cid)..".")
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce Mato " ..getPlayerName(target).. ".")
            doSendMagicEffect(getPlayerPosition(cid),12)
        end
    end
return true
end
Creaturescript.xml Tag

<event type="kill" name="HeartSys" event="script" value="heartsystem.lua"/>
Podem comenta duvidas, opiniões ou melhoramento para que haja a versão 2.0

Editado Junho 26 por RigBy

Junior001J
05 de março de 2014 às 17:14

Se tornando um ótimo scripter em :) parabéns script muito bom vou testar aqui :)

05 de março de 2014 às 19:32

Boa ! continue assim trazendo ótimos conteúdos pro fórum.

CreatservC
05 de março de 2014 às 20:14

Ae ate que fim system akatsuki igual nto ultimate ele esta pensando que só ele saber fazer kkkkkkk. Duas pergunta esse script ganha 20% exp a mais.

A outra cê pode ajuda com o system edo tensei iguail ntoultimate se puder eu agradeço.

Vamos acaba com esse negocio de arruma system e não complatilha.

Editado Março 5 por Creatserv

RigByR
05 de março de 2014 às 20:45

@Junior 001

Vlw, totalmente funcional.

 

@DuuhCarvalho

Obrigado.

 

@Creatserv

Nunca joguei Nto ,eu sique tenho o tibia 8.54 no PC então não sei se fico totalmente igual ao do nto. Pois eu fiz esse me baseando nos pedidos de script

Não da bonus de xp mais se você criar uma script que cheque a storage que eu pois la em cima vai funciona.

Cria um topico la no pedido e duvidas que eu vejo como funciona e tento fazer.

05 de março de 2014 às 20:48

=) Você evoluiu muito desde quando começou a frequentar o fórum, Ótimo script amigo, sucesso ai.

CreatservC
06 de março de 2014 às 19:46

Eu jah crie la topico edo tensei em pedidos e duvidas. Outra coisa tem como coloka pra quando da look mostra que é membro akatsuki. Tipo uma graduaçaõ.

É pq mano eu ñ queria que fica-se o nome akatsuki no nick e sim na hora que desse look. Pra ñ atrapalha o nome do pl

ayer. Eu penso assim, mim descupe se estou abusando d+. Agora se pode ajuda, só falta isso msm pra o script fica ótimo pra min, vlw.

Editado Março 6 por Creatserv

RigByR
07 de março de 2014 às 10:26

Hmm, ok

passei 2 dias sem net então daqui pra segunda eu posto a versão 2.0 com algumas modificações.

CreatservC
07 de março de 2014 às 11:13

espero que vc coloke pra ficar monstrando que é da akatsuki

2 semanas depois...
14 de março de 2014 às 16:15

Rigby ta dando um erro no npc, algo envolvido com callback, depois que fala hearts.

Editado Março 14 por ErenJaeger

RigByR
14 de março de 2014 às 19:20

Eu testei no TFS 0.4(8.60) e não deu nenhum erro mas se você informa o erro depois eu tento resolver pra você.

CreatservC
14 de março de 2014 às 23:38

eu testeii tb mas essas mensagem n aparece.

2 semanas depois...
DbkoD
28 de março de 2014 às 14:23

Aki pego Normal Vai Ajudar a Muito Systema Igual Do Notultimate KKK Saiu Igualzinho

1 ano depois...
istreekI
22 de setembro de 2015 às 19:26

Perdoe-me por reviver o tópico mas, o que eu ponho aqui?

 

 

--[Vocation] = ( Nova Vocation, New Outfit )
[1] = { 5, 128},
[2] = { 6, 129},
[3] = { 7, 130},
[4] = { 8, 131},
}

 

1 mês depois...
caiovinibcC
18 de outubro de 2015 às 01:24

To prescisando da mesma coisa /\

e o Heart System não tá funcionando...