• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[SOLVED] Title NPC errors!

Status
Not open for further replies.

katos

Noble Member
Hey guys, stuck on an error that I can't for the life of me seem to wrap my head around. Probably something incredibly stupid, but I have a very limited knowledge of C++ and therefore this script is made by updating an old script and removing / adding functions as I need them.

The error:
Code:
Error	1	error C1075: end of file found before the left brace '{' at 'D:\trinity\src\server\scripts\Custom\title_npc.cpp(10)' was matched	D:\trinity\src\server\scripts\Custom\title_npc.cpp	280	1	scripts

The script:
Click Me

Terribly sorry if this is very newbish, I seem totally unable to wrap my head around it.


Any and all help much appreciated.
Thanks in advance!
 

katos

Noble Member
Doesnt matter : |

The OnGossipHello function is incomplete.
It totally lacks the bottom half of the function, including the closing }

The script here I have built using another script as a foundation, since my C++ skill is shockingly poor.
The OnGossipHello is incomplete? I shall look into this, thanks Rochet! :)
 

katos

Noble Member
Ok fixed the OnGossipHello - can't believe I missed that, that was me missing the "exit" sorry about that!

New errors:
Error 1 error C2065: 'creature' : undeclared identifier D:\trinity\src\server\scripts\Custom\title_npc.cpp 72 1 scripts
Error 2 error C2227: left of '->GetGUID' must point to class/struct/union/generic type D:\trinity\src\server\scripts\Custom\title_npc.cpp 72 1 scripts
Error 3 error C2660: 'PlayerMenu::SendGossipMenu' : function does not take 1 arguments D:\trinity\src\server\scripts\Custom\title_npc.cpp 72 1 scripts
Error 4 error C2664: 'void WorldObject::MonsterWhisper(int32,const Player *,bool)' : cannot convert argument 2 from 'uint64' to 'const Player *' D:\trinity\src\server\scripts\Custom\title_npc.cpp 125 1 scripts
Error 5 error C2664: 'void WorldObject::MonsterWhisper(int32,const Player *,bool)' : cannot convert argument 2 from 'uint64' to 'const Player *' D:\trinity\src\server\scripts\Custom\title_npc.cpp 132 1 scripts
Error 6 error C2664: 'void WorldObject::MonsterWhisper(int32,const Player *,bool)' : cannot convert argument 2 from 'uint64' to 'const Player *' D:\trinity\src\server\scripts\Custom\title_npc.cpp 139 1 scripts
Error 7 error C2664: 'void WorldObject::MonsterWhisper(int32,const Player *,bool)' : cannot convert argument 2 from 'uint64' to 'const Player *' D:\trinity\src\server\scripts\Custom\title_npc.cpp 146 1 scripts
Error 8 error C2664: 'void WorldObject::MonsterWhisper(int32,const Player *,bool)' : cannot convert argument 2 from 'uint64' to 'const Player *' D:\trinity\src\server\scripts\Custom\title_npc.cpp 153 1 scripts
Error 9 error C2664: 'void WorldObject::MonsterWhisper(int32,const Player *,bool)' : cannot convert argument 2 from 'uint64' to 'const Player *' D:\trinity\src\server\scripts\Custom\title_npc.cpp 160 1 scripts
Error 10 error C2664: 'void WorldObject::MonsterWhisper(int32,const Player *,bool)' : cannot convert argument 2 from 'uint64' to 'const Player *' D:\trinity\src\server\scripts\Custom\title_npc.cpp 167 1 scripts
Error 11 error C2664: 'void WorldObject::MonsterWhisper(int32,const Player *,bool)' : cannot convert argument 2 from 'uint64' to 'const Player *' D:\trinity\src\server\scripts\Custom\title_npc.cpp 174 1 scripts
Error 12 error C2664: 'void WorldObject::MonsterWhisper(int32,const Player *,bool)' : cannot convert argument 2 from 'uint64' to 'const Player *' D:\trinity\src\server\scripts\Custom\title_npc.cpp 181 1 scripts
Error 13 error C2664: 'void WorldObject::MonsterWhisper(int32,const Player *,bool)' : cannot convert argument 2 from 'uint64' to 'const Player *' D:\trinity\src\server\scripts\Custom\title_npc.cpp 188 1 scripts
Error 14 error C2664: 'void WorldObject::MonsterWhisper(int32,const Player *,bool)' : cannot convert argument 2 from 'uint64' to 'const Player *' D:\trinity\src\server\scripts\Custom\title_npc.cpp 195 1 scripts
Error 15 error C2664: 'void WorldObject::MonsterWhisper(int32,const Player *,bool)' : cannot convert argument 2 from 'uint64' to 'const Player *' D:\trinity\src\server\scripts\Custom\title_npc.cpp 202 1 scripts
Error 16 error C2664: 'void WorldObject::MonsterWhisper(int32,const Player *,bool)' : cannot convert argument 2 from 'uint64' to 'const Player *' D:\trinity\src\server\scripts\Custom\title_npc.cpp 209 1 scripts
Error 17 error C2664: 'void WorldObject::MonsterWhisper(int32,const Player *,bool)' : cannot convert argument 2 from 'uint64' to 'const Player *' D:\trinity\src\server\scripts\Custom\title_npc.cpp 216 1 scripts
Error 18 error C2664: 'void WorldObject::MonsterWhisper(int32,const Player *,bool)' : cannot convert argument 2 from 'uint64' to 'const Player *' D:\trinity\src\server\scripts\Custom\title_npc.cpp 223 1 scripts
Error 19 error C2664: 'void WorldObject::MonsterWhisper(int32,const Player *,bool)' : cannot convert argument 2 from 'uint64' to 'const Player *' D:\trinity\src\server\scripts\Custom\title_npc.cpp 230 1 scripts
Error 20 error C2664: 'void WorldObject::MonsterWhisper(int32,const Player *,bool)' : cannot convert argument 2 from 'uint64' to 'const Player *' D:\trinity\src\server\scripts\Custom\title_npc.cpp 237 1 scripts
Error 21 error C2664: 'void WorldObject::MonsterWhisper(int32,const Player *,bool)' : cannot convert argument 2 from 'uint64' to 'const Player *' D:\trinity\src\server\scripts\Custom\title_npc.cpp 244 1 scripts
Error 22 error C2664: 'void WorldObject::MonsterWhisper(int32,const Player *,bool)' : cannot convert argument 2 from 'uint64' to 'const Player *' D:\trinity\src\server\scripts\Custom\title_npc.cpp 251 1 scripts
Error 23 error C2664: 'void WorldObject::MonsterWhisper(int32,const Player *,bool)' : cannot convert argument 2 from 'uint64' to 'const Player *' D:\trinity\src\server\scripts\Custom\title_npc.cpp 258 1 scripts
Error 24 error C2664: 'void WorldObject::MonsterWhisper(int32,const Player *,bool)' : cannot convert argument 2 from 'uint64' to 'const Player *' D:\trinity\src\server\scripts\Custom\title_npc.cpp 265 1 scripts
Error 25 error C2664: 'void WorldObject::MonsterWhisper(int32,const Player *,bool)' : cannot convert argument 2 from 'uint64' to 'const Player *' D:\trinity\src\server\scripts\Custom\title_npc.cpp 272 1 scripts
Error 26 error C2664: 'void WorldObject::MonsterWhisper(int32,const Player *,bool)' : cannot convert argument 2 from 'uint64' to 'const Player *' D:\trinity\src\server\scripts\Custom\title_npc.cpp 279 1 scripts
Error 27 error C2664: 'void WorldObject::MonsterWhisper(int32,const Player *,bool)' : cannot convert argument 2 from 'uint64' to 'const Player *' D:\trinity\src\server\scripts\Custom\title_npc.cpp 286 1 scripts
Error 28 error C2664: 'void WorldObject::MonsterWhisper(int32,const Player *,bool)' : cannot convert argument 2 from 'uint64' to 'const Player *' D:\trinity\src\server\scripts\Custom\title_npc.cpp 293 1 scripts
Error 29 error C2664: 'void WorldObject::MonsterWhisper(int32,const Player *,bool)' : cannot convert argument 2 from 'uint64' to 'const Player *' D:\trinity\src\server\scripts\Custom\title_npc.cpp 300 1 scripts
Error 30 error C2664: 'void WorldObject::MonsterWhisper(int32,const Player *,bool)' : cannot convert argument 2 from 'uint64' to 'const Player *' D:\trinity\src\server\scripts\Custom\title_npc.cpp 307 1 scripts
Error 31 error C2664: 'void WorldObject::MonsterWhisper(int32,const Player *,bool)' : cannot convert argument 2 from 'uint64' to 'const Player *' D:\trinity\src\server\scripts\Custom\title_npc.cpp 314 1 scripts

