Advertisement
Guest User

Untitled

a guest
Jun 13th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.11 KB | None | 0 0
  1. // ( ( ) * ) ) (
  2. // )\ ( ( )\ ) ( ( /( ` ) /(( /(( ) ( ( )\ ( ) ( (
  3. // (((_) )( ))\(()/( )\ )\())( ( ( )(_))\())\ ( /( )\))( ( ((((_)( )( ( /( ))\ )\ (
  4. // )\___(()\ /((_)((_))(_)_))/ )\ )\ _ (_(_())(_)((_))(_))(_))\ )\ )\ _ )(()\ )(_))/((_)(_) )\
  5. // ((/ __|((_)_)) _| | (_) |_ ((_)(_)_) |_ _| |(_)_)(_)_ (()(_)(_) (_)_\(_)(_)(_)_(_))( ! ((_)
  6. // | (__| '_/ -_) _` | | | _/ _ (_-<_ | | | ' \| / _` / _` / _ \ / _ \| '_/ _` | || || / _ \
  7. // \___|_| \___\__,_| |_|\__\___/__(_) |_| |_||_|_\__,_\__, \___/ /_/ \_\_| \__,_|\_,_|/ \___/
  8. // |___/ |__/
  9. // © 2016 - 2017 SaoDev Corporation Ltd. Todos os direitos reservados.
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Linq;
  13. using System.Text;
  14. using System.Threading.Tasks;
  15.  
  16. using Bios.HabboHotel.Rooms;
  17. using Bios.HabboHotel.Pathfinding;
  18. using Bios.HabboHotel.GameClients;
  19. using Bios.Communication.Packets.Outgoing.Rooms.Chat;
  20. using Bios.Communication.Packets.Outgoing.Rooms.Notifications;
  21. using Bios.Communication.Packets.Outgoing.Inventory.Purse;
  22. using Bios.Database.Interfaces;
  23. using System.Data;
  24. using Bios.Communication.Packets.Outgoing.Users;
  25. using Bios.HabboHotel.Quests;
  26. using Bios.Core;
  27.  
  28. namespace Bios.HabboHotel.Rooms.Chat.Commands.Moderator
  29. {
  30. class PremiarCommand : IChatCommand
  31. {
  32. public string PermissionRequired
  33. {
  34. get { return "command_alert_user"; }
  35. }
  36.  
  37. public string Parameters
  38. {
  39. get { return "%username%"; }
  40. }
  41.  
  42. public string Description
  43. {
  44. get { return "Faz todas as funções para premia um ganahdor de evento."; }
  45. }
  46.  
  47. public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
  48. {
  49. if (ExtraSettings.STAFF_EFFECT_ENABLED_ROOM)
  50. {
  51. if (Session.GetHabbo().isLoggedIn && Session.GetHabbo().Rank > Convert.ToInt32(BiosEmuThiago.GetConfig().data["MineRankStaff"]))
  52. {
  53. }
  54. else
  55. {
  56. Session.SendWhisper("Você precisa estar logado como staff para usar este comando.");
  57. return;
  58. }
  59. }
  60.  
  61. if (Params.Length == 1)
  62. {
  63. Session.SendWhisper("Por favor, digite o usuário que deseja premiar!");
  64. return;
  65. }
  66.  
  67. GameClient Target = BiosEmuThiago.GetGame().GetClientManager().GetClientByUsername(Params[1]);
  68. if (Target == null)
  69. {
  70. Session.SendWhisper("Opa, não foi possível encontrar esse usuário!");
  71. return;
  72. }
  73.  
  74. RoomUser TargetUser = Room.GetRoomUserManager().GetRoomUserByHabbo(Target.GetHabbo().Id);
  75. if (TargetUser == null)
  76. {
  77. Session.SendWhisper("Usuário não encontrado! Talvez ele não esteja online ou nesta sala.");
  78. return;
  79. }
  80.  
  81. if (Target.GetHabbo().Username == Session.GetHabbo().Username)
  82. {
  83. Session.SendWhisper("Você não pode se premiar!");
  84. return;
  85. }
  86.  
  87. // Comando editaveu abaixo mais cuidado pra não faze merda
  88.  
  89. RoomUser ThisUser = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
  90. if (ThisUser == null)
  91. {
  92. return;
  93. }
  94. else
  95. {
  96.  
  97. // Parte da Moedas by: Thiago Araujo
  98. Target.GetHabbo().Credits = Target.GetHabbo().Credits += Convert.ToInt32(BiosEmuThiago.GetConfig().data["Moedaspremiar"]);
  99. Target.SendMessage(new CreditBalanceComposer(Target.GetHabbo().Credits));
  100. Target.GetHabbo().Duckets += Convert.ToInt32(BiosEmuThiago.GetConfig().data["Ducketspremiar"]);
  101. Target.SendMessage(new HabboActivityPointNotificationComposer(Target.GetHabbo().Duckets, 500));
  102. Target.GetHabbo().Diamonds += Convert.ToInt32(BiosEmuThiago.GetConfig().data["Diamantespremiar"]);
  103. Target.SendMessage(new HabboActivityPointNotificationComposer(Target.GetHabbo().Diamonds, 1, 5));
  104.  
  105. // MEnsagem pro ganhador
  106. Target.SendMessage(new RoomNotificationComposer("moedas", "message", "Você ganhou " + Convert.ToInt32(BiosEmuThiago.GetConfig().data["Ducketspremiar"]) + " Ducket(s)! " + Convert.ToInt32(BiosEmuThiago.GetConfig().data["Moedaspremiar"]) + " Credito(s) " + Convert.ToInt32(BiosEmuThiago.GetConfig().data["Diamantespremiar"]) + " Diamante(s) parabéns " + Target.GetHabbo().Username + "!"));
  107.  
  108. // Sistema de entra o mobi pro ganhador by: Thiago Araujo
  109.  
  110. // Parte da codificação do dar emblema by: Thiago Araujo
  111. if (Convert.ToString(nivel["Premiar"]) != BiosEmuThiago.GetConfig().data["NiveltotalGames"])
  112. {
  113. string emblegama = "NV" + Convert.ToString(nivel["Premiar"]);
  114.  
  115. if (!Target.GetHabbo().GetBadgeComponent().HasBadge(emblegama))
  116. {
  117. Target.GetHabbo().GetBadgeComponent().GiveBadge(emblegama, true, Target);
  118. if (Target.GetHabbo().Id != Session.GetHabbo().Id)
  119. Target.SendMessage(new RoomNotificationComposer("badge/" + emblegama, 3, "Você acaba de receber um emblema game de nivel: " + emblegama + " !", ""));
  120. // Parte da Quest do evento by: Thiago Araujo
  121. BiosEmuThiago.GetGame().GetAchievementManager().ProgressAchievement(Target, "ACH_Evento", 1);
  122. // Parte da notificação com cabeça do usuário by: Thiago Araujo
  123. string figure = Target.GetHabbo().Look;
  124. BiosEmuThiago.GetGame().GetClientManager().SendMessage(new RoomNotificationComposer("fig/" + figure, 3, TargetUser.GetUsername() + " ganhou um evento no hotel. Parabéns!", " Nivel de emblema game: NIVEL " + Convert.ToString(nivel["Premiar"]) + " !"));
  125. }
  126. else
  127. Session.SendWhisper("Ops, ocorreu um erro no sistema de dar emblemas automáticos! Erro no emblema: (" + emblegama + ") !");
  128. // Mensagem de finalização do evento pro staff
  129. Session.SendWhisper("Comando (Premiar) realizado com sucesso!");
  130. }
  131. }
  132. }
  133. }
  134.  
  135. private void SendMessage(RoomNotificationComposer roomNotificationComposer)
  136. {
  137. throw new NotImplementedException();
  138. }
  139. }
  140. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement