inst.AnimState:SetMultColour(35/255,105/255,235/255,1) local function GetStatus(inst) local names = {"spiderqueen","deerclops","leif_sparse","minotaur","knight","bishop","rook","firehound"} inst.name = names[math.random(#names)] local player = GetPlayer() local bonuspoints = math.random(6) local pt = Vector3(inst.Transform:GetWorldPosition()) local wanted = SpawnPrefab(inst.name) wanted.Transform:SetPosition(pt.x+(math.random(300)-math.random(300)),0, pt.z+(math.random(300)-math.random(300))) wanted.components.health:SetMaxHealth(1000 * bonuspoints) wanted.components.health:DoDelta(1000 * bonuspoints) wanted.AnimState:SetMultColour(255/255,0/255,0/255,1) wanted.Transform:SetScale(1.5, 1.5, 1.5) inst.AnimState:SetMultColour(255/255,0/255,0/255,1) local minimap = wanted.entity:AddMiniMapEntity() minimap:SetIcon( "lucy_axe.png" ) inst:DoTaskInTime(180, function() if notwanted.components.health:IsDead() then SpawnPrefab("die_fx").Transform:SetPosition(wanted.Transform:GetWorldPosition()) SpawnPrefab("die_fx").Transform:SetPosition(player.Transform:GetWorldPosition()) player.SoundEmitter:PlaySound("dontstarve/creatures/eyeballturret/shotexplo") wanted:Remove() else for k = 1, 20*bonuspoints do SpawnPrefab("goldnugget").Transform:SetPosition(pt.x+2, pt.y,pt.z+2) player.SoundEmitter:PlaySound("dontstarve/HUD/get_gold") end end inst.AnimState:SetMultColour(35/255,105/255,235/255,1) end) end inst:AddComponent("inspectable") inst.components.inspectable.getstatus= GetStatus
|