I am told this is maybe because the script is using an outdated structure? :S
 

katos

Noble Member
Ok, have fixed the above, but now have these errors :

Error 1 error C2065: 'creature' : undeclared identifier D:\trinity\src\server\scripts\Custom\title_npc.cpp 72 1 scripts
Error 2 error C2227: left of '->GetGUID' must point to class/struct/union/generic type D:\trinity\src\server\scripts\Custom\title_npc.cpp 72 1 scripts
Error 3 error C2660: 'PlayerMenu::SendGossipMenu' : function does not take 1 arguments D:\trinity\src\server\scripts\Custom\title_npc.cpp 72 1 scripts
 

katos

Noble Member
I have now fixed all the errors but on compile I am getting the following:

D:\trinity\src\server\scripts\Custom\title_npc.cpp(76): warning C4101: 'slot' : unreferenced local variable
scripts.vcxproj -> D:\build\src\server\scripts\Release\scripts.lib
------ Build started: Project: worldserver, Configuration: Release Win32 ------
worldserver.vcxproj -> D:\build\bin\Release\worldserver.exe
------ Build started: Project: ALL_BUILD, Configuration: Release Win32 ------
Build all projects
------ Skipped Build: Project: INSTALL, Configuration: Release Win32 ------
Project not selected to build for this solution configuration
========== Build: 5 succeeded, 0 failed, 17 up-to-date, 1 skipped ==========

