Preciso de 2 scripts
Primeiro: Uma porta que só passará o player que tiver 20 ou mais de 20 frags
Segundo: Um oracle(NPC) que funcionasse como um account manager!
Alguém poderia me ajudar?
Preciso de 2 scripts
Primeiro: Uma porta que só passará o player que tiver 20 ou mais de 20 frags
Segundo: Um oracle(NPC) que funcionasse como um account manager!
Alguém poderia me ajudar?
A door, você vai em data/actions/scripts, crie um arquivo chamado frags_door.lua e adicione dentro:
function onUse(cid, item, frompos, item2, topos) if item.actionid > 0 and getPlayerFrags(cid) >= 20 then doTransformItem(item.uid, item.itemid + 1) doTeleportThing(cid, frompos) else doPlayerSendTextMessage(cid,22,'You need more resets (20) to pass here.') end return true end
Em actions.xml adicione a tag:
<action actionid="18449" event="script" value="frags_door.lua"/>
No map editor adicione Action ID 18449 na door.
Não pegou, xD
Sim, coloquei o actionid, nem apareceu a msg quando cliquei na porta "You need..."
aí, peguei 20 frags com 1 player e não deu pra passar do mesmo jeito xD
Soh pra perguntar, mas a vocaçao vai ser definida pelo acc manager? Pq se for com um npc de vocation depois eu axo que ja tenho os scripts pro npc
Crie um arquivo de bloco de notas (que depois sera trocado pra XML) e coloque na pasta Desktop\Pasta do seu ot\data\npc ----- nomeie como Account Manager o arquivo
<!--?xml version="1.0"?-->
<npc name="Account Manager" script="data/npc/scripts/account_manager.lua" access="3">
<look type="1448" head="95" body="116" legs="121" feet="115">
</look></npc>
Crie um arquivo bloco de notas e coloque na pasta Desktop\Pasta do seu ot\data\npc\scripts
---little config-----------------------------------------
templex = 49
templey = 42
templez = 7
maxnamelen = 18
maxpasslen = 14
startlvl = 1
startexp = 0
vocations = 0
healthstart = 150
manastart = 0
depoitemid = 3440
promoted = 0
---------skills-------------------------
--knight-------
kmlvl = 0
kfist = 10
kclub = 10
ksword = 10
kaxe = 10
kdist = 10
kshield = 10
kfish = 0
kcap = 300
--pall------------
pmlvl = 0
pfist = 10
pclub = 10
psword = 10
paxe = 10
pdist = 10
pshield = 10
pfish = 0
pcap = 400
---drut i sorc----
mmlvl = 0
mfist = 10
mclub = 10
msword = 10
maxe = 10
mdist = 10
mshield = 10
mfish = 0
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('Ola, bem vindo ao Dream Naruto! Sou o npc que crio accounts. Você é homem ou mulher?')
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('Espere..')
elseif focus == cid then
talk_start = os.clock()
if accstatus == 1 then
if msgcontains(msg, 'homem') then selfSay('Qual é seu nome?')
seksik = 28
outfit = 171
accstatus = 2
elseif msgcontains(msg, 'mulher') then
selfSay('Qual é seu nome?')
seksik = 0
outfit = 189
accstatus = 2
end
elseif accstatus == 66 then
if msgcontains(msg, 'yes') then
vocation = 0
selfSay('Now, we\'ll make your account. So, let\'s start?')
elseif msgcontains(msg, 'asdsdf') then
vocation = 0
selfSay('The dangerous magic casting sorcerer?')
elseif msgcontains(msg, 'asdpois') then
vocation = 0
selfSay('The magical warrior of nature?')
elseif msgcontains(msg, 'coiusiotuyd') then
vocation = 0
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('Seu nome já está usado, escolha outro.')
end
else
selfSay('seu nome é ilegal.')
end
else
selfSay('Seu nome está muito longo.')
end
elseif msgcontains(msg, 'yes') then
if accstatus == 3 then
if vocations == 0 then
selfSay('Ok, fale sua senha.')
vocation = 0
accstatus = 4
else
selfSay('You\'ll be a student, right?')
accstatus = 66
end
elseif accstatus == 5 then
if seksik == 0 then
selfSay('Perfeito! Você é uma mulher chamada: '..myname..' sua senha é: '..mypass..'. Certo?')
else
selfSay('Perfeito! Você é um homem chamado: '..myname..' sua senha é: '..mypass..'. Certo?')
end
accstatus = 6
elseif accstatus == 6 then
selfSay('Ok, agora vamos ver sua account. Diga "pronto" para continuar.')
accstatus = 7
elseif accstatus == 67 then
selfSay('Fale-me sua senha.')
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('Are you able to be a Student?')
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('Sua senha é '..mypass..' certo?')
accstatus = 5
else
selfSay('Ilegal.')
end
else
selfSay('Too long.')
end
elseif msgcontains(msg, 'pronto') 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 == 3 or vocation == 4 then
mlvl = mmlvl
fist = mfist
club = mclub
sword = msword
axe = maxe
dist = mdist
shield = mshield
fish = mfish
cap = mcap
elseif vocation == 2 then
mlvl = pmlvl
fist = pfist
club = pclub
sword = psword
axe = paxe
dist = pdist
shield = pshield
fish = pfish
cap = pcap
elseif vocation == 1 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('Account 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="\"0\"" voc="\"0\"" level="\"1\"" access="\"0\"" cap="\"200\"" maglevel="\"0\"" maxdepotitems="\"1000\"" lastlogin="\"0\"" lastlogout="\"0\"" premmium="\"0\"" promoted="\"0\"" soul="\"100\"" warning="\"0\"" red="\"0\"" banticks="\"0\"" reason="\"\"" rook="\"0\"" sleeping="\"0\"" knowaddon="\"0\"" lookaddon="\"0\""><spawn x="\"49\"" y="\"42\"" z="\"7\"\/"><temple x="\"49\"" y="\"42\"" z="\"7\"\/"><health now="\"150\"" max="\"150\"" food="\"0\"\/"><mana now="\"0\"" max="\"0\"" spent="\"0\"\/"><look type="\""" ..outfit.."\"="" head="\"77\"" body="\"79\"" legs="\"78\"" feet="\"77\"\/"><guild name="\"\"" rank="\"\"" nick="\"\"" id="\"\"/"><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="\"kagemane_velo\"/"></spell></spells><ban comment="\"\"" action="\"\"/"><skull redskulltime="\"0\"" redskull="\"0\"/"><deaths\><spells\><inventory><slot slotid="\"3\""><item id="\"1987\""><inside><item id="\"2674\"" count="\"2\"/"></item></inside></item></slot><slot slotid="\"4\""><item id="\"2509\"/"></item></slot><slot slotid="\"6\""><item id="\"2379\"/"></item></slot><slot slotid="\"8\""><item id="\"2643\"/"></item></slot></inventory><depots><depot depotid="\"1\""><item id="\"2590\"" depot="\"0\""><inside><item id="\"2594\"/"></item></inside></item></depot></depots><storage\></storage\></spells\></deaths\></skull></ban></skill></skill></skill></skill></skill></skill></skill></skills></guild></look></mana></health></temple></spawn></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('Your account and your character is now created. Your new Account Number is '..myaccnumber..' and your password: '..mypass..'.')
selfSay('Now, please logout of this character to other person crate his account.')
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('Próximo...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Good bye!')
focus = 0
end
end
end
Se der certo avisa ae
Não pegou também xD
E o a door de frags, ela buga, começa a se tranformar em outros tipos de door, e depois que não pára de se tranformar... a mesma vira uma escada O:
Isso só acontece se o player der use na porta com ele dentro da porta, ela vira outra, e assim por diante ;/