Flag & Falg2

02/18/2013 22:20 abdoumatrix#1
Hey every1

I Want to know how to know
flags
&
flags2


PHP Code:
public class Flags
        
{
            public const 
ulong ArcherTop2 = 0x55L;
            public const 
ulong ArcherTop3 = 0x56L;
            public const 
ulong ArcherTop8 = 0x54L;
            public const 
ulong Ball = 0x80000L;
            public const 
ulong Ball2 = 0x100000L;
            public const 
ulong BlackName = 0x8000L;
            public const 
ulong CastPray = 0x40000000L;
            public const 
ulong ChaosCycle = 0x1000000000000000L;
            public const 
ulong Confused = 0x1000000000000000L;
            public const 
ulong Cyclone = 0x800000L;
            public const 
ulong Dazed = 0x40000000000000L;
            public const 
ulong Dead = 0x20L;
           
// public const ulong DefensiveStance = 0x7dL;
            
public const ulong Dodge = 0x4000000L;
            public const 
ulong EarthAura = 0x12dL;
            public const 
ulong FadeAway = 0x800L;
            public const 
ulong FatalStrike = 0x800000000000L;
            public const 
ulong FendAura = 0x123L;
            public const 
ulong FireAura = 0x12bL;
            public const 
ulong FireToistTop2 = 70L;
            public const 
ulong FireToistTop3 = 0x47L;
            public const 
ulong FireToistTop8 = 0x45L;
            public const 
ulong FlashingName = 1L;
            public const 
ulong Flashy = 0x1000000000000L;
            public const 
ulong Fly = 0x8000000L;
            public const 
ulong Freeze = 0x800000000000000L;
            public const 
ulong Ghost = 0x400L;
            public const 
ulong Gm = 0x37L;
            public const 
ulong GodlyShield = 0x200000000000000L;
            public const 
ulong HeavenBlessing = 0x200000000L;
            public const 
ulong HeavenBlessing1 = 0x210L;
            public const 
ulong Intensify = 0x10000000L;
            public const 
ulong Invisibility = 0x400000L;
            public const 
ulong Invisible = 4L;
            public const 
ulong MagicShield = 0x100L;
            public const 
ulong MetalAura = 0x125L;
            public const 
ulong MonthlyPKChampion = 0x1000000000L;
            public const 
ulong MoveSpeedRecovered = 0x100000000000000L;
            public const 
ulong NewSkillTest = 0x5bL;
            public const 
ulong ninja2 = 0x4cL;
            public const 
ulong Normal = 0L;
            public const 
ulong NpcClick = 0x7efL;
            public const 
ulong PirateTop = 0x79L;
            public const 
ulong PirateTop2 = 0x7bL;
            public const 
ulong PirateTop3 = 0x7cL;
            public const 
ulong PirateTop8 = 0x7aL;
            public const 
ulong Poisoned = 2L;
            public const 
ulong Praying = 0x80000000L;
            public const 
ulong PurpleSparkles = 0x20000000000000L;
            public const 
ulong RedName = 0x4000L;
            public const 
ulong ReflectMelee = 0x20000L;
            public const 
ulong RestoreAura = 0x80000000000000L;
            public const 
ulong Ride = 0x4000000000000L;
            public const 
ulong ShockDaze = 0x400000000000000L;
            public const 
ulong ShurikenVortex = 0x400000000000L;
            public const 
ulong StarOfAccuracy = 0x80L;
            public const 
ulong Stigma = 0x200L;
            public const 
ulong Superman = 0x40000L;
            public const 
ulong TeamLeader = 0x40L;
            public const 
ulong TEarthAura = 300L;
            public const 
ulong tempest = 0x10000000000000L;
            public const 
ulong TFendAura = 290L;
            public const 
ulong TFireAura = 0x12aL;
            public const 
ulong TMetalAura = 0x124L;
            public const 
ulong Top3Warrior = 0x20000L;
            public const 
ulong TopArcher = 0x10000000000L;
            public const 
ulong TopDeputyLeader = 0x800000000L;
            public const 
ulong TopFireTaoist = 0x40000000000L;
            public const 
ulong TopGuildLeader = 0x400000000L;
            public const 
ulong TopMonk = 0x4000000000000L;
            public const 
ulong TopMonk2 = 0x73L;
            public const 
ulong TopMonk3 = 0x72L;
            public const 
ulong TopMonk8 = 0x72L;
            public const 
ulong TopNinja = 0x80000000000L;
            public const 
ulong TopSpouse = 0x8000000000000L;
            public const 
ulong TopTrojan = 0x8000000000L;
            public const 
ulong TopWarrior = 0x4000000000L;
            public const 
ulong TopWaterTaoist = 0x20000000000L;
            public const 
ulong TrojanTop3 = 0x53L;
            public const 
ulong TrojanTop8 = 0x51L;
            public const 
ulong TWaterAura = 0x128L;
            public const 
ulong TWoodAura = 0x126L;
            public const 
ulong WatarToistTop3 = 0x4aL;
            public const 
ulong WatarToistTop8 = 0x48L;
            public const 
ulong WaterAura = 0x129L;
            public const 
ulong WeeklyPKChampion = 0x2000000000L;
            public const 
ulong WoodAura = 0x127L;
            public const 
ulong XPList = 0x10L;
            public const 
ulong Oblivion = 1UL << (ushort)111;
            public const 
ulong VIP6Effect = 1UL << 52;
            public const 
ulong GMEffect = 1UL << 53;
          
//  public const ulong TopPirate = 1UL << (ushort)121;
           // public const ulong TopMonk = 0x4000000000000L;
            
public const ulong TopPirate = 0x400000000000000;  
            public const 
ulong DefensiveStance = 1UL << (ushort)125;            

            
        } 
