foundryvtt / dnd5e

An implementation of the 5th Edition game system for Foundry Virtual Tabletop (http://foundryvtt.com).
MIT License
333 stars 222 forks source link

Wiki - Updates to World Scripts page #2372

Closed MaxPat931 closed 11 months ago

MaxPat931 commented 1 year ago

Got some good feedback from the discord once this got posted, gonna notate it here for any additional feedback and get another PR working in a few days.

Add information that the server should be shut down when modifying the world/module.json
Add information about using the console to view CONFIG.DND5E Add a disclaimer that world scripts may need adjustments for modules

Class Feature Types

credit: Kaelad

// Adds a new "Blood Curse" class feature type
Hooks.once("init", () => {
  CONFIG.DND5E.featureTypes.class.subtypes.bloodCurse = "Blood Curse";
});

Weapon Types

Credit: Zhell
You will need a compendium (if you have a shared compendium module, this works well for this) in which you store a base item, just like the system already has the 'Items SRD' compendium with all the different weapons. Then, for each item you want to add as a new 'base weapon', copy the uuid from the item's header - right-click the book icon. Do not left-click. This is then your world script:

Hooks.once("init", () => {
  CONFIG.DND5E.weaponIds.handCannon = // paste uuid here
  CONFIG.DND5E.weaponIds.magnum = // paste uuid here
  // etc etc
});

Note that the uuid should be tweaked slightly, it should not be the full uuid but instead of this form: <module scope>.<compendium id>.<item id>

Similar script but both Adds and Removes (which isnt covered in current examples)
Credit Zanderaf

// Adds Three weapon types while removing darts. Those being Throwing Knvies, Shuriken, and Kunai
Hooks.once("setup", function(){
    CONFIG.DND5E.weaponIds.throwingKnife = "zander-compendiums.weaponsammo.yON0DLNKiN0iSHgR";
    CONFIG.DND5E.weaponIds.shuriken = "zander-compendiums.weaponsammo.i16VPlmOqWTigCdA";
    CONFIG.DND5E.weaponIds.kunai = "zander-compendiums.weaponsammo.bPfZ36pwM2OGmHKs";
    delete CONFIG.DND5E.weaponIds.dart;
  });
Zanderaf commented 1 year ago

I can post the rest of the ones I have, maybe it helps someone later.

Remove, Rename, and Add new languages respectivly. Removes Common, Renames Deepspeech with Voidspeech, and adds a languages called Ochnun Hooks.once("setup", function addLanguages(){ delete CONFIG.DND5E.languages.common; CONFIG.DND5E.languages.deep = "Voidspeech"; CONFIG.DND5E.languages.ochnun= "Ochnun"; });

Adds in new AC Calculations: Adds a armor class caluclation option called "Solid Body" Hooks.once("setup", function(){ CONFIG.DND5E.armorClasses.wayofboulder = { label: 'Solid Body', formula: '10 + @abilities.wis.mod + @abilities.con.mod' };

Adds in a new feature type, similar to "Class Feature" called "Martial Exploit", with 5 different subtypes for it. Hooks.once("setup", function(){ CONFIG.DND5E.featureTypes.marexploit = { label: "Martial Exploit", subtypes: { first: "1st-Degree", second: "2nd-Degree", third: "3rd-Degree", fourth: "4th-Degree", fifth: "5th-Degree", } };

Adds in two different schools of magic, Chronomancy and Graviturgy. Hooks.once("setup", function(){ CONFIG.DND5E.spellSchools.chrono = "Chronomancy"; CONFIG.DND5E.spellSchools.grav = "Graviturgy"; });

Adds in item activation types. Hooks.once("setup", function(){ CONFIG.DND5E.abilityActivationTypes.crithit = 'Critical Hit'; CONFIG.DND5E.abilityActivationTypes.attack = 'On Attack'; CONFIG.DND5E.abilityActivationTypes.attack = 'Replaces Attack'; CONFIG.DND5E.abilityActivationTypes.meleehit = 'On Melee Hit'; CONFIG.DND5E.abilityActivationTypes.rangedhit = 'On Ranged Hit'; CONFIG.DND5E.abilityActivationTypes.weaponhit = 'On Weapon Hit'; }),

krbz999 commented 1 year ago

An example of adding or adjusting a spell progression would also be a good addition.

MaxPat931 commented 12 months ago

Adding Tool Proficiencies

Similar to Weapon Types above, requires an Item be created and stored in a compendium to referenced

Hooks.once("init", () => {
  CONFIG.DND5E.toolIds.hacking = "world.technomancer-tools.1xxXh8MeffZ1V0lL";
});