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

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


script "HellfireBurnPower" (void)
{
    while (true)
    {
        Delay(35 * 20); // espera 20 segundos

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

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


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); ACS_NamedExecuteAlways("HellfireBurnPower", 0);
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);
        ACS_NamedExecuteAlways("HellfireBurnPower", 0);
    }
	 if (CheckInventory("TrueDarkLegendaryRuneCheck"))
    {
        ACS_NamedExecuteAlways("TrueDarkLegendaryRuneHealPower", 0);
    }
	if (CheckInventory("TrueDarkEnragedLegendaryRuneCheck"))
    {
        ACS_NamedExecuteAlways("TrueDarkEnragedLegendaryRuneRagePower", 0);
    }
}

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

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;
}
