Adding New Artifacts


This guide is current as of 6/26/2018. At the moment, all artifacts require custom C++ code. We are discussing ways to add new artifacts via only scripting.

 

What you need

 

 

Steps

 

  1. Add a new entry to artifacts.xml, similar to the others already there. You'll need to provide its name and description, and the text that appears when a player picks it up on the adventure map. Use the next available ID and remember it.
    1. Of note is the artifact level: treasure, minor, major, or ultimate. This affects which random events may give this artifact. 
  2. Following the guide in Adding Artwork, add the art:
    1. The 64x64 image goes in ARTIFACT.icn. This image should receive the index (artifact ID)+1.
    2. The 32x32 icon goes in ARTFX.icn.  This image should receive the index (artifact ID).
    3. The adventure map tiles go in OBJNARTI.icn. The shadow tile receives the index 2*(artifact ID). The main tile receives the index 2*(artifact ID)+1.
  3. Implement the code. Currently, artifacts are implemented by scattering a number of hero::HasArtifact checks throughout the codebase. Examples:
    1. hero::GetSSLevel implements the Spade of Necromancy ability.
    2. hero::CalcMobility implements the Traveler's Boots of Mobility, the Nomad Boots of Mobility, and the True Compass of Mobility
    3. combatManager::ModifyDamageForArtifacts implements 8 different artifact abilities  
  4. Add a scripting constant for the new artifact: https://github.com/jkoppel/project-ironfist/blob/master/src/cpp/shared/scripting/consts.cpp  
  5. Add it to the map editor. See Adding Map Overlays