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 XmdsCommonSkill.Plugin.Interface; using static CommonAI.Zone.Instance.InstanceUnit; namespace XmdsCommonSkill.Plugin.Skills.PetSkill { /// /// 宠物 - 防御(提高5%防御和10%移动速度,持续3秒,cd50秒) /// public abstract class PetGiveSkillBase : XmdsSkillBase { protected void initBindSkill(XmdsSkillData data, ref int BindPetSkillID) { XmdsSkillValue skillInfo; InitData(data, out skillInfo, XmdsSkillData.XmdsSkillDataKey.DmgRate); BindPetSkillID = skillInfo.GetValue(); } protected void PlayerLauncherSkillOver(XmdsCommonServer.Plugin.XmdsVirtual launcher) { //如果释放单位是人物, 找他的宠物,并释放一个技能特效 XmdsVirtual_Player player = launcher as XmdsVirtual_Player; if (player != null && GetBindSkillID() > 0) { //人物释放技能时,宠物放特效 XmdsVirtual_Pet pet = player.GetPet(); if (pet != null) { pet.mUnit.launchSkill(GetBindSkillID(), new InstanceUnit.LaunchSkillParam()); } } } protected void PlayerLauncherSkillOverExt(XmdsCommonServer.Plugin.XmdsVirtual launcher, ComSpellTemplate.XmdsSpellID spellID) { LaunchSpell launchSpell = ComSpellTemplate.Instance().GetSpellByID(spellID); if(launchSpell != null) { //如果释放单位是人物, 找他的宠物,并释放一个技能特效 launcher.mUnit.Parent.unitLaunchSpell(XmdsSkillType.none, launcher.mUnit, launchSpell, launcher.mUnit.X, launcher.mUnit.Y, launcher.mUnit.ID); } else { log.Warn("PlayerLauncherSkillOverExt not found spell: " + spellID); } } protected virtual int GetBindSkillID() {return 0; } } }