And upon checking in-game, the gossip menu is not shown, despite the script being added to the NPC:
http://puu.sh/9ABHS/58e7ba8d88.png
 

katos

Noble Member
Still struggling with the above, seem stuck on this one. Sorry about this guys, and I really appreciate everyone's help so far.
THANK YOU! :)
 

Tommy

Founder
This looks like my script in my video tutorial. I don't get why you wouldn't just use my script instead of those nasty enumerators. Here's my script that it was copied and completely ruined from:

Code:
/*
    <http://emudevs.com>
    By Tommy
*/

struct HonorGossip
{
    uint32 menu_id;
    uint8 icon;
    std::string name;
    uint32 HK, titleID;
};

// {icon, "title name", honored_kills, titleID}
HonorGossip Titles [] =
{
    {1, 9, "Private", 1, 1 },
    {2, 9, "Corporal", 100, 2 },
    {3, 9, "Sergeant", 250, 3 },
    {4, 9, "Master Sergeant", 500, 4 },
    {5, 9, "Sergeant Major", 750, 5 },
    {6, 9, "Knight", 1000, 6 },
    {7, 9, "Knight-Lieutenant", 1500, 7 },
    {8, 9, "Knight-Captain", 2000, 8 },
    {9, 9, "Knight-Champion", 2500, 9 },
    {10, 9, "Lieutenant Commander", 3000, 10 },
    {11, 9, "Commander", 3500, 11 },
    {12, 9, "Marshal", 4000, 12 },
    {13, 9, "Field Marshal", 4500, 13 },
    {14, 9, "Grand Marshal", 5000, 14 },

    {15, 9, "Scout", 1, 15 },
    {16, 9, "Grunt", 100, 16 },
    {17, 9, "Sergeant", 250, 17 },
    {18, 9, "Senior Sergeant", 500, 18 },
    {19, 9, "First Sergeant", 750, 19 },
    {20, 9, "Stone Guard", 1000, 20 },
    {21, 9, "Blood Guard", 1500, 21 },
    {22, 9, "Legionnaire", 2000, 22 },
    {23, 9, "Centurion", 2500, 23 },
    {24, 9, "Champion", 3000, 24 },
    {25, 9, "Lieutenant General", 3500, 25 },
    {26, 9, "General", 4000, 26 },
    {27, 9, "Warlord", 4500, 27 },
    {28, 9, "High Warlord", 5000, 28 },
};

class npc_honor_gossip : public CreatureScript
{
public:
    npc_honor_gossip() : CreatureScript("npc_honor_gossip") { }

