-- AI : Soldier Behavior local U = require "scriptbank\\utillib" local rad = math.rad ai_soldier_combatshoot = require "scriptbank\\ai\\module_combatshoot" function ai_soldier_breath_init(e) Include( "utillib.lua" ) SetPreExitValue( e, 0 ) SetCharacterSoundSet( e ) ai_soldier_combatshoot.init(e,ai_combattype_regular) end local limbNum = 16 local emitter = {} function ai_soldier_breath_main(e) ai_soldier_combatshoot.main(e,ai_combattype_regular,ai_movetype_usespeed,ai_attacktype_canfire) local Ent = g_Entity[ e ] if Ent.health > 0 then if emitter[ e ] == nil then emitter[ e ] = ParticlesGetFreeEmitter() ParticlesAddEmitterEx( emitter[ e ], 1, 0, -- xpl ypl zpl xph yph zph 0, 0, 0, 0, 0, 0, -- ssl ssh sel seh 2, 2, 40, 40, -- xsl ysl zsl xsh ysh zsh 0, 0, 0, 0, 0, 0, -- rotl roth lifl lifh 0, 0, 1000, 4000, -- asl ash ael aeh 80, 80, 0, 0, -- frq ent limb img frames 150, e, limbNum, 0, 64 ) else local _, _, _, xA, yA, zA = GetEntityPosAng( e ) local xo, yo, zo = U.Rotate3D( 0, 0, 0.01, rad( xA ), rad( yA ), rad( zA ) ) ParticlesSetSpeed( emitter[ e ], xo, yo, zo, xo, yo, zo ) end end end function ai_soldier_breath_preexit( e ) SetPreExitValue( e, 1 ) if ai_soldier_combatshoot.preexit( e, ai_movetype_useanim ) == 1 then PlayCharacterSound( e, 'onDeath' ) SetPreExitValue( e, 2 ) end if emitter[ e ] ~= nil then ParticlesDeleteEmitter( emitter[ e ] ) emitter[ e ] = nil end end function ai_soldier_breath_exit(e) module_combatcore.releasecover(e) if emitter[ e ] ~= nil then ParticlesDeleteEmitter( emitter[ e ] ) emitter[ e ] = nil end end