Ir para conteúdo
Entre para seguir isso  
Ithash151

[7.6] Npc Account Manager cria VIP Tbm

Recommended Posts

Ithash151    0
Ithash151

Olá galera esse é o meu primeiro tuto entaum dá uma culher de chá ai...

Vamos lá Crie um arquivo com o nome de Criar Sorc.xml na pasta npc

e dentro dele coloque:

<?xml version="1.0"?>

<npc name="Criar Sorc" script="data/npc/scripts/acc1.lua" access="3">

<look type="104" head="4" body="114" legs="132" feet="115"/>

</npc>

depois criei um arquivo com o nome de acc1.lua dentro da pasta script e dentro dele coloque:

 

focus = 0

talk_start = 0

target = 0

following = false

attacking = false

accstatus = 0

seksik = 3

myname = ''

mypass = ''

maxnamelen = 10

maxpasslen = 14

allow_pattern = '^[a-zA-Z0-9 -]+$'

origmsg = ''

mypasscheck = ''

mynamecheck = ''

 

function onThingMove(creature, thing, oldpos, oldstackpos)

 

end

 

 

function onCreatureAppear(creature)

 

end

 

 

function onCreatureDisappear(cid, pos)

if focus == cid then

selfSay('Good bye then.')

focus = 0

talk_start = 0

end

end

 

 

function onCreatureTurn(creature)

 

end

function msgcontains(txt, str)

return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))

end

 

 

function onCreatureSay(cid, type, msg)

origmsg = msg

msg = string.lower(msg)

 

 

 

if (msgcontains(msg, 'hi') and focus == 0) and getDistanceToCreature(cid) < 4 then

selfSay('Hello...Male or Female?')

accstatus = 1

myname = ''

mypass = ''

myaccnumber = 0

seksik = 0

focus = cid

talk_start = os.clock()

 

 

elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then

selfSay('Please wait')

 

 

elseif focus == cid then

talk_start = os.clock()

 

 

 

if msgcontains(msg, 'male') and accstatus == 1 then

selfSay('Your name is...?')

seksik = 1

accstatus = 2

elseif msgcontains(msg, 'female') and accstatus == 1 then

selfSay('Your name is...?')

seksik = 0

accstatus = 2

 

 

elseif accstatus == 2 then

myname = origmsg

mynamecheck = msg

if string.len(mynamecheck) <= maxnamelen then

if string.find(mynamecheck, allow_pattern) then

if io.open("data/players/"..myname..".xml" , "r") == nil then

selfSay('Your Name is '..myname..'. yes ?')

accstatus = 3

else

selfSay('Name allready exist, please give next one')

end

else

selfSay('Illegal characters, try another')

end

else

selfSay('Name is too long! Max is 10, try again')

end

elseif msgcontains(msg, 'yes') then

if accstatus == 3 then

selfSay('Ok, give your password')

accstatus = 4

elseif accstatus == 5 then

if seksik == 0 then

selfSay('Ok. Lets check: You are female, your name is '..myname..', your password is '..mypass..'.yes ?')

else

selfSay('Ok. Lets check: You are male, your name is '..myname..', your password is '..mypass..'.yes ?')

end

accstatus = 10

elseif accstatus == 10 then

selfSay('Ok. Say "acc" to take your acc...')

accstatus = 7

end

elseif msgcontains(msg, 'no') then

if accstatus == 3 then

selfSay('Chooze another')

accstatus = 2

elseif accstatus == 5 then

selfSay('Chooze another')

accstatus = 4

elseif accstatus == 6 then

selfSay('Again, you are man or woman?')

accstatus = 1

end

elseif accstatus == 4 then

mypass = origmsg

mypasscheck = msg

if string.len(mypasscheck) <= maxpasslen then

if string.find(mypasscheck, allow_pattern) then

selfSay('Your pass is '..mypass..' yes ?')

accstatus = 5

else

selfSay('Illegal characters, try another')

end

else

selfSay('too long! Max is 6, give other')

end

 

elseif msgcontains(msg, 'acc') and accstatus == 7 then

myaccnumber = math.random(100000,999999)

if io.open("data/accounts/"..myaccnumber..".xml" , "r") == nil then

selfSay('Your Acc is '..myaccnumber..'. Please Log in your Char...Good Luck!')

accstatus = 8

f = assert(io.open("./data/accounts/"..myaccnumber..".xml", "w"))

