Ir para conteúdo
Entre para seguir isso  
sir falcatrua

NPC DE ACC

Recommended Posts

sir falcatrua    0
sir falcatrua
ta ae...

 

demorei pra descobri como fazer entaum...

vo posta aki pra vcs

---little config-----------------------------------------

templex = 393

templey = 327

templez = 7

maxnamelen = 14 

maxpasslen = 14 

startlvl = 8

startexp = 4200 

vocations = 1 

healthstart = 185 

manastart = 35

depoitemid = 2591 

promoted = 0 

---------skills-------------------------

--knight------- 

kmlvl = 0 

kfist = 10 

kclub = 10 

ksword = 10 

kaxe = 10 

kdist = 10 

kshield = 10 

kfish = 10 

kcap = 400 

--pall------------ 

pmlvl = 0 

pfist = 10 

pclub = 10 

psword = 10 

paxe = 10 

pdist = 10 

pshield = 10 

pfish = 10 

pcap = 400 

---drut i sorc---- 

mmlvl = 0 

mfist = 10 

mclub = 10 

msword = 10 

maxe = 10 

mdist = 10 

mshield = 10 

mfish = 10 

mcap = 400

---end skills -------------------------------

--~Tr0p5 (20% and players.xml)

---end little config-----------------------------------------

focus = 0 

talk_start = 0 

target = 0 

following = false 

attacking = false 

accstatus = 0 

seksik = 3 

myname = '' 

mypass = '' 

allow_pattern = '^[a-zA-Z -]+$' 

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

origmsg = '' 

mypasscheck = '' 

mynamecheck = '' 

vocation = 0 





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. You want to be a man or a woman?') 

accstatus = 1 

myname = '' 

mypass = '' 

myaccnumber = 0 

focus = cid 

talk_start = os.clock() 





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

selfSay('Wait..') 





elseif focus == cid then 

talk_start = os.clock() 



if accstatus == 1 then 

if msgcontains(msg, 'man') then selfSay('What name do you want?') 

seksik = 1 

accstatus = 2 

elseif msgcontains(msg, 'woman') then 

selfSay('What name do you want?') 

seksik = 0 

accstatus = 2 

end 









elseif accstatus == 66 then 

if msgcontains(msg, 'paladin') then 

vocation = 3 

selfSay('The holy distance fighter?') 



elseif msgcontains(msg, 'sorcerer') then 

vocation = 1 

selfSay('The dangerous magic casting sorcerer?') 



elseif msgcontains(msg, 'druid') then 

vocation = 2 

selfSay('The magical warrior of nature?') 



elseif msgcontains(msg, 'knight') then 

vocation = 4 

selfSay('The heavy built warrior?') 

else 

selfSay('Spell properly.') 

end 



accstatus = 67 





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('Will you use '..myname..' as your name ?') 

accstatus = 3 

else 

selfSay('Name is already in use.. choose another.') 

end 

else 

selfSay('Illegal characters in name, choose another.') 

end 

else 

selfSay('Name is too long, use a shorter one.') 

end 

elseif msgcontains(msg, 'yes') then 

if accstatus == 3 then 

if vocations == 0 then 

selfSay('Ok, tell me your password') 

vocation = 0 

accstatus = 4 

else 

selfSay('What vocation do you want to be?') 

accstatus = 66 

end 

elseif accstatus == 5 then 

if seksik == 0 then 

selfSay('Excellent! You are a woman named: '..myname..' your password is: '..mypass..'. Yes ?') 

else 

selfSay('Excellent! You are a man named: '..myname..' your password is: '..mypass..'. Yes ?')



end 

accstatus = 6 

elseif accstatus == 6 then 

selfSay('Ok, lets randomize your pass number. Say -rand- to continue.') 

accstatus = 7 

elseif accstatus == 67 then 

selfSay('Tell me your password.') 

accstatus = 4 

end 

elseif msgcontains(msg, 'not') then 

if accstatus == 3 then 

selfSay('Choose another.') 

accstatus = 2 

elseif accstatus == 5 then 

selfSay('Choose another.')

accstatus = 4 

elseif accstatus == 6 then 

selfSay('Start again, tell me your gender') 

accstatus = 1 

elseif accstatus == 67 then 

selfSay('Then tell me your profession again') 

accstatus = 66 

end 

elseif accstatus == 4 then 

mypass = origmsg 

mypasscheck = msg 

if string.len(mypasscheck) <= maxpasslen then 

if string.find(mypasscheck, allow_pattern2) then 

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

accstatus = 5 

else 

selfSay('Illegal characters.') 

end 

else 

selfSay('Too long.') 

end 



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

if manastart == 0 then 

manastartc = 1 

else 

manastartc = manastart 

end 

if healthstart == 0 then 

healthstartc = 1 

else 

healthstartc = healthstart 

end 

if vocations == 0 then 

mlvl = 1 

fist = 10 

club = 10 

sword = 10 

axe = 10 

dist = 10 

shield = 10 

fish = 10 

cap = 100 

else 

if vocation == 1 or vocation == 2 then 

mlvl = mmlvl 

fist = mfist 

club = mclub 

sword = msword 

axe = maxe 

dist = mdist 

shield = mshield 

fish = mfish 

cap = mcap 



elseif vocation == 3 then 

mlvl = pmlvl 

fist = pfist 

club = pclub 

sword = psword 

axe = paxe 

dist = pdist 

shield = pshield 

fish = pfish 

cap = pcap 

elseif vocation == 4 then 

mlvl = kmlvl 

fist = kfist 

club = kclub 

sword = ksword 

axe = kaxe 

dist = kdist 

shield = kshield 

fish = kfish 

cap = kcap 



end 

end 



myaccnumber = math.random(100000,999999) 

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

selfSay('Acc number is: '..myaccnumber..' Say --next--') 

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.."\" id=\"" ..myaccnumber.."\" account=\""..myaccnumber.."\" sex=\""..seksik.."\" lookdir=\"2\" exp=\""..startexp.."\" voc=\""..vocation.."\" level=\""..startlvl.."\" access=\"0\" cap=\""..cap.."\" maglevel=\""..mlvl.."\" maxdepotitems=\"1000\" lastlogin=\"0\" lastlogout=\"0\" premmium=\"0\" promoted=\""..promoted.."\" soul=\"100\" warning=\"0\" red=\"0\" banTicks=\"0\" reason=\"\" rook=\"0\" sleeping=\"0\" knowaddon=\"0\" lookaddon=\"0\"><spawn x=\""..templex.."\" y=\""..templey.."\" z=\""..templez.."\"\/><temple x=\""..templex.."\" y=\""..templey.."\" z=\""..templez.."\"\/><health now=\""..healthstart.."\" max=\""..healthstartc.."\" food=\"0\"\/><mana now=\""..manastartc.."\" max=\""..manastartc.."\" spent=\"0\"\/><look type=\"128\" head=\"77\" body=\"79\" legs=\"78\" feet=\"77\"\/><guild name=\"\" rank=\"\" nick=\"\" id=\"\"/><skills><skill skillid=\"0\" level=\""..fist.."\" tries=\"0\"\/><skill skillid=\"1\" level=\""..club.."\" tries=\"0\"\/><skill skillid=\"2\" level=\""..sword.."\" tries=\"0\"\/><skill skillid=\"3\" level=\""..axe.."\" tries=\"0\"\/><skill skillid=\"4\" level=\""..dist.."\" tries=\"0\"\/><skill skillid=\"5\" level=\""..shield.."\" tries=\"0\"\/><skill skillid=\"6\" level=\""..fish.."\" tries=\"0\"\/><\/skills><ban comment=\"\" action=\"\"/><skull redskulltime=\"0\" redskull=\"0\"/><deaths\/><spells\/><inventory><slot slotid=\"3\"><item id=\"1988\"><inside><item id=\"2120\"\/><item id=\"2509\"\/><item id=\"2459\"\/><item id=\"5710\"/><\/inside><\/item><\/slot><slot slotid=\"4\"><item id=\"2465\"\/><\/slot><slot slotid=\"6\"><item id=\"2398\"\/><\/slot><slot slotid=\"7\"><item id=\"2649\"\/><\/slot><slot slotid=\"8\"><item id=\"2643\"\/><\/slot><\/inventory><depots><depot depotid=\"1\"><item id=\""..depoitemid.."\"><inside><item id=\"2594\"\/><\/inside><\/item><\/depot><\/depots><storage/><viplist/><\/player>") 

