Yiga Clan member spawns

Revision as of 18:15, 31 December 2018 by imported>Leoetlino (→‎Condition 3: AutoPlacementMgr)

Yiga Clan members are spawned by two different systems.

Some are statically spawned by PlacementMgr, which means that they are listed in map units and visible on the object map. However, after Link completes enough main quests, most Yiga Clan members the player sees are actually dynamically spawned by AutoPlacementMgr.

Static

Traveler (disguised Yigas)

These are linked to 'Link' tags that make them spawn if and only if the Electric_Relic_AssassinFirst flag (set when the Yiga Clan Hideout location text appears) or Npc_Kakariko001_TalkEnd (set after talking to Impa) flag is set.

Near the hideout

The five non-disguised static Yiga clan members inside and near the hideout seem to be spawned unconditionally.

Dynamic

Other Yiga Clan members are not listed on the map. This is because they are dynamically spawned by a component called the AutoPlacement Manager. Unlike PlacementMgr, AutoPlacementMgr doesn't use map units to determine which actors to spawn. The current map area the player is in and various configuration files control whether Yiga enemies spawn or not.

Condition 1: AreaData

Just like other auto-generated actors, Enemy_Assassin_Shooter_Junior or Enemy_Assassin_Middle must be listed in an area's auto-generated enemies for Yiga Clan members to be spawned by AutoPlacementMgr.

Condition 2: Event flow

Just like other auto-generated actors, the AutoPlacement event flows for Enemy_Assassin_Shooter_Junior or Enemy_Assassin_Middle must call the CreateData action for them to be spawned.

The full set of conditions can be found here:

Condition 3: AutoPlacementMgr

This series of checks is specific to Yiga enemies and hardcoded in AutoPlacementMgr (in the executable).

If the Electric_Relic_GetBack flag is set, which happens when Link opens the Thunder Helm chest in the hideout and the quest log shows this message:

You retrieved the chief's heirloom from the
thieves' leader!

It's time to head back to Gerudo Town
and return the heirloom to Riju!

...then Blademasters are allowed to spawn. In this case, Footsoldiers carry a random weapon:

// probability: roughly 75%
if (sead::Random::getU32() / (U32_MAX+1) < 0.75)
  weapon = "Weapon_Sword_073"; // Demon Carver
else
  weapon = "Weapon_Sword_053"; // Vicious Sickle

Otherwise:

  • if Electric_Relic_AssassinFirst or Npc_Kakariko001_TalkEnd is set; and
  • if the enemy is Enemy_Assassin_Junior, or a disguised Yiga, and in possibly more cases[check]

then only Footsoldiers may be dynamically generated, and they will only wield Vicious Sickles.

Note: if Electric_Relic_GetBack is set, AIDef:Action/CreateAndReplaceAssassin will create Yiga enemy actors with the DropTable parameter set to "HighRank".