Help C++ Script (after fix Release lol) menu

User Tag List

Results 1 to 9 of 9
  1. #1
    mager1794's Avatar Member
    Reputation
    356
    Join Date
    Feb 2008
    Posts
    703
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help C++ Script (after fix Release lol)

    i keep getting this error
    Code:
    ------ Build started: Project: GossipScripts, Configuration: Release Win32 ------
    Compiling...
    MountNPC.cpp
    ..\src\GossipScripts\MountNPC.cpp(53) : error C2601: 'MountItem::GossipSelectOption' : local function definitions are illegal
    ..\src\GossipScripts\MountNPC.cpp(36): this line contains a '{' which has not yet been matched
    Build log was saved at "file://c:\Documents and Settings\Kimberly the Genius!\Desktop\Codys\SQL test\src\scripts\projects\2008_int_release_gossipscripts\BuildLog.htm"
    GossipScripts - 1 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 4 up-to-date, 1 skipped ==========
    


    here is the script guys
    i made it cause people kept asking about custom mounts and stuff so i made a C++
    item script with 4 of them

    Code:
    ////////////////////////////////////////////////////////////
    /* Mount Item Script Written by Mager1794 of MMOwned //
    * //
    * This script can be easily edited to be //
    * used for your server. Throughout the script //
    * are comments on what each thing does so that //
    * you can edit this. You can create custom //
    * teleporting locations and menus. //
    * //
    * Originally written by Mager1794 //
    *///
    /////////////////////////////////////////////////
     
     
    #include"StdAfx.h"
    #include"Setup.h"
    #define MOUNT_ITEM 99999
    #ifdef WIN32
    #pragmawarning(disable:4018) // signed/unsigned mismatch in comparison op
    #endif
    class SCRIPT_DECL MountItem : public GossipScript
    {
    public:
    void GossipHello(Object * pObject, Player* Plr, bool AutoSend);
    void GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, constchar * Code);
    void GossipEnd(Object * pObject, Player* Plr);
    void Destroy(){ deletethis;}
    };
     
    void MountItem::GossipHello(Object * pObject, Player* Plr, bool AutoSend)
    {
    if(Plr->CombatStatus.IsInCombat()){
    Plr->BroadcastMessage("You are in combat!");
    }else{
    GossipMenu *Menu;
    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
    Menu->AddItem(0, "Dragonhawk Mount [level 20+]", 1);
    Menu->AddItem(0, "Cobra Mount [level 40+]", 2);
    Menu->AddItem(0, "Diemtradon [Level 50+]", 3);
    Menu->AddItem(0, "Dragon [level 65+]", 4);
    Menu->AddItem(12, "Script Written by Mager1794", 0);//you can remove this you wish but i love you long time if you dont XD
    
    if(AutoSend)
    Menu->SendTo(Plr);
    }
    
    void MountItem::GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, constchar * Code)
    {
    Creature * pCreature = (pObject->GetTypeId()==TYPEID_UNIT)?((Creature*)pObject):NULL;
    if(pCreature==NULL)
    return;
    GossipMenu * Menu;
    switch(IntId)
    {
    case 1:
    if(Plr->getLevel() >= 20){
    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "You have mounted on Dragonhawk!");
    Plr->SetPlayerSpeed(RUN, 9);
    Plr->SetPlayerSpeed(SWIM, 9);
    Plr->SetPlayerSpeed(RUNBACK, 6);
    Plr->SetPlayerSpeed(FLY, 9);
    Plr->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, 17547);
    }else {
    Plr->BroadcastMessage("Not high enough level to ride this mount please level up tp level 20"); 
    }
    break;
    
    case 2:
    if(Plr->getLevel() >= 35){
    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "You Have Mounted on Cobra");
    Plr->SetPlayerSpeed(RUN, 14);
    Plr->SetPlayerSpeed(SWIM, 14);
    Plr->SetPlayerSpeed(RUNBACK, 6);
    Plr->SetPlayerSpeed(FLY, 14);
    Plr->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, 14559);
    }else {
    Plr->BroadcastMessage("Not high enough level to ride this mount please level up tp level 35"); 
    }
    break;
    
    case 3: 
    if(Plr->getLevel() >= 50){
    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "You Have Mounted on Diemtradon");
    Plr->SetPlayerSpeed(RUN, 20);
    Plr->SetPlayerSpeed(SWIM, 20);
    Plr->SetPlayerSpeed(RUNBACK, 6);
    Plr->SetPlayerSpeed(FLY, 20);
    Plr->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, 13210);
    }else {
    Plr->BroadcastMessage("Not high enough level to ride this mount please level up tp level 50"); 
    }
    break;
    
    case 4: 
    if(Plr->getLevel() >= 65){
    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "You Have Mounted on Dragon");
    Plr->SetPlayerSpeed(RUN, 40);
    Plr->SetPlayerSpeed(SWIM, 40);
    Plr->SetPlayerSpeed(RUNBACK, 6);
    Plr->SetPlayerSpeed(FLY, 40);
    Plr->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, 2554);
    }else {
    Plr->BroadcastMessage("Not high enough level to ride this mount please level up tp level 65"); 
    }
    break;
    }
    Plr->Gossip_Complete();
    }
    }
    void SetupMountItem(ScriptMgr * mgr)
    {
    GossipScript * gs = (GossipScript*) new MountItem();
    mgr->register_item_gossip_script(MOUNT_ITEM, gs);
    }
    
    
    Lunar Gaming - Reaching For The Stars

    Help C++ Script (after fix Release lol)
  2. #2
    venom9122's Avatar Member
    Reputation
    20
    Join Date
    Nov 2007
    Posts
    99
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok on the first error, get rid of the mountitem part of the line then gimme the new results
    Don't worry, this won't bring up a BSOD......... well not this time.

  3. #3
    mager1794's Avatar Member
    Reputation
    356
    Join Date
    Feb 2008
    Posts
    703
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what do you mean
    Lunar Gaming - Reaching For The Stars

  4. #4
    venom9122's Avatar Member
    Reputation
    20
    Join Date
    Nov 2007
    Posts
    99
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    void MountItem::GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, constchar * Code)
    {
    =
    void GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, constchar * Code)
    {

    Don't worry, this won't bring up a BSOD......... well not this time.

  5. #5
    mager1794's Avatar Member
    Reputation
    356
    Join Date
    Feb 2008
    Posts
    703
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it failed with same exact errors
    Lunar Gaming - Reaching For The Stars

  6. #6
    doublehex's Avatar Member
    Reputation
    34
    Join Date
    Mar 2007
    Posts
    385
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lol its just a simple brace error
    void MountItem::GossipHello(Object * pObject, Player* Plr, bool AutoSend)
    {
    if(Plr->CombatStatus.IsInCombat())
    {
    Plr->BroadcastMessage("You are in combat!");
    }
    else
    {
    GossipMenu *Menu;
    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
    Menu->AddItem(0, "Dragonhawk Mount [level 20+]", 1);
    Menu->AddItem(0, "Cobra Mount [level 40+]", 2);
    Menu->AddItem(0, "Diemtradon [Level 50+]", 3);
    Menu->AddItem(0, "Dragon [level 65+]", 4);
    Menu->AddItem(12, "Script Written by Mager1794", 0);//you can remove this you wish but i love you long time if you dont XD
    if(AutoSend)
    Menu->SendTo(Plr);
    }
    }
    you just forgot that one brace in red, its easier if you spread them out, like i did above, and use notepad++ because it shows where the brace opens and closes if you set the language to c++.
    Last edited by doublehex; 07-09-2008 at 06:54 AM.


  7. #7
    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)
    The quote removed doublehex's indentation; You can read about it here:
    Indent style - Wikipedia, the free encyclopedia

  8. #8
    igud2's Avatar Member
    Reputation
    10
    Join Date
    Nov 2007
    Posts
    47
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    this is what i get for an error

    Code:
    ------ Build started: Project: MountNPC, Configuration: Release Win32 ------
    Compiling...
    MountNPC.cpp
    ..srcMountNPCMountNPC.cpp(4) : fatal error C1020: unexpected #endif
    Build log was saved at "file://c:Documents and SettingsChuckDesktopAscenttrunksrcscriptsprojects2008_int_release_MountNPCBuildLog.htm"
    MountNPC - 1 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
    ==========

  9. #9
    doublehex's Avatar Member
    Reputation
    34
    Join Date
    Mar 2007
    Posts
    385
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lol he put each of these on the same line:
    #define MOUNT_ITEM 99999 #ifdef WIN32 #pragmawarning(disable:401 // signed/unsigned mismatch in comparison op
    #endif
    should be:
    #define MOUNT_ITEM 99999
    #ifdef WIN32
    #pragma
    warning(disable:401 // signed/unsigned mismatch in comparison op
    #endif


Similar Threads

  1. How to exploit to S3 weps/shoulds [After fix]
    By pennaha in forum World of Warcraft Exploits
    Replies: 28
    Last Post: 12-26-2007, 05:12 AM
  2. i need help with script, im a noob
    By orangegold in forum WoW UI, Macros and Talent Specs
    Replies: 2
    Last Post: 10-27-2007, 05:47 PM
  3. Need help with a head fix
    By Acechill in forum WoW ME Questions and Requests
    Replies: 10
    Last Post: 07-25-2007, 01:02 PM
  4. help with scripts
    By orangegold in forum World of Warcraft General
    Replies: 0
    Last Post: 03-28-2007, 05:50 PM
  5. Can someone help me with helm fix?
    By qqqaaazzz in forum WoW ME Questions and Requests
    Replies: 5
    Last Post: 01-29-2007, 01:57 AM
All times are GMT -5. The time now is 07:35 AM. 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