11using TaleKit . Extension ;
22using TaleKit . Game ;
3+ using TaleKit . Game . Entities ;
34using TaleKit . Game . Event . Glacernon ;
45
56namespace TaleKit . Network . Packet . Glacernon ;
67
8+
79public class Fc : IPacket
810{
911 public int AngelPercent { get ; set ; }
1012 public int DemonPercent { get ; set ; }
13+
14+ public int AngelEvent { get ; set ; }
15+ public int DemonEvent { get ; set ; }
16+
17+ public int AngelTime { get ; set ; }
18+ public int DemonTime { get ; set ; }
19+
20+ public bool IsHatus { get ; set ; }
21+ public bool IsMorcos { get ; set ; }
22+ public bool IsCalvina { get ; set ; }
23+ public bool IsBerios { get ; set ; }
1124}
1225
1326public class FcBuilder : PacketBuilder < Fc >
@@ -19,7 +32,15 @@ protected override Fc CreatePacket(string[] body)
1932 return new Fc
2033 {
2134 AngelPercent = body [ 2 ] . ToInt ( ) ,
22- DemonPercent = body [ 11 ] . ToInt ( )
35+ AngelEvent = body [ 3 ] . ToInt ( ) ,
36+ AngelTime = body [ 4 ] . ToInt ( ) ,
37+ DemonPercent = body [ 11 ] . ToInt ( ) ,
38+ DemonEvent = body [ 12 ] . ToInt ( ) ,
39+ DemonTime = body [ 13 ] . ToInt ( ) ,
40+ IsMorcos = body [ 15 ] == "1" ,
41+ IsHatus = body [ 16 ] == "1" ,
42+ IsCalvina = body [ 17 ] == "1" ,
43+ IsBerios = body [ 18 ] == "1"
2344 } ;
2445 }
2546}
@@ -28,11 +49,41 @@ public class FcProcessor : PacketProcessor<Fc>
2849{
2950 protected override void Process ( Session session , Fc packet )
3051 {
31- session . Emit ( new GlacernonPercentChangedEvent
52+ if ( packet . AngelEvent == 0 && packet . DemonEvent == 0 )
53+ {
54+ session . Emit ( new GlacernonPercentChangedEvent
55+ {
56+ Session = session ,
57+ AngelPercent = packet . AngelPercent ,
58+ DemonPercent = packet . DemonPercent
59+ } ) ;
60+ }
61+
62+ if ( packet . AngelEvent == 2 || packet . DemonEvent == 2 )
63+ {
64+ session . Emit ( new GlacernonMukrajuSpawnedEvent
65+ {
66+ Session = session ,
67+ Side = packet . AngelEvent == 2 ? GlacernonSide . Angel : GlacernonSide . Demon ,
68+ TimeLeftInSeconds = packet . AngelEvent == 2 ? packet . AngelTime : packet . DemonTime
69+ } ) ;
70+ }
71+
72+ if ( packet . AngelEvent == 3 || packet . DemonEvent == 3 )
3273 {
33- Session = session ,
34- AngelPercent = packet . AngelPercent ,
35- DemonPercent = packet . DemonPercent
36- } ) ;
74+ session . Emit ( new GlacernonRaidOpenedEvent
75+ {
76+ Session = session ,
77+ Side = packet . AngelEvent == 3 ? GlacernonSide . Angel : GlacernonSide . Demon ,
78+ TimeLeft = packet . AngelEvent == 3 ? packet . AngelTime : packet . DemonTime ,
79+ RaidKind = packet . IsMorcos
80+ ? RaidKind . Morcos
81+ : packet . IsHatus
82+ ? RaidKind . Hatus
83+ : packet . IsCalvina
84+ ? RaidKind . Calvina
85+ : RaidKind . Berios
86+ } ) ;
87+ }
3788 }
3889}
0 commit comments