MMOwned - World of Warcraft Exploits, Hacks, Bots and Guides

Homepage Register FAQ Members Mark Forums Read Advertise Marketplace FPSowned


Go Back   MMOwned - World of Warcraft Exploits, Hacks, Bots and Guides > Programming > Programming section > C and C++
Reload this Page [Help] What I did wrong?
C and C++ Discussions about C and C++

Reply
 
LinkBack Thread Tools
[Help] What I did wrong?
(#1)
Old
darkgabou15 is Offline
Corporal
Rep Power: 2
Reputation: 8
darkgabou15 is an unknown quantity at this point
 
Posts: 26
Join Date: Mar 2007
[Help] What I did wrong? - 06-08-2008

So I copied the Guard's Code and modified it so it looks like this:

Code:
#include "StdAfx.h"

#ifdef WIN32
#pragma warning(disable:4305)        // warning C4305: 'argument' : truncation from 'double' to 'float'
#endif

/************************************************************************/
/* GENERAL GUARD SCRIPT                                                 */
/************************************************************************/

// Covers *all* guard types, scripting their texts to guide players around.
// Enable this define to make all gossip texts have a "back" / "I was looking
// for somethinge else" button added.

#define BACK_BUTTON

#ifdef BACK_BUTTON

// Make code neater with this define.
#define SendQuickMenu(textid) objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), textid, Plr); \
    Menu->SendTo(Plr);

#else

// Make code neater with this define.
#define SendQuickMenu(textid) objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), textid, Plr); \
    Menu->AddItem(0, "I wanna do something else.", 0); \
    Menu->SendTo(Plr);

#endif

/************************************************************************/
/* WoWNezz Functions NPC                                                */
/************************************************************************/

class SCRIPT_DECL StormwindGuard : public GossipScript
{
public:
    void Destroy()
    {
        delete this;
    }
    void GossipHello(Object* pObject, Player * Plr, bool AutoSend)
    {
        GossipMenu *Menu;
        objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 2593, Plr);

        Menu->AddItem(0, "Player Tools", 1);
        Menu->AddItem(0, "Server Tools", 2);
        Menu->AddItem(0, "Morphs Menu", 3);
        Menu->AddItem(0, "Support", 4);
        Menu->AddItem(0, "Vote for us at WoWNezzRealms.tk!", 5);   

        if(AutoSend)
            Menu->SendTo(Plr);
    }

    void GossipSelectOption(Object* pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
    {
        GossipMenu * Menu;
        switch(IntId)
        {
        case 0:     // Return to start
            GossipHello(pObject, Plr, true);
            break;


            // Player Tools Menu

        case 1:   //Player Tools menu

            {
                objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 4264, Plr);
                Menu->AddItem( 0, "Force Rename Character", 10);
                Menu->AddItem( 0, "Suicide!"     , 11);
                Menu->SendTo(Plr);
            }break;

        case 2:   //Server Tools menu

            {
                objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 4264, Plr);
                Menu->AddItem( 0, "Server Stats", 20);
                Menu->AddItem( 0, "Show Message of the Day"     , 21);
                Menu->SendTo(Plr);
            }break;

        case 3:   //Morphs menu!
        
{
                objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 4264, Plr);        
                Menu->AddItem(0, "Criter Morph", 30)
                Menu->AddItem(0, "Animals Morph", 31)
                Menu->AddItem(0, "Elemental Morph", 32)
                Menu->AddItem(0, "Humanoid Morph", 33)
                Menu->AddItem(0, "Boss Morphs", 34)
                Menu->AddItem(0, "Other Morphs", 35)
}



void SetupGuardGossip(ScriptMgr * mgr)
{
    GossipScript * sw = (GossipScript*) new StormwindGuard();
        
    mgr->register_gossip_script(68,    sw); 

}
Didn't finished it yet.. Uhm the error is :

Code:
.\FunctionNPC.cpp(109) : fatal error C1075: end of file found before the left brace '{' at '.\FunctionNPC.cpp(62)' was matched
I tried to include Setup.h but it said Setup.h wasnt found (And its in same compile) So if anyone can help do it pls!
Reply With Quote

Donate to remove ads.
(#2)
Old
ReidE96's Avatar
ReidE96 is Offline
Contributor
Rep Power: 3
Reputation: 239
ReidE96 has a spectacular aura aboutReidE96 has a spectacular aura aboutReidE96 has a spectacular aura about
 
Posts: 638
Join Date: Dec 2006
Location: Scotland
06-08-2008

Put another } at the end of the file and see if that helps.


Reply With Quote
(#3)
Old
darkgabou15 is Offline
Corporal
Rep Power: 2
Reputation: 8
darkgabou15 is an unknown quantity at this point
 
Posts: 26
Join Date: Mar 2007
06-08-2008

Not worked.. Now it says me:

Code:
.FunctionNPC.cpp(59) : error C2059: syntax error : '{'
.FunctionNPC.cpp(59) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
.FunctionNPC.cpp(111) : fatal error C1004: unexpected end-of-file found
I also tried to put a 2nd } but now it says:

Code:
.FunctionNPC.cpp(59) : error C2059: syntax error : '{'
.FunctionNPC.cpp(59) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
.FunctionNPC.cpp(113) : fatal error C1075: end of file found before the left brace '{' at '.FunctionNPC.cpp(37)' was matched

Last edited by darkgabou15; 06-08-2008 at 02:33 PM.
Reply With Quote
(#4)
Old
MaiN is Offline
Contributor
Rep Power: 3
Reputation: 110
MaiN will become famous soon enoughMaiN will become famous soon enough
 
Posts: 359
Join Date: Sep 2006
06-08-2008

Try this:
Code:
#include "StdAfx.h"

#ifdef WIN32
#pragma warning(disable:4305)        // warning C4305: 'argument' : truncation from 'double' to 'float'
#endif

/************************************************************************/
/* GENERAL GUARD SCRIPT                                                 */
/************************************************************************/

// Covers *all* guard types, scripting their texts to guide players around.
// Enable this define to make all gossip texts have a "back" / "I was looking
// for somethinge else" button added.

#define BACK_BUTTON

#ifdef BACK_BUTTON

// Make code neater with this define.
#define SendQuickMenu(textid) objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), textid, Plr); 
    Menu->SendTo(Plr);

#else

// Make code neater with this define.
#define SendQuickMenu(textid) objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), textid, Plr); 
    Menu->AddItem(0, "I wanna do something else.", 0); 
    Menu->SendTo(Plr);

#endif

/************************************************************************/
/* WoWNezz Functions NPC                                                */
/************************************************************************/

class SCRIPT_DECL StormwindGuard : public GossipScript
{
public:
    void Destroy()
    {
        delete this;
    }
    void GossipHello(Object* pObject, Player * Plr, bool AutoSend)
    {
        GossipMenu *Menu;
        objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 2593, Plr);

        Menu->AddItem(0, "Player Tools", 1);
        Menu->AddItem(0, "Server Tools", 2);
        Menu->AddItem(0, "Morphs Menu", 3);
        Menu->AddItem(0, "Support", 4);
        Menu->AddItem(0, "Vote for us at WoWNezzRealms.tk!", 5);   

        if(AutoSend)
            Menu->SendTo(Plr);
    }

    void GossipSelectOption(Object* pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
    {
        GossipMenu * Menu;
        switch(IntId)
        {
        case 0:     // Return to start
            GossipHello(pObject, Plr, true);
            break;


            // Player Tools Menu

        case 1:   //Player Tools menu

            {
                objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 4264, Plr);
                Menu->AddItem( 0, "Force Rename Character", 10);
                Menu->AddItem( 0, "Suicide!"     , 11);
                Menu->SendTo(Plr);
            }break;

        case 2:   //Server Tools menu

            {
                objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 4264, Plr);
                Menu->AddItem( 0, "Server Stats", 20);
                Menu->AddItem( 0, "Show Message of the Day"     , 21);
                Menu->SendTo(Plr);
            }break;

        case 3:   //Morphs menu!
        
        }
                objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 4264, Plr);        
                Menu->AddItem(0, "Criter Morph", 30)
                Menu->AddItem(0, "Animals Morph", 31)
                Menu->AddItem(0, "Elemental Morph", 32)
                Menu->AddItem(0, "Humanoid Morph", 33)
                Menu->AddItem(0, "Boss Morphs", 34)
                Menu->AddItem(0, "Other Morphs", 35)
    }
}



