/// <summary> /// Refreshes the town run variables based on current act /// </summary> internal static RunStatus ActionsEvaluatedBehavior(object ret) { Navigator.Clear(); Navigator.SearchGridProvider.Update(); MovedToSafetyLocation = false; if (FunkyGame.AdventureMode) { CurrentAct = GameCache.FindActByTownLevelAreaID(ZetaDia.CurrentLevelAreaId); } else { CurrentAct = ZetaDia.CurrentAct; } switch (CurrentAct) { case Act.A1: VendorName = "a1_uniquevendor_miner"; break; case Act.A2: VendorName = "a2_uniquevendor_peddler"; break; case Act.A3: VendorName = "a3_uniquevendor_collector"; break; case Act.A4: VendorName = "a4_uniquevendor_collector"; break; case Act.A5: VendorName = "x1_a5_uniquevendor_collector"; break; } RequiresRepair = Equipment.ShouldRepairItems(CharacterSettings.Instance.RepairWhenDurabilityBelow); SafetyVendorLocation = GameCache.ReturnTownRunMovementVector(GameCache.TownRunBehavior.Sell, CurrentAct); SafetySalvageLocation = GameCache.ReturnTownRunMovementVector(GameCache.TownRunBehavior.Salvage, CurrentAct); SafetyStashLocation = GameCache.ReturnTownRunMovementVector(GameCache.TownRunBehavior.Stash, CurrentAct); SafetyIdenifyLocation = GameCache.ReturnTownRunMovementVector(GameCache.TownRunBehavior.Idenify, CurrentAct); SafetyGambleLocation = GameCache.ReturnTownRunMovementVector(GameCache.TownRunBehavior.Gamble, CurrentAct); //Clear our item cache Backpack.ClearBackpackItemCache(); bSalvageAllMagic = false; bSalvageAllNormal = false; bSalvageAllRare = false; FunkyGame.Bounty.RefreshActiveQuests(); FunkyTownRunPlugin.DBLog.DebugFormat("Current Act: {0} VendorName: {1} Requires Repair: {2}", CurrentAct, VendorName, RequiresRepair); ActionsChecked = true; return(RunStatus.Success); }
private void InitalizeTownVariables() { Act CurrentAct = Act.Invalid; if (FunkyGame.AdventureMode) { CurrentAct = GameCache.FindActByTownLevelAreaID(ZetaDia.CurrentLevelAreaId); } else { CurrentAct = ZetaDia.CurrentAct; } switch (TownObject) { case TownObjects.Stash: MovementVector = GameCache.ReturnTownRunMovementVector(GameCache.TownRunBehavior.Stash, CurrentAct); ObjectSNO = GameCache.ReturnTownRunObjectSNO(GameCache.TownRunBehavior.Stash, CurrentAct); break; case TownObjects.Sell: MovementVector = GameCache.ReturnTownRunMovementVector(GameCache.TownRunBehavior.Sell, CurrentAct); ObjectSNO = GameCache.ReturnTownRunObjectSNO(GameCache.TownRunBehavior.Sell, CurrentAct); break; case TownObjects.Salvage: MovementVector = GameCache.ReturnTownRunMovementVector(GameCache.TownRunBehavior.Salvage, CurrentAct); ObjectSNO = GameCache.ReturnTownRunObjectSNO(GameCache.TownRunBehavior.Salvage, CurrentAct); break; case TownObjects.Gamble: MovementVector = GameCache.ReturnTownRunMovementVector(GameCache.TownRunBehavior.Gamble, CurrentAct); ObjectSNO = GameCache.ReturnTownRunObjectSNO(GameCache.TownRunBehavior.Gamble, CurrentAct); break; case TownObjects.Idenify: MovementVector = GameCache.ReturnTownRunMovementVector(GameCache.TownRunBehavior.Idenify, CurrentAct); ObjectSNO = GameCache.ReturnTownRunObjectSNO(GameCache.TownRunBehavior.Idenify, CurrentAct); break; case TownObjects.NephalemObelisk: MovementVector = GameCache.ReturnTownRunMovementVector(GameCache.TownRunBehavior.NephalemObelisk, CurrentAct); ObjectSNO = GameCache.ReturnTownRunObjectSNO(GameCache.TownRunBehavior.NephalemObelisk, CurrentAct); break; case TownObjects.NephalemNPC: MovementVector = GameCache.ReturnTownRunMovementVector(GameCache.TownRunBehavior.NephalemNPC, CurrentAct); ObjectSNO = GameCache.ReturnTownRunObjectSNO(GameCache.TownRunBehavior.NephalemNPC, CurrentAct); break; case TownObjects.Tyrael: MovementVector = GameCache.ReturnTownRunMovementVector(GameCache.TownRunBehavior.Tyrael, CurrentAct); ObjectSNO = GameCache.ReturnTownRunObjectSNO(GameCache.TownRunBehavior.Tyrael, CurrentAct); break; } //Navigator.Clear(); Helpers.Logger.DBLog.InfoFormat("Initalized Variables Vector {0} Sno {1}", MovementVector, ObjectSNO); initalizedTownVars = true; }