-
Notifications
You must be signed in to change notification settings - Fork 59
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
base: 3.3.5-cfpve
Are you sure you want to change the base?
added cfpve.cpp #143
Conversation
Note to self: create a branch and change target branch |
Sorry for my ignorance but im not sure what your saying hahaah |
Is the original faction ever restored ? |
It doesnt... I forgot about that meh |
imho this must be merged into main project. |
#include "ScriptMgr.h" enum MiscCrossFactionPVE class CfPlayerScript : public PlayerScript
private:
}; void AddSC_cfpve() |
added faction reset
This is the best I can do for now, if someone wants to help i will accept it, just trying to contribute the best I can, I have added the function to reset faction |
CfPlayerScript() : PlayerScript("CfPlayerScript") {} | ||
|
||
// Called when a player enters the world (logs in or teleports) | ||
void OnLogin(Player* player, bool firstLogin) override |
There was a problem hiding this comment.
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 */
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
You added the same file twice. |
|
||
private: | ||
// Store the original faction in a map | ||
std::unordered_map<uint64, uint32> originalFactionMap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This container is not thread-safe and I'm pretty sure OnUpdateZone() can be called by multiple maps at the same time, meaning it will cause race conditions.
Guys, seeing that it has BG areas such as Warsong Gulch and Arathi Basin, would this be suitable for a Crossfaction Battlegrounds? |
You can simply just do this to restore to player's original faction without storing it You also need to consider pet's faction
If I were you, I will use GetTeamIdInInstance() to play with faction setup instead |
Target Branch(es):
335
Issues Addressed:
This update addresses issues related to PVE content when cross-faction configurations are enabled. Specifically, it resolves problems encountered when cross-faction groups participate in dungeons or raids with faction-specific mechanics or creature flags.
Example: In the Icecrown Citadel (ICC) raid, the first player to enter the raid determines the faction alignment for the raid. This can lead to complications such as:
The Gunship Battle becoming problematic, as the enemy faction won't be able to use the cannons.
Mobs that should be friendly becoming enemies and vice versa.
This script ensures that all players have a hidden faction mask that matches the raid leader’s faction. This change prevents faction-related issues during PVE encounters. The script can be extended to handle additional PVE encounters or battlegrounds, which is useful if using NPC bots.
Tests Performed:
The script has been tested and functions as intended.