First commit
This commit is contained in:
		
							
								
								
									
										20
									
								
								app/SabrehavenServer/data/actions/lib/actions.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								app/SabrehavenServer/data/actions/lib/actions.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
			
		||||
function doDestroyItem(target)
 | 
			
		||||
	if not target:isItem() then
 | 
			
		||||
		return false
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	local itemType = ItemType(target:getId())
 | 
			
		||||
	if not itemType:isDestroyable() then
 | 
			
		||||
		return false
 | 
			
		||||
	end
 | 
			
		||||
	
 | 
			
		||||
	if math.random(1,10) <= 3 then
 | 
			
		||||
		target:transform(itemType:getDestroyTarget())
 | 
			
		||||
		target:decay()
 | 
			
		||||
		target:getPosition():sendMagicEffect(CONST_ME_BLOCKHIT)
 | 
			
		||||
	else
 | 
			
		||||
		target:getPosition():sendMagicEffect(CONST_ME_POFF)
 | 
			
		||||
	end
 | 
			
		||||
	
 | 
			
		||||
	return true
 | 
			
		||||
end
 | 
			
		||||
		Reference in New Issue
	
	Block a user