f = io.open("./data/accounts/"..myaccnumber..".xml", "w")

f:write("<?xml version=\"1.0\"?><account pass=\""..mypass.."\" type=\"1\" premDays=\"0\"><characters><character name=\""..myname.."\"\/><\/characters><\/account>")

f:close()

 

f = assert(io.open("./data/players/"..myname..".xml", "w"))

f = io.open("./data/players/"..myname..".xml", "w")

f:write("<?xml version=\"1.0\"?><player name=\""..myname.."\" account=\""..myaccnumber.."\" sex=\""..seksik.."\" lookdir=\"3\" exp=\"4200\" voc=\"1\" level=\"8\" access=\"0\" cap=\"470\" maglevel=\"1\" lastlogin=\"0\" premticks=\"0\" promoted=\"0\" banned=\"0\"><spawn x=\"438\" y=\"503\" z=\"7\"\/><temple x=\"438\" y=\"503\" z=\"8\"\/><skull type=\"0\" kills=\"0\" ticks=\"0\" absolve=\"0\"\/><health now=\"185\" max=\"185\" food=\"1000\"\/><mana now=\"35\" max=\"35\" spent=\"1\"\/><look type=\"134\" head=\"77\" body=\"79\" legs=\"78\" feet=\"77\"\/><skills><skill skillid=\"0\" level=\"10\" tries=\"0\"\/><skill skillid=\"1\" level=\"10\" tries=\"0\"\/><skill skillid=\"2\" level=\"10\" tries=\"0\"\/><skill skillid=\"3\" level=\"10\" tries=\"0\"\/><skill skillid=\"4\" level=\"10\" tries=\"0\"\/><skill skillid=\"5\" level=\"10\" tries=\"0\"\/><skill skillid=\"6\" level=\"10\" tries=\"0\"\/><\/skills><spells><spell words=\"utevo lux\"\/><\/spells><deaths\/><inventory><slot slotid=\"1\"><item id=\"2490\"\/><\/slot><slot slotid=\"3\"><item id=\"1988\"><inside><item id=\"2674\" count=\"5\"\/><\/inside><\/item><\/slot><slot slotid=\"4\"><item id=\"2463\"\/><\/slot><slot slotid=\"5\"><item id=\"2525\"\/><\/slot><slot slotid=\"6\"><item id=\"2190\"\/><\/slot><slot slotid=\"7\"><item id=\"2647\"\/><\/slot><slot slotid=\"8\"><item id=\"2643\"\/><\/slot><\/inventory><depots><depot depotid=\"1\"><item id=\"2591\"><inside><item id=\"2594\"\/><\/inside><\/item><\/depot><\/depots><storage><data key=\"777\" value=\""..seksik.."\"\/><\/storage><\/player>")

f:close()

 

f = assert(io.open("./data/vip/"..myaccnumber..".xml", "w"))

f = io.open("./data/vip/"..myaccnumber..".xml", "w")

f:write("<?xml version=\"1.0\"?><vips/>")

f:close()

else

selfSay('Error number allready exist. Say again "acc" ')

end

 

elseif msgcontains(msg, 'next') and accstatus == 8 then

selfSay(''..myaccnumber..' Pass is '..mypass..' . If you like to enter OTS website say: --links--.')

accstatus = 0

elseif msgcontains(msg, 'links') then

selfSay('URLS')

 

 

 

 

elseif string.find(msg, '(%a*)bye(%a*)') and getDistanceToCreature(cid) < 4 then

selfSay('Good bye, ' .. creatureGetName(cid) .. '!')

focus = 0

accstatus = 0

myname = ''

mypass = ''

myaccnumber = 0

seksik = ''

talk_start = 0

end

end

end

 

 

function onCreatureChangeOutfit(creature)

 

end

 

 

function onThink()

if (os.clock() - talk_start) > 30 then

if focus > 0 then

selfSay('Nastepny prosze')

end

focus = 0

end

if focus ~= 0 then

if getDistanceToCreature(focus) > 5 then

selfSay('Do zobaczenia')

focus = 0

end

end

end

==========================================================

Agora vamos criar o Knight:

criei um arquivo com o nome de Criar Knight.xml na pasta npc

e dentro dele coloque:

<?xml version="1.0"?>

<npc name="Criar Knight" script="data/npc/scripts/acc3.lua" access="3">

