Guest User

www.CriaHabbos.ga

a guest
Dec 29th, 2016
823
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.89 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.Text;
  4. using System.Collections.Generic;
  5.  
  6. using Plus.HabboHotel.Rooms;
  7. using Plus.HabboHotel.Groups;
  8. using Plus.HabboHotel.Items.Wired;
  9.  
  10. using Plus.Communication.Packets.Outgoing.Rooms.Engine;
  11. using Plus.Communication.Packets.Outgoing.Rooms.Chat;
  12. using Plus.Communication.Packets.Outgoing.Users;
  13. using Plus.Communication.Packets.Outgoing.Navigator;
  14.  
  15. using Plus.HabboHotel.Rooms;
  16.  
  17. using Plus.Database.Interfaces;
  18. using Plus.Communication.Packets.Outgoing.Inventory.Purse;
  19. using System.Data;
  20. using Plus.HabboHotel.Rooms.AI.Speech;
  21. using Plus.HabboHotel.Rooms.AI;
  22.  
  23. namespace Plus.Communication.Packets.Incoming.Rooms.Engine
  24. {
  25. class GetRoomEntryDataEvent : IPacketEvent
  26. {
  27. public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
  28. {
  29. if (Session == null || Session.GetHabbo() == null)
  30. return;
  31.  
  32. Room Room = Session.GetHabbo().CurrentRoom;
  33. if (Room == null)
  34. return;
  35.  
  36. if (Session.GetHabbo().InRoom)
  37. {
  38. Room OldRoom;
  39.  
  40. if (!PlusEnvironment.GetGame().GetRoomManager().TryGetRoom(Session.GetHabbo().CurrentRoomId, out OldRoom))
  41. return;
  42.  
  43. if (OldRoom.GetRoomUserManager() != null)
  44. OldRoom.GetRoomUserManager().RemoveUserFromRoom(Session, false, false);
  45. }
  46.  
  47. if (!Room.GetRoomUserManager().AddAvatarToRoom(Session))
  48. {
  49. Room.GetRoomUserManager().RemoveUserFromRoom(Session, false, false);
  50. return;//TODO: Remove?
  51. }
  52.  
  53. Room.SendObjects(Session);
  54.  
  55. //Status updating for messenger, do later as buggy.
  56.  
  57. try
  58. {
  59. if (Session.GetHabbo().GetMessenger() != null)
  60. Session.GetHabbo().GetMessenger().OnStatusChanged(true);
  61. }
  62. catch { }
  63.  
  64. if (Session.GetHabbo().GetStats().QuestID > 0)
  65. PlusEnvironment.GetGame().GetQuestManager().QuestReminder(Session, Session.GetHabbo().GetStats().QuestID);
  66.  
  67. Session.SendMessage(new RoomEntryInfoComposer(Room.RoomId, Room.CheckRights(Session, true)));
  68. Session.SendMessage(new RoomVisualizationSettingsComposer(Room.WallThickness, Room.FloorThickness, PlusEnvironment.EnumToBool(Room.Hidewall.ToString())));
  69.  
  70. RoomUser ThisUser = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Username);
  71.  
  72. if (ThisUser != null && Session.GetHabbo().PetId == 0)
  73. Room.SendMessage(new UserChangeComposer(ThisUser, false));
  74.  
  75. Session.SendMessage(new RoomEventComposer(Room.RoomData, Room.RoomData.Promotion));
  76.  
  77. if (Room.GetWired() != null)
  78. Room.GetWired().TriggerEvent(WiredBoxType.TriggerRoomEnter, Session.GetHabbo());
  79.  
  80. if (PlusEnvironment.GetUnixTimestamp() < Session.GetHabbo().FloodTime && Session.GetHabbo().FloodTime != 0)
  81. Session.SendMessage(new FloodControlComposer((int)Session.GetHabbo().FloodTime - (int)PlusEnvironment.GetUnixTimestamp()));
  82.  
  83. if (Room.OwnerId == Session.GetHabbo().Id)
  84. {
  85. DataRow dFrank = null;
  86. using (var dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
  87. {
  88. dbClient.SetQuery("SELECT bot_frank FROM users WHERE id = '" + Session.GetHabbo().Id + "'");
  89. dFrank = dbClient.getRow();
  90. }
  91.  
  92. if (Convert.ToBoolean(dFrank["bot_frank"]) == false)
  93. {
  94. using (var dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
  95. {
  96. dbClient.RunQuery("UPDATE users SET bot_frank = 'true' WHERE id = " + Session.GetHabbo().Id + ";");
  97. dbClient.RunQuery("UPDATE users SET nux_user = 'false' WHERE id = " + Session.GetHabbo().Id + ";");
  98. }
  99. string Chat1 = PlusEnvironment.GetDBConfig().DBData["frank.chat.1"];
  100. string Chat2 = PlusEnvironment.GetDBConfig().DBData["frank.chat.2"];
  101. string Chat3 = PlusEnvironment.GetDBConfig().DBData["frank.chat.3"];
  102. string Chat4 = PlusEnvironment.GetDBConfig().DBData["frank.chat.4"];
  103. string Chat5 = PlusEnvironment.GetDBConfig().DBData["frank.chat.5"];
  104. string Credits = PlusEnvironment.GetDBConfig().DBData["frank.give.credits"];
  105. string Diamonds = PlusEnvironment.GetDBConfig().DBData["frank.give.diamonds"];
  106. string Duckets = PlusEnvironment.GetDBConfig().DBData["frank.give.duckets"];
  107. string Gotws = PlusEnvironment.GetDBConfig().DBData["frank.give.gotws"];
  108. string Furni = PlusEnvironment.GetDBConfig().DBData["frank.give.furni"];
  109.  
  110. List<RandomSpeech> BotSpeechList = new List<RandomSpeech>();
  111. Console.WriteLine("Só se mostra bot e nuxs 1 vez por usuario.");
  112. int X = 0;
  113. int Y = 0;
  114. string hola = "false";
  115. RoomUser BotUser = Room.GetRoomUserManager().DeployBot(new RoomBot(0, Session.GetHabbo().CurrentRoomId, "generic", "freeroam", "Frank", "Manager del hotel", "hr-3194-38-36.hd-180-1.ch-220-1408.lg-285-73.sh-906-90.ha-3129-73.fa-1206-73.cc-3039-73", X, Y, 0, 4, 0, 0, 0, 0, ref BotSpeechList, "", 0, 0, false, 0, Convert.ToBoolean(hola), 1), null);
  116. System.Threading.Thread.Sleep(5000); // Mensaje bienvenida
  117. BotUser.Chat(Chat1, false, 0);
  118. System.Threading.Thread.Sleep(8000); // Segundo mensaje
  119. BotUser.Chat(Chat2, false, 0);
  120. System.Threading.Thread.Sleep(8000); // Tercer mensaje, entrega de monedas
  121. if (!string.IsNullOrWhiteSpace(Credits) && !string.IsNullOrWhiteSpace(Diamonds) && !string.IsNullOrWhiteSpace(Duckets) && !string.IsNullOrWhiteSpace(Gotws))
  122. {
  123. BotUser.Chat("Você tem " + Credits + " créditos, " + Diamonds + " diamantes, " + Duckets + " duckets, " + Gotws + " estrelas e nubes!", false, 0);
  124. Session.GetHabbo().Credits += Convert.ToInt32(PlusEnvironment.GetDBConfig().DBData["frank.give.credits"]);
  125. Session.GetHabbo().Diamonds += Convert.ToInt32(PlusEnvironment.GetDBConfig().DBData["frank.give.diamonds"]);
  126. Session.GetHabbo().Duckets += Convert.ToInt32(PlusEnvironment.GetDBConfig().DBData["frank.give.duckets"]);
  127. Session.GetHabbo().GOTWPoints += Convert.ToInt32(PlusEnvironment.GetDBConfig().DBData["frank.give.gotws"]);
  128. Session.SendMessage(new CreditBalanceComposer(Session.GetHabbo().Credits));
  129.  
  130. }
  131. else if (!string.IsNullOrWhiteSpace(Credits) && !string.IsNullOrWhiteSpace(Diamonds) && !string.IsNullOrWhiteSpace(Duckets) && !string.IsNullOrWhiteSpace(Gotws))
  132. {
  133. BotUser.Chat("Você tem " + Credits + " créditos, " + Diamonds + " diamantes, " + Duckets + " duckets e " + Gotws + " estrelas!", false, 0);
  134. Session.GetHabbo().Credits += Convert.ToInt32(PlusEnvironment.GetDBConfig().DBData["frank.give.credits"]);
  135. Session.GetHabbo().Diamonds += Convert.ToInt32(PlusEnvironment.GetDBConfig().DBData["frank.give.diamonds"]);
  136. Session.GetHabbo().Duckets += Convert.ToInt32(PlusEnvironment.GetDBConfig().DBData["frank.give.duckets"]);
  137. Session.GetHabbo().GOTWPoints += Convert.ToInt32(PlusEnvironment.GetDBConfig().DBData["frank.give.gotws"]);
  138. Session.SendMessage(new CreditBalanceComposer(Session.GetHabbo().Credits));
  139. Session.SendMessage(new ActivityPointsComposer(Session.GetHabbo().Duckets, Session.GetHabbo().Diamonds, Session.GetHabbo().GOTWPoints));
  140. }
  141. else if (!string.IsNullOrWhiteSpace(Credits) && !string.IsNullOrWhiteSpace(Diamonds) && !string.IsNullOrWhiteSpace(Duckets))
  142. {
  143. BotUser.Chat("Você tem " + Credits + " créditos, " + Diamonds + " diamantes e " + Duckets + " duckets!", false, 0);
  144. Session.GetHabbo().Credits += Convert.ToInt32(PlusEnvironment.GetDBConfig().DBData["frank.give.credits"]);
  145. Session.GetHabbo().Diamonds += Convert.ToInt32(PlusEnvironment.GetDBConfig().DBData["frank.give.diamonds"]);
  146. Session.GetHabbo().Duckets += Convert.ToInt32(PlusEnvironment.GetDBConfig().DBData["frank.give.duckets"]);
  147. Session.SendMessage(new CreditBalanceComposer(Session.GetHabbo().Credits));
  148. Session.SendMessage(new ActivityPointsComposer(Session.GetHabbo().Duckets, Session.GetHabbo().Diamonds, Session.GetHabbo().GOTWPoints));
  149. }
  150. else if (!string.IsNullOrWhiteSpace(Credits) && !string.IsNullOrWhiteSpace(Diamonds))
  151. {
  152. BotUser.Chat("Você tem " + Credits + " créditos y " + Diamonds + " diamantes!", false, 0);
  153. Session.GetHabbo().Credits += Convert.ToInt32(PlusEnvironment.GetDBConfig().DBData["frank.give.credits"]);
  154. Session.GetHabbo().Diamonds += Convert.ToInt32(PlusEnvironment.GetDBConfig().DBData["frank.give.diamonds"]);
  155. Session.SendMessage(new CreditBalanceComposer(Session.GetHabbo().Credits));
  156. Session.SendMessage(new ActivityPointsComposer(Session.GetHabbo().Duckets, Session.GetHabbo().Diamonds, Session.GetHabbo().GOTWPoints));
  157. }
  158. else if (!string.IsNullOrWhiteSpace(Credits))
  159. {
  160. BotUser.Chat("Você tem " + Credits + " créditos!", false, 0);
  161. Session.GetHabbo().Credits += Convert.ToInt32(PlusEnvironment.GetDBConfig().DBData["frank.give.credits"]);
  162. Session.SendMessage(new CreditBalanceComposer(Session.GetHabbo().Credits));
  163. }
  164. else
  165. {
  166. BotUser.Chat("Não iremos te dar nada por enquanto.", false, 0);
  167. }
  168. if (!string.IsNullOrWhiteSpace(Chat4) || !string.IsNullOrEmpty(Furni))
  169. {
  170. System.Threading.Thread.Sleep(8000); // Cuarto mensaje, entrega de furni
  171. BotUser.Chat(Chat4, false, 0);
  172. DataRow dFurni = null;
  173. using (var dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
  174. {
  175. dbClient.SetQuery("SELECT public_name FROM furniture WHERE id = '" + Convert.ToInt32(Furni) + "'");
  176. dFurni = dbClient.getRow();
  177. }
  178. Session.GetHabbo().GetInventoryComponent().AddNewItem(0, Convert.ToInt32(Furni), Convert.ToString(dFurni["public_name"]), 1, true, false, 0, 0);
  179. Session.GetHabbo().GetInventoryComponent().UpdateItems(false);
  180. }
  181. System.Threading.Thread.Sleep(8000); // Quinto ida del bot y sale el resto de las nux's
  182. BotUser.Chat(Chat5, false, 0);
  183. Room.GetGameMap().RemoveUserFromMap(BotUser, new System.Drawing.Point(0, 0));
  184. Room.GetRoomUserManager().RemoveBot(BotUser.VirtualId, false);
  185. }
  186. else
  187. {
  188. Console.WriteLine("¡No se muestra el bot ni las nux's!");
  189. }
  190. }
  191.  
  192. }
  193.  
  194. }
  195. }
Add Comment
Please, Sign In to add comment