Hello & Welcome to our community. Is this your first visit? Register
Follow us on
Follow us on Facebook Follow us on Twitter Watch us on YouTube


MMOCoin

Likes Likes:  0
Results 1 to 2 of 2
  1. #1
    Scout

    Join Date
    Jan 2013
    Posts
    5
    Post Thanks / Like
    Rep Power
    12
    Reputation
    14

    Multivendor Script [No Core Edits] [No Database Entries]


    Register to remove this ad
    IF YOU ARE USING A REPACK YOU CANNOT ADD SCRIPTS. LEARN TO COMPILE YOUR OWN CORE.


    So, after a day of working on my script I finally managed to create a multivendor script that:



    • Works without needing to edit the core (outside of installing the script)
    • Works without needing to edit the database (outside of setting NPC flags and scriptname)
    • Is retard proof (provided you follow the instructions)



    Known limitations:

    • Has a limit of 150 items per vendor, and 256 items across all vendors. Adding more than 256 items will break your script




    Here it is: C++ code - 347 lines - codepad


    Instructions


    1. Download the raw file from http://codepad.org/e6nyvrJJ/raw.cpp
    2. Move that file to \src\server\scripts\Custom in your TrinityCore folder
    3. Rename the file from raw.cpp to npc_multivendor.cpp (it might just say "raw" instead of "raw.cpp" if you have file extensions hidden, in this case rename it to "npc_multivendor")
    4. Change CMakeLists.txt so that it looks something like:


    Code:
    set(scripts_STAT_SRCS
      ${scripts_STAT_SRCS}
    Custom/npc_multivendor.cpp
    )

    5. Go to \src\server\game\Scripting and open ScriptLoader.cpp
    6. Scroll to the bottom of the file and change it to look like this:


    Code:
    #ifdef SCRIPTS
    /* This is where custom scripts' loading functions should be declared. */
        void AddSC_npc_multivendor();
    #endif
    
    
    void AddCustomScripts()
    {
    #ifdef SCRIPTS
        /* This is where custom scripts should be added. */
        AddSC_npc_multivendor();
    #endif
    }

    7. Open your database and find the NPC you want to use as a multivendor in creature_template
    7a. If you do not have a vendor created yet, you can run the following code to create one. DO NOT RUN THIS IF YOU ALREADY HAVE AN NPC YOU WANT TO USE AS A VENDOR, YOU DO NOT NEED TO ADD A NEW ONE


    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`, `equipment_id`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`, `WDBVerified`) VALUES (700000, 0, 0, 0, 0, 0, 1298, 0, 0, 0, '[QA] Dota Test Vendor', 'Multivendor', NULL, 0, 10, 10, 0, 12, 12, 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, 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, 2, 'npc_multivendor', 12340);

    7b. If you already have a creature you wish to use as a vendor, you must set npcflag to 129, and ScriptName to npc_multivendor
    8. Edit the script by going to line 243 and reading the instructions there. The shortcut for going to a line in Visual Studio is Ctrl+G.
    9. Re-create your CMake files by running CMake and pressing Configure then Generate
    10. Remember to delete the "Cache" folder in your WoW installation to avoid problems


    And you're done! Please leave any bugs/feedback in this thread and I'll try to address them when I can. The script _should_ be secure as outside of building the SMSG_INVENTORY_LIST packet it uses TrinityCore's own functions to process the item buying and such, but as with all 3rd party scripts if you're seriously bothered about security you should check it yourself.


    Peace out~




    Evilfairy


    › See More: Multivendor Script [No Core Edits] [No Database Entries]



  2. Related Threads - Scroll Down after related threads if you are only interested to view replies for above post/thread

  3. #2
    Beginner

    Join Date
    Nov 2013
    Posts
    1
    Post Thanks / Like
    Rep Power
    12
    Reputation
    1

    Error in compiling


    Register to remove this ad
    In compiling gave this error

    5> npc_multivendor.cpp
    5>..\..\..\..\Trinity\src\server\scripts\Custom\np c_multivendor.cpp(117): warning C4018: '<' : signed/unsigned mismatch
    5>..\..\..\..\Trinity\src\server\scripts\Custom\np c_multivendor.cpp(141): error C2039: 'isGameMaster' : is not a member of 'Player'
    5> D:/Trinity/src/server/game/Entities/Player\Player.h(1061) : see declaration of 'Player'
    5>..\..\..\..\Trinity\src\server\scripts\Custom\np c_multivendor.cpp(162): warning C4018: '<' : signed/unsigned mismatch
    5>..\..\..\..\Trinity\src\server\scripts\Custom\np c_multivendor.cpp(167): warning C4018: '<' : signed/unsigned mismatch
    5>..\..\..\..\Trinity\src\server\scripts\Custom\np c_multivendor.cpp(174): warning C4018: '<' : signed/unsigned mismatch
    5>..\..\..\..\Trinity\src\server\scripts\Custom\np c_multivendor.cpp(219): warning C4018: '<' : signed/unsigned mismatch
    5>..\..\..\..\Trinity\src\server\scripts\Custom\np c_multivendor.cpp(300): warning C4018: '<' : signed/unsigned mismatch
    5>..\..\..\..\Trinity\src\server\scripts\Custom\np c_multivendor.cpp(330): warning C4018: '<' : signed/unsigned mismatch

    Help-me

 

 

Visitors found this page by searching for:

smsg_inventory_list

multimultivendor trinitycore

npc multuivendor trinity core

c [trinitycore] multivendor

likes dislikes script without database

trinity core multivendor

multi vendor in multi vendor for trinity

trinitycore multi vendor script patch

multi vendors trinitycore

multivendor c vendor

trinity core multi vendor

multi vendor gossip trinity

how to script trinity core

how to create vendor

npc custom

SEO Blog

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -5. The time now is 09:23 PM.
Powered by vBulletin® Copyright ©2000-2024, Jelsoft Enterprises Ltd.
See More links by ForumSetup.net. Feedback Buttons provided by Advanced Post Thanks / Like (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
vBulletin Licensed to: MMOPro.org