• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Monster Random Monster Spawn

Exeus

Advanced OT User
Joined
Oct 8, 2012
Messages
859
Reaction score
198
Hi, someone maybe have script on random spawn?
for example:
Midnight Panther on real Tibia (she) has 3 spawns on Port Hope.

First Spawn:
Only Example.

X: 1
Y: 13
Z: 7

2nd

X: 3
Y: 5
Z: 7

3th

X: 2
Y: 4
Z: 7
 
Something like this? Change chance and monster names.

Globalevent.xml
XML:
<globalevent name="snowman" interval="80" event="script" value="snowman.lua"/>
Lua:
local pozycje =
{
 {x = 429, y = 438, z = 7, mob="Snowman"},
 {x = 390, y = 466, z = 7, mob="Snowman"},
 {x = 378, y = 452, z = 7, mob="Snowman"}
}

function onThink(interval, lastExecution, thinkInterval)
	if(math.random(1, 1000) < 900) then -- 1000 = 100%, np. 500 to 50%
		local potwor = pozycje[math.random(1, #pozycje)]
		if(type(doCreateMonster(potwor.mob, {x=potwor.x, y=potwor.y, z=potwor.z}, false)) == "number") then
			-- jak typ zwracanej zmiennej to liczba to znaczy, ze sie pojawil
			-- usun komentarz, zeby pokazac broadcast przy spawnie
		end
	end
	return true
end
 
You'd have to Game.getSpectators in the areas around the spawns and check for the presence of the creature.
 
Back
Top