Simple Portal Creation With Sai

Most people make custom portals by modifying an existing portal spell’s coordinates in the spell_target_position. I have seen one example of someone using event_scripts for the portal, but since those are deprecated perhaps it’s time someone posts a SAI version.

Here’s the sql (obviously, replace all instances of xxx with whatever value you want there):

[CODE]SET @entry := xxx; – Game object entry

SET @text := ‘xxx’; – Tooltip to show when hoving over portal

SET @display := 1327; – Display id to use for the portal

– Coordinates to port to:

SET @map := xxx; – Map id

SET @x := xxx;

SET @y := xxx;

SET @z := xxx;

SET @o := xxx; – Orientation in radians, 0 is north

INSERT INTO gameobject_template VALUES (@entry,10,@display,@text,‘’,‘’,‘’,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,‘SmartGameObjectAI’,‘’,1);

INSERT INTO smart_scripts VALUES (@entry,1,0,0,64,0,100,0,0,0,0,0,62,@map,0,0,0,0,0,0,0,0,0,@x,@y,@z,@o,CONCAT(@text, ’ - On click - Teleport’));[/CODE]

For example, a portal to shatterspear village:

[CODE]SET @entry := 500001; – Game object entry

SET @text := ‘Portal to Shatterspear Village’; – Tooltip to show when hoving over portal

SET @display := 1327; – Display id to use for the portal

– Coordinates to port to:

SET @map := 1; – Map id

SET @x := 7367.77;

SET @y := -1560.74;

SET @z := 163.45;

SET @o := 2.55; – Orientation in radians, 0 is north

INSERT INTO gameobject_template VALUES (@entry,10,@display,@text,‘’,‘’,‘’,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,‘SmartGameObjectAI’,‘’,1);

INSERT INTO smart_scripts VALUES (@entry,1,0,0,64,0,100,0,0,0,0,0,62,@map,0,0,0,0,0,0,0,0,0,@x,@y,@z,@o,CONCAT(@text, ’ - On click - Teleport’));[/CODE]

Then you missed http://www.trinitycore.org/f/topic/1000-telenpc-database-only/

No I didn’t miss it, that’s been there for a while now. A teleportation npc with several options is not the same thing as an object porting you when you click it.

Personally I intend to use the portals for a completely different purpose than a teleportation npc is usually used for. But what others use and what they use it for is up to them of course /emoticons/default_smile.png

Nice

Thanks for the share chocochaos. ^^

Although I notice you didn’t use the display variable in the statement. I don’t see a reason for declaring it anyway. (not that it matters)

Sorry for bringin it up, but this does not work with me…
I have compared my MySQL-entry with the Wiki-Page but with success.

When i right-click my portal, nothing happens.

Smart-Script:

INSERT INTO smart_scripts VALUES (500000, 1, 0, 0, 64, 0, 100, 0, 0, 0, 0, 0, 62, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, -902.144, -572.058, 6.87959, 1.5855, ‘Portal to Southshore - On click - Teleport’);
Gameobject:

INSERT INTO gameobject_template VALUES (500000, 10, 1327, ‘Portal to Southshore’, ‘’, ‘’, ‘’, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ‘SmartGameObjectAI’, ‘’, 0);
if needed, i will post it with the column names inside the query.
I hope someone can help me.

Best regards,
Firerfan

//EDIT: Fixed
Smart-script target-type had to be set to 7…

In the original SQL I posted target-type was set to 0, that works fine for me. In the queries you posted you set it to 1.

Have you tried it with 0 as the target-type?

EDIT: although I guess SMART_TARGET_ACTION_INVOKER does make more sense than SMART_TARGET_NONE…

Can anyone give me the script for a portal to gurubashi arena please /emoticons/default_smile.png I must be missing something as i can’t get it to work. I can create and spawn the portal but it does not transport you there…

Any help would be appreciated!

Edit* TrinityCore rev. unknown 1970-01-01 00:00:00 +0000 (Archived branch) (Win64, Release) unknown TDB 335.58