C++ Command menu

Shout-Out

User Tag List

Thread: C++ Command

Results 1 to 15 of 15
  1. #1
    B14d3r11's Avatar Sergeant Major
    Reputation
    9
    Join Date
    Jan 2007
    Posts
    179
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    C++ Command

    I am trying to make a Item Gossip that opens a codebox and you type a players name into it and it teleports you to that player. I need:

    Command for If player is in Party
    Gossip Script Template for Item

    If i run into any problems ill post here

    C++ Command
  2. #2
    Link_S's Avatar Member
    Reputation
    125
    Join Date
    Dec 2008
    Posts
    293
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I won't write the code for you. But I'll point you in the right direction.

    First off. It's called Function, not command.. C++ isn't commands. It's functions.
    There is a way of checking if the player is in a Group. Not a command.

    Code:
    if(_player->GetGroup() != NULL)
    {
          //Player hasn't any group
    }
    else
    {
        //Player has a group
    }

    For the item issue, just register it as an item instead for an npc.


    Code:
         mgr->register_item_gossip_script(/*ITEM ID*/, /*Gossip Class. */);

    Or just use TheSpideys. I have no idea if it works still. It's pretty old

    Freind Porter by TheSpidey
    Last edited by Link_S; 10-25-2009 at 02:01 PM. Reason: Misspell
    Why do I need a signature?

  3. #3
    B14d3r11's Avatar Sergeant Major
    Reputation
    9
    Join Date
    Jan 2007
    Posts
    179
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I need it setup up in a specific manor, like You open the item goto the option choose it, if the player is a (Insert Gm Level) it opens a menu and when they select the Teleport option a Codebox pops up so they can type in the players name and if the player isnt in a party and isnt themself then it executes the teleport. Im No good at C++ been fiddling with this for a week and no results. So Link_S or anyone could you make this script? And then explain to me how to put it into the server. I have no C++ knowledge and since i cant even make the script i havent gotten to the point of trying to put it in. If possible and anyone wants to tackle some more C++ Scripts i need i will +Rep Big time, the scripts i need are
    Code:
    C++ Global channel *type /o
    C++ Haste system ( Haste isnt capped at 1.0 seconds per hit


    these are used in the Fusion Reborn Repack at AC-Web if anyone knows how to... Ripp them outta the repack thats great but i would like to have these Scripts if possible.

  4. #4
    B14d3r11's Avatar Sergeant Major
    Reputation
    9
    Join Date
    Jan 2007
    Posts
    179
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No answers?? Whats up guys?

  5. #5
    TheSpidey's Avatar Elite User
    Reputation
    365
    Join Date
    Jan 2008
    Posts
    2,200
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I actually made this one. The FriendPorter:
    http://www.mmowned.com/forums/emulat...nd-porter.html

  6. #6
    B14d3r11's Avatar Sergeant Major
    Reputation
    9
    Join Date
    Jan 2007
    Posts
    179
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yea i know i fail @ C++ so i cant do it. I need some help lol

  7. #7
    Sounddead's Avatar Contributor
    Reputation
    160
    Join Date
    Sep 2007
    Posts
    1,126
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    He already made it..

    I live in a shoe

  8. #8
    TheSpidey's Avatar Elite User
    Reputation
    365
    Join Date
    Jan 2008
    Posts
    2,200
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello, is this thing on?
    I said I already made it, you don't need to write it again >>

  9. #9
    Exacute's Avatar Active Member
    Reputation
    67
    Join Date
    Mar 2008
    Posts
    337
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Laughting @ Spidey

    That comment were awesome xP
    [/COLOR]

  10. #10
    B14d3r11's Avatar Sergeant Major
    Reputation
    9
    Join Date
    Jan 2007
    Posts
    179
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I dont want the exact one you made, i want it setup so it costs nothing, it opens a Codebox where you input a name.

  11. #11
    [Thallium]'s Avatar Private
    Reputation
    1
    Join Date
    Nov 2009
    Posts
    4
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by B14d3r11 View Post
    I dont want the exact one you made, i want it setup so it costs nothing, it opens a Codebox where you input a name.
    Based off of Spidey's Friend Porter, all credit should go to him if anything. I just modified it to fit your request.

    Code:
    #include "StdAfx.h"
    #include "Setup.h"
    
    #ifdef WIN32
    #pragma warning(disable:4305)		// warning C4305: 'argument' : truncation from 'double' to 'float'
    #endif
    
    #define ITEM_ID     123456
    #define GM_LEVEL    'a'
    
    class SCRIPT_DECL GMPorter : 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 GMPorter::GossipHello(Object* pObject, Player* Plr, bool AutoSend)
    {
    	GossipMenu* Menu;
    	objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 2593, Plr);
    
    	//Check to see if the player has the appropriate GM level
    	if(Plr->GetSession()->CanUseCommand(GM_LEVEL))
    		Menu->AddItem(0, "Port To Player", 1, 1);
    	Menu->AddItem(0, "[Exit]", 0);
    
    	if(AutoSend)
    		Menu->SendTo(Plr);
    }
    
    void GMPorter::GossipSelectOption(Object* pObject, Player* Plr, uint32 Id, uint32 IntId, const char* Code)
    {
    	GossipMenu* Menu;
    
    	switch(IntId)
    	{
    	case 0:      //End Gossip
    		Plr->Gossip_Complete();
    		break;
    
    	case 1:      //Port to Player
    		{
    				//No name entered
    				if(!Code)
    				{
    					Plr->BroadcastMessage("%sYou have not entered a name to port to!", MSG_COLOR_RED);
    					Plr->Gossip_Complete();
    				}
    
    				Player* pPlayer = objmgr.GetPlayer(Code, false);
    
    				//Can't find the player entered
    				if(!pPlayer)
    				{
    					Plr->BroadcastMessage("%sPlayer is not online or could not be found.", MSG_COLOR_RED);
    					Plr->Gossip_Complete();
    				}
    
    				//If player has a group
    				if(pPlayer->GetGroup() != NULL)
    				{
    					Plr->BroadcastMessage("%sPlayer has a group, thus you cannot teleport to him.", MSG_COLOR_RED);
    					Plr->Gossip_Complete();
    				}
    
    				else
    				{
    					float XLoc = pPlayer->GetPositionX();
    					float YLoc = pPlayer->GetPositionY();
    					float ZLoc = pPlayer->GetPositionZ();
    					float OLoc = pPlayer->GetOrientation();
    					uint32 Map = pPlayer->GetMapId();
    
    					Plr->EventTeleport(Map, XLoc, YLoc, ZLoc);
    					Plr->SetOrientation(OLoc);
    					Plr->BroadcastMessage("%sYou have been successfully teleported to %s .", MSG_COLOR_RED, pPlayer->GetName());
    					Plr->Gossip_Complete();
    				}
    		}break;
    	}
    };
    
    void GMPorter::GossipEnd(Object* pObject, Player* Plr)
    {
    	GossipScript::GossipEnd(pObject, Plr);
    };
    
    void SetupGMPorter(ScriptMgr* mgr)
    {
    	GossipScript* gs = (GossipScript*) new GMPorter();
    	mgr->register_item_gossip_script(ITEM_ID, gs);
    };

  12. #12
    B14d3r11's Avatar Sergeant Major
    Reputation
    9
    Join Date
    Jan 2007
    Posts
    179
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay i read through it, looks like itll do exactly what i want. But now the main problem how do i implement it? Do i add it under like Optional when compiling err what?

  13. #13
    [Thallium]'s Avatar Private
    Reputation
    1
    Join Date
    Nov 2009
    Posts
    4
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by B14d3r11 View Post
    Okay i read through it, looks like itll do exactly what i want. But now the main problem how do i implement it? Do i add it under like Optional when compiling err what?
    I usually just add it with the rest of my gossip scripts are, and then in the Setup.h of that project add:

    Code:
    void SetupGMPorter(ScriptMgr* mgr);
    Then navigate to that projects Setup.cpp and add:

    Code:
    SetupGMPorter(mgr);
    You should see where the rest of your gossip scripts are added into your Setup's so you shouldn't have trouble finding the right place to add that into your Setup.cpp.

    As for the item query to get the item into your database, the query would vary depending on your database structure for your core..

  14. #14
    B14d3r11's Avatar Sergeant Major
    Reputation
    9
    Join Date
    Jan 2007
    Posts
    179
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know the whole item thing, Still fuzzy on the whole adding into server part. Can you do a step by step like Tell me what folder it should be in, Cause i use Arcemu

  15. #15
    XxCyanidexX's Avatar Member
    Reputation
    56
    Join Date
    Nov 2008
    Posts
    138
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Read the ArcEmu wiki, it has information on how to compile custom scripts. http://www.arcemu.info/wiki/index.ph...C%2B%2B_Addons

Similar Threads

  1. Whats the command to level up ranks?
    By sabend in forum World of Warcraft General
    Replies: 2
    Last Post: 11-24-2006, 06:45 AM
  2. add a radio command to your server?
    By WoWLegend in forum World of Warcraft General
    Replies: 2
    Last Post: 10-29-2006, 04:43 AM
  3. slash commands
    By alex2630 in forum World of Warcraft Guides
    Replies: 0
    Last Post: 10-25-2006, 12:47 PM
  4. 5 Priest Raiding Commandments
    By Squirllz in forum World of Warcraft Guides
    Replies: 1
    Last Post: 10-11-2006, 07:43 PM
  5. [Guide] Command List
    By oninuva in forum World of Warcraft Guides
    Replies: 5
    Last Post: 05-17-2006, 08:28 PM
All times are GMT -5. The time now is 01:44 AM. 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