Scripts ‐ Combat Items - haven1433/HexManiacAdvance GitHub Wiki

Return to List of Utilities and Scripts

After applying this .hma script, you'll be able to make custom expendable items that act like Status moves in battle. The items can be copies of moves, or can have custom effects. If you can make it into a battle script, then you can make it into an item!

How to make a Combat Item

After applying the .hma script:

  • Goto data.items.stats and create your new item in any slot. Be sure to set the following fields:
Field Value
type Battle Menu
battleusage 1
battleeffect <thumb.item_use.BattleUseFunc.BattleScriptItem+1>
  • Goto data.items.battlescripts and create a new battle script for your item. DO NOT USE INDEX 0. You can use any other index of the table you like. You can safely expand this table to have as many entries as you like.

  • Back in the data.items.stats table, update your new item's battleextra field to be the index of your script within data.items.batlescripts. Again, do not use index 0.

And that's it! Repeat these 3 steps for whatever other combat items you want to make.

Examples

Leeching Seed

An item that acts like Leech Seed, sapping health from your opponent until they switch. Doesn't work on Grass-type pokemon.

leeching-seed

The script for FireRed is below. It was built by modifying the Leech Seed battle effect script. You can easily build the script for other games by looking at how Leech Seed works in those games.

section0: # 71A700
  jumpifstatus2 target 0x01000000 <section1>
  setseeded
  printfromtable <3FE558>  # this table address is different for other games
  waitmessage 64
  end

section1: # 71A714
  pause 32
  orbyte 0x02023DCC 32    # this memory address is different for other games
  resultmessage
  waitmessage 64
  end

Gotchas

  • The battle script is running without being based on a move, so you can't do things like play move animations or check move accuracy. As such, combat items do not 'miss', but can still make other ways for them to fail if you wish.

  • Combat Items don't have PP, but are consumable.

  • The code for Combat Items allows players to use them. But trainer AIs do not know how to use them. Do not give the items to trainers.

⚠️ **GitHub.com Fallback** ⚠️