Must be built in debug
Must be built in debug
Get this code:
Execute this to world database:
build in debug, test.Code:CREATE TABLE `npc_vendor_preview` ( `entry` INT(10) UNSIGNED NOT NULL COMMENT 'npc entry', `item` INT(10) UNSIGNED NOT NULL COMMENT 'item entry', PRIMARY KEY (`entry`, `item`) ) COLLATE='utf8_general_ci' ENGINE=InnoDB;
I tested and everything worked right when I had the table in DB and the corrected code.
So i added the script name in the creature_template for my NPC. I then added to
the npc_vendor_previewer my npc entry and item entry and i can still buy the items,
creature flags set to 128, maybe i was supposed to do something naturally and missed it.
Edit: Yup i've come to no ideas, i'll continue tomorrow.
Edit: Tried adding the item through npc_vendor and didn't help, maybe i also need
a custom extendedcost, tried everything in the DB, still missing something.
Last edited by Carbinfibre; 10-20-2013 at 05:46 AM.
Spent my Sunday trying to figure out why i can still buy items, still found nothing.
You should have the npc_vendor table empty for the creature you use as preview vendor.
This setup worked for me:
Fake vendor data:Code:INSERT INTO `creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `modelid1`, `modelid2`, `modelid3`, `modelid4`, `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`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `spell1`, `spell2`, `spell3`, `spell4`, `spell5`, `spell6`, `spell7`, `spell8`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `HoverHeight`, `Health_mod`, `Mana_mod`, `Armor_mod`, `RacialLeader`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `movementId`, `RegenHealth`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`, `WDBVerified`) VALUES (26709, 0, 0, 0, 0, 0, 24004, 0, 0, 0, 'Pahu Frosthoof', 'Innkeeper', '', 0, 70, 70, 2, 35, 35, 129, 1, 1.14286, 1, 0, 252, 357, 0, 304, 1, 2000, 0, 1, 0, 2048, 8, 0, 0, 0, 0, 0, 215, 320, 44, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 3, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 'PreviewVendor', 12340);
Code:INSERT INTO `npc_vendor_preview` (`entry`, `item`) VALUES (26709, 25); INSERT INTO `npc_vendor_preview` (`entry`, `item`) VALUES (26709, 36);
I tested on TC 3.3.5a
It may be that Ark has very bad checks in vendor part .. if you can still buy items that are not in npc_vendor!
It would mean that anyone can buy any item from any vendor :|
Last edited by Rochet2; 10-20-2013 at 01:34 PM.Awards:
Ah so you didn't .npc add item, the npc_vendor_preview adds them to the vendor?
If so then the script doesn't work because when i add in the npc_vendor_preview my npc entry and item entry
and start my server the vendor only says "Greetings (Name)". Yes it was compiled correctly and has zero errors
and i added the correct flags and script name to the creature_template.
Interesting, in the server.log i found this (My Vendor name is Onyx):
Creature Onyx (Entry: 400001 GUID: 282371 DB GUID: 282371) has UNIT_NPC_FLAG_VENDOR set but has an empty trading item list.
Edit: I copy pasted your creature in my DB and it still doesn't show any items.
Edit: I am going to go try TrinityCore with this script.
Last edited by Carbinfibre; 10-20-2013 at 03:27 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)