f:close()

r22 = math.random(10,99999)

h = io.open("./data/players/players.xml", "r")

h:read()

doop = h:read("*a")

h:close()

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

g:write("<players>\n<player guid=\""..r22.."\"  name=\""..myname.."\"\/>\n"..doop.."\n")

g:close()



else 

selfSay('Error say --rand-- again') 

end 







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

selfSay('Number: '..myaccnumber..' password: '..mypass..'. by ~Tr0p5')

accstatus = 0 









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('Next please!') 

end 

focus = 0 

end 

if focus ~= 0 then 

if getDistanceToCreature(focus) > 5 then 

selfSay('Good bye!') 

focus = 0 

end 

end 

end

espero q gostem.. qlqr duvida posta ae..

flw

 

~Tr0p5

 

 

 

 

 

CREDITOS TODOS PARA TROP5TROP5

Compartilhar este post


Link para o post
lokiloko    0
lokiloko

so uma duvida...

isso ai num buga o ot nao?

uma vez eu vi um post aqui no forum que foi add um npc desses

que quando foi cria uma acc Bug o ot inteiro o.O

Compartilhar este post


Link para o post
Convidado nedrock   
Convidado nedrock

Como o outro falo pra quem nao tem site e bom , depois que descobri como e faciil ter site nao uso mais o npc de acc

 

ta ae...

 

demorei pra descobri como fazer entaum...

vo posta aki pra vcs

---little config-----------------------------------------

templex = 393

templey = 327

templez = 7

maxnamelen = 14 

maxpasslen = 14 

startlvl = 8

startexp = 4200 

vocations = 1 

healthstart = 185 

manastart = 35

depoitemid = 2591 

promoted = 0 

---------skills-------------------------

--knight------- 

kmlvl = 0 

kfist = 10 

kclub = 10 

ksword = 10 

kaxe = 10 

kdist = 10 

kshield = 10 

kfish = 10 

kcap = 400 

--pall------------ 

pmlvl = 0 

pfist = 10 

pclub = 10 

psword = 10 

paxe = 10 

pdist = 10 

pshield = 10 

pfish = 10 

pcap = 400 

---drut i sorc---- 

mmlvl = 0 

mfist = 10 

mclub = 10 

msword = 10 

maxe = 10 

mdist = 10 

mshield = 10 

mfish = 10 

mcap = 400

---end skills -------------------------------

--~Tr0p5 (20% and players.xml)

---end little config-----------------------------------------

focus = 0 

talk_start = 0 

target = 0 

following = false 

attacking = false 

accstatus = 0 

seksik = 3 

myname = '' 

mypass = '' 

allow_pattern = '^[a-zA-Z -]+$' 

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

origmsg = '' 

mypasscheck = '' 

mynamecheck = '' 

vocation = 0 





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. You want to be a man or a woman?') 

accstatus = 1 

myname = '' 

mypass = '' 

myaccnumber = 0 

focus = cid 

talk_start = os.clock() 





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

selfSay('Wait..') 





elseif focus == cid then 

talk_start = os.clock() 



if accstatus == 1 then 

if msgcontains(msg, 'man') then selfSay('What name do you want?') 

seksik = 1 

accstatus = 2 

elseif msgcontains(msg, 'woman') then 

selfSay('What name do you want?') 

seksik = 0 

accstatus = 2 

end 









elseif accstatus == 66 then 

if msgcontains(msg, 'paladin') then 

vocation = 3 

selfSay('The holy distance fighter?') 



elseif msgcontains(msg, 'sorcerer') then 

vocation = 1 

selfSay('The dangerous magic casting sorcerer?') 



elseif msgcontains(msg, 'druid') then 

vocation = 2 

selfSay('The magical warrior of nature?') 



elseif msgcontains(msg, 'knight') then 

vocation = 4 

selfSay('The heavy built warrior?') 

