Ir para conteúdo
  • Cadastre-se

Como cria novas classes e como por pra nasce com itens da class


Posts Recomendados

Ola Galera eu to usando mapa global v10.00 e super otimo estou criando um ot encima dele, bom eu queria sabe como cria novas classes "vocaçoes" alem do padrao que e sorcerer, druid knight, e paladin

 

queria cria +2 classes chamadas "Hell man& e Mega Hammer"

Hell man usa livros "como armas" e "Mega Hammer" usa Esculdo e Hammer

 

queria sabe tambem como por os chars para nascerem com determinados itens da sua vocaçao.

bom preciso dessa informaçoes quem puder min ajuda eu agradeço

Link para o post
Compartilhar em outros sites

Bom para criar novas vocações é só modificar em DATA/XML/vocations.xml.

Para nascerem com determinados itens é só modificar:

data/screaturescripts/scripts/firstitems.lua
 

function onLogin(cid)
if getPlayerGroupId(cid) == 1 and getPlayerStorageValue(cid, 50000) == -1 then
if isSorcerer(cid) then
local bag = doPlayerAddItem(cid, 9774, 1)

doAddContainerItem(bag, 2120, 1)
doAddContainerItem(bag, 2554, 1)
doAddContainerItem(bag, 2152, 20)
doAddContainerItem(bag, 2789, 20)

doPlayerAddItem(cid, 2525, 1)
doPlayerAddItem(cid, 2190, 1)
doPlayerAddItem(cid, 2463, 1)
doPlayerAddItem(cid, 2457, 1)
doPlayerAddItem(cid, 2647, 1)
doPlayerAddItem(cid, 2643, 1)

setPlayerStorageValue(cid, 50000, 1)

elseif isDruid(cid) then
local bag = doPlayerAddItem(cid, 9774, 1)
doAddContainerItem(bag, 2120, 1)
doAddContainerItem(bag, 2554, 1)
doAddContainerItem(bag, 2152, 20)
doAddContainerItem(bag, 2789, 20)

doPlayerAddItem(cid, 2525, 1)
doPlayerAddItem(cid, 2182, 1)
doPlayerAddItem(cid, 2463, 1)
doPlayerAddItem(cid, 2457, 1)
doPlayerAddItem(cid, 2647, 1)
doPlayerAddItem(cid, 2643, 1)

setPlayerStorageValue(cid, 50000, 1)

elseif isPaladin(cid) then
local bag = doPlayerAddItem(cid, 9774, 1)
doAddContainerItem(bag, 2120, 1)
doAddContainerItem(bag, 2554, 1)
doAddContainerItem(bag, 2152, 20)
doAddContainerItem(bag, 2789, 20)

doPlayerAddItem(cid, 2389, 3)
doPlayerAddItem(cid, 2525, 1)
doPlayerAddItem(cid, 2457, 1)
doPlayerAddItem(cid, 2643, 1)
doPlayerAddItem(cid, 2647, 1)
doPlayerAddItem(cid, 2463, 1)
setPlayerStorageValue(cid, 50000, 1)

elseif isKnight(cid) then
local bag = doPlayerAddItem(cid, 9774, 1)
doAddContainerItem(bag, 2120, 1)
doAddContainerItem(bag, 2554, 1)
doAddContainerItem(bag, 2152, 20)
doAddContainerItem(bag, 8601, 1)
doAddContainerItem(bag, 2383, 1)
doAddContainerItem(bag, 2417, 1)
doAddContainerItem(bag, 2789, 20)


doPlayerAddItem(cid, 2525, 1)
doPlayerAddItem(cid, 2463, 1)
doPlayerAddItem(cid, 2457, 1)
doPlayerAddItem(cid, 2647, 1)
doPlayerAddItem(cid, 2643, 1)

setPlayerStorageValue(cid, 50000, 1)
end
end
return TRUE
end

creaturescrips.xml

<event type="login" name="FirstItems" event="script" value="firstitems.lua"/>

