bool HasRights

cammy

Member
May 15, 2014
471
220
Currently trying to allow anyone to use a crafting alter however at the moment it's set to only allow users to use their own.

How would I go about allowing people who don't own the alter to use it?

Here's my InteractorCrafting.cs
using System;
using Emulator.HabboHotel.GameClients;
using Emulator.Communication.Packets.Outgoing.Rooms.Furni;
using Emulator.Communication.Packets.Outgoing.Rooms.Notifications;
using Emulator.HabboHotel.Items.Interactor;
using Emulator.HabboHotel.Items;
using Emulator.Communication.Packets.Outgoing.Rooms.Furni.Crafting2;

namespace Emulator.HabboHotel.Items.Interactor
{
class InteractorCrafting : IFurniInteractor
{
public void OnPlace(GameClient Session, Item Item)
{
}

public void OnRemove(GameClient Session, Item Item)
{
}

public void OnTrigger(GameClient Session, Item Item, int Request, bool HasRights)
{
Session.SendMessage(new MassEventComposer("inventory/open"));
Session.SendMessage(new CraftableProductsComposer());
}

public void OnWiredTrigger(Item Item)
{
}
}
}
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,195
3,906
Haven't looked into it, however I'd assume as that's an intractable item, it's called with the 'UseFurnitureEvent' event.

PHP:
item.Interactor.OnTrigger(session, item, request, hasRights);

A quick dirty one, would be to just check if the item behaviour matches the altar, if so trigger that event and return.
 

cammy

Member
May 15, 2014
471
220
So I got the packets to return UseFurnitureEvent
this._packetNames.Add(ClientPacketHeader.CraftSecretMessageEvent, "UseFurnitureEvent");
this._packetNames.Add(ClientPacketHeader.ExecuteCraftingRecipeMessageEvent, "UseFurnitureEvent");
this._packetNames.Add(ClientPacketHeader.GetCraftingItemMessageEvent, "UseFurnitureEvent");
this._packetNames.Add(ClientPacketHeader.GetCraftingRecipesAvailableMessageEvent, "UseFurnitureEvent");
this._packetNames.Add(ClientPacketHeader.SetCraftingRecipeMessageEvent, "UseFurnitureEvent");

and added the following to UseFurniEvent
if (Item.GetBaseItem().InteractionType == InteractionType.CRAFTING_ALTAR)
return;

However that didn't work. :(
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,195
3,906
So I got the packets to return UseFurnitureEvent
this._packetNames.Add(ClientPacketHeader.CraftSecretMessageEvent, "UseFurnitureEvent");
this._packetNames.Add(ClientPacketHeader.ExecuteCraftingRecipeMessageEvent, "UseFurnitureEvent");
this._packetNames.Add(ClientPacketHeader.GetCraftingItemMessageEvent, "UseFurnitureEvent");
this._packetNames.Add(ClientPacketHeader.GetCraftingRecipesAvailableMessageEvent, "UseFurnitureEvent");
this._packetNames.Add(ClientPacketHeader.SetCraftingRecipeMessageEvent, "UseFurnitureEvent");

and added the following to UseFurniEvent
if (Item.GetBaseItem().InteractionType == InteractionType.CRAFTING_ALTAR)
return;

However that didn't work. :(

Sorry, that's what I meant however, make it invoke the trigger method, but return too, something like;

PHP:
if (item.GetBaseItem().InteractionType == InteractionType.CRAFTING_ALTAR)
{
    Item.Interactor.OnTrigger(session, item, request, hasRights);
    return;
}
 

cammy

Member
May 15, 2014
471
220
Sorry, that's what I meant however, make it invoke the trigger method, but return too, something like;

PHP:
if (item.GetBaseItem().InteractionType == InteractionType.CRAFTING_ALTAR)
{
    Item.Interactor.OnTrigger(session, item, request, hasRights);
    return;
}
Still no luck, thanks for the help though!
 

Users who are viewing this thread

Top