{"id":22764809,"url":"https://github.com/jfheim/traderutils","last_synced_at":"2025-03-30T10:14:41.725Z","repository":{"id":184214771,"uuid":"666373344","full_name":"JFHeim/TraderUtils","owner":"JFHeim","description":"Manager for custom traders","archived":false,"fork":false,"pushed_at":"2023-10-11T18:48:36.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T10:14:32.210Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JFHeim.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-14T10:57:16.000Z","updated_at":"2024-08-09T09:49:49.000Z","dependencies_parsed_at":"2023-07-27T14:28:20.774Z","dependency_job_id":"de2f5156-e9e4-497b-b13a-0f7931f242ee","html_url":"https://github.com/JFHeim/TraderUtils","commit_stats":null,"previous_names":["froggerhh/traderutils","jfheim/traderutils"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JFHeim%2FTraderUtils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JFHeim%2FTraderUtils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JFHeim%2FTraderUtils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JFHeim%2FTraderUtils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JFHeim","download_url":"https://codeload.github.com/JFHeim/TraderUtils/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246301995,"owners_count":20755514,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-11T12:10:18.500Z","updated_at":"2025-03-30T10:14:41.699Z","avatar_url":"https://github.com/JFHeim.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Trader Utils\n\nIt makes it very easy to add merchants to the game and rewrite existing trades. \u003cbr\u003e\nAutomatically generates the configuration (can be turned off). \u003cbr\u003e\nWide functionality and features that are not available in the vanilla game. \u003cbr\u003e\n\n### Merging the DLLs into your mod\n\nDownload the TraderUtils.dll and the ServerSync.dll from the release section to the right.\nIncluding the DLLs is best done via ILRepack (https://github.com/ravibpatel/ILRepack.Lib.MSBuild.Task). You can load\nthis package (ILRepack.Lib.MSBuild.Task) from NuGet.\n\nIf you have installed ILRepack via NuGet, simply create a file named `ILRepack.targets` in your project and copy the\nfollowing content into the file\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cProject xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\"\u003e\n    \u003cTarget Name=\"ILRepacker\" AfterTargets=\"Build\"\u003e\n        \u003cItemGroup\u003e\n            \u003cInputAssemblies Include=\"$(TargetPath)\"/\u003e\n            \u003cInputAssemblies Include=\"$(OutputPath)\\TraderUtils.dll\"/\u003e\n        \u003c/ItemGroup\u003e\n        \u003cILRepack Parallel=\"true\" DebugInfo=\"true\" Internalize=\"true\" InputAssemblies=\"@(InputAssemblies)\"\n                  OutputFile=\"$(TargetPath)\" TargetKind=\"SameAsPrimaryAssembly\" LibraryPath=\"$(OutputPath)\"/\u003e\n    \u003c/Target\u003e\n\u003c/Project\u003e\n```\n\nMake sure to set the TraderUtils.dll in your project to \"Copy to output directory\" in the properties of the DLLs and to\nadd\na reference to it.\nAfter that, simply add `using TraderUtils;`.\nThen initialize TraderUtils by this line of code `TradesConfiguration.Initialize(Config, configSync);`.\n\n## Example project\n\nThis code creates 3 new trades for Haldor, 2 to Hildir and 3 to TheFarmer by Marlthon.\nTo create new trade you need to create new CustomTrade and set its values.\n\n1. How to set for what trader this trade related? Use `.SetTrader(\"TraderPrefabName\")`\n2. How to set what item is selling? Use `.SetItem(\"ItemPrefabName\")`\n3. How to set for what price that item is selling? Use `.SetPrice(some number)`\n4. How to set how much is selling? Use `.SetStack(some number)`\n5. How to set what item should player spend to buy this item? Use `.SetMoneyItem(\"ItemPrefabName\")`\n6. How to that world should have some key to buy this item?\n   Use `.SetRequiredGlobalKey(\"KeyName\")` [More about global keys](#about-global-keys).\n7. How to prevent player from configuring this trade in the configuration? Use `.SetConfigurable(true / false)` **By\n   default all trades are configurable**\n8. How to hide this trade, but it can be enabled from the configuration? Use `.SetEnabled((true / false)`\n\n```csharp\nusing BepInEx;\nusing TraderUtils;\n\nnamespace TestTrader\n{\n    [BepInPlugin(ModGUID, ModName, ModVersion)]\n    public class TraderPlugin : BaseUnityPlugin\n    {\n        internal const string ModName = \"TestTrader\", ModVersion = \"1.0.0\", ModGUID = \"com.Frogger.\" + ModName;\n        internal static TraderPlugin _self;\n\n        private void Awake()\n        {\n            new CustomTrade()\n                .SetTrader(\"Haldor\")\n                .SetItem(\"Carrot\")\n                .SetPrice(25)\n                .SetStack(5);\n            new CustomTrade()\n                .SetTrader(\"Haldor\")\n                .SetItem(\"FishingRod\")\n                .SetPrice(100)\n                .SetStack(1);\n            new CustomTrade()\n                .SetTrader(\"Haldor\")\n                .SetItem(\"Onion\")\n                .SetPrice(25)\n                .SetStack(5);\n                \n                new CustomTrade()\n                .SetTrader(\"Hildir\")\n                .SetItem(\"Coins\")\n                .SetPrice(5)\n                .SetStack(25)\n                .SetMoneyItem(\"Onion\");\n            new CustomTrade()\n                .SetTrader(\"Hildir\")\n                .SetItem(\"Coins\")\n                .SetPrice(10)\n                .SetStack(2)\n                .SetMoneyItem(\"Carrot\");\n          \n                \n            new CustomTrade()\n                .SetTrader(\"TheFarmer\")\n                .SetItem(\"AxeBlackMetal\")\n                .SetPrice(1000)\n                .SetStack(1)\n                .SetConfigurable(false);\n            new CustomTrade()\n                .SetTrader(\"TheFarmer\")\n                .SetItem(\"SledgeStagbreaker\")\n                .SetPrice(3)\n                .SetStack(1)\n                .SetMoneyItem(\"TrophyDeer\")\n                .SetConfigurable(true);\n            new CustomTrade()\n                .SetTrader(\"TheFarmer\")\n                .SetItem(\"TrophyDragonQueen\")\n                .SetPrice(2)\n                .SetStack(1)\n                .SetMoneyItem(\"TrophyEikthyr\");\n        }\n    }\n}\n```\n\n### About global keys\n\nGlobal keys are the parameters of the world that are changed during the passage. Mods can also add their own keys. Here\nis a list of all vanilla keys:\n\n* PlayerDamage\n* EnemyDamage\n* WorldLevel\n* EventRate\n* ResourceRate\n* StaminaRate\n* MoveStaminaRate\n* StaminaRegenRate\n* SkillGainRate\n* SkillReductionRate\n* EnemySpeedSize\n* PlayerEvents\n* Fire\n* DeathKeepEquip\n* DeathDeleteItems\n* DeathDeleteUnequipped\n* DeathSkillsReset\n* NoBuildCost\n* NoCraftCost\n* AllPiecesUnlocked\n* NoWorkbench\n* AllRecipesUnlocked\n* WorldLevelLockedTools\n* PassiveMobs\n* NoMap\n* NoPortals\n* NoBossPortals\n* DungeonBuild\n* TeleportAll\n* Preset\n* NonServerOption\n* defeated_eikthyr\n* defeated_dragon\n* defeated_goblinking\n* defeated_gdking\n* defeated_bonemass\n* activeBosses\n* KilledTroll\n* killed_surtling\n* KilledBat\n* Count","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjfheim%2Ftraderutils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjfheim%2Ftraderutils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjfheim%2Ftraderutils/lists"}