mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-05-02 18:49:21 +02:00
implement absorbDrown damage properly on items
This commit is contained in:
parent
6fff6a868a
commit
9eca23b2e1
@ -24674,7 +24674,7 @@ TypeID = 5460
|
|||||||
Name = "a helmet of the deep"
|
Name = "a helmet of the deep"
|
||||||
Description = "Enables underwater exploration"
|
Description = "Enables underwater exploration"
|
||||||
Flags = {Take,Armor}
|
Flags = {Take,Armor}
|
||||||
Attributes = {Weight=21000,SlotType=HEAD,ArmorValue=2} # TODO: Drown protection!
|
Attributes = {Weight=21000,SlotType=HEAD,ArmorValue=2,AbsorbDrown=100}
|
||||||
|
|
||||||
TypeID = 5461
|
TypeID = 5461
|
||||||
Name = "pirate boots"
|
Name = "pirate boots"
|
||||||
|
@ -671,7 +671,7 @@
|
|||||||
<movevent event="AddItem" itemid="2151" function="onAddField" />
|
<movevent event="AddItem" itemid="2151" function="onAddField" />
|
||||||
|
|
||||||
<!-- Helmets -->
|
<!-- Helmets -->
|
||||||
<movevent event="Equip" itemid="5460" slot="head" function="onEquipItem" script="misc/helmet_of_the_deep.lua" />
|
<movevent event="Equip" itemid="5460" slot="head" function="onEquipItem" />
|
||||||
<movevent event="DeEquip" itemid="5460" slot="head" function="onDeEquipItem" />
|
<movevent event="DeEquip" itemid="5460" slot="head" function="onDeEquipItem" />
|
||||||
|
|
||||||
<!-- Boots -->
|
<!-- Boots -->
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
function onEquip(player, item, slot)
|
|
||||||
player:removeCondition(CONDITION_DROWN)
|
|
||||||
return true
|
|
||||||
end
|
|
@ -402,6 +402,8 @@ bool Items::loadItems()
|
|||||||
items[id].getAbilities().absorbPercent[combatTypeToIndex(COMBAT_FIREDAMAGE)] += script.readNumber();
|
items[id].getAbilities().absorbPercent[combatTypeToIndex(COMBAT_FIREDAMAGE)] += script.readNumber();
|
||||||
} else if (identifier == "absorbpoison") {
|
} else if (identifier == "absorbpoison") {
|
||||||
items[id].getAbilities().absorbPercent[combatTypeToIndex(COMBAT_EARTHDAMAGE)] += script.readNumber();
|
items[id].getAbilities().absorbPercent[combatTypeToIndex(COMBAT_EARTHDAMAGE)] += script.readNumber();
|
||||||
|
} else if (identifier == "absorbdrown") {
|
||||||
|
items[id].getAbilities().absorbPercent[combatTypeToIndex(COMBAT_DROWNDAMAGE)] += script.readNumber();
|
||||||
} else if (identifier == "absorblifedrain") {
|
} else if (identifier == "absorblifedrain") {
|
||||||
items[id].getAbilities().absorbPercent[combatTypeToIndex(COMBAT_LIFEDRAIN)] += script.readNumber();
|
items[id].getAbilities().absorbPercent[combatTypeToIndex(COMBAT_LIFEDRAIN)] += script.readNumber();
|
||||||
} else if (identifier == "absorbmanadrain") {
|
} else if (identifier == "absorbmanadrain") {
|
||||||
|
@ -646,6 +646,10 @@ uint32_t MoveEvent::EquipItem(MoveEvent* moveEvent, Player* player, Item* item,
|
|||||||
player->sendIcons();
|
player->sendIcons();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (it.abilities->absorbPercent[combatTypeToIndex(COMBAT_DROWNDAMAGE)] == 100) {
|
||||||
|
player->removeCondition(CONDITION_DROWN);
|
||||||
|
}
|
||||||
|
|
||||||
if (it.abilities->regeneration) {
|
if (it.abilities->regeneration) {
|
||||||
Condition* condition = Condition::createCondition(static_cast<ConditionId_t>(slot), CONDITION_REGENERATION, -1, 0);
|
Condition* condition = Condition::createCondition(static_cast<ConditionId_t>(slot), CONDITION_REGENERATION, -1, 0);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user