Forums WoW Modding Support Archives TrinityCore Discord Archives [DiscordArchive] Do I need to modify anything else?

[DiscordArchive] Do I need to modify anything else?

[DiscordArchive] Do I need to modify anything else?

Pages (5): Previous 1 2 3 4 5 Next
rektbyfaith
Administrator
0
01-31-2025, 03:39 PM
#31
Archived author: Deleted User • Posted: 2025-01-31T15:39:45.969000+00:00
Original source

I'm on 3.3.5 if that makes a difference
rektbyfaith
01-31-2025, 03:39 PM #31

Archived author: Deleted User • Posted: 2025-01-31T15:39:45.969000+00:00
Original source

I'm on 3.3.5 if that makes a difference

rektbyfaith
Administrator
0
01-31-2025, 03:42 PM
#32
Archived author: Minadude • Posted: 2025-01-31T15:42:17.745000+00:00
Original source

a few weeks ago I did all that and it didn't work. it wouldn't open the vendor window if that's what you are trying to do...
rektbyfaith
01-31-2025, 03:42 PM #32

Archived author: Minadude • Posted: 2025-01-31T15:42:17.745000+00:00
Original source

a few weeks ago I did all that and it didn't work. it wouldn't open the vendor window if that's what you are trying to do...

rektbyfaith
Administrator
0
01-31-2025, 03:42 PM
#33
Archived author: Minadude • Posted: 2025-01-31T15:42:48.441000+00:00
Original source

I ended up having the item spawn and NPC and despawn after some time
rektbyfaith
01-31-2025, 03:42 PM #33

Archived author: Minadude • Posted: 2025-01-31T15:42:48.441000+00:00
Original source

I ended up having the item spawn and NPC and despawn after some time

rektbyfaith
Administrator
0
01-31-2025, 03:44 PM
#34
Archived author: Deleted User • Posted: 2025-01-31T15:44:52.209000+00:00
Original source

rektbyfaith
01-31-2025, 03:44 PM #34

Archived author: Deleted User • Posted: 2025-01-31T15:44:52.209000+00:00
Original source

rektbyfaith
Administrator
0
01-31-2025, 03:45 PM
#35
Archived author: Deleted User • Posted: 2025-01-31T15:45:02.809000+00:00
Original source

Don't mind sharing the script?
rektbyfaith
01-31-2025, 03:45 PM #35

Archived author: Deleted User • Posted: 2025-01-31T15:45:02.809000+00:00
Original source

Don't mind sharing the script?

rektbyfaith
Administrator
0
01-31-2025, 03:45 PM
#36
Archived author: Deleted User • Posted: 2025-01-31T15:45:29.368000+00:00
Original source

Or the SQL file?
rektbyfaith
01-31-2025, 03:45 PM #36

Archived author: Deleted User • Posted: 2025-01-31T15:45:29.368000+00:00
Original source

Or the SQL file?

rektbyfaith
Administrator
0
01-31-2025, 03:48 PM
#37
Archived author: Minadude • Posted: 2025-01-31T15:48:13.077000+00:00
Original source

void SendMenu_show_vendor(Player* player, Item* item)
{

uint32 vendor_id = sWorld->getRate(VENDOR_ID);

uint32 distance = 2;

// Get the player's current position and orientation
float playerX = player->GetPositionX();
float playerY = player->GetPositionY();
float playerZ = player->GetPositionZ();
float playerO = player->GetOrientation();

// Calculate the position a few feet in front of the player
float summonX = playerX + distance * cos(playerO);
float summonY = playerY + distance * sin(playerO);
float summonZ = playerZ;

// Optional: Adjust the Z coordinate for terrain (optional, depending on terrain height)
// summonZ = player->GetMap()->GetHeight(summonX, summonY, summonZ);

// Calculate orientation for NPC to face the player
float npcOrientation = atan2(playerY - summonY, playerX - summonX);

if (vendorNpcGuid)
{
// Find the existing NPC
Creature* existingNpc = ObjectAccessor::GetCreature(*player, vendorNpcGuid);
if (existingNpc && existingNpc->IsInWorld())
{
// Despawn the existing NPC
existingNpc->DespawnOrUnsummon();
}
}

Creature* summonedNpc = player->SummonCreature(vendor_id, summonX, summonY, playerZ, npcOrientation, TEMPSUMMON_MANUAL_DESPAWN, 300s);
if (summonedNpc)
{
// Store the GUID of the summoned NPC
vendorNpcGuid = summonedNpc->GetGUID();
player->GetSession()->SendListInventory(vendorNpcGuid);
}
else{
ChatHandler(player->GetSession()).PSendSysMessage("Something went wrong while spawning the Vendor. Please try again.");
}

SendMenu_main(player, item);
}
rektbyfaith
01-31-2025, 03:48 PM #37

Archived author: Minadude • Posted: 2025-01-31T15:48:13.077000+00:00
Original source

void SendMenu_show_vendor(Player* player, Item* item)
{

uint32 vendor_id = sWorld->getRate(VENDOR_ID);

uint32 distance = 2;

// Get the player's current position and orientation
float playerX = player->GetPositionX();
float playerY = player->GetPositionY();
float playerZ = player->GetPositionZ();
float playerO = player->GetOrientation();

// Calculate the position a few feet in front of the player
float summonX = playerX + distance * cos(playerO);
float summonY = playerY + distance * sin(playerO);
float summonZ = playerZ;

// Optional: Adjust the Z coordinate for terrain (optional, depending on terrain height)
// summonZ = player->GetMap()->GetHeight(summonX, summonY, summonZ);

// Calculate orientation for NPC to face the player
float npcOrientation = atan2(playerY - summonY, playerX - summonX);

if (vendorNpcGuid)
{
// Find the existing NPC
Creature* existingNpc = ObjectAccessor::GetCreature(*player, vendorNpcGuid);
if (existingNpc && existingNpc->IsInWorld())
{
// Despawn the existing NPC
existingNpc->DespawnOrUnsummon();
}
}

Creature* summonedNpc = player->SummonCreature(vendor_id, summonX, summonY, playerZ, npcOrientation, TEMPSUMMON_MANUAL_DESPAWN, 300s);
if (summonedNpc)
{
// Store the GUID of the summoned NPC
vendorNpcGuid = summonedNpc->GetGUID();
player->GetSession()->SendListInventory(vendorNpcGuid);
}
else{
ChatHandler(player->GetSession()).PSendSysMessage("Something went wrong while spawning the Vendor. Please try again.");
}

SendMenu_main(player, item);
}

rektbyfaith
Administrator
0
01-31-2025, 03:48 PM
#38
Archived author: Minadude • Posted: 2025-01-31T15:48:45.394000+00:00
Original source

this uses gossipitem script (check Trinitycore forks on github)
rektbyfaith
01-31-2025, 03:48 PM #38

Archived author: Minadude • Posted: 2025-01-31T15:48:45.394000+00:00
Original source

this uses gossipitem script (check Trinitycore forks on github)

rektbyfaith
Administrator
0
01-31-2025, 03:49 PM
#39
Archived author: Minadude • Posted: 2025-01-31T15:49:32.285000+00:00
Original source

and of course you gotta adapt it to the actual script loader etc. but this is basically the code that can spawn an NPC vendor in front of the player "at the click of an item"
rektbyfaith
01-31-2025, 03:49 PM #39

Archived author: Minadude • Posted: 2025-01-31T15:49:32.285000+00:00
Original source

and of course you gotta adapt it to the actual script loader etc. but this is basically the code that can spawn an NPC vendor in front of the player "at the click of an item"

rektbyfaith
Administrator
0
01-31-2025, 03:49 PM
#40
Archived author: Deleted User • Posted: 2025-01-31T15:49:56.858000+00:00
Original source

Amazing
rektbyfaith
01-31-2025, 03:49 PM #40

Archived author: Deleted User • Posted: 2025-01-31T15:49:56.858000+00:00
Original source

Amazing

Pages (5): Previous 1 2 3 4 5 Next
Recently Browsing
 
Recently Browsing