At first, 'compact' script 604 like this:

Code: Select all

```
script 604 (int which)
{
switch(which)
{
case 1:
break;
case 2:
if(patchouliSpellcards>GameSkill()){
SetActorState(0,"DeathExplosion",1);
Delay(210);
Exit_Normal(0);
} else {
delay(56);
SetFont("BIGFONT");
ACS_Terminate(602,0);
HudMessageBold(s:"Spell Break!";HUDMSG_PLAIN,0,CR_WHITE,0.5,0.15,2.00);
patchouliSpellcards++;
}
break;
case 3:
break;
case 4:
if(patchouliSpellcards>GameSkill()){
SetActorState(0,"DeathExplosion",1);
Delay(210);
ACS_Execute(104,0);
}
else {
delay(56);
SetFont("BIGFONT");
ACS_Terminate(602,0);
HudMessageBold(s:"Spell Break!";HUDMSG_PLAIN,0,CR_WHITE,0.5,0.15,2.00);
patchouliSpellcards++;
}
break;
}
}
```

At second, add OPEN script like this (it will work on any level, but will matter only on Patchouli's one):

Code: Select all

```
script 31337 OPEN
{
patchouliFight = random(1,5);
}
```

And script like this (I prefer named scripts, but you may, of course, use generic scripts):

Code: Select all

```
script "PatchouliFightNum" (void)
{
SetResultValue(patchouliFight);
}
```

And then, according to following attack transition table,

Code: Select all

```
NS1->AS->NS2->RT->FB->EM->WE
NS1->PU->NS2->SH->MP->FB->EM
NS1->SH->NS2->AS->WE->LC->MP
NS1->RT->NS2->MF->LC->MP->FB
NS1->MF->NS2->PU->EM->WE->LC
```

I removed Death states from PatchouliSpellcard and PatchouliSpellcard2, and modified Death states of each other Patchouli actor.

Patchouli:

Code: Select all

```
Death:
TNT1 A 0 ACS_NamedTerminate("BHI_BossStartAttack",0)
TNT1 A 0 ACS_NamedExecute("BHI_BossStopAttack",0)
PTCH A 0 A_GiveInventory("BulletDeathTrigger",1)
PTCH A 0 ACS_Execute(604,0,1)
PTCH A 0 A_JumpIf(ACS_NamedExecuteWithResult("PatchouliFightNum",0) == 1,"Death1")
PTCH A 0 A_JumpIf(ACS_NamedExecuteWithResult("PatchouliFightNum",0) == 2,"Death2")
PTCH A 0 A_JumpIf(ACS_NamedExecuteWithResult("PatchouliFightNum",0) == 3,"Death3")
PTCH A 0 A_JumpIf(ACS_NamedExecuteWithResult("PatchouliFightNum",0) == 4,"Death4")
PTCH A 0 A_JumpIf(ACS_NamedExecuteWithResult("PatchouliFightNum",0) == 5,"Death5")
Death1:
PTCH ABCDEFGHIJKLM 2 A_FadeOut(0.075)
TNT1 A 0 A_ChangeFlag("SOLID", FALSE)
TNT1 A 30
PTCH A 0 A_SpawnItemEx("PatchouliAgniShine", 0, 0, 0, 0, 0, 0, 0, SXF_TELEFRAG, 0, 0)
Stop
Death2:
PTCH ABCDEFGHIJKLM 2 A_FadeOut(0.075)
TNT1 A 0 A_ChangeFlag("SOLID", FALSE)
TNT1 A 30
PTCH A 0 A_SpawnItemEx("PatchouliPrincessUndine", 0, 0, 0, 0, 0, 0, 0, SXF_TELEFRAG, 0, 0)
Stop
Death3:
PTCH ABCDEFGHIJKLM 2 A_FadeOut(0.075)
TNT1 A 0 A_ChangeFlag("SOLID", FALSE)
TNT1 A 30
PTCH A 0 A_SpawnItemEx("PatchouliSylphaeHorn", 0, 0, 0, 0, 0, 0, 0, SXF_TELEFRAG, 0, 0)
Stop
Death4:
PTCH ABCDEFGHIJKLM 2 A_FadeOut(0.075)
TNT1 A 0 A_ChangeFlag("SOLID", FALSE)
TNT1 A 30
PTCH A 0 A_SpawnItemEx("PatchouliRageTrilithon", 0, 0, 0, 0, 0, 0, 0, SXF_TELEFRAG, 0, 0)
Stop
Death5:
PTCH ABCDEFGHIJKLM 2 A_FadeOut(0.075)
TNT1 A 0 A_ChangeFlag("SOLID", FALSE)
TNT1 A 30
PTCH A 0 A_SpawnItemEx("PatchouliMetalFatigue", 0, 0, 0, 0, 0, 0, 0, SXF_TELEFRAG, 0, 0)
Stop
```

PatchouliNS2 (note different sub-states order, and parameter of script 604):

Code: Select all

```
Death:
TNT1 A 0 ACS_NamedTerminate("BHI_BossStartAttack",0)
TNT1 A 0 ACS_NamedExecute("BHI_BossStopAttack",0)
PTCH A 0 A_GiveInventory("BulletDeathTrigger",1)
PTCH A 0 ACS_Execute(604,0,3)
PTCH A 0 A_JumpIf(ACS_NamedExecuteWithResult("PatchouliFightNum",0) == 1,"Death1")
PTCH A 0 A_JumpIf(ACS_NamedExecuteWithResult("PatchouliFightNum",0) == 2,"Death2")
PTCH A 0 A_JumpIf(ACS_NamedExecuteWithResult("PatchouliFightNum",0) == 3,"Death3")
PTCH A 0 A_JumpIf(ACS_NamedExecuteWithResult("PatchouliFightNum",0) == 4,"Death4")
PTCH A 0 A_JumpIf(ACS_NamedExecuteWithResult("PatchouliFightNum",0) == 5,"Death5")
Death3:
PTCH ABCDEFGHIJKLM 2 A_FadeOut(0.075)
TNT1 A 0 A_ChangeFlag("SOLID", FALSE)
TNT1 A 30
PTCH A 0 A_SpawnItemEx("PatchouliAgniShine", 0, 0, 0, 0, 0, 0, 0, SXF_TELEFRAG, 0, 0)
Stop
Death5:
PTCH ABCDEFGHIJKLM 2 A_FadeOut(0.075)
TNT1 A 0 A_ChangeFlag("SOLID", FALSE)
TNT1 A 30
PTCH A 0 A_SpawnItemEx("PatchouliPrincessUndine", 0, 0, 0, 0, 0, 0, 0, SXF_TELEFRAG, 0, 0)
Stop
Death2:
PTCH ABCDEFGHIJKLM 2 A_FadeOut(0.075)
TNT1 A 0 A_ChangeFlag("SOLID", FALSE)
TNT1 A 30
PTCH A 0 A_SpawnItemEx("PatchouliSylphaeHorn", 0, 0, 0, 0, 0, 0, 0, SXF_TELEFRAG, 0, 0)
Stop
Death1:
PTCH ABCDEFGHIJKLM 2 A_FadeOut(0.075)
TNT1 A 0 A_ChangeFlag("SOLID", FALSE)
TNT1 A 30
PTCH A 0 A_SpawnItemEx("PatchouliRageTrilithon", 0, 0, 0, 0, 0, 0, 0, SXF_TELEFRAG, 0, 0)
Stop
Death4:
PTCH ABCDEFGHIJKLM 2 A_FadeOut(0.075)
TNT1 A 0 A_ChangeFlag("SOLID", FALSE)
TNT1 A 30
PTCH A 0 A_SpawnItemEx("PatchouliMetalFatigue", 0, 0, 0, 0, 0, 0, 0, SXF_TELEFRAG, 0, 0)
Stop
```

Other 10 spell cards:

PatchouliAgniShine:

Code: Select all

```
Death:
TNT1 A 0 ACS_NamedTerminate("BHI_BossStartAttack",0)
TNT1 A 0 ACS_NamedExecute("BHI_BossStopAttack",0)
PTCH A 0 A_GiveInventory("BulletDeathTrigger",1)
PTCH A 0 ACS_Execute(603)
PTCH A 0 ACS_Execute(604,0,2)
PTCH A 0 A_JumpIf(ACS_NamedExecuteWithResult("PatchouliFightNum",0) == 3,"Death3")
PTCH ABCDEFGHIJKLM 2 A_FadeOut(0.075)
TNT1 A 0 A_ChangeFlag("SOLID", FALSE)
TNT1 A 30
PTCH A 0 A_SpawnItemEx("PatchouliNS2", 0, 0, 0, 0, 0, 0, 0, SXF_TELEFRAG, 0, 0)
Stop
Death3:
PTCH ABCDEFGHIJKLM 2 A_FadeOut(0.075)
TNT1 A 0 A_ChangeFlag("SOLID", FALSE)
TNT1 A 30
PTCH A 0 A_SpawnItemEx("PatchouliWaterElf", 0, 0, 0, 0, 0, 0, 0, SXF_TELEFRAG, 0, 0)
Stop
```

PatchouliPrincessUndine:

Code: Select all

```
Death:
TNT1 A 0 ACS_NamedTerminate("BHI_BossStartAttack",0)
TNT1 A 0 ACS_NamedExecute("BHI_BossStopAttack",0)
PTCH A 0 A_GiveInventory("BulletDeathTrigger",1)
PTCH A 0 ACS_Execute(603)
PTCH A 0 ACS_Execute(604,0,2)
PTCH A 0 A_JumpIf(ACS_NamedExecuteWithResult("PatchouliFightNum",0) == 5,"Death5")
PTCH ABCDEFGHIJKLM 2 A_FadeOut(0.075)
TNT1 A 0 A_ChangeFlag("SOLID", FALSE)
TNT1 A 30
PTCH A 0 A_SpawnItemEx("PatchouliNS2", 0, 0, 0, 0, 0, 0, 0, SXF_TELEFRAG, 0, 0)
Stop
Death5:
PTCH ABCDEFGHIJKLM 2 A_FadeOut(0.075)
TNT1 A 0 A_ChangeFlag("SOLID", FALSE)
TNT1 A 30
PTCH A 0 A_SpawnItemEx("PatchouliEmeraldMegalith", 0, 0, 0, 0, 0, 0, 0, SXF_TELEFRAG, 0, 0)
Stop
```

PatchouliSylphaeHorn:

Code: Select all

```
Death:
TNT1 A 0 ACS_NamedTerminate("BHI_BossStartAttack",0)
TNT1 A 0 ACS_NamedExecute("BHI_BossStopAttack",0)
PTCH A 0 A_GiveInventory("BulletDeathTrigger",1)
PTCH A 0 ACS_Execute(603)
PTCH A 0 ACS_Execute(604,0,2)
PTCH A 0 A_JumpIf(ACS_NamedExecuteWithResult("PatchouliFightNum",0) == 2,"Death2")
PTCH ABCDEFGHIJKLM 2 A_FadeOut(0.075)
TNT1 A 0 A_ChangeFlag("SOLID", FALSE)
TNT1 A 30
PTCH A 0 A_SpawnItemEx("PatchouliNS2", 0, 0, 0, 0, 0, 0, 0, SXF_TELEFRAG, 0, 0)
Stop
Death2:
PTCH ABCDEFGHIJKLM 2 A_FadeOut(0.075)
TNT1 A 0 A_ChangeFlag("SOLID", FALSE)
TNT1 A 30
PTCH A 0 A_SpawnItemEx("PatchouliMercuryPoison", 0, 0, 0, 0, 0, 0, 0, SXF_TELEFRAG, 0, 0)
Stop
```

PatchouliRageTrilithon:

Code: Select all

```
Death:
TNT1 A 0 ACS_NamedTerminate("BHI_BossStartAttack",0)
TNT1 A 0 ACS_NamedExecute("BHI_BossStopAttack",0)
PTCH A 0 A_GiveInventory("BulletDeathTrigger",1)
PTCH A 0 ACS_Execute(603)
PTCH A 0 ACS_Execute(604,0,2)
PTCH A 0 A_JumpIf(ACS_NamedExecuteWithResult("PatchouliFightNum",0) == 1,"Death1")
PTCH ABCDEFGHIJKLM 2 A_FadeOut(0.075)
TNT1 A 0 A_ChangeFlag("SOLID", FALSE)
TNT1 A 30
PTCH A 0 A_SpawnItemEx("PatchouliNS2", 0, 0, 0, 0, 0, 0, 0, SXF_TELEFRAG, 0, 0)
Stop
Death1:
PTCH ABCDEFGHIJKLM 2 A_FadeOut(0.075)
TNT1 A 0 A_ChangeFlag("SOLID", FALSE)
TNT1 A 30
PTCH A 0 A_SpawnItemEx("PatchouliForestBlaze", 0, 0, 0, 0, 0, 0, 0, SXF_TELEFRAG, 0, 0)
Stop
```

PatchouliMetalFatigue:

Code: Select all

```
Death:
PTCH A 0 A_GiveInventory("EnemyCounter4",1) // It was in original spell card
TNT1 A 0 ACS_NamedTerminate("BHI_BossStartAttack",0)
TNT1 A 0 ACS_NamedExecute("BHI_BossStopAttack",0)
PTCH A 0 A_GiveInventory("BulletDeathTrigger",1)
PTCH A 0 ACS_Execute(603)
PTCH A 0 ACS_Execute(604,0,2)
PTCH A 0 A_JumpIf(ACS_NamedExecuteWithResult("PatchouliFightNum",0) == 4,"Death4")
PTCH ABCDEFGHIJKLM 2 A_FadeOut(0.075)
TNT1 A 0 A_ChangeFlag("SOLID", FALSE)
TNT1 A 30
PTCH A 0 A_SpawnItemEx("PatchouliNS2", 0, 0, 0, 0, 0, 0, 0, SXF_TELEFRAG, 0, 0)
Stop
Death4:
PTCH ABCDEFGHIJKLM 2 A_FadeOut(0.075)
TNT1 A 0 A_ChangeFlag("SOLID", FALSE)
TNT1 A 30
PTCH A 0 A_SpawnItemEx("PatchouliLavaCromlech", 0, 0, 0, 0, 0, 0, 0, SXF_TELEFRAG, 0, 0)
Stop
```

PatchouliWaterElf:

Code: Select all

```
Death:
TNT1 A 0 ACS_NamedTerminate("BHI_BossStartAttack",0)
TNT1 A 0 ACS_NamedExecute("BHI_BossStopAttack",0)
PTCH A 0 A_GiveInventory("BulletDeathTrigger",1)
PTCH A 0 ACS_Execute(603)
PTCH A 0 ACS_Execute(604,0,4)
PTCH ABCDEFGHIJKLM 2 A_FadeOut(0.075)
TNT1 A 0 A_ChangeFlag("SOLID", FALSE)
TNT1 A 30
PTCH A 0 A_SpawnItemEx("PatchouliLavaCromlech", 0, 0, 0, 0, 0, 0, 0, SXF_TELEFRAG, 0, 0)
Stop
```

PatchouliEmeraldMegalith:

Code: Select all

```
Death:
TNT1 A 0 ACS_NamedTerminate("BHI_BossStartAttack",0)
TNT1 A 0 ACS_NamedExecute("BHI_BossStopAttack",0)
PTCH A 0 A_GiveInventory("BulletDeathTrigger",1)
PTCH A 0 ACS_Execute(603)
PTCH A 0 ACS_Execute(604,0,4)
PTCH ABCDEFGHIJKLM 2 A_FadeOut(0.075)
TNT1 A 0 A_ChangeFlag("SOLID", FALSE)
TNT1 A 30
PTCH A 0 A_SpawnItemEx("PatchouliWaterElf", 0, 0, 0, 0, 0, 0, 0, SXF_TELEFRAG, 0, 0)
Stop
```

PatchouliMercuryPoison:

Code: Select all

```
Death:
TNT1 A 0 ACS_NamedTerminate("BHI_BossStartAttack",0)
TNT1 A 0 ACS_NamedExecute("BHI_BossStopAttack",0)
PTCH A 0 A_GiveInventory("BulletDeathTrigger",1)
PTCH A 0 ACS_Execute(603)
PTCH A 0 ACS_Execute(604,0,4)
PTCH ABCDEFGHIJKLM 2 A_FadeOut(0.075)
TNT1 A 0 A_ChangeFlag("SOLID", FALSE)
TNT1 A 30
PTCH A 0 A_SpawnItemEx("PatchouliForestBlaze", 0, 0, 0, 0, 0, 0, 0, SXF_TELEFRAG, 0, 0)
Stop
```

PatchouliForestBlaze:

Code: Select all

```
Death:
TNT1 A 0 ACS_NamedTerminate("BHI_BossStartAttack",0)
TNT1 A 0 ACS_NamedExecute("BHI_BossStopAttack",0)
PTCH A 0 A_GiveInventory("BulletDeathTrigger",1)
PTCH A 0 ACS_Execute(603)
PTCH A 0 ACS_Execute(604,0,4)
PTCH ABCDEFGHIJKLM 2 A_FadeOut(0.075)
TNT1 A 0 A_ChangeFlag("SOLID", FALSE)
TNT1 A 30
PTCH A 0 A_SpawnItemEx("PatchouliEmeraldMegalith", 0, 0, 0, 0, 0, 0, 0, SXF_TELEFRAG, 0, 0)
Stop
```

PatchouliLavaCromlech:

Code: Select all

```
Death:
TNT1 A 0 ACS_NamedTerminate("BHI_BossStartAttack",0)
TNT1 A 0 ACS_NamedExecute("BHI_BossStopAttack",0)
PTCH A 0 A_GiveInventory("BulletDeathTrigger",1)
PTCH A 0 ACS_Execute(603)
PTCH A 0 ACS_Execute(604,0,4)
PTCH ABCDEFGHIJKLM 2 A_FadeOut(0.075)
TNT1 A 0 A_ChangeFlag("SOLID", FALSE)
TNT1 A 30
PTCH A 0 A_SpawnItemEx("PatchouliMercuryPoison", 0, 0, 0, 0, 0, 0, 0, SXF_TELEFRAG, 0, 0)
Stop
```

Please note that I did this editions before I fixed the first issue; so some frame durations there are equal to 0, but should be changed to 1 as I said before.