[TrinityCore2] C++ Help menu

User Tag List

Results 1 to 2 of 2
  1. #1
    jay77's Avatar Member
    Reputation
    1
    Join Date
    Jan 2009
    Posts
    55
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [TrinityCore2] C++ Help

    Alright, so I got Trinity Core... absolutely love it, and on that note, I recommend it to anyone =]... BUT...

    I've recently started learning C++ and today began scripting my teleporter... Which is crucial of course. I'll tell you step by step what I did... (because it isn't working =[...)

    I scripted my C++ Teleporter, here is my script.

    Code:
    #include "precompiled.h"
    
    bool GossipHello_Penguino(Player *player, Creature *_Creature)
    {
        if ( player->GetTeam() == ALLIANCE ) //if alliance
    	
    	{
    		player->ADD_GOSSIP_ITEM( 5, "Home Base"                       , GOSSIP_SENDER_MAIN, 1000);
    		player->ADD_GOSSIP_ITEM( 7, "Alliance Cities"                 , GOSSIP_SENDER_MAIN, 1001);
    		player->ADD_GOSSIP_ITEM( 7, "Custom 5-Mans (By Difficulty)"   , GOSSIP_SENDER_MAIN, 1003);
    
    	}
    	
    	else //if horde
    	
    	{
    		player->ADD_GOSSIP_ITEM( 5, "Home Base"                       , GOSSIP_SENDER_MAIN, 1000);
    		player->ADD_GOSSIP_ITEM( 7, "Horde Cities"                    , GOSSIP_SENDER_MAIN, 1002);
    		player->ADD_GOSSIP_ITEM( 7, "Custom 5-Mans (By Difficulty)"   , GOSSIP_SENDER_MAIN, 1003);
    	}
    
    	player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,_Creature->GetGUID());
    	
    	return true;
    }
    
    void SendDefaultMenu_Penguino(Player *player, Creature *_Creature, uint32 action )
    {
    
    switch(action)
    {
    
    case 1000: //Home Base
    	player->CLOSE_GOSSIP_MENU();
    	player->TeleportTo(530, -250.0467295f, 1033.512695f, 54.322f, 1.611220f);
    break;
    
    case 1001: //Alliance Cities
    	player->ADD_GOSSIP_ITEM( 5, "Stormwind"           , GOSSIP_SENDER_MAIN, 1004);
    	player->ADD_GOSSIP_ITEM( 5, "Ironforge"           , GOSSIP_SENDER_MAIN, 1005);
    	player->ADD_GOSSIP_ITEM( 5, "Darnassus"           , GOSSIP_SENDER_MAIN, 1006);
    	player->ADD_GOSSIP_ITEM( 5, "Exodar"              , GOSSIP_SENDER_MAIN, 1007);
    	player->ADD_GOSSIP_ITEM( 7, "<- [Main Menu]"      , GOSSIP_SENDER_MAIN, 5000);
        player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,_Creature->GetGUID());
    break;
    
    case 1002: //Horde Cities
    	player->ADD_GOSSIP_ITEM( 5, "Orgrimmar"           , GOSSIP_SENDER_MAIN, 1008);
    	player->ADD_GOSSIP_ITEM( 5, "Thunderbluff"        , GOSSIP_SENDER_MAIN, 1009);
    	player->ADD_GOSSIP_ITEM( 5, "Undercity"           , GOSSIP_SENDER_MAIN, 1010);
    	player->ADD_GOSSIP_ITEM( 5, "Silvermoon City"     , GOSSIP_SENDER_MAIN, 1011);
    	player->ADD_GOSSIP_ITEM( 7, "<- [Main Menu]"      , GOSSIP_SENDER_MAIN, 5000);
        player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,_Creature->GetGUID());
    break;
    
    case 1003: //Custom 5-Mans
    	player->ADD_GOSSIP_ITEM( 5, "Scarlet Monastary Instances"      , GOSSIP_SENDER_MAIN, 1012);
    	player->ADD_GOSSIP_ITEM( 7, "<- [Main Menu]"      , GOSSIP_SENDER_MAIN, 5000);
        player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,_Creature->GetGUID());
    break;
    
    case 1004: //Stormwind
    	player->CLOSE_GOSSIP_MENU();
    	player->TeleportTo(0, -8895.368164f, 567.118835f, 92.6534f, 0.694642f);
    break;
    
    case 1005: //Ironforge
    	player->CLOSE_GOSSIP_MENU();
    	player->TeleportTo(0, -8895.368164f, 567.118835f, 92.6534f, 0.694642f);
    break;
    }
    }
    
    bool GossipSelect_Penguino(Player *player, Creature *_Creature, uint32 sender, uint32 action)
    {
    	// Main menu
    	if (sender == GOSSIP_SENDER_MAIN)
    	SendDefaultMenu_Penguino( player, _Creature, action );
    
    return true;
    }
    
    void AddSC_Penguino()
    {
        Script *newscript;
        newscript = new Script;
        newscript->Name="Penguino";
        newscript->pGossipHello = &GossipHello_Penguino;
        newscript->pGossipSelect = &GossipSelect_Penguino;
        newscript->pItemHello = NULL;
        newscript->pGOHello = NULL;
        newscript->pAreaTrigger = NULL;
        newscript->pItemQuestAccept = NULL;
        newscript->pGOQuestAccept = NULL;
        newscript->pGOChooseReward = NULL;
        newscript->RegisterSelf();
    }
    I didn't finish the cases, because I wanted to see if it worked first, which ofc it didn't...

    Anyway, I then saved the file as a c++, and put it in my custom scripts folder in src/bindings/scripts/scripts/custom... then I added the "Existing" file to the custom folder in the solution, and then compiled trinityscripts, which was succesfull then took "trinityscripts.dll" and copied and pasted that into my main trinty core folder.

    I made my npc, who's scriptname is "Penguino" and he is flagged for gossip (1)....

    What have I done wrong? Any help would be much appreciated... +Rep to whoever can help =D or whoever replies... =\

    [TrinityCore2] C++ Help
  2. #2
    jay77's Avatar Member
    Reputation
    1
    Join Date
    Jan 2009
    Posts
    55
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nevermind =]. Figured it out, I had to put the last part in the scriptloader.cpp =D

Similar Threads

  1. Help WoW Fish-Bot
    By Eliteplague in forum World of Warcraft General
    Replies: 2
    Last Post: 12-10-2024, 05:46 PM
  2. TrinityCore2 <- Lag problem - help
    By dongel in forum WoW EMU Questions & Requests
    Replies: 5
    Last Post: 07-12-2009, 11:00 AM
  3. HELP: Gold Scam Exploit
    By GoldDragon in forum World of Warcraft General
    Replies: 11
    Last Post: 01-23-2007, 07:26 PM
  4. Hit points and talent points? Please help
    By hankusdankus in forum World of Warcraft General
    Replies: 6
    Last Post: 05-04-2006, 02:00 PM
  5. bot help
    By xwhitedeathx in forum World of Warcraft General
    Replies: 3
    Last Post: 05-01-2006, 03:50 AM
All times are GMT -5. The time now is 12:05 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