Search the Community

Showing results for tags 'c++'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Important
    • Announcements
    • Getting Started
    • The Graveyard
  • Community
    • General
    • Random
    • Gallery
    • Releases
  • Modding
    • Modeling
    • Level Design
    • Interface
    • Serverside
    • Noggit
    • Miscellaneous
    • Retro-Porting
  • Machinima
    • Moviemaking


  • Tools
  • Resources
    • 010 Editor Scripts and Templates


  • [RP] Wake: Fall of Arathor
  • Neo - A WoW Development Suite
  • My Isle - Isle of Terrors
  • Emberstone
  • Warcraft: the Old Age
  • "Titan"
  • Haradon
  • Thalanor
  • World of SeaCraft: Pirates of the Caribbean
  • Code-name 'Super Vanilla'
  • Mythia
  • Y.H.O.O.L.
  • [RP] The Sunset Of Lordaeron
  • Undying-WoW - Vengeance of Egorius
  • Dalaran V2
  • [(HC) RP] [CZ/SK] Arathor RP - Mythia
  • DotA2 map in WoW
  • [RP] Book of the Fallen: Northeron
  • [RP] Epitome
  • World Of Star Wars Galaxies
  • Dreya
  • [RP] [RU] Noblegarden
  • Les chroniques de la destinée
  • Blight of Azeroth
  • [Release] Improved models for 1.12
  • Project Rhodara
  • Codename "Orc vs Humans"
  • Neo - A Visual WoW Editor
  • The Verdant Heart
  • Serania, A Distant Dream.
  • Duronar
  • New Custom WMO set
  • World of Warcraft The South Seas
  • Wasteland
  • The Experimenst Era
  • Prophecy RP - The Fall of Lordaeron
  • WoW Blender Studio
  • [RELEASE] New Weapon Armory for WOTLK 3.3.5a


  • Beginner
  • Modeling
    • čeština
  • Level Design
  • Interface
  • Serverside
  • Miscellaneous
  • Retro-Porting
  • Machinima


  • Tutorials
  • Timelapse
  • Miscellaneous


  • Projects
  • Machinima
  • Software Development

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start






