NewbiePresent Fully Coded

Status
Not open for further replies.
Master Summoner
Joined
Jul 12, 2009
Messages
530
Reaction score
656
Wha Do you need?
- Items table of Matty's Edit (IMPORTANT) (i dont use but i edited to it)
- ItemIdGenerator Of Matty's Edit (i dont use but i edited to it)
- A bit know about C#
- A bit know about MySql

Do u have these requestments?
Continue else return

SQL Newbie Present

1.
Code:
Add interationtype: 'box'

2.
Code:
INSERT INTO `furniture` (`id`, `public_name`, `item_name`, `type`, `width`, `length`, `stack_height`, `can_stack`, `can_sit`, `is_walkable`, `sprite_id`, `allow_recycle`, `allow_trade`, `allow_marketplace_sell`, `allow_gift`, `allow_inventory_stack`, `interaction_type`, `interaction_modes_count`, `vending_ids`, `foot_figure`) VALUES
([ITEMID], 'newbie_present', 'newbie_present', 's', 1, 1, 1, '1', '0', '0', 3885, '1', '1', '1', '1', '1', 'box', 1, '0', 0);

3.
Code:
INSERT INTO `catalog_items` (`id`, `page_id`, `item_ids`, `catalog_name`, `cost_credits`, `cost_pixels`, `amount`) VALUES
([CHOOSE CATAID], [PAGEID], '[ITEMID]', 'newbie_present', 25, 0, 1);

C# Code =)

1.
Code:
Open UberEmu -> Messages -> Requests -> Rooms.cs

2.
Search for:
Code:
public void RegisterRooms()

Bevore this void Add:
Code:
        public void NewbiePresent()
        {
            uint ItemId = Request.PopWiredUInt();
            string PetName = Request.PopFixedString();

            Room Room = Session.GetHabbo().CurrentRoom;

            if (Room == null) return;

            RoomItem Box = Room.GetItem(ItemId);

            int X = Box.X;
            int Y = Box.Y;

            uint NewItemId = UberEnvironment.GetGame().GetCatalog().GenerateItemId();
            uint BaseItem = 317;

            Pet Pet = UberEnvironment.GetGame().GetCatalog().CreatePet(Session.GetHabbo().Id, PetName, 0, "0", "FFFFFF");

            using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
            {
                dbClient.AddParamWithValue("boxid", ItemId);
                dbClient.ExecuteQuery("DELETE FROM items WHERE id = @boxid");

                dbClient.AddParamWithValue("id", Pet.PetId);
                dbClient.AddParamWithValue("roomid", Room.RoomId);
                dbClient.ExecuteQuery("UPDATE user_pets SET room_id = @roomid WHERE id = @id");
            }

            Room.RemoveFurniture(Session, ItemId);

            RoomItem RoomItem = new RoomItem(NewItemId, Room.RoomId, BaseItem, "0", X, Y, 0, 0, ""); //lame

            Room.SetFloorItem(Session, RoomItem, RoomItem.X, RoomItem.Y, RoomItem.Rot, true);

            RoomUser PetBot = Room.DeployBot(new RoomBot(Pet.PetId, Room.RoomId, "pet", "stand", Pet.Name, "", Pet.Look, X, Y, (int)Pet.Z, 0, 0, 0, 0, 0), Pet);
            PetBot.Chat(Session, "*Thanks!*", true);

            GetResponse().Init(826); //
            SendResponse();
        }

3.
Search for:
Code:
            RequestHandlers[391] = new RequestHandler(OpenFlat);

Bevore this Add:
Code:
            RequestHandlers[3006] = new RequestHandler(NewbiePresent);

4.
Code:
Open UberEmu -> HabboHotel -> Items -> FurniInteractor.cs

5.
Search for:
Code:
    class InteractorStatic : FurniInteractor

After that class add this class:

Code:
    class InteractorNewbiePresent : FurniInteractor
    {
        public override void OnPlace(GameClient Session, RoomItem Item)
        {
            Item.ExtraData = "1";          
        }

        public override void OnRemove(GameClient Session, RoomItem Item)
        {
            // <3
        }

        public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
        {
            if (Session == null)
                return;

            // Get User Room
            Room Room = Session.GetHabbo().CurrentRoom;
            RoomUser User = Room.GetRoomUserByHabbo(Session.GetHabbo().Id);

            // Checks the state of the room & item, else you can get bugs
            if (Room == null || Item == null || User == null)
            {
                return;
            }

            ServerMessage Message = new ServerMessage(825);
            Message.AppendUInt(Item.Id);
            Message.AppendInt32(0); // pettype
            Message.AppendStringWithBreak(""); // name (empty)
            Session.SendMessage(Message);
        }
    }

6.
Code:
Open UberEmu -> HabboHotel -> Items -> RoomItem.cs

7.
Search for:
Code:
                    case "teleport":

                        return new InteractorTeleport();

Bevore it add:

Code:
                    case "box":

                        return new InteractorNewbiePresent();

Thats it =)

Dont forget to push the Thanks Button!
 
Last edited:
Nice release, but it needs a check if the user was already given a newbie present, cuz else scripters could send that Packet and it would spam the hotel database etc..
 
Last edited:
Yea pejump, and we have to give the NewbieBox while user is logging in =)

But, this is a pre-code =)

Im still busy with it.
 
The type or namespace name roombot could not be fount
Uber.HabboHotel.Rooms.Room.Id is inaccesible due its protection level ( 2 Times)

I saw these errors?
 
Last edited:
Datarow dRow;
string prezzie;
if(prezzie = "1") // String the so the Prezzie is there no Spamming
{
dRow to Check if its 1
}
drow its 0 /
SendNotif whatever it is Sorry Wait till they Open there Prezzie
Append
Append.Clear

just showing yeh an example

what ever lol.

Posted Via Quick C# Reply
 
Wichard,
Oh you released newbie present code a friend gave me right the same code.

XD

/facepalm
Your friend is a newbienator, if he said 'It's my work!'.

They are noob like hell and they can't code any line of C# or whatever language.
 
/facepalm
Your friend is a newbienator, if he said 'It's my work!'.

They are noob like hell and they can't code any line of C# or whatever language.
only a welcome message
Code:
SendNotif("it's my work credits for NEWBNAME");
and in the emulator
Code:
Console.Writeline("RENEMEDUNSTABLEUBERNAME r65+");// r65 which is not released X)


---------- Post added at 07:12 PM ---------- Previous post was at 07:11 PM ----------

got error with

error message: The type or namespace servermessage could not be found ...

Pls helpp :(

helppppppppppppppppp

---------- Post added at 07:13 PM ---------- Previous post was at 07:12 PM ----------

maybe not Servermessage but ServerMessage :-) just use caps lock or shif to make a M not a m :D did you understand it or..?
 
Status
Not open for further replies.
Back