Skip to content

Bridge plugin that connects CustomNPCs mod and NT-RPG plugin and more

License

Notifications You must be signed in to change notification settings

Sponge-RPG-dev/NT-RPG-CNPC

Repository files navigation

CustomNPCs NT-RPG plugin

This mod/sponge plugin allows you to combine two wonderful things: CustomNPCs mod and NT-RPG plugin, and also adds new useful features.

Feature list

  1. Gain NT-RPG experience for killing mobs (PVE exp source). Also disable "minecraft orb" experience drops
  2. Gain NT-RPG experience for completing quests (QUESTING exp source).
  3. Use NT-RPG character level for all Availability checks (quests, dialogs, barriers). (MIXINS)
  4. CustomNPCs scripts now have access to all NT-RPG scripts bindings. (MIXINS)
    To give access to new variables or functions, write this lines in some NT-RPG script
var yourThing = {/*something*/};
Bindings.getScriptEngine().put("YourThing", yourThing);  
// Now you can use it in any CNPC script 
  1. Moved NpcEvent.DamagedEvent after NT-RPG damage calculations (MIXINS)
  2. Itemizer plugin support. To use it, name any item like #IT#id#yourid or #IT#pool#yourid and place into NPC drop inventory. (MIXINS)
  3. Dialogs can now contain scripts. To use them, just mark start and end of script inside dialog with $$$. Available variables are player, npc and dialog. (MIXINS) Example:
    Dialog creation Dialog in game Dialog options can also run scripts, but for this they need to be configured inside the dialog files and put "OptionType": 5.
  4. Store any additional data inside NPCs NBT (use command /npc data while looking at NPC). (MIXINS)
  5. NPCs can contain NT-RPG properties (use command /npc data while looking at NPC). (MIXINS)

Installation

Plugin requires CustomNPCs mod by Noppes and NT-RPG plugin by NeumimTo to be installed and configured on SpongeForge server.
This project uses Sponge Mixins. Mixins allow to add new things to existing mods (even without open source code, which is the CustomNPCs mod) or change the mechanics without much effort.
If you don't want to use mixins features, just use the basic version.

Basic version

For basic version grab the latest release from github and drop to plugins folder.

Mixin version

To make mixin version work, you should grab the latest release marked MIXINS, put it in mods folder and remove CustomNPCs mod (MIXINS version already contains it).
If you do everything right, you should see CNPC NT-RPG: Mixins are used, new features await! line in server log.

Building (for developers)

Project uses CustomNPCs mod code to work, but it is not opensource, so I can't store it in the repository.
Clone the repository and setup forge workspace. Then, to make it compile, grab latest release of CustomNPCs mod from curseforge, deobfuscate it (with BON for example), put it in the folder libs in the root of the project and allow forge do its job. You should see that CustomNPCs is now added to your project.

To run the server inside you IDE (for debugging), you should add the following line to Program arguments inside run configuration:
--tweakClass org.spongepowered.asm.launch.MixinTweaker --mixin mixins.cnpcntrpg.json
This would make mixins work in dev environment.

Afterwords

If you need any support, just contact me (GlassSpirit) or NeumimTo at discord server.