- 42
- Posts
- 3
- Years
- West Virginia
- Seen Feb 12, 2025
Hello 😁,
I've been working on my hack Unofficial Crystal to be a base for the CFRU and I wanted to take full advantage of all the features it offers but it was rather unfortune that I could not find any tutorials or anything on the Raid Battles section of the CFRU and the actual CFRU Documentation lacks much explanation so I wanna share what I did to get this potentially wonderful feature working.
As of writing this I still do not understand how to actually configure the CFRU source files for Raid Battles nor do I understand the use of their script specials but I did come up with a script that initiates a raid battle and still gives us a reward.
This is just scratching the surface of the raid battles feature. If anyone knows more about this feature please let me know! I'm open to anyone willing to educate me and I'll be glad to learn!
I've also embedded a video of the script in action, this was done on a vanilla test FireRed Rom.
CREDITS TO GREEN JERRY CAUSE I USED HIS TEXTBOX PATCH IN THE VIDEO
Heres a direct video link cause for some reason the embedded video doesn't work:
https://www.youtube.com/watch?v=EZopqcJeIzs
checkitemroom was not used in this script because any way I tried to insert it just caused a chain reaction of "No that won't work" and was a headache but the CFRU has the ability to store 778 unique items in the players bag which in my opinion is more than enough bag space. If anyone is willing to educate me on a way to insert the checkitemroom portion, I'm willing to learn! 😄
Here is the script in quotes with some comments to explain what each part of the script does:
I've been working on my hack Unofficial Crystal to be a base for the CFRU and I wanted to take full advantage of all the features it offers but it was rather unfortune that I could not find any tutorials or anything on the Raid Battles section of the CFRU and the actual CFRU Documentation lacks much explanation so I wanna share what I did to get this potentially wonderful feature working.
As of writing this I still do not understand how to actually configure the CFRU source files for Raid Battles nor do I understand the use of their script specials but I did come up with a script that initiates a raid battle and still gives us a reward.
This is just scratching the surface of the raid battles feature. If anyone knows more about this feature please let me know! I'm open to anyone willing to educate me and I'll be glad to learn!
I've also embedded a video of the script in action, this was done on a vanilla test FireRed Rom.
CREDITS TO GREEN JERRY CAUSE I USED HIS TEXTBOX PATCH IN THE VIDEO
Heres a direct video link cause for some reason the embedded video doesn't work:
https://www.youtube.com/watch?v=EZopqcJeIzs
checkitemroom was not used in this script because any way I tried to insert it just caused a chain reaction of "No that won't work" and was a headache but the CFRU has the ability to store 778 unique items in the players bag which in my opinion is more than enough bag space. If anyone is willing to educate me on a way to insert the checkitemroom portion, I'm willing to learn! 😄
Here is the script in quotes with some comments to explain what each part of the script does:
#dynamic 0x800000
#define VAR_RESULT 0x800D // LASTRESULT
#define FLAG_RAID_BATTLE 0x919 // Same as CFRU Special 0x118 Start Raid Battle
#define FLAG_RAID_NO_FORCEEND 0x91A // Optional Raid Flag, was defined here but not used in the test script
//////////This section is basically setting up the script, give a intro message and details about which raids they might encounter, recommended level, and a disclaimer message about rewards and give the player the option to confirm the raid before it starts.//////////////////////////////////////////
#org @start
lock
msgbox @intro 0x6
msgbox @startraid 0x5
compare VAR_RESULT 0x0
if 0x1 goto @cancelled
setflag FLAG_RAID_BATTLE // sets flag 0x919 to inititate a raid
goto @chooseraid // Next section the script chooses which raid we get //
//////////This section of the script randomly chooses a value between 0-2 and places it in LASTRESULT 0x800D or in this script VAR_RESULT to decide which raid the player gets///////////
#org @chooseraid
random 0x3
compare VAR_RESULT 0x0
if 0x1 goto @squirtleraid
compare VAR_RESULT 0x1
if 0x1 goto @pikachuraid
compare VAR_RESULT 0x2
if 0x1 goto @charmanderraid
#org @squirtleraid
wildbattle 0x7 0x1 0x0 // the wildbattle command actually starts the raid if flag 0x919 is set
goto @battleoutcome // continues to next section after battle //
#org @pikachuraid
wildbattle 0x19 0x30 0x0 // the wildbattle command actually starts the raid if flag 0x919 is set
goto @battleoutcome // continues to next section after battle //
#org @charmanderraid
wildbattle 0x4 0x1 0x0 // the wildbattle command actually starts the raid if flag 0x919 is set
goto @battleoutcome [COLOR="Red"// continues to next section after battle //[/COLOR]
#org @battleoutcome // all this section does is check to see if we lost or ran away from the raid and if we did we don't get a reward //
special2 VAR_RESULT 0xB4 // checks our battle outcome and places it in LASTRESULT 0x800D or in this script VAR_RESULT //
compare VAR_RESULT 0x4 [COLOR="Red"]// if we ran away we don't the reward[/COLOR]
if 0x1 goto @cancelled
compare VAR_RESULT 0x5 // if we lost the raid we don't get the reward //
if 0x1 goto @cancelled
clearflag FLAG_RAID_BATTLE // clears flag 0x919 so we don't have every battle encounter be a raid battle
goto @reward1 // goes to the reward section of the script
///////This is what I came up with for the reward secton. In the little time I've messed with the raid feature(all of maybe 4 hours 😂), I couldn't think of any other way to script the reward sequence, but I'm sure I'll come up with something better in the future. It stills gives us a reward like special 0x11C but with the way its scripted there is a chance that we won't get a reward due to the random nature of the "random" command. ////////
#org @reward1
random 0x6
compare VAR_RESULT 0x0
if 0x1 goto @potion
compare VAR_RESULT 0x1
if 0x1 goto @masterball
compare VAR_RESULT 0x2
if 0x1 goto @rarecandy
compare VAR_RESULT 0x3
if 0x1 goto @fullrestore
compare VAR_RESULT 0x4
if 0x1 goto @fullheal
compare VAR_RESULT 0x5
if 0x1 goto @completed
#org @potion
giveitem 0xD 0x1 MSG_FIND
goto @reward1
#org @masterball
giveitem 0x1 0x1 MSG_FIND
goto @reward1
#org @rarecandy
giveitem 0x44 0x1 MSG_FIND
goto @reward1
#org @fullrestore
giveitem 0x13 0x1 MSG_FIND
goto @reward1
#org @fullheal
giveitem 0x17 0x1 MSG_FIND
goto @reward1
////Script is complete and tells the player the raid was completed/////
#org @completed
msgbox @done 0x6
release
end
/////If the script was ended prematurely/////
#org @cancelled
release
end
/////Text Strings//////
#org @intro
= [black_fr]You have requested a Raid Battle.\pRecommended Lvl: 5\pPotential Raids: Squirtle,\pPikachu, Charmander\pA MESSAGE ABOUT REWARDS\pIf you don't have enough bag space\nfor reward items then you simply\lwill not receive them.
#org @startraid
= [black_fr]Start the Raid Battle?
#org @done
= [black_fr]Raid battle has been completed.