PHP Code:
public class Flags2
        
{
           
// public const ulong CannonBarrage = 0x50000000000000L;
            
public const ulong WarriorWalk = 0x4000000000000000L;
            public const 
ulong AzureShield = 0x20000000L;
            public const 
ulong AzureShieldFade = 0x40000000L;
            public const 
ulong BlueRestoreAura = 0x80000000000000L;
            public const 
ulong CaryingFlag = 0x80000000L;           
            public const 
ulong ChainBoltActive = 0x10000000L;
            public const 
ulong Confused = 0x1000000000000000L;
            public const 
ulong Contestant = 0x8000000L;
            public const 
ulong Dazed = 0x40000000000000L;
            public const 
ulong EarthAura = 0x400000000000L;
            public const 
ulong FendAura = 0x1000000000L;
            public const 
ulong FireAura = 0x100000000000L;
            public const 
ulong HUGEDazed = 0x400000000000000L;
            public const 
ulong IceBlock = 0x800000000000000L;
            public const 
ulong LionShield = 0x200000000000000L;
            public const 
ulong LowVigorUnableToJump = 0x4000000000000L;
            public const 
ulong MetalAura = 0x4000000000L;
            public const 
ulong MonthlyTop8Pk = 8L;
            public const 
ulong MontlyTop2Pk = 0x10L;
            public const 
ulong MontlyTop3Pk = 0x20L;
            public const 
ulong MoveSpeedRecovered = 0x100000000000000L;
            public const 
ulong Oblivion = 0x1000000000000L;
            public const 
ulong OrangeHaloGlow = 0x1000000000000L;
            public const 
ulong PurpleSparkle = 0x20000000000000L;
            public const 
ulong SoulShackle = 0x800000000000L;
            public const 
ulong SparkleHalo = 0x10000000000000L;
            public const 
ulong SuperShieldHalo = 0x200000000000000L;
            public const 
ulong Top2Archer = 0x400000L;
            public const 
ulong Top2Fire = 0x80L;
            public const 
ulong Top2Monk = 0x10000000000000L;
            public const 
ulong Top2Ninja = 0x2000L;
            public const 
ulong Top2SpouseBlue = 0x2000000L;
            public const 
ulong Top2Trojan = 0x80000L;
            public const 
ulong Top2Warrior = 0x10000L;
            public const 
ulong Top2Water = 0x400L;
            public const 
ulong Top3Archer = 0x800000L;
            public const 
ulong Top3Fire = 0x100L;
            public const 
ulong Top3Monk = 0x20000000000000L;
            public const 
ulong Top3Ninja = 0x4000L;
            public const 
ulong Top3SpouseBlue = 0x1000000L;
            public const 
ulong Top3SpouseYellow = 0x4000000L;
            public const 
ulong Top3Trojan = 0x100000L;
            public const 
ulong Top3Warrior = 0x20000L;
            public const 
ulong Top3Water = 0x800L;
            public const 
ulong Top8Archer = 0x200000L;
            public const 
ulong Top8Fire = 0x40L;
            public const 
ulong Top8Monk = 0x8000000000000L;
            public const 
ulong Top8Ninja = 0x1000L;
            public const 
ulong Top8Trojan = 0x40000L;
            public const 
ulong Top8Warrior = 0x8000L;
            public const 
ulong Top8Water = 0x200L;
            public const 
ulong TopPirate = 0x400000000000000L;
            public const 
ulong Top8Pirate = 0x800000000000000L;
            public const 
ulong Top2Pirate = 0x1000000000000000L;
            public const 
ulong Top3Pirate = 0x2000000000000000L;
            public const 
ulong TopMonk = 0x4000000000000L;
            public const 
ulong TopSpouse = 0x8000000000000L;
            public const 
ulong TyrantAura = 0x400000000L;
            public const 
ulong WaterAura = 0x40000000000L;
            public const 
ulong WeeklyTop2PkBlue = 4L;
            public const 
ulong WeeklyTop2PkGold = 2L;
            public const 
ulong WeeklyTop8Pk = 1L;
            public const 
ulong LikeFatalStrike = 1UL << (ushort)120; //PirateXP
            
public const ulong LikeFatalStrike2 = 1UL << (ushort)121; //PirateXP
            
public const ulong WoodAura = 0x10000000000L;
            public const 
ulong MagicDefender = 1UL << (ushort)28;
            public const 
ulong PathOfShadow = 1UL << (ushort)145;
            public const 
ulong BladeFlurry = 1UL << (ushort)146;
            
            

        } 
