chocochaos
Verified Member
- 14
- 2014
- 4
- Location
- The Netherlands
Most people make custom portals by modifying an existing portal spell's coordinates in the spell_target_position. That's messy, and you quickly run out of spells to use when you are making a lot of portals (as part of an event, for example).
Here's the sql (obviously, replace all instances of xxx with whatever value you want there):
For example, a portal to shatterspear village:
Here's the sql (obviously, replace all instances of xxx with whatever value you want there):
Code:
SET @entry := xxx; -- New game object id for the portal object
SET @text := 'xxx'; -- Tooltip to show when hovering 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'));
For example, a portal to shatterspear village:
Code:
SET @entry := 500001; -- New game object id for the portal object
SET @text := 'Portal to Shatterspear Village'; -- Tooltip to show when hovering 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'));