• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

[Request] Chain Spawn

zerghel

Tsuni
Joined
Jul 1, 2008
Messages
299
Reaction score
9
Hello otlanders

well here's my idea

(i would like to do it myself but im not a good scripter)


we have a strong A** monster called "Alluro"
if player can manage to kill Alluro, then other 4 diferent monsters apear around the body
kill those 4, then another 4 diferent monster appear from each defeated monster's body and so until the chain goes to the last wave of monsters

something like this:
Code:
Alluro
    monster1 
       monster2
       monster2
       monster2
       monster2
    monster1 
       monster2
       monster2
       monster2
       monster2
    monster1 
       monster2
       monster2
       monster2
       monster2
    monster1 
       monster2
       monster2
       monster2
       monster2
then next wave for monster2, 3, 4, 5...

so we end up with a kind of "one monster raid"
i wonder if can be done for TFS 0.2.11 =3

Thx
 
LUA:
local creatures = {
	["aluro"] = "weaker monster",
	["weaker monster"] = "aluro"
}

function onKill(cid, target, lastHit)
	if(not(isMonster(target))) then
		return true
	end
	if((getCreatureName(target) == "weaker aluro" and getCreatureByName("aluro")) or (getCreatureName(target) == "weaker monster" and getCreatureByName("weaker monster")) then
		return true
	end
	if(string.lower(getCreatureName(target)) == "weaker monster" or string.lower(getCreatureName(target) == "aluro")) then
		for x = -1, 1 do
			for y = -1, 1 do
				pos = {x = getCreaturePosition(target).x + x, y = getCreaturePosition(target).y + y, z = getCreaturePosition(target).z}
				if(not(pos == getCreaturePosition(target))) then
					doSummonCreature(creatures[getCreatureName(target)], pos)
					doSendMagicEffect(pos, CONST_ME_TELEPORT)
				end
			end
		end
	end
	return true
end
 
LUA:
local creatures = {
	["aluro"] = "weaker monster",
	["weaker monster"] = "aluro"
}

function onKill(cid, target, lastHit)
	if(not(isMonster(target))) then
		return true
	end
	if((getCreatureName(target) == "weaker aluro" and getCreatureByName("aluro")) or (getCreatureName(target) == "weaker monster" and getCreatureByName("weaker monster")) then
		return true
	end
	if(string.lower(getCreatureName(target)) == "weaker monster" or string.lower(getCreatureName(target) == "aluro")) then
		for x = -1, 1 do
			for y = -1, 1 do
				pos = {x = getCreaturePosition(target).x + x, y = getCreaturePosition(target).y + y, z = getCreaturePosition(target).z}
				if(not(pos == getCreaturePosition(target))) then
					doSummonCreature(creatures[getCreatureName(target)], pos)
					doSendMagicEffect(pos, CONST_ME_TELEPORT)
				end
			end
		end
	end
	return true
end

I don't think he wants to summon 9 creatures everytime 1 is killed ;s
 
I don't think he wants to summon 9 creatures everytime 1 is killed ;s

lol I thought he wanted 9. :D

Quick solve:
LUA:
local creatures = {
	["aluro"] = "weaker monster",
	["weaker monster"] = "aluro"
}

function onKill(cid, target, lastHit)
	if((getCreatureName(target) == "weaker aluro" and getCreatureByName("aluro")) or (getCreatureName(target) == "weaker monster" and getCreatureByName("weaker monster")) then
		return true
	end
	if(isMonster(target) and string.lower(getCreatureName(target)) == "weaker monster" or string.lower(getCreatureName(target) == "aluro")) then
		for i = 1, 4 do
			pos = getClosestFreeTile(target, getCreaturePosition(target))
			doSummonCreature(creatures[getCreatureName(target)], pos)
			doSendMagicEffect(pos, CONST_ME_TELEPORT)
		end
	end
	return true
end
 
is this what? a creature script?
there's is a missing ")" in line 7 before "then"
i'm a bit confused about the configuration of the script
plus i'm a she not a he xD

and thx for replies guys =)
 
Back
Top