Likes: 0
Results 1 to 6 of 6
Thread: C++ Portal
-
25-07-08, 01:44 PM #1
C++ Portal
Register to remove this adMade by WigSplitta
In this tutorial I will show you how to make a portal in C++.
I will be using a portal that goes to Orgrimmar for an example
Well first of all we need to start the clean .cpp file with this:
Code:#include "StdAfx.h" #include "Setup.h" #ifdef WIN32 #pragma warning(disable:4305) // warning C4305: 'argument' : truncation from 'double' to 'float' #pragma warning(disable:4018) // warning C4018: '<' : signed/unsigned mismatch #endif #define GAME_OBJECT_ID 20000000 //Your Portal GO ID
Code:class tele_Org: public GameObjectAIScript // Org portal
Code:{ public: tele_Org(GameObject* goinstance) : GameObjectAIScript(goinstance) {} void OnActivate(Player * pPlayer) { pPlayer->SafeTeleport(0, 0, 2066.594727, 284.810089, 97.031319, 1); //Map Id, 0, X, Y, Z, O } static GameObjectAIScript *Create(GameObject * GO) { return new tele_Org(GO); } }; GameObjectAIScript * create_goGAME_OBJECT_ID(GameObject * GO) { return new tele_Org(GO); }
Then change #define GAME_OBJECT_ID 20000000 to whatever the GO ID is.
It should now look like:
Code:#include "StdAfx.h" #include "Setup.h" #ifdef WIN32 #pragma warning(disable:4305) // warning C4305: 'argument' : truncation from 'double' to 'float' #pragma warning(disable:4018) // warning C4018: '<' : signed/unsigned mismatch #endif #define GAME_OBJECT_ID 20000000 //Your Portal GO ID class tele_Org: public GameObjectAIScript // Org portal { public: tele_Org(GameObject* goinstance) : GameObjectAIScript(goinstance) {} void OnActivate(Player * pPlayer) { pPlayer->SafeTeleport(0, 0, 2066.594727, 284.810089, 97.031319, 1); //Map Id, 0, X, Y, Z, O } static GameObjectAIScript *Create(GameObject * GO) { return new tele_Org(GO); } }; GameObjectAIScript * create_goGAME_OBJECT_ID(GameObject * GO) { return new tele_Org(GO); }
› See More: C++ Portal
-
31-08-08, 09:08 AM #2
Nice script, works.. but why dont u make portals in lua? c++ portals require alot more work.
-
31-08-08, 09:24 AM #3
Oh, i now realise u dont know lua My bad.
Synth's Scripting
If u need somekind of help scripting? ask me! i'll gladly make u and simple script for free. These script lang's i know. C++ Blua Lua
-
31-08-08, 10:58 PM #4
-
31-08-08, 11:38 PM #5
Very nice script but even without any lua skills creating lua portals is bolth easyer and more usfull(you dont have to complie it every core change XD).
your mother
-
31-08-08, 11:41 PM #6
Register to remove this adIdc...I will eventually learn LUA but im not going to go out of my way to learn it when C++ is better...even tho LUA is faster...and easier to use cuz u dont need to compile it everytime...but idk really i just like it better