private void OnTokenAdded(Object sender, EventArgs e) { TokenEventArgs tokenEventArgs = (TokenEventArgs)e; if (tokenEventArgs.TokenID == 699) { LegacyLogic.Instance.WorldManager.SaveCurrentMapData(); m_changeContext = EContext.End; LegacyLogic.Instance.WorldManager.SaveGameName = String.Empty; LegacyLogic.Instance.WorldManager.IsSaveGame = false; LegacyLogic.Instance.WorldManager.IsShowingEndingSequences = true; PlayCutsceneByID("Killed_Erebos"); } if (tokenEventArgs.TokenID == 329) { InteractiveObject interactiveObject = LegacyLogic.Instance.MapLoader.Grid.FindInteractiveObject <InteractiveObject>(123); if (interactiveObject != null) { interactiveObject.ClearInteractions(); interactiveObject.Execute(LegacyLogic.Instance.MapLoader.Grid); interactiveObject.Update(); } interactiveObject = LegacyLogic.Instance.MapLoader.Grid.FindInteractiveObject <InteractiveObject>(88); if (interactiveObject != null) { interactiveObject.ClearInteractions(); interactiveObject.Execute(LegacyLogic.Instance.MapLoader.Grid); interactiveObject.Update(); } } }
protected override void DoExecute() { InteractiveObject interactiveObject = Grid.FindInteractiveObject(m_targetSpawnID); if (interactiveObject == null) { throw new InvalidOperationException("Tried to execute!"); } interactiveObject.ClearInteractions(); interactiveObject.Execute(LegacyLogic.Instance.MapLoader.Grid); interactiveObject.Update(); FinishExecution(); }
public override void Trigger(ConversationManager p_manager) { InteractiveObject interactiveObject = LegacyLogic.Instance.WorldManager.FindObjectBySpawnerId <InteractiveObject>(TargetSpawnerID); if (interactiveObject != null) { interactiveObject.ClearInteractions(); interactiveObject.Execute(LegacyLogic.Instance.MapLoader.Grid); interactiveObject.Update(); } else { LegacyLogger.LogError("InteractiveObject spawnerID not found! ID: " + TargetSpawnerID); } }