Hello & Welcome to our community. Is this your first visit? Register
Follow us on
Follow us on Facebook Follow us on Twitter Watch us on YouTube


MMOCoin

Likes Likes:  0
Results 1 to 6 of 6

Thread: C++ Portal

  1. #1
    Contributor
    StickyIcky's Avatar
    Join Date
    Jul 2008
    Location
    127.0.0.1
    Posts
    747
    Post Thanks / Like
    Rep Power
    19
    Reputation
    188

    C++ Portal


    Register to remove this ad
    Made 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
    Then you want to add this a few lines down from that:
    Code:
    class tele_Org: public GameObjectAIScript // Org portal
    Then add:
    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 you will have to make a game object in your database for it.
    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



  2. Related Threads - Scroll Down after related threads if you are only interested to view replies for above post/thread

  3. #2
    Scout
    Synthetic's Avatar
    Join Date
    Aug 2008
    Posts
    25
    Post Thanks / Like
    Rep Power
    17
    Reputation
    13
    Nice script, works.. but why dont u make portals in lua? c++ portals require alot more work.

  4. #3
    Scout
    Synthetic's Avatar
    Join Date
    Aug 2008
    Posts
    25
    Post Thanks / Like
    Rep Power
    17
    Reputation
    13
    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

  5. #4
    Contributor
    StickyIcky's Avatar
    Join Date
    Jul 2008
    Location
    127.0.0.1
    Posts
    747
    Post Thanks / Like
    Rep Power
    19
    Reputation
    188
    I don't know LUA one bit...thats why =P

  6. #5
    Contributor
    Boxxy's Avatar
    Join Date
    Aug 2008
    Location
    Florida
    Posts
    351
    Post Thanks / Like
    Rep Power
    18
    Reputation
    136
    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

  7. #6
    Contributor
    StickyIcky's Avatar
    Join Date
    Jul 2008
    Location
    127.0.0.1
    Posts
    747
    Post Thanks / Like
    Rep Power
    19
    Reputation
    188

    Register to remove this ad
    Idc...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

 

 

Visitors found this page by searching for:

c portal

SEO Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -5. The time now is 03:42 PM.
Powered by vBulletin® Copyright ©2000-2024, Jelsoft Enterprises Ltd.
See More links by ForumSetup.net. Feedback Buttons provided by Advanced Post Thanks / Like (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
vBulletin Licensed to: MMOPro.org