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); } } } }
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"); } }
public ReSkill(skill _s, uint _oid) { objid = _oid; s = _s; }
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); } } }