GithubHelp home page GithubHelp logo

merchantsplus's Introduction

Mod updated to 1.4.4

This mod makes the game easier by adding over 90 unique shops containing NEARLY EVERY ITEM IN TERRARIA spread across all merchants.

Even the guide, nurse, angler, tax collector and old man are now merchants!

Although not all the items are unlocked at once, you will need to defeat bosses and other types of enemies to progress.

For example, the merchant sells a copper (or tin depending on what kind of world you are in) pickaxe at first. If you defeat the slime king then he will sell a iron pick and a silver pick when you beat the Eye of Cthulhu. He also sells items based on your currently equipped gear. If you have a bow equipped then he will sell you a bow that progresses as you defeat bosses. If you are holding a sword then he will sell a sword and so on.

Progression is not entirely tied to bosses but also world events and even killing say 1000 of a certain enemy.

If you are interested how progression works for the majority of items have a look at the following source code.

MerchantsPlus/Utils.cs

Lines 59 to 99 in 3ce86bb

/// <summary>
/// The players progression, the first 7 levels are prehardmode and
/// the 18 other levels are hardmode. (Making a total of 25 progression
/// levels.
/// </summary>
/// <returns>Returns the players progression level.</returns>
public static int Progression()
{
int progression = 0;
// Pre
if (NPC.downedSlimeKing) progression++;
if (DownedEyeOfCthulhu()) progression++;
if (NPC.downedGoblins) progression++;
if (DownedBrainOfCthulhu() || DownedEaterOfWorlds()) progression++;
if (NPC.downedQueenBee) progression++;
if (DownedSkeletron()) progression++;
if (DownedWallOfFlesh()) progression++;
// Post
if (NPC.downedPirates) progression++;
if (NPC.downedClown) progression++;
if (NPC.downedMechBoss1) progression++;
if (NPC.downedMechBoss2) progression++;
if (NPC.downedMechBoss3) progression++;
if (NPC.downedHalloweenTree) progression++;
if (NPC.downedHalloweenKing) progression++;
if (NPC.downedPlantBoss) progression++;
if (NPC.downedGolemBoss) progression++;
if (NPC.downedFishron) progression++;
if (NPC.downedChristmasIceQueen) progression++;
if (NPC.downedChristmasSantank) progression++;
if (NPC.downedChristmasTree) progression++;
if (NPC.downedFrost) progression++;
if (NPC.downedMartians) progression++;
if (NPC.downedAncientCultist) progression++;
if (NPC.downedTowers) progression++;
if (NPC.downedMoonlord) progression++;
return progression;
}

Featuring

  • Merchants sell more items based on bosses and enemies defeated
  • Some merchants items get upgraded as you progress
  • Merchants sell items based on what you currently have equipped
  • Items that use to have no sell value now have unique sell values
  • Quests (Quests give you hints on what you need to do to unlock more items) (WIP)
  • Merchants have a chance to drop items on death (enabled by default)
  • All merchants have 300 health (enabled by default)
  • Merchants have slightly reduced sizes (enabled by default)
  • Merchants shoot different projectiles based on bosses defeated (enabled by default)

New

  • Adds a shop for the NPC from the Magic Storage mod

Want to help contribute? Here are some ways you can contribute:

  • Suggesting new shops and items
  • Suggesting price changes and item condition changes for making the mod more balanced
  • Listing items that have no sell value

FAQ Q: Is this compatible with other mods? A: This mod does not touch vanilla shops but rather adds its own additional shops to merchants so it should be fully compatible with other mods

Q: I looked at the source code and the sell prices do not match up with that from script and in game. A: This is because of the "happiness currency multiplier" that currently cannot be disabled via modding.

Send bug reports and suggestions here for faster response: https://discord.gg/866cg8yfxZ

Source: https://github.com/Valks-Terraria-Mods/MerchantsPlus

My Other Mods: https://steamcommunity.com/sharedfiles/filedetails/?id=3025618564

merchantsplus's People

Contributors

valkyrienyanko avatar

Watchers

 avatar  avatar

merchantsplus's Issues

Map Draw Conflict

Describe the bug
The vanilla Terraria minimap does not update and crashes the game on pressing 'M'.

To Reproduce
Possibly after fighting the EoC

