• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[SOLVED] remove a custom aura from bg

Status
Not open for further replies.

ricardodj

Member
hello, anyone know where or how i can remove a custom aura in bgs? because have example Voter buff scroll
i can disable the item to not be used in battleground but cant remove the aura when join in battleground if anyone have a idea to remove it in the db or with c++ please help me
 
Last edited:

Vitrex

Moderator
You can simply add custom script, inside of script simply check if players current map id equal to any battleground map iD. if yes simply unaura everything. but kinda weird, issue you have, since as far as i know all bufs must be disabled by default when you join BattleGround or Arena.
 

MrPixelMC

Member
as far as i know all bufs must be disabled by default when you join BattleGround or Arena.

You do not get buffs removed when joining a Battleground like WSG, you do get buffs removed when joining Arena though.

hello, anyone know where or how i can remove a custom aura in bgs? because have example Voter buff scroll
i can disable the item to not be used in battleground but cant remove the aura when join in battleground if anyone have a idea to remove it in the db or with c++ please help me

I personally would add an if check inside Battleground.cpp, around line 1049 inside Battleground::AddPlayer to remove the specific aura.
Or you can do what Vitrex said, creating a PlayerScript that uses OnZoneUpdate and checks if player is in Battleground.
 

Syphex

Exalted Member
Vitrex said they must be disabled by default not that they are disabled by default, two different things.
 

Vitrex

Moderator
You do not get buffs removed when joining a Battleground like WSG, you do get buffs removed when joining Arena though.



I personally would add an if check inside Battleground.cpp, around line 1049 inside Battleground::AddPlayer to remove the specific aura.
Or you can do what Vitrex said, creating a PlayerScript that uses OnZoneUpdate and checks if player is in Battleground.

Sorry used to Retail.
since 2016 they added change - so people wouldn't enter battlegrounds with temporary/one-time-only and similar buffs and be OP in battlegrounds.
But still in a lot of servers you got all buffs removed (in blizzlike ones). My bad here. Well how you said there is easy ways to do it.
 

darksoke

OnTop500
Code:
INSERT INTO `disables` VALUES (0, 48869, (1+16+32), "571,1", "1519", "Disable Bambina's Vengeance in map 1 and 571 and area 1519");

Now to explain a bit

1st field - SourceType = 0 -> Disable Spell
2nd field - Entry = 48869 -> Bambina's Vengeance Spell Id
3rd field - Flags = (1+16+32) -> 1 (Disable Spell For Players) + 16 (Disable spell on map id) + 32 (Disable spell on area)
*3rd field - Flags = (1+16) -> 1 (Disable Spell For Players) + 16 (Disable spell on map id)
4th field - Param_0 = "571,1" -> map ids 571,1 you can add more maps after ,
*5th field - Param_1 = "1519" -> area id required only if you choose a certain area note that the map is required if you also want the area
6th field - Comment = "" -> whatever you want to remember the code

If that doesn't work for you you can always count on c++
Code:
class player_restrictions : public PlayerScript
{
public:
	player_restrictions() : PlayerScript("player_restrictions") {}
	void OnMapChanged(Player* pPlayer) {
		if (pPlayer->GetMapId() == 489 ){
			if (pPlayer->HasAura(41924)){
				pPlayer->RemoveAura(41924);
				ChatHandler(pPlayer->GetSession()).PSendSysMessage("|cff00BFFFBattleground Restrictions:|r |cffFFFFFFOver powered buffs were removed from your buff list .|r");
			}
		}
	}
};
void AddSC_player_restrictions()
{
	new player_restrictions();
}
 
Last edited:

MrPixelMC

Member
Code:
INSERT INTO `disables` VALUES (0, 48869, (1+16+32), "571,1", "1519", "Disable Bambina's Vengeance in map 1 and 571 and area 1519");

Now to explain a bit

