From d39b762d883baf1b624a1cf8a4e47b21a289ad72 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Sun, 2 Aug 2015 03:06:49 +0200 Subject: [PATCH] Core/Misc: 3.3.5a fixes --- sql/updates/world/2015_08_02_00_world.sql | 48 +++++++++++++++++++ sql/updates/world/2015_08_02_01_world.sql | 5 ++ .../game/AuctionHouseBot/AuctionHouseBot.cpp | 7 +++ .../game/AuctionHouseBot/AuctionHouseBot.h | 10 ++++ .../AuctionHouseBot/AuctionHouseBotBuyer.cpp | 33 ++++++------- src/server/game/Spells/SpellMgr.cpp | 5 ++ .../RubySanctum/boss_halion.cpp | 17 ++----- src/server/scripts/Spells/spell_hunter.cpp | 40 ++++++++++++++++ src/server/worldserver/worldserver.conf.dist | 7 +++ 9 files changed, 141 insertions(+), 31 deletions(-) create mode 100644 sql/updates/world/2015_08_02_00_world.sql create mode 100644 sql/updates/world/2015_08_02_01_world.sql diff --git a/sql/updates/world/2015_08_02_00_world.sql b/sql/updates/world/2015_08_02_00_world.sql new file mode 100644 index 00000000000..8182441c534 --- /dev/null +++ b/sql/updates/world/2015_08_02_00_world.sql @@ -0,0 +1,48 @@ +-- +UPDATE `creature_template` SET `ainame`='SmartAI', `scriptname`='' WHERE `entry`=7774; +DELETE FROM `smart_scripts` WHERE `entryorguid`=7774 AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid`=777400 AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(7774,0,0,1,19,0,100,0,2845,0,0,0,81,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Shay Leafrunner - On Quest Accept (Wondering Shay) - Set NPC Flags'), +(7774,0,1,2,61,0,100,0,0,0,0,0,64,1,0,0,0,0,0,7,0,0,0,0,0,0,0,'Shay Leafrunner - On Quest Accept (Wondering Shay) - Store Target List'), +(7774,0,2,3,61,0,100,0,0,0,0,0,19,768,0,0,0,0,0,1,0,0,0,0,0,0,0,'Shay Leafrunner - On Quest Accept (Wondering Shay) - Set Unit Flags'), +(7774,0,3,4,61,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Shay Leafrunner - On Quest Accept (Wondering Shay) - Say Line 0'), +(7774,0,4,5,61,0,100,0,0,0,0,0,29,0,0,0,0,0,0,12,1,0,0,0,0,0,0,'Shay Leafrunner - On Quest Accept (Wondering Shay) - Follow Invoker'), +(7774,0,5,6,61,0,100,0,0,0,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Shay Leafrunner - On Quest Accept (Wondering Shay) - Set Phase 2'), +(7774,0,6,0,61,0,100,0,0,0,0,0,2,250,0,0,0,0,0,1,0,0,0,0,0,0,0,'Shay Leafrunner - On Quest Accept - Set Faction'), +(7774,0,7,0,7,0,100,0,0,0,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Shay Leafrunner - On Evade - Set Phase 2'), +(7774,0,8,0,6,0,100,0,0,0,0,0,6,2845,0,0,0,0,0,12,1,0,0,0,0,0,0,'Shay Leafrunner - On Death - Fail Quest'), +(7774,0,9,0,1,2,100,0,40000,70000,60000,70000,80,777400,0,0,0,0,0,1,0,0,0,0,0,0,0,'Shay Leafrunner - OOC (Phase 2) - Action list'), +(777400,9,0,0,0,0,100,0,0,0,0,0,46,25,0,0,0,0,0,1,0,0,0,0,0,0,0,'Shay Leafrunner - Action list - move forword'), +(777400,9,1,0,0,0,100,0,0,0,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Shay Leafrunner - Action list - Say Line 2'), +(777400,9,2,0,0,0,100,0,3000,3000,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Shay Leafrunner - Action list - Say Line 3'), +(777400,9,3,0,0,0,100,0,5000,5000,0,0,101,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Shay Leafrunner - Action list - Set home position'), +(777400,9,4,0,0,0,100,0,0,0,0,0,89,20,0,0,0,0,0,1,0,0,0,0,0,0,0,'Shay Leafrunner - Action list - Set Random Movement'), +(7774,0,10,11,8,2,100,0,11402,0,0,0,89,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Shay Leafrunner - On Spellhit (Shay''s Bell) - Turn Random Movement Off'), +(7774,0,11,12,61,2,100,0,0,0,0,0,29,0,0,0,0,0,0,12,1,0,0,0,0,0,0,'Shay Leafrunner - On Spellhit (Shay''s Bell) - Follow Invoker'), +(7774,0,12,0,61,2,100,0,0,0,0,0,1,1,0,0,0,0,0,12,1,0,0,0,0,0,0,'Shay Leafrunner - On Spellhit (Shay''s Bell) - Say Line 1'), +(7774,0,13,14,75,2,100,1,0,7765,10,0,1,4,5000,0,0,0,0,1,0,0,0,0,0,0,0,'Shay Leafrunner - On Rockbiter within 10 yards - Say Line 4'), +(7774,0,14,15,61,2,100,0,0,0,0,0,103,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Shay Leafrunner - On Rockbiter within 10 yards - Root'), +(7774,0,15,16,61,2,100,0,0,0,0,0,15,2845,0,0,0,0,0,12,1,0,0,0,0,0,0,'Shay Leafrunner - On Rockbiter within 10 yards - Call areaexploredoreventhappens'), +(7774,0,16,0,61,2,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Shay Leafrunner - On Rockbiter within 10 yards - Set Phase 1'), +(7774,0,17,18,52,0,100,0,4,7774,0,0,1,0,0,0,0,0,0,19,7765,0,0,0,0,0,0,'Shay Leafrunner - On Text Over Line 4 - Say Line 0 on Rockbiter'), +(7774,0,18,0,61,0,100,0,4,7774,0,0,41,10000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Shay Leafrunner - On Text Over Line 4 - Despawn after 10 seconds'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=11402; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1, 11402, 0, 0, 31, 0, 3, 7774, 0, 0, 0, 0, '', 'Shays Bell targets Shay Leafrunner'); + +DELETE FROM `creature_text` WHERE `entry`IN(7774,7765); +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(7774, 0, 0, 'Don''t forget to get my bell out of the chest here. And remember, if do happen to wander off, just ring it and i''ll find you again.', 12, 0, 100, 0, 0, 0, 3921, 0, 'Shay Leafrunner'), +(7774, 1, 0, 'This is quite an adventure!', 12, 0, 100, 0, 0, 0, 3914, 0, 'Shay Leafrunner'), +(7774, 1, 1, 'Oh, I wandered off again. I''m sorry.', 12, 0, 100, 0, 0, 0, 3913, 0, 'Shay Leafrunner'), +(7774, 1, 2, 'The bell again, such a sweet sound.', 12, 0, 100, 0, 0, 0, 3916, 0, 'Shay Leafrunner'), +(7774, 1, 3, 'I can''t help it, really. This is just such a beautiful place.', 12, 0, 100, 0, 0, 0, 3915, 0, 'Shay Leafrunner'), +(7774, 2, 0, '%s begins to wander off.', 16, 0, 100, 0, 0, 0, 3918, 0, 'Shay Leafrunner'), +(7774, 3, 0, 'Are we taking the scenic route?', 12, 0, 100, 0, 0, 0, 3912, 0, 'Shay Leafrunner'), +(7774, 3, 1, 'Oh, what a beautiful flower over there.', 12, 0, 100, 0, 0, 0, 3907, 0, 'Shay Leafrunner'), +(7774, 3, 2, 'These trees are quite glorious, aren''t they? ', 12, 0, 100, 0, 0, 0, 3908, 0, 'Shay Leafrunner'), +(7774, 3, 3, 'Are you sure this is the right way? Maybe we should go this way instead...', 12, 0, 100, 0, 0, 0, 3909, 0, 'Shay Leafrunner'), +(7774, 4, 0, 'Oh, here you are, Rockbiter! I''m sorry, I know I''m not supposed to wander off.', 12, 0, 100, 0, 0, 0, 3917, 0, 'Shay Leafrunner'), +(7765, 0, 0, 'I''m glad yer back, Shay. Please, don''t ever run off like that again! What would i tell yer parents if I lost ya?"', 12, 0, 100, 0, 0, 0, 3922, 0, 'Shay Leafrunner'); diff --git a/sql/updates/world/2015_08_02_01_world.sql b/sql/updates/world/2015_08_02_01_world.sql new file mode 100644 index 00000000000..a1790f3af6a --- /dev/null +++ b/sql/updates/world/2015_08_02_01_world.sql @@ -0,0 +1,5 @@ +-- +DELETE FROM `spell_script_names` WHERE `spell_id` IN (56654, 58882); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(56654, 'spell_hun_rapid_recuperation'), +(58882, 'spell_hun_rapid_recuperation'); diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBot.cpp b/src/server/game/AuctionHouseBot/AuctionHouseBot.cpp index c0c753100bc..c905ccedf2d 100644 --- a/src/server/game/AuctionHouseBot/AuctionHouseBot.cpp +++ b/src/server/game/AuctionHouseBot/AuctionHouseBot.cpp @@ -97,6 +97,11 @@ void AuctionBotConfig::SetConfig(AuctionBotConfigBoolValues index, char const* f SetConfig(index, sConfigMgr->GetBoolDefault(fieldname, defvalue)); } +void AuctionBotConfig::SetConfig(AuctionBotConfigFloatValues index, char const* fieldname, float defvalue) +{ + SetConfig(index, sConfigMgr->GetFloatDefault(fieldname, defvalue)); +} + //Get AuctionHousebot configuration file void AuctionBotConfig::GetConfigFromFile() { @@ -111,6 +116,8 @@ void AuctionBotConfig::GetConfigFromFile() SetConfig(CONFIG_AHBOT_BUYER_HORDE_ENABLED, "AuctionHouseBot.Buyer.Horde.Enabled", false); SetConfig(CONFIG_AHBOT_BUYER_NEUTRAL_ENABLED, "AuctionHouseBot.Buyer.Neutral.Enabled", false); + SetConfig(CONFIG_AHBOT_BUYER_CHANCE_FACTOR, "AuctionHouseBot.Buyer.ChanceFactor", 2.0f); + SetConfig(CONFIG_AHBOT_ITEMS_VENDOR, "AuctionHouseBot.Items.Vendor", false); SetConfig(CONFIG_AHBOT_ITEMS_LOOT, "AuctionHouseBot.Items.Loot", true); SetConfig(CONFIG_AHBOT_ITEMS_MISC, "AuctionHouseBot.Items.Misc", false); diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBot.h b/src/server/game/AuctionHouseBot/AuctionHouseBot.h index d7570c37d44..225d3b7ee25 100644 --- a/src/server/game/AuctionHouseBot/AuctionHouseBot.h +++ b/src/server/game/AuctionHouseBot/AuctionHouseBot.h @@ -174,6 +174,12 @@ enum AuctionBotConfigBoolValues CONFIG_UINT32_AHBOT_BOOL_COUNT }; +enum AuctionBotConfigFloatValues +{ + CONFIG_AHBOT_BUYER_CHANCE_FACTOR, + CONFIG_AHBOT_FLOAT_COUNT +}; + // All basic config data used by other AHBot classes for self-configure. class AuctionBotConfig { @@ -196,8 +202,10 @@ public: uint32 GetConfig(AuctionBotConfigUInt32Values index) const { return _configUint32Values[index]; } bool GetConfig(AuctionBotConfigBoolValues index) const { return _configBoolValues[index]; } + float GetConfig(AuctionBotConfigFloatValues index) const { return _configFloatValues[index]; } void SetConfig(AuctionBotConfigBoolValues index, bool value) { _configBoolValues[index] = value; } void SetConfig(AuctionBotConfigUInt32Values index, uint32 value) { _configUint32Values[index] = value; } + void SetConfig(AuctionBotConfigFloatValues index, float value) { _configFloatValues[index] = value; } uint32 GetConfigItemAmountRatio(AuctionHouseType houseType) const; bool GetConfigBuyerEnabled(AuctionHouseType houseType) const; @@ -217,6 +225,7 @@ private: uint32 _configUint32Values[CONFIG_UINT32_AHBOT_UINT32_COUNT]; bool _configBoolValues[CONFIG_UINT32_AHBOT_BOOL_COUNT]; + float _configFloatValues[CONFIG_AHBOT_FLOAT_COUNT]; void SetAHBotIncludes(const std::string& AHBotIncludes) { _AHBotIncludes = AHBotIncludes; } void SetAHBotExcludes(const std::string& AHBotExcludes) { _AHBotExcludes = AHBotExcludes; } @@ -225,6 +234,7 @@ private: void SetConfigMax(AuctionBotConfigUInt32Values index, char const* fieldname, uint32 defvalue, uint32 maxvalue); void SetConfigMinMax(AuctionBotConfigUInt32Values index, char const* fieldname, uint32 defvalue, uint32 minvalue, uint32 maxvalue); void SetConfig(AuctionBotConfigBoolValues index, char const* fieldname, bool defvalue); + void SetConfig(AuctionBotConfigFloatValues index, char const* fieldname, float defvalue); void GetConfigFromFile(); }; diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp b/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp index 64463948574..1838c28de0f 100644 --- a/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp +++ b/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp @@ -157,18 +157,18 @@ bool AuctionBotBuyer::RollBuyChance(const BuyerItemInfo* ahInfo, const Item* ite if (!auction->buyout) return false; - uint32 itemBuyPrice = auction->buyout / item->GetCount(); - uint32 itemPrice = item->GetTemplate()->SellPrice ? item->GetTemplate()->SellPrice : GetVendorPrice(item->GetTemplate()->Quality); + float itemBuyPrice = float(auction->buyout / item->GetCount()); + float itemPrice = float(item->GetTemplate()->SellPrice ? item->GetTemplate()->SellPrice : GetVendorPrice(item->GetTemplate()->Quality)); // The AH cut needs to be added to the price, but we dont want a 100% chance to buy if the price is exactly AH default itemPrice *= 1.4f; // This value is between 0 and 100 and is used directly as the chance to buy or bid // Value equal or above 100 means 100% chance and value below 0 means 0% chance - float chance = 100 / sqrt(itemBuyPrice / float(itemPrice)); + float chance = std::min(100.f, std::pow(100.f, 1.f + (1.f - itemBuyPrice / itemPrice) / sAuctionBotConfig->GetConfig(CONFIG_AHBOT_BUYER_CHANCE_FACTOR))); // If a player has bidded on item, have fifth of normal chance if (auction->bidder) - chance = chance / 5; + chance = chance / 5.f; if (ahInfo) { @@ -178,31 +178,29 @@ bool AuctionBotBuyer::RollBuyChance(const BuyerItemInfo* ahInfo, const Item* ite // If there are more than 5 items on AH of this entry, try weigh in the average buyout price if (ahInfo->BuyItemCount > 5) - { - chance *= 1 / sqrt(itemBuyPrice / avgBuyPrice); - } + chance *= 1.f / std::sqrt(itemBuyPrice / avgBuyPrice); } // Add config weigh in for quality chance *= GetChanceMultiplier(item->GetTemplate()->Quality) / 100.0f; - float rand = frand(0, 100); + float rand = frand(0.f, 100.f); bool win = rand <= chance; - TC_LOG_DEBUG("ahbot", "AHBot: %s BUY! chance = %.2f, price = %u, buyprice = %u.", win ? "WIN" : "LOSE", chance, itemPrice, itemBuyPrice); + TC_LOG_DEBUG("ahbot", "AHBot: %s BUY! chance = %.2f, price = %u, buyprice = %u.", win ? "WIN" : "LOSE", chance, uint32(itemPrice), uint32(itemBuyPrice)); return win; } // ahInfo can be NULL bool AuctionBotBuyer::RollBidChance(const BuyerItemInfo* ahInfo, const Item* item, const AuctionEntry* auction, uint32 bidPrice) { - uint32 itemBidPrice = bidPrice / item->GetCount(); - uint32 itemPrice = item->GetTemplate()->SellPrice ? item->GetTemplate()->SellPrice : GetVendorPrice(item->GetTemplate()->Quality); + float itemBidPrice = float(bidPrice / item->GetCount()); + float itemPrice = float(item->GetTemplate()->SellPrice ? item->GetTemplate()->SellPrice : GetVendorPrice(item->GetTemplate()->Quality)); // The AH cut needs to be added to the price, but we dont want a 100% chance to buy if the price is exactly AH default itemPrice *= 1.4f; // This value is between 0 and 100 and is used directly as the chance to buy or bid // Value equal or above 100 means 100% chance and value below 0 means 0% chance - float chance = 100 / sqrt(itemBidPrice / float(itemPrice)); + float chance = std::min(100.f, std::pow(100.f, 1.f + (1.f - itemBidPrice / itemPrice) / sAuctionBotConfig->GetConfig(CONFIG_AHBOT_BUYER_CHANCE_FACTOR))); if (ahInfo) { @@ -211,22 +209,19 @@ bool AuctionBotBuyer::RollBidChance(const BuyerItemInfo* ahInfo, const Item* ite TC_LOG_DEBUG("ahbot", "AHBot: Bid average: %.1f biddable item count: %u", avgBidPrice, ahInfo->BidItemCount); // If there are more than 5 items on AH of this entry, try weigh in the average bid price - if (ahInfo->BidItemCount >= 5) - { - chance *= 1 / sqrt(itemBidPrice / avgBidPrice); - } + chance *= 1.f / std::sqrt(itemBidPrice / avgBidPrice); } // If a player has bidded on item, have fifth of normal chance if (auction->bidder) - chance = chance / 5; + chance = chance / 5.f; // Add config weigh in for quality chance *= GetChanceMultiplier(item->GetTemplate()->Quality) / 100.0f; - float rand = frand(0, 100); + float rand = frand(0.f, 100.f); bool win = rand <= chance; - TC_LOG_DEBUG("ahbot", "AHBot: %s BID! chance = %.2f, price = %u, bidprice = %u.", win ? "WIN" : "LOSE", chance, itemPrice, itemBidPrice); + TC_LOG_DEBUG("ahbot", "AHBot: %s BID! chance = %.2f, price = %u, bidprice = %u.", win ? "WIN" : "LOSE", chance, uint32(itemPrice), uint32(itemBidPrice)); return win; } diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index bf34a1cb894..4badfc71ef1 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3212,6 +3212,11 @@ void SpellMgr::LoadSpellInfoCorrections() // add corruption to affected spells spellInfo->Effects[EFFECT_1].SpellClassMask[0] |= 2; break; + case 49224: // Magic Suppression - DK + case 49610: // Magic Suppression - DK + case 49611: // Magic Suppression - DK + spellInfo->ProcCharges = 0; + break; case 37408: // Oscillation Field spellInfo->AttributesEx3 |= SPELL_ATTR3_STACK_FOR_DIFF_CASTERS; break; diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp index 0e243e035fa..cc214a481fe 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp @@ -150,13 +150,7 @@ enum Actions ACTION_MONITOR_CORPOREALITY = 3, // Orb Carrier - ACTION_SHOOT = 4, - - // Living Inferno - ACTION_SUMMON_LIVING_EMBERS = 5, - - // Meteor Flame - ACTION_SUMMON_FLAME = 6 + ACTION_SHOOT = 4 }; enum Phases @@ -1006,7 +1000,7 @@ class npc_meteor_strike_initial : public CreatureScript if (HalionAI* halionAI = CAST_AI(HalionAI, owner->AI())) { Position const* ownerPos = halionAI->GetMeteorStrikePosition(); - float randomAdjustment = frand(0.0f, static_cast(M_PI / 7.0f)); + float randomAdjustment = frand(0.0f, static_cast(M_PI / 5.0f)); float angle[4]; angle[0] = me->GetAngle(ownerPos); angle[1] = angle[0] + randomAdjustment; @@ -1090,7 +1084,7 @@ class npc_meteor_strike : public CreatureScript if (_events.ExecuteEvent() == EVENT_SPAWN_METEOR_FLAME) { - Position pos = me->GetNearPosition(5.0f, frand(0.0f, static_cast(M_PI / 8.0f))); + Position pos = me->GetNearPosition(5.0f, frand(-static_cast(M_PI / 6.0f), static_cast(M_PI / 6.0f))); if (Creature* flame = me->SummonCreature(NPC_METEOR_STRIKE_FLAME, pos, TEMPSUMMON_TIMED_DESPAWN, 25000)) flame->AI()->SetGUID(me->GetGUID()); } @@ -1150,8 +1144,7 @@ class npc_meteor_strike_flame : public CreatureScript if (meteorStrike->AI()->GetData(DATA_SPAWNED_FLAMES) > 5) return; - Position pos = me->GetNearPosition(5.0f, frand(0.0f, static_cast(M_PI / 8.0f))); - + Position pos = me->GetNearPosition(5.0f, frand(-static_cast(M_PI / 6.0f), static_cast(M_PI / 6.0f))); if (Creature* flame = me->SummonCreature(NPC_METEOR_STRIKE_FLAME, pos, TEMPSUMMON_TIMED_DESPAWN, 25000)) flame->AI()->SetGUID(_rootOwnerGuid); } @@ -1358,7 +1351,7 @@ class go_twilight_portal : public GameObjectScript _spellId = gameobject->GetGOInfo()->goober.spellId; break; case GO_HALION_PORTAL_1: - case GO_HALION_PORTAL_2: // Not used, not seen in sniffs. Just in case. + case GO_HALION_PORTAL_2: gameobject->SetPhaseMask(0x1, true); /// Because WDB template has non-existent spell ID, not seen in sniffs either, meh _spellId = SPELL_TWILIGHT_REALM; diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index ae9501b1737..882d0fdaea0 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -697,6 +697,45 @@ class spell_hun_rapid_recuperation : public SpellScriptLoader } }; +// 56654, 58882 - Rapid Recuperation +class spell_hun_rapid_recuperation : public SpellScriptLoader +{ + public: + spell_hun_rapid_recuperation() : SpellScriptLoader("spell_hun_rapid_recuperation") { } + + class spell_hun_rapid_recuperation_AuraScript : public AuraScript + { + PrepareAuraScript(spell_hun_rapid_recuperation_AuraScript); + + bool Validate(SpellInfo const* spellInfo) override + { + if (!sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_0].TriggerSpell)) + return false; + return true; + } + + void HandlePeriodic(AuraEffect const* aurEff) + { + PreventDefaultAction(); + + Unit* target = GetTarget(); + uint32 mana = CalculatePct(target->GetMaxPower(POWER_MANA), aurEff->GetAmount()); + + target->CastCustomSpell(GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, SPELLVALUE_BASE_POINT0, int32(mana), target, true, nullptr, aurEff); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_hun_rapid_recuperation_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_hun_rapid_recuperation_AuraScript(); + } +}; + // 23989 - Readiness class spell_hun_readiness : public SpellScriptLoader { @@ -1095,6 +1134,7 @@ void AddSC_hunter_spell_scripts() new spell_hun_pet_carrion_feeder(); new spell_hun_pet_heart_of_the_phoenix(); new spell_hun_rapid_recuperation(); + new spell_hun_rapid_recuperation(); new spell_hun_readiness(); new spell_hun_ready_set_aim(); new spell_hun_scatter_shot(); diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index bfc8407a9ee..02bada6db5d 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -3085,6 +3085,13 @@ AuctionHouseBot.Buyer.Alliance.Enabled = 0 AuctionHouseBot.Buyer.Horde.Enabled = 0 AuctionHouseBot.Buyer.Neutral.Enabled = 0 +# AuctionHouseBot.Buyer.ChanceFactor +# Description: k value in the formula used for the chance to buy an item "100^(1 + (1 - (AuctionBid / ItemPrice)) / k)" +# It must be a decimal number in the range of (0, +infinity). The higher the number the higher chance to buy overpriced auctions +# Default: 2 + +AuctionHouseBot.Buyer.ChanceFactor = 2 + # # AuctionHouseBot.Buyer.Baseprice.QUALITY # Description: Base sellprices in copper for non priced items for each quality.