function onStartup(self) -- Make skunk non tamable at first self:SetPetsTamableState{bTamable = false} -- play the stink fx self:PlayFXEffect{name = "smelly", effectID = 1490, effectType = "create"} -- Check if the pet is already tamed if self:IsPetWild{}.bIsPetWild == false then -- change faction self:SetFaction{faction = 99} -- clear threat list self:ClearThreatList{} -- turn off the stink fx self:StopFXEffect{name = "smelly"} end end -- When the player squirts the skunk with the water gun function onSquirtWithWatergun(self,msg) -- Check if the skunk has been sprayed by seeing if it's on a non pet faction if self:GetFaction{}.faction ~= 99 then -- change faction self:SetFaction{faction = 99} -- clear threat list self:ClearThreatList{} -- make tamable self:SetPetsTamableState{bTamable = true} -- start a timer that will turn the skunk untamable and aggro self:SetVar("GoEvil", 30 ) GAMEOBJ:GetTimer():AddTimerWithCancel( self:GetVar("GoEvil") , "GoEvil", self ) -- turn off stink fx self:StopFXEffect{name = "smelly"} end end function onTimerDone(self, msg) --Did the timer to see if the skunk needs to go aggro again fire? if msg.name == "GoEvil" then -- check the skunks taming state. 5 means the pet is currently being tamed. This checks if that is false if self:GetPetHasState{iStateType = 5}.bHasState == false then -- check if pet is wild if self:IsPetWild{}.bIsPetWild == false then return end --make the pet non tamable self:SetPetsTamableState{bTamable = false} -- change faction self:SetFaction{faction = 114} -- refill health self:SetHealth{health = 5} -- play the stink effect self:PlayFXEffect{name = "smelly", effectID = 1490, effectType = "create"} return end -- if the pet is currently being tamed, set a new short timer to allow the player to continue taming without the pet aggroing. if self:GetPetHasState{iStateType = 5}.bHasState == true then self:SetVar("GoEvil", 5) GAMEOBJ:GetTimer():AddTimerWithCancel( self:GetVar("GoEvil") , "GoEvil", self ) end end end