[Quest API] (Performance) Check event exists before export and execute EVENT_GROUP_CHANGE (#2884)

* [Quest API] Optionally parse EVENT_GROUP_CHANGE

# Notes
- Optionally parse this event instead of always doing so.

* Update embparser.cpp
This commit is contained in:
Alex King 2023-02-12 22:56:25 -05:00 committed by GitHub
parent f9a87e26c9
commit 0e51131d67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 11 deletions

View File

@ -1746,7 +1746,6 @@ void PerlembParser::ExportEventVariables(
break; break;
} }
case EVENT_SPELL_EFFECT_BUFF_TIC_BOT: case EVENT_SPELL_EFFECT_BUFF_TIC_BOT:
case EVENT_SPELL_EFFECT_BUFF_TIC_CLIENT: case EVENT_SPELL_EFFECT_BUFF_TIC_CLIENT:
case EVENT_SPELL_EFFECT_BUFF_TIC_NPC: case EVENT_SPELL_EFFECT_BUFF_TIC_NPC:

View File

@ -5355,33 +5355,36 @@ int16 Mob::GetCritDmgMod(uint16 skill, Mob* owner)
void Mob::SetGrouped(bool v) void Mob::SetGrouped(bool v)
{ {
if(v) if (v) {
{
israidgrouped = false; israidgrouped = false;
} }
isgrouped = v; isgrouped = v;
if(IsClient()) if (IsClient()) {
{ if (parse->PlayerHasQuestSub(EVENT_GROUP_CHANGE)) {
parse->EventPlayer(EVENT_GROUP_CHANGE, CastToClient(), "", 0); parse->EventPlayer(EVENT_GROUP_CHANGE, CastToClient(), "", 0);
}
if(!v) if (!v) {
CastToClient()->RemoveGroupXTargets(); CastToClient()->RemoveGroupXTargets();
} }
}
} }
void Mob::SetRaidGrouped(bool v) void Mob::SetRaidGrouped(bool v)
{ {
if(v) if (v) {
{
isgrouped = false; isgrouped = false;
} }
israidgrouped = v; israidgrouped = v;
if(IsClient()) if (IsClient()) {
{ if (parse->PlayerHasQuestSub(EVENT_GROUP_CHANGE)) {
parse->EventPlayer(EVENT_GROUP_CHANGE, CastToClient(), "", 0); parse->EventPlayer(EVENT_GROUP_CHANGE, CastToClient(), "", 0);
} }
}
} }
int Mob::GetCriticalChanceBonus(uint16 skill) int Mob::GetCriticalChanceBonus(uint16 skill)