Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

3rd Issue

Initiate Mage
Joined
May 5, 2014
Messages
18
Reaction score
0
Another issue has rose, its about my keyword wired, I say the keyword and nothing happens it doesn't even whisper it.

Any support, thanks!

 
Junior Spellweaver
Joined
May 15, 2014
Messages
132
Reaction score
11
@PixelHut
Try replace SaysKeyword.cs with this:
using Silverwave.HabboHotel.Items; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace Silverwave.HabboHotel.Rooms.Wired.Handlers.Triggers
{
public class SaysKeyword : WiredItem
{


public WiredSaveType SaveType
{
get { return WiredSaveType.TextBool; }
}


#region Fields
private WiredItemType mType = WiredItemType.TriggerUserSaysKeyword;
private Room mRoom;
private RoomItem mItem;
private string mKeyword;
private bool mOwner;
#endregion


#region Properties
public WiredItemType Type
{
get { return mType; }
}
public RoomItem Item
{
get { return mItem; }
set { mItem = value; }
}
public Room Room
{
get { return mRoom; }
}
public List<RoomItem> Items
{
get { return new List<RoomItem>(); }
set { }
}
public int Delay
{
get { return 0; }
set { }
}
public string OtherString
{
get { return mKeyword; }
set { mKeyword = value; }
}
public bool OtherBool
{
get { return mOwner; }
set { mOwner = value; }
}
#endregion


#region Constructors
public SaysKeyword(RoomItem Item, Room Room)
{
this.mItem = Item;
this.mRoom = Room;
this.mKeyword = "";
this.mOwner = false;
}
#endregion


#region Methods
public bool Execute(params object[] Stuff)
{
RoomUser User = (RoomUser)Stuff[0];
string Message = (string)Stuff[1];


bool Correct = false;


if (string.IsNullOrEmpty(mKeyword))
{
return false;
}


if (Message.ToLower().Contains(mKeyword.ToLower()))
{
List<WiredItem> Conditions = mRoom.GetWiredHandler().GetConditions(this);
List<WiredItem> Effects = mRoom.GetWiredHandler().GetEffects(this);


bool cancontinue = true;
if (Conditions.Count > 0)
{
foreach (WiredItem Condition in Conditions)
{
mRoom.GetWiredHandler().OnEvent(Condition);
if (!Condition.Execute(User))
{
cancontinue = false;
}
}
}


if (Effects.Count > 0 && cancontinue)
{
foreach (WiredItem Effect in Effects)
{
if (!Effect.Execute(User, Type))
{
continue;
}
mRoom.GetWiredHandler().OnEvent(Effect);
}
}


Room.GetWiredHandler().OnEvent(this);
return true;
}


return false;
}
#endregion
}
}

Code by YoWesty
Original thread: http://forum.ragezone.com/f353/plus-emu-rev-2-wired-998832/

Hope it works!
 
Upvote 0
Experienced Elementalist
Joined
Jun 7, 2012
Messages
288
Reaction score
250
No the bug isnt in the onusersays wired class its in the talk shittle ( try to say it in bold and you see thatit works)
Oki now just add this
PHP:
            if (!IsBot)
            {
                if (mRoom.GetWiredHandler().ExecuteWired(Wired.WiredItemType.TriggerUserSaysKeyword, this, Message))
                {
                    return;  
                }
                SilverwaveEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Session, HabboHotel.Quests.QuestType.SOCIAL_CHAT);
            }
in roomuser.cs at the end of
internal void Chat(GameClient Session, string Message, bool Shout, int count, int colour = 0)
before
message = new InvokedChatMessage(this, Message, Shout, colour,count);
GetRoom().QueueChatMessage(message);

and that should fix it :)
 
Upvote 0
Initiate Mage
Joined
May 5, 2014
Messages
18
Reaction score
0
No the bug isnt in the onusersays wired class its in the talk shittle ( try to say it in bold and you see thatit works)
Oki now just add this
PHP:
            if (!IsBot)
            {
                if (mRoom.GetWiredHandler().ExecuteWired(Wired.WiredItemType.TriggerUserSaysKeyword, this, Message))
                {
                    return;  
                }
                SilverwaveEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Session, HabboHotel.Quests.QuestType.SOCIAL_CHAT);
            }
in roomuser.cs at the end of
internal void Chat(GameClient Session, string Message, bool Shout, int count, int colour = 0)
before
message = new InvokedChatMessage(this, Message, Shout, colour,count);
GetRoom().QueueChatMessage(message);

and that should fix it :)

Didn't seem to work ;s
 
Upvote 0
Back
Top