    bool OnGossipHello(Player* player, Creature* creature)
    {
        player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "How does this NPC work?", GOSSIP_SENDER_MAIN, 100);
        player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Titles", GOSSIP_SENDER_MAIN, 101);
        player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Nevermind..", GOSSIP_SENDER_MAIN, 102);
        player->SEND_GOSSIP_MENU(1, creature->GetGUID());
        return true;
    }

    bool OnGossipSelect(Player* player, Creature* creature, uint32 /* sender */, uint32 actions)
    {
        player->PlayerTalkClass->ClearMenus();
        if (actions == 100)
            ChatHandler(player->GetSession()).SendSysMessage("This npc gives you titles, herp, derp..");
        else if(actions == 101)
        {
            if (player->GetTeam() == ALLIANCE)
                for (int i = 0; i < 14; i++)
                    player->ADD_GOSSIP_ITEM(Titles[i].icon, Titles[i].name.c_str(), GOSSIP_SENDER_MAIN, Titles[i].menu_id);
            else
                for (int i = 14; i < 28; i++)
                    player->ADD_GOSSIP_ITEM(Titles[i].icon, Titles[i].name.c_str(), GOSSIP_SENDER_MAIN, Titles[i].menu_id);
            player->SEND_GOSSIP_MENU(1, creature->GetGUID());
        }
        else if (actions == 102)
            player->CLOSE_GOSSIP_MENU();

        for (int i = 0; i < sizeof(Titles) / sizeof(*Titles); i++)
            if (actions == Titles[i].menu_id)
                if (!player->HasTitle(Titles[i].titleID) && player->GetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS) >= Titles[i].HK)
                    if (CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(Titles[i].titleID))
                    {
                        player->SetTitle(titleEntry);
                        player->CLOSE_GOSSIP_MENU();
                    }
        return true;
    }
};

void AddSC_honor_gossip()
{
    new npc_honor_gossip;
}

I get that the loops could be altered to clean the script up with, but it is a tutorial example nonetheless. It wasn't to update an old script, it looks like it destroyed mine all together since it isn't at all clean. My tutorial example was about using arrays for cleaner scripts too. :/

Anyway.. IF you really want it fixed your way:

0. Remove the struct 'HonorGossip' since you aren't using it
1. You don't need "player->PlayerTalkClass->ClearMenus();" in OnGossipHello
2. Even if the script compiled, the gossip menu wouldn't send to the player because you're not sending the menu, "player->SEND_GOSSIP_MENU(1, creature->GetGUID());"
3. "_creature" variable can be changed to "creature" without the nonsense of that underscore. (Might not matter, but it makes it look better)
4. In OnGossipSelect you can comment out sender as it won't be used uint32 /*sender*/
5. You can remove the sender == IF statement, it's not needed
6. "uint8 slot;" can be removed as it isn't being used at all
7. You can easily create a function for the HK kill checks to clean up the script
8. player->PlayerTalkClass->SendCloseGossip(); can be changed to player->CLOSE_GOSSIP_MENU

The error was located on line 319.


I did this in Notepad++, so I'm not sure if there are any errors. I did everything I mentioned above:

Code:
enum eRanks
{
    PRIVATE = 1,
    CORPORAL = 2,
    SERGEANT = 3,
    MASTER_SERGEANT = 4,
    SERGEANT_MAJOR = 5,
    KNIGHT = 6,
    KNIGHT_LIEUTENANT = 7,
    KNIGHT_CAPTAIN = 8,
    KNIGHT_CHAMPION = 9,
    LIEUTENANT_COMMANDER = 10,
    COMMANDER = 11,
    MARSHAL = 12,
    FIELD_MARSHAL = 13,
    GRAND_MARSHAL = 14,
    SCOUT = 15,
    GRUNT = 16,
    SERGEANT_H = 17,
    SENIOR_SERGEANT = 18,
    FIRST_SERGEANT = 19,
    STONE_GUARD = 20,
    BLOOD_GUARD = 21,
    LEGIONNAIRE = 22,
    CENTURION = 23,
    CHAMPION = 24,
    LIEUTENANT_GENERAL = 25,
    GENERAL = 26,
    WARLORD = 27,
    HIGH_WARLORD = 28,
};
 
enum eKills
{
    KILLS_1 = 1,
    KILLS_2 = 50,
    KILLS_3 = 100,
    KILLS_4 = 250,
    KILLS_5 = 500,
    KILLS_6 = 750,
    KILLS_7 = 1000,
    KILLS_8 = 1500,
    KILLS_9 = 3000,
    KILLS_10 = 5000,
    KILLS_11 = 7500,
    KILLS_12 = 10000,
    KILLS_13 = 15000,
    KILLS_14 = 30000,
};


class npc_honor_gossip : public CreatureScript
{
public:
    npc_honor_gossip() : CreatureScript("npc_honor_gossip") { }
 
