Instructions to make a macro that is called from a mod-set

Discussion concerning lmarkus' campaign framework for D&D3.x and Pathfinder.

Moderators: dorpond, trevor, Azhrei, giliath, Gamerdude, jay, Mr.Ice, lmarkus001

Forum rules
Discussion regarding lmarkus001's framework only. Other posts deleted without notice! :)
Post Reply
neofax
Great Wyrm
Posts: 1694
Joined: Tue May 26, 2009 8:51 pm
Location: Philadelphia, PA
Contact:

Instructions to make a macro that is called from a mod-set

Post by neofax »

jsharen wrote: (at least until a haste type effect can one day modify attacks)
Thanks!
jsharen
Hummm... currently there is a Hasted mod-set that does modify attacks. But it modifies all attacks and movement speed.

Delving deeper, I have a JSON object inside the property PrivateJSON called Combat. A key in that object is "magicExtraAttack". If that gets set to 1, the attack sequence will be considered "Hasted".

The mod-set Divine Power gives an example of using this JSON object. Specifically you can check out the macro on the library token: tmDivinePower. What I am suggesting is you create a mod-set called Weapon of Speed and set "magicExtraAttack" to 1 when activated. Here is an untested sample that should be pretty close (note that this does NOT consider other mod-sets setting magicExtraAttack so it is not fool proof):
tmWeaponOfSpeed

Code: Select all

[H: tToken = json.get( macro.args, "token" ) ]
[H: active = json.get( macro.args, "active" ) ]
[H: switchToken( tToken ) ]

[H: jCombat = json.get(PrivateJSON, "Combat")]
[H, IF( json.isEmpty( jCombat ) ): jCombat = json.set( "{}", "magicExtraAttack", 0 ) ]

[H, IF( active ), CODE: {
   [ PrivateJSON = json.set( PrivateJSON, "Combat", json.set( jCombat, "magicExtraAttack", 0 ) ) ]
};{
   [ PrivateJSON = json.set( PrivateJSON, "Combat", json.set( jCombat, "magicExtraAttack", 1 ) ) ]
}]

  
Currently I think only Divine Power toggles this property. So for the short term you should be fine as long as you toggle off/on WeaponOfSpeed any time Divine Power toggles off... kind of a kludge but will work for now.

Post Reply

Return to “D&D 3.5/Pathfinder 1e Campaign Macros”