public EliteMMOWrapper(int pid) { EliteAPI = new EliteAPI(pid); Navigator = new NavigationTools(EliteAPI); NPC = new NPCTools(EliteAPI); PartyMember = new Dictionary<byte, IPartyMemberTools>(); Player = new PlayerTools(EliteAPI); Target = new TargetTools(EliteAPI); Timer = new TimerTools(EliteAPI); Windower = new WindowerTools(EliteAPI); for (byte i = 0; i < 16; i++) { PartyMember.Add(i, new PartyMemberTools(EliteAPI, i)); } }
public FFACEWrapper(int pid) { FFACE = new FFACE(pid); Navigator = new NavigationTools(FFACE); NPC = new NPCTools(FFACE); PartyMember = new Dictionary<byte, IPartyMemberTools>(); Player = new PlayerTools(FFACE); Target = new TargetTools(FFACE); Timer = new TimerTools(FFACE); Windower = new WindowerTools(FFACE); for (byte i = 0; i < 16; i++) { PartyMember.Add(i, new PartyMemberTools(FFACE, i)); } }
/// <summary> /// Constructor that instantiates FFACE /// </summary> /// <param name="processID">The Process ID of the POL Process you want to interface with.</param> public FFACE (int processID) { // create our FFACE instance _InstanceID = CreateInstance((UInt32)processID); #region Find Windower Plugin Path System.Diagnostics.Process[] Processes = System.Diagnostics.Process.GetProcessesByName("pol"); if (Processes.Length > 0) foreach (System.Diagnostics.ProcessModule mod in Processes[0].Modules) { if (mod.ModuleName.ToLower() == "hook.dll") { WindowerPath = mod.FileName.Substring(0, mod.FileName.Length - 8) + @"\plugins\"; ParseResources.UseFFXIDatFiles = false; break; } } // Fix for non-windower users if (String.IsNullOrEmpty(WindowerPath)) { string ExePath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location); // If we have a resources folder, use the resource parser otherwise let it default to using .dat reader if (System.IO.Directory.Exists(ExePath + @"\resources\")) { WindowerPath = ExePath; ParseResources.UseFFXIDatFiles = false; } } #endregion // Find out if we should be using structs or not System.Diagnostics.FileVersionInfo fileInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(FFACE_LIBRARY); // Need 4, 1, 0, 14 or later. Adjust these settings as needed. UInt64 version = ( (UInt64)fileInfo.FileMajorPart << 48 ) + ( (UInt64)fileInfo.FileMinorPart << 32 ) + ( (UInt64)fileInfo.FileBuildPart << 16 ) + (UInt64)fileInfo.FilePrivatePart; if (fileInfo.FileMajorPart != 4) throw new Exception(NEED_v410_24_OR_HIGHER); else if (version < 0x0004000100000018UL) // 0004 0001 0000 000E (4, 1, 0, 14) // // 0004 0001 0000 0018 (4, 1, 0, 24) throw new Exception(NEED_v410_24_OR_HIGHER); /*if (fileInfo.FileMajorPart != 4) throw new Exception(NEED_v410_24_OR_HIGHER); else if (fileInfo.FileMinorPart < 1) throw new Exception(NEED_v410_24_OR_HIGHER); else if (fileInfo.FileBuildPart < 0) throw new Exception(NEED_v410_24_OR_HIGHER); else if (fileInfo.FilePrivatePart < 14) throw new Exception(NEED_v410_24_OR_HIGHER);*/ // instantiate our classes Player = new PlayerTools(_InstanceID); Target = new TargetTools(_InstanceID); Party = new PartyTools(_InstanceID); Fish = new FishTools(_InstanceID); Windower = new WindowerTools(_InstanceID); Timer = new TimerTools(_InstanceID); Chat = new ChatTools(_InstanceID); Item = new ItemTools(this); NPC = new NPCTools(_InstanceID); Menu = new MenuTools(this); Search = new SearchTools(_InstanceID); Navigator = new NavigatorTools(this); Resources = ParseResources.Instance; #region Party Members // instantiate our party members PartyMember = new System.Collections.Generic.Dictionary<byte, PartyMemberTools>(); PartyMember.Add(0, new PartyMemberTools(_InstanceID, 0)); PartyMember.Add(1, new PartyMemberTools(_InstanceID, 1)); PartyMember.Add(2, new PartyMemberTools(_InstanceID, 2)); PartyMember.Add(3, new PartyMemberTools(_InstanceID, 3)); PartyMember.Add(4, new PartyMemberTools(_InstanceID, 4)); PartyMember.Add(5, new PartyMemberTools(_InstanceID, 5)); PartyMember.Add(6, new PartyMemberTools(_InstanceID, 6)); PartyMember.Add(7, new PartyMemberTools(_InstanceID, 7)); PartyMember.Add(8, new PartyMemberTools(_InstanceID, 8)); PartyMember.Add(9, new PartyMemberTools(_InstanceID, 9)); PartyMember.Add(10, new PartyMemberTools(_InstanceID, 10)); PartyMember.Add(11, new PartyMemberTools(_InstanceID, 11)); PartyMember.Add(12, new PartyMemberTools(_InstanceID, 12)); PartyMember.Add(13, new PartyMemberTools(_InstanceID, 13)); PartyMember.Add(14, new PartyMemberTools(_InstanceID, 14)); PartyMember.Add(15, new PartyMemberTools(_InstanceID, 15)); PartyMember.Add(16, new PartyMemberTools(_InstanceID, 16)); PartyMember.Add(17, new PartyMemberTools(_InstanceID, 17)); #endregion } // @ public FFACEWrapper(uint processID)
public float GetToolCooldown(PlayerTools tool) { switch (tool) { case PlayerTools.Pickaxe: return 0.5f;// 0.55f; case PlayerTools.Detonator: return 0.1f; case PlayerTools.Remote: return 0.01f; case PlayerTools.ConstructionGun: return 0.5f; case PlayerTools.DeconstructionGun: return 0.5f; case PlayerTools.ProspectingRadar: return 0.5f; case PlayerTools.ThrowBomb: return 0.1f; case PlayerTools.ThrowRope: return 0.6f; case PlayerTools.Hide: return 0.6f; default: return 0; } }
/// <summary> /// Constructor that instantiates FFACE /// </summary> /// <param name="processID">The Process ID of the POL Process you want to interface with.</param> public FFACE(int processID) { // create our FFACE instance _InstanceID = CreateInstance((UInt32)processID); if (!System.IO.Directory.Exists(WindowerPath) && !ParseResources.UseFFXIDatFiles) ParseResources.UseFFXIDatFiles = true; //#region Find Windower Plugin Path //System.Diagnostics.Process[] Processes = System.Diagnostics.Process.GetProcessesByName("pol"); //if (Processes.Length > 0) // foreach (System.Diagnostics.ProcessModule mod in Processes[0].Modules) // { // if (mod.ModuleName.ToLower() == "hook.dll") // { // WindowerPath = mod.FileName.Substring(0, mod.FileName.Length - 8) + @"\plugins\"; // break; // } // } //if (String.IsNullOrEmpty(WindowerPath)) // WindowerPath = "Windower path could not be found"; //#endregion // Find out if we should be using structs or not System.Diagnostics.FileVersionInfo fileInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(FFACE_LIBRARY); // Need 4, 1, 0, 14 or later. Adjust these settings as needed. UInt64 version = ((UInt64)fileInfo.FileMajorPart << 48) + ((UInt64)fileInfo.FileMinorPart << 32) + ((UInt64)fileInfo.FileBuildPart << 16) + (UInt64)fileInfo.FilePrivatePart; if (fileInfo.FileMajorPart != 4) throw new Exception(NEED_v410_14_OR_HIGHER); else if (version < 0x000400010000000EUL) // 0004 0001 0000 000E (4, 1, 0, 14) throw new Exception(NEED_v410_14_OR_HIGHER); /*if (fileInfo.FileMajorPart != 4) throw new Exception(NEED_v410_14_OR_HIGHER); else if (fileInfo.FileMinorPart < 1) throw new Exception(NEED_v410_14_OR_HIGHER); else if (fileInfo.FileBuildPart < 0) throw new Exception(NEED_v410_14_OR_HIGHER); else if (fileInfo.FilePrivatePart < 14) throw new Exception(NEED_v410_14_OR_HIGHER);*/ // instantiate our classes Player = new PlayerTools(_InstanceID); Target = new TargetTools(_InstanceID); Party = new PartyTools(_InstanceID); Fish = new FishTools(_InstanceID); Windower = new WindowerTools(_InstanceID); Timer = new TimerTools(_InstanceID); Chat = new ChatTools(_InstanceID); Item = new ItemTools(this); NPC = new NPCTools(_InstanceID); Menu = new MenuTools(this); Search = new SearchTools(_InstanceID); Navigator = new NavigatorTools(this); //Resources = ParseResources.Instance; #region Party Members // instantiate our party members PartyMember = new System.Collections.Generic.Dictionary<byte, PartyMemberTools>(); PartyMember.Add(0, new PartyMemberTools(_InstanceID, 0)); PartyMember.Add(1, new PartyMemberTools(_InstanceID, 1)); PartyMember.Add(2, new PartyMemberTools(_InstanceID, 2)); PartyMember.Add(3, new PartyMemberTools(_InstanceID, 3)); PartyMember.Add(4, new PartyMemberTools(_InstanceID, 4)); PartyMember.Add(5, new PartyMemberTools(_InstanceID, 5)); PartyMember.Add(6, new PartyMemberTools(_InstanceID, 6)); PartyMember.Add(7, new PartyMemberTools(_InstanceID, 7)); PartyMember.Add(8, new PartyMemberTools(_InstanceID, 8)); PartyMember.Add(9, new PartyMemberTools(_InstanceID, 9)); PartyMember.Add(10, new PartyMemberTools(_InstanceID, 10)); PartyMember.Add(11, new PartyMemberTools(_InstanceID, 11)); PartyMember.Add(12, new PartyMemberTools(_InstanceID, 12)); PartyMember.Add(13, new PartyMemberTools(_InstanceID, 13)); PartyMember.Add(14, new PartyMemberTools(_InstanceID, 14)); PartyMember.Add(15, new PartyMemberTools(_InstanceID, 15)); PartyMember.Add(16, new PartyMemberTools(_InstanceID, 16)); PartyMember.Add(17, new PartyMemberTools(_InstanceID, 17)); #endregion }
public float GetToolCooldown(PlayerTools tool) { switch (tool) { case PlayerTools.Pickaxe: return 0.55f; case PlayerTools.Detonator: return 0.01f; case PlayerTools.ConstructionGun: return 0.5f; case PlayerTools.DeconstructionGun: return 0.5f; case PlayerTools.ProspectingRadar: return 0.5f; default: return 0; } }
public static void Load() { if (File.Exists(Application.persistentDataPath + folderPath + currentSaveSlot + saveSlotStrings[currentSaveSlot - 1])) { // Debug.Log("Loading..."); BinaryFormatter data = new BinaryFormatter(); FileStream file = File.Open(Application.persistentDataPath + folderPath + currentSaveSlot + saveSlotStrings[currentSaveSlot - 1], FileMode.Open); SaveableData loadData = (SaveableData)data.Deserialize(file); file.Close(); //-----------------------Loading Data--------------------------------- PlayerTools.SetOwnedToolsList(loadData.ownedTools); PlayerTools.SetCurrentlyEquippedTool(loadData.currentlyEquippedTool.GetToolName()); ToolManager.EquipTool(PlayerTools.GetCurrentlyEquippedToolIndex()); PlayerSkills.SetEfficiencySkill(loadData.efficiencySkill); PlayerSkills.SetContractsSkill(loadData.contractsSkill); PlayerSkills.SetCurrencySkill(loadData.currencySkill); PlayerSkills.SetEnergySkill(loadData.energySkill); PlayerSkills.SetBuildingMaterialsSkill(loadData.buildingMaterialsSkill); PlayerSkills.SetToolPartsSkill(loadData.toolPartsSkill); PlayerSkills.SetBookPagesSkill(loadData.bookPagesSkill); PlayerSkills.SetLumberTreesSkill(loadData.lumberTreesSkill); PlayerSkills.SetLumberLogsSkill(loadData.lumberLogsSkill); PlayerSkills.SetLumberFirewoodSkill(loadData.lumberFirewoodSkill); PlayerRooms.SetBedRoom(loadData.bedRoom); PlayerRooms.SetKitchenRoom(loadData.kitchenRoom); PlayerRooms.SetOfficeRoom(loadData.officeRoom); PlayerRooms.SetStudyRoom(loadData.studyRoom); PlayerRooms.SetWorkshopRoom(loadData.workshopRoom); PlayerAdditions.SetCoffeeMakerAddition(loadData.coffeeMakerAddition); PlayerAdditions.SetFireplaceAddition(loadData.fireplaceAddition); PlayerAdditions.SetFrontPorchAddition(loadData.frontPorchAddition); PlayerAdditions.SetWoodworkingBenchAddition(loadData.woodworkingBenchAddition); PlayerContracts.SetActiveContractsList(loadData.activeContracts); AvailableContracts.SetAvailableContracts(loadData.availableContracts); AvailableContracts.SetContractsToRemove(loadData.availableContractsToRemove); TimeManager.SetDidDailyGeneration(loadData.didDailyGeneration); AvailableContracts.SetAverageContractDifficulty(loadData.averageContractDifficulty); AvailableContracts.SetPastGeneratedContractDifficulties(loadData.pastGeneratedContractDifficulties); PlayerEnergy.SetCurrentEnergyValue(loadData.currentEnergy); PlayerResources.SetCurrentCurrencyValue(loadData.currentCurrency); PlayerResources.SetCurrentBuildingMaterialsValue(loadData.currentBuildingMaterials); PlayerResources.SetCurrentToolPartsValue(loadData.currentToolParts); PlayerResources.SetCurrentBookPagesValue(loadData.currentBookPages); HomesteadStockpile.SetAllTreesCount(loadData.homesteadTreesCount); HomesteadStockpile.SetAllLogsCount(loadData.homesteadLogsCount); HomesteadStockpile.SetAllFirewoodCount(loadData.homesteadFirewoodCount); TimeManager.SetCurrentTime(loadData.currentTime); MainMenu.SetSceneToLoad(loadData.lastSceneName); float[] spawnHolder = loadData.lastSceneSpawnLocation; MainMenu.SetLocationToSpawn(new Vector3(spawnHolder[0], spawnHolder[1], spawnHolder[2])); //-----------------------Done Loading---------------------------------- } else { Save(); } }
public static void Save() { Debug.Log("Save Slot: " + currentSaveSlot); BinaryFormatter data = new BinaryFormatter(); FileStream file = File.Create(Application.persistentDataPath + folderPath + currentSaveSlot + saveSlotStrings[currentSaveSlot - 1]); SaveableData saveData = new SaveableData(); //-----------------------Setting Save Data--------------------------------------------- saveData.activeContracts = PlayerContracts.GetActiveContractsList(); saveData.availableContracts = AvailableContracts.GetAvailableContracts(); saveData.availableContractsToRemove = AvailableContracts.GetContractsToRemove(); saveData.didDailyGeneration = TimeManager.GetDidDailyGeneration(); saveData.averageContractDifficulty = AvailableContracts.GetAverageContractDifficulty(); saveData.pastGeneratedContractDifficulties = AvailableContracts.GetPastGeneratedContractDifficuties(); saveData.currentEnergy = PlayerEnergy.GetCurrentEnergyValue(); saveData.currentCurrency = PlayerResources.GetCurrentCurrencyValue(); saveData.currentBuildingMaterials = PlayerResources.GetCurrentBuildingMaterialsValue(); saveData.currentToolParts = PlayerResources.GetCurrentToolPartsValue(); saveData.currentBookPages = PlayerResources.GetCurrentBookPagesValue(); saveData.homesteadTreesCount = HomesteadStockpile.GetAllTreesCount(); saveData.homesteadLogsCount = HomesteadStockpile.GetAllLogsCount(); saveData.homesteadFirewoodCount = HomesteadStockpile.GetAllFirewoodCount(); saveData.ownedTools = PlayerTools.GetOwnedToolsList(); saveData.currentlyEquippedTool = PlayerTools.GetCurrentlyEquippedTool(); saveData.efficiencySkill = PlayerSkills.GetEfficiencySkill(); saveData.contractsSkill = PlayerSkills.GetContractsSkill(); saveData.currencySkill = PlayerSkills.GetCurrencySkill(); saveData.energySkill = PlayerSkills.GetEnergySkill(); saveData.buildingMaterialsSkill = PlayerSkills.GetBuildingMaterialsSkill(); saveData.toolPartsSkill = PlayerSkills.GetToolPartsSkill(); saveData.bookPagesSkill = PlayerSkills.GetBookPagesSkill(); saveData.lumberTreesSkill = PlayerSkills.GetLumberTreesSkill(); saveData.lumberLogsSkill = PlayerSkills.GetLumberLogsSkill(); saveData.lumberFirewoodSkill = PlayerSkills.GetLumberFirewoodSkill(); saveData.bedRoom = PlayerRooms.GetBedRoom(); saveData.kitchenRoom = PlayerRooms.GetKitchenRoom(); saveData.officeRoom = PlayerRooms.GetOfficeRoom(); saveData.studyRoom = PlayerRooms.GetStudyRoom(); saveData.workshopRoom = PlayerRooms.GetWorkshopRoom(); saveData.coffeeMakerAddition = PlayerAdditions.GetCoffeeMakerAddition(); saveData.fireplaceAddition = PlayerAdditions.GetFireplaceAddition(); saveData.frontPorchAddition = PlayerAdditions.GetFrontPorchAddition(); saveData.woodworkingBenchAddition = PlayerAdditions.GetWoodworkingBenchAddition(); saveData.currentTime = TimeManager.GetCurrentTime(); saveData.lastSceneName = SceneManager.GetActiveScene().name; Vector3 spawnHolder = SpawnLocations.GetSpawnForLoad(SceneManager.GetActiveScene().name); saveData.lastSceneSpawnLocation = new float[3] { spawnHolder.x, spawnHolder.y, spawnHolder.z }; //-----------------------Done Setting Data--------------------------------------------- data.Serialize(file, saveData); file.Close(); Debug.Log("Saved here: " + Application.persistentDataPath); }
// Use this for initialization void Start() { zoomInOut = Interpolate.Ease(Interpolate.EaseType.EaseInCirc); zoomElapsedTime = 0; zoomBegin = 0; zoomDistance = 0; charController = this.GetComponent<CharacterController>(); tools = this.GetComponentInChildren<PlayerTools>(); footstepSound = this.GetComponent<AudioSource>(); }
public CurePotency(PlayerTools player, double potency) { Player = player; Potency = potency; }
//this is only the server sides cooldown list public float GetToolCooldown(PlayerTools tool) { //needs to be converted to over a time frame switch (tool) { case PlayerTools.Pickaxe: return 0.4f;// 0.55f; case PlayerTools.Detonator: return 0.01f; case PlayerTools.Remote: return 0.01f; case PlayerTools.ConstructionGun: return 0.5f; case PlayerTools.DeconstructionGun: return 0.5f; case PlayerTools.ProspectingRadar: return 0.5f; case PlayerTools.ThrowBomb: return 0.07f; case PlayerTools.ThrowRope: return 0.07f; default: return 0; } }
public void Handle(byte PacketId, MessageReader Reader) { switch (PacketId) { case (byte)CustomRPC.ShieldBreak: { MedicRole.INSTANCE.BreakShield(); break; } case (byte)CustomRPC.FixLights: { SabotageCentralPatch.FixLights(); break; } case (byte)CustomRPC.ResetStartingRoles: { // EndGameCentral.SetPeaceful(Reader.ReadBytesAndSize()); EndGameCentral.ResetStartingRoles(); break; } case (byte)CustomRPC.SetProtected: { if (XenoCore.Utils.Extensions.TryGetPlayerById(Reader.ReadByte(), out var Player)) { MedicRole.INSTANCE.Protected = Player; } break; } case (byte)CustomRPC.SetRole: { var Role = Roles.Role.ROLES[Reader.ReadByte()]; Role.SetPlayerById(Reader.ReadByte()); Role.PlayerAssigned(); break; } case (byte)CustomRPC.OfficerKill: { var Killer = PlayerTools.GetPlayerById(Reader.ReadByte()); var Target = PlayerTools.GetPlayerById(Reader.ReadByte()); Killer.MurderPlayer(Target); break; } case (byte)CustomRPC.SingleWin: { EndGameCentral.RoleVictory = Role.ROLES[Reader.ReadByte()]; foreach (var player in PlayerControl.AllPlayerControls) { player.RemoveInfected(); } PlayerControl.LocalPlayer.SetInfected(new[] { Reader.ReadByte() }); break; } case (byte)CustomRPC.ProtectedMurderAttempt: { var PlayerId = Reader.ReadByte(); if (PlayerId == PlayerControl.LocalPlayer.PlayerId) { ExtraResources.BREAK_SHIELD.PlayGlobally( AudioManager.EffectsScale(3f)); } break; } case (byte)CustomRPC.PsychicEffect: { var Psychic = PsychicRole.INSTANCE; Psychic.EnableAura(); break; } case (byte)CustomRPC.ScientistEffect: { var Scientist = ScientistRole.INSTANCE; Scientist.EnableTimeWarp(); break; } case (byte)CustomRPC.SpyEffect: { var Spy = SpyRole.INSTANCE; Spy.EnableInvisibility(); break; } case (byte)CustomRPC.ZombieInfect: { var Zombie = ZombieRole.INSTANCE; var Target = PlayerTools.GetPlayerById(Reader.ReadByte()); if (Target != null) { Zombie.Infect(Target); } break; } case (byte)CustomRPC.ZombieChainKill: { ZombieRole.INSTANCE.KillTargets(Reader.ReadBytesAndSize()); break; } case (byte)CustomRPC.DebugVictory: { DebugTools.DebugWin(PlayerTools.GetPlayerById(Reader.ReadByte())); break; } case (byte)CustomRPC.MageStonefication: { MageRole.INSTANCE.EnableStonefication(Reader.ReadBytesAndSize()); break; } case (byte)CustomRPC.MageTransposition: { var Partner = PlayerTools.GetPlayerById(Reader.ReadByte()); if (Partner != null) { MageRole.INSTANCE.Transposition(Partner); } break; } case (byte)CustomRPC.CleanerClean: { CleanerRole.INSTANCE.Clean(Reader.ReadByte()); break; } } }
public void ExecuteCommand() { command = commandDropdown.options[commandDropdown.value].text; commandValue = int.Parse(commandInputField.text); if (secondaryCommmandInputField.text.Length != 0) { secondaryCommandValue = int.Parse(secondaryCommmandInputField.text); } Debug.Log("Command: " + command); Debug.Log("Value: " + commandValue); switch (command) { case "Currency Value": PlayerResources.SetCurrentCurrencyValue(commandValue); break; case "Energy Value": PlayerEnergy.SetCurrentEnergyValue(commandValue); break; case "Building Materials Value": PlayerResources.SetCurrentBuildingMaterialsValue(commandValue); break; case "Tool Parts Value": PlayerResources.SetCurrentToolPartsValue(commandValue); break; case "Book Pages Value": PlayerResources.SetCurrentBookPagesValue(commandValue); break; case "Active Contracts Tier": PlayerSkills.SetCurrentContractsTier(commandValue); break; case "Currency Tier": PlayerSkills.SetCurrentCurrencyTier(commandValue); break; case "Efficiency Tier": PlayerSkills.SetCurrentEfficiencyTier(commandValue); break; case "Energy Tier": PlayerSkills.SetCurrentEnergyTier(commandValue); break; case "Building Materials Tier": PlayerSkills.SetCurrentBuildingMaterialsTier(commandValue); break; case "Tool Parts Tier": PlayerSkills.SetCurrentToolPartsTier(commandValue); break; case "Book Pages Tier": PlayerSkills.SetCurrentBookPagesTier(commandValue); break; case "Felling Axe Tier": PlayerTools.GetToolByName(ToolName.FELLING_AXE).SetCurrentTier(commandValue); break; case "Crosscut Saw Tier": PlayerTools.GetToolByName(ToolName.CROSSCUT_SAW).SetCurrentTier(commandValue); break; case "Splitting Axe Tier": PlayerTools.GetToolByName(ToolName.SPLITTING_AXE).SetCurrentTier(commandValue); break; case "Bedroom Tier": PlayerRooms.SetBedRoomTier(commandValue); break; case "Kitchen Tier": PlayerRooms.SetKitchenRoomTier(commandValue); break; case "Office Tier": PlayerRooms.SetOfficeRoomTier(commandValue); break; case "Study Tier": PlayerRooms.SetStudyRoomTier(commandValue); break; case "Workshop Tier": PlayerRooms.SetWorkshopRoomTier(commandValue); break; case "Lumber Trees Value": HomesteadStockpile.SetTreesCountAtIndex(secondaryCommandValue, commandValue); break; case "Lumber Logs Value": HomesteadStockpile.SetLogsCountAtIndex(secondaryCommandValue, commandValue); break; case "Lumber Firewood Value": HomesteadStockpile.SetFirewoodCountAtIndex(secondaryCommandValue, commandValue); break; case "Lumber Trees Tier": PlayerSkills.SetCurrentLumberTreesTier(commandValue); break; case "Lumber Logs Tier": PlayerSkills.SetCurrentLumberLogsTier(commandValue); break; case "Lumber Firewood Tier": PlayerSkills.SetCurrentLumberFirewoodTier(commandValue); break; case "Skip To Time": TimeManager.SetCurrentTime((float)commandValue); break; case "Clear Active Contracts": PlayerContracts.SetActiveContractsList(new List <LumberContract>()); break; case "Clear Available Contracts": AvailableContracts.SetAvailableContracts(new List <LumberContract>()); break; } }
/// <summary> /// Constructor that instantiates FFACE /// </summary> /// <param name="processID">The Process ID of the POL Process you want to interface with.</param> public FFACE(int processID) { // create our FFACE instance _InstanceID = CreateInstance((UInt32)processID); if (!System.IO.Directory.Exists(WindowerPath) && !ParseResources.UseFFXIDatFiles) { ParseResources.UseFFXIDatFiles = true; } //#region Find Windower Plugin Path //System.Diagnostics.Process[] Processes = System.Diagnostics.Process.GetProcessesByName("pol"); //if (Processes.Length > 0) // foreach (System.Diagnostics.ProcessModule mod in Processes[0].Modules) // { // if (mod.ModuleName.ToLower() == "hook.dll") // { // WindowerPath = mod.FileName.Substring(0, mod.FileName.Length - 8) + @"\plugins\"; // break; // } // } //if (String.IsNullOrEmpty(WindowerPath)) // WindowerPath = "Windower path could not be found"; //#endregion // Find out if we should be using structs or not System.Diagnostics.FileVersionInfo fileInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(FFACE_LIBRARY); // Need 4, 1, 0, 14 or later. Adjust these settings as needed. UInt64 version = ((UInt64)fileInfo.FileMajorPart << 48) + ((UInt64)fileInfo.FileMinorPart << 32) + ((UInt64)fileInfo.FileBuildPart << 16) + (UInt64)fileInfo.FilePrivatePart; if (fileInfo.FileMajorPart != 4) { throw new Exception(NEED_v410_14_OR_HIGHER); } else if (version < 0x000400010000000EUL) // 0004 0001 0000 000E (4, 1, 0, 14) { throw new Exception(NEED_v410_14_OR_HIGHER); } /*if (fileInfo.FileMajorPart != 4) * throw new Exception(NEED_v410_14_OR_HIGHER); * else if (fileInfo.FileMinorPart < 1) * throw new Exception(NEED_v410_14_OR_HIGHER); * else if (fileInfo.FileBuildPart < 0) * throw new Exception(NEED_v410_14_OR_HIGHER); * else if (fileInfo.FilePrivatePart < 14) * throw new Exception(NEED_v410_14_OR_HIGHER);*/ // instantiate our classes Player = new PlayerTools(_InstanceID); Target = new TargetTools(_InstanceID); Party = new PartyTools(_InstanceID); Fish = new FishTools(_InstanceID); Windower = new WindowerTools(_InstanceID); Timer = new TimerTools(_InstanceID); Chat = new ChatTools(_InstanceID); Item = new ItemTools(this); NPC = new NPCTools(_InstanceID); Menu = new MenuTools(this); Search = new SearchTools(_InstanceID); Navigator = new NavigatorTools(this); //Resources = ParseResources.Instance; #region Party Members // instantiate our party members PartyMember = new System.Collections.Generic.Dictionary <byte, PartyMemberTools>(); PartyMember.Add(0, new PartyMemberTools(_InstanceID, 0)); PartyMember.Add(1, new PartyMemberTools(_InstanceID, 1)); PartyMember.Add(2, new PartyMemberTools(_InstanceID, 2)); PartyMember.Add(3, new PartyMemberTools(_InstanceID, 3)); PartyMember.Add(4, new PartyMemberTools(_InstanceID, 4)); PartyMember.Add(5, new PartyMemberTools(_InstanceID, 5)); PartyMember.Add(6, new PartyMemberTools(_InstanceID, 6)); PartyMember.Add(7, new PartyMemberTools(_InstanceID, 7)); PartyMember.Add(8, new PartyMemberTools(_InstanceID, 8)); PartyMember.Add(9, new PartyMemberTools(_InstanceID, 9)); PartyMember.Add(10, new PartyMemberTools(_InstanceID, 10)); PartyMember.Add(11, new PartyMemberTools(_InstanceID, 11)); PartyMember.Add(12, new PartyMemberTools(_InstanceID, 12)); PartyMember.Add(13, new PartyMemberTools(_InstanceID, 13)); PartyMember.Add(14, new PartyMemberTools(_InstanceID, 14)); PartyMember.Add(15, new PartyMemberTools(_InstanceID, 15)); PartyMember.Add(16, new PartyMemberTools(_InstanceID, 16)); PartyMember.Add(17, new PartyMemberTools(_InstanceID, 17)); #endregion } // @ public FFACEWrapper(uint processID)
void Start() { _playerTools = GameObject.FindGameObjectWithTag(AllTagsConstants.gameManagerTag).GetComponentInChildren <PlayerTools>(); }