public BattleSystem(IRole pRole) { m_pOwner = pRole; m_nDelay = m_nRawDelay = 800; m_tDelay = new TimeOutMS(m_nRawDelay); m_tAttack = new TimeOutMS(0); m_tFight = new TimeOutMS(0); }
public bool Delay() { if (m_tDelay == null) { m_tDelay = new TimeOutMS(0); SetDelay(); } return(m_tDelay.ToNextTime()); }
public DynamicNpc(DbDynamicNPC dbNpc) { m_dbNpc = dbNpc; m_pPacket = new MsgNpcInfoEx { Flag = dbNpc.Type, Identity = dbNpc.Id, Lookface = dbNpc.Lookface, Life = dbNpc.Life, MaxLife = dbNpc.Maxlife, MapX = dbNpc.Cellx, MapY = dbNpc.Celly, Type = dbNpc.Type }; try { m_sElevation = Map[MapX, MapY].Elevation; } catch { m_sElevation = 999; } if (OwnerType == _OWNER_USER && OwnerIdentity > 0) { Client temp = null; if (ServerKernel.Players.TryGetValue(OwnerIdentity, out temp)) { if (temp.Character != null) { m_pRole = temp.Character; m_pPacket.Name = temp.Character.Name; } } } if (OwnerType == _OWNER_SYN && OwnerIdentity > 0 && IsSynFlag()) { Syndicate temp = ServerKernel.Syndicates.Values.FirstOrDefault(x => x.Identity == OwnerIdentity); if (temp != null) { m_pPacket.Name = temp.Name; } } Scores = new ConcurrentDictionary <uint, SynScore>(); m_tDeathTime = new TimeOutMS(500); m_tDeathTime.Startup(500); }
public bool Create(IRole pRole, int nStatus, int nPower, int nSecs, int nTimes, uint caster = 0, byte level = 0) { m_pOwner = pRole; m_dwCaster = caster; m_nStatus = nStatus; m_nData = nPower; m_tKeep = new TimeOutMS(nSecs * 1000); m_tKeep.Startup((int)Math.Min(((long)nSecs * 1000), int.MaxValue)); m_tKeep.Update(); m_tInterval = new TimeOutMS(1000); m_tInterval.Update(); m_pLevel = level; return(true); }
public void SetDelay() { if (m_dbMagictype == null) { return; } if (m_tDelay == null) { m_tDelay = new TimeOutMS((int)Timeout); } m_tDelay.Startup((int)Timeout); m_tDelay.SetInterval((int)Timeout); m_tDelay.Update(); }