PDA

View Full Version : [GM]How to add custom portals (the real way)


Jargs
09-05-2007, 04:39 PM
Written by Daikenkaiking

First off, lets get down to the basics of what you need:
1. A Custom Portal Added to the DB, with a Unique entry ( SQL at bottom of post )
2. Basic knowledge on how to use the GM Scripts, and how to add them to your server.

Lets Get Started!
We're going to be making a portal to the STV Arena as the example.

A Link in the CODE boxes with + in front of it means that line was added at this step.

First off, open up a Blank Document ( I recommend notepad, as it doesn't add any custom headers or other junk to the file ).
Lets Create a Function we can use to make the Portal.
global TELE_GURUBASHI = function(plr)
{
};What we are doing here is creating a basic function. This won't do anything until we add more stuff to it, so moving on...
We need to add the script to move the player to the location, this is done by the Teleport(); command.
global TELE_GURUBASHI = function(plr)
{
+ plr.Teleport(0, -13232.7, 219.565, 31.9761);
};A breakdown of the Teleport(); Function:
Teleport(mapid, x coord, y coord, z coord);

For the Gurubashi Arena, the coords are as follows:
MapID: 0
X: -13232.7
Y: 219.565
Z: 31.9761

This script still will not work, as we've not yet defined the GameObject Event to run the function, we'll do that now.
global TELE_GURUBASHI = function(plr)
{
plr.Teleport(0, -13232.7, 219.565, 31.9761);
};
+.RegisterGameObjectEvent(GO_ID, 2, TELE_GURUBASHI);You must replace GO_ID with the portal ID in your DB ( SQL is at the bottom ).
What this does, is when the portal is clicked, tells the server to run the TELE_GURUBASHI function, or the teleport player function.

This script is now operational. Optionally, you could add a message to the player, this could be done like the following:
global TELE_GURUBASHI = function(plr)
{
plr.Teleport(0, -13232.7, 219.565, 31.9761);
+ plr.SendSystemMessage("Welcome to the Gurubashi PvP Arena!");
};
.RegisterGameObjectEvent(GO_ID, 2, TELE_GURUBASHI);Now save this file as something.gm, such as "ArenaTele.gm" and add it to the "scripts" folder on your server. If there is not a scripts folder, create one. Then, either type reloadscripts in the console, or .reloadscripts InGame, and add the GO to the game, and click on it!

I hope someone finds this useful, and any problems, feel free to ask for help. :)
Portal SQL:
insert into `gameobject_names` (`entry`, `Type`, `DisplayID`, `Name`, `spellfocus`, `sound1`, `sound2`, `sound3`, `sound4`, `sound5`, `sound6`, `sound7`, `sound8`, `sound9`, `unknown1`, `unknown2`, `unknown3`, `unknown4`, `unknown5`, `unknown6`, `unknown7`, `unknown8`, `unknown9`, `unknown10`, `unknown11`, `unknown12`, `unknown13`, `unknown14`) values('500000','4','5231','Portal to Gurubashi Arena','0','0','1','0','0','0','0','0','0','0','0' ,'0','0','0','0','0','0','0','0','0','0','0','0',' 0');

amanzer1
09-05-2007, 06:19 PM
wicked, so basically for any portal I just have to substitute the name, co-ordinates, and the game object id?

That's awesome, thanks so much Jargs.

EDIT: Only thing that i found an error with was in the SQL code that you have to put into your db. if you're using repack 6.5, the spellfocus column is fixed(you obviously know this, lol) But the column in your code has the 'sound0' in it. :)
Just thought i'd mention that. ;)

Jargs
09-05-2007, 06:43 PM
Ah ok i'll fix it one sec

amanzer1
09-05-2007, 10:16 PM
This script still will not work, as we've not yet defined the GameObject Event to run the function, we'll do that now.
global TELE_GURUBASHI = function(plr)
{
plr.Teleport(0, -13232.7, 219.565, 31.9761);
};
+.RegisterGameObjectEvent(GO_ID, 2, TELE_GURUBASHI);You must replace GO_ID with the portal ID in your DB ( SQL is at the bottom ).
What this does, is when the portal is clicked, tells the server to run the TELE_GURUBASHI function, or the teleport player function.
[/code]


lol i am such a moron, my portals weren't working... i should read better. :) i just left it as GO_ID. lolz d'oh!

krazyone432
09-06-2007, 12:33 AM
Jargs put displayID's of portals that you can use (org portal darn portal summoning portal etc.) so it's easier

lilnate22
09-06-2007, 01:10 AM
ill make a video later for retards

krazyone432
09-06-2007, 02:00 AM
Dee dur dee!

Nate could you make a tutorial on how to install db's? like.. acdb over ncdb?

amanzer1
09-06-2007, 02:28 AM
hmmm, I'm having problems with the portal actually working.. Like it's not sending me anywhere... I'm gonna poke around a bit and see if I can fix it.

EDIT: Fixed the problem I was having. Works great!! Thanks Jargs

Wes0617
12-12-2007, 09:00 PM
Do I replace the GO_ID with the display ID of the portal SQL script?

doublehex
12-12-2007, 09:03 PM
this is gm script, its been removed so this is no good if you are using 7.3

Wes0617
12-12-2007, 09:13 PM
Oh ok well can anyone tell me a link to a tut about how to make custom portals on ascent 7.3?

playboy87
12-13-2007, 08:59 AM
Use The Search God Dam.

ukmatty1
02-07-2008, 08:33 PM
Best Guide i seen on makeing Portal's

Clain
02-07-2008, 08:35 PM
And you just bumped a post from 12-13-07

szela_93
02-07-2008, 08:35 PM
necroposting.........

Clain
02-07-2008, 08:36 PM
Plus GM scripting is gone, its lua now