-- CORE Common Module local U = require "scriptbank\\utillib" local M = {} function M.getplayerdist( e ) if g_PlayerHealth <= 0 then return 99999 end return GetPlayerDistance( e ) end --ai_state_startidle --"startidle" --ai_state_idle --"idle" --ai_state_findpatrolpath --"findpatrolpath" --ai_state_startpatrol --"startpatrol" --ai_state_patrol --"patrol" --ai_state_startmove --"startmove" --ai_state_move --"move" --ai_state_avoid --"avoid" --ai_state_hurt --"hurt" --ai_state_punch --"punch" --ai_state_recoverstart --"recoverstart" --ai_state_recover --"recover" --ai_state_startfireonspot --"startfireonspot" --ai_state_fireonspot --"fireonspot" --ai_state_startreload --"startreload" --ai_state_reload --"reload" --ai_state_reloadsettle --"reloadsettle" --ai_state_disable --"disable" --ai_state_duckstart --"duckstart" --ai_state_duck --"duck" --ai_state_unduckstart --"unduckstart" --ai_state_unduck --"unduck" --ai_state_rollstart --"rollstart" --ai_state_roll --"roll" --ai_state_crouchdashstart --"crouchdashstart" --ai_state_crouchdash --"crouchdash" --ai_state_checkforcover --"ai_state_checkforcover" --ai_state_strafeleftstart --"strafeleftstart" --ai_state_strafeleft --"strafeleft" --ai_state_straferightstart --"straferightstart" --ai_state_straferight --"straferight" --ai_state_preexit --"preexit" function M.countaiaroundplayer( dist ) local aiCount = 0 for k, v in pairs( U.ClosestEntities( dist ) ) do local ai_bot = g_aiList[ k ] if ai_bot ~= nil and ai_bot.state ~= nil then aiCount = aiCount + 1 end end return aiCount end function M.debug( e, ai_bot, AIObjNo, PlayerDist, combattype ) if ai_bot ~= nil then if ai_bot.state ~= nil then local Ent = g_Entity[ e ] local AH = 0 if ai_bot.angryhurt ~= nil then AH = 1 end PromptLocal ( e, "H=" .. Ent.health .. " CT=" .. combattype .. " STATE=" .. ai_bot.state .. " SUB=" .. ai_bot.substate .. " DIST=" .. PlayerDist .. " AVOID=" .. Ent.avoid .. " VIS=" .. Ent.plrvisible .. " COVER=" .. ai_bot.coverindex .. "(" .. AICoverGetIfUsed( ai_bot.coverindex ) .. ")" .. " AH=" .. AH .. " SP=" .. ai_bot.gofast ) else PromptLocal ( e, "No ai_bot state" ) end else PromptLocal ( e, "Not initialised" ) end end return M