/// <summary> /// Производит удаление всех коллекций прогноза /// </summary> public void Dispose() { // Создаем все коллекции ForecastDatas.Clear(); ForecastDatas = null; BaseComponents.Clear(); BaseComponents = null; BaseComponentDirectives.Clear(); BaseComponentDirectives = null; Components.Clear(); Components = null; ComponentDirectives.Clear(); ComponentDirectives = null; AdStatus.Clear(); AdStatus = null; Damages.Clear(); Damages = null; DefferedItems.Clear(); DefferedItems = null; EngineeringOrders.Clear(); EngineeringOrders = null; OutOfPhaseItems.Clear(); OutOfPhaseItems = null; ServiceBulletins.Clear(); ServiceBulletins = null; MaintenanceChecks.Clear(); MaintenanceChecks = null; Kits.Clear(); Kits = null; DirectiveCollections.Clear(); DirectiveCollections = null; }
public void Clearup() { //RunTimedFunction.RemoveTimer(BetterTimerTypes.MobKillTimer, MapID, SpawnID); OriginalPosition = null; Owner = null; Controller = null; Damages.Clear(); }
public void Clear() { IsUpdate = false; VoiceType = PlayerInformation.Info.PType; BehType = BehaviorType.None; Targets.Clear(); Damages.Clear(); Abnormals.Clear(); IsHit.Clear(); //IsDeath.Clear(); KillList.Clear(); Effects.Clear(); Sounds.Clear(); Voices.Clear(); Messages.Clear(); }
public void CheckDead(Pos killPos = null) { if (HP == 0 && !IsDead) { IsDead = true; if (killPos != null) { Position = killPos; } setControl(null, false, null); MobPacket.SendMobDeath(this, 1); Character maxDmgChar = null; ulong maxDmgAmount = 0; MobData md = DataProvider.Mobs[MobID]; DeadsInFiveMinutes++; foreach (KeyValuePair <int, ulong> dmg in Damages) { if (maxDmgAmount < dmg.Value && Server.Instance.CharacterList.ContainsKey(dmg.Key)) { Character chr = Server.Instance.CharacterList[dmg.Key]; if (chr.Map == MapID) { maxDmgAmount = dmg.Value; maxDmgChar = chr; } } } if (maxDmgChar != null) { if (Server.Instance.CharacterDatabase.isDonator(maxDmgChar.UserID) || Map.isPremium(maxDmgChar.Map)) { maxDmgChar.AddEXP((double)EXP * Server.Instance.mobExpRate * Map.MAP_PREMIUM_EXP); //Premium Maps, also known as Internet Cafe maps } else { maxDmgChar.AddEXP((uint)EXP * Server.Instance.mobExpRate); } DropPacket.HandleDrops(maxDmgChar, MapID, Constants.getDropName(MobID, true), SpawnID, Position, false, false, false); } foreach (int mobid in md.Revive) { DataProvider.Maps[MapID].spawnMobNoRespawn(mobid, killPos, Foothold); } Damages.Clear(); if (DoesRespawn) { Position = OriginalPosition; Foothold = OriginalFoothold; int derp = (int)(((((SpawnData == null ? 10 : SpawnData.RespawnTime + 1) / DataProvider.Maps[MapID].MobRate)) * DeadsInFiveMinutes) * 5); MasterThread.MasterThread.Instance.AddRepeatingAction(new MasterThread.MasterThread.RepeatingAction("Mob Remover", (date) => { InitAndSpawn(); }, (ulong)derp * 1000, 0)); } else { Clearup(); DataProvider.Maps[MapID].RemoveMob(this); } } }