예제 #1
0
파일: Skills.cs 프로젝트: redviper/l2pvpbot
 public void populateskilllist(List<uint> skilllist)
 {
     sl.Items.Clear();
     string skillname;
     foreach (uint i in skilllist)
     {
         if (gs.skills.ContainsKey(i))
         {
             skillname = gs.skills[i];
             if (skillname != null)
             {
                 //found skill
                 skill s = new skill();
                 s.name = skillname;
                 s.id = i;
                 sl.Items.Add(s);
             }
         }
     }
 }
예제 #2
0
        private void launchMagic(skill s, uint objectid, int shift)
        {
            if (s.lastuse.AddMilliseconds(s.reuseDelay) > DateTime.Now)
            {
                return;
            }
            s.setstate(false);
            s.mre.Reset();
            useSkill(s.id, objectid, shift);
            s.mre.WaitOne(5000);
            s.mre.Reset();
            if (s.skillstate())
            {
                //wait for response
                System.Threading.Thread.Sleep((int)s.hitTime);
            }
            else
            {
                //System.Console.WriteLine("skill failed");

            }
        }
예제 #3
0
 public ReSkill(skill _s, uint _oid)
 {
     objid = _oid;
     s = _s;
 }
예제 #4
0
        private void launchBuff(skill s, uint objectid, int shift)
        {
            if (s.lastuse.AddMilliseconds(s.reuseDelay) > DateTime.Now)
            {
                ReSkill r = new ReSkill(s, objectid);
                lock (redolistlock)
                {
                    redolist.Enqueue(r);
                }

                return;
            }
            s.setstate(false);
            s.mre.Reset();
            useSkill(s.id, objectid, shift);
            s.mre.WaitOne(2000);
            s.mre.Reset();
            if (s.skillstate())
            {
                //wait for response
                s.lastuse = DateTime.Now;
                System.Threading.Thread.Sleep((int)s.hitTime);
            }
            else
            {
                //System.Console.WriteLine("skill failed");
                ReSkill r = new ReSkill(s, objectid);
                lock (redolistlock)
                {
                    redolist.Enqueue(r);
                }
            }
        }