Advertisement
PikalaxALT

Pokered Map Script Macros

Jul 26th, 2016
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. scriptpointer: MACRO
  2. ; scriptpointer mapName, scriptPointer
  3. \1Script_\2:
  4.     dw \2
  5.     endm
  6.  
  7. doscript: MACRO
  8. ; doscript mapName, scriptPointer
  9.     ld a, (\1Script_\2 - \1ScriptPointers) / 2
  10.     ld [w\1CurScript], a
  11.     endm
  12.  
  13. dmaptext: MACRO
  14. ; dmaptext mapName, textPointer
  15. \1Text_\2:
  16.     dw \2
  17.     endm
  18.  
  19. maptext: MACRO
  20. ; maptext mapName, textPointer
  21.     ld a, (\1Text_\2 - \1TextPointers) / 2
  22.     ld [hSpriteIndexOrTextID], a
  23.     call DisplayTextID
  24.     endm
  25.  
  26. trainer_header: MACRO
  27. ; trainer_header eventFlag, sightRange, textBefore, textAfter, textWin, textLose[, flagOffset]
  28. IF _NARG > 6
  29.     dbEventFlagBit \1, \7
  30.     db (\2 << 4) ; trainer's view range
  31.     dw EventFlagAddress \1, \7
  32. ELSE
  33.     dbEventFlagBit \1
  34.     db (\2 << 4) ; trainer's view range
  35.     dw EventFlagAddress \1
  36. ENDC
  37.     dw \3 ; TextBeforeBattle
  38.     dw \4 ; TextAfterBattle
  39.     dw \5 ; TextEndBattle
  40.     dw \6 ; TextEndBattle
  41.     endm
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement