RealmRelay Effect Blocker
I've been writing an effect blocker that blocks client-side effects for Realm Relay but the script doesn't seem to be picking up on the SETCONDITION packets (Which, to the best of my knowledge, let the server give the client effects such as confused)
If anyone could help me with this, please do!
Code:
//effectblock.js
var ID_CREATE_SUCCESS = $.findPacketId("CREATE_SUCCESS");
var ID_SETCONDITION = $.findPacketId("SETCONDITION");
//var blockedEffects = {5,6,7,8,9,10,13};
var blockedEffects = {};
blockedEffects[0] = 5; //Dazed
blockedEffects[1] = 6; //Stunned
blockedEffects[2] = 7; //Blind
blockedEffects[3] = 8; //Hallucinating
blockedEffects[4] = 9; //Drunk
blockedEffects[5] = 10; //Confused
blockedEffects[6] = 13; //Paralyzed
function onEnable(event) {
event.echo("Hi there!"); //Debugging
}
function onClientPacket(event) {
var packet = event.getPacket();
if ( packet.id() == 23 ) {
event.echo(packet.conditionType()); //Debugging
for (var i=0; i <= blockedEffects.length; i++) {
if (packet.conditionType == blockedEffects[i]) {
event.cancel()
}
}
}
}
