JU

Adicionando Iens Acc Manager

Por juliano2008, 16 de dez. de 2009 em Archived

script
5
999
juliano2008J
16 de dezembro de 2009 às 17:58

Gostaria de saber como add itens ao ACC Manager, provavelmente é por script né?

 

Pois meu map global, vem com quest de First Itens, mas no momento não está dando muito certo, ai queria saber como add os itens direto no ACC Manager, pra quando o cara logar ja tar os itens.

 

Obrigado.

DoidinD
16 de dezembro de 2009 às 18:20

Cara, vá em creaturescripts.xml e adicione isto lá, caso já tenha dexe lá:

 

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

 

Agora vá na pasta scripts, faça um arquivo .lua renomeie para firstitems.lua e coloque isto dentro dele:

 

local firstItems = {}
firstItems[0] =
{
2173,
2525,
3965,
2124,
2457,
2647,
2643
}
firstItems[1] =
{
2173,
2525,
2190,
2124,
2457,
2647,
2643
}
firstItems[2] =
{
2173,
2525,
2182,
2124,
2457,
2647,
2643
}
firstItems[3] =
{
2173,
2525,
2399,
2124,
2457,
2647,
2643
}
firstItems[4] =
{
2173,
2525,
2428,
2124,
2457,
2647,
2643
}

function onLogin(cid)
if getPlayerStorageValue(cid, 30001) == -1 then
for i = 1, table.maxn(firstItems[getPlayerVocation(cid)]) do
doPlayerAddItem(cid, firstItems[getPlayerVocation(cid)][i], 1)
end
if getPlayerSex(cid) == 0 then
doPlayerAddItem(cid, 2463, 1)
else
doPlayerAddItem(cid, 2463, 1)
end
local bag = doPlayerAddItem(cid, 10521, 1)
doAddContainerItem(bag, 2160, 2)
doAddContainerItem(bag, 2554, 1)
doAddContainerItem(bag, 2120, 1)
doAddContainerItem(bag, 7618, 1)
setPlayerStorageValue(cid, 30001, 1)
end
return TRUE
end

Pronto, agora é só tirar a quest dos firsts items :)

Me passa o IP do seu ot pra eu jogar lá :)

juliano2008J
16 de dezembro de 2009 às 18:51

Cara, eu ja tentei isso, porém da sempre erro quando vou ligar o OT, veja abaixo como ta a situação:

 

http://img198.imageshack.us/i/errofree2.jpg/

 

http://img519.imageshack.us/i/errofree3.jpg/

 

http://img6.imageshack.us/i/errofree4.jpg/

 

http://img192.imageshack.us/i/errofree.jpg/

 

OBS: Quando eu retiro o freeitems, o OT volta a ligar normalmente =/

 

 

SukxS
16 de dezembro de 2009 às 20:04

acho que o erro está no creaturescripts.xml (imagem 1).

1. Está assim:

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

 

Troque por isso:

 

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

</creaturescripts>

 

 

2. Abra o arquivo firstitems.lua, apague tudo que tem dentro e cole isso:

-- FirstItems edited by: Sukx --
local firstItems =
{
    2173,
    2516,
    2124,
    2457,
    2647,
    2643
}

function onLogin(cid)
    if getPlayerStorageValue(cid, 30001) == -1 then
        for i = 1, table.maxn(firstItems) do
            doPlayerAddItem(cid, firstItems[i], 1)
        end
        if getPlayerSex(cid) == 0 then
            doPlayerAddItem(cid, 2463, 1)
        else
            doPlayerAddItem(cid, 2463, 1)
        end

        if isSorcerer(cid) then
        local bag = doPlayerAddItem(cid, 7342, 1)
        doAddContainerItem(bag, 7343, 1)
        doAddContainerItem(bag, 2160, 2)
        doAddContainerItem(bag, 2666, 3)
        doAddContainerItem(bag, 2190, 1)
        doAddContainerItem(bag, 2554, 1)
        doAddContainerItem(bag, 2120, 1)
        setPlayerStorageValue(cid, 30001, 1)

        elseif isDruid(cid) then
        local bag = doPlayerAddItem(cid, 7342, 1)
        doAddContainerItem(bag, 7343, 1)
        doAddContainerItem(bag, 2160, 2)
        doAddContainerItem(bag, 2666, 3)
        doAddContainerItem(bag, 2182, 1)
        doAddContainerItem(bag, 2554, 1)
        doAddContainerItem(bag, 2120, 1)
        setPlayerStorageValue(cid, 30001, 1)

        elseif isPaladin(cid) then
        local bag = doPlayerAddItem(cid, 7342, 1)
        doAddContainerItem(bag, 7343, 1)
        doAddContainerItem(bag, 2160, 2)
        doAddContainerItem(bag, 2666, 3)
        doAddContainerItem(bag, 2399, 1)
        doAddContainerItem(bag, 2554, 1)
        doAddContainerItem(bag, 2120, 1)
        setPlayerStorageValue(cid, 30001, 1)

        elseif isKnight(cid) then
        local bag = doPlayerAddItem(cid, 7342, 1)
        doAddContainerItem(bag, 7343, 1)
        doAddContainerItem(bag, 2160, 2)
        doAddContainerItem(bag, 2666, 3)
        doAddContainerItem(bag, 2394, 1)
        doAddContainerItem(bag, 2428, 1)
        doAddContainerItem(bag, 2383, 1)
        doAddContainerItem(bag, 2554, 1)
        doAddContainerItem(bag, 2120, 1)
        setPlayerStorageValue(cid, 30001, 1)
        end
    end
    return TRUE
end

 

 

agora veja se funciona :D

Editado Dezembro 16 por Sukx

juliano2008J
16 de dezembro de 2009 às 20:17

Nem preciso mais, dei um jeito aqui, como o do Styller Yourots tava funfando, eu apenas deixei o Firstitems dele, ai pus na pasta do Serv Full 3.5 ^^

 

Ai deu ta tudo normal aqui agora, mas vlw.