[FE8] Skill System v1.0 - 404 skills done, more on the way

Guess you’ll have to stick with the most commonly preferred formula until then. It’s unlikely there’s going to be enough demand for someone else to create another version of Miracle for a public release.

1 Like

I didn’t test this and essentially just combined pavise and miracle to make this. Someone else can check to see if it works, but I think this will do it.

.thumb
.macro blh to, reg=r3
  ldr \reg, =\to
  mov lr, \reg
  .short 0xf800
.endm
.equ MiracleID, SkillTester+4
.equ d100Result, 0x802a52c
@ r0 is attacker, r1 is defender, r2 is current buffer, r3 is battle data
push {r4-r7,lr}
mov r4, r0 @attacker
mov r5, r1 @defender
mov r6, r2 @battle buffer
mov r7, r3 @battle data
ldr     r0,[r2]           @r0 = battle buffer                @ 0802B40A 6800     
lsl     r0,r0,#0xD                @ 0802B40C 0340     
lsr     r0,r0,#0xD        @Without damage data                @ 0802B40E 0B40     
mov r1, #0xC0 @skill flag @it's a passive, regardless of skills
lsl r1, #8 @0xC000
add r1, #2 @miss - why was this originally mov...?
tst r0, r1
bne End

@get max HP
ldrb r1, [r5,#0x13] @current hp

@check damage >= currhp
mov r0, #4
ldrsh r0, [r7, r0]
cmp r0, r1
blt End @not gonna die

@check for Miracle
ldr r0, SkillTester
mov lr, r0
mov r0, r5 @defender data
ldr r1, MiracleID
.short 0xf800
cmp r0, #0
beq End

@if skill found, check proc

ldrb r0, [r5, #0x19] @luck stat as activation rate
mov r1, r5 @skill user
blh d100Result
cmp r0, #1
bne End

@if we proc, set the defensive skill flag
ldr     r2,[r6]    
lsl     r1,r2,#0xD                @ 0802B42C 0351     
lsr     r1,r1,#0xD                @ 0802B42E 0B49     
mov     r0, #0x80
lsl     r0, #8           @0x8000, defender skill activated
orr     r1, r0

@and unset the crit flag
mov r0, #1
mvn  r0, r0
and     r1,r0            @unset it

ldr     r0,=#0xFFF80000                @ 0802B434 4804     
and     r0,r2                @ 0802B436 4010     
orr     r0,r1                @ 0802B438 4308     
str     r0,[r6]                @ 0802B43A 6018   
ldrb r0, MiracleID
strb r0, [r6,#4]


@and set damage to currhp-1
ldrb r0, [r5, #0x13] @currhp
sub r0, #1
strh r0, [r7, #4] @final damage

End:
pop {r4-r7}
pop {r15}

.align
.ltorg
SkillTester:
@POIN SkillTester
@WORD MiracleID
3 Likes

There seems to be a bug with the Watchful skill that allows you to capture units with it. A ups file of this bug can be found here: https://www.dropbox.com/s/1otgal35yladjnt/WatchfulBug.ups?dl=0

The bug occurs during certain unit formations when you can attack one unit that you can capture when another unit is in range that you cannot.

1 2 3 4 5 6

In the above example, while the game thinks I am targeting O’Neill, you can see that the armor knight is highlighted. If I try and switch to attack Bone and then back, it will target Breguet instead. If I attack the highlighted O’Neill, I will attack Breguet.

The event file used to create the formation can be found below:

////////////////////////////////////////////////////
//                                                //
// Disassembled with Nintenlord's Event Assembler //
// Version: 11.0.0.0                              //
// Game: FE8                                      //
// File: FE8_clean.gba                            //
// Offset: $9EC66C                                //
//                                                //
////////////////////////////////////////////////////

EventPointerTable(0x7, PointerList)

VeinEffect(0, FreezeAllEnemies)

PointerList:
POIN TurnBasedEvents
POIN CharacterBasedEvents
POIN LocationBasedEvents
POIN MiscBasedEvents
POIN Dunno1 Dunno2 Dunno3 Tutorial
POIN Traps1 Traps2
POIN Units1 Units1  //This unit group determines the number and position of deployment slots when there is a prep screen
POIN $0 $0 $0
POIN $0 $0 $0
POIN BeginningScene EndingScene

TurnBasedEvents:
END_MAIN

CharacterBasedEvents:
CharacterEventBothWays(0x10,TalkEvent, Eirika, Ephraim)
END_MAIN

LocationBasedEvents:
Vendor(ShopItems,2,7)
Armory(ArmoryItems,10,26)
Village(0x8,VillageEvent,18,27)
House(0,HouseEvent,6,24)
Seize(10,2)
END_MAIN

MiscBasedEvents:
CauseGameOverIfLordDies
END_MAIN

Dunno1:
END_MAIN

Dunno2:
END_MAIN

Dunno3:
END_MAIN

Tutorial:
END_MAIN

Units1:
UNIT Eirika  0x4 0x1 0xA1   [9,24] 0b 0x0 0x0 0x0 [0x1,0x98,0x88,0x0] [0x0,0x0,0x0,0x0]
UNIT Ephraim  0x1 0x1 0xA1  [7,24] 0b 0x0 0x0 0x0 [0x14,0x99,0x88,0x0] [0x0,0x0,0x0,0x0]
UNIT Seth  0x7 0x1 0xA1     [11,24] 0b 0x0 0x0 0x0 [0x1,0x0,0x0,0x0] [0x0,0x0,0x0,0x0]
UNIT Gilliam  0x9 0x1 0xA1  [8,25] 0b 0x0 0x0 0x0 [0x14,0x65,0x88,0x0] [0x0,0x0,0x0,0x0]
UNIT Franz  0x5 0x1 0xA1    [10,25] 0b 0x0 0x0 0x0 [0x1,0x65,0x88,0x0] [0x0,0x0,0x0,0x0]
UNIT Moulder  Bishop 0x1 0xA1 [12,25] 0b 0x0 0x0 0x0 [Heal,Lightning,Flux,0x0] [0x0,0x0,0x0,0x0]
UNIT Vanessa  0x48 0x1 0xA1 [11,26] 0b 0x0 0x0 0x0 [0x14,0x67,0x88,0x0] [0x0,0x0,0x0,0x0]
UNIT Ross  Pirate 0x1 0xA1    [7,26] 0b 0x0 0x0 0x0 [0x1F,0x64,0x88,0x0] [0x0,0x0,0x0,0x0]
UNIT Neimi  Ranger_F 0x1 0xA1   [9,26] 0b 0x0 0x0 0x0 [0x2D,0x66,0x88,0x0] [0x0,0x0,0x0,0x0]
UNIT Colm  Rogue 0x1 0xA1     [10,27] 0b 0x0 0x0 0x0 [0x1,0,0,0x0] [0x0,0x0,0x0,0x0]
UNIT Garcia  Fighter 0x1 0xA1  [12,27] 0b 0x0 0x0 0x0 [0x1F,0x64,0x88,0x0] [0x0,0x0,0x0,0x0]
UNIT Innes  0x1B 0x1 0xA1   [13,26] 0b 0x0 0x0 0x0 [0x2D,0x0,0x0,0x0] [0x0,0x0,0x0,0x0]
UNIT Lute  Sage_F 0x1 0xA1    [6,27] 0b 0x0 0x0 0x0 [0x38,0,0,0x0] [0x0,0x0,0x0,0x0]
UNIT Natasha  0x4A 0x1 0xA1 [14,27] 0b 0x0 0x0 0x0 [Heal,Lightning,0,0x0] [0x0,0x0,0x0,0x0]
UNIT Cormag  0x1F 0x1 0xA1  [14,25] 0b 0x0 0x0 0x0 [0x14,0x67,0x88,0x0] [0x0,0x0,0x0,0x0]
UNIT Forde 0x5 0x1 0xA1     [6,25] 0b 0x0 0x0 0x0 [0x14,0x65,0x88,0x0] [0x0,0x0,0x0,0x0]
UNIT Kyle 0x5 0x1 0xA1      [5,26] 0b 0x0 0x0 0x0 [0x14,0x65,0x88,0x0] [0x0,0x0,0x0,0x0]
UNIT

Units2:
UNIT Amelia Cavalier_F 0x1 0xA1   [11,26] 0b 0x0 0x0 0x0 [0x14,0x65,0x88,0x0] [0x0,0x0,0x0,0x0]
UNIT Artur Monk 0x1 0xA1    [12,26] 0b 0x0 0x0 0x0 [0x3F,0x68,0x88,0x0] [0x0,0x0,0x0,0x0]
UNIT Gerik Hero 0x1 0xA1     [13,26] 0b 0x0 0x0 0x0 [0x1,0x64,0x88,0x0] [0x0,0x0,0x0,0x0]
UNIT Tethys 0x4D 0x1 0xA1   [14,26] 0b 0x0 0x0 0x0 [0x0,0x0,0x0,0x0] [0x0,0x0,0x0,0x0]
UNIT Marisa Swordmaster_F 0x1 0xA1   [15,27] 0b 0x0 0x0 0x0 [0x1,0,0,0x0] [0x0,0x0,0x0,0x0]
UNIT Saleh 0x27 0x1 0xA1    [14,27] 0b 0x0 0x0 0x0 [0x38,0x0,0x0,0x0] [0x0,0x0,0x0,0x0]
UNIT Ewan Mage 0x1 0xA1     [13,27] 0b 0x0 0x0 0x0 [0x38,0x68,0x88,0x0] [0x0,0x0,0x0,0x0]
UNIT LArachel 0x4B 0x1 0xA1 [12,27] 0b 0x0 0x0 0x0 [0x68,0x88,Mend,0x0] [0x0,0x0,0x0,0x0]
UNIT Dozla 0x43 0x1 0xA1    [11,27] 0b 0x0 0x0 0x0 [0x1F,0x0,0x0,0x0] [0x0,0x0,0x0,0x0]
UNIT Rennac 0x33 0x1 0xA1   [10,27] 0b 0x0 0x0 0x0 [0x1,0x0,0x0,0x0] [0x0,0x0,0x0,0x0]
UNIT Duessel 0x35 0x1 0xA1  [9,27] 0b 0x0 0x0 0x0 [0x1,0x0,0x0,0x0] [0x0,0x0,0x0,0x0]
UNIT Myrrh 0x3C 0x1 0xA1    [7,27] 0b 0x0 0x0 0x0 [0xAA,0x0,0x0,0x0] [0x0,0x0,0x0,0x0]
UNIT Knoll 0x2D 0x1 0xA1    [6,27] 0b 0x0 0x0 0x0 [0x45,0x68,0x88,0x0] [0x0,0x0,0x0,0x0]
UNIT Joshua 0x13 0x1 0xA1   [9,28] 0b 0x0 0x0 0x0 [0x1,0x64,0x88,0x0] [0x0,0x0,0x0,0x0]
UNIT Syrene 0x49 0x1 0xA1   [13,28] 0b 0x0 0x0 0x0 [0x14,0x0,0x0,0x0] [0x0,0x0,0x0,0x0]
UNIT Tana 0x48 0x1 0xA1     [14,28] 0b 0x0 0x0 0x0 [0x14,0x67,0x88,0x0] [0x0,0x0,0x0,0x0]
// UNIT Orson_Ch5x 0x7 0x1 0xA1 [9,5] 0b 0x0 0x0 0x0 [0x14,0x0,0x0,0x0] [0x0,0x0,0x0,0x0]
UNIT

MoreUnits:
UNIT CaellachCC 0x11 0x1 0xA1 [18,28] 0b 0x0 0x0 0x0 [0x21,0x29,0x7C,0x0] [0x0,0x0,0x0,0x0]
UNIT GlenCC 0x21 0x1 0xA1     [17,29] 0b 0x0 0x0 0x0 [0x17,0x4,0x75,0x0] [0x0,0x0,0x0,0x0]
UNIT OrsonCC 0x07 0x1 0xA1    [19,29] 0b 0x0 0x0 0x0 [0x11,0x17,0x76,0x0] [0x0,0x0,0x0,0x0]
UNIT ValterCC 0x23 0x1 0xA1   [16,30] 0b 0x0 0x0 0x0 [0x17,0x1D,0x71,0x0] [0x0,0x0,0x0,0x0]
UNIT RievCC 0x2B 0x1 0xA1     [18,30] 0b 0x0 0x0 0x0 [0x43,0x42,0x75,0x0] [0x0,0x0,0x0,0x0]
UNIT HaydenCC 0x1D 0x1 0xA1   [15,31] 0b 0x0 0x0 0x0 [0x4,0x2F,0x74,0x0] [0x0,0x0,0x0,0x0]
UNIT FadoCC 0x0B 0x1 0xA1     [17,31] 0b 0x0 0x0 0x0 [0x4,0x17,0x21,0x88] [0x0,0x0,0x0,0x0]
UNIT IsmaireCC 0x16 0x1 0xA1  [19,31] 0b 0x0 0x0 0x0 [0xC,0xA1,0x88,0x0] [0x0,0x0,0x0,0x0]
UNIT SelenaCC 0x2A 0x1 0xA1   [16,28] 0b 0x0 0x0 0x0 [0x3B,0x3A,0x4D,0x0] [0x0,0x0,0x0,0x0]
UNIT LyonCC 0x4F 0x1 0xA1     [18,32] 0b 0x0 0x0 0x0 [0x8F,0x4E,0x57,0x0] [0x0,0x0,0x0,0x0]
UNIT

EnemyUnits:
UNIT Morva_Ch20 0x3B 0x40 0xA5    [15,2] 0b 0x0 0x0 0x0 [WretchedAir,0x0,0x0,0x0] AttackInRangeAI
UNIT ONeill Fighter 0x40 0xA5     [8,19] 0b 0x0 0x0 0x0 [SteelAxe, HandAxe] AttackInRangeAI
UNIT Breguet Knight 0x40 0xA5     [7,20] 0 0 0 0 [SteelLance, Javelin] AttackInRangeAI
UNIT Bone Brigand 0x40 0xA5       [9,20] 0 0 0 0 [SteelAxe, HandAxe] AttackInRangeAI
UNIT Bazba Brigand 0x40 0xA5      [16,18] 0 0 0 0 [SteelAxe, HandAxe] AttackInRangeAI
UNIT Saar Knight 0x40 0xA5        [8,15] 0 0 0 0 [SteelLance, Javelin] AttackInRangeAI
UNIT Novala Shaman 0x40 0xA5      [12,13] 0 0 0 0 [Nosferatu] AttackInRangeAI
UNIT Murray Cavalier 0x40 0xA5    [3,13] 0 0 0 0 [SteelSword, Javelin] AttackInRangeAI
UNIT Tirado General 0x40 0xA5     [16,9] 0 0 0 0 [SilverLance, Javelin] AttackInRangeAI
UNIT Binks Warrior 0x40 0xA5      [1,10] 0 0 0 0 [SteelAxe, SteelBow] AttackInRangeAI
UNIT Pablo Sage 0x40 0xA5         [5,11] 0 0 0 0 [Elfire, Purge] AttackInRangeAI
UNIT

EnemyUnits2:
UNIT Vigarde General 0x40 0xA5    [10,2] 0 0 0 0 [Spear, SilverBlade, Tomahawk] NeverMoveAI
UNIT Cyclops_boss Cyclops 0x40 0xA5       [9,4] 0 0 0 0 [BattleAxe, Tomahawk] AttackInRangeAI
UNIT Cyclops_boss Cyclops 0x40 0xA5       [11,4] 0 0 0 0 [BattleAxe, Tomahawk] AttackInRangeAI
UNIT Aias GreatKnight 0x40 0xA5   [7,11] 0 0 0 0 [ShortSpear, SilverBlade, SilverAxe] AttackInRangeAI
UNIT Carlyle Swordmaster 0x40 0xA5 [10,9] 0 0 0 0 [WindSword] AttackInRangeAI
UNIT Gheb Warrior 0x40 0xA5       [2,4] 0 0 0 0 [KillerAxe, KillerBow] NeverMoveAI
UNIT Beran Ranger 0x40 0xA5       [17,14] 0 0 0 0 [Lancereaver, KillerBow, Longbow] AttackInRangeAI
UNIT

Traps1:
Vein(9,23,0x0,DV1Desc) //freeze enemies
ENDTRAP
ALIGN 4

Traps2:
ENDTRAP
ALIGN 4

BeginningScene:
ENUT 0x1 //no more boss quotes
ENUT 0x2 //no more death quotes
LOAD1 0x1 EnemyUnits
ENUN
LOAD1 0x1 EnemyUnits2
ENUN
LOAD1 0x0 Units1 //0x0 instead of 0x1 seems to be for allies on maps with prep screens
ENUN
LOAD1 0x0 Units2
ENUN
LOAD1 0x0 MoreUnits
ENUN
// FADI 10
// MOVE 0 Carlyle [7,10]
// ENUN
//   StartBattle //scripted fight setup
//   MissedAttack(0,0) //Seth misses
//   NormalDamage(1,0) //Valter hits
//   EndAttack
// FIG1 Carlyle Aias 0
// STAL 60
// FADU 10
GotoPrepScreen

EndingScene:
ASMC 0x85C71 0x381F5 0x37CF9 //show records screen
STAL 120
EVBIT_F 0x2
MNTS 0x1 //return to title screen
NoFade
ENDA

VillageEvent:
	VillageEventItem(VillageText, Village, Boots)

HouseEvent:
	// Set parameters
	SVAL r1 NiceThighsID
	SVAL r2 (-1) // (-1) is active unit
	
	// Check if unit has skill
	// If they have, goto label #0 (end)
	ASMC (ASMC_HasSkill+1)
	BNE 0 rC r0
	
	// Learn skill to unit
	ASMC (ASMC_LearnNewSkill+1)
	
LABEL 0
	// end
	
	Text(HouseText)
	
	NoFade
	ENDA
	
	// HouseEvent(HouseText, HouseBG)

FreezeAllEnemies:
VeinActivation
ASMC FreezeAllASMC|1
NoFade
ENDA

TalkEvent:
Text(0xc0a)
NoFade
ENDA

ShopItems:
SHLI Thunder Elfire Nosferatu Divine Mend Physic PureWater Elixir
ALIGN 4

ArmoryItems:
SHLI SteelAxe SteelLance SteelBow SteelSword HandAxe Javelin
ALIGN 4

Has anyone made distant and close counter?

There is Point Blank, which fulfills the same basic purpose as Close Counter.
I don’t think anyone has made DC, and it would be tricky with some things like siege tomes or non-ranged axes due to the way hand axe animations work.

1 Like

Maybe have units that equip axes use Hand Axe animations if attacked from 2 or more spaces away (with the spell animation set to Hand Axe), and normal axe animations if attacked from 1 space away? Is that possible?

is accost from jugdral a thing someone already made?

I have made icons for Close and Distant Counter

Accost is the only FE4/5 skill not in skill system currently

1 Like

Well, dang. Guess I will have to do without for now.

I meant the actual skill, not the icon

Thanks to @MeatOfJustice for the idea and the documentation made by those involved in creating ArmorMarch (esspecially @P33RL355 and @Leonarth) QuickBurn, and of course @Tequila for his dropbox documentation.

I made the Boar Tactics skill because I thought it was pretty neat.

.thumb
.equ BoarTacticsID, SkillTester+4
.equ ChapterIDs, BoarTacticsID+4

push {r4-r5, lr}
mov	r4, r0 @attacker

@check if current chapter should activate
ldr	r5,=#0x202BCF0		@Chapter data struct
ldr r0,ChapterIDs		@Load chapter ids that activate skill
ldrh r5, [r5,#0x0E]		@Get current chapter ID
chapterLoop:
ldrb r1,[r0]			@Load first skill that activates
cmp	r1,#0x4f			@Check if at end of list
beq	End 				@Chapter not a rout map
cmp	r1,r5 				@See if equal to current chapter id
beq	chapterFound		@Found chapter
add	r0,#1 				@Otherwise increment
b	chapterLoop

@has skill
chapterFound:
ldr	r0, SkillTester
mov	lr, r0
mov	r0, r4
ldr	r1, BoarTacticsID
.short	0xf800
cmp	r0, #0
beq	End

@Add 15 to hit
mov	r0, #0x60
ldrh	r1, [r4,r0]	@load hit
add	r1, #0x0F	@add 15 to hit
strh	r1, [r4,r0]     @store

@Add 10 to crit
mov	r0, #0x66
ldrh	r1, [r4,r0]	@load crit
add	r1, #0x0A	@add 10 to crit
strh	r1, [r4,r0]     @store

End:
pop	{r4-r5, r15}
.align
.ltorg
SkillTester:
@Poin SkillTester
@WORD BoarTacticsID
@Poin ChapterIDs

Skill Description:

## SD_BoarTactics
Boar Tactics: If objective is[N]
Rout, +15 Hit and +10 Crit.[X]

For PreBattleSkills.event

ALIGN 4
BoarTactics:
#incbin "BoarTactics/BoarTactics.dmp"
POIN SkillTester
WORD BoarTacticsID
POIN BoarTacticsChapterList

// Ends on 0x4f as 0x0 is the prologue and 0x4f is last chapter in list

BoarTacticsChapterList:
BYTE 0x0 0x6 0x4f

It’s based off of the chapter ID rather than the mission goal text as I feel the chapter ID is more flexible and, unless I missed it, the chapter data struct doesn’t contain the goal information text ID.

Because chapter ID 0x0 is the prologue, the end byte for the list is 0x4f, as 0x4e is the last byte in the chapter data table editor. You can increase that value if you want.

The instructions above for installation aren’t as complete as they probably should be, but at the same time I figure anyone who would add this skill would already need to know all the steps involved in adding a new skill. If you have any questions, comments, or concerns please let me know.

2 Likes

Don’t forget to add BoarTactics to the Pre-Battle Calc Loop in the Internals :OOO

1 Like

I requested Armor March to be put into the skill system (praise Leonarth) do I get any thanks

2 Likes

A list works (although I’d use 0x00 or 0xFF as a terminator rather than a valid chapter id), but you could also check if byte 0x8C in the chapter data table is 0x01. If it is, the game displays the number of enemies left in the goal window.

2 Likes

Just wondering is it possible to make a warp skill used by Witches like in FE 2/14/15 and Coral Cover (doubles terrain effect) from FE15.

Coral Cover shouldn’t be hard. But nobody has made teleportation Skills yet.

iirc Witch teleport in FE15 is tied to their AI, it’s not an actual skill in the typical sense.

It looks like Triangle Adept doesn’t affect def/avoid for the advantageous character since those are technically counted as -attack/-hit for the disadvantageous character. Is there an easy way to fix this? I’d like it to have more of an effect defensively as well as offensively, like in Heroes.

I was thinking more in terms of the fates DLC which gives you warp. I realize this was probably not possible but it never hurts to ask.