how to know this number in the first place

Sry if this question seems to be very Nooby :D but i wanna to Know

Thnx Every1 for ur Time
02/18/2013 22:29 pro4never#2
Look in the client at statuseffect.ini

you'll notice numbers in there. That's which bit controls that effect.

Now you need to have some understanding of bitlogic. The effect1/effect2 you're referring to is a pool of bits. You want to turn each of these bits on or off to control if an effect is visible.


EG: 87 Archerpk_third NULL

That means the 87th bit must be turned on in order for you to have the ArcherPK top 3 effect. The problem there is that most public sources are using a ulong or something to keep track of what bits are on and off but a ulong only consists of 64 bits. That's why it's generally split into 2 groups of effects and you'd instead be operating on the 23rd bit which would be the same as...

1 << 23; (1 shifted to the left 23 bits)
02/18/2013 23:15 abdoumatrix#3
Quote:
Originally Posted by pro4never View Post
Look in the client at statuseffect.ini

you'll notice numbers in there. That's which bit controls that effect.

Now you need to have some understanding of bitlogic. The effect1/effect2 you're referring to is a pool of bits. You want to turn each of these bits on or off to control if an effect is visible.


EG: 87 Archerpk_third NULL

That means the 87th bit must be turned on in order for you to have the ArcherPK top 3 effect. The problem there is that most public sources are using a ulong or something to keep track of what bits are on and off but a ulong only consists of 64 bits. That's why it's generally split into 2 groups of effects and you'd instead be operating on the 23rd bit which would be the same as...

1 << 23; (1 shifted to the left 23 bits)
Ty it ensure me more of what i was uderstanding
02/18/2013 23:32 zoro7070#4
i get most of the from statuseffect.ini but i don't manage to get TopMonk one
in the file it must be 114 but it show in the client Top8Monk
115 in the file top8 show top2
116 in the file top2 show top3
117 in the file top3 show holdingflag
02/19/2013 00:19 shadowman123#5
Quote:
Originally Posted by pro4never View Post
Look in the client at statuseffect.ini

you'll notice numbers in there. That's which bit controls that effect.

Now you need to have some understanding of bitlogic. The effect1/effect2 you're referring to is a pool of bits. You want to turn each of these bits on or off to control if an effect is visible.


EG: 87 Archerpk_third NULL

That means the 87th bit must be turned on in order for you to have the ArcherPK top 3 effect. The problem there is that most public sources are using a ulong or something to keep track of what bits are on and off but a ulong only consists of 64 bits. That's why it's generally split into 2 groups of effects and you'd instead be operating on the 23rd bit which would be the same as...

1 << 23; (1 shifted to the left 23 bits)
dude u alawys Impress me by ur Accurate Simple Explaination for almost anything ... i've never seen smthing in Co that u dont know :D keep going m8 -- btw u are good enough to make Updated Efficient Server exactly as Co so y dont u make one ?

Note : i didnt get the Highlightened sentences .. if u could Explain this i would be Gratful
02/19/2013 13:03 abdoumatrix#6
Quote:
Originally Posted by shadowman123 View Post
dude u alawys Impress me by ur Accurate Simple Explaination for almost anything ... i've never seen smthing in Co that u dont know :D keep going m8 -- btw u are good enough to make Updated Efficient Server exactly as Co so y dont u make one ?

