How to make warp npc menu

These ads disappear when you log in.

Results 1 to 8 of 8
  1. #1
    ***Munchy***'s Avatar Master Sergeant
    Reputation
    13
    Join Date
    Jun 2008
    Posts
    87
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)

    How to make warp npc

    Here is a guide for ppl i quess lol for npc :wave:



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


    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:

    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:

    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:

    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:

    {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:

    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:

    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:

    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:
    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:
    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
    2 Words guys dont like enless you put them together "dont" and "stop".

    These ads disappear when you log in.

  2. #2
    ***Munchy***'s Avatar Master Sergeant
    Reputation
    13
    Join Date
    Jun 2008
    Posts
    87
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    If u need any help at all ask me. [dont take my +rep thingy as if i want +rep want to try something lol. +Rep + Rep
    2 Words guys dont like enless you put them together "dont" and "stop".

  3. #3
    ***Munchy***'s Avatar Master Sergeant
    Reputation
    13
    Join Date
    Jun 2008
    Posts
    87
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    lol ok i know hot to do +rep sigh now
    2 Words guys dont like enless you put them together "dont" and "stop".

  4. #4
    Appled's Avatar Contributor
    Reputation
    105
    Join Date
    Apr 2007
    Posts
    568
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Nice +2 rep

  5. #5
    Jackie Moon's Avatar Elite User CoreCoins User
    Reputation
    407
    Join Date
    May 2008
    Posts
    921
    Thanks G/R
    0/0
    Trade Feedback
    1 (100%)
    Cool... bit of a confusing guide def not for beginners
    Check out my YouTube: SkeetzGaming

  6. #6
    **Sweeny**'s Avatar Knight-Lieutenant
    Reputation
    33
    Join Date
    Dec 2007
    Posts
    282
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Wow.. this is just magers guide...
    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
    Copy and paste O.o
    You could have alteast put the source code in [c ode] [/code] that's just confusing for people..
    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
    Last edited by **Sweeny**; 07-22-2008 at 01:19 AM.

  7. #7
    bloodyhell321's Avatar Private
    Reputation
    1
    Join Date
    Sep 2008
    Posts
    2
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Question, What is the NPC ID? Is it the actual id to spawn a npc like .npc spawn NPC_ID? Or is it the SQL entry? Willing to give a +rep to anyone who tells me

  8. #8
    *Scripted*'s Avatar Banned
    Reputation
    41
    Join Date
    Aug 2008
    Posts
    240
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Its ok he wants member rank :P no rlly u failz don't Copy and paste...

Similar Threads

  1. [Guide] How to make a NPC cast spells. NO LUA!
    By Power of Illuminati in forum WoW EMU Guides & Tutorials
    Replies: 52
    Last Post: 05-06-2011, 07:13 AM
  2. How to make custom npcs, quests ect
    By nigthy in forum WoW EMU Guides & Tutorials
    Replies: 8
    Last Post: 05-24-2008, 02:09 PM
  3. How to make custom npc's In the easy way!
    By Synthio in forum WoW EMU Guides & Tutorials
    Replies: 15
    Last Post: 05-23-2008, 08:36 AM
  4. [Question] how to make custom NPCS?
    By sonnyd666 in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 03-30-2008, 10:21 AM
  5. {PICS}How to make a NPC Have Armor or a Weapon
    By Dragonscale in forum WoW EMU Guides & Tutorials
    Replies: 20
    Last Post: 12-29-2007, 05:34 AM
All times are GMT -5. The time now is 09:37 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved. Digital Point modules: Sphinx-based search