Jump to content

Search the Community

Showing results for tags 'c++'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News and Announcements
    • News
  • General
    • Suggestions & Feedback
    • General Chat
    • GFX
    • VFX
  • MMO Hub
    • Gamer's Lounge
    • Member's Lounge
    • Developer Lounge
  • MMO Corner
    • World of Warcraft
    • Lineage 2
    • Minecraft
    • Host Listing
    • Server Listing
    • Server Recruitment
    • Server Reviews
    • The Underground
  • User Hub
    • Support
    • Report
    • Contact Staff
  • Merchant Corner
    • Marketplace
  • General Development Releases
    • Applications
  • Tutorials
    • Programming
    • Web Development
  • Wasteland

Categories

  • Creative Corner
    • GFX Releases
    • VFX Releases
    • Resources
  • MMO and MMORPG
    • World of Warcraft
    • Lineage 2
    • Minecraft
  • Webmasters
    • Content Management Systems
    • Addons
    • Scripts
    • Designs
    • Proxies
    • HTML
  • Applications
  • Gaming
    • World of Warcraft
    • Lineage 2
    • Minecraft
    • Emulation
    • Nulled Distributions
  • Marketplace
    • Marsh Designs
    • iDarts

Product Groups

  • Membership
  • Advertise
  • Promote

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Interests


How Did You Find Us?


Contributor


Discord

Found 16 results

  1. StygianTheBest

    [[Template core/front/global/prefix is throwing an error. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]] [AzerothCore] StygianCore Solo/LAN 3.3.5a Repack with 20+ Modules and Eluna

    News: March 1, 2019 I have just released an updated version (v2019.03.01) of the repack and an HD client upgrade. Download links have been updated. Check out the project page for more information. Greetings! I have just released the StygianCore repack powered by AzerothCore. This project would not be possible without the players, developers, and communities of the World of Warcraft MMO emulator and private server scene. A big thanks to everyone for any and all contributions absorbed to make this repack possible. Your hard work is much appreciated! StygianCore is World of Warcraft v3.3.5a server powered by a modified build of the AzerothCore World of Warcraft v3.3.5a server emulator. It has been providing an enjoyable gaming experience to hundreds of kids at our school since summer of 2017. Last fall I promised to release a repack of this server for parents and students to host at home. Additionally, I wanted to share a fun leveling server for solo or 4-10 player groups and help others who want to get started with development, scripting, and building their own server experience. DOWNLOAD StygianCore Project Page SUPPORT Please send all questions, comments, or bug reports to the GitHub repo. Open a ticket and I'll answer when time permits. This helps keep issues in front and organized. I will not be monitoring threads, forums, or social media. All documentation, features, and updates for this repack can be found at the following links: StygianCore Project Page CORE AzerothCore rev. 500c04+ 2019-02-27 11:04:10 -0500 (Master, Win64, Release) Modified Apache 2.2.17 Web Server with working SOAP Account Registration page MySQL 5.6.42 PHP 5.3.5 Core Modifications: Beastmaster Pet Support DungeonCheckpoints Eluna LUA Engine Multi-Vendor TimeShift This project is, and will always be, FREE! I designed it with lots of comments and templates to make life easier for new developers and creators to get started. My hope is that all of the hard work I put into this will inspire others to get involved and create more cool and interesting projects for the WoW Emulation community. This repack is dedicated to the late Michel Martin Koiter (May 4, 1984 – March 18, 2004). His shrine in World of Warcraft served as a place of solace for myself, my guildmates, and countless others in the classic days of World of Warcraft and beyond. Rest In Peace.. See you on the other side brother. Here's a short list of what's included. There's a lot more detailed on the StygianCore Project Page. BACKUP/RESTORE Easily backup, restore, and archive the accounts, characters, and game world. A repack update function is included to support future revisions. Restoration archives are upgradable. SERVER, PLAYER AND GUILD Realm type set for RP-PVP rules. Why? Nostalgia. XP gain for exploration has been doubled. Mail Delivery Delay reduced to 10 seconds. Tome of World Flying allows flying in classic zones. Flying has been disabled for battlegrounds Random chance to enchant gear on drop, quest, or craft. TimeShift Adjust the number of game days per real day Default: One game day passes every 4 hours Cross-Faction enabled for: Accounts Auction House Calendar Channel Chat Friends Group Guild Mail Trade WhoList On character creation configurable options include: Add the player to a guild Grant Exalted faction with all major cities Grant items and heirloom gear Grant additional or all weapon skills Grant special abilities of other classes such as Sprint, Remove Curse, etc. Players start with the following: Starting Gold (Configurable - Default: 1000) Personal Teleporter - Spawns a teleport NPC that fades after use Heirloom Trinkets Heirloom Ring Foror's Crate of Endless Storage (36 slot bag) Player XP rate configurable as you play. From the console type: .xp set <rate 0-10>. Includes two default characters and guilds for Horde and Alliance. Guildmaster characters are owned by the Administrator account. Guildmaster characters are equipped and ready for play. Guilds are pre-configured for use: Horde Guild: Sons of the Storm Alliance Guild: Emerald Dreams Guild Banks have all tabs available Guild Tabs are styled with icons Guild Roles and Limits are set Guild Tabards are designed LIFE, DEATH, AND COMBAT - Dungeon Checkpoints: You resurrect at the last or closest boss killed with 25% health/mana - Dungeons and Raid difficulty is auto-scaled based on player count and other factors - Quest, Raid, and Party requirements for entering instances are ignored - 25% reduced creature aggro rate - 25% less creature assistance radius - 25% less creature flee assistance radius - Resurrection Sickness is disabled - Durability on resurrection has been reduced - PVP kills can allow the player to loot a percentage of the victim's loot. - A bounty system can award players money for mob or player kills based on level. - World, Dungeon, and PVP kills are announced to the world. - All classes can have Hunter tamed beasts that will assist you in battle. CUSTOM NPC Over 30 new vendors with custom item sets. BeastMaster NPC: Allows all classes to have and control hunter pets. Bengal Tiger NPC: If you can find the cave, she gives you the Bengal Tiger! Buffer NPC: Buffs players with one click. Critters NPC: Various critters (Pig, Dog, Horse, Cow, etc.) Codebox NPC: Allows codes to be entered for gold and items. Enchanter NPC: Offers all weapon and armor enchantments. Fisherman NPC: A custom fishing vendor with a path, waypoints, and speech. Gambler NPC: Allows players to gamble their money. Gift Box NPC: Sends players gifts at specified times like level-up. Global Trainer NPC: Trains all classes and skills. Jukebox NPC: Plays much of the music content and videos in the game. Koiter NPC: A recreation of Koiter's character from beta in normal and ghost form. Loremaster NPC: Recants lore and trivia of WoW at specific locations. Multi-Vendor NPC: Allows multiple item iventories on one vendor. Portal Master NPC: Provides quick transport all over the realm. Trollop NPC: Everyone needs someone. Transmogrifier NPC (Eluna): Transmog your gear. World Trainer NPC: Trains every class, skills, and flying. CUSTOM NPC TOOLS NPC Model Mall: Generates hundreds or thousands of NPCs with unique models. NPCs are spawned on Programmer Isle NPCs are named as their ModelID # Number of models and spawn location is configurable NPC Model Randomizer: Randomizes the models of NPCs from a list of valid models. This is used for GM Island and Vendor Set NPCs Reseeding of random models can be done from StygianCoreTools CUSTOM ITEMS Personal Teleporter: An item that spawns a teleport NPC that fades after use. Level-Up Token: An item that levels the player up on use. This is a unique item. Tome of World Flying: Sold by all flight masters. Allows flying in classic zones. Azerothian Humor Vol.1: A book of WoW jokes. Not sold in stores! Parents beware! GameMaster's License: A vanity item for kids so they can brag about being a REAL GM! ITEM PRICING - Vendor an items have been repriced using the included template - Prices are adjusted for my server's solo and small group players - Fishing is now much more lucrative - Rare and strange items now fetch more money from vendors - The repricing template can be adjusted/imported to suit your needs. MODULES Better Item Reloading Congrats On Level Up Custom Login Set Reputation Set Skills Set Special Abilities Set Special Items Set Heirloom Items Custom Server Core modifications and smaller scripts Duel Reset Dungeon Checkpoints Multi-Vendor Eluna LUA Engine Script: GM Command Handler Script: Item Gossip & other examples Script: Transmogrification NPC GM Island Individual XP Item Level-Up Money For Kills World/Dungeon Boss Kill Announcer PVP Kill Announcer Suicide Announcer Custom NPC Most NPCs have custom configurable phrases, emotes, and actions NPC All Mounts Vendor NPC Beastmaster NPC Buffer NPC Codebox NPC Enchanter NPC Gambler NPC Loremaster NPC Multi-Vendor NPC Trollop Random Enchants % Chance to enchant is now configurable Item Quality to enchant is now configurable Starting Guild Included SQL for creating default Guild/Characters/Guild Bank VAS AutoBalance Questions, Comments, Bug Reports? Please hit me up on the GitHub repo. Enjoy! - STB ---------- - StygianCore - My WoW Projects - GitHub
  2. StygianTheBest

    [[Template core/front/global/prefix is throwing an error. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]] [C++ Module] Loremaster NPC

    I just released a new module for StygianCore Repack powered by AzerothCore. This is one I’ve been wanting to create for a while, and I look forward to improving it by adding many more Loremaster NPCs at key locations around the Eastern Kingdoms, Kalimdor, and beyond. Once found, perhaps they will have a book or item of historical significance for you. Right now there are only three, but those three are in special places. When you talk to one, they will tell you about the area you're in and offer to teleport you to the next Loremaster in the chain. It’s easy to add new ones too by using the SQL template I’ve provided. DOWNLOAD
  3. StygianTheBest

    [[Template core/front/global/prefix is throwing an error. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]] [C++ Module] WhiteFang Beastmaster NPC

    I've recently updated my WhiteFang Beastmaster module for my StygianCore Repack based on Azerothcore. I've improved code and function and it now reads all beasts from the config file (thanks to Stoabrogga) which is a great feature. DOWNLOAD
  4. When i buff berserk 900% add damage to char 1000% when buff more 1 berserk 900% = 10000% but need 1800% who know wtf is this? Code void AuraEffect::HandleModDamagePercentDone(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const { if (!(mode & (AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK | AURA_EFFECT_HANDLE_STAT))) return; Unit* target = aurApp->GetTarget(); // also handles spell group stacks if (GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL) target->UpdateAllDamagePctDoneMods(); if (target->GetTypeId() == TYPEID_PLAYER) { for (uint8 i = 0; i < MAX_SPELL_SCHOOL; ++i) { if (GetMiscValue() & (1 << i)) { // only aura type modifying PLAYER_FIELD_MOD_DAMAGE_DONE_PCT float amount = target->GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, 1 << i); target->SetFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT + i, amount); } } } }
  5. Configuration 1) Open World.h and Inside: enum WorldBoolConfigs add: CONFIG_CROSSFACTIONBG 2) Open World.cpp and add: m_bool_configs[CONFIG_CROSSFACTIONBG] = sConfigMgr->GetBoolDefault("MixedBGs", true); Around line #1191 where all the other options are loading. Player source & header file 1) Open Player.h and Player.cpp. In Player.h go to line #1061 and above line #1066 add: //CROSSFACION BG START private: bool m_ForgetBGPlayers; bool m_ForgetInListPlayers; public: typedef std::vector<uint64> FakePlayers; void FitPlayerInTeam(bool action); void DoForgetPlayersInList(); void DoForgetPlayersInBG(Battleground* pBattleGround); uint8 GetFakeRaceOrRace(); void SetForgetBGPlayers(bool tralse) { m_ForgetBGPlayers = tralse; } bool ShouldForgetBGPlayers() { return m_ForgetBGPlayers; } void SetForgetInListPlayers(bool tralse) { m_ForgetInListPlayers = tralse; } bool ShouldForgetInListPlayers() { return m_ForgetInListPlayers; } bool SendBattleGroundChat(uint32 msgtype, std::string message); void MorphFit(bool value); bool TeamIsBGTeam() { return GetBGTeam() == GetTeam(); } FakePlayers m_FakePlayers; //CROSSFACION BG END 2) Go to line #1887 and above that add: TeamId GetBGTeamId() const { return GetBGTeam() == ALLIANCE ? TEAM_ALLIANCE : TEAM_HORDE; } 3) Go to Player.cpp and on any line under a function of your choice add: /*#################################################################################### ###############################CROSSFACTION BATTLEGROUNDS############################# ####################################################################################*/ void Player::FitPlayerInTeam(bool action) { ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(GetFakeRaceOrRace()); if(rEntry && !TeamIsBGTeam() && action) setFaction(rEntry->FactionID); else setFactionForRace(getRace()); if (action) SetForgetBGPlayers(true); else SetForgetInListPlayers(true); MorphFit(action); if (GetBattleground() && action) ChatHandler(GetSession()).PSendSysMessage("You are playing for the %s%s in %s!", GetBGTeam() == ALLIANCE ? "|cff0000FFalliance|r" : "|cffFF0000horde|r", GetBattleground()->GetName()); } uint8 Player::GetFakeRaceOrRace() { if(!TeamIsBGTeam()) return GetBGTeam() == ALLIANCE ? RACE_HUMAN : RACE_BLOODELF; else return getRace(); } void Player::DoForgetPlayersInList() { // m_FakePlayers is filled from a vector within the battleground // they were in previously so all players that have been in that BG will be invalidated. for (FakePlayers::const_iterator itr = m_FakePlayers.begin(); itr != m_FakePlayers.end(); ++itr) { WorldPacket data(SMSG_INVALIDATE_PLAYER, 8); data << *itr; GetSession()->SendPacket(&data); if (Player* pPlayer = ObjectAccessor::FindPlayer(*itr)) GetSession()->SendNameQueryOpcode(*itr); } m_FakePlayers.clear(); } void Player::DoForgetPlayersInBG(Battleground* pBattleGround) { if (!pBattleGround || pBattleGround->isArena()) return; for (Battleground::BattlegroundPlayerMap::const_iterator itr = pBattleGround->GetPlayers().begin(); itr != pBattleGround->GetPlayers().end(); ++itr) { // Here we invalidate players in the bg to the added player WorldPacket data1(SMSG_INVALIDATE_PLAYER, 8); data1 << itr->first; GetSession()->SendPacket(&data1); GetSession()->SendNameQueryOpcode(itr->first); if (Player* pPlayer = ObjectAccessor::FindPlayer(itr->first)) { // Here we invalidate the player added to players in the bg WorldPacket data2(SMSG_INVALIDATE_PLAYER, 8); data2 << GetGUID(); pPlayer->GetSession()->SendPacket(&data2); pPlayer->GetSession()->SendNameQueryOpcode(GetGUID()); } } } bool BattlegroundQueue::CheckCrossFactionMatch(BattlegroundBracketId bracket_id, Battleground* bg) { TC_LOG_DEBUG("misc", "BattleGroundQueue::CheckCrossFactionMatch"); if (bg->isArena()) return false; // Only do this if crossbg's are enabled. // Here we will add all players to selectionpool, later we check if there are enough and launch a bg. FillXPlayersToBG(bracket_id, bg, true); uint8 MPT = bg->GetMinPlayersPerTeam(); if (m_SelectionPools[TEAM_ALLIANCE].GetPlayerCount() < MPT || m_SelectionPools[TEAM_HORDE].GetPlayerCount() < MPT) { TC_LOG_DEBUG("misc", "Not enough players. Has: %u Need: %u", m_SelectionPools[TEAM_ALLIANCE].GetPlayerCount() + m_SelectionPools[TEAM_HORDE].GetPlayerCount(), MPT * 2); return false; } return true; } // This function will invite players in the least populated faction, which makes battleground queues much faster. // This function will return true if cross faction battlegrounds are enabled, otherwise return false, // which is useful in FillPlayersToBG. Because then we can interrupt the regular invitation if cross faction bg's are enabled. bool BattlegroundQueue::FillXPlayersToBG(BattlegroundBracketId bracket_id, Battleground* bg, bool start) { if (sWorld->getBoolConfig(CONFIG_CROSSFACTIONBG)) { int32 aliFree = start ? bg->GetMinPlayersPerTeam() : bg->GetFreeSlotsForTeam(ALLIANCE); int32 hordeFree = start ? bg->GetMinPlayersPerTeam() : bg->GetFreeSlotsForTeam(HORDE); // Empty selection pools. They will be refilled from queued groups. m_SelectionPools[TEAM_ALLIANCE].Init(); m_SelectionPools[TEAM_HORDE].Init(); int32 valiFree = aliFree; int32 vhordeFree = hordeFree; int32 diff = 0; TC_LOG_DEBUG("misc", "valiFree: %u vhordeFree: %u", valiFree, vhordeFree); for (GroupsQueueType::iterator itr = m_QueuedGroups[bracket_id][BG_QUEUE_MIXED].begin(); itr != m_QueuedGroups[bracket_id][BG_QUEUE_MIXED].end(); ++itr) { if ((*itr)->IsInvitedToBGInstanceGUID) continue; diff = abs(valiFree - vhordeFree); bool moreAli = valiFree < vhordeFree; if (diff > 0) (*itr)->Team = moreAli ? HORDE : ALLIANCE; bool alliance = (*itr)->Team == ALLIANCE; if (m_SelectionPools[alliance ? TEAM_ALLIANCE : TEAM_HORDE].AddGroup((*itr), alliance ? aliFree : hordeFree)) { uint8 GSize = (*itr)->Players.size(); alliance ? valiFree -= GSize : vhordeFree -= GSize; } } return true; } return false; } bool Player::SendBattleGroundChat(uint32 msgtype, std::string message) { float distance = msgtype == CHAT_MSG_SAY ? sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY) : sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL); if (Battleground* pBattleGround = GetBattleground()) { for (Battleground::BattlegroundPlayerMap::const_iterator itr = pBattleGround->GetPlayers().begin(); itr != pBattleGround->GetPlayers().end(); ++itr) { if (Player* pPlayer = ObjectAccessor::FindPlayer(itr->first)) { if (GetDistance2d(pPlayer->GetPositionX(), pPlayer->GetPositionY()) <= distance) { if (GetBGTeam() == pPlayer->GetBGTeam()) { WorldPacket data; ChatHandler::BuildChatPacket(data, ChatMsg(msgtype), LANG_UNIVERSAL, pPlayer, NULL, message); pPlayer->GetSession()->SendPacket(&data); } else if (msgtype != CHAT_MSG_EMOTE) { WorldPacket data; ChatHandler::BuildChatPacket(data, ChatMsg(msgtype), pPlayer->GetTeam() == ALLIANCE ? LANG_ORCISH : LANG_COMMON, pPlayer, NULL, message); pPlayer->GetSession()->SendPacket(&data); } } } } return true; } else return false; } void Player::MorphFit(bool value) { if (!TeamIsBGTeam() && value) { if (GetBGTeam() == ALLIANCE) { if (getGender() == GENDER_MALE) { SetDisplayId(19723); SetNativeDisplayId(19723); } else { SetDisplayId(19724); SetNativeDisplayId(19724); } } else { if (getGender() == GENDER_MALE) { SetDisplayId(20578); SetNativeDisplayId(20578); } else { SetDisplayId(20579); SetNativeDisplayId(20579); } } } else InitDisplayIds(); } Unit.cpp & Handlers 1) Open QueryHandler.cpp and under SendNameQueryOpcode(uint64 guid), change: data << uint8(nameData->m_race); to data << uint8(player ? player->GetFakeRaceOrRace() : nameData->m_race); 2) Open MiscHandler.cpp and under void WorldSession::HandleTimeSyncResp(WorldPacket& recvData) add: (Above or below line: #1418) Battleground* bg = _player->GetBattleground(); if (bg) { if (_player->ShouldForgetBGPlayers()) { _player->DoForgetPlayersInBG(bg); _player->SetForgetBGPlayers(false); } } else if (_player->ShouldForgetInListPlayers()) { _player->DoForgetPlayersInList(); _player->SetForgetInListPlayers(false); } 3) Open ChatHandler.cpp and Inside of void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) add: (Above line #251) if (!GetPlayer()->IsGameMaster()) if (GetPlayer()->SendBattleGroundChat(type, msg)) return; 4) Open CharacterHandler.cpp and Inside of void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) Under line #1031 add: if (sWorld->getBoolConfig(CONFIG_CROSSFACTIONBG)) { float x = pCurrChar->GetPositionX(); float y = pCurrChar->GetPositionY(); float z = pCurrChar->GetPositionZ(); uint32 hm = pCurrChar->m_homebindMapId; float hx = pCurrChar->m_homebindX; float hy = pCurrChar->m_homebindX; float hz = pCurrChar->m_homebindX; if (z+1 < pCurrChar->GetMap()->GetHeight(x, y, MAX_HEIGHT) && pCurrChar->GetMap()->IsOutdoors(x, y, z)) pCurrChar->TeleportTo(hm, hx, hy, hz, 0); } if (pCurrChar->GetBattleground() && !pCurrChar->GetBattleground()->isArena()) pCurrChar->FitPlayerInTeam(true); else pCurrChar->FitPlayerInTeam(false); 5) Open Unit.cpp and Inside of void Unit::RestoreFaction() on line #15921, change: ToPlayer()->setFactionForRace(getRace()); to ToPlayer()->setFactionForRace(ToPlayer()->GetFakeRaceOrRace()); BattlegroundQueue.h 1) Open BattlegroundQueue.h and Inside of enum BattlegroundQueueGroupTypes under BG_QUEUE_NORMAL_HORDE = 3, add: BG_QUEUE_MIXED = 4 End Result: enum BattlegroundQueueGroupTypes { BG_QUEUE_PREMADE_ALLIANCE = 0, BG_QUEUE_PREMADE_HORDE = 1, BG_QUEUE_NORMAL_ALLIANCE = 2, BG_QUEUE_NORMAL_HORDE = 3, BG_QUEUE_MIXED = 4 }; 2) On line #65 replace #define BG_QUEUE_GROUP_TYPES_COUNT 4 with: #define BG_QUEUE_GROUP_TYPES_COUNT 5 3) Under line #75 add: bool FillXPlayersToBG(BattlegroundBracketId bracket_id, Battleground* bg, bool start = false); bool CheckCrossFactionMatch(BattlegroundBracketId bracket_id, Battleground* bg); BattlegroundQueue.cpp 1) Open BattlegroundQueue.cpp and on line #840, change: if (CheckNormalMatch(bg_template, bracket_id, MinPlayersPerTeam, MaxPlayersPerTeam) || (bg_template->isArena() && CheckSkirmishForSameFaction(bracket_id, MinPlayersPerTeam))) to if (CheckNormalMatch(bg_template, bracket_id, MinPlayersPerTeam, MaxPlayersPerTeam) || (bg_template->isArena() && CheckSkirmishForSameFaction(bracket_id, MinPlayersPerTeam)) || CheckCrossFactionMatch(bracket_id, bg_template)) 2) On line #747, change: if (m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE].empty() && m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_HORDE].empty() && m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE].empty() && m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_HORDE].empty()) return; to if (m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE].empty() && m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_HORDE].empty() && m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE].empty() && m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_HORDE].empty() && m_QueuedGroups[bracket_id][BG_QUEUE_MIXED].empty()) return; 3) On line #501 add: if (!bg->isArena()) if (FillXPlayersToBG(bracket_id, bg, false)) return; 4) On line #313, change: for (uint32 j = index; j < BG_QUEUE_GROUP_TYPES_COUNT; j += BG_TEAMS_COUNT) to for (uint32 j = 0; j < BG_QUEUE_GROUP_TYPES_COUNT; ++j) 5) On line #298, change: TC_LOG_ERROR("bg.battleground", "BattlegroundQueue: couldn't find player %s (GUID: %u)", playerName.c_str(), GUID_LOPART(guid)); to TC_LOG_DEBUG("bg.battleground", "BattlegroundQueue: couldn't find player %s (GUID: %u)", playerName.c_str(), GUID_LOPART(guid)); 6) Inside of GroupQueueInfo* BattlegroundQueue::AddGroup(Player* leader, Group* grp, BattlegroundTypeId BgTypeId, PvPDifficultyEntry const* bracketEntry, uint8 ArenaType, bool isRated, bool isPremade, uint32 ArenaRating, uint32 MatchmakerRating, uint32 arenateamid) on line #143 change: ginfo->Team = leader->GetTeam(); to ginfo->Team = leader->GetBGTeam(); 7) Above line #157 add: if (sWorld->getBoolConfig(CONFIG_CROSSFACTIONBG) && ArenaType == 0) index = BG_QUEUE_MIXED; 8) On line #200 change: if (Battleground* bg = sBattlegroundMgr->GetBattlegroundTemplate(ginfo->BgTypeId)) { char const* bgName = bg->GetName(); uint32 MinPlayers = bg->GetMinPlayersPerTeam(); uint32 qHorde = 0; uint32 qAlliance = 0; uint32 q_min_level = bracketEntry->minLevel; uint32 q_max_level = bracketEntry->maxLevel; GroupsQueueType::const_iterator itr; for (itr = m_QueuedGroups[bracketId][BG_QUEUE_NORMAL_ALLIANCE].begin(); itr != m_QueuedGroups[bracketId][BG_QUEUE_NORMAL_ALLIANCE].end(); ++itr) if (!(*itr)->IsInvitedToBGInstanceGUID) qAlliance += (*itr)->Players.size(); for (itr = m_QueuedGroups[bracketId][BG_QUEUE_NORMAL_HORDE].begin(); itr != m_QueuedGroups[bracketId][BG_QUEUE_NORMAL_HORDE].end(); ++itr) if (!(*itr)->IsInvitedToBGInstanceGUID) qHorde += (*itr)->Players.size(); // Show queue status to player only (when joining queue) if (sWorld->getBoolConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY)) { ChatHandler(leader->GetSession()).PSendSysMessage(LANG_BG_QUEUE_ANNOUNCE_SELF, bgName, q_min_level, q_max_level, qAlliance, (MinPlayers > qAlliance) ? MinPlayers - qAlliance : (uint32)0, qHorde, (MinPlayers > qHorde) ? MinPlayers - qHorde : (uint32)0); } // System message else { sWorld->SendWorldText(LANG_BG_QUEUE_ANNOUNCE_WORLD, bgName, q_min_level, q_max_level, qAlliance, (MinPlayers > qAlliance) ? MinPlayers - qAlliance : (uint32)0, qHorde, (MinPlayers > qHorde) ? MinPlayers - qHorde : (uint32)0); } } to if (Battleground* bg = sBattlegroundMgr->GetBattlegroundTemplate(ginfo->BgTypeId)) { if (sWorld->getBoolConfig(CONFIG_CROSSFACTIONBG)) { char const* bgName = bg->GetName(); uint32 MinPlayers = bg->GetMinPlayersPerTeam()*2; uint32 qPlayers = 0; uint32 q_min_level = bracketEntry->minLevel; uint32 q_max_level = bracketEntry->maxLevel; for (GroupsQueueType::const_iterator itr = m_QueuedGroups[bracketId][BG_QUEUE_MIXED].begin(); itr != m_QueuedGroups[bracketId][BG_QUEUE_MIXED].end(); ++itr) if (!(*itr)->IsInvitedToBGInstanceGUID) qPlayers += (*itr)->Players.size(); if (sWorld->getBoolConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY)) ChatHandler(leader->GetSession()).PSendSysMessage("Queue status for %s (Lvl: %u to %u) Queued players: %u (Need at least %u more)", bgName, q_min_level, q_max_level, qPlayers, MinPlayers - qPlayers); else { std::ostringstream ss; ss << "|cffff0000[BG Queue Announcer]:|r " << bgName << " -- [" << q_min_level << "-" << q_max_level << "]" << qPlayers << "/" << MinPlayers; sWorld->SendGlobalText(ss.str().c_str(), NULL); } } else { char const* bgName = bg->GetName(); uint32 MinPlayers = bg->GetMinPlayersPerTeam(); uint32 qHorde = 0; uint32 qAlliance = 0; uint32 q_min_level = bracketEntry->minLevel; uint32 q_max_level = bracketEntry->maxLevel; GroupsQueueType::const_iterator itr; for (itr = m_QueuedGroups[bracketId][BG_QUEUE_NORMAL_ALLIANCE].begin(); itr != m_QueuedGroups[bracketId][BG_QUEUE_NORMAL_ALLIANCE].end(); ++itr) if (!(*itr)->IsInvitedToBGInstanceGUID) qAlliance += (*itr)->Players.size(); for (itr = m_QueuedGroups[bracketId][BG_QUEUE_NORMAL_HORDE].begin(); itr != m_QueuedGroups[bracketId][BG_QUEUE_NORMAL_HORDE].end(); ++itr) if (!(*itr)->IsInvitedToBGInstanceGUID) qHorde += (*itr)->Players.size(); // Show queue status to player only (when joining queue) if (sWorld->getBoolConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY)) { ChatHandler(leader->GetSession()).PSendSysMessage(LANG_BG_QUEUE_ANNOUNCE_SELF, bgName, q_min_level, q_max_level, qAlliance, (MinPlayers > qAlliance) ? MinPlayers - qAlliance : (uint32)0, qHorde, (MinPlayers > qHorde) ? MinPlayers - qHorde : (uint32)0); } // System message else { sWorld->SendWorldText(LANG_BG_QUEUE_ANNOUNCE_WORLD, bgName, q_min_level, q_max_level, qAlliance, (MinPlayers > qAlliance) ? MinPlayers - qAlliance : (uint32)0, qHorde, (MinPlayers > qHorde) ? MinPlayers - qHorde : (uint32)0); } } } Credits: QQrofl(Script) Death(Tutorial reformat)
  6. Jimteck

    [[Template core/front/global/prefix is throwing an error. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]] Donor NPC (C++) (C2259)

    #include "ScriptPCH.h" #include <sstream> #include <string> #include <vector> std::string getString(std::string string, uint32 number); std::string getDPString(std::string string, uint32 number, uint8 quality); uint32 getDPFromID(uint32 item_id); bool canRun = true; class dp_items { public: dp_items() {} dp_items(uint32 item_id, uint8 item_type, std::string item_name, uint8 quality, uint32 dp_cost) { this->item_id = item_id; this->dp_cost = dp_cost; this->quality = quality; this->item_type = item_type; this->item_name = item_name; } inline uint32 getItemID() { return item_id; } inline uint32 getDPCost() { return dp_cost; } inline uint8 getQuality() { return quality; } inline uint8 getItemType() { return item_type; } inline std::string getName() { return item_name; } private: uint32 item_id, dp_cost; uint8 quality, item_type; std::string item_name; }; std::vector<dp_items> items; class load_dp : public WorldScript { public: load_dp() : WorldScript("load_dp") {} void OnStartup() { QueryResult loadQuery = WorldDatabase.Query(loadStmnt.c_str()); Field *fields = loadQuery->Fetch(); if (fields) { do { dp_items item = dp_items(fields[0].GetUInt32(), fields[1].GetUInt8(), fields[2].GetString(), fields[3].GetUInt8(), fields[4].GetUInt32()); items.push_back(item); } while (loadQuery->NextRow()); TC_LOG_INFO("server.loading", "DP Items Loaded Successfully."); } else { canRun = false; } QueryResult testQuery = LoginDatabase.Query("SELECT * from account LIMIT 1;"); if (testQuery->GetFieldCount() < 25) { TC_LOG_INFO("server.loading", "ERROR: Missing dp_balance column."); canRun = false; } else { TC_LOG_INFO("server.loading", "DP System Loaded Successfully."); } } private: std::string loadStmnt = "SELECT * from dp_items;"; }; class gossip_dp : public CreatureScript { public: gossip_dp() : CreatureScript("gossip_dp") { } uint32 getDP(Player* player) { QueryResult dQuery = LoginDatabase.Query(getString(dpQuery, player->GetSession()->GetAccountId()).c_str()); Field *field = dQuery->Fetch(); return field[0].GetUInt32(); } bool OnGossipHello(Player* player, Creature* creature) { if (canRun) { if (player->IsInCombat()) { player->GetSession()->SendAreaTriggerMessage("Вы в бою"); return false; } AddGossipItemFor(player,GOSSIP_ICON_MONEY_BAG, getString(currentDP, getDP(player)).c_str(), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); AddGossipItemFor(player,GOSSIP_ICON_VENDOR, "|TInterface/ICONS/Inv_chest_cloth_71:30|t |cffB22222Предпросмотр вещей", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); AddGossipItemFor(player,GOSSIP_ICON_BATTLE, "|TInterface/ICONS/Inv_weapon_halberd_31:30|t |cffB22222Оружие за пожертвование", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); AddGossipItemFor(player,GOSSIP_ICON_VENDOR, "|TInterface/ICONS/Inv_chest_cloth_61:30|t |cffB22222Экипировка за пожертвование", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); AddGossipItemFor(player,GOSSIP_ICON_VENDOR, "|TInterface/ICONS/Inv_misc_armorkit_12:30|t |cffB22222Разные мелкие штучки за пожертвование", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); AddGossipItemFor(player,GOSSIP_ICON_TRAINER, "|TInterface/ICONS/Spell_shaman_ancestralawakening:30|t |cffB22222Спелы за пожертвования", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); AddGossipItemFor(player,GOSSIP_ICON_CHAT, "|TInterface/ICONS/Spell_misc_emotionsad:30|t |cff0000CDНичего не хочу", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); SendGossipMenuFor(player, DEFAULT_GOSSIP_MESSAGE, creature->GetGUID()); return true; } else { return false; } } bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 actions) { player->PlayerTalkClass->ClearMenus(); if (sender == GOSSIP_SENDER_MAIN) { switch (actions) { case GOSSIP_ACTION_INFO_DEF + 1: creature->Whisper(getString(currentDP, getDP(player)), LANG_UNIVERSAL, player, false); player->PlayerTalkClass->SendCloseGossip(); break; case GOSSIP_ACTION_INFO_DEF + 2: for (unsigned int i = 0; i < items.size(); i++){ if (items.at(i).getItemType() == 1) AddGossipItemFor(player,GOSSIP_ICON_BATTLE, getDPString(items.at(i).getName(), items.at(i).getDPCost(), items.at(i).getQuality()).c_str(), GOSSIP_SENDER_MAIN+1, items.at(i).getItemID()); } AddGossipItemFor(player, GOSSIP_ICON_CHAT, "|TInterface/ICONS/Spell_misc_emotionsad:30|t |cff0000CDНазад", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8); SendGossipMenuFor(player, DEFAULT_GOSSIP_MESSAGE, creature->GetGUID()); \ break; case GOSSIP_ACTION_INFO_DEF + 3: for (unsigned int i = 0; i < items.size(); i++) { if (items.at(i).getItemType() == 2) AddGossipItemFor(player, GOSSIP_ICON_TABARD, getDPString(items.at(i).getName(), items.at(i).getDPCost(), items.at(i).getQuality()).c_str(), GOSSIP_SENDER_MAIN+1, items.at(i).getItemID()); } AddGossipItemFor(player, GOSSIP_ICON_CHAT, "|TInterface/ICONS/Spell_misc_emotionsad:30|t |cff0000CDНазад", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8); SendGossipMenuFor(player, DEFAULT_GOSSIP_MESSAGE, creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: for (unsigned int i = 0; i < items.size(); i++){ if (items.at(i).getItemType() == 3) AddGossipItemFor(player, GOSSIP_ICON_VENDOR, getDPString(items.at(i).getName(), items.at(i).getDPCost(), items.at(i).getQuality()).c_str(), GOSSIP_SENDER_MAIN+1, items.at(i).getItemID()); } AddGossipItemFor(player, GOSSIP_ICON_CHAT, "|TInterface/ICONS/Spell_misc_emotionsad:30|t |cff0000CDНазад", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8); SendGossipMenuFor(player, DEFAULT_GOSSIP_MESSAGE, creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: for (unsigned int i = 0; i < items.size(); i++){ if (items.at(i).getItemType() == 4) AddGossipItemFor(player, GOSSIP_ICON_TRAINER, getDPString(items.at(i).getName(), items.at(i).getDPCost(), items.at(i).getQuality()).c_str(), GOSSIP_SENDER_MAIN+2, items.at(i).getItemID()); } AddGossipItemFor(player, GOSSIP_ICON_CHAT, "|TInterface/ICONS/Spell_misc_emotionsad:30|t |cff0000CDНазад", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8); SendGossipMenuFor(player, DEFAULT_GOSSIP_MESSAGE, creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: player->PlayerTalkClass->SendCloseGossip(); break; case GOSSIP_ACTION_INFO_DEF + 7: player->PlayerTalkClass->SendCloseGossip(); SendListInventory(player, creature); break; case GOSSIP_ACTION_INFO_DEF + 8: player->PlayerTalkClass->ClearMenus(); OnGossipHello(player, creature); break; } } else if (sender == GOSSIP_SENDER_MAIN + 1) { uint32 dpCost = getDPFromID(actions); uint32 dpBAL = getDP(player); if (dpCost <= dpBAL) { if (player->AddItem(actions, 1)) { LoginDatabase.PExecute(accountQuery.c_str(), (dpBAL - dpCost), player->GetSession()->GetAccountId()); LoginDatabase.PExecute(accountdataQuery.c_str(), (dpBAL - dpCost), player->GetSession()->GetAccountId()); player->GetSession()->SendNotification("Поздравляю вас с новой покупкой!"); } else { player->GetSession()->SendNotification("ОШИБКА - ваши сумки полны."); } } else { creature->Whisper(notEnoughDP, LANG_UNIVERSAL, player, false); player->GetSession()->SendNotification("ОШИБКА - у вас нет монет пожертвований."); } player->PlayerTalkClass->SendCloseGossip(); } else if (sender == GOSSIP_SENDER_MAIN + 2) { uint32 dpCost = getDPFromID(actions); uint32 dpBAL = getDP(player); if (dpCost <= dpBAL) { if (!player->HasSpell(actions)){ player->LearnSpell(actions, false, false); LoginDatabase.PExecute(accountQuery.c_str(), (dpBAL - dpCost), player->GetSession()->GetAccountId()); LoginDatabase.PExecute(accountdataQuery.c_str(), (dpBAL - dpCost), player->GetSession()->GetAccountId()); player->GetSession()->SendNotification("Поздравляю вас с новой покупкой."); } else { player->GetSession()->SendNotification("ОШИБКА - вы уже знаете это заклинание."); } } else { creature->Whisper(notEnoughDP, LANG_UNIVERSAL, player, false); player->GetSession()->SendNotification("ОШИБКА - у вас нет монет пожертвований."); } player->PlayerTalkClass->SendCloseGossip(); } return true; } // Do NOT modify anything in SendListInventory, may break previewing or allow players to buy items void SendListInventory(Player *player, Creature *creature) { // remove fake death if (player->HasUnitState(UNIT_STATE_DIED)) player->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); if (creature->HasUnitState(UNIT_STATE_MOVING)) creature->StopMoving(); VendorItemData *vItems = new VendorItemData(); for (uint32 i = 0; i < items.size(); i++) // Allows us to create a vendor window on the fly. { if (items.at(i).getItemType() != 4) // If the item is not a spell, lets put it in the vendor. vItems->AddItem(items.at(i).getItemID(), 0, 0, 59475); } if (!vItems) { WorldPacket data(SMSG_LIST_INVENTORY, 8 + 1 + 1); data << uint64(creature->GetGUID()); data << uint8(0); // count == 0, next will be error code data << uint8(0); // "Vendor has no inventory" player->GetSession()->SendPacket(&data); return; } uint8 itemCount = vItems->GetItemCount(); uint8 count = 0; WorldPacket data(SMSG_LIST_INVENTORY, 8 + 1 + itemCount * 8 * 4); data << uint64(creature->GetGUID()); size_t countPos = data.wpos(); data << uint8(count); float discountMod = player->GetReputationPriceDiscount(creature); for (uint8 slot = 0; slot < itemCount; ++slot) { if (VendorItem const* item = vItems->GetItem(slot)) { if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(item->item)) { if (!(itemTemplate->AllowableClass & player->getClassMask()) && itemTemplate->Bonding == BIND_WHEN_PICKED_UP && !player->IsGameMaster()) continue; // Only display items in vendor lists for the team the // player is on. If GM on, display all items. if (!player->IsGameMaster() && ((itemTemplate->Flags2 & ITEM_FLAG2_FACTION_HORDE && player->GetTeam() == ALLIANCE) || (itemTemplate->Flags2 == ITEM_FLAG2_FACTION_ALLIANCE && player->GetTeam() == HORDE))) continue; // reputation discount int32 price = item->IsGoldRequired(itemTemplate) ? uint32(floor(itemTemplate->BuyPrice * discountMod)) : 0; data << uint32(slot + 1); // client expects counting to start at 1 data << uint32(item->item); data << uint32(itemTemplate->DisplayInfoID); data << int32(0); data << uint32(price); data << uint32(itemTemplate->MaxDurability); data << uint32(itemTemplate->BuyCount); data << uint32(item->ExtendedCost); if (++count >= MAX_VENDOR_ITEMS) break; } } } if (count == 0) { data << uint8(0); player->GetSession()->SendPacket(&data); return; } data.put<uint8>(countPos, count); player->GetSession()->SendPacket(&data); } private: //Do not edit the Queries/constants below, they're set up 100%. std::string accountQuery = "UPDATE account SET dp_balance = %u WHERE id = %u;"; std::string accountdataQuery = "UPDATE account_data SET dp = %u WHERE id = %u;"; std::string currentDP = "|TInterface/ICONS/Inv_misc_coin_02:30|t |cffB22222На вашем счету: "; std::string notEnoughDP = "У вас нет монет пожертвований,зайдите на сайт или свяжитесь с администрацией сервера."; std::string dpQuery = "SELECT dp_balance FROM account WHERE id="; }; //Do NOT modify any of the below functions unless you are sure you know what you're doing. uint32 getDPFromID(uint32 item_id) { //Not the most efficient loop. Let me know if you are using a large amount of items/spells //and I can implement a more efficient search. uint32 dpCost = 99999; for (unsigned int i = 0; i < items.size(); i++) if (item_id == items.at(i).getItemID()) dpCost = items.at(i).getDPCost(); return dpCost; } std::string getString(std::string string, uint32 number) { std::ostringstream oss; oss << string << number; return oss.str(); } std::string getDPString(std::string string, uint32 number, uint8 quality) { //Colors currently disabled. /*std::string color; switch (quality) { case 0: color = "|cff9d9d9d"; break; case 1: color = "|cffffffff"; break; case 2: color = "|cff47b247"; break; case 3: color = "|cff00003d"; break; case 5: color = "|cff331f00"; break; default: color = "|cff3d003d"; break; }*/ std::ostringstream oss; //oss << color << string << " - (" << number << "DP)"; //With Color oss << string << " - (" << number << "Монет пожертвований)"; //Without color return oss.str(); } void AddSC_DPSystem() { new load_dp(); new gossip_dp(); <---class' : cannot instantiate abstract class Code declares an instance of an abstract class or structure. You cannot instantiate a class or structure with one or more pure virtual functions. To instantiate objects of a derived class, the derived class must override each pure virtual function. }
  7. Reforge (rochet2) not work for custom item`s,but item level tabard 200,but Mantle of the Tempest work fine with new stats #include <sstream> #include <string> #include <vector> #include "Creature.h" #include "Define.h" #include "EventProcessor.h" #include "GossipDef.h" #include "Item.h" #include "ItemPrototype.h" #include "ObjectGuid.h" #include "ObjectMgr.h" #include "Player.h" #include "ScriptedGossip.h" #include "ScriptMgr.h" #include "SharedDefines.h" #include "Spell.h" #include "Transaction.h" #include "WorldPacket.h" #include "WorldSession.h" /* Reforging by Rochet2 http://rochet2.github.io/Transmogrification.html Rules of thumb: Item can be reforged once. Item reforge wont show to anyone but you in tooltips. Stats will be there nevertheless. You will see the increased stats on all tooltips of the same item you reforged. You can disable the stat changes to tooltips by setting send_cache_packets to false. Reforges are stripped when you mail, ah, guildbank the item etc. Only YOU can have the reforge. Only item base stats are reforgable. Enchants and random stats are not. This script is made blizzlike. This means that the reforgable stats etc are from CATACLYSM! I have been informed that some stats were removed etc that would be important to be reforgable. However I do not know what those stats are currently. Do look through the statTypes to add whatever you want. Edit IsReforgable is you want to tweak requirements */ static const bool send_cache_packets = true; // change player cache? // Remember to add to GetStatName too static const ItemModType statTypes[] = { ITEM_MOD_SPIRIT, ITEM_MOD_STRENGTH, ITEM_MOD_AGILITY, ITEM_MOD_STAMINA, ITEM_MOD_INTELLECT, ITEM_MOD_ATTACK_POWER, ITEM_MOD_SPELL_POWER }; static const uint8 stat_type_max = sizeof(statTypes) / sizeof(*statTypes); static const char* GetStatName(uint32 ItemStatType) { switch(ItemStatType) { case ITEM_MOD_SPIRIT : return "Дух"; break; case ITEM_MOD_STRENGTH : return "Сила"; break; case ITEM_MOD_AGILITY : return "Ловкость"; break; case ITEM_MOD_STAMINA : return "Выносливость"; break; case ITEM_MOD_INTELLECT : return "Интеллект"; break; case ITEM_MOD_ATTACK_POWER : return "Сила атаки"; break; case ITEM_MOD_SPELL_POWER : return "Сила заклинаний"; break; default: return NULL; } } static const char* GetSlotName(uint8 slot, WorldSession* /*session*/) { switch (slot) { case EQUIPMENT_SLOT_HEAD : return "Голова"; case EQUIPMENT_SLOT_NECK : return "Шея"; case EQUIPMENT_SLOT_SHOULDERS : return "Плечи"; case EQUIPMENT_SLOT_BODY : return "Рубашка"; case EQUIPMENT_SLOT_CHEST : return "Тело"; case EQUIPMENT_SLOT_WAIST : return "Пояс"; case EQUIPMENT_SLOT_LEGS : return "Ноги"; case EQUIPMENT_SLOT_FEET : return "Ступни"; case EQUIPMENT_SLOT_WRISTS : return "Браслеты"; case EQUIPMENT_SLOT_HANDS : return "Руки"; case EQUIPMENT_SLOT_FINGER1 : return "Правый палец"; case EQUIPMENT_SLOT_FINGER2 : return "Левый палец"; case EQUIPMENT_SLOT_TRINKET1 : return "Правая серьга"; case EQUIPMENT_SLOT_TRINKET2 : return "Левая серьга"; case EQUIPMENT_SLOT_BACK : return "Накидка"; case EQUIPMENT_SLOT_MAINHAND : return "Правая рука"; case EQUIPMENT_SLOT_OFFHAND : return "Левая рука"; case EQUIPMENT_SLOT_TABARD : return "Гербовая накидка"; case EQUIPMENT_SLOT_RANGED : return "Дальнобойное оружие"; default: return NULL; } } static uint32 Melt(uint8 i, uint8 j) { return (i << 8) + j; } static void Unmelt(uint32 melt, uint8& i, uint8& j) { i = melt >> 8; j = melt & 0xFF; } static std::vector<Item*> GetItemList(const Player* player) { std::vector<Item*> itemlist; // Copy paste from Player::GetItemByGuid(guid) for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i) if (Item* pItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, i)) itemlist.push_back(pItem); for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) if (Item* pItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, i)) itemlist.push_back(pItem); for (int i = BANK_SLOT_ITEM_START; i < BANK_SLOT_BAG_END; ++i) if (Item* pItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, i)) itemlist.push_back(pItem); for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) if (Bag* pBag = player->GetBagByPos(i)) for (uint32 j = 0; j < pBag->GetBagSize(); ++j) if (Item* pItem = pBag->GetItemByPos(j)) itemlist.push_back(pItem); for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; ++i) if (Bag* pBag = player->GetBagByPos(i)) for (uint32 j = 0; j < pBag->GetBagSize(); ++j) if (Item* pItem = pBag->GetItemByPos(j)) itemlist.push_back(pItem); return itemlist; } static Item* GetEquippedItem(Player* player, uint32 guidlow) { for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i) if (Item* pItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, i)) if (pItem->GetGUIDLow() == guidlow) return pItem; return NULL; } void RemoveReforge(Player* player, uint32 itemguid, bool update); // Supply lowguid or reforge! (or both) // Warning, this function may modify player->reforgeMap when lowguid is supplied static void SendReforgePacket(Player* player, uint32 entry, uint32 lowguid = 0, const ReforgeData* reforge = NULL) { ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(entry); if (!pProto) return; if (lowguid) { if (!player->reforgeMap.empty() && player->reforgeMap.find(lowguid) != player->reforgeMap.end()) reforge = &player->reforgeMap[lowguid]; else RemoveReforge(player, lowguid, true); } // Update player cache (self only) pure visual. // HandleItemQuerySingleOpcode copy paste std::string Name = pProto->Name1; std::string Description = pProto->Description; int loc_idx = player->GetSession()->GetSessionDbLocaleIndex(); if (loc_idx >= 0) { if (ItemLocale const* il = sObjectMgr->GetItemLocale(pProto->ItemId)) { ObjectMgr::GetLocaleString(il->Name, loc_idx, Name); ObjectMgr::GetLocaleString(il->Description, loc_idx, Description); } } WorldPacket data(SMSG_ITEM_QUERY_SINGLE_RESPONSE, 600); data << pProto->ItemId; data << pProto->Class; data << pProto->SubClass; data << pProto->SoundOverrideSubclass; data << Name; data << uint8(0x00); //pProto->Name2; // blizz not send name there, just uint8(0x00); <-- \0 = empty string = empty name... data << uint8(0x00); //pProto->Name3; // blizz not send name there, just uint8(0x00); data << uint8(0x00); //pProto->Name4; // blizz not send name there, just uint8(0x00); data << pProto->DisplayInfoID; data << pProto->Quality; data << pProto->Flags; data << pProto->Flags2; data << pProto->BuyPrice; data << pProto->SellPrice; data << pProto->InventoryType; data << pProto->AllowableClass; data << pProto->AllowableRace; data << pProto->ItemLevel; data << pProto->RequiredLevel; data << pProto->RequiredSkill; data << pProto->RequiredSkillRank; data << pProto->RequiredSpell; data << pProto->RequiredHonorRank; data << pProto->RequiredCityRank; data << pProto->RequiredReputationFaction; data << pProto->RequiredReputationRank; data << int32(pProto->MaxCount); data << int32(pProto->Stackable); data << pProto->ContainerSlots; data << pProto->StatsCount + (reforge ? 1 : 0); // increase stat count by 1 bool decreased = false; for (uint32 i = 0; i < pProto->StatsCount; ++i) { data << pProto->ItemStat[i].ItemStatType; if (reforge && !decreased && pProto->ItemStat[i].ItemStatType == reforge->decrease) { data << pProto->ItemStat[i].ItemStatValue-reforge->stat_value; decreased = true; } else { data << pProto->ItemStat[i].ItemStatValue; } } if (reforge) { data << reforge->increase; // set new stat type data << reforge->stat_value; // and value } data << pProto->ScalingStatDistribution; // scaling stats distribution data << pProto->ScalingStatValue; // some kind of flags used to determine stat values column for (int i = 0; i < MAX_ITEM_PROTO_DAMAGES; ++i) { data << pProto->Damage[i].DamageMin; data << pProto->Damage[i].DamageMax; data << pProto->Damage[i].DamageType; } // resistances (7) data << pProto->Armor; data << pProto->HolyRes; data << pProto->FireRes; data << pProto->NatureRes; data << pProto->FrostRes; data << pProto->ShadowRes; data << pProto->ArcaneRes; data << pProto->Delay; data << pProto->AmmoType; data << pProto->RangedModRange; for (int s = 0; s < MAX_ITEM_PROTO_SPELLS; ++s) { // send DBC data for cooldowns in same way as it used in Spell::SendSpellCooldown // use `item_template` or if not set then only use spell cooldowns SpellInfo const* spell = sSpellMgr->GetSpellInfo(pProto->Spells[s].SpellId); if (spell) { bool db_data = pProto->Spells[s].SpellCooldown >= 0 || pProto->Spells[s].SpellCategoryCooldown >= 0; data << pProto->Spells[s].SpellId; data << pProto->Spells[s].SpellTrigger; data << uint32(-abs(pProto->Spells[s].SpellCharges)); if (db_data) { data << uint32(pProto->Spells[s].SpellCooldown); data << uint32(pProto->Spells[s].SpellCategory); data << uint32(pProto->Spells[s].SpellCategoryCooldown); } else { data << uint32(spell->RecoveryTime); data << uint32(spell->GetCategory()); data << uint32(spell->CategoryRecoveryTime); } } else { data << uint32(0); data << uint32(0); data << uint32(0); data << uint32(-1); data << uint32(0); data << uint32(-1); } } data << pProto->Bonding; data << Description; data << pProto->PageText; data << pProto->LanguageID; data << pProto->PageMaterial; data << pProto->StartQuest; data << pProto->LockID; data << int32(pProto->Material); data << pProto->Sheath; data << pProto->RandomProperty; data << pProto->RandomSuffix; data << pProto->Block; data << pProto->ItemSet; data << pProto->MaxDurability; data << pProto->Area; data << pProto->Map; // Added in 1.12.x & 2.0.1 client branch data << pProto->BagFamily; data << pProto->TotemCategory; for (int s = 0; s < MAX_ITEM_PROTO_SOCKETS; ++s) { data << pProto->Socket[s].Color; data << pProto->Socket[s].Content; } data << pProto->socketBonus; data << pProto->GemProperties; data << pProto->RequiredDisenchantSkill; data << pProto->ArmorDamageModifier; data << pProto->Duration; // added in 2.4.2.8209, duration (seconds) data << pProto->ItemLimitCategory; // WotLK, ItemLimitCategory data << pProto->HolidayId; // Holiday.dbc? player->GetSession()->SendPacket(&data); } static void SendReforgePackets(Player* player) { if (!send_cache_packets) return; std::vector<Item*> items = GetItemList(player); for (std::vector<Item*>::const_iterator it = items.begin(); it != items.end(); ++it) SendReforgePacket(player, (*it)->GetEntry(), (*it)->GetGUIDLow()); } void RemoveReforge(Player* player, uint32 itemguid, bool update) { if (!itemguid || player->reforgeMap.empty() || player->reforgeMap.find(itemguid) == player->reforgeMap.end()) return; Item* invItem = update ? player->GetItemByGuid(ObjectGuid(HIGHGUID_ITEM, 0, itemguid)) : NULL; if (!invItem) { player->reforgeMap.erase(itemguid); return; } player->_ApplyItemMods(invItem, invItem->GetSlot(), false); player->reforgeMap.erase(itemguid); player->_ApplyItemMods(invItem, invItem->GetSlot(), true); SendReforgePacket(player, invItem->GetEntry()); } static bool IsReforgable(Item* invItem, Player* player) { //if (!invItem->IsEquipped()) // return false; if (invItem->GetOwnerGUID() != player->GetGUID()) return false; const ItemTemplate* pProto = invItem->GetTemplate(); //if (pProto->ItemLevel < 200) // return false; //if (pProto->Quality == ITEM_QUALITY_HEIRLOOM) // block heirlooms necessary? // return false; if (!pProto->StatsCount || pProto->StatsCount >= MAX_ITEM_PROTO_STATS) // Mandatory! Do NOT remove or edit return false; if (!player->reforgeMap.empty() && player->reforgeMap.find(invItem->GetGUIDLow()) != player->reforgeMap.end()) // Mandatory! Do NOT remove or edit return false; for (uint32 i = 0; i < pProto->StatsCount; ++i) { if (!GetStatName(pProto->ItemStat[i].ItemStatType)) continue; if (((int32)floorf((float)pProto->ItemStat[i].ItemStatValue * 0.5f)) > 1) return true; } return false; } static void UpdatePlayerReforgeStats(Item* invItem, Player* player, uint32 decrease, uint32 increase) // stat types { const ItemTemplate* pProto = invItem->GetTemplate(); int32 stat_diff = 0; for (uint32 i = 0; i < pProto->StatsCount; ++i) { if (pProto->ItemStat[i].ItemStatType == increase) return; // Should not have the increased stat already if (pProto->ItemStat[i].ItemStatType == decrease) stat_diff = (int32)floorf((float)pProto->ItemStat[i].ItemStatValue * 0.5f); } if (stat_diff <= 0) return; // Should have some kind of diff // Update player stats player->_ApplyItemMods(invItem, invItem->GetSlot(), false); uint32 guidlow = invItem->GetGUIDLow(); ReforgeData& data = player->reforgeMap[guidlow]; data.increase = increase; data.decrease = decrease; data.stat_value = stat_diff; player->_ApplyItemMods(invItem, invItem->GetSlot(), true); // CharacterDatabase.PExecute("REPLACE INTO `custom_reforging` (`GUID`, `increase`, `decrease`, `stat_value`) VALUES (%u, %u, %u, %i)", guidlow, increase, decrease, stat_diff); player->ModifyMoney(pProto->SellPrice < (100*GOLD) ? (-100*GOLD) : -(int32)pProto->SellPrice); SendReforgePacket(player, invItem->GetEntry(), 0, &data); // player->SaveToDB(); } class REFORGE_PLAYER : public PlayerScript { public: REFORGE_PLAYER() : PlayerScript("REFORGE_PLAYER") { CharacterDatabase.DirectExecute("DELETE FROM `custom_reforging` WHERE NOT EXISTS (SELECT 1 FROM `item_instance` WHERE `item_instance`.`guid` = `custom_reforging`.`GUID`)"); } class SendRefPackLogin : public BasicEvent { public: SendRefPackLogin(Player* _player) : player(_player) { _player->m_Events.AddEvent(this, _player->m_Events.CalculateTime(1000)); } bool Execute(uint64, uint32) override { SendReforgePackets(player); return true; } Player* player; }; void OnLogin(Player* player, bool /*firstLogin*/) override { uint32 playerGUID = player->GetGUIDLow(); QueryResult result = CharacterDatabase.PQuery("SELECT `GUID`, `increase`, `decrease`, `stat_value` FROM `custom_reforging` WHERE `Owner` = %u", playerGUID); if (result) { do { uint32 lowGUID = (*result)[0].GetUInt32(); Item* invItem = player->GetItemByGuid(ObjectGuid(HIGHGUID_ITEM, 0, lowGUID)); if (invItem) player->_ApplyItemMods(invItem, invItem->GetSlot(), false); ReforgeData& data = player->reforgeMap[lowGUID]; data.increase = (*result)[1].GetUInt32(); data.decrease = (*result)[2].GetUInt32(); data.stat_value = (*result)[3].GetInt32(); if (invItem) player->_ApplyItemMods(invItem, invItem->GetSlot(), true); // SendReforgePacket(player, entry, lowGUID); } while (result->NextRow()); // SendReforgePackets(player); new SendRefPackLogin(player); } } //void OnLogout(Player* player) override //{ // if (player->reforgeMap.empty()) // return; // for (ReforgeMapType::const_iterator it = player->reforgeMap.begin(); it != player->reforgeMap.end();) // { // ReforgeMapType::const_iterator old_it = it++; // RemoveReforge(player, old_it->first, false); // } //} void OnSave(Player* player) override { uint32 lowguid = player->GetGUIDLow(); SQLTransaction trans = CharacterDatabase.BeginTransaction(); trans->PAppend("DELETE FROM `custom_reforging` WHERE `Owner` = %u", lowguid); if (!player->reforgeMap.empty()) { // Only save items that are in inventory / bank / etc std::vector<Item*> items = GetItemList(player); for (std::vector<Item*>::const_iterator it = items.begin(); it != items.end(); ++it) { ReforgeMapType::const_iterator it2 = player->reforgeMap.find((*it)->GetGUIDLow()); if (it2 == player->reforgeMap.end()) continue; const ReforgeData& data = it2->second; trans->PAppend("REPLACE INTO `custom_reforging` (`GUID`, `increase`, `decrease`, `stat_value`, `Owner`) VALUES (%u, %u, %u, %i, %u)", it2->first, data.increase, data.decrease, data.stat_value, lowguid); } } if (trans->GetSize()) // basically never false CharacterDatabase.CommitTransaction(trans); } }; class REFORGER_NPC : public CreatureScript { public: REFORGER_NPC() : CreatureScript("REFORGER_NPC") { } bool OnGossipHello(Player* player, Creature* creature) override { player->ADD_GOSSIP_ITEM(GOSSIP_ICON_BATTLE, "Выберите слот:", 0, Melt(MAIN_MENU, 0)); for (uint8 slot = EQUIPMENT_SLOT_START; slot < EQUIPMENT_SLOT_END; ++slot) { if (Item* invItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, slot)) if (IsReforgable(invItem, player)) if (const char* slotname = GetSlotName(slot, player->GetSession())) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, slotname, 0, Melt(SELECT_STAT_REDUCE, slot)); } player->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, "Удалить перековку", 0, Melt(SELECT_RESTORE, 0)); player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Обновить меню", 0, Melt(MAIN_MENU, 0)); player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, creature->GetGUID()); return true; } bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 melt) override { player->PlayerTalkClass->ClearMenus(); uint8 menu, action; Unmelt(melt, menu, action); switch (menu) { case MAIN_MENU: OnGossipHello(player, creature); break; case SELECT_STAT_REDUCE: // action = slot if (Item* invItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, action)) { if (IsReforgable(invItem, player)) { uint32 guidlow = invItem->GetGUIDLow(); const ItemTemplate* pProto = invItem->GetTemplate(); player->ADD_GOSSIP_ITEM(GOSSIP_ICON_BATTLE, "Статы которые можно урезать:", sender, melt); for (uint32 i = 0; i < pProto->StatsCount; ++i) { int32 stat_diff = ((int32)floorf((float)pProto->ItemStat[i].ItemStatValue * 0.5f)); if (stat_diff > 1) if (const char* stat_name = GetStatName(pProto->ItemStat[i].ItemStatType)) { std::ostringstream oss; oss << stat_name << " (" << pProto->ItemStat[i].ItemStatValue << " |cFFDB2222-" << stat_diff << "|r)"; player->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, oss.str(), guidlow, Melt(SELECT_STAT_INCREASE, i)); } } player->ADD_GOSSIP_ITEM(GOSSIP_ICON_TALK, "Назад..", 0, Melt(MAIN_MENU, 0)); player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, creature->GetGUID()); } else { player->GetSession()->SendNotification("Ошибка выбора предмета"); OnGossipHello(player, creature); } } else { player->GetSession()->SendNotification("Ошибка выбора предмета"); OnGossipHello(player, creature); } break; case SELECT_STAT_INCREASE: // sender = item guidlow // action = StatsCount id { Item* invItem = GetEquippedItem(player, sender); if (invItem) { const ItemTemplate* pProto = invItem->GetTemplate(); int32 stat_diff = ((int32)floorf((float)pProto->ItemStat[action].ItemStatValue * 0.5f)); player->ADD_GOSSIP_ITEM(GOSSIP_ICON_BATTLE, "Статы для поднятия:", sender, melt); for (uint8 i = 0; i < stat_type_max; ++i) { bool cont = false; for (uint32 j = 0; j < pProto->StatsCount; ++j) { if (statTypes[i] == pProto->ItemStat[j].ItemStatType) // skip existing stats on item { cont = true; break; } } if (cont) continue; if (const char* stat_name = GetStatName(statTypes[i])) { std::ostringstream oss; oss << stat_name << " |cFF3ECB3C+" << stat_diff << "|r"; player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_INTERACT_1, oss.str(), sender, Melt(i, (uint8)pProto->ItemStat[action].ItemStatType), "Вы уверены что хотите перековать\n\n" + pProto->Name1, (pProto->SellPrice < (10 * GOLD) ? (10 * GOLD) : pProto->SellPrice), false); } } player->ADD_GOSSIP_ITEM(GOSSIP_ICON_TALK, "Назад..", 0, Melt(SELECT_STAT_REDUCE, invItem->GetSlot())); player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, creature->GetGUID()); } else { player->GetSession()->SendNotification("Ошибка выбора предмета"); OnGossipHello(player, creature); } } break; case SELECT_RESTORE: { player->ADD_GOSSIP_ITEM(GOSSIP_ICON_BATTLE, "Выберите предмет из слота:", sender, melt); if (!player->reforgeMap.empty()) { for (uint8 slot = EQUIPMENT_SLOT_START; slot < EQUIPMENT_SLOT_END; ++slot) { if (Item* invItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, slot)) if (player->reforgeMap.find(invItem->GetGUIDLow()) != player->reforgeMap.end()) if (const char* slotname = GetSlotName(slot, player->GetSession())) player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_INTERACT_1, slotname, invItem->GetGUIDLow(), Melt(RESTORE, 0), "Удалить перековку\n\n" + invItem->GetTemplate()->Name1, 0, false); } } player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Обновить меню", sender, melt); player->ADD_GOSSIP_ITEM(GOSSIP_ICON_TALK, "Назад..", 0, Melt(MAIN_MENU, 0)); player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, creature->GetGUID()); } break; case RESTORE: // sender = item guidlow { if (player->GetItemByGuid(ObjectGuid(HIGHGUID_ITEM, 0, sender))) { if (!player->reforgeMap.empty() && player->reforgeMap.find(sender) != player->reforgeMap.end()) RemoveReforge(player, sender, true); } OnGossipHello(player, creature); } break; default: // Reforge // sender = item guidlow // menu = stat type to increase index to statTypes[] // action = stat type to decrease { if (menu < stat_type_max) { Item* invItem = GetEquippedItem(player, sender); if (invItem && IsReforgable(invItem, player)) { if (player->HasEnoughMoney(invItem->GetTemplate()->SellPrice < (100 * GOLD) ? (100 * GOLD) : invItem->GetTemplate()->SellPrice)) { // int32 stat_diff = ((int32)floorf((float)invItem->GetTemplate()->ItemStat[action].ItemStatValue * 0.4f)); UpdatePlayerReforgeStats(invItem, player, action, statTypes[menu]); // rewrite this function } else { player->GetSession()->SendNotification("У вас нет денег"); } } else { player->GetSession()->SendNotification("Ошибка выбора предмета"); } } OnGossipHello(player, creature); } } return true; } enum Menus { MAIN_MENU = 200, // stat_type_max SELECT_ITEM, SELECT_STAT_REDUCE, SELECT_STAT_INCREASE, SELECT_RESTORE, RESTORE, REFORGE, }; }; void AddSC_REFORGER_NPC() { new REFORGER_NPC; new REFORGE_PLAYER; } #undef FOR_REFORGE_ITEMS
  8. mathex

    Skills on Login

    Hello this is a very simple script that max out your weapon skills for every character on each login. #include "ScriptPCH.h" class maxskills : public PlayerScript { public: maxskills() : PlayerScript("maxskills") { } void OnLogin(Player * player) { player->MonsterWhisper("Your skills have been updated.", player->GetGUID()); player->UpdateSkillsToMaxSkillsForLevel(); } }; void AddSC_maxskills() { new maxskills; } save anywhere as "any_name.cpp" :-) Enjoy. Adding scripts into core
  9. Pajak21

    [C++] Donor NPC

    Hello Guys ! Well i was re-searching on the internet and i can not find any script for donor npc .. well then i was searching on my computer and i find cascade wow source then when i open it i found the donornpc.cpp .. I've seen thath on this forum there is no donornpc c++ script so i wanted to post it .. Well i didnt made this script and i dont know who made it,but its verry good and useful .. Hope you guys like it and sorry for my English ! --> http://pastebin.com/rBc3dc8z /PasteBin/ --> https://mega.nz/#!nBk1hDRR /Download/ Hope you guys use it ! Thanks !
  10. Hello everyone, my name is Raj Puri. Many of you may know me from other communities, but I've decided to stick with Lordcraft, simply because you're all nice! Anyhow, I will be contributing frequently (mainly C++ scripts) for TrinityCore. I WILL BE CRAFTING WHAT MATTERS!
  11. TrintyCore World Chat C++ How we do for to have SQL .chat please https://www.lordcraft.net/pst/p/8-wsnt2x/
  12. Hey guys, I wanted to give back to the community by sharing this script that I used to make a level 11 World Event Boss in replacement of the town's Hallow's end quests.All you would have to do is add in the NPCI have tested it and it works great --[[ Summary Description: A short simple script that scripts a Custom mini-boss for low levels for the Hallow's End Event (Event ID 12) Its basically the Horseman's attack on the towns without putting out fires. Maybe Future? -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- TODO: Pumpkin Adds: Derived from Kruul's LUA Script -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Spells: Cleave - 15496 - Inflicts 110% of weapon damage to an enemy and its nearest ally. Conflagration - 42380 - Sets an enemy aflame, inflicting 5% of maximum health as Fire damage every 1 sec and sending it into a state of panic for 4 sec. While the target is affected, the flames periodically scorch its nearby allies as well. ** This spell targets a random player and casts the spell ** SummonPumpkins -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Developed By: Promotion (In-Game Name) (Render1982) Credits: EmuDevs (For the API would've never have done this without it xD and all its Members for support and kindly nature!) Notes: I have put comments through out to remind myself and maybe others about what each line is. -]] local entry = 500200 -- NPC Entry local function CastCleave(eventId, dely, calls, creature) -- Cleave creature:CastSpell(creature:GetVictim(), 15496, true) end local function CastConflagration(eventId, dely, calls, creature) -- BURN THE PLAYER! if (math.random(1, 100) <= 75) then local players = creature:GetPlayersInRange() creature:CastSpell(players[math.random(1, #players)], 42380) creature:SendUnitYell("Harken, cur! Tis you I spurn! Now feel... the burn!", 0) creature:PlayDirectSound(12573) end end local function OnSpawn(event, creature) -- The Horseman Spawns creature:SendUnitYell("Prepare yourselves, the bells have tolled! Shelter your weak, your young and your old! Each of you shall pay the final sum! CRY for mercy! THE RECKONING HAS COME!", 0) creature:PlayDirectSound(11966) creature:RemoveEvents() end local function OnTargetDied(event, creature, victim) -- A player was Defeated creature:SendUnitYell("Your body lies beaten, battered and broken! Let my curse be your own, fate has spoken!", 0) creature:PlayDirectSound(11962) end local function OnEnterCombat(event, creature, target) -- Activate his Spells creature:RegisterEvent(CastCleave, 7000, 0) creature:RegisterEvent(CastConflagration, 12000, 0) -- creature:RegisterEvent(SpawnPumpkins, 15000, 1) -- Will Activate at a later time creature:SendUnitYell("It is over, your search is done! Let fate choose now, the righteous one!",0) creature:PlayDirectSound(11961) end --[[ -- Will be Activated Later local function SummonPumpkins(creature, target) local x, y, z = GetRelativePoint(math.random()*9, math.random()*math.pi*2) local pumpkin = creature:SpawnCreature(Pumpkin Entry, x, y, z, 0, 2, 300000) if (pumpkin) then pumpkin:AttackStart(target) end end local function SpawnPumpkins(event, delay, pCall, creature) SummonPumpkins(creature, creature:GetVictim()) SummonPumpkins(creature, creature:GetVictim()) SummonPumpkins(creature, creature:GetVictim()) creature:RegisterEvent(SpawnPumpkins, 45000, 0) end --]] local function OnLeaveCombat(event, creature) creature:PlayDirectSound(11965) -- Group Wiped creature:SendUnitEmote("The Horseman Cackles") -- Horseman Laughs creature:RemoveEvents() end local function OnDied(event, creature, killer) creature:SendUnitYell("This end... have I reached before. What new adventure lies in store?", 0) -- Players Were Successful creature:PlayDirectSound(11964) creature:RemoveEvents() end -- Register the Horseman's Events RegisterCreatureEvent(entry, 1, OnEnterCombat) RegisterCreatureEvent(entry, 2, OnLeaveCombat) RegisterCreatureEvent(entry, 3, OnTargetDied) RegisterCreatureEvent(entry, 4, OnDied) RegisterCreatureEvent(entry, 5, OnSpawn)Fixed Conflagration being casted without him in combat and added sound.Next Up will be the Pumpkin SolidersThanks to Foereaper for this script; credits to him. It's a bug fix to the Hallow's Eve Treats. local PumpkinTreat = { Entry = 20557, Spells = {24924, 24925, 24708, 24927}, -- Define all the pumpkin spells here } function PumpkinTreat.OnUse(event, player, item, target) local t = PumpkinTreat["Spells"] -- Shorten the subtable to t for _, v in ipairs(t) do -- Loop through the spell table to see if the player has any of the spells applied if(player:HasAura(v)) then player:RemoveAura(v) end end player:CastSpell(player, t[math.random(#t)], true) -- Cast random spell on the player end RegisterItemEvent(PumpkinTreat.Entry, 2, PumpkinTreat.OnUse) Credits: Render1982
  13. t1on

    GOMove Trinity

    Original idea: Mordred Best suggestion: MrSmite on trinitycore forums, thanks for that :3 GOMove is a script that allows you to move objects. You no longer need to be at the point where you want to spawn an object and you can fine tune the position of objects (rotation and x,y,z position) Some features: (Does not include all .. see video) Move objects (to compass directions and according to your character position) Favourite list Snap facing to a compass direction (N,E,W,S) Spawn an object again move to ground level Suggestions are welcome :3 Download: https://rochet2.github.io/?page=GOMove READ THE README! https://www.youtube.com/watch?v=dqbUQrvIlcA Predecessors: GOMove by Mordred (arc) GOMove gossip edition by Rochet2 (arc) GOMove UI addon edition by Rochet2 (trinitycore) Credits: rochet2 and morded
  14. vanquisher

    [[Template core/front/global/prefix is throwing an error. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]] Gunship

    Any working Gunship script, for the latest trinitycore? - Please share it..
  15. Death

    Recommended Equipment

    For beginners I recommend Navicat. It's basic and simple. Download Navicat Here: Navicat For the ones with a little experience I highly recommend Heidisql (Beginner-friendly) Download Hedisql Here: HeidiSQL These programs are trusted by me, and thousands of other developers. If you have any questions on how to use or help with SQL in General, please navigate here: Support and post your problem. I guarantee it will be answered within an hour.
×
×
  • Create New...