¿Quieres reaccionar a este mensaje? Regístrate en el foro con unos pocos clics o inicia sesión para continuar.


Todo sobre AO
 
ÍndiceÚltimas imágenesBuscarRegistrarseConectarse

 

 NPC's dan puntos

Ir abajo 
AutorMensaje
Agus
Admin



Mensajes : 69
Fecha de inscripción : 01/07/2008

NPC's dan puntos Empty
MensajeTema: NPC's dan puntos   NPC's dan puntos EmptyJue Jul 03, 2008 6:08 am

Primero paso a explicar el codigo.
¿Para que sirve?
Es un codigo de recompensas mediante puntos.
¿Como se consigen los puntos? matando npcs.
¿Cuantos puntos me dan los npcs? Segun la cantidad que se defina en npc-hostiles.dat
Que tipo de recompensas me dan:
En todas las recompensas Oro.
Cuales son los comandos:
Para ver la cantidad de puntos que posees: /PUNTOS
Para ver que podes canjear /PREMIOS
Para Ver la lista de premios /LISTAPREMIOS
Lean el code para mas informacion.
El codigo esta testeado y es para 0.11.2.


Buscamos
Código:
UserList(UserIndex).flags.Envenenado = val(GetVar(UserFile, "FLAGS", "Envenenado"))
y arriba ponemos
Código:
'Ladder
UserList(UserIndex).flags.Puntos = val(GetVar(UserFile, "PREMIOS", "PUNTOS"))
UserList(UserIndex).flags.CambiosRealizados = val(GetVar(UserFile, "PREMIOS", "CAMBIOSREALIZADOS"))
'Ladder
Buscamos
Código:
EstaEmpo As Byte '<-Empollando (by yb)
y arriba ponemos
Código:
'Ladder
Puntos As Integer
CambiosRealizados As Integer
'Ladder
Luego buscamos
Código:
'¿Fueron modificados los atributos del usuario?
y arriba ponemos
Código:
'Ladder
Call WriteVar(UserFile, "PREMIOS", "PUNTOS", UserList(UserIndex).flags.Puntos)
Call WriteVar(UserFile, "PREMIOS", "CAMBIOSREALIZADOS", UserList(UserIndex).flags.CambiosRealizados)
'Ladder
Bien hasta aqui ya hemos logrado que lea y escriba los datos en el charlife y declaramos los flags. Ahora vamos con el Npc.
Buscamos
Código:
GiveGLD As Long
y abajo ponemos
Código:
'Ladder
PuntosDar As Long
'Ladder
Luego decimos:
LADDER ES UN GROXO y buscamos:
Código:
Npclist(NpcIndex).GiveEXP = val(Leer.DarValor("NPC" & NpcNumber, "GiveEXP"))
y abajo ponemos
Código:
'Ladder
Npclist(NpcIndex).PuntosDar = val(Leer.DarValor("NPC" & NpcNumber, "PuntosDar"))
'Ladder
Buscamos
Código:
If MiNPC.flags.ExpCount > 0 Then
y arriba ponemos
Código:
'Ladder
If MiNPC.PuntosDar > 0 Then
UserList(UserIndex).flags.Puntos = UserList(UserIndex).flags.Puntos MiNPC.PuntosDar
Call SendData(ToIndex, UserIndex, 0, "||Has ganado " & MiNPC.PuntosDar & " puntos!" & FONTTYPE_SERVER)
End If
'Ladder
Buscamos
Código:
Case "/EST"
Call SendUserStatsTxt(UserIndex, UserIndex)
Exit Sub
y abajo ponemos
Código:
'Ladder
Case "/PUNTOS"
Call SendData(ToIndex, UserIndex, 0, "||Tienes " & UserList(UserIndex).flags.Puntos & " puntos." & FONTTYPE_VENENO)
Exit Sub