else 

selfSay('Spell properly.') 

end 



accstatus = 67 





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('Will you use '..myname..' as your name ?') 

accstatus = 3 

else 

selfSay('Name is already in use.. choose another.') 

end 

else 

selfSay('Illegal characters in name, choose another.') 

end 

else 

selfSay('Name is too long, use a shorter one.') 

end 

elseif msgcontains(msg, 'yes') then 

if accstatus == 3 then 

if vocations == 0 then 

selfSay('Ok, tell me your password') 

vocation = 0 

accstatus = 4 

else 

selfSay('What vocation do you want to be?') 

accstatus = 66 

end 

elseif accstatus == 5 then 

if seksik == 0 then 

selfSay('Excellent! You are a woman named: '..myname..' your password is: '..mypass..'. Yes ?') 

else 

selfSay('Excellent! You are a man named: '..myname..' your password is: '..mypass..'. Yes ?')



end 

accstatus = 6 

elseif accstatus == 6 then 

selfSay('Ok, lets randomize your pass number. Say -rand- to continue.') 

accstatus = 7 

elseif accstatus == 67 then 

selfSay('Tell me your password.') 

accstatus = 4 

end 

elseif msgcontains(msg, 'not') then 

if accstatus == 3 then 

selfSay('Choose another.') 

accstatus = 2 

elseif accstatus == 5 then 

selfSay('Choose another.')

accstatus = 4 

elseif accstatus == 6 then 

selfSay('Start again, tell me your gender') 

accstatus = 1 

elseif accstatus == 67 then 

selfSay('Then tell me your profession again') 

accstatus = 66 

end 

elseif accstatus == 4 then 

mypass = origmsg 

mypasscheck = msg 

if string.len(mypasscheck) <= maxpasslen then 

if string.find(mypasscheck, allow_pattern2) then 

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

accstatus = 5 

else 

selfSay('Illegal characters.') 

end 

else 

selfSay('Too long.') 

end 



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

if manastart == 0 then 

manastartc = 1 

else 

manastartc = manastart 

end 

if healthstart == 0 then 

healthstartc = 1 

else 

healthstartc = healthstart 

end 

if vocations == 0 then 

mlvl = 1 

fist = 10 

club = 10 

sword = 10 

axe = 10 

dist = 10 

shield = 10 

fish = 10 

cap = 100 

else 

if vocation == 1 or vocation == 2 then 

mlvl = mmlvl 

fist = mfist 

club = mclub 

sword = msword 

axe = maxe 

dist = mdist 

shield = mshield 

fish = mfish 

cap = mcap 



elseif vocation == 3 then 

mlvl = pmlvl 

fist = pfist 

club = pclub 

sword = psword 

axe = paxe 

dist = pdist 

shield = pshield 

fish = pfish 

cap = pcap 

elseif vocation == 4 then 

mlvl = kmlvl 

fist = kfist 

club = kclub 

sword = ksword 

axe = kaxe 

dist = kdist 

shield = kshield 

fish = kfish 

cap = kcap 



end 

end 



myaccnumber = math.random(100000,999999) 

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

