Lumina Posted August 7, 2016 Share Posted August 7, 2016 Hello, I need a little help to know how to make conditional drop for earthquake (in cave). Like, ice if it's winter, yellow gem in summer... Any advice ? Thanks Link to comment Share on other sites More sharing options...
DarkXero Posted August 9, 2016 Share Posted August 9, 2016 local AutumnDebris = { { -- common weight = 0.75, loot = { "rocks", "flint", }, }, { -- uncomon weight = 0.20, loot = { "goldnugget", "nitre", "rabbit", "mole", }, }, { -- rare weight = 0.05, loot = { "redgem", "bluegem", "marble", }, }, } local WinterDebris = { { -- common weight = 0.75, loot = { "ice", "flint", }, }, { -- uncomon weight = 0.20, loot = { "goldnugget", "nitre", "rabbit", "mole", }, }, { -- rare weight = 0.05, loot = { "redgem", "bluegem", "marble", }, }, } local SpringDebris = { { -- common weight = 0.75, loot = { "rocks", "flint", }, }, { -- uncomon weight = 0.20, loot = { "goldnugget", "nitre", "rabbit", "mole", }, }, { -- rare weight = 0.05, loot = { "redgem", "bluegem", "marble", }, }, } local SummerDebris = { { -- common weight = 0.75, loot = { "rocks", "flint", }, }, { -- uncomon weight = 0.20, loot = { "goldnugget", "nitre", "rabbit", "mole", }, }, { -- rare weight = 0.05, loot = { "redgem", "yellowgem", "marble", }, }, } AddComponentPostInit("quaker", function(self) local _world = GLOBAL.TheWorld if _world and _world.ismastersim then local function UpdateDebris(_world) local season = _world.state.season print("MOD - Setting "..season.." quake debris") if season == "summer" then self:SetDebris(SummerDebris) elseif season == "spring" then self:SetDebris(SpringDebris) elseif season == "winter" then self:SetDebris(WinterDebris) else -- "autumn" self:SetDebris(AutumnDebris) end end _world:WatchWorldState("season", UpdateDebris) UpdateDebris(_world) end end) Link to comment Share on other sites More sharing options...
Lumina Posted August 10, 2016 Author Share Posted August 10, 2016 Thanks a lot ! It work fine, it's so great Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now