[DiscordArchive] Do I need to modify anything else?
[DiscordArchive] Do I need to modify anything else?
Archived author: Whomadeit • Posted: 2025-01-31T15:17:58.862000+00:00
Original source
Okay then:
#include "Define.h"
#include "GossipDef.h"
#include "Item.h"
#include "Player.h"
#include "ScriptedGossip.h"
#include "ScriptMgr.h"
#include "Spell.h"
#include "ObjectMgr.h"
class vendor_ItemScript : public ItemScript
{
public:
vendor_ItemScript() : ItemScript("vendor_ItemScript") { }
bool OnUse(Player* player, Item* item, SpellCastTargets const& /*targets*/) override
{
uint32 NPC_ENTRY = 1234; // Replace with actual NPC entry
// Find the nearest creature matching the entry
if (Creature* creature = player->FindNearestCreature(NPC_ENTRY, true))
{
if (creature->HasAI() && creature->AI()->sGossipHello)
{
// Call the NPC's script-based gossip if available
creature->AI()->sGossipHello(player);
}
else
{
// Fallback to manually sending a gossip menu
player->GetSession()->SendGossipMenu(10000, creature->GetGUID()); // Replace 10000 with valid Gossip Text ID
}
}
return true;
}
};
void AddSC_vendor_ItemScript()
{
new vendor_ItemScript();
}
Archived author: Whomadeit • Posted: 2025-01-31T15:18:10.557000+00:00
Original source
Gossip menus instead
Archived author: Deleted User • Posted: 2025-01-31T15:18:17.735000+00:00
Original source
Cool
Archived author: Whomadeit • Posted: 2025-01-31T15:18:24.637000+00:00
Original source
Lemme know how it goes
Archived author: Deleted User • Posted: 2025-01-31T15:18:28.560000+00:00
Original source
Now I just gotta find gossip menu of NPC lol
Archived author: Deleted User • Posted: 2025-01-31T15:18:40.321000+00:00
Original source
It's the npcbot hirer
Archived author: Whomadeit • Posted: 2025-01-31T15:18:44.231000+00:00
Original source
Easy look up npc in game and find if
Archived author: Whomadeit • Posted: 2025-01-31T15:18:46.821000+00:00
Original source
Id
Archived author: Whomadeit • Posted: 2025-01-31T15:18:52.407000+00:00
Original source
Then go to db and look
Archived author: Deleted User • Posted: 2025-01-31T15:18:54.797000+00:00
Original source
Oh shit durrr