• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Spell City Teleport

jestemPolakiem

New Member
Joined
Oct 17, 2009
Messages
48
Reaction score
2
Location
Poland
translatelogo.gif
City Teleport
created by jestemPolakiem

mapag.png


Introduction
Welcome all members of this forum! I would like to give you my newly-created script.​
I would like now to present you the third consecutive post the script in a modern and professional style. I would just like to recall once again that everything has been translated Google Translate interpreter (which is why the upper right corner is a special icon)​

Description
Action spell is quite simple - after using the object (player) locks up for 30 seconds, by which the figure showing the counter. After this time the player teleports to his temple.​

Install
data/spells/spells.xml - after <spells>
PHP:
<instant name="City Teleport" 		words="exani hom" 		lvl="20" mana="0" aggressive="0" selftarget="1" exhaustion="5000" needlearn="0" event="script" value="citytp.lua">
	<vocation id="1-8"/>
</instant>
data/spells/scripts/citytp.lua
PHP:
function onCastSpell(cid, var)
	local function doTeleport(cid, count)
		if (not isPlayer(cid)) then
			return true
		end
		doSendAnimatedText(getCreaturePosition(cid), (30 - count).."s", COLOR_ORANGE)
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_YELLOW_RINGS)
		if (count == 30) then
			return doCreatureSetNoMove(cid, false) and doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
		else
			addEvent(doTeleport, 1000, cid, count + 1)
		end
		return true
	end
	return doCreatureSetNoMove(cid, true) and doTeleport(cid, 0)
end


Termination
I greet all​
jestemPolakiem​
 
I would like you to speak normal english..

Just change this line:
return doCreatureSetNoMove(cid, false) and doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))

TO:
return doCreatureSetNoMove(cid, false) and doTeleportThing(cid,{x=1,y=1,z=7})
 
It's not bad idea however you should think before you write the script. Actually you allowed players to escape from every dangerous situation they encounter. You didn't even add pz check, which would stop skulled players from teleporting to temple.
 
I did something similar, but in my script the player turns round while he is waiting -> idea from zelda port zone. ;d
Also mine stops if player moves

But nice release
 
Ive done something like this a while ago, a spell that worked like the "recall" thing in LoL. I dont have the files anymore but it shouldnt be hard to do, here are some things you could do to improve your spell (in case you want to):

  1. Add "battle" check, if you have the battle crosses you cant cast it, and if you casted it without it and you get it in the meantime it will stop the countdown and ofc cancel the spell.

  2. In my case I didnt make them "not move", in case they ended up in a dangerous situation and wanted to run, so if you'll do it like that just make them not be locked but if you move while the spell is on countdown it will stop and cancel.

  3. You could add some little area effect around the player while it counts down, instead of just on top of it :)

Good job still, keep it up!
 
Last edited:
Just add this:

PHP:
if isPlayerPzLocked(cid) then
	doPlayerSendTextMessage(cid,MESSAGE_STATUS_SMALL,"You cannot use this command while you are pz locked.")
	return true
end

PHP:
if getCreatureCondition(cid, 1024) then
	doPlayerSendTextMessage(cid,MESSAGE_STATUS_SMALL,"You cannot use this command while you are infight.")
	return true
end
 
Code:
[21/06/2010 21:40:59] [Error - Spell Interface] 
[21/06/2010 21:40:59] data/spells/scripts/citytp.lua
[21/06/2010 21:40:59] Description: 
[21/06/2010 21:40:59] (internalGetPlayerInfo) Player not found when requesting player info #26

[21/06/2010 21:40:59] [Error - Spell Interface] 
[21/06/2010 21:40:59] data/spells/scripts/citytp.lua
[21/06/2010 21:40:59] Description: 
[21/06/2010 21:40:59] (luaGetCreatureCondition) Creature not found

LoL?
 
Back
Top