[DiscordArchive] I patched `Unit:CastSpell()` as follows:
[DiscordArchive] I patched `Unit:CastSpell()` as follows:
Archived author: tomato • Posted: 2024-01-25T11:42:26.439000+00:00
Original source
Yeah, that exactly - basically directly use `triggerFlags`, without setting `TRIGGERED_FULL_MASK`
Archived author: Honey • Posted: 2024-01-25T11:43:46.552000+00:00
Original source
I have a vague feeling the answer involves packets. <:kneecap:1142939447567069184>
Archived author: Foe • Posted: 2024-01-25T11:44:04.735000+00:00
Original source
Then the core side call needs to be changed to allow you to pass through flags
Archived author: Foe • Posted: 2024-01-25T11:44:10.893000+00:00
Original source
And a 4th variable
Archived author: Honey • Posted: 2024-01-25T11:44:35.409000+00:00
Original source
Optional 4th variable it is
Archived author: tomato • Posted: 2024-01-25T11:45:13.768000+00:00
Original source
Yeah, I've done that:
```diff
diff --git a/src/LuaEngine/UnitMethods.h b/src/LuaEngine/UnitMethods.h
index 50e467b..4e06c03 100644
--- a/src/LuaEngine/UnitMethods.h
+++ b/src/LuaEngine/UnitMethods.h
@@ -7,6 +7,8 @@
#ifndef UNITMETHODS_H
#define UNITMETHODS_H
+#include <SpellDefines.h>
+
/***
* Inherits all methods from: [Object], [WorldObject]
*/
@@ -2199,11 +2201,12 @@ namespace LuaUnit
Unit* target = Eluna::CHECKOBJ<Unit>(L, 2, false);
uint32 spell = Eluna::CHECKVAL<uint32>(L, 3);
bool triggered = Eluna::CHECKVAL<bool>(L, 4, false);
+ TriggerCastFlags triggerFlags = (TriggerCastFlags)Eluna::CHECKVAL<uint32>(L, 5, triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE); // TODO: terrible cast
SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(spell);
if (!spellEntry)
return 0;
-
- unit->CastSpell(target, spell, triggered);
+
+ unit->CastSpell(target, spell, triggerFlags);
return 0;
}
```
but `Spell::SendSpellStart()` has a check if any flags in `triggerFlags` are set, and sets `CAST_FLAG_PENDING` if so, suppressing both cast bar and cast start event
Archived author: Foe • Posted: 2024-01-25T11:47:03.063000+00:00
Original source
Core side changes it is then