@@ -31,9 +31,23 @@ public override void OnSpawn(NPC npc, IEntitySource source) {
31
31
// Special case for moon lord. The hands and head do not 'die' when the messages need to be triggered
32
32
public override void HitEffect ( NPC npc , NPC . HitInfo hit ) {
33
33
if ( ( npc . type == NPCID . MoonLordHand || npc . type == NPCID . MoonLordHead ) && npc . life <= 0 ) {
34
+ if ( Main . npc . Any ( x => x . type == NPCID . MoonLordCore && x . life <= 0 ) )
35
+ return ; // Messages shouldn't be sent if the Moon Lord's core is defeated as that would mean the entire boss is defeated
36
+
34
37
if ( BossChecklist . bossTracker . IsEntryLimb ( npc . type , out EntryInfo limbEntry ) && limbEntry . GetLimbMessage ( npc ) is LocalizedText message ) {
35
- if ( Main . netMode != NetmodeID . Server )
38
+ if ( Main . netMode == NetmodeID . SinglePlayer ) {
36
39
Main . NewText ( message . Format ( npc . FullName ) , Colors . RarityGreen ) ;
40
+ }
41
+ else if ( Main . netMode == NetmodeID . Server ) {
42
+ // Send a packet to all multiplayer clients. Limb messages are client based, so they will need to read their own configs to determine the message.
43
+ foreach ( Player player in Main . ActivePlayers ) {
44
+ ModPacket packet = BossChecklist . instance . GetPacket ( ) ;
45
+ packet . Write ( ( byte ) PacketMessageType . SendClientConfigMessage ) ;
46
+ packet . Write ( ( byte ) ClientMessageType . Limb ) ;
47
+ packet . Write ( npc . whoAmI ) ;
48
+ packet . Send ( player . whoAmI ) ; // Server --> Multiplayer client
49
+ }
50
+ }
37
51
}
38
52
}
39
53
}
@@ -46,7 +60,7 @@ public override void OnKill(NPC npc) {
46
60
// Display a message for Limbs/Towers if config is enabled, which should be checked after the active flags update
47
61
if ( BossChecklist . bossTracker . IsEntryLimb ( npc . type , out EntryInfo limbEntry ) && limbEntry . GetLimbMessage ( npc ) is LocalizedText message ) {
48
62
if ( Main . netMode == NetmodeID . SinglePlayer ) {
49
- Main . NewText ( message . Format ( npc . FullName ) , Colors . RarityPurple ) ;
63
+ Main . NewText ( message . Format ( npc . FullName ) , Colors . RarityGreen ) ;
50
64
}
51
65
else if ( Main . netMode == NetmodeID . Server ) {
52
66
// Send a packet to all multiplayer clients. Limb messages are client based, so they will need to read their own configs to determine the message.
0 commit comments