[5165] What Does This Actually mean

12/17/2010 17:02 †he Knight#1



Hello Everybody! I'm Having trouble understanding those shits// So I want Some Help from you
NOT THE ENUM , But The Things in it
Code:
public enum StatusEffectEn : ulong
{
        Normal = 0x0,
        BlueName = 0x1,
        Poisoned = 0x2,
        Gone = 0x4,
        XPStart = 0x10,
        TeamLeader = 0x40,
        Accuracy = 0x80,
        Shield = 0x100,
        Stigma = 0x200,
        Dead = 0x420,
        Invisible = 0x400000,
        RedName = 0x4000,
        BlackName = 0x8000,
        SuperMan = 0x40000,
        Cyclone = 0x800000,
        Fly = 0x8000000,
        Pray = 0x40000000,
        Blessing = 8589934592,
        TopGuildLeader = 17179869184,
        TopDeputyLeader = 34359738368,
        MonthlyPKChampion = 68719476736,
        WeeklyPKChampion = 137438953472,
        TopWarrior = 274877906944,
        TopTrojan = 549755813888,
        TopArcher = 1099511627776,
        TopWaterTaoist = 2199023255552,
        TopFireTaoist = 4398046511104,
        TopNinja = 8796093022208,
        ShurikenVortex = 70368744177664,
        FatalStrike = 140737488355328,
        Flashy = 281474976710656,
        Ride = 1125899906842624
}


12/17/2010 18:14 _DreadNought_#2
They are in hex and sent to the client and the client knows what it means if that hex is received in that packet. ex: sent 0x123 in string packet. Client receives string packet->gets the value 0x123 and does the action.
12/17/2010 18:41 †he Knight#3
I see , Thats All I Guess//
#request close
12/17/2010 21:38 Basser#4
Remember 0x123 is not equal to 123!
12/18/2010 03:44 InfamousNoone#5
I'll cover a lesson on bitflags in my tutorial soon I guess; doesn't seem like many people understand how to use them.
12/18/2010 06:00 pro4never#6
you're probably best to wait for hybrid but the way that they work is that you essentially add them together... as such they must double each time in order to hold the possible combinations of values.


IE: bluename = 1 and poison = 2.... that means if you are bluenamed AND poisoned you have a status value of 3... changing it back to 2 removes bluename etc...

as such values for status effects use a ulong and can be quite large. When creating new status effects make sure it's using one of the unocupied doubling values (you can't do lets say a status effect using value 513.... that's cause 513 = whatever effect is assigned to 512... plus bluename.


hope that helps some
12/18/2010 09:25 †he Knight#7
Yeah Guyz , Everyone of you helped alot//