Multi Vendor core mod


Someone had some problems with Evilfairy’s script, so I took a look at it and decided to make my own.
In contrast to the “not core mod”, “not database” idea, I decided to make this script editable through database and made it a core modification so I could just tweak the base gossip system slightly.

This modification allows multi vendors to be edited and created totally through database AND C++.
You can have multiple options to open different vendors.
You can use all normal other gossip as well, this does not close other possibilities.
YOU CAN send vendors also from C++ code, read the readme.

This script does not add new database tables or columns!

[SIZE=14px]Download: [/SIZE]

Example NPC: (uses menu_id 22000 by default)

INSERT INTO creature_template (entry, modelid1, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction_A, faction_H, npcflag, speed_walk, speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, unit_flags2, dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, type_flags, lootid, pickpocketloot, skinloot, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, HoverHeight, Health_mod, Mana_mod, Armor_mod, RacialLeader, movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName, WDBVerified) VALUES
(700001, 1298, “Herbert”, “MultiVendor”, NULL, 22000, 10, 10, 0, 35, 35, 129, 1, 1.14286, 1, 0, 13, 17, 0, 42, 1, 1500, 0, 1, 512, 2048, 8, 0, 0, 0, 0, 0, 9, 13, 100, 7, 0, 0, 0, 0, 0, 0, 0, 0, ‘’, 0, 3, 1, 1, 1, 1, 0, 0, 1, 0, 0, 2, ‘’, 12340);
Example vendors/options:

INSERT INTO gossip_menu_option (menu_id, id, option_icon, option_text, option_id, npc_option_npcflag, action_menu_id, action_poi_id, box_coded, box_money, box_text) VALUES
(22000, 0, 4, ‘VendorTest 1’, 3, 128, 465, 0, 0, 0, ‘’),
(22000, 1, 9, ‘VendorTest 2’, 3, 128, 54, 0, 0, 0, ‘’),
(22000, 2, 6, ‘VendorTest 3’, 3, 128, 35574, 0, 0, 100, ‘These goods are special, so pay up!’);

script - Rochet2
NPC and special thanks - Evilfairy (checked out her script)

Release threads:

Very nice and Congrats !!!

Atm there is a 150 items per NPC limit.

I am updating soon (today?) probably with a solution to get unlimited vendors to one NPC with 150 items in each vendor.

I am just assuming the limit is 150 from what other ppl say, but its around there (120- 256)

Now there is a possibility for endless vendors (untested).
Something like 150 items per one option.

Also, the only way the gossip option needs to differ from a regular vendor gossip option is that the action_menu_id is set to the vendor entry from npc_vendor table.

nice work +Rochet2, an thanks for sharing /emoticons/default_smile.png


You can now add items to an existing vendor ingame with normal item commands.
Simply open the vendor window and do the command with 1 in the end:

.npc add item 25 0 0 0 1

.npc delete item 25 1

(The vendor is selected based on a variable that is set when you click the gossip option)

Here is the old diff for reverting:


Rather obviously you can also use .reload gossip_menu_option to reload the gossip options for the NPC (including the vendor options)
and you can also use .reload npc_vendor to reload the vendor entries.

Updated diff.

Commented out the NPC check from objectmgr allowing NPCless npc_vendor entries.

Video of multivendor

(along with other things)

Item multivendor at 0:30

How did u made the vendor be player instead of creature, it aint working as player, or the patch aint available anymore?

I never made a public patch. Only gave it to someone and lost it.

But anyways, you need to edit everything in the vendor sending as well as buying that use the creature to use either the player, the vendor entry or just skip it or something.

There are a few places you need to edit. See the buy from slot packet handle and the SendListInventory or whats it called.

ok …

Hmm, might try redo it if you cant get it done.

A bit interested in using UIs like vendor, training etc for other things possibly…

Gossip is rather limited and hmm … sometimes a little fugly for accomplishing something.

Everything custom related to the systems needs proper checks though. (IE, dont use the info that comes from the client)

I tried, but many things needs changes, and I was confused somewhere and I left editing because the errors continued like never ends lol. If you can redo it would be nice, atm worked to show from the player but when buying something it says “too far away”, after I remove that far away checks comes next errors and that’s why I stopped… maybe I don’t know what Im doing lol

Ok here it is. Coded sending the menu, buying items and selling items. Includes multivendor as part of it is needed for player vendors.

Note. player item stacks are not coded. This means that all items in a player vendor have unlimited quantity.

Example code:

player->GetSession()->SendListInventory(player->GetGUID(), 54); // MUST use player's own guid | 54 is an example vendor entry from npc_vendor

Thank you so much Rochet :3

Updated for newer TC /emoticons/default_smile.png

A patch now also available.

Rochet2 delivering god-tier code as usual, keep up the good work! /emoticons/default_smile.png

Updated to [COLOR=rgb(0,0,0)]747184a7c0dc200b9c2c8607a3e1dd990161278e TC version.

[COLOR=rgb(0,0,0)]Also fixed this minor exploit:

LilleCarl reported a bug possibility that you can buy items from the last multivendor you were at IF:
You are near at an NPC with vendor flags
You have not clicked on any normal vendor in between
You send buy item packets while being near the vendor NPC (any vendor)
(Note that all security and faction checks and costs are still the same for the item, this is only a possible exploit to buy the items elsewhere than at the vendor)

Hi I have a problem with MultiVendor, I tried to apply patch in newest (today revision) of TrinityCore:

error: patch failed: src/server/game/Server/WorldSession.cpp:121

error: src/server/game/Server/WorldSession.cpp: patch does not apply