C++ menu

Shout-Out

User Tag List

Thread: C++

Results 1 to 14 of 14
  1. #1
    Chuck Norris's Avatar Member
    Reputation
    32
    Join Date
    Oct 2007
    Posts
    134
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    C++

    Does any one have a guide or teach me how to do it?
    I will +rep you.
    Or you can make me a dll that will increase weapon skill to 350 when you click on the item.
    Google won't search for Chuck Norris because it knows you don't find Chuck Norris, he finds you.

    C++
  2. #2
    2dgreengiant's Avatar ★ Elder ★


    Reputation
    1192
    Join Date
    Feb 2007
    Posts
    7,129
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    google it :P
    If you need me you have my skype, if you don't have my skype then you don't need me.

  3. #3
    Chuck Norris's Avatar Member
    Reputation
    32
    Join Date
    Oct 2007
    Posts
    134
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah I did but it comes up as....
    Code:
    
    
    Code:
    int main()
    {
      int total_dollars = 0;
      int total_days_at_3_dollars = 0;
      int total_days_at_2_dollars = 0;
      int transaction_code = 0;
      int days_for_one_video = 0;
      do
      {
        if(transaction_code==2)
          total_days_at_2_dollars+=days_for_one_video;
        if(transaction_code==3)
          total_days_at_3_dollars+=days_for_one_video;
        cout<<"Please enter a transaction code and number of days a video was rented: ";
        cin>>transaction_code>>days_for_one_video;
      }while(transaction_code!=0)
    and non of its WoW stuff.
    }
    Google won't search for Chuck Norris because it knows you don't find Chuck Norris, he finds you.

  4. #4
    The MMO Rolo's Avatar Member
    Reputation
    11
    Join Date
    Sep 2007
    Posts
    227
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    would be nice if someone put a guid up...i would love to learn too
    https://Future-wow.org

  5. #5
    2dgreengiant's Avatar ★ Elder ★


    Reputation
    1192
    Join Date
    Feb 2007
    Posts
    7,129
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you should learn the basis of C++ ill try and see if i can make a guide on it
    If you need me you have my skype, if you don't have my skype then you don't need me.

  6. #6
    Lich King's Avatar Contributor
    Reputation
    100
    Join Date
    May 2007
    Posts
    911
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Me too, that would be awsome

  7. #7
    Le Froid's Avatar Contributor
    Reputation
    172
    Join Date
    Mar 2007
    Posts
    1,327
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Kind of hard to learn...here are 2 example codes (1 that has to do with WoW, taken from MaNGOS source code)

    Code:
    chat.cpp
    
    { "die",         SEC_ADMINISTRATOR, &ChatHandler::HandleDieCommand,              "",   NULL },
    Code:
    chat.h
    
    bool HandleDieCommand(const char* args);
    Code:
    level3.cpp
    
    bool ChatHandler::HandleDieCommand(const char*)
    {
        Unit* target = getSelectedUnit();
    
        if(!target || !m_session->GetPlayer()->GetSelection())
        {
            SendSysMessage("You must select a character or creature");
            return true;
        }
    
        if( target->isAlive() )
        {
            m_session->GetPlayer()->DealDamage(target, target->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_NORMAL, NULL, false);
        }
    
        return true;
    }
    1) Chat.cpp is declaring a function ".die" available only to admin ranks. It has &ChatHandler::HandleDieCommand so other code uses chathandler to reach HandleDieCommand

    2) Chat.h is Again, declaring HandleDieCommand

    3) Level3.cpp is declaring it with
    Code:
    bool ChatHandler::HandleDieCommand(const char*)
    {
    Unit* target = getSelectedUnit(); is telling the main thing
    that there will be something selected (clicked on)..kind of

    Code:
     if(!target || !m_session->GetPlayer()->GetSelection())
        {
            SendSysMessage("You must select a character or creature");
            return true;
        }
    If the target is not a valid selection, you get an error, and return true ends function die

    Code:
    if( target->isAlive() )
        {
            m_session->GetPlayer()->DealDamage(target, target->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_NORMAL, NULL, false);
        }
    
        return true;
    If the target is valid. The player deals the exact amount of damage needed to kill, then ends command.

    Next tut is too big, so posted in next thing (it is nim sticks )

  8. #8
    Lich King's Avatar Contributor
    Reputation
    100
    Join Date
    May 2007
    Posts
    911
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Le Froid, you should make a guide on this

  9. #9
    Le Froid's Avatar Contributor
    Reputation
    172
    Join Date
    Mar 2007
    Posts
    1,327
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    #include <iostream>
    using namespace std;

    int main()
    {
    //Lets start with a welcoming
    cout<< "Welcome to the Game of Single-Pile Nim!" << endl; //sends a system message and ends the line
    cout<< "-----------------------------------------------" << endl;
    cout << "" << endl;

    // Define each kind of player

    const bool HUMAN_PLAYER = true;
    const bool COMPUTER_PLAYER = false;

    // define variables
    // Human player desides who goes first
    char firstPlayer; //who he chooses
    bool validPlayer = false; // Did he make a valid choise?

    bool currentPlayer;

    do
    {
    // prompt and data entry
    cout << "Who plays first? [P]layer or [C]omputer?" << endl;
    cin >> firstPlayer;

    //analyze the choice
    switch( firstPlayer )
    {
    // if he chose first
    case 'P':
    case 'p':
    validPlayer = true;
    currentPlayer = HUMAN_PLAYER;
    break;

    //if comp is first

    case 'C':
    case 'c':
    validPlayer = false;
    currentPlayer = COMPUTER_PLAYER;
    break;

    // did he make a mistake?
    default:
    cout << "invalid entry!!!!! ";
    break;
    }

    } while( !validPlayer );

    int nimSticks = 22; //start the game! (my hands hurt :P)

    while( 0 != nimSticks )
    {
    //how many in the pile?
    cout << "There are now " << nimSticks
    << " in the pile." << endl;

    int currentPlayerMove = 0;

    if( currentPlayer == HUMAN_PLAYER )
    {
    bool validHumanMove = false;
    do
    {
    cout << "How many sticks do you want to remove? [1-4]";
    cin >> currentPlayerMove;
    validHumanMove = ( currentPlayerMove > 0 &&
    currentPlayerMove < 5 &&
    currentPlayerMove <= nimSticks );

    if( !validHumanMove )
    cout << "Between 1 and 4, and no more then there are "
    << "in the pile, please." << endl;
    } while( !validHumanMove );
    }

    else //computer guy
    {

    int idealMove = ( nimSticks % 5 );
    if( 0 == idealMove )
    currentPlayerMove = 1;
    else
    currentPlayerMove = idealMove;

    cout << "I am taking " << currentPlayerMove << " sticks from the pile." << endl;
    }

    nimSticks -= currentPlayerMove;

    if( 0 == nimSticks )
    {
    if( HUMAN_PLAYER == currentPlayer )
    {
    // winner!
    cout << "You win, Congratz!!" << endl;
    }
    else
    {

    cout << "You lost! Play again for $0.25? " << endl;
    }
    }
    else
    {
    currentPlayer = !currentPlayer;
    }
    }
    return 0;
    }
    I left enough comments

  10. #10
    latruwski's Avatar Banned
    Reputation
    647
    Join Date
    Dec 2006
    Posts
    2,456
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well tutorials and ascentwiki is what i use if i need to do something in C++:
    Understanding Ascent Code - Ascent Wiki
    C - Ascent Wiki
    (google for tutorials or ebooks)
    ofcours examples like the one Le Froid posted are very nice too, you can learn a lot from them too...

    grtz

  11. #11
    berryman13's Avatar Contributor
    Reputation
    251
    Join Date
    Dec 2006
    Posts
    856
    Thanks G/R
    0/2
    Trade Feedback
    3 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i'll make a WoW C++ guide.

  12. #12
    2dgreengiant's Avatar ★ Elder ★


    Reputation
    1192
    Join Date
    Feb 2007
    Posts
    7,129
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i'll make a WoW C++ guide.
    you should as long as it dosnt have 100&#37; ripped content
    If you need me you have my skype, if you don't have my skype then you don't need me.

  13. #13
    Viter's Avatar Elite User
    Reputation
    410
    Join Date
    Aug 2007
    Posts
    2,153
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    guys if you want to learn C++ (and are new at coding) go start somewhere else c++ is verry verry hard! you should start with visual basic/auto it/java and then when you are good at that change to C then C++



  14. #14
    Gastricpenguin's Avatar Legendary
    Reputation
    980
    Join Date
    Feb 2007
    Posts
    2,236
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This doesn't even require C++ scripting. All you need to do is set the starting min and max of each skill to 350 in the playercreateinfo_skills table.
    Life Puzzler WoW - Website | Forums

All times are GMT -5. The time now is 03:22 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