123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- using CommonAI.Data;
- using CommonAI.Zone;
- using CommonAI.Zone.Helper;
- using CommonAI.Zone.Instance;
- using CommonLang;
- using System;
- using System.Collections.Generic;
- using XmdsCommon.Plugin;
- using XmdsCommonServer.Plugin;
- using XmdsCommonServer.Plugin.XmdsSkillTemplate.Skills;
- using XmdsCommonServer.XLS.Data;
- using XmdsCommonSkill.Plugin.Buffs;
- using XmdsCommonSkill.Plugin.Interface;
- using XmdsCommonSkill.Plugin.PassiveSkills.Magic;
- using static CommonAI.Zone.Instance.InstanceUnit;
- using static XmdsCommonSkill.Plugin.Buffs.XmdsBuff_SwordShadow;
- using static XmdsCommonSkill.Plugin.Interface.ComSpellTemplate;
- using static XmdsCommonSkill.Plugin.Skills.XmdsSummonBase;
- namespace XmdsCommonSkill.Plugin.Skills.Magic
- {
- /// <summary>
- /// 一个AOE技能,释放机制为:每过一段时间指定的小怪从地图的几个位置刷出,向boss位置进发。当有一个抵达boss周围小范围内,杀死这些小怪。
- /// boss就会释放此aoe技能(伤害+控制)。指定小怪出现的时候boss会冒气泡提示。此小怪有血量,死亡时会释放自爆法术
- /// </summary>
- public class Skill_910190 : XmdsSummonBase_ActiveSkill
- {
- public static readonly int ID = 910190;
- public override int SkillID { get { return ID; } }
- private static readonly int Buff_ID = (int)XmdsBuffBase.XmdsBuffList.COM_SLIENT;
- public static XmdsSkillValue dmg; // 伤害
- public static XmdsSkillValue lockTime; // 沉默时间
- private XmdsVirtual mOwner;
- protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
- {
- // Buff修改
- var pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID);
- var bt = pack.mBuffTemplate;
- bt.LifeTimeMS = lockTime.GetValue();
- bt.IsHarmful = true;
- pack.BindTemplateAndDispose();
- unit.RegistSendBuff(bt);
- //单位攻击监听
- this.mOwner = unit;
- unit.RegistLaunchSkillOver(OnLaunchSkillOver, info);
- }
- private int OnLaunchSkillOver(GameSkill info, XmdsCommonServer.Plugin.XmdsVirtual attacker, CommonAI.Zone.Instance.InstanceUnit.SkillState state)
- {
- base.summonModule.SummonUnit(attacker);
- return 0;
- }
- //刷新
- protected override void OnUpdate(int intervalMS, bool slowRefresh)
- {
- this.refreshSummonUnit(slowRefresh);
- }
- protected override void OnSkillDamagePerEvent(BattleParams param)
- {
- param.SkillDamagePer = dmg.GetValue();
- }
- protected override void OnSkillLogicEvent(BattleParams param)
- {
- param.Hitter.mUnit.AddBuff(Buff_ID, param.Attacker.mUnit);
- }
- // 处理特殊机制
- private void refreshSummonUnit(bool slowRefresh)
- {
- XmdsVirtual_Monster masterMonster = this.mOwner as XmdsVirtual_Monster;
- List<XmdsVirtual> summonList = masterMonster.GetSummonUnits();
- if(summonList == null || summonList.Count <= 0)
- {
- return;
- }
- for(int i = 0; i < summonList.Count; i++)
- {
- InstanceUnit unit = summonList[i].mUnit;
- if(unit.Info.ID != base.mSummonID)
- {
- continue;
- }
- if (slowRefresh && CMath.getDistance(unit.X, unit.Y, this.mOwner.mUnit.X, this.mOwner.mUnit.Y) <= 0.3f)
- {
- //杀死所有召唤物
- masterMonster.CleanSummonList();
- //释放特殊法术
- InstanceUnit bossUnit = masterMonster.mUnit;
- LaunchSpell spell = ComSpellTemplate.Instance().GetSpellByID(XmdsSpellID.DUNGEON_DEADSPELL);
- bossUnit.Parent.unitLaunchSpell(XmdsSkillType.none, bossUnit, spell, bossUnit.X, bossUnit.Y);
- break;
- }
- unit.startMoveTo(this.mOwner.mUnit.X, this.mOwner.mUnit.Y);
- }
- }
- protected override void OnInitConfig()
- {
- XmdsSkillData data = base.InitSummonConfig(SummonType.MoveToMaster);
- InitData(data, out dmg, XmdsSkillData.XmdsSkillDataKey.ValueSet4);
- InitData(data, out lockTime, XmdsSkillData.XmdsSkillDataKey.ValueSet5);
- }
- }
- }
|