1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- using CommonAI.Zone;
- using CommonAI.Zone.Helper;
- using CommonAI.Zone.Instance;
- using XmdsCommon.Plugin;
- using XmdsCommonServer.Plugin;
- using XmdsCommonServer.XLS.Data;
- using XmdsCommonSkill.Plugin.Buffs;
- using static CommonAI.Zone.Instance.InstanceUnit;
- namespace XmdsCommonSkill.Plugin.Skills.PetSkill
- {
- /// <summary>
- /// 宠物 - 免疫(无敌3秒,期间不能操作,无法移动,cd50秒)
- /// </summary>
- public class PetGiveSkill_920120 : PetGiveSkillBase
- {
- private static readonly int ID = 920120;
- public static readonly int Buff_ID = (int)XmdsBuffBase.XmdsBuffList.PET_WUDI;
- /// 伤害倍数.
- public static XmdsSkillValue valueSet1; //无敌时间
- //人物的技能,释放是,宠物释放的技能特效
- private static int BindPetSkillID = 0;
- public override int SkillID {get{return ID;}}
- protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
- {
- XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID);
- //加攻
- var buff = pack.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.Invincible) as XmdsBuff_Invincible;
- buff.isCanMove = false;
- var bt1 = pack.mBuffTemplate;
- bt1.LifeTimeMS = valueSet1.GetValue(info.SkillLevel);
- bt1.IsHarmful = false;
- pack.BindTemplateAndDispose();
- unit.RegistSendBuff(bt1);
- unit.RegistTriggerPetSkillEvent(OnTriggerPetSkill, info);
- }
- protected override void OnSkillDataChange(GameSkill gs, XmdsVirtual unit)
- {
- base.OnSkillDataChange(gs, unit);
- var bt = unit.GetRegistBuff(Buff_ID);
- bt.LifeTimeMS = valueSet1.GetValue(gs.SkillLevel);
- }
- private bool OnTriggerPetSkill(GameSkill info, ref InstanceUnit.SkillState skill, XmdsVirtual launcher, ref InstanceUnit.LaunchSkillParam param)
- {
- launcher.mUnit.AddBuff(Buff_ID, launcher.mUnit);
- //玩家释放技能
- base.PlayerLauncherSkillOver(launcher);
- return true;
- }
- protected void initSkillInfo(int skillId, ref int BindPetSkillID)
- {
- XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(skillId);
- InitData(data, out valueSet1, XmdsSkillData.XmdsSkillDataKey.ValueSet);
- //初始化人物释放技能时,宠物播放的技能特效
- initBindSkill(data, ref BindPetSkillID);;
- }
- protected override void OnInitSkillParam()
- {
- initSkillInfo(ID, ref BindPetSkillID);
- }
- protected override int GetBindSkillID()
- {
- return BindPetSkillID;
- }
- }
- }
|