[BCSTORM] WIRED-ACTION: Kick
Hi, I've coded many weeks ago Wired-action: Kick. And i want release it now. :)
Find
Add after:
Find from WiredInteractor.cs:
Code:
case InteractionType.actionresettimer:
message = new ServerMessage(Outgoing.WiredEffect);
message.AppendBoolean(false);
message.AppendInt32(5);
message.AppendInt32(list.Count);
foreach (RoomItem item2 in list)
{
message.AppendInt32(item2.Id);
}
message.AppendInt32(Item.GetBaseItem().SpriteId);
message.AppendInt32(Item.Id);
message.AppendString(s);
message.AppendInt32(0);
message.AppendInt32(0);
message.AppendInt32(0);
message.AppendInt32(0);
message.AppendInt32(0);
message.AppendInt32(0);
Session.SendMessage(message);
break;
Add after:
Code:
case InteractionType.actionkick:
message = new ServerMessage(Outgoing.WiredEffect);
message.AppendBoolean(false);
message.AppendInt32(0);
message.AppendInt32(list.Count);
foreach (RoomItem item2 in list)
{
message.AppendInt32(item2.Id);
}
message.AppendInt32(Item.GetBaseItem().SpriteId);
message.AppendInt32(Item.Id);
message.AppendString(s);
message.AppendInt32(0);
message.AppendInt32(0);
message.AppendInt32(7);
message.AppendInt32(0);
message.AppendInt32(0);
message.AppendInt32(0);
Session.SendMessage(message);
break;
Find:
Code:
case "actionshowmessage":
return InteractionType.actionshowmessage;
Add after:
Code:
case "actionkick":
return InteractionType.actionkick;
Find:
Code:
case InteractionType.actionresettimer:
return "actionresettimer";
Add after:
Code:
case InteractionType.actionkick:
return "actionkick";
Find:
case InteractionType.conditiontriggeronfurni:
return new WiredInteractor();
Add before:
Code:
case InteractionType.actionkick:
Find from WiredLoader.cs:
Code:
case InteractionType.actionshowmessage:
trigger = new ShowMessage(string.Empty, room.GetWiredHandler(), item.Id);
trigger.LoadFromDatabase(dbClient, room);
HandleItemLoad(trigger, room.GetWiredHandler(), item);
break;
Add after:
Code:
case InteractionType.actionkick:
trigger = new Kick(string.Empty, room.GetWiredHandler(), item.Id);
trigger.LoadFromDatabase(dbClient, room);
HandleItemLoad(trigger, room.GetWiredHandler(), item);
break;
Find from WiredSaver.cs:
Code:
case InteractionType.triggerwalkofffurni:
list = new List<RoomItem>();
num3 = 0;
trigger2 = new WalksOffFurni(item, room.GetWiredHandler(), list, num3);
HandleTriggerSave(trigger2, room.GetWiredHandler(), room, itemID);
break;
Add after:
Code:
case InteractionType.actionkick:
{
string message = string.Empty;
IWiredTrigger action = new Kick(message, room.GetWiredHandler(), itemID);
HandleTriggerSave(action, room.GetWiredHandler(), room, itemID);
break;
}
Find:
Code:
case InteractionType.actionshowmessage:
num = clientMessage.PopWiredInt32();
trigger2 = new ShowMessage(clientMessage.PopFixedString(), room.GetWiredHandler(), itemID);
HandleTriggerSave(trigger2, room.GetWiredHandler(), room, itemID);
break;
Add after:
Code:
case InteractionType.actionkick:
num = clientMessage.PopWiredInt32();
trigger2 = new Kick(clientMessage.PopFixedString(), room.GetWiredHandler(), itemID);
HandleTriggerSave(trigger2, room.GetWiredHandler(), room, itemID);
break;
Find:
Code:
internal static bool TypeIsWired(InteractionType type)
{
Add:
Code:
case InteractionType.actionkick:
Create new file Kick.cs to Wired -> Actions:
Code:
namespace Butterfly.HabboHotel.Rooms.Wired.WiredHandlers.Effects
{
using Butterfly.HabboHotel.Items;
using Butterfly.HabboHotel.Rooms;
using Butterfly.HabboHotel.Rooms.Games;
using Butterfly.HabboHotel.Rooms.Wired;
using Butterfly.HabboHotel.Rooms.Wired.WiredHandlers;
using Butterfly.HabboHotel.Rooms.Wired.WiredHandlers.Interfaces;
using Butterfly.Messages;
using Database_Manager.Database.Session_Details.Interfaces;
using HabboEvents;
using System;
using System.Runtime.InteropServices;
internal class Kick : IWiredTrigger, IWiredEffect
{
private WiredHandler handler;
private uint itemID;
private string message;
public Kick(string message, WiredHandler handler, uint itemID)
{
this.itemID = itemID;
this.handler = handler;
this.message = message;
}
public void DeleteFromDatabase(IQueryAdapter dbClient)
{
dbClient.runFastQuery("DELETE FROM trigger_item WHERE trigger_id = '" + this.itemID + "'");
}
public void Dispose()
{
this.message = null;
}
public bool Handle(RoomUser user, Team team, RoomItem item)
{
if (((user != null) && !user.IsBot) && (user.GetClient() != null))
{
user.GetClient().SendNotif(message);
ButterflyEnvironment.GetGame().GetRoomManager().GetRoom(user.RoomId).GetRoomUserManager().RemoveUserFromRoom(user.GetClient(), true, false);
this.handler.OnEvent(this.itemID);
return true;
}
return false;
}
public bool IsSpecial(out SpecialEffects function)
{
function = SpecialEffects.None;
return false;
}
public void LoadFromDatabase(IQueryAdapter dbClient, Room insideRoom)
{
dbClient.setQuery("SELECT trigger_data FROM trigger_item WHERE trigger_id = @id ");
dbClient.addParameter("id", (int)this.itemID);
this.message = dbClient.getString();
}
public void SaveToDatabase(IQueryAdapter dbClient)
{
WiredUtillity.SaveTriggerItem(dbClient, (int)this.itemID, "integer", string.Empty, this.message, false);
}
}
}
Change interaction type to actionkick on furni.
Screen:
http://i.imgur.com/KhGYFW2.png
Re: [BCSTORM] WIRED-ACTION: Kick
Re: [BCSTORM] WIRED-ACTION: Kick
Re: [BCSTORM] WIRED-ACTION: Kick
Re: [BCSTORM] WIRED-ACTION: Kick
Quote:
Create new file Kick.cs to Wired -> Actions:
Dont you mean
Butterfly.HabboHotel.Rooms.Wired.WiredHandlers.Effects
Re: [BCSTORM] WIRED-ACTION: Kick
My emu contains folder in Butterfly - > HabboHotel - > Rooms -> Wired -> Actions
Re: [BCSTORM] WIRED-ACTION: Kick
Quote:
Originally Posted by
JohnHearfield
Dont you mean
Butterfly.HabboHotel.Rooms.Wired.WiredHandlers.Effects
you're right, it's the same for me.
thanks btw.
Re: [BCSTORM] WIRED-ACTION: Kick
Thanks man, the thing I've always missed everywhere ;P
The best thing is the leave a message part xD
Re: [BCSTORM] WIRED-ACTION: Kick
yet again another great release cheers dude!
Re: [BCSTORM] WIRED-ACTION: Kick
Re: [BCSTORM] WIRED-ACTION: Kick
Quote:
Originally Posted by
Divide
BC Storm only?
Or any other rename of butterfly.
Re: [BCSTORM] WIRED-ACTION: Kick
You are an amazing person.
Re: [BCSTORM] WIRED-ACTION: Kick
hrmm i think ive got something wrong but not sure what :S
Emu starts up perfectly... but I buy the furniture and attempt to place it in my room but it goes straight back into my inventory. [yes i changed the interaction type]
Re: [BCSTORM] WIRED-ACTION: Kick
Or is situated the file WiredInteractor.cs? Do we owe creates it ?
Re: [BCSTORM] WIRED-ACTION: Kick
I think someone needs to remake the Match to Position wired.. =)