Beispiel #1
0
 private void OnBaTiStateChange(GameClient client, bool active, BuffItemData buffItemData)
 {
     if (active)
     {
         if (buffItemData.buffVal >= 30L)
         {
             client.ClientData.DongJieStart   = 0L;
             client.ClientData.DongJieSeconds = 0;
             client.RoleBuffer.SetTempExtProp(47, 0.0, 0L);
             client.RoleBuffer.SetTempExtProp(2, 0.0, 0L);
             client.RoleBuffer.SetTempExtProp(18, 0.0, 0L);
             double moveCost = RoleAlgorithm.GetMoveSpeed(client);
             client.ClientData.MoveSpeed = moveCost;
             GameManager.ClientMgr.NotifyRoleStatusCmd(Global._TCPManager.MySocketListener, Global._TCPManager.TcpOutPacketPool, client, 12, TimeUtil.NOW(), (int)(buffItemData.endTicks - buffItemData.startTicks), moveCost);
         }
         if (buffItemData.buffVal >= 50L)
         {
             buffItemData.buffValEx = BuffManager.GetZSPLHXZAttackInjurePercent(Global.GetAll9ClientsNum(client) - 1);
         }
     }
     else
     {
         if (buffItemData.buffId >= 30)
         {
             double moveCost = RoleAlgorithm.GetMoveSpeed(client);
             client.ClientData.MoveSpeed = moveCost;
             GameManager.ClientMgr.NotifyRoleStatusCmd(Global._TCPManager.MySocketListener, Global._TCPManager.TcpOutPacketPool, client, 12, TimeUtil.NOW(), 0, moveCost);
         }
         if (buffItemData.buffVal >= 50L)
         {
             buffItemData.buffValEx = 0.0;
         }
     }
 }
Beispiel #2
0
        public void OnBuffStateChange(GameClient client, int bufferId, BuffItemData buffItemData)
        {
            if ((buffItemData.flags & 1073741824) != 0)
            {
                switch (bufferId)
                {
                case 113:
                    this.OnBaTiStateChange(client, buffItemData.enabled, buffItemData);
                    break;

                case 114:
                    if (buffItemData.enabled)
                    {
                        GameManager.ClientMgr.NotifyImportantMsg(client, GLang.GetLang(4, new object[0]), GameInfoTypeIndexes.Error, ShowGameInfoTypes.ErrAndBox, 0);
                        GameManager.ClientMgr.NotifyRoleStatusCmd(Global._TCPManager.MySocketListener, Global._TCPManager.TcpOutPacketPool, client, 13, buffItemData.startTicks, buffItemData.buffSecs, 1.0);
                    }
                    else
                    {
                        GameManager.ClientMgr.NotifyImportantMsg(client, GLang.GetLang(5, new object[0]), GameInfoTypeIndexes.Error, ShowGameInfoTypes.ErrAndBox, 0);
                        GameManager.ClientMgr.NotifyRoleStatusCmd(Global._TCPManager.MySocketListener, Global._TCPManager.TcpOutPacketPool, client, 13, 0L, 0, 1.0);
                    }
                    break;

                case 116:
                    if (!buffItemData.enabled)
                    {
                        HuiJiManager.getInstance().OnHuiJiStateChange(client, false, 0, 0, null);
                    }
                    break;

                case 120:
                    if (buffItemData.enabled)
                    {
                        client.ClientData.MinLife = (int)buffItemData.buffVal;
                    }
                    else
                    {
                        client.ClientData.MinLife = 0;
                    }
                    break;

                case 121:
                    if (!buffItemData.enabled)
                    {
                        BianShenManager.getInstance().OnBianShenStateChange(client, false, 0, 0, null);
                    }
                    break;
                }
            }
        }