    bool OnGossipHello(Player* player, Creature* creature)
    {
        if (player->GetTeam() == HORDE)
            player->ADD_GOSSIP_ITEM(GOSSIP_ICON_TALK, "|TInterface/icons/Achievement_Arena_2v2_2:30|tPVP Titles", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
        else
            player->ADD_GOSSIP_ITEM(GOSSIP_ICON_TALK, "|TInterface/icons/Achievement_Arena_2v2_2:30|tPVP Titles", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
        player->ADD_GOSSIP_ITEM(7, "|TInterface\\icons\\Ability_Spy:30|tExit|r", GOSSIP_SENDER_MAIN, 102);
		player->SEND_GOSSIP_MENU(1, creature->GetGUID());

        return true;
    }

    bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 actions)
    {
        player->PlayerTalkClass->ClearMenus();
        switch(actions)
        {               
            case GOSSIP_ACTION_INFO_DEF+1:
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "SCOUT.(1 Kill)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "GRUNT.(50 Kills)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "SERGEANT_H.(100 Kills)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "SENIOR_SERGEANT.(250 Kills)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "FIRST_SERGEANT.(500 Kills)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "STONE_GUARD.(750 Kills)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 15);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "BLOOD_GUARD.(1000 Kills)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 16);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "LEGIONNAIRE.(1500 Kills)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 17);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "CENTURION.(3000 Kills)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 18);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "CHAMPION.(5000 Kills)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 19);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "LIEUTENANT_GENERAL.(7500 Kills)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 20);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "GENERAL.(10000 Kills)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "WARLORD.(15000 Kills)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "HIGH_WARLORD.(30000 Kills)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 23);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Nevermind", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+99);
                player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, _creature->GetGUID());
                break;                          
            case GOSSIP_ACTION_INFO_DEF+2:
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "PRIVATE.(1 Kill)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 30);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "CORPORAL.(50 Kills)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 31);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "SERGEANT.(100 Kills)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 32);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "MASTER_SERGEANT.(250 Kills)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 33);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "SERGEANT_MAJOR.(500 Kills)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 34);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "KNIGHT.(750 Kills)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 35);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "KNIGHT_LIEUTENANT.(1000 Kills)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 36);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "KNIGHT_CAPTAIN.(1500 Kills)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 37);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "KNIGHT_CHAMPION.(3000 Kills)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 38);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "LIEUTENANT_COMMANDER.(5000 Kills)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 39);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "COMMANDER.(7500 Kills)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 40);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "MARSHAL.(10000 Kills)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 41);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "FIELD_MARSHAL.(15000 Kills)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 42);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "GRAND_MARSHAL.(30000 Kills)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 43);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Nevermind", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+99);
                player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, _creature->GetGUID());
                break;                              
            case GOSSIP_ACTION_INFO_DEF+10:
			    AddTitle(player, 1, SCOUT);
                break;                               
            case GOSSIP_ACTION_INFO_DEF+11:
			    AddTitle(player, 50, GRUNT);
                break;                              
            case GOSSIP_ACTION_INFO_DEF+12:
			    AddTitle(player, 100, SERGEANT_H);
                break;                              
            case GOSSIP_ACTION_INFO_DEF+13:
			    AddTitle(player, 250, SENIOR_SERGEANT);
                break;                              
            case GOSSIP_ACTION_INFO_DEF+14:
			    AddTitle(player, 500, FIRST_SERGEANT);
                break;                               
            case GOSSIP_ACTION_INFO_DEF+15:
			    AddTitle(player, 750, STONE_GUARD);
                break;                               
            case GOSSIP_ACTION_INFO_DEF+16:
			    AddTitle(player, 1000, BLOOD_GUARD);
                break;                             
            case GOSSIP_ACTION_INFO_DEF+17:
			    AddTitle(player, 1500, LEGIONNAIRE);
                break;                               
            case GOSSIP_ACTION_INFO_DEF+18:
			    AddTitle(player, 3000, CENTURION);
                break;                               
            case GOSSIP_ACTION_INFO_DEF+19:
			    AddTitle(player, 5000, CHAMPION);
                break;                              
            case GOSSIP_ACTION_INFO_DEF+20:
			    AddTitle(player, 7500, LIEUTENANT_GENERAL);
                break;                              
            case GOSSIP_ACTION_INFO_DEF+21:
			    AddTitle(player, 10000, GENERAL);
                break;                             
            case GOSSIP_ACTION_INFO_DEF+22:
			    AddTitle(player, 15000, WARLORD);
                break;                              
            case GOSSIP_ACTION_INFO_DEF+23:
			    AddTitle(player, 30000, HIGH_WARLORD);
                break;                              
            case GOSSIP_ACTION_INFO_DEF+30:
			    AddTitle(player, 1, PRIVATE);
                break;                              
            case GOSSIP_ACTION_INFO_DEF+31:
			    AddTitle(player, 50, CORPORAL);
                break;                               
            case GOSSIP_ACTION_INFO_DEF+32:
			    AddTitle(player, 100, SERGEANT);
                break;                               
            case GOSSIP_ACTION_INFO_DEF+33:
			    AddTitle(player, 250, MASTER_SERGEANT);
                break;                               
            case GOSSIP_ACTION_INFO_DEF+34:
			    AddTitle(player, 500, SERGEANT_MAJOR);
                break;                              
            case GOSSIP_ACTION_INFO_DEF+35:
			    AddTitle(player, 750, KNIGHT);
                break;                              
            case GOSSIP_ACTION_INFO_DEF+36:
			    AddTitle(player, 1000, KNIGHT_LIEUTENANT);
                break;                               
            case GOSSIP_ACTION_INFO_DEF+37:
			    AddTitle(player, 1500, KNIGHT_CAPTAIN);
                break;                            
            case GOSSIP_ACTION_INFO_DEF+38:
			    AddTitle(player, 3000, KNIGHT_CHAMPION);
                break;                              
            case GOSSIP_ACTION_INFO_DEF+39:
			    AddTitle(player, 5000, LIEUTENANT_COMMANDER);
                break;                              
            case GOSSIP_ACTION_INFO_DEF+40:
			    AddTitle(player, 7500, COMMANDER);
                break;
            case GOSSIP_ACTION_INFO_DEF+41:
			    AddTitle(player, 10000, MARSHAL);
                break;
            case GOSSIP_ACTION_INFO_DEF+42:
			    AddTitle(player, 15000, FIELD_MARSHAL);
                break;
            case GOSSIP_ACTION_INFO_DEF+43:
			    AddTitle(player, 30000, GRAND_MARSHAL);
                break;
            case GOSSIP_ACTION_INFO_DEF+99:
                player->CLOSE_GOSSIP_MENU();
                break;  
        }
        return true;
    }
	
    void AddTitle(Player* player, uint32 kills, uint32 title)
    {
        if(player->GetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS) >= kills)
            player->SetTitle(sCharTitlesStore.LookupEntry(title));
        else
            player->GetSession()->SendNotification("You don't have enough Life Time Kills!!");
    }
};
 
 
void AddSC_honor_gossip()
{
    new npc_honor_gossip;
}
 

