|
|
@ -146,17 +146,22 @@ if SERVER then |
|
|
|
if( canGather ) then |
|
|
|
if( canGather ) then |
|
|
|
|
|
|
|
|
|
|
|
if( dmgInfo != nil ) then |
|
|
|
if( dmgInfo != nil ) then |
|
|
|
self:SetHealth( self:Health() - dmgInfo:GetDamage() ) |
|
|
|
ent:SetHealth( ent:Health() - dmgInfo:GetDamage() ) |
|
|
|
if( self:Health() <= 0 ) then |
|
|
|
if( ent:Health() <= 0 ) then |
|
|
|
Quantum.Node.Remove( self ) |
|
|
|
Quantum.Node.Remove( ent ) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
local loot, amount = randomizeLootTable( nodeTbl.give, nodeTbl.giveprobability ) |
|
|
|
local loot, amount = randomizeLootTable( nodeTbl.give, nodeTbl.giveprobability ) |
|
|
|
if( loot != nil ) then |
|
|
|
if( loot != nil ) then |
|
|
|
Quantum.Server.Inventory.GiveItem( pl, loot, amount ) |
|
|
|
if( !Quantum.Server.Settings.ItemsGatheredSpawnInWorld ) then |
|
|
|
local itemTbl = Quantum.Item.Get( loot ) |
|
|
|
Quantum.Server.Inventory.GiveItem( pl, loot, amount ) |
|
|
|
Quantum.Notify.ItemGathered( pl, itemTbl, amount ) |
|
|
|
local itemTbl = Quantum.Item.Get( loot ) |
|
|
|
|
|
|
|
Quantum.Notify.ItemGathered( pl, itemTbl, amount ) |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
local basepos = ent:GetPos() |
|
|
|
|
|
|
|
Quantum.Server.Item.SpawnItem( basepos, loot, amount ) |
|
|
|
|
|
|
|
end |
|
|
|
else |
|
|
|
else |
|
|
|
return |
|
|
|
return |
|
|
|
end |
|
|
|
end |
|
|
|