require('State') require('o_StateCreate') require('o_mis') require('o_Main') CONSTANTS = {} CONSTANTS["RebuildStateOpen"] = 0 CONSTANTS["RebuildStateCompleted"] = 2 CONSTANTS["EnemySmashableFaction"] = 1 local iplayer = "" function onStartup(self) Set = {} --[[ /////////////////////////////////////////////////////////////////////////// ____ _ __ ___ _ _ ____ / ___| | |/ / |_ _| | | | | / ___| \___ \ | ' / | | | | | | \___ \ ___) | | . \ | | | |___ | |___ ___) | |____/ |_|\_\ |___| |_____| |_____| |____/ --]] 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'] = 20 -- Aggro Radius Set['conductRadius'] = 15 -- Conduct Radius Set['tetherRadius'] = 50 -- Tether Radius Set['tetherSpeed'] = 0 -- 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'] = "Guard" --["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'] = 0 -- Main Weight Set['WanderDelayMin'] = 5 -- Min Wander Delay Set['WanderDelayMax'] = 5 -- Max Wander Delay Set['WanderSpeed'] = 0 -- Move speed -- effect 1 Set['WanderEmote'] = false -- Enable bool Set['WEmote_1'] = 30 -- Weight Set['WEmoteType_1'] = "salute" -- Animation Type ------ Do not change ---------------------------------------------------------- self:SetVar("Set",Set) loadOnce(self) getVarables(self) CreateStates(self) oStart(self) -------------------------------------------------------------------------------- ---------------------------------- --Turns the AI Off so the unbuilt bricks do not attack the darkling. setState("AiDisable",self) ----------------------------------* end -------------------------------------------------------------------------------- -- onRebuildNotifyState -- -- Notes: Whenever the rebuild state changes Update -------------------------------------------------------------------------------- function onRebuildNotifyState(self, msg) if (msg.iState == CONSTANTS["RebuildStateCompleted"]) then -- Set to Darkling hated smashable faction Using PLAYER faction for now. self:SetFaction{ faction = CONSTANTS["EnemySmashableFaction"] } --------------------------------------- -- Testing drop loot instead of cast skill -- setState("AiEnable",self) -- self:CastSkill{skillID = 201} ----------------------------------------- self:SetVar("DieTime", 25) self:SetVar("DropLifeTime", 3) self:SetVar("DropArmorTime", 6) self:SetVar("DropImagTime", 4) GAMEOBJ:GetTimer():AddTimerWithCancel( self:GetVar("DieTime") , "DieTime", self ) GAMEOBJ:GetTimer():AddTimerWithCancel( self:GetVar("DropLifeTime") , "DropLifeTime", self ) GAMEOBJ:GetTimer():AddTimerWithCancel( self:GetVar("DropArmorTime") , "DropArmorTime", self ) GAMEOBJ:GetTimer():AddTimerWithCancel( self:GetVar("DropImagTime") , "DropImagTime", self ) end if (msg.iState == CONSTANTS["RebuildStateOpen"]) then end end --Gets the player that built the generator -- Commented out for the time being just in case we need it. function onRebuildStart(self, msg) -- storeObjectByName (self, "playerID", msg.userID ) iplayer = msg.userID end ------------------------- -- Check if the timer for self death is done. ------------------------- onTimerDone = function(self, msg) if msg.name == "DieTime" then self:Die() end if msg.name == "DropLifeTime" then local newID = GAMEOBJ:GenerateSpawnedID() self:DropLoot{itemTemplate = 177,owner = iplayer, lootID = newID, rerouteID = iplayer, sourceObj = self} GAMEOBJ:GetTimer():AddTimerWithCancel( self:GetVar("DropLifeTime") , "DropLifeTime", self ) end if msg.name == "DropArmorTime" then local newID2 = GAMEOBJ:GenerateSpawnedID() GAMEOBJ:GetTimer():AddTimerWithCancel( self:GetVar("DropArmorTime") , "DropArmorTime", self ) self:DropLoot{itemTemplate = 6431,owner = iplayer, lootID = newID2, rerouteID = iplayer, sourceObj = self} end if msg.name == "DropImagTime" then GAMEOBJ:GetTimer():AddTimerWithCancel( self:GetVar("DropImagTime") , "DropImagTime", self ) local newID1 = GAMEOBJ:GenerateSpawnedID() self:DropLoot{itemTemplate = 935,owner = iplayer, lootID = newID1, rerouteID = iplayer, sourceObj = self} end end