<look type="104" head="4" body="114" legs="132" feet="115"/>

</npc>

e depois o arquivo acc3.lua na pasta scripts

e dentro dele coloque:

focus = 0

talk_start = 0

target = 0

following = false

attacking = false

accstatus = 0

seksik = 3

myname = ''

mypass = ''

maxnamelen = 10

maxpasslen = 14

allow_pattern = '^[a-zA-Z0-9 -]+$'

origmsg = ''

mypasscheck = ''

mynamecheck = ''

 

function onThingMove(creature, thing, oldpos, oldstackpos)

 

end

 

 

function onCreatureAppear(creature)

 

end

 

 

function onCreatureDisappear(cid, pos)

if focus == cid then

selfSay('Good bye then.')

focus = 0

talk_start = 0

end

end

 

 

function onCreatureTurn(creature)

 

end

function msgcontains(txt, str)

return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))

end

 

 

function onCreatureSay(cid, type, msg)

origmsg = msg

msg = string.lower(msg)

 

 

 

if (msgcontains(msg, 'hi') and focus == 0) and getDistanceToCreature(cid) < 4 then

selfSay('Hello...Male or Female?')

accstatus = 1

myname = ''

mypass = ''

myaccnumber = 0

seksik = 0

focus = cid

talk_start = os.clock()

 

 

elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then

selfSay('Please wait')

 

 

elseif focus == cid then

talk_start = os.clock()

 

 

 

if msgcontains(msg, 'male') and accstatus == 1 then

selfSay('Your name is...?')

seksik = 1

accstatus = 2

elseif msgcontains(msg, 'female') and accstatus == 1 then

selfSay('Your name is...?')

seksik = 0

accstatus = 2

 

 

elseif accstatus == 2 then

myname = origmsg

mynamecheck = msg

if string.len(mynamecheck) <= maxnamelen then

if string.find(mynamecheck, allow_pattern) then

if io.open("data/players/"..myname..".xml" , "r") == nil then

selfSay('Your Name is '..myname..'. yes ?')

accstatus = 3

else

selfSay('Name allready exist, please give next one')

end

else

selfSay('Illegal characters, try another')

end

else

selfSay('Name is too long! Max is 10, try again')

end

elseif msgcontains(msg, 'yes') then

if accstatus == 3 then

selfSay('Ok, give your password')

accstatus = 4

elseif accstatus == 5 then

if seksik == 0 then

selfSay('Ok. Lets check: You are female, your name is '..myname..', your password is '..mypass..'.yes ?')

else

selfSay('Ok. Lets check: You are male, your name is '..myname..', your password is '..mypass..'.yes ?')

end

accstatus = 10

elseif accstatus == 10 then

selfSay('Ok. Say "acc" to take your acc...')

accstatus = 7

end

elseif msgcontains(msg, 'no') then

if accstatus == 3 then

selfSay('Chooze another')

accstatus = 2

elseif accstatus == 5 then

selfSay('Chooze another')

accstatus = 4

elseif accstatus == 6 then

selfSay('Again, you are man or woman?')

accstatus = 1

end

elseif accstatus == 4 then

mypass = origmsg

mypasscheck = msg

if string.len(mypasscheck) <= maxpasslen then

if string.find(mypasscheck, allow_pattern) then

selfSay('Your pass is '..mypass..' yes ?')

accstatus = 5

else

selfSay('Illegal characters, try another')

end

else

selfSay('too long! Max is 6, give other')

end

 

elseif msgcontains(msg, 'acc') and accstatus == 7 then

myaccnumber = math.random(100000,999999)

if io.open("data/accounts/"..myaccnumber..".xml" , "r") == nil then

selfSay('Your Acc is '..myaccnumber..'. Please Log in your Char...Good Luck!')

accstatus = 8

f = assert(io.open("./data/accounts/"..myaccnumber..".xml", "w"))

f = io.open("./data/accounts/"..myaccnumber..".xml", "w")

f:write("<?xml version=\"1.0\"?><account pass=\""..mypass.."\" type=\"1\" premDays=\"0\"><characters><character name=\""..myname.."\"\/><\/characters><\/account>")

f:close()

 

f = assert(io.open("./data/players/"..myname..".xml", "w"))

f = io.open("./data/players/"..myname..".xml", "w")