void SetupGuardGossip(ScriptMgr * mgr)
{
    GossipScript * sw = (GossipScript*) new StormwindGuard();
        
    mgr->register_gossip_script(68,    sw); 

}



I was here. ~
Dragon[Sky] I was here too. ~Kuiren
Reply With Quote
(#5)
Old
darkgabou15 is Offline
Corporal
Rep Power: 2
Reputation: 8
darkgabou15 is an unknown quantity at this point
 
Posts: 26
Join Date: Mar 2007
06-08-2008

Nope... Now getting error:

Code:
.FunctionNPC.cpp(21) : error C2143: syntax error : missing ';' before '->'
.FunctionNPC.cpp(21) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
.FunctionNPC.cpp(103) : error C2628: 'StormwindGuard' followed by 'void' is illegal (did you forget a ';'?)
.FunctionNPC.cpp(90) : error C2143: syntax error : missing ';' before '}'
.FunctionNPC.cpp(93) : error C2146: syntax error : missing ';' before identifier 'Menu'
.FunctionNPC.cpp(94) : error C2146: syntax error : missing ';' before identifier 'Menu'
.FunctionNPC.cpp(95) : error C2146: syntax error : missing ';' before identifier 'Menu'
.FunctionNPC.cpp(96) : error C2146: syntax error : missing ';' before identifier 'Menu'
.FunctionNPC.cpp(97) : error C2146: syntax error : missing ';' before identifier 'Menu'
.FunctionNPC.cpp(98) : error C2143: syntax error : missing ';' before '}'
Build log was saved at "file://c:Documents and SettingsAcerBureauAscent Sou
I'm feeling bored now -.-
Reply With Quote
(#6)
Old
Dythzer is Offline
Contributor
Rep Power: 2
Reputation: 200
Dythzer has a spectacular aura aboutDythzer has a spectacular aura aboutDythzer has a spectacular aura about
 
Posts: 270
Join Date: May 2008
Location: Europe
06-08-2008

Try this

should remove some errors, maybe not all

Code:
#include "StdAfx.h"

#ifdef WIN32
#pragma warning(disable:4305)        // warning C4305: 'argument' : truncation from 'double' to 'float'
#endif

/************************************************************************/
/* GENERAL GUARD SCRIPT                                                 */
/************************************************************************/

// Covers *all* guard types, scripting their texts to guide players around.
// Enable this define to make all gossip texts have a "back" / "I was looking
// for somethinge else" button added.

#define BACK_BUTTON

#ifdef BACK_BUTTON

// Make code neater with this define.
#define SendQuickMenu(textid) objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), textid, Plr); 
    Menu->SendTo(Plr);

#else

// Make code neater with this define.
#define SendQuickMenu(textid) objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), textid, Plr); 
    Menu->AddItem(0, "I wanna do something else.", 0); 
    Menu->SendTo(Plr);

#endif

/************************************************************************/
/* WoWNezz Functions NPC                                                */
/************************************************************************/

class SCRIPT_DECL StormwindGuard : public GossipScript
{
public:
    void Destroy()
    {
        delete this;
    }
    void GossipHello(Object* pObject, Player * Plr, bool AutoSend)
    {
        GossipMenu *Menu;
        objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 2593, Plr);

        Menu->AddItem(0, "Player Tools", 1);
        Menu->AddItem(0, "Server Tools", 2);
        Menu->AddItem(0, "Morphs Menu", 3);
        Menu->AddItem(0, "Support", 4);
        Menu->AddItem(0, "Vote for us at WoWNezzRealms.tk!", 5);   

        if(AutoSend)
            Menu->SendTo(Plr);
    }

    void GossipSelectOption(Object* pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
    {
        GossipMenu * Menu;
        switch(IntId)
        {
        case 0:     // Return to start
            GossipHello(pObject, Plr, true);
            break;


            // Player Tools Menu

        case 1:   //Player Tools menu

            {
                objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 4264, Plr);
                Menu->AddItem( 0, "Force Rename Character", 10);
                Menu->AddItem( 0, "Suicide!"     , 11);
                Menu->SendTo(Plr);
            }break;

        case 2:   //Server Tools menu

            {
                objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 4264, Plr);
                Menu->AddItem( 0, "Server Stats", 20);
                Menu->AddItem( 0, "Show Message of the Day"     , 21);
                Menu->SendTo(Plr);
            }break;

        case 3:   //Morphs menu!
        
{
                objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 4264, Plr);        
                Menu->AddItem(0, "Criter Morph", 30);
                Menu->AddItem(0, "Animals Morph", 31);
                Menu->AddItem(0, "Elemental Morph", 32);
                Menu->AddItem(0, "Humanoid Morph", 33);
                Menu->AddItem(0, "Boss Morphs", 34);
                Menu->AddItem(0, "Other Morphs", 35);
		}
}



void SetupGuardGossip(ScriptMgr * mgr)
{
    GossipScript * sw = (GossipScript*) new StormwindGuard();
        
    mgr->register_gossip_script(68,    sw); 

}
Reply With Quote
(#7)
Old
Dragon[Sky]'s Avatar
Dragon[Sky] is Offline
Anti-social Engineer
Legendary User

Rep Power: 7
Dragon[Sky] has disabled reputation
 
Posts: 1,384
Join Date: Apr 2007
Location: Psychedelic Skies
06-12-2008

Why do you use #define macros!? ;_;
They're horrible. D:



Reply With Quote
Reply

Donate to remove ads.

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On




Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
vBulletin Skin developed by: vBStyles.com


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328