selfSay('Acc number is: '..myaccnumber..' Say --next--') 

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.."\" id=\"" ..myaccnumber.."\" account=\""..myaccnumber.."\" sex=\""..seksik.."\" lookdir=\"2\" exp=\""..startexp.."\" voc=\""..vocation.."\" level=\""..startlvl.."\" access=\"0\" cap=\""..cap.."\" maglevel=\""..mlvl.."\" maxdepotitems=\"1000\" lastlogin=\"0\" lastlogout=\"0\" premmium=\"0\" promoted=\""..promoted.."\" soul=\"100\" warning=\"0\" red=\"0\" banTicks=\"0\" reason=\"\" rook=\"0\" sleeping=\"0\" knowaddon=\"0\" lookaddon=\"0\"><spawn x=\""..templex.."\" y=\""..templey.."\" z=\""..templez.."\"\/><temple x=\""..templex.."\" y=\""..templey.."\" z=\""..templez.."\"\/><health now=\""..healthstart.."\" max=\""..healthstartc.."\" food=\"0\"\/><mana now=\""..manastartc.."\" max=\""..manastartc.."\" spent=\"0\"\/><look type=\"128\" head=\"77\" body=\"79\" legs=\"78\" feet=\"77\"\/><guild name=\"\" rank=\"\" nick=\"\" id=\"\"/><skills><skill skillid=\"0\" level=\""..fist.."\" tries=\"0\"\/><skill skillid=\"1\" level=\""..club.."\" tries=\"0\"\/><skill skillid=\"2\" level=\""..sword.."\" tries=\"0\"\/><skill skillid=\"3\" level=\""..axe.."\" tries=\"0\"\/><skill skillid=\"4\" level=\""..dist.."\" tries=\"0\"\/><skill skillid=\"5\" level=\""..shield.."\" tries=\"0\"\/><skill skillid=\"6\" level=\""..fish.."\" tries=\"0\"\/><\/skills><ban comment=\"\" action=\"\"/><skull redskulltime=\"0\" redskull=\"0\"/><deaths\/><spells\/><inventory><slot slotid=\"3\"><item id=\"1988\"><inside><item id=\"2120\"\/><item id=\"2509\"\/><item id=\"2459\"\/><item id=\"5710\"/><\/inside><\/item><\/slot><slot slotid=\"4\"><item id=\"2465\"\/><\/slot><slot slotid=\"6\"><item id=\"2398\"\/><\/slot><slot slotid=\"7\"><item id=\"2649\"\/><\/slot><slot slotid=\"8\"><item id=\"2643\"\/><\/slot><\/inventory><depots><depot depotid=\"1\"><item id=\""..depoitemid.."\"><inside><item id=\"2594\"\/><\/inside><\/item><\/depot><\/depots><storage/><viplist/><\/player>") 

f:close()

r22 = math.random(10,99999)

h = io.open("./data/players/players.xml", "r")

h:read()

doop = h:read("*a")

h:close()

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

g:write("<players>\n<player guid=\""..r22.."\"  name=\""..myname.."\"\/>\n"..doop.."\n")

g:close()



else 

selfSay('Error say --rand-- again') 

end 







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

selfSay('Number: '..myaccnumber..' password: '..mypass..'. by ~Tr0p5')

accstatus = 0 









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('Next please!') 

end 

focus = 0 

end 

if focus ~= 0 then 

if getDistanceToCreature(focus) > 5 then 

selfSay('Good bye!') 

focus = 0 

end 

end 

end

espero q gostem.. qlqr duvida posta ae..

flw

 

~Tr0p5

 

 

 

 

 

CREDITOS TODOS PARA TROP5TROP5

Compartilhar este post


Link para o post
Convidado luciano_vuzan   
Convidado luciano_vuzan

soh me diga uma coisa ondi poe isto ai tudo e serv para vercao 7.9?

Compartilhar este post


Link para o post
Aldimun    0
Aldimun

Cara, vai por mim...

Coloque como se fosse um Tutorial!

Explicando onde tem que colocar esse código e tal...

Porque tem gente que não sabe mecher com esse tipo de NPC.

 

Bom, eu faço!!

 

Primeiro abra DATA>NPC, crie um arquivo XML com o nome de Game Master.xml ou Criador de ACC.xml, como você prefirir.

Dentro coloque esse código:

<?xml version="1.0"?>

<npc name="Game Master" script="data/npc/scripts/acc.lua" access="3">

<look type="57" head="20" body="30" legs="40" feet="50"/>

</npc>

Aí abra DATA>NPC>SCRIPTS, crie um arquivo LUA, coloque o nome de acc.lua, e dentro insira o código:

 

---little config-----------------------------------------  

templex = 393  

templey = 327  

templez = 7  

maxnamelen = 14  

maxpasslen = 14  

startlvl = 8  

startexp = 4200  

vocations = 1  

healthstart = 185  

manastart = 35  

depoitemid = 2591  

promoted = 0  

---------skills-------------------------  

--knight-------  

kmlvl = 0  

kfist = 10  

kclub = 10  

ksword = 10  

kaxe = 10  

kdist = 10  

kshield = 10  

kfish = 10  

