コード例 #1
0
 private void OnNpcDamageEvent(NpcDamageEvent Event)
 {
     if (Event.Master.ID == Master.ID)
     {
         AttackerNpc = NpcManager.FindNpc(Event.AttackerID);
     }
 }
コード例 #2
0
        protected override void OnTrigger()
        {
            var Master = NpcManager.FindNpc(TargetID_);

            if (Master == null || !Master.IsValid())
            {
                return;
            }

            if (MaxTriggerCount_ > 0 && CurTriggerCount_ >= MaxTriggerCount_)
            {
                return;
            }

            CurTriggerCount_++;
            Master.Data.Attr.ApplyModify(Modify_);
        }
コード例 #3
0
        private void OnNpcDamageEvent(NpcDamageEvent Event)
        {
            if (Event.Master.ID != Args_.Master.ID)
            {
                return;
            }

            var Attacker = NpcManager.FindNpc(Event.AttackerID);

            if (Attacker == null)
            {
                return;
            }

            var Level = Args_.Master.Skill.GetSkillLevel(Args_.Skill.SkillID);

            Attacker.OnHitDamage(Args_.Master, Args_.Skill.Name, Event.RealValue * Level * 0.5f);
        }
コード例 #4
0
        protected override void OnDetach()
        {
            if (!IsRefund_)
            {
                return;
            }

            var Master = NpcManager.FindNpc(TargetID_);

            if (Master == null || !Master.IsValid())
            {
                return;
            }

            for (var Index = 0; Index < CurTriggerCount_; ++Index)
            {
                Master.Data.Attr.RestoreModify(Modify_);
            }
        }