mirror of
				https://github.com/ErikasKontenis/SabrehavenServer.git
				synced 2025-10-30 19:56:22 +01:00 
			
		
		
		
	obsidian knife ice statue script
This commit is contained in:
		| @@ -22,6 +22,12 @@ local config = { | ||||
|  | ||||
| 		-- Bone Beasts | ||||
| 		[4212] = {value = 25000, newItem = 5925}, | ||||
| 		 | ||||
| 		-- Ice Cube | ||||
| 		[7441] = {value = 25000, newItem = 7442}, | ||||
| 		[7442] = {value = 25000, newItem = 7444}, | ||||
| 		[7444] = {value = 25000, newItem = 7445}, | ||||
| 		[7445] = {value = 25000, newItem = 7446}, | ||||
| 	}, | ||||
| 	[5942] = { | ||||
| 		-- Demon | ||||
| @@ -34,37 +40,62 @@ local config = { | ||||
|  | ||||
| function onUse(player, item, fromPosition, target, toPosition, isHotkey) | ||||
| 	local skin = config[item.itemid][target.itemid] | ||||
|  | ||||
| 	if not skin then | ||||
| 		return false | ||||
| 		player:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE) | ||||
| 		return true | ||||
| 	end | ||||
|  | ||||
| 	local random, effect, transform = math.random(1, 100000), CONST_ME_MAGIC_GREEN, true | ||||
| 	if type(skin[1]) == 'table' then | ||||
| 		local added = false | ||||
| 		local _skin | ||||
| 		for i = 1, #skin do | ||||
| 			_skin = skin[i] | ||||
| 			if random <= _skin.value then | ||||
| 				if isInArray({7441, 7442, 7444, 7445}, target.itemid) then | ||||
| 				if target.itemid == 11343 then | ||||
| 					effect = CONST_ME_ICEAREA | ||||
| 					local gobletItem = player:addItem(_skin.newItem, _skin.amount or 1) | ||||
| 					if gobletItem then | ||||
| 						gobletItem:setDescription(_skin.desc:gsub('|PLAYERNAME|', player:getName())) | ||||
| 					end | ||||
| 					added = true | ||||
| 				elseif isInArray({7441, 7442, 7444, 7445}, target.itemid) then | ||||
| 					player:addItem(_skin.newItem, _skin.amount or 1) | ||||
| 					effect = CONST_ME_HITAREA | ||||
| 					added = true | ||||
| 				else | ||||
| 					player:addItem(_skin.newItem, _skin.amount or 1) | ||||
| 					added = true | ||||
| 				end | ||||
| 				break | ||||
| 			end | ||||
| 		end | ||||
|  | ||||
| 		if not added and target.itemid == 8961 then | ||||
| 			effect = CONST_ME_POFF | ||||
| 			transform = false | ||||
| 		end | ||||
| 	elseif random <= skin.value then | ||||
| 		if isInArray({7441, 7442, 7444, 7445}, target.itemid) then | ||||
| 			player:addItem(skin.newItem, skin.amount or 1) | ||||
| 		if target.itemid == 11343 then | ||||
| 			effect = CONST_ME_ICEAREA | ||||
| 			local gobletItem = player:addItem(skin.newItem, skin.amount or 1) | ||||
| 			if gobletItem then | ||||
| 				gobletItem:setDescription(skin.desc:gsub('|PLAYERNAME|', player:getName())) | ||||
| 			end | ||||
| 		elseif isInArray({7441, 7442, 7444, 7445}, target.itemid) then | ||||
| 			target:transform(skin.newItem) | ||||
| 			effect = CONST_ME_HITAREA | ||||
| 			transform = false | ||||
| 		else | ||||
| 			player:addItem(skin.newItem, skin.amount or 1) | ||||
| 		end | ||||
| 	else | ||||
| 		if isInArray({7441, 7442, 7444, 7445}, target.itemid) then | ||||
| 			player:say('The attempt of sculpting failed miserably.', TALKTYPE_MONSTER_SAY) | ||||
| 			target:remove() | ||||
| 			effect = CONST_ME_HITAREA | ||||
| 			transform = false | ||||
| 		else | ||||
| 			effect = CONST_ME_POFF | ||||
| 		end | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 ErikasKontenis
					ErikasKontenis