[DiscordArchive] Do I need to modify anything else?
[DiscordArchive] Do I need to modify anything else?
Archived author: Deleted User • Posted: 2025-01-31T15:14:00.219000+00:00
Original source
Do I need to modify anything else?
Archived author: Whomadeit • Posted: 2025-01-31T15:15:24.420000+00:00
Original source
#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
{
// Replace 1234 with your actual vendor NPC entry
uint32 NPC_ENTRY = 1234;
// Find the nearest creature with the given NPC entry
if (Creature* creature = player->FindNearestCreature(NPC_ENTRY, true))
{
if (creature->IsVendor()) // Ensure it's a vendor
{
player->PrepareGossipMenu(creature, creature->GetCreatureTemplate()->GossipMenuId);
player->GetSession()->SendPreparedGossip(creature);
}
}
return true;
}
};
void AddSC_vendor_ItemScript()
{
new vendor_ItemScript();
}
Archived author: Deleted User • Posted: 2025-01-31T15:15:42.102000+00:00
Original source
?
Archived author: Whomadeit • Posted: 2025-01-31T15:16:02.157000+00:00
Original source
Try that should work better just fix your id
Archived author: Deleted User • Posted: 2025-01-31T15:16:18.511000+00:00
Original source
Did you modify it?
Archived author: Whomadeit • Posted: 2025-01-31T15:16:27.905000+00:00
Original source
Yup
Archived author: Deleted User • Posted: 2025-01-31T15:16:33.808000+00:00
Original source
Ahh cool
Archived author: Whomadeit • Posted: 2025-01-31T15:16:38.563000+00:00
Original source
Archived author: Whomadeit • Posted: 2025-01-31T15:16:44.899000+00:00
Original source
Cheers
Archived author: Deleted User • Posted: 2025-01-31T15:17:07.028000+00:00
Original source
If the NPC isn't a vendor what should I modify?
NPC has a script attached to it