https://youtu.be/Sw6gM46ppIQ
trying to create a new monster and his attack is coming from two different origins
here is the code:
Code: Select all
void (vector org, vector vec) LaunchBolt = {
sound (self, CHAN_WEAPON, "weapons/lhit.wav", 1, ATTN_NORM);
vec = normalize (vec);
newmis = spawn ();
newmis.owner = self;
newmis.classname = "bolt";
newmis.movetype = MOVETYPE_FLYMISSILE;
newmis.solid = SOLID_BBOX;
newmis.effects = EF_BRIGHTLIGHT;
setmodel (newmis,"progs/bolt.mdl");
setsize (newmis,VEC_ORIGIN,VEC_ORIGIN);
setorigin (newmis,org);
newmis.velocity = (vec * 1000.000);
newmis.velocity = newmis.velocity + v_right*crandom()*50 + v_up*crandom()*50;
newmis.angles = vectoangles (newmis.velocity);
newmis.touch = T_BoltTouch;
newmis.nextthink = time + 5;
newmis.think = SUB_Remove;
};
void () jesus_bolt =
{
local vector dir;
local entity en;
ai_face ();
//sound (self,CHAN_WEAPON,"weapons/spike2.wav",TRUE,ATTN_NORM);
en = self.enemy;
dir = (en.origin - (en.velocity * 0.200));
dir = normalize ((dir - self.origin));
LaunchBolt(self.origin+v_right*32+'0 0 64',dir);
};
void () monster_player_bolt1 = [103,monster_player_bolt2]{jesus_bolt();self.nextthink = time + 0.05;ai_face();};
void () monster_player_bolt2 = [104,monster_player_bolt3]{self.nextthink = time + 0.05;ai_face();};
void () monster_player_bolt3 = [103,monster_player_bolt4]{jesus_bolt();self.nextthink = time + 0.05;ai_face();};
void () monster_player_bolt4 = [104,monster_player_bolt5]{self.nextthink = time + 0.05;ai_face();};
void () monster_player_bolt5 = [103,monster_player_bolt6]{self.nextthink = time + 0.05;jesus_bolt();ai_face();};
void () monster_player_bolt6 = [104,monster_player_boss_run1]{self.nextthink = time + 0.05;SUB_CheckRefire(monster_player_bolt1); ai_face();};