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');
DL les SWF
VS