[Release] Status Effects [Full]

08/10/2011 07:10 Spirited#1
This is probably how TQ does theirs... it matches the file in the client at least:

Code:
namespace Kibou.Connections.Enums
{
    public class StatusEffectsShort
    {
        public const ulong
            None = 0UL,
            BlueName = 1UL << 0,
            Poisoned = 1UL << 1,
            RemoveMesh = 1UL << 2,
            XpCircle = 1UL << 4,
            RestrictMovement = 1UL << 5,
            TeamLeader = 1UL << 6,
            StarOfAccuracy = 1UL << 7,
            Shield = 1UL << 8,
            Stigma = 1UL << 9,
            Dead = 1UL << 10,
            Fade = 1UL << 11,
            RedName = 1UL << 14,
            BlackName = 1UL << 15,
            Superman = 1UL << 18,
            BodyShield = 1UL << 19,
            GodBelieve = 1UL << 20,
            SeeThrough = 1UL << 22,
            Cyclone = 1UL << 23,
            Fly = 1UL << 27,
            LuckDiffuse = 1UL << 30,
            LuckAbsorb = 1UL << 31,
            Cursed = 1UL << 32,
            Bless = 1UL << 33,
            TopLeader = 1UL << 34,
            TopDeputy = 1UL << 35,
            MonthlyPk = 1UL << 36,
            WeeklyPk = 1UL << 37,
            TopWarrior = 1UL << 38,
            TopTrojan = 1UL << 39,
            TopArcher = 1UL << 40,
            TopWater = 1UL << 41,
            TopFire = 1UL << 42,
            TopNinja = 1UL << 43,
            Vortex = 1UL << 46,
            FatalStrike = 1UL << 47,
            Champion = 1UL << 48,
            Mount = 1UL << 50,
            TopSpouse = 1UL << 51,
            OrangeSparkles = 1UL << 52,
            PurpleSparkles = 1UL << 53,
            Dazed = 1UL << 54,
            RestoreAura = 1UL << 55,
            MoveSpeedRecovered = 1UL << 56,
            GodlyShield = 1UL << 57,
            ShockDaze = 1UL << 58,
            Freeze = 1UL << 59,
            ChaosCycle = 1UL << 60;
    }
    public class StatusEffectsLong
    {
        public const ulong
            None = 0UL,
            WeeklyPkTop8 = 1UL << 64,
            WeeklyPkTop2Orange = 1UL << 65,
            WeeklyPkTop2Purple = 1UL << 66,
            MonthlyPkTop8 = 1UL << 67,
            MonthlyPkTop2 = 1UL << 68,
            MonthlyPkTop3 = 1UL << 69,
            Top8Fire = 1UL << 70,
            Top2Fire = 1UL << 71,
            Top3Fire = 1UL << 72,
            Top8Water = 1UL << 73,
            Top2Water = 1UL << 74,
            Top3Water = 1UL << 75,
            Top8Ninja = 1UL << 76,
            Top2Ninja = 1UL << 77,
            Top3Ninja = 1UL << 78,
            Top8Warrior = 1UL << 79,
            Top2Warrior = 1UL << 80,
            Top3Warrior = 1UL << 81,
            Top8Trojan = 1UL << 82,
            Top2Trojan = 1UL << 83,
            Top3Trojan = 1UL << 84,
            Top8Archer = 1UL << 85,
            Top2Archer = 1UL << 86,
            Top3Archer = 1UL << 87,
            Top3SpouseBlue = 1UL << 88,
            Top2Spouse = 1UL << 89,
            Top3SpouseGreen = 1UL << 90,
            Contestant = 1UL << 91,
            ChainBolt = 1UL << 92,
            AzureShield = 1UL << 93,
            CarryingFlag = 1UL << 95,
            TyrantAura = 1UL << 98,
            FendAura = 1UL << 100,
            MetalAura = 1UL << 102,
            WoodAura = 1UL << 104,
            WaterAura = 1UL << 106,
            FireAura = 1UL << 108,
            EarthAura = 1UL << 110,
            Oblivion = 1UL << 112,
            TopMonk = 1UL << 114,
            Top8Monk = 1UL << 115,
            Top2Monk = 1UL << 116,
            Top3Monk = 1UL << 117,
            HoldingFlag = 1UL << 118;
    }
}
08/10/2011 18:05 Sp!!ke#2
Thanks! Thats will be help me I'm sure..& Good Luck !
08/19/2011 03:13 The~Lord!#3
Thx Fang :D
08/19/2011 17:58 Crazy_XX#4
Thanks Pro
09/30/2011 09:39 florin2012#5
Where add it?can give me guide?
09/30/2011 09:50 shadowman123#6
Quote:
Originally Posted by florin2012 View Post
Where add it?can give me guide?
Network/Game packets/update.cs :)
09/30/2011 10:20 florin2012#7
Thanks.bro!!
09/30/2011 17:49 Spirited#8
Quote:
Originally Posted by florin2012 View Post
Where add it?can give me guide?
Why the hell would you add something to your source ... that you don't even understand the use of?
09/30/2011 19:12 teroareboss1#9
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Project_Terror.Characters
{
    public class StatusFlag
    {
        public const ulong
        FlasHName = 0,
        Toxic = 1,
        Invisible = 2,
        ExpSkill = 4,
        TeamLider = 6,
        Acuarity = 7,
        Shield = 8,
        Stigma = 9,
        ReviveAprend = 10,
        AddInvi = 11,
        RedName = 14,
        BlackName = 15,
        SuperMan = 18,
        Ciclone = 23,
        Flay = 27,
        Bless = 30,
        AddBlessLuky = 31,
        Curse = 32,
        AddPlayeringStone = 33,
        TopGuildLider = 34,
        TopDeputiLider = 35,
        PkChampingMonday = 36,
        PkChampingWenday = 37,
        TopWarrion = 38,
        TopTrojan = 39,
        TopArcher = 40,
        TopWatterTaoist = 41,
        TopFireTaoist = 42,
        TopNinja = 43,
        Vortex = 46,
        FatalStrike = 47,
        PureEffect = 48,
        Ride = 50,
        TopSpounse = 51,
        EffectStralucitorGalben = 52,
        EffectStralucitorMov = 53,
        Stun = 54,// for steed race
        EffectBlue = 55,// for steed race
        SpeedRecover = 56, // for steed race
        SpeedRecoverWithShield = 57,// for steed race
        StunBig = 58,// for steed race
        IceBlock = 59,
        InverseJump = 60,
        TopWeeklyTop8 = 63,
        TopWeeklyOrangeTop2 = 64,//portocaliu
        TopWeeklyMovTop2 = 65,//mov
        WoothlyTop8 = 66,//blue
        WoothlyTop2 = 67,//portocaliu
        WoothlyTop3 = 68,
        FireTaoistTop8 = 69,
        FireTaoistTop2 = 70,
        FireTaoistTop3 = 71,
        WaterTaoistTop8 = 72,
        WaterTaoistTop2 = 73,
        WaterTaoistTop3 = 74,
        NinjaTaoistTop8 = 75,
        NinjaTaoistTop2 = 76,
        NinjaTaoistTop3 = 77,
        WarriorTaoistTop8 = 78,
        WarriorTaoistTop2 = 79,
        WarriorTaoistTop3 = 80,
        TrojanTaoistTop8 = 81,
        TrojanTaoistTop2 = 82,
        TrojanTaoistTop3 = 83,
        ArcherTaoistTop8 = 84,
        ArcherTaoistTop2 = 85,
        ArcherTaoistTop3 = 86,
        SpouseTop3 = 87,
        SpouseTop2 = 88,
        Contestant = 90,// don't know that.. is icon.. think for GuildWar quest (Flag quest)
        WarriorPureSkill = 91,
        waterPureSkillShield = 92,
        FlagNoJump = 94, //steag for GuildWar quest(unable jump)
        TyrantAura = 97,//For Critical Strike ... subClass
        FendAura = 99,//imunity ... subClass
        ElementalAura_Metal = 101,//elemental ... subClass
        ElementalAura_Wood = 103,//elemental ... subClass
        ElementalAura_Water = 105,
        ElementalAura_Fire = 107,
        ElementalAura_Earth = 109,
        PureMonkSkill = 110,
        Oblivion = 111,
        TopMonk = 113,
        TopMonk8 = 114,
        TopMonk2 = 115,
        TopMonk3 = 116,
        FargAlowJump = 117;

        private Packets.Update upgrade;
        private Characters.Player player;
        public StatusFlag(Characters.Player pl)
        {
            player = pl;
        }

        /*BIG THX TO ALEX IMPULSE*/
        public void Clear()
        {
            player.SpawnPacket.StatusFlag = 0;
            player.SpawnPacket.StatusFlag2 = 0;
            upgrade = new Project_Terror.Characters.Packets.Update(true);
            upgrade.UID = player.UID;
            upgrade.Append(Packets.Update.StatusFlag, player.SpawnPacket.StatusFlag, player.SpawnPacket.StatusFlag2);
            player.game.SendData(upgrade.ToArray());
            new Screen.Base(player.game, upgrade.ToArray(), true, Screen.Base.MessageType.Players);
        }
        public void AddBitValue(int offset)
        {
            if (offset > 62)
            {
                player.SpawnPacket.StatusFlag2 |= (ulong)((ulong)1 << (offset - 63));
            }
            else
            {
                player.SpawnPacket.StatusFlag |= (ulong)((ulong)1 << offset);
            }
            upgrade = new Project_Terror.Characters.Packets.Update(true);
            upgrade.UID = player.UID;
            upgrade.Append(Packets.Update.StatusFlag, player.SpawnPacket.StatusFlag, player.SpawnPacket.StatusFlag2);
            player.game.SendData(upgrade.ToArray());
            new Screen.Base(player.game, upgrade.ToArray(), true, Screen.Base.MessageType.Players);
        }
        public void RemoveBitValue(int offset)
        {
            if (offset > 62)
            {
                player.SpawnPacket.StatusFlag2 &= ~(ulong)((ulong)1 << (offset - 63));
            }
            else
            {
                player.SpawnPacket.StatusFlag &= ~(ulong)((ulong)1 << offset);
            }
            upgrade = new Project_Terror.Characters.Packets.Update(true);
            upgrade.UID = player.SpawnPacket.UID;
            upgrade.Append(Packets.Update.StatusFlag, player.SpawnPacket.StatusFlag, player.SpawnPacket.StatusFlag2);
            player.game.SendData(upgrade.ToArray());
            new Screen.Base(player.game, upgrade.ToArray(), true, Screen.Base.MessageType.Players);
        }
        public bool ContainsBitValue(int offset)
        {
            if (offset > 62)
            {
                ulong aux = player.SpawnPacket.StatusFlag2;
                aux &= ~(ulong)((ulong)1 << (offset - 63));
                return !(aux == player.SpawnPacket.StatusFlag2);
            }
            else
            {
                ulong aux = player.SpawnPacket.StatusFlag;
                aux &= ~(ulong)((ulong)1 << offset);
                return !(aux == player.SpawnPacket.StatusFlag);
            }
        }
        public void Write(byte[] Buffer, int offset)
        {
            unsafe
            {
                fixed (byte* buffer = Buffer)
                {
                    *((UInt64*)(buffer + offset)) = player.SpawnPacket.StatusFlag;
                    *((UInt64*)(buffer + offset + 8)) = player.SpawnPacket.StatusFlag2;
                }
            }
        }
    }
}
10/02/2011 00:17 shadowman123#10
Quote:
Originally Posted by Fаng View Post
Why the hell would you add something to your source ... that you don't even understand the use of?
Rofl beside he doesnt know where to add it he doesnt know how to use em ..But anyways i helped him lil bit he has to Learn smthing
10/02/2011 20:30 Korvacs#11
I think its important to note that the method used in this release will be slower than just using regular numbers due to the bitwise operation.
10/02/2011 21:39 Spirited#12
Quote:
Originally Posted by Korvacs View Post
I think its important to note that the method used in this release will be slower than just using regular numbers due to the bitwise operation.
They're constants though.
Aren't constants assigned immediately when the program starts?
10/02/2011 21:56 Korvacs#13
Constants are defined at compile time yeah, but what your using are constant expressions, which are different from constant fixed values and are treated differently in some senses.

To be honest theres no real advantage to doing it this way so why not just use enums, its much neater and offers alot more possibilities, enums also use constants btw.