f:write("<?xml version=\"1.0\"?><player name=\""..myname.."\" account=\""..myaccnumber.."\" sex=\""..seksik.."\" lookdir=\"3\" exp=\"4200\" voc=\"4\" level=\"8\" access=\"0\" cap=\"470\" maglevel=\"1\" lastlogin=\"0\" premticks=\"0\" promoted=\"0\" banned=\"0\"><spawn x=\"438\" y=\"503\" z=\"7\"\/><temple x=\"438\" y=\"503\" z=\"8\"\/><skull type=\"0\" kills=\"0\" ticks=\"0\" absolve=\"0\"\/><health now=\"185\" max=\"185\" food=\"1000\"\/><mana now=\"35\" max=\"35\" spent=\"1\"\/><look type=\"134\" head=\"77\" body=\"79\" legs=\"78\" feet=\"77\"\/><skills><skill skillid=\"0\" level=\"10\" tries=\"0\"\/><skill skillid=\"1\" level=\"10\" tries=\"0\"\/><skill skillid=\"2\" level=\"10\" tries=\"0\"\/><skill skillid=\"3\" level=\"10\" tries=\"0\"\/><skill skillid=\"4\" level=\"10\" tries=\"0\"\/><skill skillid=\"5\" level=\"10\" tries=\"0\"\/><skill skillid=\"6\" level=\"10\" tries=\"0\"\/><\/skills><spells><spell words=\"utevo lux\"\/><\/spells><deaths\/><inventory><slot slotid=\"1\"><item id=\"2490\"\/><\/slot><slot slotid=\"3\"><item id=\"1988\"><inside><item id=\"2674\" count=\"5\"\/><\/inside><\/item><\/slot><slot slotid=\"4\"><item id=\"2463\"\/><\/slot><slot slotid=\"5\"><item id=\"2525\"\/><\/slot><slot slotid=\"6\"><item id=\"2383\"\/><\/slot><slot slotid=\"7\"><item id=\"2647\"\/><\/slot><slot slotid=\"8\"><item id=\"2643\"\/><\/slot><\/inventory><depots><depot depotid=\"1\"><item id=\"2591\"><inside><item id=\"2594\"\/><\/inside><\/item><\/depot><\/depots><storage><data key=\"777\" value=\""..seksik.."\"\/><\/storage><\/player>")

f:close()

 

f = assert(io.open("./data/vip/"..myaccnumber..".xml", "w"))

f = io.open("./data/vip/"..myaccnumber..".xml", "w")

f:write("<?xml version=\"1.0\"?><vips/>")

f:close()

else

selfSay('Error number allready exist. Say again --rand-- ')

end

 

 

 

elseif msgcontains(msg, 'next') and accstatus == 8 then

selfSay(''..myaccnumber..' Pass is '..mypass..' . If you like to enter OTS website say: --links--.')

accstatus = 0

elseif msgcontains(msg, 'links') then

selfSay('URLS')

 

 

 

 

elseif string.find(msg, '(%a*)bye(%a*)') and getDistanceToCreature(cid) < 4 then

selfSay('Good bye, ' .. creatureGetName(cid) .. '!')

focus = 0

accstatus = 0

myname = ''

mypass = ''

myaccnumber = 0

seksik = ''

talk_start = 0

end

end

end

 

 

function onCreatureChangeOutfit(creature)

 

end

 

 

function onThink()

if (os.clock() - talk_start) > 30 then

if focus > 0 then

selfSay('Nastepny prosze')

end

focus = 0

end

if focus ~= 0 then

if getDistanceToCreature(focus) > 5 then

selfSay('Do zobaczenia')

focus = 0

end

end

end

==========================================================

Agora vamos criar o pally:

criei um arquivo com o nome de Criar Pally.xml dentro da pasta npc

e coloque isso dentro dele

<?xml version="1.0"?>

<npc name="Criar Pally" script="data/npc/scripts/acc4.lua" access="3">

<look type="104" head="4" body="114" legs="132" feet="115"/>

</npc>

e depois crie um arquivo com o nome de acc4.lua

e cole isso dentro dele:

focus = 0

talk_start = 0

target = 0

following = false

attacking = false

accstatus = 0

seksik = 3

myname = ''

mypass = ''

maxnamelen = 10

maxpasslen = 14

allow_pattern = '^[a-zA-Z0-9 -]+$'

origmsg = ''

mypasscheck = ''

mynamecheck = ''

 

function onThingMove(creature, thing, oldpos, oldstackpos)

 

