Code: Select all
void() flash_rune_on =
{
if ((self.owner.player_flag & ITEM_RUNE_MASK) && (self.lip < 11))
{
self.lip = (self.lip + 1.00);//lip is a counter for the flash
self.think = flash_rune_off;
self.nextthink = time + 0.1;
self.owner.items2 = (self.owner.items2 | self.cnt); //--toggle rune
}
else
{
remove(self);
}
}
void() flash_rune_off =
{
if ((self.owner.player_flag & ITEM_RUNE_MASK) && (self.lip < 10))
{
self.lip = (self.lip + 1.00); //--lip is a counter for the flash
self.think = flash_rune_on;
self.nextthink = time + 0.1;
self.owner.items2 = self.owner.items2 - (self.owner.items2 & self.cnt);//--toggle rune off
}
else
{
remove(self);
}
}
void(float sig) flash_rune_stat =
{
local entity flash;
flash = spawn();
flash.think = flash_rune_on;
flash.nextthink = time + 0.1;
flash.cnt = sig;//remember the rune we have
flash.owner = self;
};
then for example call flash like this
void () RegenerationSound =
{
if ((self.player_flag & ITEM_RUNE4_FLAG))
{
if ((self.regeneration_sound < time))
{
self.regeneration_sound = (time + 1);
sound (self, CHAN_AUTO, "items/r_item1.wav", 1, ATTN_NORM);
flash_rune_stat(IT2_SIGIL4);
}
}
};