Jump to content

Help with the code to change the complexity of the raid


sania207

Recommended Posts

Hello, i was wondering if anyone can help me with code. 
You need a code to switch the complexity of the raid (normal/heroic/normal).

RunLuaCode ResetInstances();   -  not suitable for solving the problem.

Link to comment
Share on other sites

2 hours ago, sania207 said:

Although it is unclear, but thank you

 

It is code used in BFA interface (function seems changed since old game vesions) to change difficulty: https://github.com/tomrus88/BlizzardInterfaceCode/blob/ffbd8a3f993fb455aaff5726a8192b1a6d81f56c/Interface/FrameXML/UnitPopup.lua#L1885

For "DUNGEON_DIFFICULTY":

SetDungeonDifficultyID(difficultyID);

For "RAID_DIFFICULTY":

SetRaidDifficulties(true, difficultyID);

For "LEGACY_RAID_DIFFICULTY":

SetRaidDifficulties(false, difficultyID);

And diffultyID can be found here: https://github.com/tomrus88/BlizzardInterfaceCode/blob/ffbd8a3f993fb455aaff5726a8192b1a6d81f56c/Interface/FrameXML/UnitPopup.lua#L85

["DUNGEON_DIFFICULTY1"] > difficultyID = 1
["DUNGEON_DIFFICULTY2"] > difficultyID = 2
["DUNGEON_DIFFICULTY3"] > difficultyID = 23

["RAID_DIFFICULTY1"] > difficultyID = 14
["RAID_DIFFICULTY2"] > difficultyID = 15
["RAID_DIFFICULTY3"] > difficultyID = 16

["LEGACY_RAID_DIFFICULTY1"] > difficultyID = 3
["LEGACY_RAID_DIFFICULTY2"] > difficultyID = 4

IDs seems unchanged, you can use https://wowpedia.fandom.com/wiki/API_SetRaidDifficultyID

3 → 10 Player
4 → 25 Player
5 → 10 Player (Heroic)
6 → 25 Player (Heroic)
14 → Normal
15 → Heroic
16 → Mythic

 

Based on wow UI code you code should look like (to use heroic difficulty):

SetRaidDifficulties(true, 15);

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...