public void Modify(GameObject entity, ZDO entityZdo) { var character = ComponentCache.Get <Character>(entity); if (character is null) { return; } string aiConfig = "{}"; if (!string.IsNullOrWhiteSpace(Config)) { aiConfig = Config; } try { MobManager.RegisterMob(character, Guid.NewGuid().ToString(), AiName, aiConfig); Log.LogTrace($"Set AI '{AiName}' for spawn '{entity.name}'."); } catch (Exception e) { Log.LogError($"Failure while attempting to set AI '{AiName}' for spawn '{entity.name}'", e); } }
public void Modify(GameObject entity, ZDO entityZdo) { if (MaxLevel <= 1) { return; } if (MinDistanceForLevelups > 0 && entityZdo.m_position.magnitude < MinDistanceForLevelups) { return; } int minLevel = Math.Max(1, MinLevel); int level = minLevel; for (; level < MaxLevel; ++level) { if (UnityEngine.Random.Range(0f, 100f) > LevelupChance) { break; } } if (minLevel > 1) { Character character = ComponentCache.Get <Character>(entity); if (character != null && character) { character.SetLevel(minLevel); } } }
public void Modify(GameObject entity, ZDO entityZdo) { if (entity is null) { return; } var character = ComponentCache.Get <Character>(entity); if (character is null) { return; } if (Faction is null) { return; } #if DEBUG Log.LogDebug($"Setting faction {Faction}"); #endif character.m_faction = Faction.Value; entityZdo?.SetFaction(Faction.Value); }
public void Modify(GameObject entity, ZDO entityZdo) { var character = ComponentCache.Get <Character>(entity); if (character != null) { API.LevelRand(character); } }
private void Fire() { if (timer > 0) { return; } timer = rechargeTime; var orange = cache.Get(); orange.Fire(transform.position + transform.up * startDistance, transform.up * fireStartSpeed); }
public void Modify(GameObject entity, ZDO entityZdo) { var character = ComponentCache.Get <Character>(entity); if (character is null) { return; } #if DEBUG Log.LogDebug($"Setting tamed"); #endif character.SetTamed(Tamed); }
public void Modify(GameObject entity, ZDO entityZdo) { if (ExtraEffect is null) { return; } var character = ComponentCache.Get <Character>(entity); if (character is null) { return; } Log.LogTrace($"Setting extra effect '{ExtraEffect}' for '{entity.name}'."); API.SetExtraEffectCreature(character, ExtraEffect.Value); }
public void Modify(GameObject entity, ZDO entityZdo) { if (Infusion is null) { return; } var character = ComponentCache.Get <Character>(entity); if (character is null) { return; } Log.LogTrace($"Setting infusion '{Infusion}' for '{entity.name}'."); API.SetInfusionCreature(character, Infusion.Value); }
private static bool FixSpawnCount(GameObject prefab, Vector3 center, float maxRange, ref int __result) { //Fish and birds all seem to have this tag assigned. It will be counted by the standard method. if (prefab.CompareTag("spawned")) { return(true); } BaseAI baseAI = ComponentCache.Get <BaseAI>(prefab); if (baseAI && baseAI is not null) { return(true); } __result = WorldSpawnSessionManager.CountEntitiesInArea(prefab, center, maxRange); return(true); }
private static bool FixSpawnsInRangeForNonAI(GameObject prefab, Vector3 centerPoint, float minDistance, ref bool __result) { //Fish and birds all seem to have this tag assigned. It will be counted by the standard method. if (prefab.CompareTag("spawned")) { return(true); } BaseAI baseAI = ComponentCache.Get <BaseAI>(prefab); if (baseAI && baseAI is not null) { return(true); } __result = WorldSpawnSessionManager.AnyInRange(prefab, centerPoint, (int)minDistance); return(false); }
public void Modify(GameObject entity, ZDO entityZdo) { var character = ComponentCache.Get <Character>(entity); if (character is null) { return; } var tameable = ComponentCache.Get <Tameable>(entity); if (tameable is not null && tameable) { #if DEBUG Log.LogDebug($"Setting tamed commandable"); #endif tameable.m_commandable = Commandable; entityZdo?.Set(ZdoFeatureHash, Commandable); } }
public void Modify(GameObject entity, ZDO entityZdo) { if (Affix is null) { return; } var character = ComponentCache.Get <Character>(entity); if (character is null) { return; } if (!character.IsBoss()) { return; } Log.LogTrace($"Setting boss affix '{Affix}' for '{entity.name}'."); API.SetAffixBoss(character, Affix.Value); }