Question: when using your code, does the spell cost MP?
If not, how does it know not to (since it's using the magic routine)? And is it possible to make it cost MP? This would take a bit of the cheap out of a theorhetical MKnight's special command...
DeathLike2 had the right idea with his response, but I did find the actual byte which says whether to use MP and that was in Recall's routine...
"So to have Recall not take any MP it is as simple as changing this...
$03/EABC EE 5D 35 INC $355D [$7E:355D] A:0019 X:000F Y:0003 P:envMxdizc - +1 to 7E355D.
To this...
$03/EABC 9C 5D 35 STZ $355D [$7E:355D] A:0020 X:0009 Y:0003 P:envMxdizc - Store Zero in 7E355D."
Adding that +1 to 7E355D signals to the game to use that spell's MP to cast it.
As for checking to see if you have enough MP to use said spell, that too is in Recall...
"
$03/EA9B AD 8B 26 LDA $268B [$7E:268B] A:0000 X:000F Y:0003 P:envMxdiZC - Load Caster's MP Byte 1.
$03/EA9E 85 A9 STA $A9 [$00:00A9] A:00E7 X:000F Y:0003 P:eNvMxdizC - Store A in A9.
$03/EAA0 AD 8C 26 LDA $268C [$7E:268C] A:00E7 X:000F Y:0003 P:eNvMxdizC - Load Caster's MP Byte 2.
$03/EAA3 F0 04 BEQ $04 [$EAA9] A:0003 X:000F Y:0003 P:envMxdizC - Branch if not 00 to 03EAA9.
-------------------------------------------------------------------------------------------------------------------------------------------------
$03/EAA5 A9 FF LDA #$FF A:0003 X:000F Y:0003 P:envMxdizC - Load FF into A. (Assumes you have enough MP to cast spell)
$03/EAA7 85 A9 STA $A9 [$00:00A9] A:00FF X:000F Y:0003 P:eNvMxdizC - Store A in A9.
-----------------------------------------------------------------------------------------------------------------------------------------------
$03/EAA9 AD A1 28 LDA $28A1 [$7E:28A1] A:00FF X:000F Y:0003 P:eNvMxdizC - Load A from Spell's MP Cost.
$03/EAAC 29 7F AND #$7F A:0007 X:000F Y:0003 P:envMxdizC - Get rid of negative bits.
$03/EAAE C5 A9 CMP $A9 [$00:00A9] A:0007 X:000F Y:0003 P:envMxdizC - Is it the same as what is in A9?
$03/EAB0 F0 06 BEQ $06 [$EAB8] A:0007 X:000F Y:0003 P:envMxdizc - Branch if Equal to 03EAB8.
$03/EAB2 90 04 BCC $04 [$EAB8] A:0007 X:000F Y:0003 P:envMxdizc - Branch if More to 03EAB8.
-------------------------------------------------------------------------------------------------------------------------------------------------
$03/EAB4 68 PLA A:0005 X:0009 Y:0003 P:envMxdizC - Pull A.
$03/EAB5 4C C2 EA JMP $EAC2 [$03:EAC2] A:0020 X:0009 Y:0003 P:envMxdizC - Jump to Routine (Return)
-------------------------------------------------------------------------------------------------------------------------------------------------
$03/EAB8 68 PLA A:0007 X:000F Y:0003 P:envMxdizc - Pull A from Stack (retrieving the spell to be cast)
$03/EAB9 8D D2 26 STA $26D2 [$7E:26D2] A:0019 X:000F Y:0003 P:envMxdizc - Store A in Caster's Action to be Taken.
$03/EABC EE 5D 35 INC $355D [$7E:355D] A:0019 X:000F Y:0003 P:envMxdizc - +1 to 7E355D.
$03/EABF 20 46 CC JSR $CC46 [$03:CC46] A:0019 X:000F Y:0003 P:envMxdizc - Jump to Subroutine (Magic Call - Full)
$03/EAC2 60 RTS A:00E0 X:0680 Y:001A P:eNvMxdizC - Return
"
Granted that uses up a fair amount of bytes. What would be easier is a way to make the command unusable at 00 MP. Which is a very easy thing to set up whether inside the command or outside of it.
Now spells that are drawn from weapons are purely on a weapon by weapon basis.
There is an unknown (and possibly unused) byte in weapons that I think could be replaced and used for this as a secondary "Spell Check" so to speak. So that it can't be cast by just using the weapon. Now the way I would set this up is to check the character's equipment (7E2780+), look in the Right Hand, then if inapplicable look in the Left Hand, meaning that only one instance of a spell would occur as the game would branch to the next part of the routine. But let me see if the game is capable of recognizing two magic commands in a single routine for theories sake...
The game does not take kindly to casting two spells in one action, it seems. Either that or I'm missing something, which is completely possible. I might need to look back at the Summon section of data to see how that works since that is technically two spells, even if one is just the Summoning Preparation.