Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #region AdminDeReferidos
- case 2920:
- {
- string refername = "";
- switch (npcRequest.OptionID)
- {
- case 0:
- {
- dialog.Text("Soy el AdminDeReferidos. Puedes establecer el referido (Nombre del personaje del amigo que te invito al juego) o reclamar premio si invitaste a alguna persona. Tambien puedo darte 215 CPs por cada 30 Minutos que estes conectado (Si se te desconecta, empezara de 0 el tiempo de conexion).");
- dialog.Option("Establecer Referido.", 1);
- dialog.Option("Reclamar Premio.", 2);
- dialog.Option("Ver puntos de referido.", 3);
- dialog.Option("Reclamar Premio por estar conectado.", 4);
- dialog.Option("Paso.", 255);
- dialog.Send();
- break;
- }
- case 1:
- {
- if (client.Account.IDReferido == 0)
- {
- dialog.Text("Introduce el nombre del jugador que te invito al juego.");
- dialog.Input("Nombre del jugador: ", 10, 16);
- dialog.Option("Cerrar.", 255);
- dialog.Send();
- }
- else
- {
- dialog.Text("Ya tienes un jugador establecido como el que te invito a jugar!");
- dialog.Option("Vale", 255);
- dialog.Send();
- }
- break;
- }
- case 2:
- {
- dialog.Text("Elije el premio que quieres reclamar:");
- dialog.Option("20.000 CPs y 5 BossPoints [1 Referido].", 20);
- dialog.Option("VIP Nivel 6 por 7 Dias [5 Referidos].", 21);
- dialog.Option("Cerrar.", 255);
- dialog.Send();
- break;
- }
- case 3:
- {
- uint restanteReferidos = client.Entity.NumReferidos - client.Entity.NumReferidosTotal;
- dialog.Text("Tienes " + client.Entity.NumReferidos + " Referidos. " + restanteReferidos + " reclamados y " + client.Entity.NumReferidosTotal + " en total.");
- dialog.Option("Vale, gracias.", 255);
- dialog.Send();
- break;
- }
- case 4:
- {
- int minutosrestantes = client.Entity.OnlinePoints - 30;
- if (client.Entity.OnlinePoints >= 30)
- {
- Network.GamePackets.NpcReply npc = new Network.GamePackets.NpcReply(6, "Obtienes 215 CPs por haber estado conectado 30 Minutos en el juego!");
- npc.OptionID = 255;
- client.Send(npc.ToArray());
- client.Entity.OnlinePoints -= 30;
- client.Entity.ConquerPoints += 215;
- }
- else
- {
- dialog.Text("Has estado conectado " + client.Entity.OnlinePoints + " Minutos. Te quedan " + minutosrestantes + " para reclamar los 215 CPs");
- dialog.Option("Vale, gracias.", 255);
- dialog.Send();
- }
- break;
- }
- case 10:
- {
- if (npcRequest.Input == "" || npcRequest.Input.Contains(" "))
- {
- dialog.Text("No colocaste ningun nombre de personaje");
- dialog.Option("Ya veo.", 255);
- dialog.Send();
- return;
- }
- bool readok = false;
- if (npcRequest.Input != client.Entity.Name)
- {
- if (npcRequest.Input != "")
- {
- using (var rdr = new MySqlReader(new MySqlCommand(MySqlCommandType.SELECT).Select("entities").Where("name", npcRequest.Input)))
- {
- if (rdr.Read())
- {
- refername = rdr.ReadString("Name");
- client.Account.IDReferido = rdr.ReadUInt32("UID");
- readok = true;
- }
- }
- if (readok == false)
- {
- dialog.Text("El nombre de personaje no existe!");
- dialog.Option("Vale!", 255);
- dialog.Send();
- return;
- }
- if (readok == true)
- {
- if (client.Account.Referido(client.Account.IP, client.Account.Username, npcRequest.Input) == false)
- {
- client.Account.GuardarReferidos(client.Account.Username);
- dialog.Text("Jugador " + refername + "Establecido como el que te invito a jugar.");
- dialog.Option("Cerrar.", 255);
- dialog.Send();
- EntityTable.UpdateReferidosPJ(client.Account.IDReferido);
- return;
- }
- else
- {
- dialog.Text("Ese jugador ya lo tienes de referido en alguna de tus cuentas!");
- dialog.Option("Vaya, me has pillado!", 255);
- dialog.Send();
- }
- }
- }
- }
- break;
- }
- case 20:
- {
- if (client.Entity.NumReferidos >= 1)
- {
- client.Entity.NumReferidos -= 1;
- client.Entity.BossPoints += 5;
- client.Entity.ConquerPoints += 20000;
- dialog.Text("Obtienes el premio por tener un referido");
- dialog.Option("Gracias!", 255);
- dialog.Send();
- }
- break;
- }
- case 21:
- {
- if (client.Entity.VIPLevel != 6)
- {
- if (client.Entity.NumReferidos >= 5)
- {
- client.Entity.NumReferidos -= 5;
- client.Entity.VIPLevel = 6;
- client.Entity.VIPLevelDays = 6;
- client.Entity.VIPDays = 7;
- dialog.Text("Obtienes el premio por tener un referido");
- dialog.Option("Gracias!", 255);
- dialog.Send();
- }
- else
- {
- dialog.Text("Por favor regresa cuando tengas los 5 referidos.");
- dialog.Option("Ya veo.", 255);
- dialog.Avatar(116);
- dialog.Send();
- }
- }
- else
- {
- dialog.Text("Lo siento, ya tienes VIP nivel 6.");
- dialog.Option("Ya veo.", 255);
- dialog.Avatar(116);
- dialog.Send();
- }
- break;
- }
- }
- break;
- }
- #endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement