private static void EnsureMapAndZone(ActorEntity entry) { if (Scanner.Instance.Locations.ContainsKey("MAPINFO")) { try { entry.MapTerritory = (uint)MemoryHandler.Instance.GetPlatformUInt(Scanner.Instance.Locations["MAPINFO"]); entry.MapID = (uint)MemoryHandler.Instance.GetPlatformUInt(Scanner.Instance.Locations["MAPINFO"], 8); } catch (Exception ex) { MemoryHandler.Instance.RaiseException(Logger, ex, true); } } if (Scanner.Instance.Locations.ContainsKey("ZONEINFO")) { try { entry.MapIndex = (uint)MemoryHandler.Instance.GetPlatformUInt(Scanner.Instance.Locations["ZONEINFO"], 8); // current map is 0 if the map the actor is in does not have more than 1 layer. // if the map has more than 1 layer, overwrite the map id. var currentActiveMapID = (uint)MemoryHandler.Instance.GetPlatformUInt(Scanner.Instance.Locations["ZONEINFO"]); if (currentActiveMapID > 0) { entry.MapID = currentActiveMapID; } } catch (Exception ex) { MemoryHandler.Instance.RaiseException(Logger, ex, true); } } }
public void onAgroRemoved(ActorEntity mob) { // PartyList seems to be broken currently in FFXIV-APP, so disabling this until it's fixed return; if (mob.Name.Contains("The Ghost Of Meracydia")) { bool found = false; foreach (PartyEntity player in partyList) { try { debug("player: " + player.Name); foreach (StatusEntry status in player.StatusEntries) { try { debug("player: " + player.Name + " - " + status.StatusName); if (status.StatusName.Contains("Garrote Twist")) { found = true; tts(player.Name); } } catch { } } } catch { } } if (found) { tts("to white circles"); } } }
public void onMobAdded(ActorEntity mob) { if (mob.Name.Contains("Renaud")) { renaudCount++; lastRenaud = DateTime.Now; tts("Renaud"); } if (mob.Name.Contains("Lamia Prosector")) { tts("Add"); } if (mob.Name.Contains("Lamia Deathdancer")) { tts("Add"); } if (DateTime.Now < (lastAddedNewMob + TimeSpan.FromSeconds(5))) { return; } if (mob.Name.Contains("Lamia Fatedealer")) { tts("Adds"); lastAddedNewMob = DateTime.Now; } }
public void onMobRemoved(ActorEntity mob) { if (mob.Name.Contains("Renaud")) { renaudCount--; } }
public void onMobAdded(ActorEntity mob) { if (mob.Name.Contains("The Ghost Of Meracydia")) { tts("Add"); } }
public void onMobAdded(ActorEntity mob) { if (mob.Name.Contains("Weapons")) { setPhase(3); } }
public static void AddNPCEntity(ActorEntity entity) { lock (_npcEntities) { _npcEntities.Add(entity); } }
public static void AddUniqueNPCEntity(ActorEntity entity) { lock (_uniqueNPCEntities) { _uniqueNPCEntities.Add(entity); } }
public void Update(ActorEntity actor) { var a = GetById(actor.Id); if (a != null) { a.Likes = actor.Likes; //Only updates likes for the moment } }
public void TestModeStart() { if (TestMode) { TestModeStop(); } LogHelper.Log(Logger, "Test Mode Started", LogLevel.Trace); Widgets.Instance.ShowTwintaniaWidget(); ForceTop = true; TestMode = true; TwintaniaEntity = new ActorEntity { Name = "Twintania", HPMax = 514596, HPCurrent = 514596 }; TwintaniaEngaged = true; TwintaniaIsValid = true; TwintaniaHPPercent = 1; EnrageTimerStart(); TwintaniaDivebombCount = 1; TwintaniaDivebombTimeToNextCur = 0; TwintaniaDivebombTimeToNextMax = 0; DreadknightEntity = new ActorEntity { Name = "Dreadknight", HPMax = 11250, HPCurrent = 11250 }; DreadknightIsValid = true; DreadknightHPPercent = 1; TwintaniaTestTimeToNextCur = 0.3; TwintaniaTestList.Enqueue(Tuple.Create("Divebomb", Settings.Default.TwintaniaWidgetDivebombTimeFast + 0.5)); TwintaniaTestList.Enqueue(Tuple.Create("Divebomb", Settings.Default.TwintaniaWidgetDivebombTimeFast + 0.5)); TwintaniaTestList.Enqueue(Tuple.Create("Divebomb", Settings.Default.TwintaniaWidgetDivebombTimeSlow + 0.5)); TwintaniaTestList.Enqueue(Tuple.Create("Divebomb", Settings.Default.TwintaniaWidgetDivebombTimeFast + 0.5)); TwintaniaTestList.Enqueue(Tuple.Create("Divebomb", Settings.Default.TwintaniaWidgetDivebombTimeFast + 0.5)); TwintaniaTestList.Enqueue(Tuple.Create("Twister", 1.0)); TwintaniaTestList.Enqueue(Tuple.Create("End", (double)0)); TwintaniaTestTimer.Start(); }
public void onMobAdded(ActorEntity mob) { if (mob.Name.Contains("Dark Matter Bulb")) { if (mob.Coordinate.DistanceTo(bossEntity.Coordinate) <= 7) { tts("Bulb under boss"); } } }
public void onMobAgro(ActorEntity mob) { if (mob.HPMax > bossHealth && !EncounterController.ignoreMobs.Contains(mob.Name)) { bossName = mob.Name; bossHealth = mob.HPMax; } allEnemies[mob.Name] = mob; }
public void AddNewActor() { var myNewActor = new ActorEntity { Id = new Guid("591C6ACC-191B-4539-A4B9-42C5C280E4B5"), Age = 55, FirstName = "Jožko", SecondName = "Podržho", PhotoFilePath = @":C\Windows\fotka.jpg", WikiUrl = @"www.wikipedia.com/jozkoPodrzho", ActedMovies = { new FilmActorEntity() { Film = new FilmEntity { OriginalName = "Iron Man", CzechName = "Zelezny muz", CountryOfOrigin = "Canada", GenreOfFilm = Genre.ActionFilm, Description = "Film o zeleznem muzi", ImageFilePath = @":C\Windows\filmFotka.jpg", LengthInMinutes = new TimeSpan(1, 30, 0) } }, new FilmActorEntity() { Film = new FilmEntity { OriginalName = "Spiderman", CzechName = "Pavouci muz", CountryOfOrigin = "Canada", GenreOfFilm = Genre.ActionFilm, Description = "Film o pavoucim muzi", ImageFilePath = @":C\Windows\filmFotkaSpider.jpg", LengthInMinutes = new TimeSpan(1, 30, 0) } } } }; appDbContextTestUnit.Actors.Add(myNewActor); appDbContextTestUnit.SaveChanges(); using (var tempDbContext = dbContextFactory.CreateDbContext()) { var retrievedActor = tempDbContext.Actors .Include(entity => entity.ActedMovies) .ThenInclude(connectionTable => connectionTable.Film) .Single(entity => entity.Id == myNewActor.Id); Assert.Equal(myNewActor, retrievedActor, ActorEntity.ActorEntityComparer); } }
private IEnumerable <FilmActorListModel> MapActors(ActorEntity actorEntity) { return(actorEntity?.ActedMovies.Select(filmEntity => new FilmActorListModel() { Id = filmEntity.Id, FilmId = filmEntity.FilmId, ActorId = filmEntity.ActorId, ActorName = string.Concat(filmEntity.Actor.FirstName, " ", filmEntity.Actor.SecondName), FilmName = filmEntity.Film.OriginalName }).ToArray()); }
public void onMobAdded(ActorEntity mob) { if (phase < 3 && mob.Name.Contains("Bennu")) { Bennu.start(); //bennuCount++; //tts("Add " + bennuCount); } }
void ShowPlayerInfo(ActorEntity entity, Transform textScore, Transform textLife) { if (entity == null) { return; } var score = entity.score.value; var life = entity.life.value; ShowText(textLife, life.ToString()); ShowText(textScore, score.ToString()); }
/// <summary> /// Factory method to create an agent /// Call the Initialize method /// </summary> /// <returns></returns> public static PersonAgent CreateInstance(SymuEnvironment environment, CognitiveArchitectureTemplate template) { if (environment == null) { throw new ArgumentNullException(nameof(environment)); } var entity = new ActorEntity(environment.MainOrganization.ArtifactNetwork); var agent = new PersonAgent(entity.EntityId, environment, template); agent.Initialize(); return(agent); }
public ActorDto(ActorEntity actorEntity) { Id = actorEntity.CorrelationId; Name = actorEntity.Name; if (actorEntity.Birthday.HasValue) { Birthday = actorEntity.Birthday.Value.ToString("yyyy-MM-dd"); } else { Birthday = null; } }
public override void AddEntity(Entity entity) { if (entity.GetType() == typeof(ActorEntity)) { _actorEntity = (ActorEntity)entity; } if (entity.Components.ContainsKey(typeof(AiComponent)) //|| entity.Components.ContainsKey(typeof(SeekerAiComponent)) || entity.Components.ContainsKey(typeof(IAiComponent))) { _systemEntities.Add(entity); } }
public void onMobAdded(ActorEntity mob) { if (DateTime.Now < (lastAddedNewMob + TimeSpan.FromSeconds(5))) { return; } if (mob.Name.Contains("Meracydia")) { //tts("Add"); lastAddedNewMob = DateTime.Now; } }
void OnTriggerBoom(ActorEntity actor, GameEntity player, IGroup <GameEntity> _allEnemy) { foreach (var tank in _allEnemy.GetEntities()) { if (tank.isDestroyed || tank.unit.health == 0) { continue; } tank.unit.killerLocalId = player.entityId.value; tank.unit.health = 0; tank.isDestroyed = true; } }
private decimal ResolveHeightVarianceDecimal(ActorEntity user, ActorEntity actorEntity) { double variance = 0; if (user.Z < actorEntity.Z) { variance = user.Z - actorEntity.Z; } if (user.Z > actorEntity.Z) { variance = actorEntity.Z - user.Z; } return((decimal)variance); }
private string ResolveHeightVariance(ActorEntity user, ActorEntity actorEntity) { var modifier = ""; if (user.Z < actorEntity.Z) { modifier = "+"; } if (user.Z > actorEntity.Z) { modifier = "-"; } return(String.Format("{0}{1:N2}", modifier, Math.Abs(ResolveHeightVarianceDecimal(user, actorEntity)))); }
public bool bossCheck(ActorEntity mob) { _inController = true; if (mob.Name.Trim() == bossName.Trim()) { bossEntity = mob; _inController = false; return(true); } _inController = false; return(false); }
static void insertToDB(List <Show> shows) { var optionsBuilder = new DbContextOptionsBuilder <RtlDbContext>(); optionsBuilder.UseSqlServer(Resources.DefaultConnection); var dbContext = new RtlDbContext(optionsBuilder.Options); dbContext.Database.EnsureCreated(); var dbShows = new List <ShowEntity>(); foreach (var show in shows) { var showEntity = new ShowEntity(); showEntity.Name = show.Name; showEntity.CorrelationId = show.Id; showEntity.Actors = new List <ActorEntity>(); List <Actor> actors = readPersonFile(show.Id); foreach (var actor in actors) { ActorEntity actorEntity = new ActorEntity(); actorEntity.Name = actor.Person.Name; actorEntity.CorrelationId = actor.Person.Id; if (actor.Person.Birthday.HasValue) { actorEntity.Birthday = actor.Person.Birthday.Value.Date; } showEntity.Actors.Add(actorEntity); } dbShows.Add(showEntity); } dbContext.Shows.AddRange(dbShows); dbContext.SaveChanges(); }
public void onAgroRemoved(ActorEntity mob) { }
public void onMobAgro(ActorEntity mob) { }
public void onMobRemoved(ActorEntity mob) { }
public static ActorEntity ResolveActorFromBytes(byte[] source, bool isCurrentUser = false) { var entry = new ActorEntity(); try { entry.MapIndex = 0; entry.TargetID = 0; entry.Name = MemoryHandler.Instance.GetStringFromBytes(source, 48); entry.ID = BitConverter.ToUInt32(source, 0x74); entry.NPCID1 = BitConverter.ToUInt32(source, 0x78); entry.NPCID2 = BitConverter.ToUInt32(source, 0x80); entry.OwnerID = BitConverter.ToUInt32(source, 0x84); entry.Type = (Actor.Type)source[0x8A]; entry.TargetType = (Actor.TargetType)source[0x8C]; entry.Distance = source[0x8E]; entry.GatheringStatus = source[0x8F]; entry.X = BitConverter.ToSingle(source, 0xA0); entry.Z = BitConverter.ToSingle(source, 0xA4); entry.Y = BitConverter.ToSingle(source, 0xA8); entry.Heading = BitConverter.ToSingle(source, 0xB0); entry.Fate = BitConverter.ToUInt32(source, 0xE4); // ?? entry.GatheringInvisible = source[0x11C]; // ?? entry.ModelID = BitConverter.ToUInt32(source, 0x174); entry.ActionStatus = (Actor.ActionStatus)source[0x17C]; entry.IsGM = BitConverter.ToBoolean(source, 0x183); // ? entry.Icon = (Actor.Icon)source[0x18C]; entry.Status = (Actor.Status)source[0x17E]; //0x18E]; entry.ClaimedByID = BitConverter.ToUInt32(source, 0x180); // 0x1A0); var targetID = BitConverter.ToUInt32(source, 0x188); // 0x1A8); var pcTargetID = BitConverter.ToUInt32(source, 0x938); // 0xAA8); entry.Job = (Actor.Job)source[0x1540]; // 0x17C0]; entry.Level = source[0x1541]; // 0x17C1]; entry.GrandCompany = source[0x1543]; // 0x17C3]; entry.GrandCompanyRank = source[0x1544]; //0x17C4]; entry.Title = source[0x1546]; //0x17C6]; entry.HPCurrent = BitConverter.ToInt32(source, 0x1548); // 0x17C8); entry.HPMax = BitConverter.ToInt32(source, 0x154C); // 0x17CC); entry.MPCurrent = BitConverter.ToInt32(source, 0x1550); // 0x17D0); entry.MPMax = BitConverter.ToInt32(source, 0x1554); // 0x17D4); entry.TPCurrent = BitConverter.ToInt16(source, 0x1558); // 0x17D8); entry.TPMax = 1000; entry.GPCurrent = BitConverter.ToInt16(source, 0x155A); // 0x17DA); entry.GPMax = BitConverter.ToInt16(source, 0x155C); // 0x17DC); entry.CPCurrent = BitConverter.ToInt16(source, 0x155E); // 0x17DE); entry.CPMax = BitConverter.ToInt16(source, 0x1560); // 0x17E0); entry.Race = source[0x2808]; // ?? entry.Sex = (Actor.Sex)source[0x2809]; //? entry.IsCasting = BitConverter.ToBoolean(source, 0x2A30); // 0x2C90); entry.CastingID = BitConverter.ToInt16(source, 0x2A34); // 0x2C94); entry.CastingTargetID = BitConverter.ToUInt32(source, 0x2A40); // 0x2CA0); entry.CastingProgress = BitConverter.ToSingle(source, 0x2A64); // 0x2CC4); entry.CastingTime = BitConverter.ToSingle(source, 0x2A68); // 0x2DA8); entry.Coordinate = new Coordinate(entry.X, entry.Z, entry.Y); if (targetID > 0) { entry.TargetID = (int)targetID; } else { if (pcTargetID > 0) { entry.TargetID = (int)pcTargetID; } } if (entry.CastingTargetID == 3758096384) { entry.CastingTargetID = 0; } entry.MapIndex = 0; var limit = 60; switch (entry.Type) { case Actor.Type.PC: limit = 30; break; } entry.StatusEntries = new List <StatusEntry>(); const int statusSize = 12; var statusesSource = new byte[limit * statusSize]; Buffer.BlockCopy(source, 0x28B8, statusesSource, 0, limit * 12); for (var i = 0; i < limit; i++) { var statusSource = new byte[statusSize]; Buffer.BlockCopy(statusesSource, i * statusSize, statusSource, 0, statusSize); var statusEntry = new StatusEntry { TargetName = entry.Name, StatusID = BitConverter.ToInt16(statusSource, 0x0), Duration = BitConverter.ToSingle(statusSource, 0x4), CasterID = BitConverter.ToUInt32(statusSource, 0x8) }; try { var statusInfo = StatusEffectHelper.StatusInfo(statusEntry.StatusID); statusEntry.IsCompanyAction = statusInfo.CompanyAction; var statusKey = ""; switch (Settings.Default.GameLanguage) { case "English": statusKey = statusInfo.Name.English; break; case "French": statusKey = statusInfo.Name.French; break; case "German": statusKey = statusInfo.Name.German; break; case "Japanese": statusKey = statusInfo.Name.Japanese; break; } statusEntry.StatusName = statusKey; } catch (Exception ex) { statusEntry.StatusName = "UNKNOWN"; } if (statusEntry.IsValid()) { entry.StatusEntries.Add(statusEntry); } } } catch (Exception ex) { } CleanXPValue(ref entry); if (isCurrentUser) { PCWorkerDelegate.CurrentUser = entry; } entry.CurrentUser = PCWorkerDelegate.CurrentUser; return(entry); }
private static void CleanXPValue(ref ActorEntity entity) { if (entity.HPCurrent < 0 || entity.HPMax < 0) { entity.HPCurrent = 1; entity.HPMax = 1; } if (entity.HPCurrent > entity.HPMax) { if (entity.HPMax == 0) { entity.HPCurrent = 1; entity.HPMax = 1; } else { entity.HPCurrent = entity.HPMax; } } if (entity.MPCurrent < 0 || entity.MPMax < 0) { entity.MPCurrent = 1; entity.MPMax = 1; } if (entity.MPCurrent > entity.MPMax) { if (entity.MPMax == 0) { entity.MPCurrent = 1; entity.MPMax = 1; } else { entity.MPCurrent = entity.MPMax; } } if (entity.GPCurrent < 0 || entity.GPMax < 0) { entity.GPCurrent = 1; entity.GPMax = 1; } if (entity.GPCurrent > entity.GPMax) { if (entity.GPMax == 0) { entity.GPCurrent = 1; entity.GPMax = 1; } else { entity.GPCurrent = entity.GPMax; } } if (entity.CPCurrent < 0 || entity.CPMax < 0) { entity.CPCurrent = 1; entity.CPMax = 1; } if (entity.CPCurrent > entity.CPMax) { if (entity.CPMax == 0) { entity.CPCurrent = 1; entity.CPMax = 1; } else { entity.CPCurrent = entity.CPMax; } } }