-
Quest System [UBER, R63/64]
This is base for heart quests.
Oh yeah, I said this is a BASE, so you must code this futher, this is only a crappy code.
This is a TEST code, Credits to Meth0d for uberemu, Privilege(for simple packetlogger) and me for code
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Uber.Messages
{
partial class GameClientMessageHandler
{
private void Initialize()
{
//L`val11{{2}}JISjHFIND_STUFF{{2}}bling_chair_c{{2}}QA1296540000000{{2}}EXTRA01{{2}}{{2}}{{1}}
ServerMessage Message = new ServerMessage(800);
Message.AppendStringWithBreak("FIND_STUFF");
Message.AppendStringWithBreak("throne");
Message.AppendInt32(1);
Message.AppendStringWithBreak("EXTRA01");
}
public void RegisterQuests()
{
RequestHandlers[800] = new RequestHandler(Initialize);
}
}
}
Code for ION coming soon.
-
Re: Quest System [UBER, R63/64]
Brilliant release, may use this. Thanks!
-
Re: Quest System [UBER, R63/64]
I can't believe you made this one,
This is probably a copy & paste from KekoMundo,
If it isn't, Great job, But your using the wrong Class..
And you probably don't know that UberEmulator is based on ION/Deltar do you? :P
-
Re: Quest System [UBER, R63/64]
This is MY code, Kekomundo doesn't work for me anymore.
Thanks for all comments.
edit:
This code must be in a .cs file in Messages/requests
-
Re: Quest System [UBER, R63/64]
this djintrouble sounds like a badass mofo for coding this.
-
Re: Quest System [UBER, R63/64]
@PowahAlert why exactly?
I just coded a little base,I didn't code the whole system.
-
Re: Quest System [UBER, R63/64]
It's not that hard to code PE,,,so..
Posted via Mobile Device
-
Re: Quest System [UBER, R63/64]
But it's not done. I will complete this.
-
Re: Quest System [UBER, R63/64]
Quote:
Originally Posted by
Donkjam
It's not that hard to code PE,,,so..
Posted via Mobile Device
I know, but he still used the Wrong class..
-
Re: Quest System [UBER, R63/64]
Pejump2, can you help me then?
---------- Post added at 01:38 PM ---------- Previous post was at 01:30 PM ----------
You think ur the best.n I fix code now
-
Re: Quest System [UBER, R63/64]
Where can i add that code?
Or i need to make a new cs file? (first post)
-
Re: Quest System [UBER, R63/64]
SOrry, I am testing the code, the code needs to be somewhere in a exist .cs file (not a new one) so if u aren't very busy hel;p me.
-
Re: Quest System [UBER, R63/64]
it sends a few messgaes [packets] ion gets easy and easier to me everytime i see a code lol
-
Re: Quest System [UBER, R63/64]
Quote:
Originally Posted by
DjInTrouble
...
packet logger that you use? mine is bad:
Code:
[13:11:53] [RAW DATA] Got packet from port: 30000 to port: 43367
[ DATA ] (0x0000) 4C 60 76 61 6C 31 31 02 4A 49 53 6A 4B 46 49 4E L.val11.JISjKFIN
[ DATA ] (0x0010) 44 5F 53 54 55 46 46 02 62 6C 69 6E 67 5F 63 68 D.STUFF.bling.ch
[ DATA ] (0x0020) 61 69 72 5F 63 02 51 41 31 32 39 36 35 34 33 36 air.c.QA12965436
[ DATA ] (0x0030) 30 30 30 30 30 02 45 58 54 52 41 30 31 02 02 01 00000.EXTRA01...
xDD
sorry for my very bad english lol
EDIT: .. and:
MessageHandler.RegisterUsers();
MessageHandler.RegisterMessenger();
MessageHandler.RegisterCatalog();
MessageHandler.RegisterNavigator();
MessageHandler.RegisterRooms();
add
MessageHandler.RegisterMyStuff();
and..
in new .cs
...
private void Initialize()
{
....
}
public void RegisterMyStuff()
{
RequestHandlers[800] = new RequestHandler(Initialize);
}
}
}
-
Re: Quest System [UBER, R63/64]
Nice, I think.
Pejump don't be so negative dude.
-
Re: Quest System [UBER, R63/64]
-
Re: Quest System [UBER, R63/64]
thanks chillhabbo.
and I use privilege's packetlogger.
must I find MessageHandler.RegisterUsers();
MessageHandler.RegisterMessenger();
MessageHandler.RegisterCatalog();
MessageHandler.RegisterNavigator();
MessageHandler.RegisterRooms();? and add below that the code of you?
-
Re: Quest System [UBER, R63/64]
Example
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Uber.Net;
using Uber.Messages;
using Uber.HabboHotel.Users;
using Uber.HabboHotel.Users.Authenticator;
using Uber.HabboHotel.Support;
using Uber.HabboHotel.Misc;
using Uber.Storage;
using Uber.Util;
using Uber.Core;
namespace Uber.HabboHotel.GameClients
{
class GameClient
{
private uint Id;
private TcpConnection Connection;
private GameClientMessageHandler MessageHandler;
private Habbo Habbo;
public Boolean PongOK;
public uint ClientId
{
get
{
return Id;
}
}
public Boolean LoggedIn
{
get
{
if (Habbo == null)
{
return false;
}
return true;
}
}
public GameClient(uint ClientId)
{
Id = ClientId;
Connection = UberEnvironment.GetConnectionManager().GetConnection(ClientId);
MessageHandler = new GameClientMessageHandler(this);
}
public TcpConnection GetConnection()
{
return Connection;
}
public GameClientMessageHandler GetMessageHandler()
{
return MessageHandler;
}
public Habbo GetHabbo()
{
return Habbo;
}
public void StartConnection()
{
if (Connection == null)
{
return;
}
PongOK = true;
MessageHandler.RegisterGlobal();
MessageHandler.RegisterHandshake();
MessageHandler.RegisterHelp();
TcpConnection.RouteReceivedDataCallback DataRouter = new TcpConnection.RouteReceivedDataCallback(HandleConnectionData);
Connection.Start(DataRouter);
}
public void Login(string AuthTicket)
{
try
{
Habbo NewHabbo = Authenticator.TryLoginHabbo(AuthTicket, this);
UberEnvironment.GetGame().GetClientManager().LogClonesOut(NewHabbo.Username);
this.Habbo = NewHabbo;
this.Habbo.LoadData();
}
catch (IncorrectLoginException e)
{
SendNotif("Login error: " + e.Message);
//Logging.LogException(e.ToString());
Disconnect();
return;
}
try
{
UberEnvironment.GetGame().GetBanManager().CheckForBanConflicts(this);
}
catch (ModerationBanException e)
{
SendBanMessage(e.Message);
Disconnect();
return;
}
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
dbClient.ExecuteQuery("UPDATE users SET online = '1', auth_ticket = '', ip_last = '" + GetConnection().ipAddress + "' WHERE id = '" + GetHabbo().Id + "' LIMIT 1;");
dbClient.ExecuteQuery("UPDATE user_info SET login_timestamp = '" + UberEnvironment.GetUnixTimestamp() + "' WHERE user_id = '" + GetHabbo().Id + "' LIMIT 1;");
}
List<string> Rights = UberEnvironment.GetGame().GetRoleManager().GetRightsForHabbo(GetHabbo());
GetMessageHandler().GetResponse().Init(2);
GetMessageHandler().GetResponse().AppendInt32(Rights.Count);
foreach (string Right in Rights)
{
GetMessageHandler().GetResponse().AppendStringWithBreak(Right);
}
GetMessageHandler().SendResponse();
if (GetHabbo().HasFuse("fuse_mod"))
{
SendMessage(UberEnvironment.GetGame().GetModerationTool().SerializeTool());
UberEnvironment.GetGame().GetModerationTool().SendOpenTickets(this);
}
SendMessage(GetHabbo().GetAvatarEffectsInventoryComponent().Serialize());
MessageHandler.GetResponse().Init(290);
MessageHandler.GetResponse().AppendBoolean(true);
MessageHandler.GetResponse().AppendBoolean(false);
MessageHandler.SendResponse();
MessageHandler.GetResponse().Init(3);
MessageHandler.SendResponse();
MessageHandler.GetResponse().Init(517);
MessageHandler.GetResponse().AppendBoolean(true);
MessageHandler.SendResponse();
if (UberEnvironment.GetGame().GetPixelManager().NeedsUpdate(this))
{
UberEnvironment.GetGame().GetPixelManager().GivePixels(this);
}
MessageHandler.GetResponse().Init(455);
MessageHandler.GetResponse().AppendUInt(GetHabbo().HomeRoom);
MessageHandler.SendResponse();
MessageHandler.GetResponse().Init(458);
MessageHandler.GetResponse().AppendInt32(30);
MessageHandler.GetResponse().AppendInt32(GetHabbo().FavoriteRooms.Count);
foreach (uint Id in GetHabbo().FavoriteRooms)
{
MessageHandler.GetResponse().AppendUInt(Id);
}
MessageHandler.SendResponse();
SendNotif("Welcome to Star-City hotel emu by sulake.vg SHJ");
//For club badges
if (GetHabbo().HasFuse("fuse_use_club_badge") && !GetHabbo().GetBadgeComponent().HasBadge("ACH_BasicClub1"))
{
GetHabbo().GetBadgeComponent().GiveBadge("ACH_BasicClub1", true);
}
else if (!GetHabbo().HasFuse("fuse_use_club_badge") && GetHabbo().GetBadgeComponent().HasBadge("ACH_BasicClub1"))
{
GetHabbo().GetBadgeComponent().RemoveBadge("ACH_BasicClub1");
}
if (GetHabbo().GetBadgeComponent().HasBadge("HC1"))
{
GetHabbo().GetBadgeComponent().RemoveBadge("HC1");
}
//For VIP's - Gives VIP badge since I'm lazy and cbf to give it by hand :)
if (GetHabbo().Rank == 2 && !GetHabbo().GetBadgeComponent().HasBadge("VIP"))
{
GetHabbo().GetBadgeComponent().GiveBadge("VIP", true);
SendNotif("Your VIP rights have been received. You now have the BETA badge in your inventory, as well as all the cool VIP rights in-game! Thanks for purchasing VIP!");
}
else if (GetHabbo().Rank < 2 && GetHabbo().GetBadgeComponent().HasBadge("VIP"))
{
GetHabbo().GetBadgeComponent().RemoveBadge("VIP");
}
//For Staff - same structure as VIP
if (GetHabbo().Rank >= 3 && !GetHabbo().GetBadgeComponent().HasBadge("ADM"))
{
GetHabbo().GetBadgeComponent().GiveBadge("ADM", true);
}
else if (GetHabbo().Rank < 3 && GetHabbo().GetBadgeComponent().HasBadge("ADM"))
{
GetHabbo().GetBadgeComponent().RemoveBadge("ADM");
}
//100,000 register badge - inactive now
/*
if (!GetHabbo().GetBadgeComponent().HasBadge("BL1"))
{
GetHabbo().GetBadgeComponent().GiveBadge("BL1", true);
SendNotif("You have received the 100,000 Registrations badge. Check your badges to see more information.");
}
*/
//UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(this, 11, 1);
//Unlocks Respect Achievements
//For users that came before the achievement was added
//Not tested, should work
if (GetHabbo().Respect >= 1)
UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(this, 12, 1);
if (GetHabbo().Respect >= 10)
UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(this, 12, 2);
if (GetHabbo().Respect >= 25)
UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(this, 12, 3);
if (GetHabbo().Respect >= 40)
UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(this, 12, 4);
if (GetHabbo().Respect >= 60)
UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(this, 12, 5);
if (GetHabbo().Respect >= 85)
UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(this, 12, 6);
if (GetHabbo().Respect >= 100)
UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(this, 12, 7);
if (GetHabbo().Respect >= 150)
UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(this, 12, 8);
if (GetHabbo().Respect >= 200)
UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(this, 12, 9);
if (GetHabbo().Respect >= 300)
UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(this, 12, 10);
//if (!GetHabbo().GetBadgeComponent().HasBadge("Z63"))
// GetHabbo().GetBadgeComponent().GiveBadge("Z63", true);
MessageHandler.RegisterUsers();
MessageHandler.RegisterMessenger();
MessageHandler.RegisterCatalog();
MessageHandler.RegisterNavigator();
MessageHandler.RegisterRooms();
MessageHandler.Quests();
}
private void Quests()
{
ServerMessage Message = new ServerMessage(800);
Message.AppendStringWithBreak("FIND_STUFF");
Message.AppendStringWithBreak("throne");
Message.AppendInt32(1);
Message.AppendStringWithBreak("EXTRA01");
this.SendMessage(Message);
}
public void SendBanMessage(string Message)
{
ServerMessage BanMessage = new ServerMessage(35);
BanMessage.AppendStringWithBreak("A moderator has kicked you from the hotel:", 13);
BanMessage.AppendStringWithBreak(Message);
GetConnection().SendMessage(BanMessage);
}
public void SendNotif(string Message)
{
SendNotif(Message, false);
}
public void SendNotif(string Message, Boolean FromHotelManager)
{
ServerMessage nMessage = new ServerMessage();
if (FromHotelManager)
{
nMessage.Init(139);
}
else
{
nMessage.Init(161);
}
nMessage.AppendStringWithBreak(Message);
GetConnection().SendMessage(nMessage);
}
public void SendNotif(string Message, string Url)
{
ServerMessage nMessage = new ServerMessage(161);
nMessage.AppendStringWithBreak(Message);
nMessage.AppendStringWithBreak(Url);
GetConnection().SendMessage(nMessage);
}
public void Stop()
{
if (Connection != null)
Connection.Dispose();
if (GetHabbo() != null)
{
Habbo.OnDisconnect();
Habbo = null;
}
if (GetConnection() != null)
Connection = null;
if (GetMessageHandler() != null)
{
MessageHandler.Destroy();
MessageHandler = null;
}
}
public void Disconnect()
{
UberEnvironment.GetGame().GetClientManager().StopClient(Id);
}
public void HandleConnectionData(ref byte[] data)
{
if (data[0] == 64)
{
int pos = 0;
while (pos < data.Length)
{
try
{
int MessageLength = Base64Encoding.DecodeInt32(new byte[] { data[pos++], data[pos++], data[pos++] });
uint MessageId = Base64Encoding.DecodeUInt32(new byte[] { data[pos++], data[pos++] });
byte[] Content = new byte[MessageLength - 2];
for (int i = 0; i < Content.Length; i++)
{
Content[i] = data[pos++];
}
ClientMessage Message = new ClientMessage(MessageId, Content);
if (MessageHandler == null)
{
return;
}
MessageHandler.HandleRequest(Message);
}
catch (Exception e)
{
Logging.LogException("User DC: " + e.ToString());
Disconnect();
}
}
}
else
{
Connection.SendData(CrossdomainPolicy.GetXmlPolicy());
Connection.Dispose();
}
}
public void SendMessage(ServerMessage Message)
{
if (Message == null)
{
return;
}
GetConnection().SendMessage(Message);
}
}
}
-
Re: Quest System [UBER, R63/64]
^^ thanks above, but I overreaded some needed texts:$
-
Re: Quest System [UBER, R63/64]
I tried to insert it into the server as you said SpazzEmu but nothing has changed when I click on missions nothing appears.
-
Re: Quest System [UBER, R63/64]
Same problem. I dunno why but it isn't working.
-
Re: Quest System [UBER, R63/64]
For starters you're registering the wrong packet header. Second issue is the fact that the quest packets appear to have changed for the latest SWF release (so using this with your current r63 will just error you), which I have just taken a look at and guess what - They've changed the way they protect their SWFs, so it'll probably be a while before anyone figures out what's changed because the old communication file is now blank.
-
Re: Quest System [UBER, R63/64]
Thanks Sojobo, can you tell me the right packet header?
-
Re: Quest System [UBER, R63/64]
Quote:
Originally Posted by
DjInTrouble
Pejump2, can you help me then?
---------- Post added at 01:38 PM ---------- Previous post was at 01:30 PM ----------
You think ur the best.n I fix code now
Trololololol.
-
Re: Quest System [UBER, R63/64]
RequestHandlers[3102] = new RequestHandler(ShowQuests);