end

 

 

function onCreatureAppear(creature)

 

end

 

 

function onCreatureDisappear(cid, pos)

if focus == cid then

selfSay('Good bye then.')

focus = 0

talk_start = 0

end

end

 

 

function onCreatureTurn(creature)

 

end

function msgcontains(txt, str)

return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))

end

 

 

function onCreatureSay(cid, type, msg)

origmsg = msg

msg = string.lower(msg)

 

 

 

if (msgcontains(msg, 'hi') and focus == 0) and getDistanceToCreature(cid) < 4 then

selfSay('Hello...Male or Female?')

accstatus = 1

myname = ''

mypass = ''

myaccnumber = 0

seksik = 0

focus = cid

talk_start = os.clock()

 

 

elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then

selfSay('Please wait')

 

 

elseif focus == cid then

talk_start = os.clock()

 

 

 

if msgcontains(msg, 'male') and accstatus == 1 then

selfSay('Your name is...?')

seksik = 1

accstatus = 2

elseif msgcontains(msg, 'female') and accstatus == 1 then

selfSay('Your name is...?')

seksik = 0

accstatus = 2

 

 

elseif accstatus == 2 then

myname = origmsg

mynamecheck = msg

if string.len(mynamecheck) <= maxnamelen then

if string.find(mynamecheck, allow_pattern) then

if io.open("data/players/"..myname..".xml" , "r") == nil then

selfSay('Your Name is '..myname..'. yes ?')

accstatus = 3

else

selfSay('Name allready exist, please give next one')

end

else

selfSay('Illegal characters, try another')

end

else

selfSay('Name is too long! Max is 10, try again')

end

elseif msgcontains(msg, 'yes') then

if accstatus == 3 then

selfSay('Ok, give your password')

accstatus = 4

elseif accstatus == 5 then

if seksik == 0 then

selfSay('Ok. Lets check: You are female, your name is '..myname..', your password is '..mypass..'.yes ?')

else

selfSay('Ok. Lets check: You are male, your name is '..myname..', your password is '..mypass..'.yes ?')

end

accstatus = 10

elseif accstatus == 10 then

selfSay('Ok. Say "acc" to take your acc...')

accstatus = 7

end

elseif msgcontains(msg, 'no') then

if accstatus == 3 then

selfSay('Chooze another')

accstatus = 2

elseif accstatus == 5 then

selfSay('Chooze another')

accstatus = 4

elseif accstatus == 6 then

selfSay('Again, you are man or woman?')

accstatus = 1

end

elseif accstatus == 4 then

mypass = origmsg

mypasscheck = msg

if string.len(mypasscheck) <= maxpasslen then

if string.find(mypasscheck, allow_pattern) then

selfSay('Your pass is '..mypass..' yes ?')

accstatus = 5

else

selfSay('Illegal characters, try another')

end

else

selfSay('too long! Max is 6, give other')

end

 

elseif msgcontains(msg, 'acc') and accstatus == 7 then

myaccnumber = math.random(100000,999999)

if io.open("data/accounts/"..myaccnumber..".xml" , "r") == nil then

selfSay('Your Acc is '..myaccnumber..'. Please Log in your Char...Good Luck!')

accstatus = 8

f = assert(io.open("./data/accounts/"..myaccnumber..".xml", "w"))

f = io.open("./data/accounts/"..myaccnumber..".xml", "w")

f:write("<?xml version=\"1.0\"?><account pass=\""..mypass.."\" type=\"1\" premDays=\"0\"><characters><character name=\""..myname.."\"\/><\/characters><\/account>")

f:close()

 

f = assert(io.open("./data/players/"..myname..".xml", "w"))

f = io.open("./data/players/"..myname..".xml", "w")

f:write("<?xml version=\"1.0\"?><player name=\""..myname.."\" account=\""..myaccnumber.."\" sex=\""..seksik.."\" lookdir=\"3\" exp=\"4200\" voc=\"3\" level=\"8\" access=\"0\" cap=\"470\" maglevel=\"1\" lastlogin=\"0\" premticks=\"0\" promoted=\"0\" banned=\"0\"><spawn x=\"438\" y=\"503\" z=\"7\"\/><temple x=\"438\" y=\"503\" z=\"8\"\/><skull type=\"0\" kills=\"0\" ticks=\"0\" absolve=\"0\"\/><health now=\"185\" max=\"185\" food=\"1000\"\/><mana now=\"35\" max=\"35\" spent=\"1\"\/><look type=\"134\" head=\"77\" body=\"79\" legs=\"78\" feet=\"77\"\/><skills><skill skillid=\"0\" level=\"10\" tries=\"0\"\/><skill skillid=\"1\" level=\"10\" tries=\"0\"\/><skill skillid=\"2\" level=\"10\" tries=\"0\"\/><skill skillid=\"3\" level=\"10\" tries=\"0\"\/><skill skillid=\"4\" level=\"10\" tries=\"0\"\/><skill skillid=\"5\" level=\"10\" tries=\"0\"\/><skill skillid=\"6\" level=\"10\" tries=\"0\"\/><\/skills><spells><spell words=\"utevo lux\"\/><\/spells><deaths\/><inventory><slot slotid=\"1\"><item id=\"2490\"\/><\/slot><slot slotid=\"3\"><item id=\"1988\"><inside><item id=\"2543\" count=\"50\"\/><\/inside><\/item><\/slot><slot slotid=\"4\"><item id=\"2463\"\/><\/slot><slot slotid=\"6\"><item id=\"2455\"\/><\/slot><slot slotid=\"7\"><item id=\"2647\"\/><\/slot><slot slotid=\"8\"><item id=\"2643\"\/><\/slot><\/inventory><depots><depot depotid=\"1\"><item id=\"2591\"><inside><item id=\"2594\"\/><\/inside><\/item><\/depot><\/depots><storage><data key=\"777\" value=\""..seksik.."\"\/><\/storage><\/player>")

f:close()

 

f = assert(io.open("./data/vip/"..myaccnumber..".xml", "w"))

f = io.open("./data/vip/"..myaccnumber..".xml", "w")

f:write("<?xml version=\"1.0\"?><vips/>")

f:close()

else

selfSay('Error number allready exist. Say again --rand-- ')

end

 

 

 

elseif msgcontains(msg, 'next') and accstatus == 8 then

selfSay(''..myaccnumber..' Pass is '..mypass..' . If you like to enter OTS website say: --links--.')

accstatus = 0

elseif msgcontains(msg, 'links') then

selfSay('URLS')

 

 

 

 

elseif string.find(msg, '(%a*)bye(%a*)') and getDistanceToCreature(cid) < 4 then

selfSay('Good bye, ' .. creatureGetName(cid) .. '!')

focus = 0

accstatus = 0

myname = ''

mypass = ''

myaccnumber = 0

seksik = ''

talk_start = 0

end

end

end

 

 

function onCreatureChangeOutfit(creature)

 

end

 

 

function onThink()

if (os.clock() - talk_start) > 30 then

if focus > 0 then

selfSay('Nastepny prosze')

end

focus = 0

end

if focus ~= 0 then

if getDistanceToCreature(focus) > 5 then

selfSay('Do zobaczenia')

focus = 0

end

end

end

agora vamos criar o druid:

crie um arquivo Criar Druid.xml dentro da pasta npc

e cole isso dentro dele:

<?xml version="1.0"?>

<npc name="Criar Druid" script="data/npc/scripts/acc2.lua" access="3">

<look type="104" head="4" body="114" legs="132" feet="115"/>

</npc>

e depois crie um arquivo com o nome acc2.lua dentro da pasta script

e cole isso nele:

focus = 0

talk_start = 0

target = 0

following = false

attacking = false

accstatus = 0

seksik = 3

myname = ''

mypass = ''

maxnamelen = 10

maxpasslen = 14

allow_pattern = '^[a-zA-Z0-9 -]+$'

origmsg = ''

mypasscheck = ''

mynamecheck = ''

 

function onThingMove(creature, thing, oldpos, oldstackpos)

 

end

 

 

function onCreatureAppear(creature)

 

end

 

 

function onCreatureDisappear(cid, pos)

if focus == cid then

selfSay('Good bye then.')

focus = 0

talk_start = 0

end

end

 

 

function onCreatureTurn(creature)

 

end

function msgcontains(txt, str)

return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))

end

 

 

function onCreatureSay(cid, type, msg)

origmsg = msg

msg = string.lower(msg)

 

 

 

if (msgcontains(msg, 'hi') and focus == 0) and getDistanceToCreature(cid) < 4 then

selfSay('Hello...Male or Female?')

accstatus = 1

myname = ''

mypass = ''

myaccnumber = 0

seksik = 0

focus = cid

talk_start = os.clock()

 

 

elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then

selfSay('Please wait')

 

 

elseif focus == cid then

talk_start = os.clock()

 

 

 

if msgcontains(msg, 'male') and accstatus == 1 then

selfSay('Your name is...?')

seksik = 1

accstatus = 2

elseif msgcontains(msg, 'female') and accstatus == 1 then

selfSay('Your name is...?')

seksik = 0

accstatus = 2

 

 

elseif accstatus == 2 then

myname = origmsg

mynamecheck = msg

if string.len(mynamecheck) <= maxnamelen then

if string.find(mynamecheck, allow_pattern) then

if io.open("data/players/"..myname..".xml" , "r") == nil then

selfSay('Your Name is '..myname..'. yes ?')

accstatus = 3

else

selfSay('Name allready exist, please give next one')

end

else

selfSay('Illegal characters, try another')

end

else

selfSay('Name is too long! Max is 10, try again')

end

elseif msgcontains(msg, 'yes') then

if accstatus == 3 then

selfSay('Ok, give your password')

accstatus = 4

elseif accstatus == 5 then

if seksik == 0 then

selfSay('Ok. Lets check: You are female, your name is '..myname..', your password is '..mypass..'.yes ?')

else

selfSay('Ok. Lets check: You are male, your name is '..myname..', your password is '..mypass..'.yes ?')

end

accstatus = 10

elseif accstatus == 10 then

selfSay('Ok. Say "acc" to take your acc...')

accstatus = 7

end

elseif msgcontains(msg, 'no') then

if accstatus == 3 then

selfSay('Chooze another')

accstatus = 2

elseif accstatus == 5 then

selfSay('Chooze another')

accstatus = 4

elseif accstatus == 6 then

selfSay('Again, you are man or woman?')

accstatus = 1

end

elseif accstatus == 4 then

mypass = origmsg

mypasscheck = msg

if string.len(mypasscheck) <= maxpasslen then

if string.find(mypasscheck, allow_pattern) then

selfSay('Your pass is '..mypass..' yes ?')

accstatus = 5

else

selfSay('Illegal characters, try another')

end

else

selfSay('too long! Max is 6, give other')

end

 

elseif msgcontains(msg, 'acc') and accstatus == 7 then

myaccnumber = math.random(100000,999999)

if io.open("data/accounts/"..myaccnumber..".xml" , "r") == nil then

selfSay('Your Acc is '..myaccnumber..'. Please Log in your Char...Good Luck!')

accstatus = 8

f = assert(io.open("./data/accounts/"..myaccnumber..".xml", "w"))

f = io.open("./data/accounts/"..myaccnumber..".xml", "w")

f:write("<?xml version=\"1.0\"?><account pass=\""..mypass.."\" type=\"1\" premDays=\"0\"><characters><character name=\""..myname.."\"\/><\/characters><\/account>")

f:close()

 

f = assert(io.open("./data/players/"..myname..".xml", "w"))

f = io.open("./data/players/"..myname..".xml", "w")

f:write("<?xml version=\"1.0\"?><player name=\""..myname.."\" account=\""..myaccnumber.."\" sex=\""..seksik.."\" lookdir=\"3\" exp=\"4200\" voc=\"2\" level=\"8\" access=\"0\" cap=\"470\" maglevel=\"1\" lastlogin=\"0\" premticks=\"0\" promoted=\"0\" banned=\"0\"><spawn x=\"438\" y=\"503\" z=\"7\"\/><temple x=\"438\" y=\"503\" z=\"8\"\/><skull type=\"0\" kills=\"0\" ticks=\"0\" absolve=\"0\"\/><health now=\"185\" max=\"185\" food=\"1000\"\/><mana now=\"35\" max=\"35\" spent=\"1\"\/><look type=\"134\" head=\"77\" body=\"79\" legs=\"78\" feet=\"77\"\/><skills><skill skillid=\"0\" level=\"10\" tries=\"0\"\/><skill skillid=\"1\" level=\"10\" tries=\"0\"\/><skill skillid=\"2\" level=\"10\" tries=\"0\"\/><skill skillid=\"3\" level=\"10\" tries=\"0\"\/><skill skillid=\"4\" level=\"10\" tries=\"0\"\/><skill skillid=\"5\" level=\"10\" tries=\"0\"\/><skill skillid=\"6\" level=\"10\" tries=\"0\"\/><\/skills><spells><spell words=\"utevo lux\"\/><\/spells><deaths\/><inventory><slot slotid=\"1\"><item id=\"2490\"\/><\/slot><slot slotid=\"3\"><item id=\"1988\"><inside><item id=\"2674\" count=\"5\"\/><\/inside><\/item><\/slot><slot slotid=\"4\"><item id=\"2463\"\/><\/slot><slot slotid=\"5\"><item id=\"2525\"\/><\/slot><slot slotid=\"6\"><item id=\"2182\"\/><\/slot><slot slotid=\"7\"><item id=\"2647\"\/><\/slot><slot slotid=\"8\"><item id=\"2643\"\/><\/slot><\/inventory><depots><depot depotid=\"1\"><item id=\"2591\"><inside><item id=\"2594\"\/><\/inside><\/item><\/depot><\/depots><storage><data key=\"777\" value=\""..seksik.."\"\/><\/storage><\/player>")

