SphereServer BugTracker - SphereServer
View Issue Details
0002243SphereServernew feature requestpublic19-11-13 15:3704-12-13 16:06
Coruja 
khaos 
normalminorN/A
resolvedno change required 
 
 
Not Available
None
None
0002243: New trigger to run on map teleports
My suggestion is create a new trigger @MapTeleport / @WorldTeleport / @whatever to run when a player step on a world teleport defined on sphere_map_pointsX.scp

ARGN1: the destination P (writeable)
return 1: prevent teleport
it will be usefull to allow more customization and to take control of these teleports.
Example: block someone to exit an area, or make a fix to prevent field traps on world teleports


[EVENTS e_char]
ON=@MapTeleport
IF !(<TAG0.QuestComplete>)
 SYSMESSAGE You cant exit this area without complete the quest first.
 return 1
ENDIF

//Clear field spells traps on destination before send the player to this P
SERV.NEWITEM i_gold
NEW.P=<ARGN1>
NEW.TeleportClearTrap
NEW.REMOVE

[FUNCTION TeleportClearTrap]
FORITEMS 2
 IF (<TYPE>==t_spell)
  REMOVE
 ENDIF
ENDFOR
No tags attached.
Issue History
19-11-13 15:37CorujaNew Issue
01-12-13 09:33khaosNote Added: 0001792
01-12-13 09:33khaosAssigned To => khaos
01-12-13 09:33khaosStatusnew => feedback
01-12-13 21:53CorujaNote Added: 0001795
01-12-13 21:53CorujaStatusfeedback => assigned
04-12-13 16:06khaosNote Added: 0001805
04-12-13 16:06khaosStatusassigned => resolved
04-12-13 16:06khaosResolutionopen => no change required

Notes
(0001792)
khaos   
01-12-13 09:33   
Could this not be done with REGION triggers or simply invisible tiles in that area (if an entrance) to check for a tag on the char if doing a quest and not allow them to leave?
(0001795)
Coruja   
01-12-13 21:53   
yea, on a single region it can be done using @Enter or @Exit
But it's not a good idea copy/paste this same code writing thousand of lines to make it works on every single region of all maps (more than 400 areadef/roomdef) or replace all 1000+ map teleports with an t_telepad invisible item if it could be done with a single trigger on a single player event :P
(0001805)
khaos   
04-12-13 16:06   
We tested with character trigger @RegionEnter and @RegionLeave. We were able to emulate what you asked for with no issue. You don't need a telepad. Testing resulted in a parse of the P you dont want them to leave on the character trigger via a removable event.

We tested recalling, walking, mappoints, teleporting, telepads, customitems, etc. It all blocked leaving or entry.

This we have decided is the best course of action. Adding another trigger at the time is not in the best interest at the moment. Again, we simulated everything you asked for. If you need an example please post for help in the forums.

Sincerely,
Khaos, XuN, and Ben.