Ejemplo n.º 1
0
        bool LearnMetalScan(ItemAsset.MetalScan metalScan, bool bLearn = true)
        {
            if (null == metalScan)
            {
                return(false);
            }

            if (Entity.Id != PeCreature.Instance.mainPlayerId)
            {
                return(false);
            }

            foreach (int metalId in metalScan.metalIds)
            {
                if (!MetalScanData.HasMetal(metalId))
                {
                    if (bLearn)
                    {
                        MetalScanData.AddMetalScan(metalScan.metalIds);
                    }
                    LearnEffectAndSound();
                    return(true);
                }
            }
            return(false);
        }
Ejemplo n.º 2
0
    void RPC_S2C_MetalScanList(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        int[] metalScan = stream.Read <int[]>();
        bool  openWnd   = stream.Read <bool>();

        MetalScanData.AddMetalScan(metalScan, openWnd);

        //if (null != PlayerFactory.mMainPlayer)
        //    PlayerFactory.mMainPlayer.ApplyMetalScan(metalScan.ToList());
    }
Ejemplo n.º 3
0
 public bool RefreshBuff(SkAliveEntity ske)
 {
     if (ske == null)
     {
         return(false);
     }
     foreach (List <string> iter in cmd)
     {
         if (iter != null)
         {
             if (iter.Count > 1)
             {
                 if (iter[0] == "buff")
                 {//"buff",buffid,atrtype,atrvalue,atrtype1,atrvalue1....
                     int          buffid   = Convert.ToInt32(iter[1]);
                     List <int>   atrtype  = new List <int>();
                     List <float> atrvalue = new List <float>();
                     for (int i = 2; i < iter.Count; i = i + 2)
                     {
                         atrtype.Add(Convert.ToInt32(iter[i]));
                         atrvalue.Add(Convert.ToSingle(iter[i + 1]));
                     }
                     if (atrtype.Count > 0 && atrvalue.Count > 0)
                     {
                         //remove old buff
                         SkEntity.UnmountBuff(ske, buffid);
                         //add buff
                         SkEntity.MountBuff(ske, buffid, atrtype, atrvalue);
                     }
                 }
                 else if (iter[0] == "scanradius")
                 {//"scanradius",Radius
                     int radius = Convert.ToInt32(iter[1]);
                     MSScan.Instance.radius = radius;
                 }
                 else if (iter[0] == "scanmat")
                 {//"scanmat",mat1,mat2...
                     for (int i = 1; i < iter.Count; i++)
                     {
                         MetalScanData.AddMetalScan(Convert.ToInt32(iter[i]));
                     }
                 }
             }
         }
     }
     return(true);
 }