Found 3 results

  1. Roarl

    GossipSelect triggered twice

    Hello, I am currently working on a small housing system and am almost done with the bare bones but something is still refusing to work properly. I want to add a very small description of how the housing system works in a gossip menu, but as soon as SendGossipMenuFor it triggers the OnGossipHello instantly. I compared this part to the Transmogrifier script of Rochet2, which works fine, and it really looks the same so I do not get what I am doing wrong. More concretly, when I click "Why acquire a property ?" in the first menu, the relevant action (case 1 in OnGossipSelect in the code below) is executed (as expected) but then instantly the action made available in the next menu is also executed instantly (default case, with action = 3) : in the end the second menu never appears, instead OnGossipHello is executed again. Does anyone have any idea how to avoid this ? Thanks in advance for your time ! class npc_house_seller : public CreatureScript { public: npc_house_seller() : CreatureScript("npc_house_seller") { } class npc_house_sellerAI : public ScriptedAI { public: npc_house_sellerAI(Creature* creature) : ScriptedAI(creature) {} bool GossipHello(Player* player) override { return OnGossipHello(player, me); } static bool OnGossipHello(Player* player, Creature* creature) { WorldSession* session = player->GetSession(); AddGossipItemFor(player, GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Misc_Book_11:30:30:-18:0|tWhy acquire a property ?", 1, 0); std::stringstream warningMessage; warningMessage.str(std::string()); warningMessage << "Are you sure you want to proceed ? It will cost you " << HousingSystem::instance()->HouseFromSeller(creature->GetSpawnId())->_price / 10000 << " gold and strip you of any previous estate property."; AddGossipItemFor(player, GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Enchant_Disenchant:30:30:-18:0|tPurchase this estate", 2, 0, warningMessage.str().c_str(), 0, false); SendGossipMenuFor(player, 800001, creature->GetGUID()); return true; } bool GossipSelect(Player* player, uint32 /*menu_id*/, uint32 gossipListId) override { uint32 sender = player->PlayerTalkClass->GetGossipOptionSender(gossipListId); uint32 action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId); return OnGossipSelect(player, me, sender, action); } static bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) { ClearGossipMenuFor(player); WorldSession* session = player->GetSession(); switch (sender) { case 1: { AddGossipItemFor(player, GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/Ability_Spy:30:30:-18:0|tBack..", 3, 0); SendGossipMenuFor(player, 800002, creature->GetGUID()); } break; case 2: if (player->HasEnoughMoney(HousingSystem::instance()->HouseFromSeller(creature->GetSpawnId())->_price)) { House* house = HousingSystem::instance()->HouseFromPlayer(player->GetGUID().GetCounter()); if (house != nullptr) { house->_owner = 0; // Respawn NPC Map* map = sMapMgr->FindBaseNonInstanceMap(house->_map_id); Position pos(house->_coord_x, house->_coord_y, house->_coord_z, house->_orientation); Creature* cbuffer = new Creature(); if (!cbuffer->Create(map->GenerateLowGuid<HighGuid::Unit>(), map, PHASEMASK_ANYWHERE, 50006, pos)) delete cbuffer; cbuffer->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), PHASEMASK_ANYWHERE); ObjectGuid::LowType db_guid = cbuffer->GetSpawnId(); // To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells() // current "creature" variable is deleted and created fresh new, otherwise old values might trigger asserts or cause undefined behavior cbuffer->CleanupsBeforeDelete(); delete cbuffer; cbuffer = new Creature(); if (!cbuffer->LoadFromDB(db_guid, map, true, true)) delete cbuffer; sObjectMgr->AddCreatureToGrid(db_guid, sObjectMgr->GetCreatureData(db_guid)); house->_seller = db_guid; HousingSystem::instance()->AdaptSellerMapOnHouseChange(db_guid, house); house->SaveToDB(); } house = HousingSystem::instance()->HouseFromSeller(creature->GetSpawnId()); house->_owner = player->GetGUID().GetCounter(); house->_seller = 0; house->SaveToDB(); HousingSystem::instance()->AdaptPlayerMapOnHouseChange(house->_owner, house); // Remove Creature ObjectGuid::LowType guid = creature->GetGUID().GetCounter(); creature->CombatStop(); creature->DeleteFromDB(); creature->AddObjectToRemoveList(); player->ModifyMoney(0-HousingSystem::instance()->HouseFromSeller(creature->GetSpawnId())->_price, false); std::stringstream yay; yay.str(std::string()); yay << "Congratulations ! You are now the proud owner of this estate ! "; WorldPacket data(SMSG_MOTD); Tokenizer motdTokens(yay.str(), '@'); data << uint32(motdTokens.size()); for (Tokenizer::const_reference token : motdTokens) data << token; player->GetSession()->SendPacket(&data); player->AddItem(60073,1); player->PlayerTalkClass->SendCloseGossip(); } else { std::stringstream nope; nope.str(std::string()); nope << "You cannot afford that property ! You need at least " << HousingSystem::instance()->HouseFromSeller(creature->GetSpawnId())->_price/10000 << " gold."; session->SendNotification(nope.str().c_str()); player->PlayerTalkClass->SendCloseGossip(); } break; default: { std::stringstream nope; nope.str(std::string()); nope << "Triggered " << sender << " !"; session->SendNotification(nope.str().c_str()); } return OnGossipHello(player, creature); } return true; } }; CreatureAI* GetAI(Creature *creature) const override { return new npc_house_sellerAI(creature); } };
  2. Description: BetterItemReloading is a C++ Azerothcore module which allows to reload items on the server side and as much as possible on the client side of WoW 3.3.5. Sadly some things are cached on the client which can't be properly invalidated and need DBC file changes. The following things must be changed in DBC files: ItemClass ItemSubClass sound_override_subclassid MaterialID ItemDisplayInfo InventorySlotID SheathID Multiple items can be reloaded by splitting each entry id with a space like: .breload item 12345 23456 34567 Download link: How to install? This module only works for AzerothCore. Check the module page for the explanation, but it's very easy to do and works the same for all the modules. Credits: Me and a german chocolate company because i ate some chocolate while developing it. I share this module with you because we support each other in the AzerothCore community. How to thank us? The answer is simple: contribute! You can help by making new modules, fixing or improving other modules, converting fixes from TC to AzerothCore, fixing our own issues, spreading the word (by talking about it, making tutorials or releasing stuff), donating, testing our pull requests or identifying issues etc... Contributors will receive better support and tips. ------------------------------------------------- What is AzerothCore? Click here for an (incomplete) overview of AzerothCore's advantages. And have a look at the wiki. Join us! Join our discord and post on our forum! - The main place to talk, come !
  3. Greetings Model-Changing community, I posted this on Emu-devs not too long ago maybe someone has use for it. How to setup? Create an item in the database with an on use effect, use a test spell such as modify scriptname column to the scriptname of the script and you're done. Limitations When re logging visual of mount is removed and the current mount aura will override it. Tooltip of spell still shows the real mount aura(your mount visual will obviously be different however) enum mount_timer { MOUNT_TIMER = 3000, }; enum MountSpells { SPELL_MOUNT_SPECTRAL_TIGER = 42777, //We use this as the actual mount spell, the display id overrides it via the script. }; enum MountDisplayIds { RABID_BEAR_MOUNT_DISPLAY_ID = 1082, }; /* [Reins Of The Custom Bear] */ class item_reins_of_the_custom_bear : public ItemScript { public: item_reins_of_the_custom_bear() : ItemScript("item_reins_of_the_custom_bear") { } bool OnUse(Player* player, Item* item, SpellCastTargets const& targets) { player->CastSpell(player, SPELL_MOUNT_SPECTRAL_TIGER, false); //A mount spell to modify ground movement speed player->m_Events.AddEvent(new reins_of_the_custom_bear_handler(player), player->m_Events.CalculateTime(MOUNT_TIMER)); // OnUse is instant so we need to delay the changing of mount visual until cast is complete. return true; } class reins_of_the_custom_bear_handler : public BasicEvent { public: reins_of_the_custom_bear_handler(Player* player) : player(player) {} bool Execute(uint64 /*time*/, uint32 /*diff*/) { if (player->HasAura(SPELL_MOUNT_SPECTRAL_TIGER)) //Check if mounted before changing mount visual, prevents bugs { player->Mount(RABID_BEAR_MOUNT_DISPLAY_ID); //The custom mount display id } return true; } Player* player; }; }; void AddSC_item_custom_mounts() { new item_reins_of_the_custom_bear(); }