ScriptUO
Scripting Resources & Utilities => Stealth Client => Topic started by: rwo001 on December 30, 2015, 05:57:10 PM
-
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ScriptSDK.API;
namespace StealthUO
{
class Program
{
static void Main(string[] args)
{
Stealth.Client.Buff_DebuffSystem += _onBuff;
Stealth.Client.CastSpell("Lightning Strike"); // Toggle On
Stealth.Client.CastSpell("Lightning Strike"); // Toggle Off
Console.ReadKey();
}
public static void _onBuff(object sender, Buff_DebuffSystemEventArgs e)
{
Console.WriteLine(e.AttributeId);
Console.WriteLine(e.IsEnabled);
}
}
}
I expected the about code shoud return
1096
True
1096
False
But the result is
1096
False
1096
False
Anyone knows what the problem is?
-
namespace ScriptSDK.API
{
public class Buff_DebuffSystemEventArgs : ObjectEventArgs
{
public ushort AttributeId { get; private set; }
public bool IsEnabled { get; private set; }
public Buff_DebuffSystemEventArgs(uint objectId, ushort attributeId, bool isEnabled)
: base(objectId)
{
this.AttributeId = attributeId;
this.IsEnabled = this.IsEnabled;
// Is it the reason why the return value incorrect?
// this.IsEnabled = isEnabled?
}
}
}
-
The ScriptSDK.API is Maxwells handler for using Stealth in C# if we look at the event properly we will see :
this.IsEnabled = this.IsEnabled;
Boolean Values are false by Default. So if you assign x = x then x is ... x.
Correct should be :
this.IsEnabled = this.isEnabled;
And then it has 2 different variables and get the correct assignment.
I go now check if he fixed it on his source if not i will fix it on his side as well
-
* Fixed on SDK
* Fixed on Maxwells Repo
* Rebuild and upload on Sourceforge