Jump to content

[latest] More or less correct Sacrifice, Consume Shadows (maybe other) autocast fix


Alex

Recommended Posts

What does this patch do:

1. Fixes spells that must not be autocastable for pets, like Sacrifice. Maybe some others, do not know.

2. Also may fix the same for tamed/charmed creatures, but not sure because I do not know any spells that must be fixed.

3. Not autocastable spells are properly displayed in the client action bar: without yellow corner triangles. Autocast toggle is disabled by client too.

4. Does not allow load or otherwise add passive/not autocastable spells with ACT_DISABLED/ACT_ENABLED states, replaces by ACT_PASSIVE

List of pet spells that are undergoing autocastable check (warlock pet spells selected by flags): http://pastebin.ca/1429765

List of pet spells that will not be autocastable is here (selected by new flag found): http://pastebin.ca/1429767

These lists are auto-generated based on flag used.

What revision is it for: tested on [7940]

Some background information:

There is two warlock pet spells known to me that are not autocastable: Sacrifice and Consume Shadows (both are Voidwalker spells). Analyzing a set of spells from spell.dbc I have found a flag that is common for these spells and absent from another warlock pet spells. It is flag 17 (20000h) in AttributesEx. Combined with spell family and family flags, it yields excellent results.

The check function IsPetAutoCastableSpell may be easily extended to disable autocast for more pet spells in the same way.

Short about chages:

1. Constant SPELL_ATTR_EX_UNK17 is renamed SPELL_ATTR_EX_PET_NOT_AUTOCASTABLE

2. Function IsPetAutoCastableSpell(uint32 spellId) is added to SpellMgr.cpp

3. Added family selection masks SPELLFAMILYFLAG_WARLOCK_PET_SPELLS and SPELLFAMILYFLAG_WARLOCK_PET_SPELLS2 to SpellMgr.h

4. Checks in Pet.cpp are fixed to set not autocastable spells type to ACT_PASSIVE, it is the correct value to send to client to disable these 'corners' and autocast toggle feature

5. The same is done in Unit.cpp

Patch (version 4):

Get the patch code here: http://pastebin.ca/1444524

Link to comment
Share on other sites

got this problem:

/home/cyrex/warlock.patch:10: trailing whitespace.

newspell.active = IsPetAutoCastableSpell(spell_id) ? ACT_DISABLED : ACT_PASSIVE;

/home/cyrex/warlock.patch:14: trailing whitespace.

{

/home/cyrex/warlock.patch:15: trailing whitespace.

if (((active != ACT_DISABLED) && (active != ACT_ENABLED)) ||

/home/cyrex/warlock.patch:16: trailing whitespace.

IsPetAutoCastableSpell(spell_id))

/home/cyrex/warlock.patch:17: trailing whitespace.

newspell.active = active;

error: patch failed: src/game/Pet.cpp:1339

error: src/game/Pet.cpp: patch does not apply

error: patch failed: src/game/SharedDefines.h:259

error: src/game/SharedDefines.h: patch does not apply

error: patch failed: src/game/SpellMgr.cpp:98

error: src/game/SpellMgr.cpp: patch does not apply

error: patch failed: src/game/SpellMgr.h:148

error: src/game/SpellMgr.h: patch does not apply

error: patch failed: src/game/Unit.cpp:10385

error: src/game/Unit.cpp: patch does not apply

Link to comment
Share on other sites

I found a mechanism to properly detect warlock pet spells, currently analyzing what I have, then will update patch with a correct method of detecting all warlock spells and selecting (not-)autocastable from them.

The patch is semantically correct, it may be applied even now. Only the IsPetAutoCastableSpell will be changing from now on.

2cyrex: what software are you using to apply the patch?

Link to comment
Share on other sites

Update

Latest (and probably last) version of the patch. More correctly select spells for autocast flag check using family ID.

List of pet spells that are undergoing autocastable check (warlock pet spells selected by flags): http://pastebin.ca/1429765

List of pet spells that will not be autocastable is here (selected by new flag found): http://pastebin.ca/1429767

These lists are auto-generated based on flags used.

The check function IsPetAutoCastableSpell may be easily extended to disable autocast for more pet spells in the same way.

Overall changes list:

1. Constant SPELL_ATTR_EX_UNK17 is renamed SPELL_ATTR_EX_PET_NOT_AUTOCASTABLE

2. Function IsPetAutoCastableSpell(uint32 spellId) is added to SpellMgr.cpp

3. Added family selection masks SPELLFAMILYFLAG_WARLOCK_PET_SPELLS and SPELLFAMILYFLAG_WARLOCK_PET_SPELLS2 to SpellMgr.h

4. Checks in Pet.cpp are fixed to set not autocastable spells type to ACT_PASSIVE, it is the correct value to send to client to disable these 'corners' and autocast toggle feature

5. The same is done in Unit.cpp

Get the patch code here: http://pastebin.ca/1429788

First post also updated.

The patch is ready and will be updated only if some error is found.

Link to comment
Share on other sites

I use GNU patch to apply, but create patches using GIT.

Tried GIT apply with the latest one. Works ok. If it's not the case for you, well... maybe our GIT versions are mismatched or pastebin is fiddling with the patch somehow.

Link to comment
Share on other sites

Any news about Hunter's pet similars spells?

Yes, please someone that plays hunter tell us how it works, i never played it myself so i can't help here :(

Do hunter pets have non-autocastable spells that can be autocasted though?

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use