• 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 can teleport?

Xanter

New Member
Joined
Nov 8, 2008
Messages
12
Reaction score
0
(I don't speak good, only use Translat)

Hi, I'm looking for an opportunity to have a monster to teleport to specific places. Something kind of spell, the spell allows teleportation defense during the fight.

It would counsel someone to write a spell or use the script "Creaturescript? I would be grateful.
 
random positions?
this should be a fast functional spell make it attackble by the monster with low chance or w/e
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, 2)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local places = { {x=1,y=1,z=1},{x=1,y=1,z=1},{x=1,y=1,z=1},{x=1,y=1,z=1},{x=1,y=1,z=1},{x=1,y=1,z=1} }

function onCastSpell(cid, var)
	if isPlayer(target) then
		rand = math.random(1,#places)
			doTeleportThing(target,places[rand],false)
			doSendMagicEffect(places[rand],0)
	end
	return doCombat(cid, combat, var)
end
 
Or am I doing it wrong, or it does not work. Yes random, I need 4 pos. Then
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, 2)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
 
local places = { {x=1000,y=1000,z=7},{x=1001,y=1001,z=7},{x=1002,y=1002,z=7},{x=1003,y=1003,z=7},{x=1004,y=1004,z=7} }
 
function onCastSpell(cid, var)
	if isPlayer(target) then
		rand = math.random(1,#places)
			doTeleportThing(target,places[rand],false)
			doSendMagicEffect(places[rand],30)
	end
	return doCombat(cid, combat, var)
end

?
 
try this
and in the spell.xml amke it needtarget="1"
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, 2)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
 
local places = { {x=99,y=99,z=7},{x=99,y=99,z=7} }
 
function onCastSpell(cid, var)
	if isPlayer(getCreatureTarget(cid)) then
		rand = math.random(1,#places)
			doTeleportThing(getCreatureTarget(cid),places[rand],false)
			doSendMagicEffect(places[rand],30)
	end
	return doCombat(cid, combat, var)
end
 
Great, this is what I meant. I do not know how to thank you.

I ask again, is the possibility that the monster he used a spell on yourself? and be teleported himself and not the player?
 
just change all this
Code:
getCreatureTarget(cid)

to
Code:
cid
in the whole script so when he use this spell the monster will tp him self
 
Thanks, but still does not work, however, changed "isplayer" to "iscreature" and it works.
Thank you very much for your help and patience with me. Reputation concerned, but nonetheless it's still not enough as a reward.
 
Back
Top Bottom