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