mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-27 06:22:26 +00:00
[Quest API] (Performance) Check event EVENT_ENVIRONMENTAL_DAMAGE exists before export and execute (#2899)
* [Quest API] Optionally parse EVENT_ENVIRONMENTAL_DAMAGE # Notes - Optionally parses this event instead of always doing so. * Update client_packet.cpp
This commit is contained in:
parent
de047fb851
commit
0a7d482299
@ -6180,8 +6180,10 @@ void Client::Handle_OP_EnvDamage(const EQApplicationPacket *app)
|
|||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
SetHP(GetHP() - (damage * RuleR(Character, EnvironmentDamageMulipliter)));
|
SetHP(GetHP() - (damage * RuleR(Character, EnvironmentDamageMulipliter)));
|
||||||
|
|
||||||
|
if (parse->PlayerHasQuestSub(EVENT_ENVIRONMENTAL_DAMAGE)) {
|
||||||
int final_damage = (damage * RuleR(Character, EnvironmentDamageMulipliter));
|
int final_damage = (damage * RuleR(Character, EnvironmentDamageMulipliter));
|
||||||
std::string export_string = fmt::format(
|
const auto& export_string = fmt::format(
|
||||||
"{} {} {}",
|
"{} {} {}",
|
||||||
ed->damage,
|
ed->damage,
|
||||||
ed->dmgtype,
|
ed->dmgtype,
|
||||||
@ -6189,6 +6191,7 @@ void Client::Handle_OP_EnvDamage(const EQApplicationPacket *app)
|
|||||||
);
|
);
|
||||||
parse->EventPlayer(EVENT_ENVIRONMENTAL_DAMAGE, this, export_string, 0);
|
parse->EventPlayer(EVENT_ENVIRONMENTAL_DAMAGE, this, export_string, 0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (GetHP() <= 0) {
|
if (GetHP() <= 0) {
|
||||||
mod_client_death_env();
|
mod_client_death_env();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user