[C++] Plane NPC Teleporter request menu

User Tag List

Results 1 to 5 of 5
  1. #1
    newtech's Avatar Active Member
    Reputation
    57
    Join Date
    Aug 2008
    Posts
    308
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [C++] Plane NPC Teleporter request

    Hey there, all my fellow scripters!

    So, I work for CoA, and since we're soon arising again, we've decided to stay Trinity. Which means, no Lua. NOEZ!, I know :/ Anyways, but that requires me to learn C++. Atleast, the C++ for Trinity... So I was wondering if anyone could provide me with the most simple C++ teleporter for an NPC, there is out there! Like, in Lua its just

    [SPOILER]
    Code:
    function NPC(pUnit, event, player) 
    	pUnit:GossipCreateMenu(100, player, 0)
    	pUnit:GossipMenuAddItem(1, "First Menu", 1, 0)
    	pUnit:GossipSendMenu(player)
    end
    
    function On_Gossip_Select1(pUnit, event, player, id, intid, code)
    	if(intid == 1) then
    		--Do something
    	end
    end
    
    --Register's
    [/SPOILER]

    Something just about as simple as that, but in C++, and compatible with Trinity. Please, as simple as possible x)

    Q: "Why, since your a developer, aren't you learning it from a book or tutorial, instead of just looking at a script"
    A: Well, believe it or don't, but I've never been much for books or tutorials. I prefer having a simple 100% working script, and manipulate with it, see what happens, and slowly build up my knowledge. And then later on, when there's something I JUST DON'T GET, I look at a tutorial, and figure out what the issue is :P

    Thank you for your time

    Thanks
    Newtech

    Ps. Any very simple C++ script for Trinity would be appriciated. Like for example: 'Talk to an NPC' -> 'He says "Hello world"'
    LuaHypArc Lua scripter - 3.3.5a World Builder.

    [C++] Plane NPC Teleporter request
  2. #2
    Harambeqt's Avatar Elite User CoreCoins Purchaser
    Reputation
    333
    Join Date
    Mar 2010
    Posts
    1,206
    Thanks G/R
    9/29
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thx 4 sharin the lua +r
    Last edited by Harambeqt; 04-18-2011 at 07:03 AM.
    Support the #1 WoW Emulator:
    http://arcemu.org/
    https://github.com/arcemu/arcemu
    - - -

  3. #3
    newtech's Avatar Active Member
    Reputation
    57
    Join Date
    Aug 2008
    Posts
    308
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Erhm... Im asking for a C++ script >_> I just provided the Lua version of what I want, incase there might be someone out there doing both, and understands my situation x) But yeah, if you can use that small bit of Lua, sure, go ahead and use it xD

    Thanks
    Newtech
    LuaHypArc Lua scripter - 3.3.5a World Builder.

  4. #4
    Dynashock's Avatar Contributor

    Reputation
    176
    Join Date
    Nov 2007
    Posts
    203
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Take a look at the example script provided by trinitycore in src/server/scripts/examples => https://github.com/TrinityCore/Trini...ip_codebox.cpp

    I think a lot of this speaks for itself, but the function you need for teleporting is TeleportTo(map, x, y, z, o);. You do not need the OnGossipSelectCode function (unless you want to use a codebox), but it shows a switch statement in action which you could use for a teleporter with multiple menus/options/locations. If you can't figure it out, just ask and I'll try and see if I can help you out.

    EDIT: It's also possible to do it in SQL. See http://the-isy.co.uk/project-code/ for one.
    Last edited by Dynashock; 04-18-2011 at 12:11 PM.
    Ignorance is bliss.

  5. #5
    4BOLTMAIN's Avatar Sergeant
    Reputation
    2
    Join Date
    Dec 2010
    Posts
    63
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I found a couple posts in some other forums that might help, one involves scripting , the other just uses the database.

    http://www.trinitycore.org/f/index.p...-dont-working/ (Good function examples here)

    I havent tried this but I remember coming across it a while back....
    http://www.trinitycore.org/f/index.p...mu-and-mangos/ (No need for compiling, database version)

    You may have to sign up on the Trinity forums to view the links but I know they are strict about not supporting public servers. This topic would get closed if you posted it there.

    Good luck!
    Last edited by 4BOLTMAIN; 04-18-2011 at 02:03 PM.

Similar Threads

  1. How to make a Warp NPC/Teleporter NPC
    By Krunkage in forum WoW EMU Guides & Tutorials
    Replies: 19
    Last Post: 10-01-2008, 07:32 AM
  2. [Guide] How to create a Warp-NPC (Teleporter)
    By nikey_007 in forum WoW EMU Guides & Tutorials
    Replies: 19
    Last Post: 06-26-2008, 08:30 AM
  3. NPC teleporter?
    By c0ddingt0n in forum World of Warcraft Emulator Servers
    Replies: 8
    Last Post: 06-01-2008, 09:30 AM
  4. [Service] Will Make Npc Teleporter
    By ~SaiLyn~ in forum World of Warcraft Emulator Servers
    Replies: 15
    Last Post: 02-20-2008, 03:23 PM
  5. Help with NPC Teleporters
    By KnownReason in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 09-11-2007, 05:22 PM
All times are GMT -5. The time now is 03:50 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search