main (notifyname, character, node, scr_thread, bitflags) { if (getdvar ("debug") == "1") { println ("------------------------------------------------"); println ("Notifyname ^c", notifyname); println ("character ", character); println ("node ", node); println ("scr_thread ", scr_thread); println ("bitflags ", bitflags); println ("------------------------------------------------"); } if (!isdefined (level.scr_anim[notifyname][character]["animation"])) { self.scripted_notifyname = notifyname; self.scriptedFacialAnim = level.scr_anim[notifyname][character]["facial"]; self.scriptedFacialSound = level.scr_anim[notifyname][character]["sound"][0]; self playsound (self.scriptedFacialSound); println ("^bPlayed friendly chat sound " + self.scriptedFacialSound); self notify ("ScriptedFacial"); return; } self thread abrupt_end(notifyname); if (isdefined (self.notifyname)) { maps\_utility::error (character + " tried to do scripted sequence " + notifyname + " but was in the middle of doing sequence " + self.notifyname); } self.notifyname = notifyname; self notify ("new_sequence"); if ((!isdefined (level.scripted_animation_slot)) || (!isdefined (level.scripted_animation_slot[notifyname]))) { level.scripted_animation_slot[notifyname] = 1; } else { level.scripted_animation_slot[notifyname]++; } if (isdefined (node)) { node = getnode (node,"targetname"); self.seeknode = node; if (level.scripted_animation_slot[notifyname] == 1) { level.scripted_animation_counter [notifyname] = 0; self thread wait_notify (notifyname); } } self.character = character; level.scripted_animation [notifyname][level.scripted_animation_slot[notifyname]-1] = self; if (isdefined (scr_thread)) { self.scripted_thread = scr_thread; } if (isdefined (level.scr_anim[notifyname][self.character]["animation"])) { org = getStartOrigin (node.origin, node.angles, level.scr_anim[notifyname][self.character]["animation"]); self.oldhealth = self.health; self.health = 5000; self setgoalpos (org); self.goalradius = (25); teleport = false; if (isdefined (bitflags)) { if (bitflags & level.teleport) { self teleport (org); teleport = true; } } level.scripted_animation_counter [notifyname]++; if (!teleport) { self waittill ("goal"); } level.scripted_animation_counter [notifyname]--; } else { doscriptedanim (notifyname); return; } if (isdefined (level.scr_anim[notifyname][self.character]["idle"])) { self thread idle_anim(node, notifyname, self.character); } if ((isdefined (node)) && (!level.scripted_animation_counter [notifyname])) { level.scripted_animation [notifyname][0] notify ("anim_notify" + notifyname); } else if (getdvar ("debug") == "1") { println ("Counter for sequence ", notifyname," was ", level.scripted_animation_counter [notifyname]); } } checkanim ( notifyname, total ) { doanim = true; for (i=0;i