Screenshots
MapImage

Merchant Ore Revision

Describe the bug
The merchant sells copper and iron ore for 1 gold each.

To Reproduce
Steps to reproduce the behavior:

  1. Go to the merchant.
  2. Open his shop.
  3. Cycle over to ores.'
  4. Open up ores.
  5. Both copper and iron ore cost 1 gold coin each.

Expected behavior
I expected a much cheaper price.

Wiki + Readme

Mod could use a descriptive readme and wiki underling everything about the mod.

Needs Refactoring

Please talk to me on discord (valk#3277) before attempting to modify the mod to how you see fit.

Mod needs changes to prices, NPC lore, NPC attacks as well as other things I can't think off hand right now.

Nurse's shop menu won't open

Describe the bug
I talk to the nurse to open her shop menu but whenever I do an action that would bring up the shop icon, it would show up for a short moment then disappear.

To Reproduce
Steps to reproduce the behavior:

  1. Speak to the Nurse.
  2. Click to bring up the icon that shows "Healing Cycle Shop"
  3. See error

Expected behavior
I expected to see the shop menu like every other NPC but the nurse's shop won't show up long enough for it to open up.

Mod is completely broken in 1.4.4

If you want to get a better idea of how this mod functions, switch to 1.4.3 version of Terraria and download the "MerchantsPlus" mod from the workshop while you still can before August 1st (as that is when 1.4.3 is no more). Once in game, right click the guide and you will notice a custom UI on the left of your screen with 2 buttons. Click on the button on the left to open the custom shop for the guide.

Shops have been entirely changed in 1.4.4. This has completely broken this mod. Please switch over to the 1.4.4 branch when trying to solve this issue.

Note that all shops are opened from this part of the code.
https://github.com/Valks-Terraria-Mods/MerchantsPlus/blob/5735ab2a07e45f22947665f5e3a4b0b75883c7c5/UI/ShopUI.cs#L112C86-L137

How are we suppose to create a new custom shop when in order to open this shop we need to override from ModNPC::OnChatButtonClicked(bool firstButton, ref string shop) and set shop equal to the shop we want to open. ModNPC is for custom NPCs but we are trying to add custom shops to existing vanilla NPCs like the merchant, guide, nurse and dyrad.

Or more simply put how do we make custom shop(s) appear when pressing a custom made button in 1.4.4.

Errors from 1.4.3 Code

The following line has been commented out because of a out of index bounds error that freezes the game. To reproduce this error, uncomment the line, notice the error in-game. Client.log can be found in C:\Program Files (x86)\Steam\steamapps\common\tModLoader\tModLoader-Logs

//Main.SetNPCShopIndex(20);

This line of code also gives an error and thus the reason it has been commented out.

//Inv.SetupShop(0);

Useful Links

Migration Guide (Shop Changes): https://github.com/tModLoader/tModLoader/wiki/Update-Migration-Guide#shop-changes-aka-declarative-shops
Declarative Shops PR: tModLoader/tModLoader#3219

The new way of creating custom shops: https://github.com/tModLoader/tModLoader/blob/e6caaaf678efd2a69deece4d72fdaecc4391bd26/ExampleMod/Content/NPCs/ExamplePerson.cs#L281-L309

How to open custom shops: https://github.com/tModLoader/tModLoader/blob/e6caaaf678efd2a69deece4d72fdaecc4391bd26/ExampleMod/Content/NPCs/ExamplePerson.cs#L276

How to modify existing shops: (although not very helpful because this mod adds shops to NPCs that originally did not have shops in the first place like the Guide and Nurse) https://github.com/tModLoader/tModLoader/blob/1.4.4/ExampleMod/Common/GlobalNPCs/ExampleNPCShop.cs

Wiki Contributors Needed!

Have a quick look at the following page on the wiki. https://github.com/valkyrienyanko/MerchantsPlus/wiki/Angler

The Angler's items, prices, conditions and slots were found in the following code. https://github.com/valkyrienyanko/MerchantsPlus/blob/master/Shops/ShopAngler.cs

The Angler's projectiles and loot were found in the following code.
https://github.com/valkyrienyanko/MerchantsPlus/blob/master/NPCs/Angler.cs

This is what needs to be done for the other merchants eventually.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.