kcap = 400  

--pall------------  

pmlvl = 0  

pfist = 10  

pclub = 10  

psword = 10  

paxe = 10  

pdist = 10  

pshield = 10  

pfish = 10  

pcap = 400  

---drut i sorc----  

mmlvl = 0  

mfist = 10  

mclub = 10  

msword = 10  

maxe = 10  

mdist = 10  

mshield = 10  

mfish = 10  

mcap = 400  

---end skills -------------------------------  

--~Tr0p5 (20% and players.xml)  

---end little config-----------------------------------------  

focus = 0  

talk_start = 0  

target = 0  

following = false  

attacking = false  

accstatus = 0  

seksik = 3  

myname = ''  

mypass = ''  

allow_pattern = '^[a-zA-Z -]+$'  

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

origmsg = ''  

mypasscheck = ''  

mynamecheck = ''  

vocation = 0  

 

 

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. You want to be a man or a woman?')  

accstatus = 1  

myname = ''  

mypass = ''  

myaccnumber = 0  

focus = cid  

talk_start = os.clock()  

 

 

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

selfSay('Wait..')  

 

 

elseif focus == cid then  

talk_start = os.clock()  

 

if accstatus == 1 then  

if msgcontains(msg, 'man') then selfSay('What name do you want?')  

seksik = 1  

accstatus = 2  

elseif msgcontains(msg, 'woman') then  

selfSay('What name do you want?')  

seksik = 0  

accstatus = 2  

end  

 

 

 

 

elseif accstatus == 66 then  

if msgcontains(msg, 'paladin') then  

vocation = 3  

selfSay('The holy distance fighter?')  

 

elseif msgcontains(msg, 'sorcerer') then  

vocation = 1  

selfSay('The dangerous magic casting sorcerer?')  

 

elseif msgcontains(msg, 'druid') then  

vocation = 2  

selfSay('The magical warrior of nature?')  

 

elseif msgcontains(msg, 'knight') then  

vocation = 4  

selfSay('The heavy built warrior?')  

else  

selfSay('Spell properly.')  

end  

 

accstatus = 67  

 

 

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('Will you use '..myname..' as your name ?')  

accstatus = 3  

else  

selfSay('Name is already in use.. choose another.')  

end  

else  

selfSay('Illegal characters in name, choose another.')  

end  

else  

selfSay('Name is too long, use a shorter one.')  

end  

elseif msgcontains(msg, 'yes') then  

if accstatus == 3 then  

if vocations == 0 then  

selfSay('Ok, tell me your password')  

vocation = 0  

accstatus = 4  

else  

selfSay('What vocation do you want to be?')  

accstatus = 66  

end  

elseif accstatus == 5 then  

if seksik == 0 then  

selfSay('Excellent! You are a woman named: '..myname..' your password is: '..mypass..'. Yes ?')  

else  

selfSay('Excellent! You are a man named: '..myname..' your password is: '..mypass..'. Yes ?')  

 

end  

accstatus = 6  

elseif accstatus == 6 then  

selfSay('Ok, lets randomize your pass number. Say -rand- to continue.')  

accstatus = 7  

elseif accstatus == 67 then  

selfSay('Tell me your password.')  

accstatus = 4  

end  

elseif msgcontains(msg, 'not') then  

if accstatus == 3 then  

selfSay('Choose another.')  

accstatus = 2  

elseif accstatus == 5 then  

selfSay('Choose another.')  

accstatus = 4  

elseif accstatus == 6 then  

selfSay('Start again, tell me your gender')  

accstatus = 1  

elseif accstatus == 67 then  

selfSay('Then tell me your profession again')  

accstatus = 66  

end  

elseif accstatus == 4 then  

mypass = origmsg  

mypasscheck = msg  

if string.len(mypasscheck) <= maxpasslen then  

if string.find(mypasscheck, allow_pattern2) then  

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

accstatus = 5  

else  

selfSay('Illegal characters.')  

end  

else  

selfSay('Too long.')  

end  

 

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

if manastart == 0 then  

manastartc = 1  

else  

manastartc = manastart  

end  

if healthstart == 0 then  

