public QuestCounterParams(QuestId questId, int maximum = 1, int counterId = 0, QuestPeriod?periodOverride = null) { QuestId = questId; Maximum = maximum; CounterId = counterId; this.periodOverride = periodOverride; }
private Dictionary <string, string> BuildReplacementArguments() { var replacementArguments = new Dictionary <string, string>(); if (QuestId > 0) { replacementArguments.Add("QuestId", QuestId.ToString()); } if (QuestRequirementComplete != QuestCompleteRequirement.NotComplete) { replacementArguments.Add("QuestCompleteRequirement", QuestRequirementComplete.ToString()); } if (QuestRequirementInLog != QuestInLogRequirement.InLog) { replacementArguments.Add("QuestCompleteRequirement", QuestRequirementInLog.ToString()); } if (MobId > 0) { replacementArguments.Add("MobId", MobId.ToString()); } if (FactionId > 0) { replacementArguments.Add("FactionId", FactionId.ToString()); } if (IsMoveToMob) { replacementArguments.Add("MovementBy", "ClickToMoveOnly"); } return(replacementArguments); }
public void StartQuest(QuestId questId) { var quest = Quests.Find(x => x.Description.QuestId == questId); if (quest != null && quest.Status == QuestStatus.Available) { quest.Status = QuestStatus.Ongoing; quest.RefreshStatus(); } }
public void RequestStartQuest(string playerName, QuestId questId) { try { var player = gameStateService.PlayerCollection.FindByPlayerName(playerName); player.StartQuest(questId); } catch (Exception e) { logService.Log(e); } }
public QuestData CreateNewQuest(QuestId id) { if (!storage.ContainsKey(id)) { return(null); } QuestData data = new QuestData(storage[id]); return(data); }
void RaiseEventIfCompletedNow(QuestId id) { var quest = questLookup_[id]; bool wasComplete = IsCompleted(id); if (!wasComplete && quest.CheckCurrentCompletionState(this)) { CompleteQuest(id); GameEvents.RaiseQuestCompletedEvent(quest); } }
object BuildPayload(Game game, QuestId questId) { if (game == null) { return(null); } return(new { IsCompleted = game.Quests.QuestCompleted(game.Difficulty, questId) }); }
public bool RequestCollectQuest(string playerName, QuestId questId) { try { var player = gameStateService.PlayerCollection.FindByPlayerName(playerName); var result = player.CollectQuest(questId); hubService.PlayerDataSync(player); return(result); } catch (Exception e) { logService.Log(e); return(false); } }
public void ActivateQuest(QuestId id) { QuestGiverScript.Instance.Close(); activatedQuest_ = id; var pos = QuestPortal.transform.position; mapAccess_.TriggerExplosion(QuestPortal.transform.position, 2.9f); var portalCenter = pos + Vector3.up * 1.5f; ParticleScript.EmitAtPosition(ParticleScript.Instance.PlayerLandParticles, portalCenter, 25); ParticleScript.EmitAtPosition(ParticleScript.Instance.MuzzleFlashParticles, portalCenter, 1); ParticleScript.EmitAtPosition(ParticleScript.Instance.WallDestructionParticles, portalCenter, 10); QuestPortal.SetActive(true); }
private void ReloadLoopTick() { // if this is the first time reloading this quest and step, set reload loops to zero string thisQuestId = QuestId.ToString() + "_" + StepId.ToString(); if (thisQuestId != _lastReloadLoopQuestStep) { _questStepReloadLoops = 0; } // increment ReloadLoops _questStepReloadLoops++; // record this quest Id and step Id _lastReloadLoopQuestStep = thisQuestId; }
/// <summary> /// Create a named autosplit for the specified quest and difficulty. /// </summary> /// <param name="questId">The quest.</param> /// <param name="difficulty">Difficulty for quest.</param> /// <returns>An autosplit for a specific quest.</returns> AutoSplit CreateForQuest(QuestId questId, GameDifficulty difficulty) { var quest = QuestFactory.Create(questId, 0); var name = quest != null ? quest.CommonName : "Quest"; // Add difficulty to name if above normal. if (difficulty == GameDifficulty.Nightmare) { name += " (NM)"; } if (difficulty == GameDifficulty.Hell) { name += " (H)"; } return(new AutoSplit(name, AutoSplit.SplitType.Quest, (short)questId, (short)difficulty)); }
public override int GetHashCode() { int hash = 1; if (QuestId.Length != 0) { hash ^= QuestId.GetHashCode(); } if (SubQuestId.Length != 0) { hash ^= SubQuestId.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public bool CollectQuest(QuestId questId) { var quest = Quests.Find(x => x.Description.QuestId == questId); if (quest != null && quest.Status == QuestStatus.Completed) { var description = quest.Description; // Money Money = description.MoneyReward; // Character types foreach (var characterType in description.CharacterTypeRewards) { if (!AvailableCharacters.Contains(characterType)) { AvailableCharacters.Add(characterType); } } // Spirit Relics foreach (var relic in description.SpiritRelicIdsReward) { SpiritRelicIds.Add(relic); } // Physicas Relics foreach (var relic in description.PhysicalRelicIdsReward) { PhysicalRelicsIds.Add(relic); } quest.Status = QuestStatus.Collected; return(true); } return(false); }
public override int GetHashCode() { int hash = 1; if (QuestId.Length != 0) { hash ^= QuestId.GetHashCode(); } if (Pokemon != 0) { hash ^= Pokemon.GetHashCode(); } if (EncounterType != 0) { hash ^= EncounterType.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
private Dictionary <string, string> BuildReplacementArguments() { var replacementArguments = new Dictionary <string, string>(); if (QuestId > 0) { replacementArguments.Add("QuestId", QuestId.ToString()); } if (QuestRequirementComplete != QuestCompleteRequirement.NotComplete) { replacementArguments.Add("QuestCompleteRequirement", QuestRequirementComplete.ToString()); } if (QuestRequirementInLog != QuestInLogRequirement.InLog) { replacementArguments.Add("QuestCompleteRequirement", QuestRequirementInLog.ToString()); } if (ObjectId > 0) { replacementArguments.Add("MobId", ObjectId.ToString()); } return(replacementArguments); }
public override int GetHashCode() { int hash = 1; if (QuestId.Length != 0) { hash ^= QuestId.GetHashCode(); } hash ^= dialog_.GetHashCode(); if (Description.Length != 0) { hash ^= Description.GetHashCode(); } if (Title.Length != 0) { hash ^= Title.GetHashCode(); } if (Slot != 0) { hash ^= Slot.GetHashCode(); } hash ^= subdisplay_.GetHashCode(); if (StoryEndingQuest != false) { hash ^= StoryEndingQuest.GetHashCode(); } if (StoryEndingDescription.Length != 0) { hash ^= StoryEndingDescription.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public bool IsCompleted(QuestId id) => CompletedQuests.Contains(id);
public void CollectQuest(QuestId id) => CollectedQuests.Add(id);
protected bool Equals(MembersJoined other) { return(QuestId.Equals(other.QuestId) && Day == other.Day && Location == other.Location && Members.SequenceEqual(other.Members)); }
public static Quest Create(QuestId id, ushort completionBits) => Quests.TryGetValue(id, out var details) ? new Quest(details, completionBits) : null;
public QuestTest() { QuestId.Add(5545); // Add quest id }
public override int GetHashCode() { int hash = 1; if (QuestType != 0) { hash ^= QuestType.GetHashCode(); } if (dailyQuest_ != null) { hash ^= DailyQuest.GetHashCode(); } if (multiPart_ != null) { hash ^= MultiPart.GetHashCode(); } if (catchPokemon_ != null) { hash ^= CatchPokemon.GetHashCode(); } if (addFriend_ != null) { hash ^= AddFriend.GetHashCode(); } if (tradePokemon_ != null) { hash ^= TradePokemon.GetHashCode(); } if (QuestId.Length != 0) { hash ^= QuestId.GetHashCode(); } if (QuestSeed != 0L) { hash ^= QuestSeed.GetHashCode(); } if (QuestContext != 0) { hash ^= QuestContext.GetHashCode(); } if (TemplateId.Length != 0) { hash ^= TemplateId.GetHashCode(); } if (Progress != 0) { hash ^= Progress.GetHashCode(); } if (goal_ != null) { hash ^= Goal.GetHashCode(); } if (Status != 0) { hash ^= Status.GetHashCode(); } hash ^= questRewards_.GetHashCode(); if (CreationTimestampMs != 0L) { hash ^= CreationTimestampMs.GetHashCode(); } if (LastUpdateTimestampMs != 0L) { hash ^= LastUpdateTimestampMs.GetHashCode(); } if (CompeletionTimestampMs != 0L) { hash ^= CompeletionTimestampMs.GetHashCode(); } if (FortId.Length != 0) { hash ^= FortId.GetHashCode(); } if (AdminGenerated != false) { hash ^= AdminGenerated.GetHashCode(); } if (StampCountOverrideEnabled != false) { hash ^= StampCountOverrideEnabled.GetHashCode(); } if (StampCountOverride != 0) { hash ^= StampCountOverride.GetHashCode(); } if (S2CellId != 0L) { hash ^= S2CellId.GetHashCode(); } if (StoryQuestTemplateVersion != 0) { hash ^= StoryQuestTemplateVersion.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public bool QuestCompleted(GameDifficulty difficulty, QuestId id) { var c = ByDifficulty(difficulty); return(c != null && c.First(quest => quest.Id == id).IsCompleted); }
public void CompleteQuest(QuestId id) => CompletedQuests.Add(id);
private string QuestName(QuestId questId) { var quest = QuestFactory.Create(questId, 0); return((quest.IsBossQuest ? "" : $"Act {quest.Act} - ") + quest.CommonName); }
public async Task RequestCollectQuest(string playerName, QuestId questId) { await hubProxy.Invoke(NetworkConstants.Request_CollectQuest, playerName, questId); }
public override int GetHashCode() { int hash = 1; if (QuestId != 0UL) { hash ^= QuestId.GetHashCode(); } if (QuestTitle.Length != 0) { hash ^= QuestTitle.GetHashCode(); } if (QuestId2 != 0UL) { hash ^= QuestId2.GetHashCode(); } if (U4 != 0L) { hash ^= U4.GetHashCode(); } if (U05 != 0UL) { hash ^= U05.GetHashCode(); } if (U06 != 0UL) { hash ^= U06.GetHashCode(); } if (QuestId3 != 0UL) { hash ^= QuestId3.GetHashCode(); } if (U08 != 0UL) { hash ^= U08.GetHashCode(); } if (U09 != 0UL) { hash ^= U09.GetHashCode(); } if (U10.Length != 0) { hash ^= U10.GetHashCode(); } if (U11 != 0UL) { hash ^= U11.GetHashCode(); } if (U12 != 0UL) { hash ^= U12.GetHashCode(); } if (U13 != 0UL) { hash ^= U13.GetHashCode(); } if (U14.Length != 0) { hash ^= U14.GetHashCode(); } if (U15 != 0UL) { hash ^= U15.GetHashCode(); } if (U16 != 0UL) { hash ^= U16.GetHashCode(); } if (U17 != 0UL) { hash ^= U17.GetHashCode(); } if (U18 != 0UL) { hash ^= U18.GetHashCode(); } if (U19 != 0UL) { hash ^= U19.GetHashCode(); } if (U20 != 0UL) { hash ^= U20.GetHashCode(); } if (U21 != 0UL) { hash ^= U21.GetHashCode(); } if (U22 != 0UL) { hash ^= U22.GetHashCode(); } if (QuestId4 != 0UL) { hash ^= QuestId4.GetHashCode(); } if (U24 != 0UL) { hash ^= U24.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public bool IsQuestCompleted(QuestId questId) => quests.First(quest => quest.Id == questId).IsAutoSplitReached;
protected bool Equals(MonsterSlayed other) { return(QuestId.Equals(other.QuestId) && Name == other.Name); }
public bool IsCollected(QuestId id) => CollectedQuests.Contains(id);