katos

Noble Member
This looks like my script in my video tutorial. I don't get why you wouldn't just use my script instead of those nasty enumerators. Here's my script that it was copied and completely ruined from:

It looks like yours? I just used one that I found on Pastebin (PS: It didn't have your name) and tried to alter it, but yea, maybe it was messy as f*** to begin with.
I will just use yours then, thanks a bunch for this! :)

Will try to compile with your script now then! :)
 

Tommy

Founder
It looks like yours? I just used one that I found on Pastebin (PS: It didn't have your name) and tried to alter it, but yea, maybe it was messy as f*** to begin with.
I will just use yours then, thanks a bunch for this! :)

Will try to compile with your script now then! :)

I found out it was mine when I saw the struct HonorGossip. :p
 

katos

Noble Member
I found out it was mine when I saw the struct HonorGossip. :p

hehe, well I apologise for this, I honestly didn't know, it was built from a script I obtained from the pastebin of Symbolixdev, something like that. (If I remember correctly.)

// Compiled and working 100% as intended. Thanks Tommy! \\

solved
 

Rochet2

Moderator / Eluna Dev
The problem was with your script that you dont send the menu with
player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, _creature->GetGUID());
 

katos

Noble Member
The problem was with your script that you dont send the menu with
player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, _creature->GetGUID());

Oh I see! Ok, I am starting to get a hang of C++ now actually, I might have to force myself to sit down and read into it a little more. :

Having reports now that the Title NPC isn't giving titles now, the menu shows but title's cant be received. (Tommy's script)
 

katos

Noble Member
Oh I see! Ok, I am starting to get a hang of C++ now actually, I might have to force myself to sit down and read into it a little more. :

Having reports now that the Title NPC isn't giving titles now, the menu shows but title's cant be received. (Tommy's script)

Fixed the issue, this topic can now be fully closed. Huge thanks to Rochet2 and Tommy for fixing. I owe you guys a beer or two! :)
:lock1:
 
Status
Not open for further replies.
Top