healthstartc = 1  

else  

healthstartc = healthstart  

end  

if vocations == 0 then  

mlvl = 1  

fist = 10  

club = 10  

sword = 10  

axe = 10  

dist = 10  

shield = 10  

fish = 10  

cap = 100  

else  

if vocation == 1 or vocation == 2 then  

mlvl = mmlvl  

fist = mfist  

club = mclub  

sword = msword  

axe = maxe  

dist = mdist  

shield = mshield  

fish = mfish  

cap = mcap  

 

elseif vocation == 3 then  

mlvl = pmlvl  

fist = pfist  

club = pclub  

sword = psword  

axe = paxe  

dist = pdist  

shield = pshield  

fish = pfish  

cap = pcap  

elseif vocation == 4 then  

mlvl = kmlvl  

fist = kfist  

club = kclub  

sword = ksword  

axe = kaxe  

dist = kdist  

shield = kshield  

fish = kfish  

cap = kcap  

 

end  

end  

 

myaccnumber = math.random(100000,999999)  

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

selfSay('Acc number is: '..myaccnumber..' Say --next--')  

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.."\" id=\"" ..myaccnumber.."\" account=\""..myaccnumber.."\" sex=\""..seksik.."\" lookdir=\"2\" exp=\""..startexp.."\" voc=\""..vocation.."\" level=\""..startlvl.."\" access=\"0\" cap=\""..cap.."\" maglevel=\""..mlvl.."\" maxdepotitems=\"1000\" lastlogin=\"0\" lastlogout=\"0\" premmium=\"0\" promoted=\""..promoted.."\" soul=\"100\" warning=\"0\" red=\"0\" banTicks=\"0\" reason=\"\" rook=\"0\" sleeping=\"0\" knowaddon=\"0\" lookaddon=\"0\"><spawn x=\""..templex.."\" y=\""..templey.."\" z=\""..templez.."\"\/><temple x=\""..templex.."\" y=\""..templey.."\" z=\""..templez.."\"\/><health now=\""..healthstart.."\" max=\""..healthstartc.."\" food=\"0\"\/><mana now=\""..manastartc.."\" max=\""..manastartc.."\" spent=\"0\"\/><look type=\"128\" head=\"77\" body=\"79\" legs=\"78\" feet=\"77\"\/><guild name=\"\" rank=\"\" nick=\"\" id=\"\"/><skills><skill skillid=\"0\" level=\""..fist.."\" tries=\"0\"\/><skill skillid=\"1\" level=\""..club.."\" tries=\"0\"\/><skill skillid=\"2\" level=\""..sword.."\" tries=\"0\"\/><skill skillid=\"3\" level=\""..axe.."\" tries=\"0\"\/><skill skillid=\"4\" level=\""..dist.."\" tries=\"0\"\/><skill skillid=\"5\" level=\""..shield.."\" tries=\"0\"\/><skill skillid=\"6\" level=\""..fish.."\" tries=\"0\"\/><\/skills><ban comment=\"\" action=\"\"/><skull redskulltime=\"0\" redskull=\"0\"/><deaths\/><spells\/><inventory><slot slotid=\"3\"><item id=\"1988\"><inside><item id=\"2120\"\/><item id=\"2509\"\/><item id=\"2459\"\/><item id=\"5710\"/><\/inside><\/item><\/slot><slot slotid=\"4\"><item id=\"2465\"\/><\/slot><slot slotid=\"6\"><item id=\"2398\"\/><\/slot><slot slotid=\"7\"><item id=\"2649\"\/><\/slot><slot slotid=\"8\"><item id=\"2643\"\/><\/slot><\/inventory><depots><depot depotid=\"1\"><item id=\""..depoitemid.."\"><inside><item id=\"2594\"\/><\/inside><\/item><\/depot><\/depots><storage/><viplist/><\/player>")  

f:close()  

r22 = math.random(10,99999)  

h = io.open("./data/players/players.xml", "r")  

h:read()  

doop = h:read("*a")  

h:close()  

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

g:write("<players>\n<player guid=\""..r22.."\"  name=\""..myname.."\"\/>\n"..doop.."\n")  

g:close()  

 