Case "/PREMIOS"
Call SendData(ToIndex, UserIndex, 0, "||Tu Puntaje es " & UserList(UserIndex).flags.Puntos & " puntos." & FONTTYPE_VENENO)
If UserList(UserIndex).flags.Puntos <= 0 Then
Call SendData(ToIndex, UserIndex, 0, "||No tienes recompensas Disponibles..." & FONTTYPE_VENENO)
Exit Sub
End If
If UserList(UserIndex).flags.Puntos >= 1000 And UserList(UserIndex).flags.Puntos < 1999 Then
Call SendData(ToIndex, UserIndex, 0, "||La mejor recompensa disponible es:" & FONTTYPE_VENENO)
Call SendData(ToIndex, UserIndex, 0, "||10000 Monedas de Oro, Si deseas esta recompensa Ingresa /RECOMPENSA1 se te descontaran 1000 puntos." & FONTTYPE_VENENO)
Exit Sub
End If
If UserList(UserIndex).flags.Puntos >= 2000 And UserList(UserIndex).flags.Puntos < 2999 Then
Call SendData(ToIndex, UserIndex, 0, "||La mejor recompensa disponible es:" & FONTTYPE_VENENO)
Call SendData(ToIndex, UserIndex, 0, "||30000 Monedas de Oro, Si deseas esta recompensa Ingresa /RECOMPENSA2 se te descontaran 2000 puntos." & FONTTYPE_VENENO)
Exit Sub
End If
If UserList(UserIndex).flags.Puntos >= 3000 And UserList(UserIndex).flags.Puntos < 3999 Then
Call SendData(ToIndex, UserIndex, 0, "||La mejor recompensa disponible es:" & FONTTYPE_VENENO)
Call SendData(ToIndex, UserIndex, 0, "||50000 Monedas de Oro, Si deseas esta recompensa Ingresa /RECOMPENSA3 se te descontaran 3000 puntos." & FONTTYPE_VENENO)
Exit Sub
End If
If UserList(UserIndex).flags.Puntos >= 4000 And UserList(UserIndex).flags.Puntos < 4999 Then
Call SendData(ToIndex, UserIndex, 0, "||La mejor recompensa disponible es:" & FONTTYPE_VENENO)
Call SendData(ToIndex, UserIndex, 0, "||80000 Monedas de Oro, Si deseas esta recompensa Ingresa /RECOMPENSA4 se te descontaran 4000 puntos." & FONTTYPE_VENENO)
Exit Sub
End If
If UserList(UserIndex).flags.Puntos >= 5000 And UserList(UserIndex).flags.Puntos < 5999 Then
Call SendData(ToIndex, UserIndex, 0, "||La mejor recompensa disponible es:" & FONTTYPE_VENENO)
Call SendData(ToIndex, UserIndex, 0, "||100000 Monedas de Oro, Si deseas esta recompensa Ingresa /RECOMPENSA5 se te descontaran 5000 puntos." & FONTTYPE_VENENO)
Exit Sub
End If
If UserList(UserIndex).flags.Puntos >= 10000 And UserList(UserIndex).flags.Puntos < 99999 Then
Call SendData(ToIndex, UserIndex, 0, "||La mejor recompensa disponible es:" & FONTTYPE_VENENO)
Call SendData(ToIndex, UserIndex, 0, "||1000000 Monedas de Oro, Si deseas esta recompensa Ingresa /RECOMPENSA6 se te descontaran 10000 puntos." & FONTTYPE_VENENO)
Exit Sub
End If
If UserList(UserIndex).flags.Puntos >= 100000 Then
Call SendData(ToIndex, UserIndex, 0, "||La mejor recompensa disponible es:" & FONTTYPE_VENENO)
Call SendData(ToIndex, UserIndex, 0, "||10000000 Monedas de Oro, Si deseas esta recompensa Ingresa /RECOMPENSA7 se te descontaran 100000 puntos." & FONTTYPE_VENENO)
Exit Sub
End If
Exit Sub

Case "/RECOMPENSA1"
If UserList(UserIndex).flags.Puntos >= 1000 Then
Call SendData(ToIndex, UserIndex, 0, "||Has canjeado 1000 puntos por 10000 Monedas de Oro." & FONTTYPE_VENENO)
UserList(UserIndex).flags.Puntos = UserList(UserIndex).flags.Puntos - 1000
UserList(UserIndex).Stats.GLD = UserList(UserIndex).Stats.GLD 10000
Exit Sub
End If
If UserList(UserIndex).flags.Puntos < 1000 Then
Call SendData(ToIndex, UserIndex, 0, "||No tienes suficientes puntos para este premio." & FONTTYPE_VENENO)
Exit Sub
End If
Exit Sub

Case "/RECOMPENSA2"
If UserList(UserIndex).flags.Puntos >= 2000 Then
Call SendData(ToIndex, UserIndex, 0, "||Has canjeado 2000 puntos por 30000 Monedas de Oro." & FONTTYPE_VENENO)
UserList(UserIndex).flags.Puntos = UserList(UserIndex).flags.Puntos - 2000
UserList(UserIndex).Stats.GLD = UserList(UserIndex).Stats.GLD 30000
Exit Sub
End If
If UserList(UserIndex).flags.Puntos < 2000 Then
Call SendData(ToIndex, UserIndex, 0, "||No tienes suficientes puntos para este premio." & FONTTYPE_VENENO)
Exit Sub
End If
Exit Sub

Case "/RECOMPENSA3"
If UserList(UserIndex).flags.Puntos >= 3000 Then
Call SendData(ToIndex, UserIndex, 0, "||Has canjeado 3000 puntos por 50000 Monedas de Oro." & FONTTYPE_VENENO)
UserList(UserIndex).flags.Puntos = UserList(UserIndex).flags.Puntos - 3000
UserList(UserIndex).Stats.GLD = UserList(UserIndex).Stats.GLD 50000
Exit Sub
End If
If UserList(UserIndex).flags.Puntos < 3000 Then
Call SendData(ToIndex, UserIndex, 0, "||No tienes suficientes puntos para este premio." & FONTTYPE_VENENO)
Exit Sub
End If
Exit Sub

Case "/RECOMPENSA4"
If UserList(UserIndex).flags.Puntos >= 4000 Then
Call SendData(ToIndex, UserIndex, 0, "||Has canjeado 4000 puntos por 80000 Monedas de Oro." & FONTTYPE_VENENO)
UserList(UserIndex).flags.Puntos = UserList(UserIndex).flags.Puntos - 4000
UserList(UserIndex).Stats.GLD = UserList(UserIndex).Stats.GLD 80000
Exit Sub
End If
If UserList(UserIndex).flags.Puntos < 4000 Then
Call SendData(ToIndex, UserIndex, 0, "||No tienes suficientes puntos para este premio." & FONTTYPE_VENENO)
Exit Sub
End If
Exit Sub

Case "/RECOMPENSA5"
If UserList(UserIndex).flags.Puntos >= 5000 Then
Call SendData(ToIndex, UserIndex, 0, "||Has canjeado 5000 puntos por 100000 Monedas de Oro." & FONTTYPE_VENENO)
UserList(UserIndex).flags.Puntos = UserList(UserIndex).flags.Puntos - 5000
UserList(UserIndex).Stats.GLD = UserList(UserIndex).Stats.GLD 100000
Exit Sub
End If
If UserList(UserIndex).flags.Puntos < 5000 Then
Call SendData(ToIndex, UserIndex, 0, "||No tienes suficientes puntos para este premio." & FONTTYPE_VENENO)
Exit Sub
End If
Exit Sub

Case "/RECOMPENSA6"
If UserList(UserIndex).flags.Puntos >= 10000 Then
Call SendData(ToIndex, UserIndex, 0, "||Has canjeado 10000 puntos por 1000000 Monedas de Oro." & FONTTYPE_VENENO)
UserList(UserIndex).flags.Puntos = UserList(UserIndex).flags.Puntos - 10000
UserList(UserIndex).Stats.GLD = UserList(UserIndex).Stats.GLD 1000000
Exit Sub
End If
If UserList(UserIndex).flags.Puntos < 10000 Then
Call SendData(ToIndex, UserIndex, 0, "||No tienes suficientes puntos para este premio." & FONTTYPE_VENENO)
Exit Sub
End If
Exit Sub

Case "/RECOMPENSA7"
If UserList(UserIndex).flags.Puntos >= 100000 Then
Call SendData(ToIndex, UserIndex, 0, "||Has canjeado 10000000 puntos por 1000000 Monedas de Oro." & FONTTYPE_VENENO)
UserList(UserIndex).flags.Puntos = UserList(UserIndex).flags.Puntos - 100000
UserList(UserIndex).Stats.GLD = UserList(UserIndex).Stats.GLD 10000000
Exit Sub
End If
If UserList(UserIndex).flags.Puntos < 100000 Then
Call SendData(ToIndex, UserIndex, 0, "||No tienes suficientes puntos para este premio." & FONTTYPE_VENENO)
Exit Sub
End If
Exit Sub

Case "/LISTAPREMIOS"
Call SendData(ToIndex, UserIndex, 0, "||Lista de Premios:" & FONTTYPE_VENENO)
Call SendData(ToIndex, UserIndex, 0, "||1: Canjea 1000 puntos por 10000 Monedas de Oro." & FONTTYPE_VENENO)
Call SendData(ToIndex, UserIndex, 0, "||2: Canjea 1000 puntos por 10000 Monedas de Oro." & FONTTYPE_VENENO)
Call SendData(ToIndex, UserIndex, 0, "||3: Canjea 3000 puntos por 50000 Monedas de Oro." & FONTTYPE_VENENO)
Call SendData(ToIndex, UserIndex, 0, "||4: Canjea 4000 puntos por 80000 Monedas de Oro." & FONTTYPE_VENENO)
Call SendData(ToIndex, UserIndex, 0, "||5: Canjea 5000 puntos por 100000 Monedas de Oro." & FONTTYPE_VENENO)
Call SendData(ToIndex, UserIndex, 0, "||6: Canjea 10000 puntos por 1000000 Monedas de Oro." & FONTTYPE_VENENO)
Call SendData(ToIndex, UserIndex, 0, "||7: Canjea 10000000 puntos por 1000000 Monedas de Oro." & FONTTYPE_VENENO)
Exit Sub
'Ladder


Por ultimo al npc ahi que ponerle

PuntosDar= 200

Por ejemplo nos puede quedar así.

[NPC500] 'Murcielago
Name=Murcielago
Head=0
Body=9
Heading=3
Movement=3
Attackable=1
Comercia=0
Hostile=1
Alineacion=2
ReSpawn=0
GiveEXP=15
GiveGLD=2
MinHP=10
MaxHP=10
MaxHIT=1
MinHIT=1
PoderAtaque=15
PoderEvasion=10
DEF=0
NROITEMS=0
PuntosDar= 100

CODIGO 100% funcional 0.11.2 adaptable a otras versiones.-
Volver arriba Ir abajo
https://recompilacionao.forosactivos.com
 
NPC's dan puntos
Volver arriba 
Página 1 de 1.
 Temas similares
-
» Los npcs dicen si el user falla arriba de ellos.
» Los npcs dicen si ellos fayan sobre los users arriba de ellos.

Permisos de este foro:No puedes responder a temas en este foro.
 :: Argentum Online :: Programación :: 0.11.2-
Cambiar a: