require('State') require('o_StateCreate') require('o_mis') require('o_Main') CONSTANTS = {} CONSTANTS["QuickbuildAnchorLOT"] = 7549 --get a real number for this thing CONSTANTS["GroundPoundSkill"] = 242 CONSTANTS["RebuildStateOpen"] = 0 CONSTANTS["RebuildStateCompleted"] = 2 function onStartup(self) Set = {} --New AI Override ------------------------------------ Set['SuspendLuaAI'] = true -- a state suspending scripted AI Set['SuspendLuaMovementAI'] = true -- a state suspending scripted movement AI ---------------------------------------- --[[ /////////////////////////////////////////////////////////////////////////// ____ _ __ ___ _ _ ____ / ___| | |/ / |_ _| | | | | / ___| \___ \ | ' / | | | | | | \___ \ ___) | | . \ | | | |___ | |___ ___) | |____/ |_|\_\ |___| |_____| |_____| |____/ --]] Set['OverRideHealth'] = false -- Bool Health Overide Set['Health'] = 1 -- Amount of health Set['OverRideImag'] = false -- Bool Imagination Overide Set['Imagination'] = nil -- Amout of Imagination Set['OverRideImmunity'] = false -- Bool Immunity Overide Set['Immunity'] = false -- Bool Set['OverRideName'] = false Set['Name'] = "Master Template" Set['EmoteReact'] = false Set['Emote_Delay'] = 2 Set['React_Set'] = "test" --[[ /////////////////////////////////////////////////////////////////////////// ____ _ ____ ___ _ _ ____ | _ \ / \ | _ \ |_ _| | | | | / ___| | |_) | / _ \ | | | | | | | | | | \___ \ | _ < / ___ \ | |_| | | | | |_| | ___) | |_| \_\ /_/ \_\ |____/ |___| \___/ |____/ --]] Set['aggroRadius'] = 65 -- Aggro Radius Set['conductRadius'] = 15 -- Conduct Radius Set['tetherRadius'] = 100 -- Tether Radius Set['tetherSpeed'] = 8 -- Tether Speed Set['wanderRadius'] = 0 -- Wander Radius --- FOV Radius -- -- Aggro Set['UseAggroFOV'] = false Set['aggroFOV'] = 180 -- Conduct Set['UseConductFOV'] = false Set['conductFOV'] = 180 --[[ //////////////////////////////////////////////////////////////////////////////// _ ____ ____ ____ ___ / \ / ___| / ___| | _ \ / _ \ / _ \ | | _ | | _ | |_) | | | | | / ___ \ | |_| | | |_| | | _ < | |_| | /_/ \_\ \____| \____| |_| \_\ \___/ --]] Set['Aggression'] = "Aggressive" -- [Aggressive]--[Neutral]--[Passive] -- [PassiveAggres]- Set['AggroNPC'] = false Set['AggroDist'] = 7 -- Distance away from target to stop before attacking Set['AggroSpeed'] = 0 -- Multiplier of the NPC's base speed to approach while attacking -- Aggro Emote Set['AggroEmote'] = false --Plays Emote on Aggro Set['AggroE_Type'] = "" -- String Name of Emote Set['AggroE_Delay'] = 1 -- Animation Delay Time --[[ /////////////////////////////////////////////////////////////////////////// __ __ ___ __ __ _____ __ __ _____ _ _ _____ | \/ | / _ \ \ \ / / | ____| | \/ | | ____| | \ | | |_ _| | |\/| | | | | | \ \ / / | _| | |\/| | | _| | \| | | | | | | | | |_| | \ V / | |___ | | | | | |___ | |\ | | | |_| |_| \___/ \_/ |_____| |_| |_| |_____| |_| \_| |_| --]] --********************************************************************** Set['MovementType'] = "Wander" --["Guard"],["Wander"] --********************************************************************** -- Attach Way Point Set to NPC -- " this is for NPC's that are not HF placed " Set['WayPointSet'] = nil -- Wander Settings --------------------------------------------------------- Set['WanderChance'] = 100 -- Main Weight Set['WanderDelayMin'] = 5 -- Min Wander Delay Set['WanderDelayMax'] = 5 -- Max Wander Delay Set['WanderSpeed'] = 0.5 -- Move speed -- effect 1 Set['WanderEmote'] = false -- Enable bool Set['WEmote_1'] = 30 -- Weight Set['WEmoteType_1'] = "salute" -- Animation Type ------ Set your Custom ProximityRadius ----------------------------- --self:SetProximityRadius { radius = 40 , name = "CustomRadius" } ------ Do not change ---------------------------------------------------------- self:SetVar("Set",Set) loadOnce(self) getVarables(self) CreateStates(self) oStart(self) -------------------------------------------------------------------------------- end --When this skill is cast, spawn the anchor QB function onCastSkill(self, msg) if msg.skillID == CONSTANTS["GroundPoundSkill"] and not self:GetVar("QBAlive") then self:SetVar("SpawnQBTime", 5) GAMEOBJ:GetTimer():AddTimerWithCancel( self:GetVar("SpawnQBTime") , "SpawnQBTime", self ) end end --check if armor is depleted then start timer and change faction function onOnHit(self, msg) if self:GetArmor{}.armor < 1 then self:SetFaction{faction = -1} self:ClearThreatList() self:SetVar("ReviveTime", 12) GAMEOBJ:GetTimer():AddTimerWithCancel( self:GetVar("ReviveTime") , "ReviveTime", self ) setState("AiDisable",self) ----------------------------------------------------- --to play the animation for stunning the guy. self:PlayAnimation{animationID = "disable"} self:SetVar("ReviveTime", 12) GAMEOBJ:GetTimer():AddTimerWithCancel( self:GetVar("ReviveTime") , "ReviveTime", self ) ----------------------------------------------------- end end -- Check timer to revive onTimerDone = function(self, msg) if msg.name == "ReviveTime" then self:SetFaction{faction = 4} setState("AiEnable",self) ProximityPuls(self) self:SetArmor{armor = 25} self:SetHealth{health = 4} end if msg.name == "SpawnQBTime" then local mypos = self:GetPosition().pos local myRot = self:GetRotation() local parent = msg.killerID; --put quick build on Apes look dir local oPos = { pos = "", rot = ""} local oDir = self:GetObjectDirectionVectors() oPos.pos = self:GetPosition().pos oPos.pos.y = oPos.pos.y oPos.pos.x = oPos.pos.x - (oDir.backward.x * 8) oPos.pos.z = oPos.pos.z - (oDir.backward.z * 8) local posString = self:CreatePositionString{ x = (oPos.pos.x), y = oPos.pos.y, z = (oPos.pos.z) }.string local config = { {"rebuild_activators", posString }, {"respawn", 100000 }, {"rebuild_reset_time", 10}, {"no_timed_spawn", true}, {"currentTime", 0} } --print("------------------[" .. oPos.pos.x .. "]-[" .. oPos.pos.y .. "]-[" .. oPos.pos.z .. "]") RESMGR:LoadObject { objectTemplate = CONSTANTS["QuickbuildAnchorLOT"], x= mypos.x, y= mypos.y + 13, z= mypos.z, rw= myRot.w, rx= myRot.x, ry= myRot.y , rz = myRot.z, configData = config, owner = self } self:SetVar("QBAlive", true) end if msg.name == "SmashApeTime" then --Smashing the ape and calling the player as the killer self:Die{killerID = GAMEOBJ:GetObjectByID(self:GetVar("Smasher"))} end ------------------- --temp to get the stunned anim to kinda work --[[ if msg.name == "disableIdleTime" then self:PlayAnimation{animationID = "disable-idle"} self:SetVar("disableRecoverTime", 5) GAMEOBJ:GetTimer():AddTimerWithCancel( self:GetVar("disableRecoverTime") , "disableRecoverTime", self ) end if msg.name == "disableRecoverTime" then self:PlayAnimation{animationID = "disable-recovery"} end --]] ------------------------------------------- end --Store the QB so we can use it to smash the Ape function onChildLoaded( self,msg ) if ( msg.childID:GetLOT().objtemplate == CONSTANTS["QuickbuildAnchorLOT"]) then storeParent( self, msg.childID ) end end --Notify the Ape when the rebuild state changes function onNotifyObject( self, msg ) -- if the rebuild is complete if ( msg.name == "rebuildDone" ) then --Getting the sender ID which we set as the player and storing it for the DIE call self:SetVar("Smasher", "|" .. msg.ObjIDSender:GetID()) self:SetVar("SmashApeTime", .5) GAMEOBJ:GetTimer():AddTimerWithCancel( self:GetVar("SmashApeTime") , "SmashApeTime", self ) end if ( msg.name == "rebuildCancel" ) then self:SetVar("QBAlive", false) end end