Exemplo n.º 1
0
        // Someone killed me
        private void OnDeathPayload(DeathPayload payload)
        {
            Zoned.Broadcast(new ServerMobPlayAnimationPacket(Zoned.Id, AnimationType.Dead, "dying", 1));

            //Attributes[AttributeName.Dead] = 1;

            var killer = payload.Killer;

            KillPayload killPayload = new KillPayload(payload, this, payload.Power);
            killer.SendMessage(killPayload);

            Zoned.World.GameObjects.Remove(this.GameObject);
        }
Exemplo n.º 2
0
        // Someone hit me
        private void OnHitPayload(HitPayload payload)
        {
            var attacker = payload.Attacker;

            float totalDamage = 0;
            foreach (var damageEntry in payload.AttackPayload.DamageEntries)
            {
                var damage = _random.Next((int)damageEntry.MinDamage, (int)(damageEntry.MinDamage + damageEntry.DeltaDamage));

                //TODO: damage reduction

                totalDamage += damage;
            }

            // if damage = 0
            // parry/immune

            //if dodgechange < random
            // dodge

            //else

            Attributes[AttributeId.Hitpoints] = Math.Max(0, Attributes[AttributeId.Hitpoints] - (int)totalDamage);

            Zoned.Broadcast(new ServerFloatingNumberPacket(Zoned.Id, (int)totalDamage, FloatingNumberType.Damage));

            if (Attributes[AttributeId.Hitpoints] == 0)
            {
                DeathPayload deathPayload = new DeathPayload(payload, this, payload.Power);

                SendMessage(deathPayload);
            }
            else
            {
                // We could play hit animation here if we had one
            }
        }
Exemplo n.º 3
0
 public KillPayload(DeathPayload deathPayload, Combatant victim, Power power)
 {
     this.DeathPayload = deathPayload;
     this.Victim = victim;
     this.Power = power;
 }
Exemplo n.º 4
0
 private void OnMobDeath(DeathPayload payload)
 {
     this._spawnCount--;
 }