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 3 of 3
  1. #1
    Scout

    Join Date
    Jul 2009
    Posts
    20
    Post Thanks / Like
    Rep Power
    16
    Reputation
    40

    [C++] Create A Custom Teleporter NPC


    Register to remove this ad
    well this is fully done in notepad for me cause the computer i do my programming and stuff is broken and i gotta buy a new copy of windows
    for it but hey alteast im trying here
    ok



    type this into your notepad or visual c++ or what ever your gonna use

    Code:
    
    
    Code:
      #include "StdAfx.h"
    #include "Setup.h"
    
    #ifdef WIN32
    #pragma warning(disable:4305)
    #endif
    

    that is your opening text

    Next type this under that


    Code:
    
    
    Code:
       
    class SCRIPT_DECL GlobalNPC : public GossipScript
    {
    public:
        void GossipHello(Object * pObject, Player* Plr, bool AutoSend);
        void GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code);
        void GossipEnd(Object * pObject, Player* Plr);
        void Destroy()
        {
            delete this;
        }
    };
    
    
    
    ok now we will make the opening menu that you see when you speak to the warpNPC


    Code:
    
    
    Code:
       
    void GlobalNPC::GossipHello(Object * pObject, Player* Plr, bool AutoSend)
        {
            GossipMenu *Menu;
            objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
    
    
    now here is where we divide the horde and ally warps

    "i got bored of old color so i went to red"
    Code:
    
    
    Code:
      
            if(Plr->getRace()== 10||Plr->getRace()== 2||Plr->getRace()== 6||Plr->getRace()== 8||Plr->getRace()== 5)
    
    ok that divided them so now under that put

    Code:
    
    
    Code:
      
            {Menu->AddItem(0, "Horde Cities", 1);}else{Menu->AddItem(1, "Alliance Cities", 2);}
    
    
    that will make it where if alliance they cant port to horde and if horde they cant port to alliance


    Code:
    
    
    Code:
       
            Menu->AddItem(2, "Global Locations", 80);        
    
    
    look at taht study it clearly stare stare stare BAM!!! you got hit with knowledge

    lets break it down

    Menu- its stating that its part of the menu obvious right

    ->pointing to the command i guess lol thats my easy description

    AddItem - This is what will add this to be selectable on the menu as a port or another menu with more ports

    the 2 is just a number for the icon that will be next to it i usually put 0 for it cuase im cool like that

    "Global Locations" - that is the name of the menu or port

    then 80 - that is the case that that menu links to

    ok lets create our own little custom one here just so we understand it

    now do what ever you want for yours dont scroll down past the line below til you finish your menu peice



    _

    ok for my creation i got


    Menu->AddItem(4, "ZOMG this guide is awesome", 20);

    weird eh,

    but if your menu is kind like mine then Good job

    now before we go any further let me mention the case thing i said earlier

    on my example i put the case as 20

    so somewhere in my script will be



    Code:
    
    
    Code:
              
            case 20: //Magers guide        
    
    
    now if you have a slight C++ knowledge you know what that means
    but if you dont well then your screwed lol j/k
    the case is what the link will send you to
    if the case is a teleport it will port you to where its supposed to
    if its a menu you get to go to another menu again

    do you kinda understand??

    anyway after you made all the menu items you want for the first thing

    (btw dont make the Case the same as others or else it will do the same thing)

    after your done with your main menu type
    Code:
    
    
    Code:
     
            if(AutoSend)
                Menu->SendTo(Plr);
        }
    
    void GlobalNPC::GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
        {
        Creature * pCreature = (pObject->GetTypeId()==TYPEID_UNIT)?((Creature*)pObject):NULL;
        if(pCreature==NULL)
            return;
    
            GossipMenu * Menu;
            switch(IntId)
            {        
    
    
    it should somewhat look like this

    Code:
            if(Plr->getRace()== 10||Plr->getRace()== 2||Plr->getRace()== 6||Plr->getRace()== 8||Plr->getRace()== 5)
            {Menu->AddItem(0, "Horde Cities", 1);}else{Menu->AddItem(1, "Alliance Cities", 2);}            
            Menu->AddItem(3, "Azeroth Instances", 30);
            Menu->AddItem(4, "Outland Instances", 50);
            Menu->AddItem(5, "Shattrath", 20);
            Menu->AddItem(6, "Gurubashi Arena", 21);
            Menu->AddItem(8, "Buff me up, baby!", 96);
            Menu->AddItem(7, "Make This Place Your Home", 95);        
            Menu->AddItem(9, "Remove Resurrection Sickness", 97);
    
            if(AutoSend)
                Menu->SendTo(Plr);
        }
    
    void GlobalNPC::GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
        {
        Creature * pCreature = (pObject->GetTypeId()==TYPEID_UNIT)?((Creature*)pObject):NULL;
        if(pCreature==NULL)
            return;
    
            GossipMenu * Menu;
            switch(IntId)
            {
    great now we got that set up
    time for Case 0:
    Code:
    
    
    Code:
     case 0: 
            GossipHello(pObject, Plr, true);
            break;
    that goes directly under the little "{" mark from the code above

    now we go to case 1

    now one of your menu items that you made should have started with case 1 if not change it or just do a different case its all the same thing

    now if you want the case to send you to another menu just make it look like this a bit
    Code:
    
    
    Code:
     case 1: 
                    {
                    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
                    Menu->AddItem(5, "Silvermoon", 4);
                    Menu->AddItem(5, "Orgrimmar", 5);
                    Menu->AddItem(5, "Thunder Bluff", 6);
                    Menu->AddItem(5, "Undercity", 7);
    
                    Menu->SendTo(Plr);
                    }
            break;
    that goes directly under the little "{" mark from the code above

    I taught the Menu items so i dont need to describe that again
    and the Menu->SendTo(Plr);
    just make it to where it shows up

    all you need to know now is to make it port

    that would be a simple command

    so lets base off of Menu->AddItem(5, "Thunder Bluff", 6);

    so now we will put

    Code:
            case 6://ThunderBluff
                {
                    Plr->EventTeleport(1, -1304.569946, 205.285004, 68.681396);
                }
                break;
    the //thunderbluff is just a comment that reminds you that, that one is the one that ports you to Thunder bluff

    Plr->EventTeleport - that is innitiating that the Plr or Player is going have the event teleport used on him/her

    then the coords are where you end up at


    now just type this at the bottom of this and your done


    Code:
      void GlobalNPC::GossipEnd(Object * pObject, Player* Plr)
    {
        GossipScript::GossipEnd(pObject, Plr);
    }
    
    void SetupGlobalNPC(ScriptMgr * mgr)
    {
        GossipScript * gs = (GossipScript*) new GlobalNPC();
        mgr->register_gossip_script(NPC ID)
    }
    replace the NPC ID with your NPCs ID and compile

    if you need help compiling look to another guide please

    Well Guys i hoped you liked it and please leave feed back

    i wanna know what you guys think


    › See More: [C++] Create A Custom Teleporter NPC
    Last edited by Apple; 16-02-10 at 10:46 PM.



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

  3. #2
    Scout
    Torgash's Avatar
    Join Date
    Mar 2009
    Location
    In My Computer!
    Posts
    12
    Post Thanks / Like
    Rep Power
    16
    Reputation
    8
    Nice.

  4. #3
    Beginner

    Join Date
    Nov 2009
    Posts
    2
    Post Thanks / Like
    Rep Power
    15
    Reputation
    1

    Register to remove this ad
    i will try this now. But i have to say the colors you used to make this tutorial are so ugly !

 

 

Visitors found this page by searching for:

how to make a c teleporter

wow custom teleporter npc

teleport

trinity c teleporter

Trinity Teleporter NPC

teleport npc c

trinity world.config npc teleport

npc teleporter trinity tutorial

c teleport npc trinity

teleporter npc trinity

custom npc trinity

trinity npc teleporter

how to make a wow teleporter with c

custom trinity teleporter

wow trinity teleporter npc

how to make your own trinity NPC script

c npc custom wow

trinitycore custom npc script

teleporter npc for trinity

trinity teleporter C

trinity teleporter full custom

c teleport npc

Téléporteur multiple c trinity

create custom teleport npc trinity

how to make a teleport npc in trinity

trinitycore custom teleport npc

Teleporter c trinity

npc teleport trinity

custome teleport npc trinity

wow trinity teleport npc

how to create wow teleporter npc

wow how to make a teleporter npc

wow basic c teleporter script

teleporter

C ArcEmu how to make a Teleporter NPCcréer pnj teleporteur trinityascent emulator c teleporterHow to make NPC Teleport trinityC Teleporterhow to make custom npcs in c arcemucréer un pnj téléporteur c trinityhow to make trinity Npc Teleporterhow to make a custom teleporter for trinity with C how to make a C teleporter npc arcemucustom teleporter trinityhow to make a custom npc for trinitycustom teleporter for trinityhwo to make my own teleporter in wow C custom trinity teleport tool create teleporter trinity
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 10:32 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