mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 03:31:08 +00:00
[API] Perl functions to set invulnerable to and modify environmental damage. (#2044)
* invulnerable * modifier * fix * fix * fix * [API] Perl functions to set invulnerable to and modify environmental damage. * [API] Perl and Lua functions to set invulnerable to and modify environmental damage. credit to kinglykrab for lua
This commit is contained in:
@@ -5784,6 +5784,11 @@ void Client::Handle_OP_EnvDamage(const EQApplicationPacket *app)
|
||||
|
||||
EnvDamage2_Struct* ed = (EnvDamage2_Struct*)app->pBuffer;
|
||||
auto damage = ed->damage;
|
||||
|
||||
if (GetEnvironmentDamageModifier()) {
|
||||
damage = static_cast<int32>(damage) + (static_cast<int32>(damage) * GetEnvironmentDamageModifier() / 100);
|
||||
}
|
||||
|
||||
if (ed->dmgtype == EQ::constants::EnvironmentalDamage::Falling) {
|
||||
uint32 mod = spellbonuses.ReduceFallDamage + itembonuses.ReduceFallDamage + aabonuses.ReduceFallDamage;
|
||||
damage -= damage * mod / 100;
|
||||
@@ -5817,6 +5822,10 @@ void Client::Handle_OP_EnvDamage(const EQApplicationPacket *app)
|
||||
);
|
||||
SetHP(GetHP() - 1);//needed or else the client wont acknowledge
|
||||
return;
|
||||
}
|
||||
else if (GetInvulnerableEnvironmentDamage()) {
|
||||
SetHP(GetHP() - 1);
|
||||
return;
|
||||
} else if (zone->GetZoneID() == Zones::TUTORIAL || zone->GetZoneID() == Zones::LOAD) { // Hard coded tutorial and load zones for no fall damage
|
||||
return;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user