void KrakenAttack(aref rCharacter, int iSwimQuantity)
// Character and number of tentacles
{
if (!bSeaActive) return;
ref pchar = GetMainCharacter();
int delay = 0;
for (int i=0; i < iSwimQuantity; i++)
{
PostEvent("CreateKrakenTentacle", delay, "i", rCharacter);
delay = delay + rand(1000);
}
if(IsMainCharacter(rCharacter)) LogIt("Captain, we're being attacked by the Kraken!");
else
{
LogIt("Captain, the " + rCharacter.ship.name + " is under attack by the Kraken!");
pchar.KrakenAttack = true;
}
PostEvent("KrakenAttackFinished", delay, "i", rCharacter);
}
#event_handler("KrakenAttackFinished", "FinishKrakenAttack");
void FinishKrakenAttack()
{
ref pchar = GetMainCharacter();
aref rCharacter = GetEventData();
LogIt("Captain, the Kraken has finished its attack on the " + rCharacter.ship.name + "!");
if(CheckAttribute(pchar, "KrakenAttack")) PostEvent("EnableKraken", 5*60*1000);
}