Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added cfpve.cpp #143

Open
wants to merge 157 commits into
base: 3.3.5-cfpve
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
157 commits
Select commit Hold shift + click to select a range
c2b4831
added cfpve.cpp
Sep 14, 2024
235c7d7
Add files via upload
urwifemykids Sep 14, 2024
e49135c
Add files via upload
urwifemykids Sep 14, 2024
c5c4755
Update cfpve.cpp
urwifemykids Sep 14, 2024
16996b1
Merge branch 'TrinityCore:3.3.5' into cfpve
urwifemykids Sep 16, 2024
4d2ca87
Add files via upload
urwifemykids Sep 16, 2024
1559872
Core/Maps: Do not allow entering an instance if the player is not ali…
Jildor Sep 23, 2024
b18ba61
DB: Remove unsigned floats and recreate views with utf8mb4 in auth da…
Shauren Sep 26, 2024
c5663d5
DB/Misc: Fix Alliance GY when dying in Thunder Bluff
Aokromes Sep 29, 2024
0a059c7
DB/Conditions: Fix The Aldor and Scryers flightmasters reputation req…
Aokromes Sep 29, 2024
cf74c2a
Core/Units: Fixed crashes in Unit::GetDebugInfo if called in the dest…
Shauren Sep 30, 2024
fd85a71
Core/Objects: Corrected TYPEMASK_SEER value incorrectly changed in 0d…
Shauren Sep 30, 2024
03333b1
DB/Loot: Fix thorium ore prospection sometimes resulting in 0 items
Aokromes Oct 2, 2024
3acb25c
Core/Players: Prevent creation of characters with duplicate names
Shauren Oct 3, 2024
4d083b0
Replace wotlk_classic with cata_classic in build status badges in REA…
CraftedRO Oct 4, 2024
262a1e5
Core/Objects: Move personal summon handling from TemporarySummon/Game…
matanshukry Mar 14, 2021
cb9b34d
Core/Objects: Refactor private object checks into separate function
Shauren Mar 28, 2021
b502bc4
Core/Objects: Pass privateObjectOwner guid directly to SummonCreature…
Shauren Mar 28, 2021
762a32c
Core/Object: Implement FindNearestCreatureWithAura (#28410)
Nyr97 Oct 30, 2022
da73672
Core/Objects: Implement FindNearestCreatureWithOptions helper functio…
Seyden Dec 26, 2022
78fe841
Core/Creatures: Implement StringId for Creatures, a custom identifier…
Seyden Dec 27, 2022
b10823f
Core/Creatures: Fix logic when searching for nearby creatures by Stri…
Odyssey Jan 9, 2023
36bd2df
Core/Objects: Unify WorldObjectSearcher classes into one common imple…
Shauren May 28, 2023
d019719
Core/Objects: Unify GameObjectSearcher, UnitSearcher, CreatureSearche…
Shauren May 28, 2023
1f6a6d2
Core/GameObjects: Added stringid to gameobjects
Shauren Jul 30, 2023
6e64548
Core/Objects: Added GameObject type parameter to FindGameObjectOption…
Golrag Oct 8, 2023
d900e0e
Core/Entities: Added GetStringId helper methods
mdX7 Apr 9, 2024
ed41672
Core/Entities: Update StringId assignment to use StringIdType
mdX7 Apr 9, 2024
d98bb5f
Core/Entities: nopch build fix
mdX7 Apr 9, 2024
5655aa4
Core/Entities: Added possibility to inherit StringIds from other enti…
mdX7 Apr 10, 2024
ae6b9bd
Core/Entities: Fixed m_stringIds[0] invalidation when reloading creat…
Shauren Apr 10, 2024
515294f
Player/Emotes: Fix infinite dance and read map animation
Dekadencee Sep 6, 2014
2c0ebbe
Core/Players: Allow delayed teleports to be executed even when not al…
Jildor Oct 5, 2024
5a29762
Scripts/Spells: Implement Titanium Seal of Dalaran (#30291)
Odyssey Oct 6, 2024
4e70960
DB/Loot: Proper loot for starting zone battered chest
Aokromes Oct 7, 2024
af1f9c1
DB/Creature: Add waypoints to Harb Foulmountain
Aokromes Oct 7, 2024
ff29701
Core/Objects: Switch to using designated initializers instead of chai…
Shauren Jul 29, 2023
e3daa2b
Core/Objects: Fixed uninitialized variables in FindCreatureOptions
Shauren May 22, 2023
57c1726
DB/Gameobject: Add 4 missing gameobjects in Thunderbluff
Aokromes Oct 10, 2024
d225b66
DB/Creature: Add waypoints to Greater Firebird
Aokromes Oct 10, 2024
b2f3a7b
DB/Creature: Add waypoints to Murderous Blisterpaw
Aokromes Oct 10, 2024
2dc584c
DB/Creature: Add waypoints to Rex Ashil
Aokromes Oct 10, 2024
492a33f
DB/Creature: Add waypoints to Alshirr Banebreath
Aokromes Oct 10, 2024
cfaf559
DB/Creature: Add waypoints to Foulmane
Aokromes Oct 10, 2024
e5981cb
DB/Creature: Add waypoints to Vile Sting
Aokromes Oct 10, 2024
275436e
DB/Creature: Add waypoints to Treebole
Aokromes Oct 10, 2024
b347cb2
DB/Creature: Add waypoints to Zora
Aokromes Oct 10, 2024
ed4d14e
DB/Creature: Add waypoints to Tideress
Aokromes Oct 10, 2024
d699b50
DB/Creature: Add waypoints to Archmage Xylem
Aokromes Oct 10, 2024
c3bbade
DB/Creature: Replace wrong fixed orientation value with default NULL
Aokromes Oct 10, 2024
1afeabf
DB/Gameobject: All missing Battered chest from starting zones with po…
Aokromes Oct 10, 2024
97111be
DB/Gameobject: Missing Battered Chest, Ghostlands GO 2849
Aokromes Oct 10, 2024
e0009a9
DB/Spell: Update Portals to Blasted Lands spell target position
Aokromes Oct 10, 2024
88b1d9d
Scripts/CoS: Do not permabind players upon completing Mal'Ganis encou…
Jildor Oct 11, 2024
1b0f54c
DB/Loot: Sunstrider Isle loot fixup
Aokromes Oct 11, 2024
23cd7c2
DB/Creature: Noarm shoud roam
Aokromes Oct 11, 2024
86bf4fe
DB/Creature: Add missing rare The Behemoth
Aokromes Oct 17, 2024
c03d302
DB/Gameobject: Add missing Battered Chest with pooling, Ghostlands GO…
Aokromes Oct 20, 2024
9db32d3
DB/Gameobject: Add missing Large Battered Chest and pool, Ghostlands …
Aokromes Oct 20, 2024
a0756e5
DB/Gameobject: Azuremyst Isle Missing Tattered Chest
Aokromes Oct 20, 2024
48b8d47
DB/Gameobject Add missing Battered Chest ID: 106318 to Mulgore with p…
Aokromes Oct 20, 2024
134033a
DB/Gameobject: Add missing Battered Chest ID: 106318 to Teldrassil wi…
Aokromes Oct 20, 2024
15ce7d0
DB/Gameobject: Bloodmyst Isle Missing Tattered Chest
Aokromes Oct 20, 2024
d82ff21
DB/Gameobject: Eversong Woods Missing Tattered Chest
Aokromes Oct 20, 2024
2baecc5
DB/Gameobject: The World Tree and the Emerald Dream book update
Aokromes Oct 23, 2024
e61ad33
DB/Creature: Felpaw Village, Felwood Deadwood furbog respawning
Aokromes Oct 23, 2024
5da8e80
DB/Misc: Restore data deleted by mistake
Aokromes Oct 24, 2024
113f31d
DB/Creature: Jadefire Run, Felwood Respawn Jadefire Tricksters, Betra…
Aokromes Oct 24, 2024
df17886
DB/Creature: Remove one Stormwind guard incorrect pathing
Aokromes Oct 26, 2024
90db558
Core/Objects: Eliminate unneccessary temporary objects and double map…
Shauren Oct 27, 2024
d95cf74
Core/PacketIO: Skip sending empty SMSG_UPDATE_OBJECT for transports o…
Shauren Oct 29, 2024
e19d590
DB/Creature: Fix incorrect OptionBroadcastTextID for hunter gossip_me…
Aokromes Oct 29, 2024
6180393
DB/Creature: Fix incorrect OptionBroadcastTextID for hunter gossip_me…
Aokromes Oct 29, 2024
5b631c5
DB/Quest: City of Light updates
Aokromes Nov 1, 2024
189bfec
DB/Quest: ObjectiveText locale esES and esMX missing text
Aokromes Nov 1, 2024
32bfd07
DB/Condition: Load Into Catapult and Throw Passenger
Aokromes Nov 3, 2024
98cd499
DB/Creature: Icecrown - Ymirheim Updates
Aokromes Nov 5, 2024
6dd142d
DB/Trainer: Correct ReqLevel for Darnassus and Thunder Bluff spells
Aokromes Nov 5, 2024
dfb7f06
DB/Misc: Fix startup errors from Issue
Aokromes Nov 5, 2024
f1c2c97
DB/Creature: Add some missing emotes to Birgitte Cranston
Aokromes Nov 7, 2024
586c8a8
DB/Quest: Adjust minimum reputation value required for 'A Special Tha…
Aokromes Nov 7, 2024
c7a0218
DB/Quest: Add few missing queststarters
Aokromes Nov 8, 2024
b537773
DB/CreatureTexts: Add proper texts for Rivendark, Furywing, Insidion …
Aokromes Nov 10, 2024
a377ce2
DB/Creature: Add sniffed waypoints for Hildana Deathstealer for Ymirh…
Aokromes Nov 10, 2024
2c30abf
DB/Gameobject: Culling of Stratholme Love is in the Air spawns
Aokromes Nov 12, 2024
df9b09c
DB/Gameobject: Borean Tundra missing Brewfest spawns
Aokromes Nov 12, 2024
1a578fa
DB/Gameobject: Wintergrasp missing Brewfest spawns
Aokromes Nov 12, 2024
6457918
DB/Gameobject: StormPeaks Missing Brewfest spawns
Aokromes Nov 12, 2024
e762eb2
typo fix
Aokromes Nov 12, 2024
52c73f9
typo fix 2
Aokromes Nov 12, 2024
c7fdf58
DB/Gameobject: Sholazar Basin missing Brewfest spawns
Aokromes Nov 12, 2024
dd7ee3c
DB/SAI: Add missing spell to Ravenous Windroc
Aokromes Nov 12, 2024
3618839
DB/Gameobject: Dragonblight Missing Brewfest spawns
Aokromes Nov 12, 2024
9883014
DB/Gameobject; Zul'Drak missing Brewfest spawns
Aokromes Nov 12, 2024
dd27398
DB/Gameobject: Grizzly Hills Missing Brewfest spawns
Aokromes Nov 12, 2024
8405a61
DB/Gameobject: Howling Fjord: Missing Brewfest spawns
Aokromes Nov 12, 2024
12b07e0
DB/Gameobject: Shadowmoon Valley Missing Brewfest spawns
Aokromes Nov 13, 2024
a72de0c
DB/Quest: Update Cloth Scavenging Completion (RewardText)
Aokromes Nov 14, 2024
3c9bf7b
DB/Creature: Update Monte Muzzleshot
Aokromes Nov 14, 2024
b6bb35b
Core/Spells: Allow persistent area auras to apply all of their effect…
CraftedRO Nov 15, 2024
a81e7b2
Scripts/PitOfSaron: Update Ick's reaction state during Explosive Barr…
Jildor Nov 16, 2024
b0ca98f
Scripts/ForgeOfSouls: Ensure that Bronjahm teleport is executed when …
Jildor Nov 16, 2024
32b54ff
Core/Spells: Don't treat pets as permanently crowd controlled
Shauren Nov 16, 2024
cf27f1c
DB/Creature: Update a Firemane Flamecaller spawn position
Aokromes Nov 18, 2024
225a1bb
Core/Vmaps: Fix inconsistency of hitInstance and hitModel to cause wr…
mdX7 Dec 29, 2022
b4d6ca2
Core/vmaps: Removed vmap lookup functions duplicating functionality o…
Shauren Nov 19, 2024
5eed750
Core/vmaps: Improved WMO detection for group models that don't have f…
Shauren Nov 19, 2024
ab8c1d6
DB/Creature: Aldor Neophyte at Aldor Rise shoud only be draenei
Aokromes Nov 20, 2024
a93b115
DB/Skills: Death Knights shoud start with Journeyman Riding (150)
Aokromes Nov 20, 2024
c6fb439
Core/Unit: Fix DualWield Off-hand hit penalty (#30444)
CraftedRO Nov 20, 2024
b747124
DB/Creature: Fix people still on combat after killing tyrannus
Aokromes Nov 22, 2024
c354f25
TDB 335.24111 - 2024/11/22
Nov 22, 2024
31f5866
DB/Misc: Fix Alliance GY when dying in Ironforge
Aokromes Nov 23, 2024
c0d8dba
Core/Vmaps: Don't ignore model rotation when calculating liquid level
Shauren Nov 28, 2024
65e2474
Core/Players: Add separate config option for starting money for Death…
heyitsbench Nov 29, 2024
2433148
Core/Spells: Fixed item level requirements for enchanting spells
Shauren Dec 5, 2024
8eab9cb
DB/Gameobject: Blades Edge Mountains Missing Brewfest spawns
Aokromes Dec 5, 2024
0c2d2fe
DB/Gameobject: Zangarmarsh missing Brewfest spawns
Aokromes Dec 5, 2024
4e09333
DB/Gameobject: Nagrand missing Brewfest spawns
Aokromes Dec 5, 2024
b7bbc42
DB/Creature: Update Draenei Youngling PvPFlags
CraftedRO Dec 5, 2024
fdd42c7
Scripts/AzuremystIsle: Set correct PvP flags for Draenei Survivor (#3…
danielfinke Dec 5, 2024
21a4acf
DB/Creatures: Add missing PvPFlags to many creatures
Shauren Dec 6, 2024
0ae1433
DB/Creature: Buzzard
Aokromes Dec 15, 2024
9d5fce4
DB/Creature: Update Gates of Ironforge Spirit Healer coordinates
Aokromes Dec 16, 2024
586386d
DB/Creature: Update two Shattered Sun Marksman SheathState
Aokromes Dec 16, 2024
1ecd085
DB/Gameobject: Culling of Stratholme Hallow's End spawns
Aokromes Dec 17, 2024
6385b32
DB/Gameobject: Culling of Stratholme Feast of Winter Veil spawns
Aokromes Dec 17, 2024
0803ce1
DB/Hallow's End: Wickerman Festival updates
Aokromes Dec 17, 2024
36503a9
DB/Gameobject: Crystalsong Forest Love is in the Air spawns
Aokromes Dec 17, 2024
4956c91
DB/Gameobject: Dragonblight Love is in the Air spawns
Aokromes Dec 17, 2024
896e8c9
DB/Gameobject: Icecrown Love is in the Air spawns
Aokromes Dec 17, 2024
4f4159a
DB/Gameobject: The Stockade Love is in the Air spawns
Aokromes Dec 17, 2024
e393f72
DB/Gameobject: Borean Tundra Love is in the Air spawns
Aokromes Dec 17, 2024
dd99638
DB/Gameobject: Howling Fjord Love is in the Air spawns
Aokromes Dec 17, 2024
1adf9e8
DB/Gameobject: Blackrock Depths Love is in the Air spawns
Aokromes Dec 17, 2024
2a090ab
DB/Gameobject: Blackrock Depths Midsummer Fire Festival spawns
Aokromes Dec 17, 2024
72f1489
DB/Gameobject: Blackrock Depths Feast of Winter Veil spawns
Aokromes Dec 17, 2024
7f5790d
DB/Creature: Fix a dberror
Aokromes Dec 21, 2024
ae1f80c
Core/Time: Fixed WowTime operator<=>
Shauren Jan 6, 2025
4bec944
Core/Spells: DynamicObject auras will now use the largest radius foun…
Shauren Jan 13, 2025
41e48ff
Core/Battlegrounds: Remove temporary currency bonus auras before rewa…
Shocker Nov 26, 2011
e492944
Core/Misc: Reduce code differences between branches
Shauren Feb 1, 2025
ba0ed27
Core/Spells: add name for cast_flag_unknown_2 to cast_flag_has_trajec…
Star-lion Aug 6, 2012
8268ab3
DB/Schema: Change basehp/mana/armor in creature_classlevelstatus to u…
DDuarte Aug 6, 2012
7782a17
DB/Quest: Move Priest Garments quest series from c++ to database (#30…
CraftedRO Feb 2, 2025
00875fe
Core/Misc: Reduce code differences between branches
Shauren Feb 2, 2025
01132b1
Core/Misc: Reduce code differences between branches
Shauren Feb 3, 2025
0011c11
Core/Items: Destroy only one item from stack when inserting a gem, no…
Shauren Aug 20, 2012
5a0a660
DB/Schema: Increase size of quest_template.RequiredRaces to mediumint
DDuarte Aug 20, 2012
8b1d6f9
DB/Quest: Warlock quest "The Binding"
Aokromes Feb 5, 2025
61819f2
Core/Misc: Reduce differences between branches and fix data sent in S…
Shauren Feb 5, 2025
f8847aa
DB/Creature: Fix Witherheart the Stalker equipment
Aokromes Feb 6, 2025
b4adab5
DB/Creature: Add waypoints to Mirelow
Aokromes Feb 6, 2025
de9340c
Core/Battlegrounds: Port BattlegroundQueueTypeId changes from master …
Shauren Feb 8, 2025
8565ba9
Core/PacketIO: Converted BattlegroundPackets to classes
Shauren Feb 9, 2025
a5d4c46
Fix build with libstdc++-11
Shauren Feb 9, 2025
2346bfb
Merge branch 'TrinityCore:3.3.5' into cfpve
urwifemykids Feb 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions src/server/scripts/Custom/cfpve.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/


#include "ScriptMgr.h"
#include "Player.h"
#include "Group.h"
#include "ObjectAccessor.h"

enum MiscCrossFactionPVE
{
ZONE_ICECROWN_CITADEL = 4812,
ICC_MAP_ID = 631,
ZONE_TRIAL_OF_THE_CHAMPION = 4723,
TOCHAMPION_MAP_ID = 650,
ZONE_TRIAL_OF_THE_CRUSADER = 4722,
TOCRUSADER_MAP_ID = 649,
ZONE_PIT_OF_SARON = 4813,
POS_MAP_ID = 658,
ZONE_HALLS_OF_REFLECTION = 4820,
HOR_MAP_ID = 668,
ZONE_FORGE_OF_SOULS = 4809,
FOS_MAP_ID = 632,
ZONE_HALLS_OF_STONE = 4264,
HOS_MAP_ID = 599,
ZONE_THE_NEXUS = 4265,
TN_MAP_ID = 576,
ZONE_WARSONG_GULCH = 3277,
WSG_MAP_ID = 489,
ZONE_ARATHI_BASIN = 3358,
AB_MAP_ID = 529
};

class CfPlayerScript : public PlayerScript
{
public:
CfPlayerScript() : PlayerScript("CfPlayerScript") {}

// Called when a player enters the world (logs in or teleports)
void OnLogin(Player* player, bool firstLogin) override
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change bool firstlogin to bool /* firstlogin */

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

{
HandleFactionChange(player, player->GetMapId());
}

// Called when a player changes zones
void OnUpdateZone(Player* player, uint32 newZone, uint32 /*newArea*/) override
{
HandleFactionChange(player, newZone);
}

private:
// Store the original faction in a map
std::unordered_map<uint64, uint32> originalFactionMap;

void HandleFactionChange(Player* player, uint32 zoneOrMapId)
{
static const std::set<uint32> zoneSet = {
ICC_MAP_ID, TOCHAMPION_MAP_ID, TOCRUSADER_MAP_ID, POS_MAP_ID,
HOR_MAP_ID, FOS_MAP_ID, HOS_MAP_ID, TN_MAP_ID, WSG_MAP_ID, AB_MAP_ID
};

if (zoneSet.count(zoneOrMapId))
{
// Change faction to match the group leader
if (Group* group = player->GetGroup())
{
if (Player* leader = ObjectAccessor::FindPlayer(group->GetLeaderGUID()))
{
if (originalFactionMap.find(player->GetGUID()) == originalFactionMap.end())
{
// Store the original faction
originalFactionMap[player->GetGUID()] = player->GetFaction();
}
player->SetFaction(leader->GetFaction());
}
}
}
else
{
// Restore player's original faction
auto it = originalFactionMap.find(player->GetGUID());
if (it != originalFactionMap.end())
{
player->SetFaction(it->second);
originalFactionMap.erase(it); // Clean up the map after restoring
}
}
}
};

void AddSC_cfpve()
{
new CfPlayerScript();
}
3 changes: 3 additions & 0 deletions src/server/scripts/Custom/custom_script_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@

// This is where scripts' loading functions should be declared:

void AddSC_cfpve();

// The name of this function should match:
// void Add${NameOfDirectory}Scripts()
void AddCustomScripts()
{
AddSC_cfpve();
}