//////////////////////////////////////////////////////////////
// copy / overwrite all the files inside the eball folder to your game (\office) folder
// don't forget to include eball.wdl in your main game file (office.wdl if you are using the templates)
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
string energyball_mdl = <energy.mdl>;
//////////////////////////////////////////////////////////////
sound energy_snd = <energy.wav>;
//////////////////////////////////////////////////////////////
var eball_speed;
var eball_pos;
//////////////////////////////////////////////////////////////
function energy_ball();
function remove_eball();
//////////////////////////////////////////////////////////////
action wizard
{
clip_size = 0;
while (1)
{
while (my.skill10 < 95)
{
ent_cycle ("attack", my.skill10); // play the attack animation frames
my.skill10 += 3 * time;
wait (1);
}
eball_pos.x = my.x;
eball_pos.y = my.y;
eball_pos.z = my.z + 25; // the energy ball appears betwen wizard's hands
ent_create (energyball_mdl, eball_pos, energy_ball);
snd_play (energy_snd, 70, 0);
wait (16);
while (my.skill10 > 2)
{
ent_cycle ("attack", my.skill10); // play the attack animation frames
my.skill10 -= 2 * time;
wait (1);
}
wait (32);
}
remove_eball();
}
function energy_ball()
{
wait (1);
my.enable_entity = on;
my.enable_block = on;
my.event = remove_eball;
my.pan = you.pan;
my.tilt = you.tilt;
my.lightred = 250;
my.lightgreen = 150;
my.lightrange = 200;
eball_speed.x = 20;
eball_speed.y = 0;
eball_speed.z = 0;
eball_speed *= time;
while (my != null)
{
my.roll += 20 * time;
//move_mode = ignore_you + ignore_passents;
//c_move(my,nullvector,use_aabb | ignore_passable | glide);
ent_move (eball_speed, nullvector);
wait (1);
}
}
Action enemy_impact
{
my.enable_entity = on;
my.event = remove_eball;
}
function remove_eball()
{
wait (1);
if (event_type == event_entity)
{
ent_remove (me);
}
}
How do i tell the ball that when there's a impact it's supossed to dissapear?
I tryed impact, entity, block, none worked. And i cant find whats wrong...
Thanks in advance.