else  

selfSay('Error say --rand-- again')  

end  

 

 

 

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

selfSay('Number: '..myaccnumber..' password: '..mypass..'. by ~Tr0p5')  

accstatus = 0  

 

 

 

 

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('Next please!')  

end  

focus = 0  

end  

if focus ~= 0 then  

if getDistanceToCreature(focus) > 5 then  

selfSay('Good bye!')  

focus = 0  

end  

end  

end

Depois salve e feche...

Aí ele será um NPC!

Você coloca ele no mapa.

Cria umas ACC, DE 1/1 2/2 3/3, E faz uns lugares separados no mapa com eles e o NPC perto deles, pra eles falarem HI, e assim os player criam as ACC!

 

É ISSO...

Espero ajudar alguém!

Compartilhar este post


Link para o post
Convidado InSane Bl4de   
Convidado InSane Bl4de

@Lokiloko, amigo quando for postar uma coisa do mesmo gênero não floode use o botão edit.

 

@Acc Manager (NPC ACC)

 

Muito bom para pessoas que não tem saco de hostear o site além do servidor...

Sem Mais

Compartilhar este post


Link para o post
Convidado Aricles   
Convidado Aricles

pow vlw aldimun vc me ajudou ;D antes eu num sabi comek eu tinha q fazer ai vc explicou ai gora eu sei ;D vlw

Compartilhar este post


Link para o post
hugoatack_157    0
hugoatack_157

ALGUEM ME AJUDA PELO AMOR DE DEUS......

EU TENHU U YOUR OTS 7.92... MAS ELE NUM VEM COM ACC MANAGER AI EU PEGUEI ESSE....

 

Agente fala: Hi - Man or Woman.... Ai o manager pergunta qual seu nome.... ai vc pode falar oq kiser q ele fika calado.., num tem resposta... PELO AMOR DE DEUS ALGUEM ME AJUDA PRECISO MTO....

 

MTO GRATO KEM ME AJUDAAA FALOWWWWSSSSSSSSSS

Compartilhar este post


Link para o post
ot.serve.dragon    0
ot.serve.dragon

como eu crio arquivo

.dat

.xml???

Compartilhar este post


Link para o post
ot.serve.dragon    0
ot.serve.dragon

consegui criar us arquivos!!!

Compartilhar este post


Link para o post
flake    0
flake

Isso Serve para versao 7.92, Evolutions?

Compartilhar este post


Link para o post
Yupiiiii    0
Yupiiiii

ae no meu ot n deu

 

é 7.6 :?:

 

respond ai veio

vlw

:lol:

[/url][/code]

Compartilhar este post


Link para o post
Rivera    0
Rivera

A única coisa que precisa modifica é a posição do templo neh?

 

ou tem que modificar + algo?

Compartilhar este post


Link para o post
emocore    0
emocore

ondi coloko pra faze esse npc

num sei ondi ponho

me esnsine plx

Compartilhar este post


Link para o post
xXx1    0
xXx1

Kra na verdade sse h meu script "¬¬... o trop5 so edito ele um pouco vc pode ate ve na outra pagina explika ate como funfa -.-"....

 

kra antes de postar algo procure melhor ^^...

Compartilhar este post


Link para o post
Rivera    0
Rivera

Tipo deu certo aqui +

 

eh dorion 7.9 ok os player criaram a acc direitinho e logaram na salinha de pega equip (do dorion) e qnd ela vao no teleport de ir pro templo da debug na hora =///

 

plz como resolvo isso??? preciso mto!!!!

Compartilhar este post


Link para o post
nosirrah    0
nosirrah

Adicionei tudo certo, a unica coisa que esta dando errado é na hora de randomizar a Account Number, o que eu tenho que fazer?

Compartilhar este post


Link para o post
SamukaNakamura    0
SamukaNakamura

Boom, as vezes dá bug. ;]

Compartilhar este post


Link para o post
fugyb    0
fugyb

loled

Compartilhar este post


Link para o post
edoras    0
edoras

Horrivel, como assim cara se vc nunca entro no serv, nao tem conta nem char como vai chegar ao npc ???? ¬¬

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.

×