#library "EXTRAI"
#include "zcommon.acs"

Script "just gonne leave this here for now" (void) {}


script "TrueDarkEnragedLegendaryRuneRagePower" (void)
{
    while (true)
    {
        Delay(35 * 60); 

        int x = GetActorX(0);
        int y = GetActorY(0);
        int z = GetActorZ(0);
        int angle = GetActorAngle(0);

        SpawnForced("TrueDarkEnragedLegendaryRuneRageEffect", x, y, z, 0, angle);
    }
}

script "TrueDarkLegendaryRuneHealPower" (void)
{
    while (true)
    {
        Delay(35 * 50); 

        int x = GetActorX(0);
        int y = GetActorY(0);
        int z = GetActorZ(0);
        int angle = GetActorAngle(0);

        SpawnForced("TrueDarkLegendaryRuneHealEffect", x, y, z, 0, angle);
    }
}

Script "INFGODSRespawnRunes" RESPAWN 
{
If(CheckInventory("ZamasuRuneCheck")) GiveInventory("ZamasuRuneResistance",1); GiveInventory("ZamasuRuneSpeed",1); GiveInventory("ZamasuRuneDamage",1);
If(CheckInventory("ZamasuGodRuneCheck")) GiveInventory("ZamasuRuneResistance",1); GiveInventory("ZamasuRuneSpeed",1); GiveInventory("ZamasuGodRuneDamage",1); GiveInventory("PermanentSphereOfPower",1);
If(CheckInventory("HellFireRuneCheck")) GiveInventory("HellFireRuneResistance",1); GiveInventory("HellfireRuneDamage",1);
If(CheckInventory("TrueDarkLegendaryRuneCheck")) ACS_NamedExecuteAlways("TrueDarkLegendaryRuneHealPower", 0);
If(CheckInventory("TrueDarkEnragedLegendaryRuneCheck")) ACS_NamedExecuteAlways("TrueDarkEnragedLegendaryRuneRagePower", 0);
}

script "INFGODSEnterRunes" ENTER
{
    if (CheckInventory("ZamasuRuneCheck"))
    {
        GiveInventory("ZamasuRuneResistance", 1);
        GiveInventory("ZamasuRuneSpeed", 1);
		GiveInventory("ZamasuRuneDamage", 1);
    }

    if (CheckInventory("ZamasuGodRuneCheck"))
    {
        GiveInventory("ZamasuRuneResistance", 1);
        GiveInventory("ZamasuRuneSpeed", 1);
        GiveInventory("ZamasuGodRuneDamage", 1);
        GiveInventory("PermanentSphereOfPower", 1);
    }

    if (CheckInventory("HellFireRuneCheck"))
    {
        GiveInventory("HellFireRuneResistance", 1);
        GiveInventory("HellfireRuneDamage", 1);
    }
	 if (CheckInventory("TrueDarkLegendaryRuneCheck"))
    {
        ACS_NamedExecuteAlways("TrueDarkLegendaryRuneHealPower", 0);
    }
	if (CheckInventory("TrueDarkEnragedLegendaryRuneCheck"))
    {
        ACS_NamedExecuteAlways("TrueDarkEnragedLegendaryRuneRagePower", 0);
    }
}

script "Check Runes" DEATH 
{
  if (CheckInventory("ZamasuRuneCheck")) { TakeInventory("ZamasuRuneCheck",1); TakeInventory("ZamasuRuneItem",1); DropItem(0,"ZamasuRune",1,256); } 
  if (CheckInventory("ZamasuGodRuneCheck")) { TakeInventory("ZamasuGodRuneCheck",1); TakeInventory("ZamasuGodRuneItem",1); DropItem(0,"ZamasuGodRune",1,256); } 
  if (CheckInventory("HellFireRuneCheck")) { TakeInventory("HellFireRuneCheck",1); TakeInventory("HellFireRuneItem",1); DropItem(0,"HellFireRune",1,256); } 
  if (CheckInventory("TrueDarkLegendaryRuneCheck")) { TakeInventory("TrueDarkLegendaryRuneCheck",1); TakeInventory("TrueDarkLegendaryRuneItem",1); DropItem(0,"TrueDarkLegendaryRune",1,256); } 
  if (CheckInventory("TrueDarkEnragedLegendaryRuneCheck")) { TakeInventory("TrueDarkEnragedLegendaryRuneCheck",1); TakeInventory("TrueDarkEnragedLegendaryRuneItem",1); DropItem(0,"TrueDarkEnragedLegendaryRune",1,256); } 
}


/*
script "Check Runes" DEATH 
{
  if (CheckInventory("ZamasuRuneCheck")) TakeInventory("ZamasuRuneCheck",1); DropItem(0,"ZamasuRune",1,256);
  if (CheckInventory("ZamasuGodRuneCheck")) TakeInventory("ZamasuGodRuneCheck",1); DropItem(0,"ZamasuGodRune",1,256);
  if (CheckInventory("HellFireRuneCheck")) TakeInventory("HellFireRuneCheck",1); DropItem(0,"HellFireRune",1,256);
  if (CheckInventory("TrueDarkLegendaryRuneCheck")) TakeInventory("TrueDarkLegendaryRuneCheck",1); DropItem(0,"TrueDarkLegendaryRune",1,256);
  if (CheckInventory("TrueDarkEnragedLegendaryRuneCheck")) TakeInventory("TrueDarkEnragedLegendaryRuneCheck",1); DropItem(0,"TrueDarkEnragedLegendaryRune",1,256);
}
*/

str EnragedExosName[2] = { "\c[m6]Enraged\c- \c[z3]Legendary Exos\c- \c[m6]MKII\c-"};
int EnragedExosHealth[2] = {16000};

Script "EnragedExosUpgrade" (int tier)
{
  int UTimer;
  delay(25);
  while (UTimer < 100)
  {
    PrintBold(s:"Enraged Legendary Exos Augmentation: ", d:UTimer, s:"% complete");
	delay(35);
	//UTimer = Utimer+Random(3,5);
	UTimer = Utimer+Random(9,18);
  }
  PrintBold(s:"Enraged Legendary Exos Augmentation : 100% complete");
  SetActorProperty(0,APROP_Health,EnragedExosHealth[tier]);
  SetActorProperty(0,APROP_SpawnHealth,EnragedExosHealth[tier]);
  SetActorProperty(0,APROP_NameTag,EnragedExosName[tier]);
  SetActorState(0,"UpgradeEnd");
  delay(35);
  PrintBold(s:"");
  terminate;
}
