Aller au contenu
  • Veuillez ne pas poster de message pour but d'insulter, incitation à la haine, propos sexuels et tout autre qui ne respecte pas nos conditions générales !

[WIRED GIVE BADGE]


S3TZ-

Messages recommandés

                                                                                                                                    09/04/2018

Aujourd'hui je t'apporte le wired custom, give badge
C'est ma première contribution, que votre Emu apporte déjà les codes, mais pas le SWF du wired customs, ni le SQL.

Nous commençons

Allez dans
HabboHotel --> Items --> Wired --> Boxes --> Effects
Là nous créons un fichier appelé "GiveUserBadgeBox.cs"
et insérez ce qui suit:

 

using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System.Collections.Concurrent;

using Plus.Communication.Packets.Incoming;
using Plus.HabboHotel.Rooms;
using Plus.HabboHotel.Users;
using Plus.Communication.Packets.Outgoing.Rooms.Chat;

namespace Plus.HabboHotel.Items.Wired.Boxes.Effects
{
    class GiveUserBadgeBox : IWiredItem
    {
        public Room Instance { get; set; }

        public Item Item { get; set; }

        public WiredBoxType Type { get { return WiredBoxType.EffectGiveUserBadge; } }

        public ConcurrentDictionary<int, Item> SetItems { get; set; }

        public string StringData { get; set; }

        public bool BoolData { get; set; }

        public string ItemsData { get; set; }

        public GiveUserBadgeBox(Room Instance, Item Item)
        {
            this.Instance = Instance;
            this.Item = Item;
            this.SetItems = new ConcurrentDictionary<int, Item>();
        }

        public void HandleSave(ClientPacket Packet)
        {
            int Unknown = Packet.PopInt();
            string Badge = Packet.PopString();

            this.StringData = Badge;
        }

        public bool Execute(params object[] Params)
        {
            if (Params == null || Params.Length == 0)
                return false;

            Habbo Owner = PlusEnvironment.GetHabboById(Item.UserID);
            if (Owner == null || !Owner.GetPermissions().HasRight("room_item_wired_rewards"))
                return false;

            Habbo Player = (Habbo)Params[0];
            if (Player == null || Player.GetClient() == null)
                return false;

            RoomUser User = Player.CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(Player.Username);
            if (User == null)
                return false;

            if (String.IsNullOrEmpty(StringData))
                return false;

            if (Player.GetBadgeComponent().HasBadge(StringData))
                Player.GetClient().SendMessage(new WhisperComposer(User.VirtualId, "Al parecer ibas a recibir una placa pero ya cuentas con ella!", 0, User.LastBubble));
            else
            {
                Player.GetBadgeComponent().GiveBadge(StringData, true, Player.GetClient());
                Player.GetClient().SendNotification("Has recibido una nueva placa!");
            }

            return true;
        }
    }
}

Après allez dans HabboHotel --> Items --> Wired y abrimos WiredBoxType.cs

Nous recherchons la ligne 47 et insérons ce qui suit:

EffectGiveUserBadge,

 

Dans le même dossier, nous ouvrons

Nous recherchons la ligne 163 et insérons ce qui suit :

case WiredBoxType.EffectGiveUserBadge:

 

Maintenant nous cherchons HabboHotel --> Rooms --> Instance

Nous ouvrons WiredComponent.cs

 

Et nous allons à la ligne 263 et insérons:

case WiredBoxType.EffectGiveUserBadge:
                    return new GiveUserBadgeBox(_room, Item);

 

         Nous sauvegardons et compilons

 

Furnidata:
<furnitype id="15508" classname="wf_staff_badge">

<revision>9000</revision>
<defaultdir>0</defaultdir>
<xdim>1</xdim>
<ydim></ydim>
<partcolors></partcolors>
<name>Staff WIRED: Give Badge</name>
<description>Da una placa</description>
<adurl/>
<offerid>-1</offerid>
<buyout>-1</buyout>
<rentofferid>-1</rentofferid>
<rentbuyout>0</rentbuyout>
<bc>0</bc>
<customparams/>
<specialtype>1</specialtype>
<canstandon>0</canstandon>
<cansiton>0</cansiton>
<canlayon>1</canlayon>
</furnitype>

 

SQL catalog_items:

INSERT INTO `catalog_items` VALUES (15508, 'PageID', '15508', 'Staff WIRED: Give Badge', '5', '0', '0', '0', '1', '0', '1', '0', '0', '-1');

 

SQL furniture:

INSERT INTO `furniture` (`id`, `item_name`, `public_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`, `height_adjustable`, `effect_id`, `wired_id`, `is_rare`, `clothing_id`, `extra_rot`) VALUES
('15508', 'wf_staff_badge', 'Staff WIRED: Give Badge', 's', '1', '1', '1', '1', '0', '0', '15508', '1', '1', '1', '1', '1', 'wired_effect', '2', '0', '0', '0', '61', '0', '0', '0');

 

Pour avoir accès à ce lien, merci de vous connecter.

Pour avoir accès à ce lien, merci de vous connecter.


 

 

                                                             rwZ9RD7.png.5faf4a17f58e74c51d7ed1a1fe56b700.png         

                                                                                                   S3TZ#2272

Lien à poster
Partager sur d’autres sites

à l’instant, Starnix a dit :

Merci du partage ! 

Je teste ça un peu plus tard car il est minuit ;)

Oui ahaha ! Pas de soucis petit cafard :)

                                                             rwZ9RD7.png.5faf4a17f58e74c51d7ed1a1fe56b700.png         

                                                                                                   S3TZ#2272

  • Haha 1
Lien à poster
Partager sur d’autres sites

Créer un compte ou se connecter pour commenter

Vous devez être membre afin de pouvoir déposer un commentaire

Créer un compte

Créez un compte sur notre communauté. C’est facile !

Créer un nouveau compte

Se connecter

Vous avez déjà un compte ? Connectez-vous ici.

Connectez-vous maintenant
×
×
  • Créer...