|
@@ -1081,26 +1081,29 @@ namespace CommonAI.Zone.Instance
|
|
|
|
|
|
if (hp < 0)
|
|
if (hp < 0)
|
|
{
|
|
{
|
|
-
|
|
+
|
|
- int finalHP = hp;
|
|
+ hp = attacker.Virtual.DispatchAddOtherHPEvent(hp, this, source);
|
|
- attacker.Virtual.DispatchAddOtherHPEvent(-hp, this, out finalHP);
|
|
|
|
- hp = -finalHP;
|
|
|
|
|
|
|
|
-
|
|
+
|
|
if (attacker.IsPlayer && this.IsPet && attacker.Virtual.GetUnitPro() == XmdsUnitPro.Priest)
|
|
if (attacker.IsPlayer && this.IsPet && attacker.Virtual.GetUnitPro() == XmdsUnitPro.Priest)
|
|
{
|
|
{
|
|
hp = (int)(hp * XmdsConstConfig.PET_HEALD_RATIO);
|
|
hp = (int)(hp * XmdsConstConfig.PET_HEALD_RATIO);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- else if (this.IsPlayer && attacker.IsMonster)
|
|
+ else
|
|
{
|
|
{
|
|
-
|
|
+
|
|
- InstanceUnit petUnit = this.Virtual.GetPetUnit();
|
|
+ hp = this.Virtual.DispatchAddOtherHPEvent(hp, attacker, source);
|
|
- if (petUnit != null)
|
|
+ if (this.IsPlayer && attacker.IsMonster)
|
|
{
|
|
{
|
|
- int petShareDmg = Math.Max(1, (int)(hp * XmdsConstConfig.PET_SHARE_MASTERDMG_RATIO));
|
|
+
|
|
- hp = Math.Max(1, hp - petShareDmg);
|
|
+ InstanceUnit petUnit = this.Virtual.GetPetUnit();
|
|
- petUnit.PetShareDamage(petShareDmg, this);
|
|
+ if (petUnit != null)
|
|
|
|
+ {
|
|
|
|
+ int petShareDmg = Math.Max(1, (int)(hp * XmdsConstConfig.PET_SHARE_MASTERDMG_RATIO));
|
|
|
|
+ hp = Math.Max(1, hp - petShareDmg);
|
|
|
|
+ petUnit.PetShareDamage(petShareDmg, this);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1116,13 +1119,21 @@ namespace CommonAI.Zone.Instance
|
|
hitMessage = new UnitHitEvent();
|
|
hitMessage = new UnitHitEvent();
|
|
}
|
|
}
|
|
hitMessage.object_id = this.ID;
|
|
hitMessage.object_id = this.ID;
|
|
|
|
+
|
|
hitMessage.senderId = attacker == null ? 0 : attacker.ID;
|
|
hitMessage.senderId = attacker == null ? 0 : attacker.ID;
|
|
|
|
+
|
|
hitMessage.senderMasterId = attacker == null ? 0 : attacker.Virtual.GetMasterID();
|
|
hitMessage.senderMasterId = attacker == null ? 0 : attacker.Virtual.GetMasterID();
|
|
|
|
+
|
|
hitMessage.hitMasterId = this.Virtual.GetMasterID();
|
|
hitMessage.hitMasterId = this.Virtual.GetMasterID();
|
|
|
|
+
|
|
hitMessage.hp = hp;
|
|
hitMessage.hp = hp;
|
|
|
|
+
|
|
hitMessage.isSpecialHit = dmgSrc != DamageSource.Def;
|
|
hitMessage.isSpecialHit = dmgSrc != DamageSource.Def;
|
|
|
|
+
|
|
hitMessage.dmgSrc = dmgSrc;
|
|
hitMessage.dmgSrc = dmgSrc;
|
|
|
|
+
|
|
hitMessage.isDead = IsDead();
|
|
hitMessage.isDead = IsDead();
|
|
|
|
+
|
|
queueEvent(hitMessage);
|
|
queueEvent(hitMessage);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1495,7 +1506,7 @@ namespace CommonAI.Zone.Instance
|
|
public bool LaunchSetDirection;
|
|
public bool LaunchSetDirection;
|
|
public float direction;
|
|
public float direction;
|
|
public bool IsAutoLaunch;
|
|
public bool IsAutoLaunch;
|
|
- public bool IsInGuard;
|
|
+ public bool IsInGuard;
|
|
|
|
|
|
public LaunchSkillParam(uint targetUnitID = 0, Vector2 target_pos = null, bool autoFocusNearTarget = false,
|
|
public LaunchSkillParam(uint targetUnitID = 0, Vector2 target_pos = null, bool autoFocusNearTarget = false,
|
|
bool LaunchSetDirection = false, float direction = 0, bool IsAutoLaunch = false, bool IsInGuard = false)
|
|
bool LaunchSetDirection = false, float direction = 0, bool IsAutoLaunch = false, bool IsInGuard = false)
|