Note : i didnt get the Highlightened sentences .. if u could Explain this i would be Gratful
i think he mean 32 bit
PHP Code:
you'd instead be operating on the 32rd bit which would be the same as...

1 << 32; (1 shifted to the left 32 bits) 
02/19/2013 13:08 pro4never#7
Quote:
Originally Posted by abdoumatrix View Post
i think he mean 32 bit
PHP Code:
you'd instead be operating on the 32rd bit which would be the same as...

1 << 32; (1 shifted to the left 32 bits) 
87-64=23

so it would be 1UL << 23;

ULong is a 64 bit unsigned integer. You're trying to manipulate the 87th bit to be 'on' when dealing with two pools of 64 bits (Effect1 and Effect2). To do this you need to create a 'mask' that can be used to manipulate the correct binary digit in this pool. To create this mask we take a single bit and shift it to the left as many bits as we desire, in this case the answer is 23 bits.


We then use bitwise operations to turn that bit on or off.
02/19/2013 13:11 abdoumatrix#8
Quote:
Originally Posted by pro4never View Post
87-64=23

so it would be 1UL << 23;

ULong is a 64 bit unsigned integer. You're trying to manipulate the 87th bit to be 'on' when dealing with two pools of 64 bits (Effect1 and Effect2). To do this you need to create a 'mask' that can be used to manipulate the correct binary digit in this pool. To create this mask we take a single bit and shift it to the left as many bits as we desire, in this case the answer is 23 bits.


We then use bitwise operations to turn that bit on or off.

aha

but wy when i do

some thing like this

PHP Code:
client.Entity.AddFlag2(Update.Effects.NewTopMonk); 
PHP Code:
public class Effects
        
{
            public const 
ulong NewTopMonk = 1UL << (ushort)114; 
PHP Code:
114 wspk_first NULL -1 
it work fine

or u mean it will be like this
(114-64=50)

PHP Code:
public class Effects
        
{
            public const 
ulong NewTopMonk = 1UL << 50; 
Ty again
02/19/2013 13:56 shadowman123#9
ill give u Example and correct me if am wrong :-

lets say i got Flag of value 120 So :-
ulong ShiftFlag = 120 - 64;
so 1 << ShiftFlag will Turn the Flag On .. Right ?

i got a question about Flag3 .. which statusflag does it use to add value in statusFlag1 Or 2 or there is new Type that i dont know ?
02/19/2013 14:20 pro4never#10
Quote:
Originally Posted by shadowman123 View Post
ill give u Example and correct me if am wrong :-

lets say i got Flag of value 120 So :-
ulong ShiftFlag = 120 - 64;
so 1 << ShiftFlag will Turn the Flag On .. Right ?

i got a question about Flag3 .. which statusflag does it use to add value in statusFlag1 Or 2 or there is new Type that i dont know ?
It's just more bytes in the packet being used. As such a new pool is needed, or the better alternative that you can see in hybrid's latest source. I think he called it a bit array
02/19/2013 14:24 nTL3fTy#11
Quote:
Originally Posted by pro4never View Post
It's just more bytes in the packet being used. As such a new pool is needed, or the better alternative that you can see in hybrid's latest source. I think he called it a bit array
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
;)
02/19/2013 14:30 shadowman123#12
Damn it i still dont get it :(
02/19/2013 15:09 pro4never#13
Quote:
Originally Posted by shadowman123 View Post
Damn it i still dont get it :(
Sources for all intensive purposes were handling it 'wrong' for simplicity sake (avoiding writing a new class). Packets are simply a binary stream of information being sent between client and server. The number of bytes in the spawn entity packet and update entity packet (which control status effects) has grown beyond what a ulong can hold (old patches it only took up 8 bytes which meant ulong was convenient to use). As TQ added more effects, it took up more and more space and we, when emulating their servers just split it into 2 ulong 'pools' for simplicity sake.

Hybrid's BitVector system was a way around that and does not use the standard ulong status effect pools that many on epvp have gotten accustomed to. As such you can set the number of bytes to use and it will work just fine. You just set the individual bit offsets to on or off and you're done.

<Disclaimer> I've never read through his system. I'm just describing on how I assume it works :D


<Edit>

It helps if you understand how binary works in relation to hex and decimal numbering systems. I'd suggest looking up what a Binary Octet is for starters to understand how most values in packets will be stored.