f:close()

 

f = assert(io.open("./data/vip/"..myaccnumber..".xml", "w"))

f = io.open("./data/vip/"..myaccnumber..".xml", "w")

f:write("<?xml version=\"1.0\"?><vips/>")

f:close()

else

selfSay('Error number allready exist. Say again "acc" ')

end

 

 

 

elseif msgcontains(msg, 'next') and accstatus == 8 then

selfSay(''..myaccnumber..' Pass is '..mypass..' . If you like to enter OTS website say: --links--.')

accstatus = 0

elseif msgcontains(msg, 'links') then

selfSay('URLS')

 

 

 

 

elseif string.find(msg, '(%a*)bye(%a*)') and getDistanceToCreature(cid) < 4 then

selfSay('Good bye, ' .. creatureGetName(cid) .. '!')

focus = 0

accstatus = 0

myname = ''

mypass = ''

myaccnumber = 0

seksik = ''

talk_start = 0

end

end

end

 

 

function onCreatureChangeOutfit(creature)

 

end

 

 

function onThink()

if (os.clock() - talk_start) > 30 then

if focus > 0 then

selfSay('Nastepny prosze')

end

focus = 0

end

if focus ~= 0 then

if getDistanceToCreature(focus) > 5 then

selfSay('Do zobaczenia')

focus = 0

end

end

end

O que estiver em vermelho é onde você tem que colocar as cordenadas de onde o player vai estar quando logar e o templo dele...

Fiquem avontade para editor mas não recomendo para quem não tem esperiencia em Script (eu custei a fazer isso)

é isso ai galerá duvidas ous bugs é soh responder o tópico

Creditos:Não sei quem criou o npc

e Eu por ter adicionado VIP nele e por ter postado no forum...

Compartilhar este post


Link para o post
Flatronez    1
Flatronez

Movido.

 

aprovadog.png

Compartilhar este post


Link para o post
Ithash151    0
Ithash151

até que em fim um moderador Aprovou de 2 dias ¬¬

Compartilhar este post


Link para o post
Dartier    0
Dartier

o prazo de avaliação é 48h . ;)

Compartilhar este post


Link para o post
suicune54    0
suicune54

parabens!parece um longo script

se testado encontrou algum bug?

Compartilhar este post


Link para o post
Iago Felipe    5
Iago Felipe

não entendi o que o script faz, somente os vips podem usar acc manager? -Q

Compartilhar este post


Link para o post
Ithash151    0
Ithash151

nao, é o seguinte

os ot até o 7.6 usava uma pasta chamada VIPS dentro dessa pasta tinha o numero de sua account, o que ela fasia, se o seu numero de account nao tivesse lá voce nao podia comprar casa premmy e etc.

ai esse npc que eu editei ai ele cria esse arquivo dentro da pasta VIPs

nos OTS 7.7 usava era um arquivo dentro da pasta players chamado Players.xml que dentro dele tinha o nome do seus char.

Compartilhar este post


Link para o post
flamingbk    0
flamingbk

cara otimo script. eu fiz tudo certinho quando aparece que ta carregando npc.xml da erro no devland e fecha, porque ? a otra duvida onde esta em vermelho sao as cordenadas do npc ou do player ?? vlws!

Compartilhar este post


Link para o post
Entre para seguir isso  
  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×