data/screaturescripts/scripts/login.lua
Só adiciona o registro lá ..

registerCreatureEvent(cid, "FirstItems")

créditos: fausto

 

Para adicionar novos itens para uma nova vocação é só adicionar:

elseif isVOCAÇÃO(cid) then
local bag = doPlayerAddItem(cid, 9774, 1)
doAddContainerItem(bag, 2120, 1)
doAddContainerItem(bag, 2554, 1)
doAddContainerItem(bag, 2152, 20)
doAddContainerItem(bag, 8601, 1)
doAddContainerItem(bag, 2383, 1)
doAddContainerItem(bag, 2417, 1)
doAddContainerItem(bag, 2789, 20)

Poem o nome da vocação aqui: 

elseif isVOCAÇÃO(cid) then

Se não funcionar tente:

local commonItems = {
-- ITEMS ALL VOCS RECEIVE
{itemid=2120, count=1}, -- rope
{itemid=5710, count=1}, -- shovel
{itemid=1988, count=1}, -- backpack
}

local firstItems = {
{ -- SORC ITEMS
{itemid=2482, count=1}, -- hat
{itemid=2484, count=1}, -- cape
{itemid=2468, count=1}, -- legs
{itemid=2643, count=1}, -- bots
{itemid=2175, count=1}, -- spellbook
{itemid=2412, count=1}, -- katana
},
{ -- DRUID ITEMS
{itemid=2323, count=1}, -- hat of the mad
{itemid=8871, count=1}, -- focus cape
{itemid=7730, count=1}, -- blue legs
{itemid=2195, count=1}, -- boots of haste
{itemid=8902, count=1}, -- spellbook of mind control
{itemid=2183, count=1}, -- hailstorm rod

{itemid=2268, count=1}, -- sd
{itemid=2273, count=1}, -- uh
{itemid=7590, count=1}, -- gmp
{itemid=2293, count=1}, -- mw
{itemid=2269, count=1}, -- wg
{itemid=2278, count=1}, -- para
},
{ -- PALADIN ITEMS
{itemid=2482, count=1}, -- hat
{itemid=2484, count=1}, -- cape
{itemid=2468, count=1}, -- legs
{itemid=2643, count=1}, -- bots
{itemid=2175, count=1}, -- spellbook
{itemid=5907, count=1}, -- slingshot
},
{ -- KNIGHT ITEMS
{itemid=2493, count=1}, -- demon helmet
{itemid=2472, count=1}, -- magic plate armor
{itemid=2470, count=1}, -- golden legs
{itemid=2195, count=1}, -- boots of haste
{itemid=2514, count=1}, -- mastermind shield
{itemid=2431, count=1}, -- Stonecutter Axe

{itemid=7620, count=1}, -- mp
{itemid=7591, count=1}, -- ghp
{itemid=8473, count=1}, -- uhp
{itemid=2313, count=1}, -- explosion
{itemid=2293, count=1}, -- mw
}
}

for _, items in ipairs(firstItems) do
for _, item in ipairs(commonItems) do
table.insert(items, item)
end
end

function onLogin(cid)
if getPlayerGroupId(cid) < 2 then
local hasReceivedFirstItems = getPlayerStorageValue(cid, 67708)

if hasReceivedFirstItems == -1 then
--[[local backpack = ]]doPlayerAddItem(cid, 1988, 1)

local giveItems = firstItems[getPlayerVocation(cid)]

if giveItems ~= nil then
for _, v in ipairs(giveItems) do
--doAddContainerItem(backpack, v.itemid, v.count or 1)
doPlayerAddItem(cid, v.itemid, v.count or 1)
end

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have recieved your equipment")
setPlayerStorageValue(cid, 67708, 1)
end
end
end
return TRUE
end
<event type="login" name="FirstItems" event="script" value="firstitems.lua"/>

Link para o post
Compartilhar em outros sites

bom eu estou com seguinte problema editei certo e talz aew quando inicio servidor da falha

bom amanha vou posta os arquivos se voces poderem min ajuda

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.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo