[Request]WarpNPC

Results 1 to 15 of 15
  1. #1
    C# Developer stealarcher is offline
    Grand MasterRank
    Jan 2008 Join Date
    571Posts

    [Request]WarpNPC

    Well, i have looked at a lot of guides, but none of them seem to work, or have missing links. I was wondering if anyone could help me get a working Warp NPC or teleporter, w/e u wanna call it. Or atleast direct me to a link that could help me make one. +rep if you can


  2. #2
    Sorcerer Supreme Kira90 is offline
    Member +Rank
    Jun 2007 Join Date
    Erm ... Er ... *Sneezes*Location
    320Posts

    Re: [Request]WarpNPC

    This site doesnt have a rep system ... lol
    This is for LUA :
    Code:
        ----------------------------------------------------------
        ----- Created by Tazjin -----
        -----------------------------------------------------------
        function warp_on_gossip_talk(unit, event, player)
    
        unit:GossipCreateMenu(3543, player)
        unit:GossipMenuAddItem(player, 0, "Horde cities", 1, 0)
        unit:GossipMenuAddItem(player, 0, "Alliance cities", 2, 0)
        unit:GossipMenuAddItem(player, 0, "Azeroth Instances", 5, 0)
        unit:GossipMenuAddItem(player, 0, "Outland Instances", 6, 0)
        unit:GossipMenuAddItem(player, 5, "Shattrath", 51, 0)
        unit:GossipSendMenu(player)
        end
    
        function warp_on_gossip_select(unit, event, player, id, intid, code)
    
    
        if(intid == 1) then
        unit:GossipCreateMenu(3542, player)
        unit:GossipMenuAddItem(player, 5, "Orgrimmar", 9, 0)
        unit:GossipMenuAddItem(player, 5, "Undercity", 10, 0)
        unit:GossipMenuAddItem(player, 5, "Thunder Bluff", 11, 0)
        unit:GossipMenuAddItem(player, 5, "Silvermoon", 12, 0)
        unit:GossipMenuAddItem(player, 5, "[Back]", 100, 0)
        unit:GossipSendMenu(player)
        end
    
        if(intid == 2) then
        unit:GossipCreateMenu(3542, player)
        unit:GossipMenuAddItem(player, 5, "Stormwind", 14, 0)
        unit:GossipMenuAddItem(player, 5, "Ironforge", 15, 0)
        unit:GossipMenuAddItem(player, 5, "Darnassus", 16, 0)
        unit:GossipMenuAddItem(player, 5, "Exodar", 17, 0)
        unit:GossipMenuAddItem(player, 5, "[Back]", 100, 0)
        unit:GossipSendMenu(player)
        end
    
        if(intid == 5) then
        unit:GossipCreateMenu(3542, player)
        unit:GossipMenuAddItem(player, 0, "Azeroth Raids", 3, 0)
        unit:GossipMenuAddItem(player, 5, "Shadowfang Keep", 19, 0)
        unit:GossipMenuAddItem(player, 5, "Scarlet Monastery", 20, 0)
        unit:GossipMenuAddItem(player, 5, "Zul'Farrak", 21, 0)
        unit:GossipMenuAddItem(player, 5, "Stratholme", 22, 0)
        unit:GossipMenuAddItem(player, 5, "Scholomance", 23, 0)
        unit:GossipMenuAddItem(player, 5, "Ragefire", 110, 0)
        unit:GossipMenuAddItem(player, 5, "Deathmines", 170, 0)
        unit:GossipMenuAddItem(player, 5, "Those caverns in barrens xX", 111, 0)
        unit:GossipMenuAddItem(player, 5, "Blackfathom deepths", 112, 0)
        unit:GossipMenuAddItem(player, 5, "This instance in Stormwind biggrin.gif", 113, 0)
        unit:GossipMenuAddItem(player, 5, "Gnomeregan", 114, 0)
        unit:GossipMenuAddItem(player, 5, "Razorfen thing number 1", 115, 0)
        unit:GossipMenuAddItem(player, 5, "Razorfen hills", 116, 0)
        unit:GossipMenuAddItem(player, 5, "Uldaman", 117, 0)
        unit:GossipMenuAddItem(player, 5, "Maraudon", 118, 0)
        unit:GossipMenuAddItem(player, 5, "Sunken temple", 119, 0)
        unit:GossipMenuAddItem(player, 5, "Lower Blackrock", 120, 0)
        unit:GossipMenuAddItem(player, 5, "Dire Maul", 121, 0)
        unit:GossipMenuAddItem(player, 5, "Upper Blackrock", 122, 0)
        unit:GossipMenuAddItem(player, 5, "[Back]", 100, 0)
        unit:GossipSendMenu(player)
        end
    
        if(intid == 6) then
        unit:GossipCreateMenu(3542, player)
        unit:GossipMenuAddItem(player, 5, "Outland Raids", 4, 0)
        unit:GossipMenuAddItem(player, 5, "Hellfire Ramparts", 25, 0)
        unit:GossipMenuAddItem(player, 5, "Blood furnace", 26, 0)
        unit:GossipMenuAddItem(player, 5, "Shattered Halls", 27, 0)
        unit:GossipMenuAddItem(player, 5, "Underbog", 28, 0)
        unit:GossipMenuAddItem(player, 5, "Slave pens", 29, 0)
        unit:GossipMenuAddItem(player, 5, "Steam whatever tongue.gif", 30, 0)
        unit:GossipMenuAddItem(player, 5, "Mana tombs", 31, 0)
        unit:GossipMenuAddItem(player, 5, "Auchenai crypts", 32, 0)
        unit:GossipMenuAddItem(player, 5, "Sethekk halls", 33, 0)
        unit:GossipMenuAddItem(player, 5, "Shadow lab", 34, 0)
        unit:GossipMenuAddItem(player, 5, "Mechanar", 35, 0)
        unit:GossipMenuAddItem(player, 5, "Bota whatever Oo", 36, 0)
        unit:GossipMenuAddItem(player, 5, "Arcatraz", 37, 0)
        unit:GossipMenuAddItem(player, 5, "Caverns of Time", 52, 0)
        unit:GossipMenuAddItem(player, 5, "[Back]", 100, 0)
        unit:GossipSendMenu(player)
        end
    
        if(intid == 3) then
        unit:GossipCreateMenu(3542, player)
        unit:GossipMenuAddItem(player, 5, "Onyxias Lair", 39, 0)
        unit:GossipMenuAddItem(player, 5, "Molten Core", 40, 0)
        unit:GossipMenuAddItem(player, 5, "Blackwing Lair", 123, 0)
        unit:GossipMenuAddItem(player, 5, "Zul'Gurub", 41, 0)
        unit:GossipMenuAddItem(player, 5, "Karazhan", 42, 0)
        unit:GossipMenuAddItem(player, 5, "Ruins of Ahn'Qiraj", 43, 0)
        unit:GossipMenuAddItem(player, 5, "Temple of Ahn'Qiraj", 44, 0)
        unit:GossipMenuAddItem(player, 5, "Naxxramas", 45, 0)
        unit:GossipMenuAddItem(player, 5, "Zul'Aman", 124, 0)
        unit:GossipMenuAddItem(player, 5, "Caverns of Time", 52, 0)
        unit:GossipMenuAddItem(player, 5, "[Back]", 100, 0)
        unit:GossipSendMenu(player)
        end
    
        if(intid == 4) then
        unit:GossipCreateMenu(3542, player)
        unit:GossipGossipMenuAddItem(player, 5, "Black Temple", 50, 0)
        unit:GossipGossipMenuAddItem(player, 5, "Tempest Keep", 49, 0)
        unit:GossipGossipMenuAddItem(player, 5, "Gruuls Lair", 48, 0)
        unit:GossipMenuAddItem(player, 5, "Serpentshrine caverns", 47, 0)
        unit:GossipMenuAddItem(player, 5, "Maghteridons Lair", 46, 0)
        unit:GossipMenuAddItem(player, 5, "[Back]", 100, 0)
        unit:GossipSendMenu(player)
        end
    
        if(intid == 12) then
        player:Teleport(530, 9400.486328, -7278.376953, 14.206780)
        end
    
        if(intid == 9) then
        player:Teleport(1, 1371.068970, -4370.801758, 26.052483)
        end
    
        if(intid == 11) then
        player:Teleport(1, -1304.569946, 205.285004, 68.681396)
        end
    
        if(intid == 10) then
        player:Teleport(0, 2050.203125, 285.650604, 56.994549)
        end
    
        if(intid == 17) then
        player:Teleport(530, -4072.202393, -12014.337891, -1.277277)
        end
    
        if(intid == 14) then
        player:Teleport(0, -9100.480469, 406.950745, 92.594185)
        end
    
        if(intid == 15) then
        player:Teleport(0, -5028.265137, -825.976563, 495.301575)
        end
    
        if(intid == 16) then
        player:Teleport(1, 9985.907227, 1971.155640, 1326.815674)
        end
    
        if(intid == 51) then
        player:Teleport(530, -1887.510010, 5359.379883, -12.427300)
        end
    
        if(intid == 19) then
        player:Teleport(0, -234.495087, 1561.946411, 76.892143)
        end
    
        if(intid == 20) then
        player:Teleport(0, 2870.442627, -819.985229, 160.331085)
        end
    
        if(intid == 21) then
        player:Teleport(1, -6797.278809, -2903.917969, 9.953360)
        end
    
        if(intid == 41) then
        player:Teleport(0, -11919.073242, -1202.459374, 92.298744)
        end
    
        if(intid == 43) then
        player:Teleport(1, -8394.730469, 1485.658447, 21.038563)
        end
    
        if(intid == 44) then
        player:Teleport(1, -8247.316406, 1970.156860, 129.071472)
        end
    
        if(intid == 40) then
        player:Teleport(409, 1089.6, -470.19, -106.41)
        end
    
        if(intid == 39) then
        player:Teleport(1, -4746, -3749, -4.0)
        end
    
        if(intid == 45) then
        player:Teleport(533, 3006.06, -3436.72, 293.891)
        end
    
        if(intid == 23) then
        player:Teleport(0, 1267.468628, -2556.651367, 94.127983)
        end
    
        if(intid == 24) then
        player:Teleport(0, 3359.111572, -3380.8444238, 144.781860)
        end
    
        if(intid == 38) then
        player:Teleport(0, -7527.129883, -1224.997437, 285.733002)
        end
    
        if(intid == 42) then
        player:Teleport(532, -11087.3, -1977.47, 49.6135)
        end
    
        if(intid == 52) then
        player:Teleport(1, -8519.718750, -4297.542480, -208.441376)
        end
    
        if(intid == 25) then
        player:Teleport(530, -360.670990, 3071.899902, -15.097700)
        end
    
        if(intid == 26) then
        player:Teleport(530, -303.506012, 3164.820068, 31.742500)
        end
    
        if(intid == 27) then
        player:Teleport(530, -311.083527, 3083.291748, -3.745923)
        end
    
        if(intid == 28) then
        player:Teleport(530, 777.088989, 6763.450195, -72.062561)
        end
    
        if(intid == 29) then
        player:Teleport(530, 719.507996, 6999.339844, -73.074303)
        end
    
        if(intid == 30) then
        player:Teleport(530, 816.590027, 6934.669922, -80.544601)
        end
    
        if(intid == 31) then
        player:Teleport(530, -3079.810059, 4943.040039, -101.046997)
        end
    
        if(intid == 32) then
        player:Teleport(530, -3361.959961, 5225.770020, -101.047997)
        end
    
        if(intid == 33) then
        player:Teleport(530, -3362.219971, 4660.410156, -101.049004)
        end
    
        if(intid == 34) then
        player:Teleport(530, -3645.060059, 4943.620117, -101.047997)
        end
    
        if(intid == 35) then
        player:Teleport(530, 2862.409912, 1546.089966, 252.158691)
        end
    
        if(intid == 36) then
        player:Teleport(530, 3413.649902, 1483.319946, 182.837997)
        end
    
        if(intid == 37) then
        player:Teleport(530, 3311.598145, 1332.745117, 505.557251)
        end
    
        if(intid == 46) then
        player:Teleport(530, -313.678986, 3088.350098, -116.501999)
        end
    
        if(intid == 47) then
        player:Teleport(530, 830.542908, 6865.445801, -63.785503)
        end
    
        if(intid == 48) then
        player:Teleport(530, 3549.424072, 5179.854004, -4.430779)
        end
    
        if(intid == 49) then
        player:Teleport(530, 3087.310059, 1373.790039, 184.643005)
        end
    
        if(intid == 50) then
        player:Teleport(530, -3609.739990, 328.252014, 37.307701)
        end
    
        if(intid == 124) then
        player:Teleport(530, 6850, -7950, 170)
        end
    
        if(intid == 136) then
        player:Teleport(0, -13152.9, 342.729, 53.1328)
        end
    
        if(intid == 110) then
        player:Teleport(389, 1.7849, -14.3685, -16.5533)
        end
    
        if(intid == 111) then
        player:Teleport(1, -746.207, -2213.18, 15.8909)
        end
    
        if(intid == 112) then
        player:Teleport(48, -152.984, 106.33, -39.0953)
        end
    
        if(intid == 113) then
        player:Teleport(0, -8776.78, 836.753, 93.1946)
        end
    
        if(intid == 114) then
        player:Teleport(0, -5189.22, 524.796, 389.107)
        end
    
        if(intid == 115) then
        player:Teleport(1, -4464.92, -1666.24, 91)
        end
    
        if(intid == 116) then
        player:Teleport(129, 2591.99, 1101.25, 52.8593)
        end
    
        if(intid == 117) then
        player:Teleport(70, -228.193, 46.1602, -45.0186)
        end
    
        if(intid == 118) then
        player:Teleport(349, 419.84, 11.3365, -131.079)
        end
    
        if(intid == 119) then
        player:Teleport(0, -10349.1, -3849.67, -24.6078)
        end
    
        if(intid == 120) then
        player:Teleport(230, 596.432, -188.498, -49)
        end
    
        if(intid == 121) then
        player:Teleport(429, 254.588, -24.7395, -1.56062)
        end
    
        if(intid == 122) then
        player:Teleport(229, 73.5083, -215.044, 53.3869)
        end
    
        if(intid == 123) then
        player:Teleport(469, -7665.55, -1102.49, 400.679)
        end
    
        if(intid == 170) then
        player:Teleport(0, -11079.8, 1506.98, 42.9594)
        end
    
        intid = 0
        end
    
    
        RegisterGossipEvent(80000 , 1, "warp_on_gossip_talk") --change the NPC
        RegisterGossipEvent(80000 , 2, "warp_on_gossip_select") -- here too
    U should know how lua works ... just save it as whateve.lua and put in your scripts folder :p ... also replace the NPC ID, tested it NOW it does work ... on latest rev of openascent + lua ++ <--- this wont work without lua++

    Then for the C++ version ...
    warper.cpp
    Code:
    #include "StdAfx.h"
    #include "Setup.h"
    
    
    //////////////
    //WARPER NPC//
    //////////////
    
    class SCRIPT_DECL Warper : 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;
        }
    };
    void Warper::GossipHello(Object * pObject, Player* Plr, bool AutoSend)
        {
            GossipMenu *Menu;
            objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
                Menu->AddItem(0, "What can I do here?", 1);
                Menu->AddItem(0, "Teleport List", 2);
                //Menu->AddItem(1, "Set my hearthstone here please.", 19);
                /*Menu->AddItem(3, "AddItems", 17);*/
    
            if(AutoSend)
                Menu->SendTo(Plr);
        }
    
    void Warper::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)
            {
            case 1:
                {
                    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Here you can teleport to different locations that are listed." );
                    Plr->Gossip_Complete();
                }break;
            
            
                    
    
    
             case 2:    
                {
                    objmgr.CreateGossipMenuForPlayer(&Menu, pCreature->GetGUID(), 2593, Plr);
                    //Menu->AddItem(0, "Custom Areas", 14);
                    Menu->AddItem(0, "Main Cities", 4);
                    if (Plr->getLevel() >= 60)
                     {
                     Menu->AddItem(2, "Sky City", 18);
                     }
    
                     Menu->SendTo(Plr);
                    /*Menu->AddItem(3, "AddItems", 17);*/
                    Menu->SendTo(Plr);
                }break;
    
             case 14:
                 {
                     objmgr.CreateGossipMenuForPlayer(&Menu, pCreature->GetGUID(), 2593, Plr);
                     /*Menu->AddItem(2, "Common Shoping Centre", 3);
                     Menu->AddItem(2, "Leveling Area", 13);
                     if (Plr->GetTeam() < 1)
                     {
                     Menu->AddItem(2, "Alliance Shoping Centre", 15);
                     }
                     else
                     {
                     Menu->AddItem(2, "Horde Shoping Centre", 16);
                     }
                     if (Plr->getLevel() >= 60)
                     {
                     Menu->AddItem(2, "Sky City", 18);
                     }*/
    
                     Menu->SendTo(Plr);
                 }break;
             
             
             
             case 3: 
                 {
                      Plr->EventTeleport(530, -2345.25, 3234.94, 2.98399);
                      Plr->Gossip_Complete();
                 }break;
    
             case 4:
                 {
                     objmgr.CreateGossipMenuForPlayer(&Menu, pCreature->GetGUID(), 2593, Plr);
                     if (Plr->GetTeam() < 1)
                     {
                     Menu->AddItem(2, "Stormwind", 5);
                     Menu->AddItem(2, "Ironforge", 6);
                     Menu->AddItem(2, "Exodar", 7);
                     Menu->AddItem(2, "Darnassus", 8);
                     }
                     else
                     {
                     Menu->AddItem(2, "Orgrimar", 9);
                     Menu->AddItem(2, "Thunder Bluff", 10);
                     Menu->AddItem(2, "Silvermoon City", 11);
                     Menu->AddItem(2, "Undercity", 12);
                     }
                     if (Plr->getLevel() >= 58)
                     {
                     Menu->AddItem(2, "Shattrath City", 20);
                     }
                     Menu->SendTo(Plr);
                 }break;
    
             case 5:
                 {
                     Plr->EventTeleport(0, -8831.61, 622.666, 93.7787);
                     Plr->Gossip_Complete();
                 }break;
    
             case 6:
                 {
                     Plr->EventTeleport(0, -4804.45, -1101.14, 498.807);
                     Plr->Gossip_Complete();
                 }break;
    
             case 7:
                 {
                     Plr->EventTeleport(530, -3796.24, -11710.9, -105.45);
                     Plr->Gossip_Complete();
                 }break;
    
             case 8:
                 {
                     Plr->EventTeleport(1, 9952.07, 2278.46, 1341.39);
                     Plr->Gossip_Complete();
                 }break;
    
             case 9:
                 {
                     Plr->EventTeleport(1, 1499.55, -4406.91, 23.1642);
                     Plr->Gossip_Complete();
                 }break;
    
             case 10:
                 {
                     Plr->EventTeleport(1, -1195.88, -56.5582, 160.034);
                     Plr->Gossip_Complete();
                 }break;
    
             case 11:
                 {
                     Plr->EventTeleport(530, 9492.45, -7279.12, 14.3036);
                     Plr->Gossip_Complete();
                 }break;
    
             case 12:
                 {
                     Plr->EventTeleport(0, 1615.1, 239.786, -62.0774);
                     Plr->Gossip_Complete();
                 }break;
    
             case 13:
                 {
                     Plr->EventTeleport(1, 4605.59, -3826.49, 955.109);
                     Plr->Gossip_Complete();
                 }break;
    
             case 15:
                 {
                     Plr->EventTeleport(1, -11816.1, -4713.48, 15.6113);
                     Plr->Gossip_Complete();
                 }break;
    
             case 16:
                 {
                     Plr->EventTeleport(1, -11424.6, -4750.36, 17.5092);
                     Plr->Gossip_Complete();
                 }break;
    
             case 17:
                 {
                     pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Welcome 2 WOWReborn!" );
                     Plr->GetItemInterface()->SafeAddItem(100000, INVENTORY_SLOT_NOT_SET, 23);
                     Plr->GetItemInterface()->SafeAddItem(100001, INVENTORY_SLOT_NOT_SET, 23);
                     Plr->GetItemInterface()->SafeAddItem(100002, INVENTORY_SLOT_NOT_SET, 23);
                     Plr->GetItemInterface()->SafeAddItem(100003, INVENTORY_SLOT_NOT_SET, 23);
                     Plr->GetItemInterface()->SafeAddItem(100004, INVENTORY_SLOT_NOT_SET, 23);
                     Plr->GetItemInterface()->SafeAddItem(100005, INVENTORY_SLOT_NOT_SET, 23);
                     Plr->Gossip_Complete();
                 }break;
    
             case 18:
                 {
                     Plr->EventTeleport(1, 5235.37, -3829.22, 2017.54);
                     Plr->Gossip_Complete();
                 }break;
    
             case 19: // Bind Position
                {
                    Plr->GetSession()->SendInnkeeperBind(pCreature);
                }break;
    
             case 20:
                 {
                     Plr->EventTeleport(530, -1852.84, 5447.97, -12.4277);
                     Plr->Gossip_Complete();
                 }break;
                
                
     }
        }
    
    
    
    
    void Warper::GossipEnd(Object * pObject, Player* Plr)
    {
        GossipScript::GossipEnd(pObject, Plr);
    }
    
    
    
    /////////////////////
    //Bunjee Instructor//
    /////////////////////
    
    
    class SCRIPT_DECL Bunjee_gos : 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;
        }
    };
    void Bunjee_gos::GossipHello(Object * pObject, Player* Plr, bool AutoSend)
        {
            GossipMenu *Menu;
            objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
            Menu->AddItem(0, "Skydive Info (First Time? ... U Might Wanna Read This :D)", 1);
                Menu->AddItem(0, "!!!GOOO!!!", 2);
    
            if(AutoSend)
                Menu->SendTo(Plr);
        }
    
    
    
    void Bunjee_gos::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)
            {
            case 1:
                {
                    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Here you can skydive without any risk! ... *Hopefully :O* ... clicking on *!!!GOOO!!!* will teleport u off the ledge and induce a SKYDIVE xD ... U will also recieve a parachute ... dont use it to soon ... (or late) or u WILL die ... so ... BREAK A LEG! *We accept no liability for any lost lives ^^ P.S. : Theres a Mystic Sphere below which has been found to bring you back here *shrug*" );
                    Plr->Gossip_Complete();
                }break;
    
            case 2:
                {
                    Plr->GetItemInterface()->SafeAddItem(100006, INVENTORY_SLOT_NOT_SET, 23);
                    Plr->GetItemInterface()->SafeAddItem(17056, INVENTORY_SLOT_NOT_SET, 23);
                    Plr->EventTeleport(1, 5381.36, -3812.06, 2007.02);
                 }break;
            
            
            
            
            }
    }
    
    
    void Bunjee_gos::GossipEnd(Object * pObject, Player* Plr)
    {
       GossipScript::GossipEnd(pObject, Plr);
    }
    
    
    
    
    void SetupWarper(ScriptMgr * mgr)
    {
        GossipScript * gs = (GossipScript*) new Warper();
        GossipScript * bgs = (GossipScript*) new Bunjee_gos();
    
        /* Teleporter List */
        
        mgr->register_gossip_script(8000000, gs);          // Warp NPC <-- change ID
        mgr->register_gossip_script(8000001, bgs);         // Bunjee Script <-- Change ID
    }

    Just modify the stuff there ;P ...

    setup.cpp
    Code:
    SetupWarper(mgr);

    setup.h
    Code:
    void SetupWarper(ScriptMgr * mgr);
    Just dump this content into your gossipscripts project and compile ;)

    This C++ is only an example please make your own thing from this ...

  3. #3
    Member dimzim is offline
    MemberRank
    Jul 2007 Join Date
    26Posts

    Re: [Request]WarpNPC

    Kira im using that Lua++ warpnpc, but im having some trouble. What flags do you have to give the npc, also i think i have the latest lua++. Im using the latest Openascent and i think the Lua++ dll is included. Do you know what i could be doing wrong?

  4. #4
    Member dimzim is offline
    MemberRank
    Jul 2007 Join Date
    26Posts

    Re: [Request]WarpNPC

    Ah i just noticed this
    LuaEngine: Warpnpc.lua..
    failed. <could not run>
    scripts/warpnpc.lua:361: attempt to call global 'RegisterGossipEvent <a nil value>

    Anyone know how to over come this?

    This is what my lua file looks like

    Code:
    ----------------------------------------------------------
        ----- Created by Tazjin -----
        -----------------------------------------------------------
        function warp_on_gossip_talk(unit, event, player)
    
        unit:GossipCreateMenu(3543, player)
        unit:GossipMenuAddItem(player, 0, "Horde cities", 1, 0)
        unit:GossipMenuAddItem(player, 0, "Alliance cities", 2, 0)
        unit:GossipMenuAddItem(player, 0, "Azeroth Instances", 5, 0)
        unit:GossipMenuAddItem(player, 0, "Outland Instances", 6, 0)
        unit:GossipMenuAddItem(player, 5, "Shattrath", 51, 0)
        unit:GossipMenuAddItem(Player, 0, "Malls", 500, 0)
        unit:GossipSendMenu(player)
        end
    
        function warp_on_gossip_select(unit, event, player, id, intid, code)
    
        if(intid == 500) then
        unit:GossipCreateMenu(3542, player)
        unit:GossipMenuAddItem(Player, 5, "Alliance Mall", 501, 0)
        unit:GossipMenuAddItem(Player, 5, "Horde Mall", 502, 0)
        Unit:GossipMenuAddItem(Player, 5, "[Back]", 100, 0)
        Unit:GossipSendMenu(Player)
        end
    
    
        if(intid == 1) then
        unit:GossipCreateMenu(3542, player)
        unit:GossipMenuAddItem(player, 5, "Orgrimmar", 9, 0)
        unit:GossipMenuAddItem(player, 5, "Undercity", 10, 0)
        unit:GossipMenuAddItem(player, 5, "Thunder Bluff", 11, 0)
        unit:GossipMenuAddItem(player, 5, "Silvermoon", 12, 0)
        unit:GossipMenuAddItem(player, 5, "[Back]", 100, 0)
        unit:GossipSendMenu(player)
        end
    
        if(intid == 2) then
        unit:GossipCreateMenu(3542, player)
        unit:GossipMenuAddItem(player, 5, "Stormwind", 14, 0)
        unit:GossipMenuAddItem(player, 5, "Ironforge", 15, 0)
        unit:GossipMenuAddItem(player, 5, "Darnassus", 16, 0)
        unit:GossipMenuAddItem(player, 5, "Exodar", 17, 0)
        unit:GossipMenuAddItem(player, 5, "[Back]", 100, 0)
        unit:GossipSendMenu(player)
        end
    
        if(intid == 5) then
        unit:GossipCreateMenu(3542, player)
        unit:GossipMenuAddItem(player, 0, "Azeroth Raids", 3, 0)
        unit:GossipMenuAddItem(player, 5, "Shadowfang Keep", 19, 0)
        unit:GossipMenuAddItem(player, 5, "Scarlet Monastery", 20, 0)
        unit:GossipMenuAddItem(player, 5, "Zul'Farrak", 21, 0)
        unit:GossipMenuAddItem(player, 5, "Stratholme", 22, 0)
        unit:GossipMenuAddItem(player, 5, "Scholomance", 23, 0)
        unit:GossipMenuAddItem(player, 5, "Ragefire", 110, 0)
        unit:GossipMenuAddItem(player, 5, "Deathmines", 170, 0)
        unit:GossipMenuAddItem(player, 5, "Those caverns in barrens xX", 111, 0)
        unit:GossipMenuAddItem(player, 5, "Blackfathom deepths", 112, 0)
        unit:GossipMenuAddItem(player, 5, "This instance in Stormwind biggrin.gif", 113, 0)
        unit:GossipMenuAddItem(player, 5, "Gnomeregan", 114, 0)
        unit:GossipMenuAddItem(player, 5, "Razorfen thing number 1", 115, 0)
        unit:GossipMenuAddItem(player, 5, "Razorfen hills", 116, 0)
        unit:GossipMenuAddItem(player, 5, "Uldaman", 117, 0)
        unit:GossipMenuAddItem(player, 5, "Maraudon", 118, 0)
        unit:GossipMenuAddItem(player, 5, "Sunken temple", 119, 0)
        unit:GossipMenuAddItem(player, 5, "Lower Blackrock", 120, 0)
        unit:GossipMenuAddItem(player, 5, "Dire Maul", 121, 0)
        unit:GossipMenuAddItem(player, 5, "Upper Blackrock", 122, 0)
        unit:GossipMenuAddItem(player, 5, "[Back]", 100, 0)
        unit:GossipSendMenu(player)
        end
    
        if(intid == 6) then
        unit:GossipCreateMenu(3542, player)
        unit:GossipMenuAddItem(player, 5, "Outland Raids", 4, 0)
        unit:GossipMenuAddItem(player, 5, "Hellfire Ramparts", 25, 0)
        unit:GossipMenuAddItem(player, 5, "Blood furnace", 26, 0)
        unit:GossipMenuAddItem(player, 5, "Shattered Halls", 27, 0)
        unit:GossipMenuAddItem(player, 5, "Underbog", 28, 0)
        unit:GossipMenuAddItem(player, 5, "Slave pens", 29, 0)
        unit:GossipMenuAddItem(player, 5, "Steam whatever tongue.gif", 30, 0)
        unit:GossipMenuAddItem(player, 5, "Mana tombs", 31, 0)
        unit:GossipMenuAddItem(player, 5, "Auchenai crypts", 32, 0)
        unit:GossipMenuAddItem(player, 5, "Sethekk halls", 33, 0)
        unit:GossipMenuAddItem(player, 5, "Shadow lab", 34, 0)
        unit:GossipMenuAddItem(player, 5, "Mechanar", 35, 0)
        unit:GossipMenuAddItem(player, 5, "Bota whatever Oo", 36, 0)
        unit:GossipMenuAddItem(player, 5, "Arcatraz", 37, 0)
        unit:GossipMenuAddItem(player, 5, "Caverns of Time", 52, 0)
        unit:GossipMenuAddItem(player, 5, "[Back]", 100, 0)
        unit:GossipSendMenu(player)
        end
    
        if(intid == 3) then
        unit:GossipCreateMenu(3542, player)
        unit:GossipMenuAddItem(player, 5, "Onyxias Lair", 39, 0)
        unit:GossipMenuAddItem(player, 5, "Molten Core", 40, 0)
        unit:GossipMenuAddItem(player, 5, "Blackwing Lair", 123, 0)
        unit:GossipMenuAddItem(player, 5, "Zul'Gurub", 41, 0)
        unit:GossipMenuAddItem(player, 5, "Karazhan", 42, 0)
        unit:GossipMenuAddItem(player, 5, "Ruins of Ahn'Qiraj", 43, 0)
        unit:GossipMenuAddItem(player, 5, "Temple of Ahn'Qiraj", 44, 0)
        unit:GossipMenuAddItem(player, 5, "Naxxramas", 45, 0)
        unit:GossipMenuAddItem(player, 5, "Zul'Aman", 124, 0)
        unit:GossipMenuAddItem(player, 5, "Caverns of Time", 52, 0)
        unit:GossipMenuAddItem(player, 5, "[Back]", 100, 0)
        unit:GossipSendMenu(player)
        end
    
        if(intid == 4) then
        unit:GossipCreateMenu(3542, player)
        unit:GossipGossipMenuAddItem(player, 5, "Black Temple", 50, 0)
        unit:GossipGossipMenuAddItem(player, 5, "Tempest Keep", 49, 0)
        unit:GossipGossipMenuAddItem(player, 5, "Gruuls Lair", 48, 0)
        unit:GossipMenuAddItem(player, 5, "Serpentshrine caverns", 47, 0)
        unit:GossipMenuAddItem(player, 5, "Maghteridons Lair", 46, 0)
        unit:GossipMenuAddItem(player, 5, "[Back]", 100, 0)
        unit:GossipSendMenu(player)
        end
       
        if(intid == 501) then
        player:Teleport(0, -1827.511963, -4225.322266, 4.624390)
        end
    
        if(intid == 12) then
        player:Teleport(530, 9400.486328, -7278.376953, 14.206780)
        end
    
        if(intid == 9) then
        player:Teleport(1, 1371.068970, -4370.801758, 26.052483)
        end
    
        if(intid == 11) then
        player:Teleport(1, -1304.569946, 205.285004, 68.681396)
        end
    
        if(intid == 10) then
        player:Teleport(0, 2050.203125, 285.650604, 56.994549)
        end
    
        if(intid == 17) then
        player:Teleport(530, -4072.202393, -12014.337891, -1.277277)
        end
    
        if(intid == 14) then
        player:Teleport(0, -9100.480469, 406.950745, 92.594185)
        end
    
        if(intid == 15) then
        player:Teleport(0, -5028.265137, -825.976563, 495.301575)
        end
    
        if(intid == 16) then
        player:Teleport(1, 9985.907227, 1971.155640, 1326.815674)
        end
    
        if(intid == 51) then
        player:Teleport(530, -1887.510010, 5359.379883, -12.427300)
        end
    
        if(intid == 19) then
        player:Teleport(0, -234.495087, 1561.946411, 76.892143)
        end
    
        if(intid == 20) then
        player:Teleport(0, 2870.442627, -819.985229, 160.331085)
        end
    
        if(intid == 21) then
        player:Teleport(1, -6797.278809, -2903.917969, 9.953360)
        end
    
        if(intid == 41) then
        player:Teleport(0, -11919.073242, -1202.459374, 92.298744)
        end
    
        if(intid == 43) then
        player:Teleport(1, -8394.730469, 1485.658447, 21.038563)
        end
    
        if(intid == 44) then
        player:Teleport(1, -8247.316406, 1970.156860, 129.071472)
        end
    
        if(intid == 40) then
        player:Teleport(409, 1089.6, -470.19, -106.41)
        end
    
        if(intid == 39) then
        player:Teleport(1, -4746, -3749, -4.0)
        end
    
        if(intid == 45) then
        player:Teleport(533, 3006.06, -3436.72, 293.891)
        end
    
        if(intid == 23) then
        player:Teleport(0, 1267.468628, -2556.651367, 94.127983)
        end
    
        if(intid == 24) then
        player:Teleport(0, 3359.111572, -3380.8444238, 144.781860)
        end
    
        if(intid == 38) then
        player:Teleport(0, -7527.129883, -1224.997437, 285.733002)
        end
    
        if(intid == 42) then
        player:Teleport(532, -11087.3, -1977.47, 49.6135)
        end
    
        if(intid == 52) then
        player:Teleport(1, -8519.718750, -4297.542480, -208.441376)
        end
    
        if(intid == 25) then
        player:Teleport(530, -360.670990, 3071.899902, -15.097700)
        end
    
        if(intid == 26) then
        player:Teleport(530, -303.506012, 3164.820068, 31.742500)
        end
    
        if(intid == 27) then
        player:Teleport(530, -311.083527, 3083.291748, -3.745923)
        end
    
        if(intid == 28) then
        player:Teleport(530, 777.088989, 6763.450195, -72.062561)
        end
    
        if(intid == 29) then
        player:Teleport(530, 719.507996, 6999.339844, -73.074303)
        end
    
        if(intid == 30) then
        player:Teleport(530, 816.590027, 6934.669922, -80.544601)
        end
    
        if(intid == 31) then
        player:Teleport(530, -3079.810059, 4943.040039, -101.046997)
        end
    
        if(intid == 32) then
        player:Teleport(530, -3361.959961, 5225.770020, -101.047997)
        end
    
        if(intid == 33) then
        player:Teleport(530, -3362.219971, 4660.410156, -101.049004)
        end
    
        if(intid == 34) then
        player:Teleport(530, -3645.060059, 4943.620117, -101.047997)
        end
    
        if(intid == 35) then
        player:Teleport(530, 2862.409912, 1546.089966, 252.158691)
        end
    
        if(intid == 36) then
        player:Teleport(530, 3413.649902, 1483.319946, 182.837997)
        end
    
        if(intid == 37) then
        player:Teleport(530, 3311.598145, 1332.745117, 505.557251)
        end
    
        if(intid == 46) then
        player:Teleport(530, -313.678986, 3088.350098, -116.501999)
        end
    
        if(intid == 47) then
        player:Teleport(530, 830.542908, 6865.445801, -63.785503)
        end
    
        if(intid == 48) then
        player:Teleport(530, 3549.424072, 5179.854004, -4.430779)
        end
    
        if(intid == 49) then
        player:Teleport(530, 3087.310059, 1373.790039, 184.643005)
        end
    
        if(intid == 50) then
        player:Teleport(530, -3609.739990, 328.252014, 37.307701)
        end
    
        if(intid == 124) then
        player:Teleport(530, 6850, -7950, 170)
        end
    
        if(intid == 136) then
        player:Teleport(0, -13152.9, 342.729, 53.1328)
        end
    
        if(intid == 110) then
        player:Teleport(389, 1.7849, -14.3685, -16.5533)
        end
    
        if(intid == 111) then
        player:Teleport(1, -746.207, -2213.18, 15.8909)
        end
    
        if(intid == 112) then
        player:Teleport(48, -152.984, 106.33, -39.0953)
        end
    
        if(intid == 113) then
        player:Teleport(0, -8776.78, 836.753, 93.1946)
        end
    
        if(intid == 114) then
        player:Teleport(0, -5189.22, 524.796, 389.107)
        end
    
        if(intid == 115) then
        player:Teleport(1, -4464.92, -1666.24, 91)
        end
    
        if(intid == 116) then
        player:Teleport(129, 2591.99, 1101.25, 52.8593)
        end
    
        if(intid == 117) then
        player:Teleport(70, -228.193, 46.1602, -45.0186)
        end
    
        if(intid == 118) then
        player:Teleport(349, 419.84, 11.3365, -131.079)
        end
    
        if(intid == 119) then
        player:Teleport(0, -10349.1, -3849.67, -24.6078)
        end
    
        if(intid == 120) then
        player:Teleport(230, 596.432, -188.498, -49)
        end
    
        if(intid == 121) then
        player:Teleport(429, 254.588, -24.7395, -1.56062)
        end
    
        if(intid == 122) then
        player:Teleport(229, 73.5083, -215.044, 53.3869)
        end
    
        if(intid == 123) then
        player:Teleport(469, -7665.55, -1102.49, 400.679)
        end
    
        if(intid == 170) then
        player:Teleport(0, -11079.8, 1506.98, 42.9594)
        end
    
        intid = 0
        end
    
    
        RegisterGossipEvent(37000 , 1, "warp_on_gossip_talk") --change the NPC
        RegisterGossipEvent(37000 , 2, "warp_on_gossip_select") -- here too

  5. #5
    Member dimzim is offline
    MemberRank
    Jul 2007 Join Date
    26Posts

    Re: [Request]WarpNPC

    Ok i put the end to the actual end of the text file, and this time it didnt error and loaded, maybe i have the flags wrong now or something.,.

  6. #6
    Sorcerer Supreme Kira90 is offline
    Member +Rank
    Jun 2007 Join Date
    Erm ... Er ... *Sneezes*Location
    320Posts

    Re: [Request]WarpNPC

    To overcome that use the latest lua++, it is not included in OpenAscent ... Il upload
    No editing is necesary ... it works

  7. #7
    Member dimzim is offline
    MemberRank
    Jul 2007 Join Date
    26Posts

    Re: [Request]WarpNPC

    Ok ill await your lua++ :D

  8. #8
    C# Developer stealarcher is offline
    Grand MasterRank
    Jan 2008 Join Date
    571Posts

    Re: [Request]WarpNPC

    haha sorry that i cant give u rep then :'(. Thank you a lot tho :D. (+rep in my book ^^) haha.

  9. #9
    C# Developer stealarcher is offline
    Grand MasterRank
    Jan 2008 Join Date
    571Posts

    Re: [Request]WarpNPC

    ahh sorry for the double post, but when i go to load up ascent, i get a error message saying

    "The procedure entry point ??0LocationVector@@QAE@MMM@Z could not be located in the dynamic link library ascent-world.exe"

    not a clue how to fix that :(

  10. #10
    Member dimzim is offline
    MemberRank
    Jul 2007 Join Date
    26Posts

    Re: [Request]WarpNPC

    I had the same after i swaped LUAScripting.dll. So i would say swap back to the old dll.

  11. #11
    Sorcerer Supreme Kira90 is offline
    Member +Rank
    Jun 2007 Join Date
    Erm ... Er ... *Sneezes*Location
    320Posts

    Re: [Request]WarpNPC

    :s ... You will have to compile your Lua++ on your own to be compiled @ the same version as your source :s ... or download a premade source with Lua++ included

  12. #12
    Member dimzim is offline
    MemberRank
    Jul 2007 Join Date
    26Posts

    Re: [Request]WarpNPC

    Where can i find the sources?

  13. #13
    C# Developer stealarcher is offline
    Grand MasterRank
    Jan 2008 Join Date
    571Posts

    Re: [Request]WarpNPC

    oh ok, thanks kira :D

  14. #14
    Newbie InternetHero is offline
    MemberRank
    Apr 2008 Join Date
    6Posts

    Re: [Request]WarpNPC

    I compiled the C++ version fine with no errors and I now have these 10 files
    Code:
    Buildlog
    Gossip_Battlemaster
    Gossip_Innkeepers
    GossipScripts.dll.intermediate.manifest
    GuardGossip
    mt.dep
    Setup
    vc90
    vc90
    WarpNPC
    in my...

    Code:
    C:\OpenAscent\trunk\src\scripts\projects\2008_int_release_gossipscripts
    folder... where do I put these files?

    Because I am having problems... all the NPC says to me in game is "Hello, player how my I help you"

    All I have done at this point is just Compile the WarpNPC... are there other files I need to edit, move or add, that effect the operation of the WarpNPC? Do I need a .dll file for OpenAscent or no?

    Please help. Can someone help me on MSN or something?
    Last edited by InternetHero; 14-06-08 at 12:34 AM.

  15. #15
    Newbie LonelyChild is offline
    MemberRank
    May 2008 Join Date
    Your houseLocation
    6Posts

    Re: [Request]WarpNPC

    Gak.. all looks scary! Must learn how lua works for wow servers... Link if you can



Advertisement