mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
Prevent Gate if near bind location (Rule) and Heal on Gate (Rule)
RULE_INT(NPC, NPCGatePercent, 5) // % at which the NPC Will attempt to gate at. RULE_BOOL(NPC, NPCGateNearBind, false) // Will NPC attempt to gate when near bind location? RULE_INT(NPC, NPCGateDistanceBind, 75) // Distance from bind before NPC will attempt to gate RULE_BOOL(NPC, NPCHealOnGate, true) // Will the NPC Heal on Gate. RULE_REAL(NPC, NPCHealOnGateAmount, 25) // How much the npc will heal on gate if enabled.
This commit is contained in:
@@ -717,6 +717,10 @@ void Client::GoToSafeCoords(uint16 zone_id, uint16 instance_id) {
|
||||
|
||||
void Mob::Gate(uint8 bindnum) {
|
||||
GoToBind(bindnum);
|
||||
if (RuleB(NPC, NPCHealOnGate) && this->IsNPC() && this->GetHPRatio() <= RuleR(NPC, NPCHealOnGateAmount)) {
|
||||
auto HealAmount = (RuleR(NPC, NPCHealOnGateAmount) / 100);
|
||||
SetHP(int(this->GetMaxHP() * HealAmount));
|
||||
}
|
||||
}
|
||||
|
||||
void Client::Gate(uint8 bindnum) {
|
||||
|
||||
Reference in New Issue
Block a user