mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-19 17:38:26 +00:00
Implemented event type "EVENT_ENVIRONMENTAL_DAMAGE"
- This event triggers when taking any sort of environmental damage. Example use:
sub EVENT_ENVIRONMENTAL_DAMAGE{
quest::debug("EVENT_ENVIRONMENTAL_DAMAGE");
quest::debug("env_damage is " . $env_damage);
quest::debug("env_damage_type is " . $env_damage_type);
quest::debug("env_final_damage is " . $env_final_damage);
}
Result: (Test falling in Velks): http://i.imgur.com/tPRL7yL.png
This commit is contained in:
@@ -5541,6 +5541,12 @@ void Client::Handle_OP_EnvDamage(const EQApplicationPacket *app)
|
||||
}
|
||||
else{
|
||||
SetHP(GetHP() - (damage * RuleR(Character, EnvironmentDamageMulipliter)));
|
||||
|
||||
/* EVENT_ENVIRONMENTAL_DAMAGE */
|
||||
int final_damage = (damage * RuleR(Character, EnvironmentDamageMulipliter));
|
||||
char buf[24];
|
||||
snprintf(buf, 23, "%u %u %i", ed->damage, ed->dmgtype, final_damage);
|
||||
parse->EventPlayer(EVENT_ENVIRONMENTAL_DAMAGE, this, buf, 0);
|
||||
}
|
||||
|
||||
if (GetHP() <= 0) {
|
||||
|
||||
Reference in New Issue
Block a user