@@ -603,6 +603,12 @@ private void SSCClone(CommandArgs args)
603
603
/// <param name="args"></param>
604
604
private void SSCModify ( CommandArgs args )
605
605
{
606
+ if ( ! TShock . ServerSideCharacterConfig . Settings . Enabled )
607
+ {
608
+ args . Player . SendErrorMessage ( GetString ( "服务器没有开启ServerSideCharacter,无法使用该命令!" ) ) ;
609
+ return ;
610
+ }
611
+
606
612
if ( args . Parameters . Count != 1 && args . Parameters . Count != 3 )
607
613
{
608
614
args . Player . SendInfoMessage ( GetString ( "输入 /zmodify help 查看修改玩家数据的指令帮助" ) ) ;
@@ -649,13 +655,15 @@ private void SSCModify(CommandArgs args)
649
655
args . Player . SendInfoMessage ( GetString ( "格式错误!输入 /zmodify help 查看修改玩家数据的指令帮助" ) ) ;
650
656
return ;
651
657
}
652
-
658
+
653
659
//再判断能不能找到人的情况
654
660
var players = this . BestFindPlayerByNameOrIndex ( args . Parameters [ 0 ] ) ;
655
661
if ( players . Count > 1 )
656
662
{
657
663
args . Player . SendInfoMessage ( this . MultipleMatchPlayerWarning ) ;
664
+
658
665
}
666
+
659
667
//在线能找到
660
668
else if ( players . Count == 1 )
661
669
{
@@ -664,29 +672,34 @@ private void SSCModify(CommandArgs args)
664
672
{
665
673
case "life" :
666
674
players [ 0 ] . TPlayer . statLife = num ;
667
- players [ 0 ] . SendData ( PacketTypes . PlayerHp , "" , players [ 0 ] . Index ) ;
668
- players [ 0 ] . SendMessage ( "您的生命值已被修改为:" + num , new Color ( 0 , 255 , 0 ) ) ;
675
+ TSPlayer . All . SendData ( PacketTypes . PlayerHp , "" , players [ 0 ] . Index ) ;
676
+ players [ 0 ] . SendMessage ( GetString ( "您的生命值已被修改为:" ) + num , new Color ( 0 , 255 , 0 ) ) ;
669
677
break ;
670
678
case "lifemax" :
671
679
players [ 0 ] . TPlayer . statLifeMax = num ;
672
- players [ 0 ] . SendData ( PacketTypes . PlayerHp , "" , players [ 0 ] . Index ) ;
680
+ TSPlayer . All . SendData ( PacketTypes . PlayerHp , "" , players [ 0 ] . Index ) ;
673
681
players [ 0 ] . SendMessage ( GetString ( "您的生命上限已被修改为:" ) + num , new Color ( 0 , 255 , 0 ) ) ;
674
682
break ;
675
683
case "mana" :
676
684
players [ 0 ] . TPlayer . statMana = num ;
677
- players [ 0 ] . SendData ( PacketTypes . PlayerMana , "" , players [ 0 ] . Index ) ;
685
+ TSPlayer . All . SendData ( PacketTypes . PlayerMana , "" , players [ 0 ] . Index ) ;
678
686
players [ 0 ] . SendMessage ( GetString ( "您的魔力值已被修改为:" ) + num , new Color ( 0 , 255 , 0 ) ) ;
679
687
break ;
680
688
case "manamax" :
681
689
players [ 0 ] . TPlayer . statManaMax = num ;
682
- players [ 0 ] . SendData ( PacketTypes . PlayerMana , "" , players [ 0 ] . Index ) ;
690
+ TSPlayer . All . SendData ( PacketTypes . PlayerMana , "" , players [ 0 ] . Index ) ;
683
691
players [ 0 ] . SendMessage ( GetString ( "您的魔力上限已被修改为:" ) + num , new Color ( 0 , 255 , 0 ) ) ;
684
692
break ;
685
693
case "fish" :
686
694
players [ 0 ] . TPlayer . anglerQuestsFinished = num ;
687
- players [ 0 ] . SendData ( PacketTypes . NumberOfAnglerQuestsCompleted , "" , players [ 0 ] . Index ) ;
695
+ TSPlayer . All . SendData ( PacketTypes . NumberOfAnglerQuestsCompleted , "" , players [ 0 ] . Index ) ;
688
696
players [ 0 ] . SendMessage ( GetString ( "您的渔夫任务完成数已被修改为:" ) + num , new Color ( 0 , 255 , 0 ) ) ;
689
697
break ;
698
+ case "golf" :
699
+ players [ 0 ] . TPlayer . golferScoreAccumulated = num ;
700
+ TSPlayer . All . SendData ( PacketTypes . NumberOfAnglerQuestsCompleted , "" , players [ 0 ] . Index ) ;
701
+ players [ 0 ] . SendMessage ( GetString ( "您的高尔夫球分数已被修改为:" ) + num , new Color ( 0 , 255 , 0 ) ) ;
702
+ break ;
690
703
default :
691
704
{
692
705
if ( config . EnablePointTracking && subCommand == "point" )
@@ -714,52 +727,52 @@ private void SSCModify(CommandArgs args)
714
727
{
715
728
case "torch" :
716
729
players [ 0 ] . TPlayer . unlockedBiomeTorches = num != 0 ;
717
- players [ 0 ] . SendData ( PacketTypes . PlayerInfo , "" , players [ 0 ] . Index ) ;
730
+ TSPlayer . All . SendData ( PacketTypes . PlayerInfo , "" , players [ 0 ] . Index ) ;
718
731
players [ 0 ] . SendMessage ( GetString ( "您的火把神增益开启状态:" ) + players [ 0 ] . TPlayer . unlockedBiomeTorches , new Color ( 0 , 255 , 0 ) ) ;
719
732
break ;
720
733
case "demmon" :
721
734
players [ 0 ] . TPlayer . extraAccessory = num != 0 ;
722
- players [ 0 ] . SendData ( PacketTypes . PlayerInfo , "" , players [ 0 ] . Index ) ;
735
+ TSPlayer . All . SendData ( PacketTypes . PlayerInfo , "" , players [ 0 ] . Index ) ;
723
736
players [ 0 ] . SendMessage ( GetString ( "您的恶魔心增益开启状态:" ) + players [ 0 ] . TPlayer . extraAccessory , new Color ( 0 , 255 , 0 ) ) ;
724
737
break ;
725
738
case "bread" :
726
739
players [ 0 ] . TPlayer . ateArtisanBread = num != 0 ;
727
- players [ 0 ] . SendData ( PacketTypes . PlayerInfo , "" , players [ 0 ] . Index ) ;
740
+ TSPlayer . All . SendData ( PacketTypes . PlayerInfo , "" , players [ 0 ] . Index ) ;
728
741
players [ 0 ] . SendMessage ( GetString ( "您的工匠面包增益开启状态:" ) + players [ 0 ] . TPlayer . ateArtisanBread , new Color ( 0 , 255 , 0 ) ) ;
729
742
break ;
730
743
case "heart" :
731
744
players [ 0 ] . TPlayer . usedAegisCrystal = num != 0 ;
732
- players [ 0 ] . SendData ( PacketTypes . PlayerInfo , "" , players [ 0 ] . Index ) ;
745
+ TSPlayer . All . SendData ( PacketTypes . PlayerInfo , "" , players [ 0 ] . Index ) ;
733
746
players [ 0 ] . SendMessage ( GetString ( "您的埃癸斯水晶增益开启状态:" ) + players [ 0 ] . TPlayer . usedAegisCrystal , new Color ( 0 , 255 , 0 ) ) ;
734
747
break ;
735
748
case "fruit" :
736
749
players [ 0 ] . TPlayer . usedAegisFruit = num != 0 ;
737
- players [ 0 ] . SendData ( PacketTypes . PlayerInfo , "" , players [ 0 ] . Index ) ;
750
+ TSPlayer . All . SendData ( PacketTypes . PlayerInfo , "" , players [ 0 ] . Index ) ;
738
751
players [ 0 ] . SendMessage ( GetString ( "您的埃癸斯果增益开启状态:" ) + players [ 0 ] . TPlayer . usedAegisFruit , new Color ( 0 , 255 , 0 ) ) ;
739
752
break ;
740
753
case "star" :
741
754
players [ 0 ] . TPlayer . usedArcaneCrystal = num != 0 ;
742
- players [ 0 ] . SendData ( PacketTypes . PlayerInfo , "" , players [ 0 ] . Index ) ;
755
+ TSPlayer . All . SendData ( PacketTypes . PlayerInfo , "" , players [ 0 ] . Index ) ;
743
756
players [ 0 ] . SendMessage ( GetString ( "您的奥术水晶增益开启状态:" ) + players [ 0 ] . TPlayer . usedArcaneCrystal , new Color ( 0 , 255 , 0 ) ) ;
744
757
break ;
745
758
case "pearl" :
746
759
players [ 0 ] . TPlayer . usedGalaxyPearl = num != 0 ;
747
- players [ 0 ] . SendData ( PacketTypes . PlayerInfo , "" , players [ 0 ] . Index ) ;
760
+ TSPlayer . All . SendData ( PacketTypes . PlayerInfo , "" , players [ 0 ] . Index ) ;
748
761
players [ 0 ] . SendMessage ( GetString ( "您的银河珍珠增益开启状态:" ) + players [ 0 ] . TPlayer . usedGalaxyPearl , new Color ( 0 , 255 , 0 ) ) ;
749
762
break ;
750
763
case "worm" :
751
764
players [ 0 ] . TPlayer . usedGummyWorm = num != 0 ;
752
- players [ 0 ] . SendData ( PacketTypes . PlayerInfo , "" , players [ 0 ] . Index ) ;
765
+ TSPlayer . All . SendData ( PacketTypes . PlayerInfo , "" , players [ 0 ] . Index ) ;
753
766
players [ 0 ] . SendMessage ( GetString ( "您的粘性蠕虫增益开启状态:" ) + players [ 0 ] . TPlayer . usedGummyWorm , new Color ( 0 , 255 , 0 ) ) ;
754
767
break ;
755
768
case "ambrosia" :
756
769
players [ 0 ] . TPlayer . usedAmbrosia = num != 0 ;
757
- players [ 0 ] . SendData ( PacketTypes . PlayerInfo , "" , players [ 0 ] . Index ) ;
770
+ TSPlayer . All . SendData ( PacketTypes . PlayerInfo , "" , players [ 0 ] . Index ) ;
758
771
players [ 0 ] . SendMessage ( GetString ( "您的珍馐增益开启状态:" ) + players [ 0 ] . TPlayer . usedAmbrosia , new Color ( 0 , 255 , 0 ) ) ;
759
772
break ;
760
773
case "cart" :
761
774
players [ 0 ] . TPlayer . unlockedSuperCart = num != 0 ;
762
- players [ 0 ] . SendData ( PacketTypes . PlayerInfo , "" , players [ 0 ] . Index ) ;
775
+ TSPlayer . All . SendData ( PacketTypes . PlayerInfo , "" , players [ 0 ] . Index ) ;
763
776
players [ 0 ] . SendMessage ( GetString ( "您的超级矿车增益开启状态:" ) + players [ 0 ] . TPlayer . unlockedSuperCart , new Color ( 0 , 255 , 0 ) ) ;
764
777
break ;
765
778
case "all" :
@@ -776,7 +789,7 @@ private void SSCModify(CommandArgs args)
776
789
players [ 0 ] . TPlayer . usedGummyWorm = true ;
777
790
players [ 0 ] . TPlayer . usedAmbrosia = true ;
778
791
players [ 0 ] . TPlayer . unlockedSuperCart = true ;
779
- players [ 0 ] . SendData ( PacketTypes . PlayerInfo , "" , players [ 0 ] . Index ) ;
792
+ TSPlayer . All . SendData ( PacketTypes . PlayerInfo , "" , players [ 0 ] . Index ) ;
780
793
players [ 0 ] . SendMessage ( GetString ( "您的所有永久增益均开启" ) , new Color ( 0 , 255 , 0 ) ) ;
781
794
break ;
782
795
case 0 :
@@ -790,7 +803,7 @@ private void SSCModify(CommandArgs args)
790
803
players [ 0 ] . TPlayer . usedGummyWorm = false ;
791
804
players [ 0 ] . TPlayer . usedAmbrosia = false ;
792
805
players [ 0 ] . TPlayer . unlockedSuperCart = false ;
793
- players [ 0 ] . SendData ( PacketTypes . PlayerInfo , "" , players [ 0 ] . Index ) ;
806
+ TSPlayer . All . SendData ( PacketTypes . PlayerInfo , "" , players [ 0 ] . Index ) ;
794
807
players [ 0 ] . SendMessage ( GetString ( "您的所有永久增益均关闭" ) , new Color ( 0 , 255 , 0 ) ) ;
795
808
break ;
796
809
}
@@ -1177,7 +1190,7 @@ private void ZResetPlayer(CommandArgs args)
1177
1190
1178
1191
1179
1192
/// <summary>
1180
- /// 重置所有用户所有数据方法指令
1193
+ /// 重置所有用户所有数据方法指令
1181
1194
/// </summary>
1182
1195
/// <param name="args"></param>
1183
1196
private void ZResetPlayerAll ( CommandArgs args )
0 commit comments