1st field - SourceType = 0 -> Disable Spell
2nd field - Entry = 48869 -> Bambina's Vengeance Spell Id
3rd field - Flags = (1+16+32) -> 1 (Disable Spell For Players) + 16 (Disable spell on map id) + 32 (Disable spell on area)
*3rd field - Flags = (1+16) -> 1 (Disable Spell For Players) + 16 (Disable spell on map id)
4th field - Param_0 = "571,1" -> map ids 571,1 you can add more maps after ,
*5th field - Param_1 = "1519" -> area id required only if you choose a certain area note that the map is required if you also want the area
6th field - Comment = "" -> whatever you want to remember the code

If that doesn't work for you you can always count on c++
Code:
class player_restrictions : public PlayerScript
{
public:
	player_restrictions() : PlayerScript("player_restrictions") {}
	void OnMapChanged(Player* pPlayer) {
		if (pPlayer->GetMapId() == 489 ){
			if (pPlayer->HasAura(41924)){
				pPlayer->RemoveAura(41924);
				ChatHandler(pPlayer->GetSession()).PSendSysMessage("|cff00BFFFBattleground Restrictions:|r |cffFFFFFFOver powered buffs were removed from your buff list .|r");
			}
		}
	}
};
void AddSC_player_restrictions()
{
	new player_restrictions();
}

Disables do not remove the aura from you when you enter the map with the disabled spell, it just doesn't allow you cast it.
Also, that script you sent isn't the best way to handle it (you're directly checking the ID of map, why not just use IsBattleground()?). The best way to handle it would be editing the Battleground.cpp file itself, I believe.
 

darksoke

OnTop500
Disables do not remove the aura from you when you enter the map with the disabled spell, it just doesn't allow you cast it.
Also, that script you sent isn't the best way to handle it (you're directly checking the ID of map, why not just use IsBattleground()?). The best way to handle it would be editing the Battleground.cpp file itself, I believe.

I wrote that from my mind and I just forgot the name of the function for is in battleground check but however what if you have and open area as pvp zone ? you can do 2 checks however I just specified 2 possible solutions.
 

MrPixelMC

Member
I wrote that from my mind and I just forgot the name of the function for is in battleground check but however what if you have and open area as pvp zone ? you can do 2 checks however I just specified 2 possible solutions.

While being a possible solution it is not the easiest/best way to handle what he is asking for. He specifically asked for a removal in BG, not in a certain area, so I gave my answer accordingly.
PS:


open area
You would use GetAreaId for that, not GetMapId, hehe.
 

darksoke

OnTop500
While being a possible solution it is not the easiest/best way to handle what he is asking for. He specifically asked for a removal in BG, not in a certain area, so I gave my answer accordingly.
PS:



You would use GetAreaId for that, not GetMapId, hehe.

I'm not trying to be rude but either way it work you could just suggest him the changes and not be an asshole. I know a lot about player scripts you could either use GetZoneID but once again I just gave a suggestion. Feel free to give him a working way to solve his problem but don't laugh on a working given one.

Ofc the script can be improved, put the restricted spells into an array , create an object map and check for exploits and so on but there we're talking about something else!
 

MrPixelMC

Member
I'm not trying to be rude but either way it work you could just suggest him the changes and not be an asshole. I know a lot about player scripts you could either use GetZoneID but once again I just gave a suggestion. Feel free to give him a working way to solve his problem but don't laugh on a working given one.

Ofc the script can be improved, put the restricted spells into an array , create an object map and check for exploits and so on but there we're talking about something else!

Uhm.. first of, I wasn't "laughing on a working given one", I wrote "hehe", dunno how that sounded to you but if I wanted to laugh I'd have wrote "lol" or something similar. It was only a "hehe" no other meaning.
Second, getZoneID != getAreaID and getMapId != getAreaId, those are all different things and I don't know why you're making it sound like it's the same thing. You can be in a certain map ID, with a certain area ID and a certain (can be different) zone ID. A zone is under an area and an area is under a map.

PS: You don't really need to check for anything, or create object maps or whatever, simply add an aura removal when joining, the disables DB table & TrinityCore handles the rest..


I know a lot about player scripts
This doesn't mean you can't be wrong so I don't really know why you're saying it..
 
Last edited:
Status
Not open for further replies.
Top