yvoms
Exalted Member
I have applied rochet2's item and player gossip,
However the below script does not seem to be functionizing, i've been told to debug it however i have no clue on how to do so.
Could anyone please assist me with this, and tell me what i've done wrong?
when i am ingame it does show me the
player->GetSession()->SendNotification("DEBUG: Teleporter active!");
when i right click the hearthstone(im using the default hearthstone yes)
But it does not show the
player->GetSession()->SendNotification("DEBUG: ONGOSSIPSELECT");
I've tried multiple different ways of doing it, however it shows the main menu, but ongossipselect does not seem to execute.
However the below script does not seem to be functionizing, i've been told to debug it however i have no clue on how to do so.
Could anyone please assist me with this, and tell me what i've done wrong?
Code:
#include "ScriptPCH.h"
class Teleportert : public ItemScript
{
public:
Teleportert() : ItemScript("Teleportert") { }
bool OnUse(Player* player, Item* item, SpellCastTargets const& targets) override
{
if (player->IsInCombat())
{
player->GetSession()->SendNotification("You are in combat!");
player->CLOSE_GOSSIP_MENU();
return false; //laat de onderstaande menu's niet zien.
}
player->PlayerTalkClass->ClearMenus();
player->GetSession()->SendNotification("DEBUG: Teleporter active!");
player->ADD_GOSSIP_ITEM(0, "|cff4169E1|TInterface\\icons\\INV_Misc_Bag_FelclothBag:30|t The Mall|r", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
player->ADD_GOSSIP_ITEM(0, "|cff4169E1|TInterface\\icons\\Achievement_Leader_King_Varian_Wrynn:30|t Alliance Capital Cities|r", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
player->ADD_GOSSIP_ITEM(0, "|cffFF0000|TInterface\\icons\\Achievement_Leader_Sylvanas:30|t Horde Capital Cities|r", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
player->ADD_GOSSIP_ITEM(0, "|cffFFFF00|TInterface\\icons\\Temp:30|t Neutral Capital Cities|r", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
player->ADD_GOSSIP_ITEM(0, "|cff4169E1|TInterface\\icons\\ACHIEVEMENT_BOSS_KINGYMIRON_01:30|t Dungeons|r", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
player->ADD_GOSSIP_ITEM(0, "|cff4169E1|TInterface\\icons\\Achievement_Dungeon_Icecrown_Frostmourne:30|t Raids|r", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
player->ADD_GOSSIP_ITEM(0, "|cffFF0000|TInterface\\icons\\Achievement_FeatsOfStrength_Gladiator_10:30|t PvP Areas|r", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, item->GetGUID());
return true; //laat de onderstaande acties/menu's werken/zien.
}
void OnGossipSelect(Player* player, Item* item, uint32 sender, uint32 action) override
{
player->PlayerTalkClass->ClearMenus();
player->GetSession()->SendNotification("DEBUG: ONGOSSIPSELECT");
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1:
player->GetSession()->SendNotification("TEST 1 COMPLETED");
player->CLOSE_GOSSIP_MENU();
break;
case GOSSIP_ACTION_INFO_DEF + 2:
player->GetSession()->SendNotification("TEST 2 COMPLETED");
player->CLOSE_GOSSIP_MENU();
break;
case GOSSIP_ACTION_INFO_DEF + 3:
player->GetSession()->SendNotification("TEST 3 COMPLETED");
player->CLOSE_GOSSIP_MENU();
break;
case GOSSIP_ACTION_INFO_DEF + 4:
player->GetSession()->SendNotification("TEST 4 COMPLETED");
player->CLOSE_GOSSIP_MENU();
break;
case GOSSIP_ACTION_INFO_DEF + 5:
player->GetSession()->SendNotification("TEST 5 COMPLETED");
player->CLOSE_GOSSIP_MENU();
break;
case GOSSIP_ACTION_INFO_DEF + 6:
player->GetSession()->SendNotification("TEST 6 COMPLETED");
player->CLOSE_GOSSIP_MENU();
break;
case GOSSIP_ACTION_INFO_DEF + 7:
player->GetSession()->SendNotification("TEST 7 COMPLETED");
player->CLOSE_GOSSIP_MENU();
break;
}
player->CLOSE_GOSSIP_MENU();
}
};
void AddSC_Teleportert()
{
new Teleportert();
}
player->GetSession()->SendNotification("DEBUG: Teleporter active!");
when i right click the hearthstone(im using the default hearthstone yes)
But it does not show the
player->GetSession()->SendNotification("DEBUG: ONGOSSIPSELECT");
I've tried multiple different ways of doing it, however it shows the main menu, but ongossipselect does not seem to execute.