Tutorial de COMO configurar el idioma de los npcs

Ver el tema anterior Ver el tema siguiente Ir abajo

Tutorial de COMO configurar el idioma de los npcs

Mensaje  WebMaster Greider el Sáb Mayo 03, 2008 3:05 am

bueno aki les dejo mi primer aporte xD me pase como 1 hora programandolos para q les puedas decir hola chao y decirles en español... por lo menos el guild master uff ese me costo bastante pero le puedes decir invitar, sacar ( es kickear), dejar ( salirte) etc xD les va a gustar, no le kite al version de ingles porq algunos se acostumbraron a decirlo en ingles y pss es mejor las 2 xD despues se arrechan y se van del server Ok dejo la habladera y aki se los dejo =P
GUILD MASTER

Código:
local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false
local talk_state = 0
local gstat = 0 -- guild status
local grank = '' -- guild rank
local gname = '' -- guild name
local cname = '' -- name of player who talks to us
local pname = '' -- name of some other player
local maxnamelen = 30
local maxranklen = 20
local maxnicklen = 20
local leaderlevel = 50
local NONE = 0
local INVITED = 1
local MEMBER = 2
local VICE = 3
local LEADER = 4
local allow_pattern = '^[a-zA-Z0-9 -]+$'
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)
cname = creatureGetName(cid)
if (msgcontains(msg, 'hi') or msgcontains(msg, 'hola') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('Hola ' .. cname .. '! En que te puedo ayudar?')
talk_state = 0
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') or msgcontains(msg, 'hola') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Disculpa, ' .. cname .. '! Te atiendo en un momento.')
elseif msgcontains(msg, 'chao') or msgcontains(msg, 'chao') and (focus == cid) and getDistanceToCreature(cid) < 4 then
selfSay('Chao, ' .. cname .. '!')
talk_state = 0
focus = 0
talk_start = 0
elseif focus == cid then
if talk_state == 0 then
msg = string.lower(msg)
if msgcontains(msg, 'found') or msgcontains(msg, 'fundar') then -- found a new guild
level = getPlayerLevel(cid)
if level >= leaderlevel then
gstat = getPlayerGuildStatus(cname)
if gstat == NONE or gstat == INVITED then
selfSay('Cual nombre quieres para tu guild?')
talk_state = 1
elseif gstat == MEMBER or gstat == VICE or gstat == LEADER then
selfSay('Disculpa ya perteneces a un guild.')
talk_state = 0
end
else
selfSay('Disculpa necesitas ser lvl ' .. leaderlevel .. ' para fundar un guild.')
end
talk_start = os.clock()
elseif msgcontains(msg, 'join') or msgcontains(msg, 'entrar') then -- join a guild when invited
gstat = getPlayerGuildStatus(cname)
if gstat == NONE then
selfSay('Disculpa no estas invitado a ningun guild.')
talk_state = 0
elseif gstat == INVITED then
gname = getPlayerGuildName(cname)
selfSay('Quieres ingresar a ' .. gname .. '?')
talk_state = 3
elseif gstat == MEMBER or gstat == VICE or gstat == LEADER then
selfSay('Disculpa ya eres miembro de un guild.')
talk_state = 0
end
talk_start = os.clock()
elseif msgcontains(msg, 'sacar') or msgcontains(msg, 'kick') then -- kick player from a guild
gstat = getPlayerGuildStatus(cname)
if gstat == VICE or gstat == LEADER then
selfSay('A quien quieres sacar?')
talk_state = 4
else
selfSay('Disculpa solo los lideres pueden sacar a un miembro')
talk_state = 0
end
talk_start = os.clock()
elseif msgcontains(msg, 'invite') or msgcontains(msg, 'invitar')then -- invite player to a guild
gstat = getPlayerGuildStatus(cname)
if gstat == VICE or gstat == LEADER then
selfSay('A quien quieres invitar?')
talk_state = 5
else
selfSay('Disculpa solo los lideres pueden invitar a alguien')
talk_state = 0
end
talk_start = os.clock()
elseif msgcontains(msg, 'leave') or msgcontains(msg, 'dejar') then -- leave a guild
gstat = getPlayerGuildStatus(cname)
if gstat == NONE or gstat == INVITED then
selfSay('No estas en ningun guild...')
talk_state = 0
elseif gstat == MEMBER or gstat == VICE then
gname = getPlayerGuildName(cname)
selfSay('Quieres dejar ' .. gname .. '?')
talk_state = 7
elseif gstat == LEADER then
selfSay('Eres el lider si dejas el guild no podras invitar mas player. Estas seguro?')
talk_state = 7
end
elseif msgcontains(msg, 'pass') or msgcontains(msg, 'pasar') then -- pass leadership
gstat = getPlayerGuildStatus(cname)
if gstat == LEADER then
selfSay('Quieres elegir un nuevo lider?')
talk_state = 8
else
selfSay('Disculpa solo un lider puede renunciar a su posicion.')
talk_state = 0
end
elseif msgcontains(msg, 'vice') then -- set vice leader
gstat = getPlayerGuildStatus(cname)
if gstat == LEADER then
selfSay('Quien quieres que sea el vice-lider?')
talk_state = 9
else
selfSay('Disculpa solo un lider puede elegir un vice-lider.')
talk_state = 0
end
elseif msgcontains(msg, 'member') or msgcontains(msg, 'miembro') then -- remove vice-leader
gstat = getPlayerGuildStatus(cname)
if gstat == LEADER then
selfSay('A que vice-lider quieres degradar a miembro?')
talk_state = 10
else
selfSay('Disculpa solo los lideres pueden degradar.')
talk_state = 0
end
elseif msgcontains(msg, 'nick') or msgcontains(msg, 'title') then -- set nick
gstat = getPlayerGuildStatus(cname);
if gstat == LEADER then
selfSay('A que jugador deseas cambiar el nick?')
talk_state = 11
else
selfSay('Disculpa solo los lideres pueden cambiar los nick.')
talk_state = 0
end
end
else -- talk_state != 0
talk_start = os.clock()
if talk_state == 1 then -- get name of new guild
gname = msg
if string.len(gname) <= maxnamelen then
if string.find(gname, allow_pattern) then
if foundNewGuild(gname) == 0 then
selfSay('Disculpa ya existe un guild con este nombre.')
talk_state = 0
else
selfSay('Que rango deseas tener?')
talk_state = 2
end
else
selfSay('Disculpa el nombre contiene caracteres invalidos.')
talk_state = 0
end
else
selfSay('Disculpa el nombre puede tener un maximo de ' .. maxnamelen .. ' caracteres.')
talk_state = 0
end
elseif talk_state == 2 then -- get rank of leader
grank = msg
if string.len(grank) <= maxranklen then
if string.find(grank, allow_pattern) then
setPlayerGuild(cname,LEADER,grank,gname)
selfSay('Ahora eres el lider del guild.')
talk_state = 0
else
selfSay('Disculpa el nombre del rango contiene caracteres ilegales.')
talk_state = 0
end
else
selfSay('Disculpa el nombre del rank puede tener un maximo de ' .. maxranklen .. ' caracteres.')
talk_state = 0
end
elseif talk_state == 3 then -- join a guild
if msg == 'yes' then
setPlayerGuildStatus(cname, MEMBER)
selfSay('Ahora eres miembro del guild.')
talk_state = 0
else
selfSay('Que mas puedo hacer por ti?')
talk_state = 0
end
elseif talk_state == 4 then -- kick player
pname = msg
gname = getPlayerGuildName(cname)
gname2 = getPlayerGuildName(pname)
if cname == pname then
selfSay('Para entrar debes decir leave o dejar .')
talk_state = 0
elseif gname == gname2 then
gstat2 = getPlayerGuildStatus(pname)
if gstat > gstat2 then
clearPlayerGuild(pname)
selfSay(' ' .. pname .. ' Fuiste sacado de tu guild.')
talk_state = 0
else
selfSay('Disculpa los vice-lider hola no pueden sacar a miembros.')
talk_state = 0
end
else
selfSay('Disculpa, ' .. pname .. ' No es tu guild.')
talk_state = 0
end
elseif talk_state == 5 then -- get invited name
pname = msg
gstat = getPlayerGuildStatus(pname)
if gstat == MEMBER or gstat == VICE or gstat == LEADER then
selfSay('Disculpa, ' .. pname .. ' esta en otro guild.')
talk_state = 0
else
selfSay('Y que rango le deseas dar a el/ella?')
talk_state = 6
end
elseif talk_state == 6 then -- get invited rank
grank = msg
if string.len(grank) <= maxranklen then
if string.find(grank, allow_pattern) then
gname = getPlayerGuildName(cname)
setPlayerGuild(pname, INVITED, grank, gname)
selfSay('Tu has invitado a ' .. pname .. ' a tu guild.')
talk_state = 0
else
selfSay('Disculpa el nombre del rank contiene caracteres ilegales.')
talk_state = 0
end
else
selfSay('Disculpa el nombre del rank puede tener un maximo de' .. maxranklen .. ' caracteres.')
talk_state = 0
end
elseif talk_state == 7 then -- leave a guild
if msg == 'yes' then
clearPlayerGuild(cname)
selfSay('Has dejado el guild.')
talk_state = 0
else
selfSay('Que mas puedo hacer por ti?')
talk_state = 0
end
elseif talk_state == 8 then -- pass leadership
pname = msg
level = getPlayerLevel(pname)
if level >= leaderlevel then
gname = getPlayerGuildName(cname)
gname2 = getPlayerGuildName(pname)
if gname == gname2 then
setPlayerGuildStatus(cname,MEMBER)
setPlayerGuildStatus(pname,LEADER)
gname = getPlayerGuildName(cname)
selfSay(pname .. ' Es el nuevo lider de ' .. gname .. '.')
talk_state = 0
else
selfSay('Disculpa, ' .. pname .. ' No esta en tu guild.')
talk_state = 0;
end
else
selfSay('Sorry, ' .. pname .. ' is not online.')
talk_state = 0
end
elseif talk_state == 9 then -- set vice-leader
pname = msg
gname = getPlayerGuildName(cname)
gname2 = getPlayerGuildName(pname)
if cname == pname then
selfSay('Para ceder el liderazgo di pasar o pass.')
talk_state = 0
elseif gname == gname2 then
gstat = getPlayerGuildStatus(pname)
if gstat == INVITED then
selfSay('Diculpa, ' .. pname .. ' No a entrado al guild aun.');
talk_state = 0
elseif gstat == VICE then
selfSay(pname .. ' Es vice-lider.')
talk_state = 0
elseif gstat == MEMBER then
setPlayerGuildStatus(pname, VICE)
selfSay(pname .. ' Es ahora vice-lider de tu guild.')
talk_state = 0
end
else
selfSay('Disculpa, ' .. pname .. ' No esta en tu guild.')
talk_state = 0
end
elseif talk_state == 10 then -- set member
pname = msg
gname = getPlayerGuildName(cname)
gname2 = getPlayerGuildName(pname)
if cname == pname then
selfSay('Para ceder el liderazgo di pasar o pass.')
talk_state = 0
elseif gname == gname2 then
gstat = getPlayerGuildStatus(pname)
if gstat == INVITED then
selfSay('Diculpa, ' .. pname .. ' No a entrado al guild aun.');
talk_state = 0
elseif gstat == VICE then
setPlayerGuildStatus(pname, MEMBER)
selfSay(pname .. ' Es ahora miembro de tu guild.')
talk_state = 0
elseif gstat == MEMBER then
selfSay(pname .. ' Ya es miembro.')
talk_state = 0
end
else
selfSay('Disculpa, ' .. pname .. ' No esta en tu guild.')
talk_state = 0
end
elseif talk_state == 11 then -- get name of player to change nick
pname = msg
gname = getPlayerGuildName(cname)
gname2 = getPlayerGuildName(pname)
if gname == gname2 then
selfSay('Y que nick quieres que tenga (a decir ninguno claro)')
talk_state = 12
else
selfSay('Disculpa, ' .. pname .. ' No esta en tu guild.')
talk_state = 0
end
elseif talk_state == 12 then -- get nick
if msg == 'none' then
setPlayerGuildNick(pname, '')
selfSay(pname .. ' ahora no tiene nick.')
talk_state = 0
else
if string.len(msg) <= maxnicklen then
if string.find(msg, allow_pattern) then
setPlayerGuildNick(pname, msg)
selfSay('Has cambiado el nick de ' .. pname .. '\\'.')
talk_state = 0
else
selfSay('Disculpa el nick contiene caracteres ilegales')
talk_state = 0
end
else
selfSay('Disculpa, el nick puede tener un maximo de ' .. maxnicklen .. ' caracteres.')
talk_state = 0
end
end
end
end
end
end

function onCreatureChangeOutfit(creature)
end

function onThink()
doNpcSetCreatureFocus(focus)
if (os.clock() - talk_start) > 45 then
if focus > 0 then
selfSay('Siguiente...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Chao.')
focus = 0
end
end
end
Vallan al script del guild master y reemplazan todo por este xD
avatar
WebMaster Greider
Admin

Cantidad de envíos : 90
Fecha de inscripción : 30/03/2008

Ver perfil de usuario http://narutoxot.powerrpg.com

Volver arriba Ir abajo

continuacion del tema escuhcado

Mensaje  WebMaster Greider el Sáb Mayo 03, 2008 3:06 am

VARKHAL (ADDONS)

Código:
local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false
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)
msg = string.lower(msg)
if (msgcontains(msg, 'hi') or msgcontains(msg, 'hola') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('Hola ' .. creatureGetName(cid) .. '! Vendo la primera addon por 5k.')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') or msgcontains(msg, 'hola') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Disculpa, ' .. creatureGetName(cid) .. '! Te atiendo en un momento.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'first addon') or msgcontains(msg, '1 addon') then
selfSay('Quieres comprar la primera addon por 5k?')
talk_state = 1
elseif msgcontains(msg, 'second addon') or msgcontains(msg, '2 addon') then
selfSay('Do you want to buy the second addon for 10k?')
talk_state = 2
elseif talk_state == 1 then
if msgcontains(msg, 'yes') or msgcontains(msg, 'si') then
if pay(cid,5000) then
addon(cid, 1)
else
selfSay('Disculpa no tienes plata...')
end
end
talk_state = 0
elseif talk_state == 2 then
if msgcontains(msg, 'yes') or msgcontains(msg, 'si') then
if pay(cid,10000) then
addon(cid, 2)
else
selfSay('Disculpa no tienes plata...')
end
end
talk_state = 0
elseif msgcontains(msg, 'bye') or msgcontains(msg, 'chao') and getDistanceToCreature(cid) < 4 then
selfSay('Chao, ' .. creatureGetName(cid) .. '! Cuidate')
focus = 0
talk_start = 0
end
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
doNpcSetCreatureFocus(focus)
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Siguiente...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Good bye then.')
focus = 0
end
end
end
Vallan al script de las addons y reemplazen todo por esto


JOHNNY PREMIUM

Código:
local focus = 0
local talk_start = 0
local target = 0
local days = 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)
msg = string.lower(msg)
if (msgcontains(msg, 'hi') or msgcontains(msg, 'hola') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('Hola ' .. creatureGetName(cid) .. '! Vendo premiums y promociones.')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') or msgcontains(msg, 'hola') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Disculpa, ' .. creatureGetName(cid) .. '! Te atiendo en un momento.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'promotion') or msgcontains(msg, 'promote') then
if getPlayerVocation(cid) > 4 then
selfSay('Disculpa ya estas promocionado.')
talk_state = 0
elseif getPlayerLevel(cid) < 20 then
selfSay('Tienes q ser level 20 para promocionarte.')
talk_state = 0
elseif not isPremium(cid) then
selfSay('Tienes q ser premium para promocionarte')
talk_state = 0
else
selfSay('Quieres comprar la promocion por 20k?')
talk_state = 1
end
elseif msgcontains(msg, 'premium') or msgcontains(msg, 'premmy') then
selfSay('Quieres comprar 7 dias de premium por 7k?')
talk_state = 2
elseif talk_state == 1 then
if msgcontains(msg, 'yes') or msgcontains(msg, 'si') then
if pay(cid,20000) then
doPlayerSetVocation(cid, getPlayerVocation(cid)+4)
selfSay('Estas promocionado!')
else
selfSay('Disculpa no tienes plata...')
end
end
talk_state = 0
elseif talk_state == 2 then
if msgcontains(msg, 'yes') or msgcontains(msg, 'si') then
if pay(cid,7000) then
selfSay('/premium '.. creatureGetName(cid) ..', 7')
selfSay('Tienes 7 dias mas de premium')
else
selfSay('Disculpa no tienes plata...')
end
end
talk_state = 0
elseif msgcontains(msg, 'bye') or msgcontains(msg, 'chao') and getDistanceToCreature(cid) < 4 then
selfSay('Chao, ' .. creatureGetName(cid) .. '!')
focus = 0
talk_start = 0
end
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
doNpcSetCreatureFocus(focus)
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Siguiente...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Chao.')
focus = 0
end
end
end
Valla al script de premiums y reemplazan todo lo que tiene adentro por lo de arriba...

Eso es todo "Por ahora" espero q les sirva =P cuando ponga los otros en spanish los pongo aka esperenlos
avatar
WebMaster Greider
Admin

Cantidad de envíos : 90
Fecha de inscripción : 30/03/2008

Ver perfil de usuario http://narutoxot.powerrpg.com

Volver arriba Ir abajo

Ver el tema anterior Ver el tema siguiente Volver arriba

- Temas similares

 
Permisos de este foro:
No puedes responder a temas en este foro.