mirror of
				https://github.com/ErikasKontenis/SabrehavenServer.git
				synced 2025-10-31 20:06:23 +01:00 
			
		
		
		
	introduce svargrond arena quest
This commit is contained in:
		
							
								
								
									
										41
									
								
								data/creaturescripts/scripts/arena_kill.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								data/creaturescripts/scripts/arena_kill.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,41 @@ | ||||
| function onKill(creature, target) | ||||
| 	local targetMonster = target:getMonster() | ||||
| 	if not targetMonster then | ||||
| 		return | ||||
| 	end | ||||
|  | ||||
| 	local player = creature:getPlayer() | ||||
| 	local pit = player:getStorageValue(1101) | ||||
| 	if pit < 1 or pit > 10 then | ||||
| 		return | ||||
| 	end | ||||
|  | ||||
| 	local arena = player:getStorageValue(1100) | ||||
| 	if arena < 1 then | ||||
| 		return | ||||
| 	end | ||||
|  | ||||
| 	if not isInArray(ARENA[arena].creatures, targetMonster:getName():lower()) then | ||||
| 		return | ||||
| 	end | ||||
|  | ||||
| 	-- Remove pillar and create teleport | ||||
| 	local pillarTile = Tile(PITS[pit].pillar) | ||||
| 	if pillarTile then | ||||
| 		local pillarItem = pillarTile:getItemById(SvargrondArena.itemPillar) | ||||
| 		if pillarItem then | ||||
| 			pillarItem:remove() | ||||
|  | ||||
| 			local teleportItem = Game.createItem(SvargrondArena.itemTeleport, 1, PITS[pit].tp) | ||||
| 			if teleportItem then | ||||
| 				teleportItem:setMovementId(25200) | ||||
| 			end | ||||
|  | ||||
| 			SvargrondArena.sendPillarEffect(pit) | ||||
| 		end | ||||
| 	end | ||||
|  | ||||
| 	player:setStorageValue(1101, pit + 1) | ||||
| 	player:say('Victory! Head through the new teleporter into the next room.', TALKTYPE_MONSTER_SAY) | ||||
| 	return true | ||||
| end | ||||
		Reference in New Issue
	
	Block a user
	 ErikasKontenis
					ErikasKontenis