var MKt1 = 1;
function remove_t1();
function tree1();
ENTITY* marker;
#define health skill40
function tree1()
{
while(player == NULL){wait(1);}
my.red = 200;
my.green = 220;
my.blue = 200;
set(my, TRANSLUCENT);
my.alpha = 0;
set(my, PASSABLE);
set(my, SHADOW);
my.health = 100;
while (1)
{
while (vec_dist(my.x, player.x) > 800){wait(1);}
if ((vec_dist(my.x, player.x) < 800) && (MKt1 ==0))
{
if(my.alpha < 100)
{
my.alpha += 15 * time_step;
if(my.alpha > 100)
{
my.alpha = 100;
}
}
}
else
{
my.alpha -= 5 * time_step;
my.health -= 5 * time_step;
if((my.alpha < 0)&&(my.health < 0))
{
my.alpha = 0;
my.health = 0;
}
}
wait (1);
remove_t1();
}
}
function remove_t1()
{
while(vec_dist(my.x, player.x) < 900){wait(1);}
if ((vec_dist(my.x, player.x) > 900)&&(MKt1 ==0))
{
if((my.health)&&(my.alpha))
{
my.health = 0;
my.alpha = 0;
wait(-1);
ent_remove(me);
MKt1 = 1;
}
}
}
action makem()
{
while(player == NULL){wait(1);}
marker = me;
set(my, PASSABLE);
while(1)
{
if((vec_dist(my.x, player.x) < 800) && (MKt1 == 1))
{
ent_create ("cbabe_unanim.mdl", vector(-3554.000, 39.000, -150.000), tree1);
MKt1 = 0;
}
wait(1);
}
}