PAK w55-)V55_PtTGYOxP]DPu 7-# w'NmywTG^JxAAؖA vY#w6깷#^(5LB6[TY lXVY^VDw55-#dw5ώ#xTFDQmEYGxYY@cM#u5hm>5k55_PtTGYOx[\A3w55#,깓tk-B|XLW+@TL l25-m995llGPMkAXNwPArIu-#kwG~wTG^JxAAؖA pGPM7TȻ-#ww5[-DW9w5TLNwPABiTFYVu55-#2w5&d#xTFDQmEYP|YFVz`#55 -R)4Zǔ4Zǔ4Zǔ4Zǔ4Zǔ4Zǔ4Zǔ4Zǔ4ZǔZV |l(V]FQ|F״')pAיQw} 1 and param:GetString( 1 ) == "damaged" then info.pBeh:SetVar("damaged_only", 1); end; PostXEvent(info.self_id, ET_LuaEventUse, "damage"); local szSelf = EntityPtr(info.self_id, "CEntity"):GetName(); _G["OnDamage_"..szSelf] = function(self_id, agressor_id, point, wpn, damage) PostXEvent(self_id, ET_SendBehaviorEvent, "damaged", self_id); end; local mark = param:GetString( 0 ); info.pBeh:SetBehavior("universal ub_run_check_friends "..mark.." 2000"); end; on_script_event = function(info, param) local ev_type = info.ev.type; if ev_type == "damaged" then return "rerun"; end; end; detectenemy = function(info, param) if info.pBeh:GetVar("damaged_only") ~= 1 then return "rerun"; end; end; behavior_end = function(info, param) return "end"; end; }; rerun = { on_entry = function(info, param) PostXEvent(info.self_id, ET_LuaEventUse); local mark = param:GetString( 0 ); info.pBeh:SetBehavior("attacktoposition rerun movetomarker "..mark.." 10000"); end; behavior_end = function(info, param) return "end"; end; }; END = { on_entry = function(info, param) PostXEvent(info.self_id, ET_LuaEventUse); end; }; }; RegisterUBehavior(ub_run_and_rerun, "ub_run_and_rerun"); ------------------------------------------------------------------------------------------------------------- local ub_guard_assault = { init = { on_entry = function(info, param) info.pBeh:SetBehavior("attacktoposition run movetomarker $client0 100000"); PostXEvent(info.self_id, ET_LuaEventUse, "damage"); local szSelf = EntityPtr(info.self_id, "CEntity"):GetName(); _G["OnDamage_"..szSelf] = function(self_id, agressor_id, point, wpn, damage) PostXEvent(self_id, ET_SendBehaviorEvent, "damaged", self_id); end; end; on_script_event = function(info, param) local ev_type = info.ev.type; if ev_type == "damaged" then return "rerun"; end; end; detectenemy = function(info, param) if info.dist < 4000 then return "stay"; end; end; behavior_end = function(info, param) return "stay"; end; }; rerun = { on_entry = function(info, param) PostXEvent(info.self_id, ET_LuaEventUse); info.pBeh:SetBehavior("attacktoposition rerun movetomarker $client0 10000"); info.pBeh:SetTimer( 5 ); end; detectenemy = function(info, param) if info.dist < 4000 then return "stay"; end; end; behavior_end = function(info, param) return "stay"; end; timer_end = function(info, param) return "stay"; end; }; stay = { on_entry = function(info, param) local szSelf = EntityPtr(info.self_id, "CEntity"):GetName(); info.pBeh:SetBehavior("waitonposition standed "..szSelf.." nofindenemy 1000 4000"); info.pBeh:SetTimer( 1 ); end; timer_end = function(info, param) local pSelf = EntityPtr(info.self_id, "CActor"); if not pSelf:AIR_LastEnemyTrue() then return "rerun"; else info.pBeh:SetTimer( 1 ); end; end; }; END = { on_entry = function(info, param) PostXEvent(info.self_id, ET_LuaEventUse); end; }; }; RegisterUBehavior(ub_guard_assault, "ub_guard_assault"); 8XWvWv]FNIVP*vY_$2[ATQmRRrN(WvYZ0z? 0 then local pPlayer = EntityPtr("$client0", "CEntity"); local nProjID = SPT_FireClausGlow(claus, pPlayer:ID(), nClausGlowDamage, 5000, false, fStatisDamage); PostXEvent(nProjID, ET_Loopsound, -1, szSoundClausGlowMove); PostXEvent(nProjID, ET_SetLuaSM, "sm_glow_move_to_entity $client0"); PostXEvent(nProjID, ET_BoundBox, -1, XVec3:new(-nClausGlowBoxSize), XVec3:new(nClausGlowBoxSize)); end; end; --------------------------------------------------------------------------------------------------------------- function OnChangeSMVar_claus_fire_big_glow( var_name, old_val, new_val ) if new_val > 0 then local pPlayer = EntityPtr("$client0", "CEntity"); local nProjID = SPT_FireClausGlow(claus, pPlayer:ID(), nClausGlowDamage*2, 5000, true, fStatisDamage*1.5); PostXEvent(nProjID, ET_Loopsound, -1, szSoundClausGlowMove); PostXEvent(nProjID, ET_SetLuaSM, "sm_glow_move_to_entity $client0"); PostXEvent(nProjID, ET_Healths, -1, 300); PostXEvent(nProjID, ET_BoundBox, -1, XVec3:new(-nClausGlowBoxSize*2/3), XVec3:new(nClausGlowBoxSize*2/3)); end; end; --------------------------------------------------------------------------------------------------------------- claus_trig_table = { }; --------------------------------------------------------------------------------------------------------------- local claus_agony_count = 2; local pClaus = EntityPtr(claus, "CEntity"); local claus_healths = pClaus:GetHealths(); claus_agony_table = { {lim_hl = claus_healths - (claus_healths/(claus_agony_count + 1));}; {lim_hl = claus_healths - 2*(claus_healths/(claus_agony_count + 1));}; }; --------------------------------------------------------------------------------------------------------------- function FillClausTriggersTable() for nTrigNumber = 1, 1000 do local sTrigName = "trigger"..nTrigNumber.."_pl_claus"; local pTrigger = EntityPtr( sTrigName, "CEntity" ); if not pTrigger then break; end; local sub_trig_table = {}; claus_trig_table[ sTrigName ] = sub_trig_table; sub_trig_table[ "marks_count" ] = 0; for nMarkNumber = 1, 1000 do local sMarkName = "m"..nMarkNumber.."_tr"..nTrigNumber.."_cl"; local pMark = EntityPtr( sMarkName, "CEntity" ); if not pMark then break; end; sub_trig_table[ "mark"..nMarkNumber ] = sMarkName; sub_trig_table.marks_count = nMarkNumber; end; if sub_trig_table.marks_count > 0 then _G[ "OnActivate_"..sTrigName ] = function( trigger_id, activator_ID, state ) ProcessXEvent(claus, ET_SendBehaviorEvent, "trigger_pl_claus_activate", trigger_id, state); end; end; end; end; FillClausTriggersTable(); --------------------------------------------------------------------------------------------------------------- function GetClausRandomMarkByTriggerID( trigger_id ) local pTrigger = EntityPtr( trigger_id, "CEntity" ); if not pTrigger then popup( "!!!Not pTrigger" ); return; end; local sub_trig_table = claus_trig_table[ pTrigger:GetName() ]; local nRndMark = math.random( 1, sub_trig_table.marks_count ); return sub_trig_table[ "mark"..nRndMark ]; end; --------------------------------------------------------------------------------------------------------------- local sm_claus_dialogs = { init = { on_entry = function(info, param) info.pSM:SetVar("cur_dialog", 1); return "show_dialog"; end; }; show_dialog = { on_entry = function(info, param) local nCurDialog = info.pSM:GetVar("cur_dialog"); local szDialogName = "min2_talk_"..nCurDialog; if nCurDialog > 17 then return "end"; end; ShowDialog(szDialogName, "$client0"); info.pSM:SetTimer( GetDialogTime(szDialogName) ); info.pSM:SetVar("cur_dialog", nCurDialog + 1); end; timer_end = function(info, param) return "delay"; end; }; delay = { on_entry = function(info, param) info.pSM:SetTimer( math.random(4, 6) ); end; timer_end = function(info, param) return "show_dialog"; end; }; }; RegisterSM(sm_claus_dialogs, "sm_claus_dialogs"); ------------------------------------------------------------------------------------------------------------- local sm_glow_move_to_entity = { init = { on_entry = function(info, param) end; }; END = { on_entry = function(info, param) if not bHandlePlayerDamagedByGlow then PostXEvent(claus, ET_SendBehaviorEvent, "glow_not_inflict_damage"); end; bHandlePlayerDamagedByGlow = false; end; }; }; RegisterSM(sm_glow_move_to_entity, "sm_glow_move_to_entity"); --------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- local ub_claus_start_behavior = { init = { on_entry = function(info, param) info.pBeh:SetBehavior("universal ub_claus_wait_enemy"); end; behavior_end = function(info, param) PostXEvent(info.self_id, ET_SetLuaSM, "sm_claus_dialogs"); PostXEvent(info.self_id, ET_SetBehavior, "universal ub_claus_mamanager"); end; }; }; RegisterUBehavior(ub_claus_start_behavior, "ub_claus_start_behavior"); --------------------------------------------------------------------------------------------------------------- local ub_claus_mamanager = { init = { on_entry = function(info, param) info.pBeh:SetVar("current_agony", 1); return "main"; end; }; main = { on_entry = function(info, param) info.pBeh:SetBehavior("universal ub_claus_main"); end; evaluate = function(info, param) local pSelf = EntityPtr(info.self_id, "CActor"); local nCurAgony = info.pBeh:GetVar("current_agony"); if nCurAgony <= table.getn(claus_agony_table) and (pSelf:GetHealths() < claus_agony_table[nCurAgony].lim_hl) then return "in_statis"; end; end; }; in_statis = { on_entry = function(info, param) info.pBeh:SetVar("current_agony", info.pBeh:GetVar("current_agony") + 1); info.pBeh:SetBehavior("universal ub_claus_in_statis"); end; behavior_end = function(info, param) return "main"; end; }; }; RegisterUBehavior(ub_claus_mamanager, "ub_claus_mamanager"); --------------------------------------------------------------------------------------------------------------- local ub_claus_main = { init = { on_entry = function(info, param) PostXEvent(info.self_id, ET_SetForcedAttack, "rocket"); info.pBeh:SetBehavior("universal ub_claus_distance_attack"); end; detectenemy = function(info, param) local pSelf = EntityPtr(info.self_id, "CActor"); local fDist = pSelf:GetDistanceTo(EntityPtr("$client0", "CEntity")) if fDist < nClausMeleeDistance and pSelf:IsTracedTo("$client0", nClausMeleeDistance + 1000) then return "contactattack"; end; end; }; contactattack = { on_entry = function(info, param) info.pBeh:SetBehavior("universal ub_claus_contactattack"); end; detectenemy = function(info, param) local pSelf = EntityPtr(info.self_id, "CActor"); local fDist = pSelf:GetDistanceTo(EntityPtr("$client0", "CEntity")) if fDist >= nClausMeleeDistance then return "init"; end; end; lostenemy = function(info, param) return "init"; end; behavior_end = function(info, param) return "init"; end; }; }; RegisterUBehavior(ub_claus_main, "ub_claus_main"); --------------------------------------------------------------------------------------------------------------- local ub_claus_wait_enemy = { init = { on_entry = function(info, param) info.pBeh:SetBehavior("simpleattack markaiming standed $client0"); end; evaluate = function(info, param) local pSelf = EntityPtr(info.self_id, "CActor"); if pSelf:AIR_LastEnemyTrue() then return "end"; end; end; alarm = function(info, param) if info.alarm == eatDamage then return "end"; end; end; }; }; RegisterUBehavior(ub_claus_wait_enemy, "ub_claus_wait_enemy"); --------------------------------------------------------------------------------------------------------------- local ub_claus_distance_attack = { on_script_event = function(info, param) local ev_type = info.ev.type; if ev_type == "trigger_pl_claus_activate" then if info.ev.number == 1 then local pMark = EntityPtr( GetClausRandomMarkByTriggerID( info.ev.ent_id ), "CEntity" ); if pMark then info.pBeh:SetVar("cur_pos_id", pMark:ID()); return "move_to_position"; end; end; end; end; init = { on_entry = function(info, param) return "move_to_enemy"; end; }; wait_enemy = { on_entry = function(info, param) info.pBeh:SetBehavior("simpleattack markaiming standed $client0"); end; evaluate = function(info, param) local pSelf = EntityPtr(info.self_id, "CActor"); if pSelf:AIR_LastEnemyTrue() then return "attacking"; end; end; alarm = function(info, param) if info.alarm == eatDamage then return "attacking"; end; end; }; attacking = { on_entry = function(info, param) info.pBeh:SetBehavior("universal ub_claus_distanceattack"); info.pBeh:SetTimer( 1 ); end; detectenemy = function(info, param) info.pBeh:SetTimer( 1 ); end; timer_end = function(info, param) return "move_to_enemy"; end; }; move_to_enemy = { on_entry = function(info, param) local pSelf = EntityPtr(info.self_id, "CActor"); if not pSelf:AIR_LastEnemyTrue() then info.pBeh:SetBehavior("attacktoposition run movetomarker $client0"); else return "attacking"; end; end; detectenemy = function(info, param) return "attacking"; end; behavior_end = function(info, param) if info.beh_res == ebrPathNotFound then return "move_to_position"; else return "wait_enemy"; end; end; }; move_to_position = { on_entry = function(info, param) local nMark = info.pBeh:GetVar("cur_pos_id"); local pMark = EntityPtr( nMark, "CEntity" ); local pSelf = EntityPtr(info.self_id, "CActor"); if pMark then if not pSelf:AIR_LastEnemyTrue() then info.pBeh:SetBehavior("attacktoposition run movetomarker "..pMark:GetName().." 1000000"); else return "attacking"; end; else return "wait_enemy"; end; end; detectenemy = function(info, param) return "attacking"; end; alarm = function(info, param) if info.alarm == eatDamage then return "attacking"; end; end; behavior_end = function(info, param) return "wait_enemy"; end; }; }; RegisterUBehavior(ub_claus_distance_attack, "ub_claus_distance_attack"); --------------------------------------------------------------------------------------------------------------- function ScriptBehavior_claus_contact_attack(info) local pBeh = info.pBehavior; if math.random(0, 1) == 0 then pBeh:AddScriptState("anim", "attack_melee_kick1", 1); else pBeh:AddScriptState("anim", "attack_melee_kick2", 1); end; end; --------------------------------------------------------------------------------------------------------------- function ScriptBehavior_claus_glow_attack(info) local pBeh = info.pBehavior; pBeh:AddScriptState("anim", "attack1", 1000000); end; --------------------------------------------------------------------------------------------------------------- function ScriptBehavior_claus_accumulate_glow(info) local pBeh = info.pBehavior; pBeh:AddScriptState("anim", "accumulate_glow", 1000000); end; --------------------------------------------------------------------------------------------------------------- function ScriptBehavior_claus_big_glow_attack(info) local pBeh = info.pBehavior; pBeh:AddScriptState("anim", "attack_big_glow", 1); end; --------------------------------------------------------------------------------------------------------------- local ub_claus_contactattack = { init = { on_entry = function(info, param) PostXEvent(info.self_id, ET_DisableAttacking); ProcessXEvent(info.self_id, ET_SetForcedAttack, "melee"); info.pBeh:SetBehavior("script claus_contact_attack $client0 (attack no_snd_stop) looktomark"); info.pBeh:SetTimer( 0 ); end; evaluate = function(info, param) local pSelf = EntityPtr(info.self_id, "CActor"); local nPlayerID = EntityPtr("$client0", "CEntity"):ID(); if not pSelf:AIR_LastEnemyTrue() then return "end"; end; if not pSelf:IsTracedTo("$client0", nClausMeleeDistance + 1000) then return "end"; end; if pSelf:GetDistanceTo( nPlayerID ) >= nClausMeleeDistance then return "end"; end; end; behavior_end = function(info, param) return "init"; end; timer_end = function(info, param) PostXEventWithFlag(info.self_id, ET_Fire); info.pBeh:SetTimer( 1/nClausContactGlowPerSecond ); end; }; END = { on_entry = function(info, param) ProcessXEvent(info.self_id, ET_SetForcedAttack, "undefined"); PostXEvent(info.self_id, ET_EnableAttacking); end; }; }; RegisterUBehavior(ub_claus_contactattack, "ub_claus_contactattack"); --------------------------------------------------------------------------------------------------------------- local ub_claus_distanceattack = { init = { on_entry = function(info, param) info.pBeh:SetBehavior("script claus_glow_attack $client0 (noloop no_snd_stop) looktomark"); info.pBeh:SetTimer( 1 ); info.pBeh:SetVar("allow_strafe", 0); end; evaluate = function(info, param) local player = EntityPtr("$client0", "CEntity"); if info.pBeh:GetVar("allow_strafe") == 1 and SPT_IsEntityBoxOnView(player:ID(), info.self_id) then con_print(" !!!!!"); return "strafe"; end; end; timer_end = function(info, param) info.pBeh:SetVar("allow_strafe", 1); end; on_script_event = function(info, param) local ev_type = info.ev.type; if ev_type == "glow_not_inflict_damage" then return "strafe"; end; end; }; strafe = { on_entry = function(info, param) ProcessXEvent(info.self_id, ET_DisableAttacking); local nNode = SPT_FindStrafeNode( claus, 1000 ); if nNode ~= -1 then info.pBeh:SetBehavior("attacktoposition rerun movetoposition "..nNode.." 1000000"); else return "init"; end; info.pBeh:SetTimer( 1 ); end; on_exit = function(info, param) ProcessXEvent(info.self_id, ET_EnableAttacking); end; behavior_end = function(info, param) return "init"; end; timer_end = function(info, param) return "init"; end; }; }; RegisterUBehavior(ub_claus_distanceattack, "ub_claus_distanceattack"); --------------------------------------------------------------------------------------------------------------- local ub_claus_in_statis = { init = { on_entry = function(info, param) info.pBeh:SetTimer( 8 ); info.pBeh:SetBehavior("script claus_accumulate_glow $client0 (noloop no_snd_stop) looktomark"); PostXEvent(info.self_id, ET_StartShield, 1000, 999, 3000); PostXEvent(info.self_id, ET_Undead, -1, 1); end; timer_end = function(info, param) return "fire"; end; }; fire = { on_entry = function(info, param) info.pBeh:SetBehavior("script claus_big_glow_attack $client0 (noloop no_snd_stop) looktomark"); end; behavior_end = function(info, param) return "wait"; end; }; wait = { on_entry = function(info, param) info.pBeh:SetTimer( 1 ); info.pBeh:SetBehavior("script claus_accumulate_glow $client0 (noloop no_snd_stop) looktomark"); end; timer_end = function(info, param) return "end"; end; }; END = { on_entry = function(info, param) PostXEvent(info.self_id, ET_Undead, -1, 0); PostXEvent(info.self_id, ET_StartShield, -1, -1, 3000); end; }; }; RegisterUBehavior(ub_claus_in_statis, "ub_claus_in_statis");8?^f|Q_9#jyFL5F}W\[AB|+WpaBgv[Â )vmpCGv(ƙhoz3ZZ }eZuFmyF[TC_wPGAAtPjrJm[QLxTVBPm[_vAZ_Qt(Fʈ9T\CPm[anded m1_s1 nofindenemy 1000 2000)"); PostXEvent(s2, ET_SetBehavior, "universal ub_move_to_point_and_wait (attacktoposition rerun movetomarker m1_s2 10000) (waitonposition standed m1_s1 nofindenemy 1000 2000)"); function OnActivate_trigger1_s1( trigger_id, activator_ID, state ) ProcessXEvent(door_03, ET_LockDoor, 0); WakeupActor(s1, s2); DeleteEntity( trigger_id ); end; --------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- PostXEvent(s3, ET_SetBehavior, "universal ub_move_to_point_and_wait (attacktoposition rerun movetomarker m1_s3 10000) (waitonposition standed m1_s3 nofindenemy 1000 3000)"); PostXEvent(s4, ET_SetBehavior, "universal ub_move_to_point_and_wait (attacktoposition rerun movetomarker m1_s4 10000) (waitonposition standed m1_s4 nofindenemy 1000 3000)"); function OnActivate_trigger1_s3( trigger_id, activator_ID, state ) WakeupActor(s3, s4); DeleteEntity( trigger_id ); end; --------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- PostXEvent(s5, ET_SetForcedAttack, "none"); PostXEvent(s6, ET_SetForcedAttack, "none"); function ScriptBehavior_mining(info) local pBeh = info.pBehavior; pBeh:AddScriptState("anim", "mining", 1000000); end; PostXEvent(s5, ET_SetBehavior, "script mining"); PostXEvent(s6, ET_SetBehavior, "script mining"); PostXEvent(s7, ET_SetBehavior, "waitonposition standed s7 nofindenemy"); function OnActivate_trigger1_s5( trigger_id, activator_ID, state ) WakeupActor(s5, s6, s7); PostXEvent(look_s5, ET_SetLuaSM, "sm_s5"); DeleteEntity( trigger_id ); end; function S5_alarm() PostXEvent(s5, ET_LuaEventUse); PostXEvent(s6, ET_LuaEventUse); PostXEvent(s5, ET_SetForcedAttack, "undefined"); PostXEvent(s6, ET_SetForcedAttack, "undefined"); WakeupActor(s8, s9); PostXEvent(s5, ET_SetBehavior, "universal ub_guard_assault"); PostXEvent(s6, ET_SetBehavior, "universal ub_guard_assault"); PostXEvent(s8, ET_SetBehavior, "universal ub_guard_assault"); PostXEvent(s9, ET_SetBehavior, "universal ub_guard_assault"); end; -------------------------------------------------------------------------------------------- function OnAlarm_s5(self_ID, target_ID, alarm_type, distance) if alarm_type == eatDamage or alarm_type == eatShots then DeleteEntity( look_s5 ); end; end; -------------------------------------------------------------------------------------------- function OnAlarm_s6(self_ID, target_ID, alarm_type, distance) if alarm_type == eatDamage or alarm_type == eatShots then DeleteEntity( look_s5 ); end; end; --------------------------------------------------------------------------------------------------------------- local sm_s5 = { init = { states = function(info, param) local player = EntityPtr("$client0", "CEntity"); if player:IsLookOn(look_s5, 40, 100000) then return "check_alarm"; end; end; }; check_alarm = { on_entry = function(info, param) PostXEvent(s5, ET_LuaEventUse, "alarm"); PostXEvent(s6, ET_LuaEventUse, "alarm"); info.pSM:SetTimer( 15 ); end; states = function(info, param) local pS5 = EntityPtr("s5", "CActor"); if pS5 and pS5:AIR_CheckDangerestProjectile() ~= -1 then return "end"; end; local pS6 = EntityPtr("s6", "CActor"); if pS6 and pS6:AIR_CheckDangerestProjectile() ~= -1 then return "end"; end; end; timer_end = function(info, param) return "end"; end; }; END = { on_entry = function(info, param) S5_alarm(); DeleteEntity( info.self_id ); end; }; }; RegisterSM(sm_s5, "sm_s5"); --------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- PostXEvent(s10, ET_SetBehavior, "universal ub_move_to_point_and_wait (attacktoposition rerun movetomarker m1_s10 10000) (waitonposition standed m1_s10 nofindenemy 1000 3000)"); PostXEvent(s11, ET_SetBehavior, "universal ub_move_to_point_and_wait (attacktoposition rerun movetomarker m1_s11 10000) (waitonposition standed m1_s11 nofindenemy 1000 3000)"); function OnActivate_trigger1_s10( trigger_id, activator_ID, state ) WakeupActor(s10, s11); DeleteEntity( trigger_id ); end; --------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- PostXEvent(s12, ET_SetBehavior, "universal ub_move_to_point_and_wait (attacktoposition rerun movetomarker m1_s12 10000) (waitonposition standed m1_s12 nofindenemy 1000 3000)"); PostXEvent(s13, ET_SetBehavior, "universal ub_move_to_point_and_wait (attacktoposition rerun movetomarker m1_s13 10000) (waitonposition standed m1_s13 nofindenemy 1000 3000)"); function OnActivate_trigger1_s12( trigger_id, activator_ID, state ) WakeupActor(s12, s13); DeleteEntity( trigger1_s12, trigger2_s12 ); end; function OnActivate_trigger2_s12( trigger_id, activator_ID, state ) WakeupActor(s12, s13); DeleteEntity( trigger1_s12, trigger2_s12 ); end; --------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- PostXEvent(s15, ET_SetBehavior, "universal ub_move_to_point_and_wait (universal ub_run_and_rerun m1_s15) (waitonposition standed m1_s15 nofindenemy 1000 3000)"); PostXEvent(s16, ET_SetBehavior, "universal ub_move_to_point_and_wait (universal ub_run_and_rerun m1_s16) (waitonposition standed m1_s16 nofindenemy 1000 3000)"); function OnActivate_trigger1_s15( trigger_id, activator_ID, state ) WakeupActor(s15, s16); DeleteEntity( trigger_id ); end; --------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- function OnActivate_trigger1_s17( trigger_id, activator_ID, state ) ProcessXEvent(door_01, ET_LockDoor, 0); ProcessXEvent(door_02, ET_LockDoor, 0); local behavior = "universal ub_move_and_die (universal ub_run_and_rerun m1_s17_common damaged)"; PostXEvent(m1_s17_common, ET_SetLuaSM, "sm_multi_spawn_base s17 ("..behavior..") 1.5"); DeleteEntity( trigger_id ); end; --------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- local sm_spawn_s18 = { user_data = { on_spawn = function(info, param) local nAciveActors = info.pSM:GetVar("active_actors"); info.pSM:SetVar("active_actors", nAciveActors + 1); end; on_dead = function(info, param) local nAciveActors = info.pSM:GetVar("active_actors"); info.pSM:SetVar("active_actors", nAciveActors - 1); end; on_init = function(info, param) info.pSM:SetVar("active_actors", 0); end; }; wait = { on_entry = function(info, param) info.pSM:SetTimer( 0.1 ); end; }; check_trigger = { states = function(info, param) local nAciveActors = info.pSM:GetVar("active_actors"); if nAciveActors == 0 then return "spawn"; end; end; }; }; RegisterSM(sm_spawn_s18, "sm_spawn_s18", "sm_multi_spawn_common"); function OnActivate_trigger1_s18( trigger_id, activator_ID, state ) local behavior = "universal ub_move_and_die (universal ub_run_and_rerun m1_s17_common damaged)"; PostXEvent(m1_s17_common, ET_SetLuaSM, "sm_spawn_s18 s18 ("..behavior..")"); local behavior = "universal ub_move_and_die (universal ub_run_and_rerun m1_s17_common damaged)"; PostXEvent(m1_s17_common, ET_SetLuaSM, "sm_spawn_s18 s19 ("..behavior..")"); DeleteEntity( trigger_id ); end; --------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- function Spawn_s21() local behavior = "universal ub_move_and_die (universal ub_run_and_rerun m1_s17_common damaged)"; PostXEvent(m1_s17_common, ET_SetLuaSM, "sm_multi_spawn_base s21 ("..behavior..") 2"); DeleteEntity( trigger1_s21, trigger2_s21 ); end; function OnActivate_trigger1_s21( trigger_id, activator_ID, state ) Spawn_s21(); end; function OnActivate_trigger2_s21( trigger_id, activator_ID, state ) Spawn_s21(); end; --------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- PostXEvent(s22, ET_SetBehavior, "universal ub_move_to_point_and_wait (attacktoposition rerun movetomarker m1_s22 10000) (waitonposition standed m1_s22 nofindenemy 1000 3000)"); PostXEvent(s23, ET_SetBehavior, "universal ub_move_to_point_and_wait (attacktoposition rerun movetomarker m1_s23 10000) (waitonposition standed m1_s23 nofindenemy 1000 3000)"); function OnActivate_trigger1_s22( trigger_id, activator_ID, state ) WakeupActor(s22, s23); DeleteEntity( trigger_id ); end; --------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- function OnActivate_trigger1_s24( trigger_id, activator_ID, state ) local behavior = "universal ub_move_to_point_and_wait (universal ub_run_and_rerun m1_s24) (waitonposition standed m1_s24 nofindenemy 1000 3000)"; PostXEvent(mark_sm_s24, ET_SetLuaSM, "sm_multi_spawn_common s24 ("..behavior..")"); local behavior = "universal ub_move_to_point_and_wait (universal ub_run_and_rerun m1_s25) (waitonposition standed m1_s25 nofindenemy 1000 3000)"; PostXEvent(mark_sm_s24, ET_SetLuaSM, "sm_multi_spawn_common s25 ("..behavior..")"); DeleteEntity( trigger_id ); end; --------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- function OnActivate_trigger1_s26( trigger_id, activator_ID, state ) local behavior = "universal ub_move_and_die (universal ub_run_and_rerun m1_s17_common damaged)"; PostXEvent(mark_sm_s26, ET_SetLuaSM, "sm_multi_spawn_common s26 ("..behavior..")"); local behavior = "universal ub_move_and_die (universal ub_run_and_rerun m1_s17_common damaged)"; PostXEvent(mark_sm_s26, ET_SetLuaSM, "sm_multi_spawn_common s27 ("..behavior..")"); DeleteEntity( trigger_id ); end; --------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- function OnActivate_trigger1_s28( trigger_id, activator_ID, state ) local behavior = "universal ub_move_to_point_and_wait (universal ub_run_and_rerun m1_s28) (waitonposition standed m1_s28 nofindenemy 1000 3000)"; PostXEvent(mark_sm_s28, ET_SetLuaSM, "sm_multi_spawn_common s28 ("..behavior..")"); local behavior = "universal ub_move_to_point_and_wait (universal ub_run_and_rerun m1_s29) (waitonposition standed m1_s29 nofindenemy 1000 3000)"; PostXEvent(mark_sm_s28, ET_SetLuaSM, "sm_multi_spawn_common s29 ("..behavior..")"); DeleteEntity( trigger_id ); end; --------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- PostXEvent(s30, ET_SetBehavior, "universal ub_move_to_point_and_wait (attacktoposition rerun movetomarker m1_s30 10000) (waitonposition standed m1_s30 nofindenemy 1000 3000)"); PostXEvent(s31, ET_SetBehavior, "universal ub_move_to_point_and_wait (attacktoposition rerun movetomarker m1_s31 10000) (waitonposition standed m1_s31 nofindenemy 1000 3000)"); function OnActivate_trigger1_s30( trigger_id, activator_ID, state ) WakeupActor(s30, s31); DeleteEntity( trigger_id ); end; --------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- PostXEvent(s32, ET_SetBehavior, "universal ub_move_to_point_and_wait (attacktoposition rerun movetomarker m1_s32 10000) (waitonposition standed m1_s32 nofindenemy 1000 3000)"); PostXEvent(s33, ET_SetBehavior, "universal ub_move_to_point_and_wait (attacktoposition rerun movetomarker m1_s33 10000) (waitonposition standed m1_s33 nofindenemy 1000 3000)"); function OnActivate_trigger1_s32( trigger_id, activator_ID, state ) WakeupActor(s32, s33); DeleteEntity( trigger_id ); end; function OnActivate_trigger2_s32( trigger_id, activator_ID, state ) PostXEvent(s32, ET_SetBehavior, "universal ub_move_and_die (attacktoposition run movetomarker m2_s32 100000)"); PostXEvent(s33, ET_SetBehavior, "universal ub_move_and_die (attacktoposition run movetomarker m2_s33 100000)"); DeleteEntity( trigger_id ); end; --------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- function OnActivate_trigger1_s34( trigger_id, activator_ID, state ) local behavior = "universal ub_move_to_point_and_wait (attacktoposition run movetomarker m1_s34 100000) (waitonposition standed m1_s34 nofindenemy 1000 3000)"; PostXEvent(m1_s34, ET_SetLuaSM, "sm_multi_spawn_common s34 ("..behavior..")"); DeleteEntity( trigger_id ); end; --------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- PostXEvent(s35, ET_SetBehavior, "universal ub_guard_assault"); function OnActivate_trigger1_s35( trigger_id, activator_ID, state ) WakeupActor(s35); DeleteEntity( trigger_id ); end; --------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- function OnActivate_trigger1_s36( trigger_id, activator_ID, state ) local behavior = "universal ub_move_to_point_and_wait (universal ub_run_and_rerun m1_s36) (waitonposition standed m1_s36 nofindenemy 1000 3000)"; PostXEvent(mark_sm_s36, ET_SetLuaSM, "sm_multi_spawn_common s36 ("..behavior..")"); local behavior = "universal ub_move_to_point_and_wait (universal ub_run_and_rerun m1_s37) (waitonposition standed m1_s37 nofindenemy 1000 3000)"; PostXEvent(mark_sm_s36, ET_SetLuaSM, "sm_multi_spawn_common s37 ("..behavior..")"); DeleteEntity( trigger_id ); end; --------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- function Spawn_s38( mark ) WakeupActor(s38); PostXEvent(s38, ET_SetBehavior, "universal ub_move_to_point_and_wait (universal ub_run_and_rerun "..mark..") (waitonposition standed "..mark.." nofindenemy 1000 3000)"); DeleteEntity( trigger1_s38, trigger2_s38 ); end; function OnActivate_trigger1_s38( trigger_id, activator_ID, state ) Spawn_s38( "m1_s38" ); end; function OnActivate_trigger2_s38( trigger_id, activator_ID, state ) Spawn_s38( "m2_s38" ); end; Ew\Z~buAZfHvB[A ZV ~pxDW1L8?EF(WQZ$ăEpJLj F9PTH~$ĆLxWEp Di:rhJ`$ĆLxWPaH\ryF1L8?'J9#LEfF4azYM~ 0 then return; end; return "spawn"; end; end; end; }; END = { on_entry = function(info, param) active_parashut_count = active_parashut_count - 1; if active_parashut_count == 0 then local sm_var = param:GetString( 2 ); _G[ "OnChangeSMVar_drop_"..sm_var ] = nil; _G[ "OnChangeSMVar_"..sm_var ] = nil; g_pSMVars:SetVar( "fly", 0 ); StopSoundTrack(); end; end; }; }; RegisterSM(sm_parashut_manager, "sm_parashut_manager", "sm_multi_spawn_common"); ------------------------------------------------------------------------------------------------------------- function ScriptBehavior_parashut_man_dead(info) local pBeh = info.pBehavior; pBeh:AddScriptState("anim", "trup_deu_blackguard", 1000000); end; local ub_parashut_man = { init = { on_entry = function(info, param) PostXEvent(info.self_id, ET_Healths, -1, 30000); PostXEvent(info.self_id, ET_LuaEventUse, "damage"); info.pBeh:SetBehavior("universal ub_parashut_man_shot"); local szSelf = EntityPtr(info.self_id, "CEntity"):GetName(); _G["OnDamage_"..szSelf] = function(self_id, agressor_id, point, mod, damage) PostXEvent(self_id, ET_SendBehaviorEvent, "damaged", nil, mod); end; EnableParashutIcon( info.self_id, true ); end; on_script_event = function(info, param) if info.ev.type == "damaged" then info.pBeh:SetVar("mod", info.ev.number); return "dead"; end; end; }; dead = { on_entry = function(info, param) --SPT_ProcessEmotionOnKilled( info.pBeh:GetVar("mod") ); PostXEvent(info.self_id, ET_LuaEventUse); PostXEvent(info.self_id, ET_DisableAttacking); PostXEvent(info.self_id, ET_Undead, -1, 1); info.pBeh:SetBehavior("script parashut_man_dead"); EnableParashutIcon( info.self_id, false ); if math.random(0,1) == 0 then PostXEvent(info.self_id, ET_DropWeapon); end; end; }; }; RegisterUBehavior(ub_parashut_man, "ub_parashut_man"); ------------------------------------------------------------------------------------------------------------- local ub_parashut_man_shot = { init = { on_entry = function(info, param) info.pBeh:SetBehavior("simpleattack markattack standed $client0 easyreload"); info.pBeh:SetTimer( 2 ); end; evaluate = function(info, param) local pSelf = EntityPtr(info.self_id, "CActor"); if not pSelf:AIR_LastEnemyTrue() then return "wait"; end; end; timer_end = function(info, param) return "delay"; end; behavior_end = function(info, param) return "wait"; end; }; delay = { on_entry = function(info, param) info.pBeh:SetBehavior("simpleattack markaiming standed $client0 easyreload"); info.pBeh:SetTimer( 1 ); end; timer_end = function(info, param) return "init"; end; }; wait = { on_entry = function(info, param) info.pBeh:SetBehavior("simpleattack markaiming standed $client0 easyreload"); end; evaluate = function(info, param) local pSelf = EntityPtr(info.self_id, "CActor"); if pSelf:AIR_LastEnemyTrue() then return "init"; end; end; }; }; RegisterUBehavior(ub_parashut_man_shot, "ub_parashut_man_shot"); --------------------------------------------------------------------------------------------------------------- C'4ќHöwjl( j}5-(/VUP="5>Gqt55b8=--Ddn)=;5eH`Fqq55gfɟF=--;C=.5 qqk55Xꢬ'i=-