Need some help with areatrigger_teleport menu

User Tag List

Results 1 to 4 of 4
  1. #1
    alladarsda's Avatar Member
    Reputation
    1
    Join Date
    Dec 2017
    Posts
    10
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need some help with areatrigger_teleport

    Hello there, I'm new to wow development so I would like to know how can I add an areatrigger_teleport for dungeon entrance for people to go inside and outside of the dungeon...

    https://i.imgur.com/xh2RXPR.png

    For example, what is that PortLocID and what do I type on that.

    Any reply would be helpful.

    (PS: I'm using trinity core for BFA expansion).

    Need some help with areatrigger_teleport
  2. #2
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    I always had a invisible npc that checked for players within 5 yards every second and teleported them in. Not the most efficient but it works.

    The way Blizzlike ones work is there's an AreaTrigger when you enter the area, and the server can hook that.

  3. #3
    alladarsda's Avatar Member
    Reputation
    1
    Join Date
    Dec 2017
    Posts
    10
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @stoneharry that would work as well, are you available to explain how is that possible to make ?

  4. #4
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by alladarsda View Post
    @stoneharry that would work as well, are you available to explain how is that possible to make ?
    I used Eluna, but you could achieve the same with a C++ script.

    Here's an example C++ teleporter script for TC:
    Code:
    /*
    Credits:
    Rochet2
    Eric
    
    ScriptName: TeLe_gossip_codebox
    */
    
    #include "ScriptPCH.h"
    
    struct Eric
    {
        uint32 menu_id;
        uint32 next_menu_id;
        uint8 icon;
        std::string name;
        int32 cost; // 0 for no requirement
        uint8 level; // 0 for no requirement
        uint32 faction; // 0 Both, 1 Ally, 2 Horde
        uint32 map;
        float x, y, z, o;
    };
    typedef struct Eric Rochet2;
    
    static const Rochet2 TeLe [] =
    {
    //  {menu_id, next_menu_id, icon, name, cost, level, faction, map, x, y, z, o}
        {1, 0, 2, "Stormwind", 0, 0, 1, 0, -8842.09f, 626.358f, 94.0867f, 3.61363f},
        {1, 0, 2, "Orgrimmar", 0, 0, 2, 1, -1601.08f, 4378.69f, 9.9846f, 2.14362f},
        {1, 2, 3, "Submenu", 0, 0, 0, 0, 0, 0, 0, 0},
    
        {2, 0, 2, "Some other teleport", 0, 0, 0, 0, -8842.09f, 626.358f, 94.0867f, 3.61363f},
        {2, 1, 7, "Back..", 0, 0, 0, 0, 0, 0, 0, 0},
    };
    
    
    static const uint32 TeLe_size = sizeof(TeLe)/sizeof(*TeLe);
    #define ARE_YOU_SURE    "Are you sure, that you want to go to "
    #define ERROR_COMBAT    "You are in combat"
    
    class TeLe_gossip_codebox : public CreatureScript
    {
    public:
        TeLe_gossip_codebox() : CreatureScript("TeLe_gossip_codebox")
        {
        }
    
        void SendMenu(Player* player, Creature* creature, uint32 Key)
        {
            uint32 team = player->GetTeam()+1;
            for (uint32 i = 0; i < TeLe_size; ++i)
            {
                if (TeLe[i].menu_id != Key)
                    continue;
                if (player->getLevel() < TeLe[i].level)
                    continue;
                if (TeLe[i].faction && TeLe[i].faction != team)
                    continue;
                if (TeLe[i].next_menu_id)
                    player->ADD_GOSSIP_ITEM_EXTENDED(TeLe[i].icon, TeLe[i].name, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+i, "", TeLe[i].cost, false);
                else
                    player->ADD_GOSSIP_ITEM_EXTENDED(TeLe[i].icon, TeLe[i].name, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+i, ARE_YOU_SURE+TeLe[i].name, TeLe[i].cost, false);
            }
            player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, creature->GetGUID());
        }
    
        bool OnGossipHello(Player* player, Creature* creature)
        {
            SendMenu(player, creature, 1);
            return true;
        }
    
        bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action)
        {
            player->PlayerTalkClass->ClearMenus(); // clear the menu
    
            // Stop cheats
            if (sender != GOSSIP_SENDER_MAIN || action < GOSSIP_ACTION_INFO_DEF || action >= GOSSIP_ACTION_INFO_DEF+TeLe_size)
            {
                player->CLOSE_GOSSIP_MENU();
                return true;
            }
            action -= GOSSIP_ACTION_INFO_DEF;
            if (player->getLevel() < TeLe[action].level ||
                TeLe[action].faction && TeLe[action].faction != player->GetTeam()+1)
            {
                SendMenu(player, creature, 1);
                return true;
            }
    
            if (TeLe[action].next_menu_id) // No next menu, teleport
            {
                if (player->IsInCombat())
                {
                    player->GetSession()->SendNotification(ERROR_COMBAT);
                    SendMenu(player, creature, TeLe[action].menu_id);
                    return true;
                }
                player->ModifyMoney(-TeLe[action].cost);
                SendMenu(player, creature, TeLe[action].menu_id);
                player->TeleportTo(TeLe[action].map, TeLe[action].x, TeLe[action].y, TeLe[action].z, TeLe[action].o);
                return true;
            }
    
            player->ModifyMoney(-TeLe[action].cost);
            SendMenu(player, creature, TeLe[action].next_menu_id);
            return true;
        }
    };
    #undef ARE_YOU_SURE
    #undef ERROR_COMBAT
    
    void AddSC_TeLe_gossip_codebox()
    {
        new TeLe_gossip_codebox();
    }
    You would need to hook a creature update function instead of a gossip function.

Similar Threads

  1. need some help with realmlist.wtf
    By AuRaGoD in forum World of Warcraft General
    Replies: 1
    Last Post: 05-20-2007, 11:33 PM
  2. Need some help with druid skins
    By Surikat in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 04-30-2007, 04:42 AM
  3. Need some help with Head changing
    By Emotion in forum WoW ME Questions and Requests
    Replies: 6
    Last Post: 01-01-2007, 07:12 PM
  4. Need some help with fishing bot
    By ralphie123 in forum World of Warcraft Bots and Programs
    Replies: 3
    Last Post: 11-24-2006, 09:41 AM
  5. NEED SOME HELP with Model Editing
    By Dwarf in forum World of Warcraft Model Editing
    Replies: 4
    Last Post: 09-12-2006, 08:12 PM
All times are GMT -5. The time now is 03:19 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search