using System; using CommonAI.Zone.Formula; using XmdsCommonServer.Plugin; using XmdsCommonServer.Plugin.XmdsSkillTemplate.Skills; using XmdsCommonSkill.Plugin.Skills; using XmdsCommon.Plugin; using CommonAI.Zone.Instance; using CommonLang.Log; namespace XmdsCommonSkill.Plugin.Buffs { /// /// FileName: XmdsBuff.cs /// Author: Alex.Yu /// Corporation:... /// Description: /// DateTime: 2015/6/8 20:48:06 /// public class XmdsBuffBase : UnitBuff { protected static Logger log = LoggerFactory.GetLogger("XmdsBuffBase"); public enum XmdsBuffUseType : int { Times = 1, //作用次数型. LifeTime = 2 //作用时间型. } public enum XmdsBuffList : int { CHAO_FENG = 100060, //嘲讽. //----------------------------------------------------------. LIAN_JI_DIAN = 200010, //连击点. AN_YIN_ZHI_REN = 200020, //暗影之刃(多段伤害). YIN_SHEN = 200050, //隐身. SPEED_UP = 200060, //疾跑. DU_SHANG = 201010, //荼毒. YIN_SHEN_HUI_XUE = 201050, //隐身回血(不可打断). JI_PAO_MIAN_SHANG = 201060, //疾跑免伤. YING_XI_ZHUANG_TAI = 202020,//影袭状态. CHEN_MO = 202030, //沉默. TAN_HUAN = 202040, //瘫痪. MEN_GUN = 202041, //闷棍(旧). YIN_SHEN2 = 202050, //强化隐身. JI_PAO_MIAN_KONG = 202060, //疾跑免控. //----------------------------------------------------------. DIAN_RAN = 300010, //点燃. BING_SHUANG = 300030, //冰霜. DING_SHI_ZHA_DAN = 301020, //定时炸弹(3s). MIAN_SHANG_2 = 301040, //免伤(比例). MO_KANG_DOWN = 301050, //闪电掌握(魔抗↓). ZHI_LIAO_XIAO_GUO = 301070, //受治疗效果↑. DONG_JIE = 302030, //冰霜冻结. YUN_XUAN_LEI_BAO = 302040, //雷暴(晕眩). AO_SHU_GUANG_HUI = 302070, //奥术光辉(魔攻↑). HAN_BING_PING_ZHANG = 302090,//寒冰屏障(锁帧+免伤免控). //----------------------------------------------------------. FEN_LIE_JIAN = 400020, // 分裂箭(标志). CHONG_NENG = 400060, // 充能(伤害↑). ZHONG_SHANG = 402010, // 重伤(流血+治疗效果下降). SHAN_BI_UP = 402040, // 闪避↑. //----------------------------------------------------------. SHEN_SHENG_FANG_HU = 501040,//神圣防护(魔抗↓). AN_YIN_XING_TAI = 501050, //暗影形态(护甲+移速+耗法). ZHENG_JIU = 501060, //拯救(免伤+恢复生命). CONG_RONG = 501080, //护盾+抵挡一次控制. BIAN_TA = 502010, //鞭挞(魔抗↓-有层叠). JIAN_SU = 502030, //减速. SHEN_SHENG_ZHI_LI = 502040, //神圣之力(治疗效果↑). CHAN_HUI = 502070, //忏悔(眩晕). //---------------------------------------------------------. SHOU_REN_ZHAN_HOU = 10060302, // 兽人队长 - 战吼(攻击+防御↑). CHAN_RAO = 10760402, // 古树之灵 - 缠绕(不动+点燃). DSZD_MONSTER = 10330402, // 被魔化的艾克 - 定时炸弹(5s). KUANG_NU_MONSTER = 10340502, // 科斯林伯爵 - 狂怒(攻击+防御↑). MA_BI = 10480202, // 毒血卫士 - 麻痹(先中毒,后麻痹). DSZD_MONSTER2 = 10530503, // 火焰女王罗曼提 - 定时炸弹(5s). WU_SHU_ZU_ZHOU = 10540502, // 黑暗女王萨缇娜 - 巫术诅咒. WEN_YI = 6061204, // 疫病之王亚巴 - 瘟疫(流血 + 5s后传给别人). XSSH_MONSTER = 6050602, // 狂暴护盾(吸收伤害 + 10s结束后再释放一个增加自己物攻的buff). SHI_HUA = 1508003, // 石化(不能释放技能不能移动 + 物防↑). JG_CANSPELL = 9140503, // 地宫执事-禁锢(移动速度↓ + 可施法). ANYINGLAOLONG = 604093, //暗影牢笼 //--------------------------------------------------- WU_DI = 1010, // 无敌. HUI_XUE_DA_DUAN = 1020, // 回血(可打断)-单挑王用. JJC_TIANSHEN = 1031, // 竞技场天神 JJC_HUICHUN = 1032, // 竞技场回春 JJC_TANLAN = 1033, // 竞技场贪婪 JJC_JIASU = 1034, // 竞技场加速 JJC_WUDI = 1035, // 竞技场无敌 PVP_FLAG_DAMAGEREDUCE = 1038, // PVP旗子标记 LIU_XUE = 1050, // 流血. MO_KANG_DOWN2 = 1060, // 魔抗↓. WU_FANG_DOWN = 1070, // 物防↓. YUN_XUAN = 1080, // 晕眩. FANG_YU_DOWN = 1090, // 防御下降. ATTACK_UP = 1100, // 攻击力↑. DIAN_RAN_TONGYONG = 1110, // 点燃(buffIcon共用“灼烧”). CHI_XU_DAMAGE = 1120, // 持续伤害. DU = 1130, // 毒伤害. BING_DONG = 1150, // 冰冻. ZHUO_SHAO = 1160, // 灼烧(buffIcon共用“点燃”). WU_GONG_UP = 1210, // 物攻↑. FEAR = 1220, // 恐惧(沉默+乱走). IRON_MAIDEN = 1230, // 反弹护盾(程序还未实现,占坑). SPEED_DOWN = 1240, // 移动速度↓. INVICIBLE_CANNOTMOVE = 1241, // 无敌,无法移动 SLEEP = 1270, // 沉睡 IGNORE_DAMAGE = 1280, // 全部免伤 PROP_CHANGE_1 = 1281, // 属性变更 - 一种 PROP_CHANGE_2 = 1282, //属性变更 - 两种 PROP_CHANGE_3 = 1283, //属性变更 - 三种 COM_INGORE_CTRL = 1284, // 免控(霸体) ADD_HP_EVERYSEC = 1285, // 每秒回血 // 新增 COM_JINGU = 1286, // 通用禁锢 COM_BRAND = 1287, // 通用灼烧 COM_SLIENT = 1288, // 通用沉默 //////////////////////////////////////////////////////////////////////////////////// ///////////////////// 战士buf ///////////////////// //////////////////////////////////////////////////////////////////////////////////// ATTACK_UP_ZS_1_1 = 110110, // 战士1-1技能命中后,再次命中,伤害提高 ZS_YUNXIAN_1_6 = 110160, // 战士1-6晕眩 ZS_SPEEDDOWN_2 = 110200, // 战士2-减速 ZS_INGORE_DAMAGE = 110201, // 战士2-动作期间免伤 ZS_ADD_ATTACK = 110210, // 战士2-1,落地提升攻击 ZS_REDUCE_ATTACK = 110211, // 战士2-4, 劈中减攻 HUDUN_ZS_2_5 = 110250, // 战士2-5技能护盾 HUDUN_ZS_2_6 = 110260, // 战士2-6护盾 ZS_SPEEDDOWN_3 = 110300, // 战士3-减速 ZS_INGOREDMG_3 = 110301, // 战士3-免伤 ZS_ATTACKUP_3_1 = 110310, // 战士3-1,攻击提升 ZHUO_SHAO_ZS_3_2 = 110320, // 点燃3-2, 每秒扣血 ZS_YUNXUAN_3_3 = 110330, // 3-3 满蓄附带眩晕 ZS_DEFENCEUP_3_4 = 110340, // 3-4,防御提升 ZS_SPEEDUP_3_5 = 110350, // 3-5,火焰路径,自己加速 ZS_CAOFENG = 110400, // 4-0嘲讽 ZS_4_ADD_TALENT = 110401, // 4-0气动山河 ATTCK_UP_ZS_4_2 = 110420, // 根据损失生命值提高攻击力 LOCK_HP_ZS_4_3 = 110430, // 战士锁血 HitAddHp_ZS_4_5 = 110450, // 受击恢复生命 HPReduce_Damage_4_6 = 110460, // 受伤,对周围造成伤害 LAUNCH_BUF_ZS_5 = 110500, // 免硬控,并转换成减速debuf //Bleed_ZS_5 = 110501, // 每0.5s造成伤害 TRY_LAUNCH_BUF_ZS_5 = 110502, // 聚气阶段buf IGNORCTRL_AND_SPPEDCHG = 110503, // 免控,并且速度变更 HUANYUAN_SZ_6 = 110600, // 战士被动,荒原血统 //////////////////////////////////////////////////////////////////////////////////// ///////////////////// 法师buf ///////////////////// //////////////////////////////////////////////////////////////////////////////////// ATTACK_SPPED_FS_1_4 = 310140, // 提高攻速 //FS_1_6_SPEED_DOWN = 310160, // 移速下降 ATTACK_UP_FS_2_2 = 310220, // 攻击标记敌人,触发,造成额外伤害 ATTACK_UP_FS_2_3 = 310230, // 攻击禁锢敌人,伤害提高 JINGU_FS_2_3_1 = 310231, // 禁锢 FS_YAZHI_3_5 = 310350, // 压制 FS_TAG_3_5 = 310351, // 寒霜区域标记1 FS_TAG_3_5Ext = 310352, // 寒霜区域标记2 FS_BUFF_3_6 = 310360, // 3-6加速,加攻 FS_YAZHI_4 = 310400, // 压制 SkillDamageUp_FS_4_3 = 310430, // 法师技能伤害变更 SwordCut_FS_5_2 = 310520, // 剑伤debuf FS_SPEEDDOWN_5_3 = 310530, // 5-3减速 FS_HUDUN_5_6 = 310560, // 法师护盾 PASSIVE_FS_6 = 310600, // 法师被动,标记敌人 PASSIVE_FS_6_1 = 310601, // 法师被动,剑影 PASSIVE_FS_6_SPEEDDOWN = 310602, // 法师被动-减速 //////////////////////////////////////////////////////////////////////////////////// ///////////////////// 治疗buf ///////////////////// //////////////////////////////////////////////////////////////////////////////////// HIT_ATTACKUP = 510150, // 命中提高攻击 REMEDY_2_0_ADDHP = 510200, // 治疗加血buff REMEDY_2_1_DEFENCEUP = 510210, // 治疗加防 REMEDY_2_2_HUDUN = 510220, // 治疗护盾 REMEDY_2_4_ATTACKUP = 510240, // 攻击提升 REMEDY_2_6_HEALEDDOWN = 510260, // 降低敌方治疗效果 REMEDY_3_3_TAG = 510330, // 命中降防 REMEDY_3_4_TAG = 510340, // 治疗3-4技能标记 REMEDY_3_5_TAG = 510350, // 治疗3-5弹射标记 REMEDY_4_JINGU = 510400, // 禁锢 REMEDY_4_JINGUEXT = 510401, // 禁锢后减速 REMEDY_4_JINGU_SPEEDDOWN = 510402, // 禁锢减速 REMEDY_4_3_ATTACKADDHP = 510430, // 治疗4-3藤蔓debuff,队友和自己攻击增加回血 REMEDY_4_4_SPEEDDOWN = 510440, // 治疗4-4,毒爆后减速 REMEDY_4_6_DEBUFF = 510460, // 延时藤蔓debuff REMEDY_4_6_JINGUEXT = 510461, // 延时藤蔓-禁锢 GOLDEN_BODY_5 = 510500, // 金身buff IGNORE_DAMAGE_5 = 510501, // 技能 AttackRoundAddHP = 510510, // 攻击范围回血 REMEDY_5_2_PROPCHG = 510520, // 属性变更 - 两种 REMEDY_5_3_TAG = 510530, // 光环标记 REMEDY_5_3_ALLIESTAG = 510531, // 光环标记-队友 //REMEDY_5_5_TAG = 510540, // 治疗5-4普攻标记 REMEDY_5_6_TAG = 510560, // 光环标记 REMEDY_5_6_ALLIESTAG = 510561, // 光环标记-队友 NORMAL_ATTACK_STRENGTH = 510600, // 普攻强化buff REMEDY_POISON = 510610, // 挂毒buff //////////////////////////////////////////////////////////////////////////////////// ///////////////////// 宠物被动buff ////////////////////// //////////////////////////////////////////////////////////////////////////////////// PET_ATK_6 = 910000, //攻6 - 攻速buff PET_ATK_2 = 910001, //防2-减伤buf PET_DEFENCE_2_1 = 910002, //防2-减伤buf PET_DEFENCE_4_1 = 910006, //防4-护盾buff PET_DEFENCE_6_1 = 910008, //防6-防御buff PET_CRIT_2_1 = 910010, //爆2-技能附带灼烧buff PET_CRIT_4_1 = 910012, //爆4-位移后提高穿透buff PET_CONSUM_6_1 = 910003, //耗6-伤害提高buff PET_ASSIST_4_1 = 910021, //辅4-治疗伤害者buff PET_ASSIST_6 = 910022, //辅6-衰减减速 //////////////////////////////////////////////////////////////////////////////////// ///////////////////// 宠物主动buff /////////////////////// //////////////////////////////////////////////////////////////////////////////////// PET_DEFENCE_MOVE = 910100, //防御+移速 buff PET_REMEDY_MOVE = 910101, //治疗+移速 buff PET_CRIT_HPADD = 910102, //下次普攻暴击+生命偷取Buff PET_DEFENCE_ATTACK = 910103, //降防->加攻 PET_HUDUN = 910104, //护盾 PET_CURSE = 910105, //引燃,真实伤害+降低治疗效果 PET_AMULET = 910106, //护符 PET_ATTACK_REMIT = 910107, //减伤,攻击-》免伤 PET_ROUND_SPEEDDOWN = 910108, //群体减速标记 PET_NEXT_SCOPEATTACK = 910109, //下次攻击范围伤害 PET_NEXT_SPURTINGATTACK = 910110, //下次攻击溅射伤害 PET_ATTACK_SPEEDUP = 910111, //加攻+加速 PET_WUDI = 910112, //无敌 //////////////////////////////////////////////////////////////////////////////////// ///////////////////// boss buff ////////////////////// //////////////////////////////////////////////////////////////////////////////////// BOSS_HUDUN_DEFENCE = 910201, // 护盾 + 防御增加 BOSS_SUNDERARMOR = 910202, // 破甲 BOSS_ZB_BLESS = 910203, // 周本1号boss-流血 TAG_WATER = 910204, // 水标记 TAG_FIRE = 910205, // 火标记 TAG_POISON = 910206, // 毒标记 BOSS_ZB_TAG_SKILLLAUNCH = 910207, // 水火无情冷却标记 BOSS_ZB_TAG_ELEMENTS = 910208, // 五行元素 BOSS_ZB_TRAP = 910209, // 捆仙索 BOSS_CRAZE = 910210, // boss狂暴 BOSS_WEAK = 920001, // boss虚弱状态 //////////////////////////////////////////////////////////////////////////////////// ///////////////////// 新版本宠物2020.5.15 ////////////////////// //////////////////////////////////////////////////////////////////////////////////// NEWPET_CONTINUE_DAMAGE = 910300, // 持续伤害 NEWPET_CRITRATE_CHG = 910301, // 爆1:暴击几率提升 NEWPET_NEXTATK_CRIT = 910302, // 爆2:下次普攻暴击 NEWPET_DAMAGE_CHG = 910303, // 爆4:提高造成伤害 NEWPET_CHAOFENG = 910304, // 防1:嘲讽 NEWPET_DEFENCEUP = 910305, // 防2:防御提升 NEWPET_REBOUND_DAMAGE = 910306, // 防3:反伤 NEWPET_DAMAGEREDUCE = 910307, // 防4:免伤 NEWPET_ATTACK_CHANGE = 910308, // 血1:降低攻击 NEWPET_ADDHP = 910309, // 血3:回血 NEWPET_ATTACKSPEED_DOWN = 910310, // 血4:降低攻速 NEWPET_DEFENCE_DOWN = 910311, // 辅1:破防 NEWPET_INGOREDEFENCE_UP = 910312, // 辅2:提高穿透 NEWPET_ATTACKSPEED_UP = 910313, // 辅3:提高攻速 NEWPET_DAMAGE_DEEP = 910314, // 辅4:伤害加深 NEWPET_ATTACK_UP = 910315, // 攻4:攻击提升 //////////////////////////////////////////////////////////////////////////////////// ///////////////////// 宠物装备2021.6.16 ////////////////////// //////////////////////////////////////////////////////////////////////////////////// PET_EQUIPSKILL_RAGE = 80200, // 狂暴 PET_EQUIPSKILL_HUDUN = 80260, // 护盾 PET_EQUIPSKILL_RAGE_DEAD = 80280, // 狂暴-死亡 PET_EQUIPSKILL_ADDHP = 80290, // 死亡加血 //////////////////////////////////////////////////////////////////////////////////// ///////////////////// 斩妖技2020.7.27 ////////////////////// //////////////////////////////////////////////////////////////////////////////////// ZHANYAO_ZS_1 = 70010, ZHANYAO_ZS_2 = 70011, ZHANYAO_ZS_S_1 = 70012, ZHANYAO_ZS_S_2 = 70013, ZHANYAO_FS_1 = 70020, ZHANYAO_FS_2 = 70021, ZHANYAO_FS_S_1 = 70022, ZHANYAO_FS_S_2 = 70023, ZHANYAO_NM_1 = 70030, ZHANYAO_NM_2 = 70031, ZHANYAO_NM_S_1 = 70032, ZHANYAO_NM_S_2 = 70033, LINGBAO_BUFF = 100100, // 灵宝攻击提升buff TINAHU_DAMAGE_TAG_1 = 100101, // 天书-伤害标记buff TINAHU_DAMAGE_TAG_2 = 100102, // 天书-伤害标记buff TINAHU_DAMAGE_TAG_3 = 100103, // 天书-伤害标记buff TINAHU_DAMAGE_TAG_4 = 100104, // 天书-伤害标记buff TINAHU_DAMAGE_TAG_5 = 100105, // 天书-伤害标记buff //////////////////////////////////////////////////////////////////////////////////// ///////////////////// 卡牌技能buff2021.8.12 ////////////////////// //////////////////////////////////////////////////////////////////////////////////// CARD_STORE_ENERGY = 1999000, // 蓄势 // ---------------------------------------青龙--------------------------------------- CARD_QINGLONG = 1100000, // 青龙之力 CARD_QL_ADDHP = 1100001, // 青龙- 加血buff CARD_QL_DEFENCEUP = 1100002, // 青龙- 防御提升 // ---------------------------------------朱雀--------------------------------------- CARD_ZHUQUE = 1200000, // 朱雀之力 CARD_CRATE_UP = 1200001, // 暴击率提升 // ---------------------------------------白虎--------------------------------------- CARD_BAIHU = 1300000, // 白虎之力 CARD_DEFENCE_DOWN = 1300001, // 减防 // ---------------------------------------玄武--------------------------------------- CARD_XUANWU = 1400000, // 玄武之力 CARD_XW_HUDUN = 1400001, // 普通护盾反伤 CARD_XW_DEFENCE_UP = 1400002, // 护盾- 加防 CARD_XW_FORZEN = 1400003, // 冰冻效果 CARD_XW_IGNORECTRL_HUDUN = 1400004, // 免控护盾 CARD_XW_ALLIES_SPEED_DEFENCE = 1400005, // 队友移速,防御提高 // ---------------------------------------BOSS--------------------------------------- CARD_BOSS_DMG_DEEPER = 1999900, //boss-灼伤,受伤增加 CARD_BOSS_SPEED_DMG_DOWN = 1999901, //boss-虚弱,移速降低,伤害降低 } /// ////作用类型. /// public int BuffUseType = (int)XmdsBuffUseType.LifeTime; /// /// 时间/次数. /// public int BuffUseTime = 0; public event XmdsSkillBase.ScriptHandler OnXmdsBuffHitEvent; public delegate void OnBuffEndEvent(XmdsCommonServer.Plugin.XmdsVirtual hitter, InstanceUnit.BuffState state); public event OnBuffEndEvent OnHandleBuffEndEvent; public delegate void OnBuffBeginEvent(XmdsVirtual hitter, XmdsVirtual attacker, InstanceUnit.BuffState state); public event OnBuffBeginEvent OnHandleBuffBeginEvent; private GameSkill mGameSkill = null; private bool mShowBuffTips = true; //BUFF是否需要飘字. public bool ShowBuffTips { get { return mShowBuffTips; } set { mShowBuffTips = value; } } public override int GetAbilityID() { return (int)(XmdsBuffProperties.XmdsBuffAbility.None); } /** buff是否已失效 */ protected bool BuffInvaildCheck() { if (mInvalid == true) { return mInvalid; } bool ret = false; //时间型按照BUFF时间来. if (BuffUseType == (int)XmdsBuffBase.XmdsBuffUseType.LifeTime) { ret = false; } else { BuffUseTime--; if (BuffUseTime <= 0) { ret = true; } else { ret = false; } } if (ret == true) { mInvalid = true; } return mInvalid; } public override void BuffBegin(XmdsVirtual hitter, XmdsVirtual attacker, InstanceUnit.BuffState state) { mInvalid = false; if (OnHandleBuffBeginEvent != null) { OnHandleBuffBeginEvent.Invoke(hitter, attacker, state); } OnBuffBegin(hitter, attacker, state); } public override void BuffEnd(XmdsVirtual hitter, InstanceUnit.BuffState state, bool replace) { if (OnHandleBuffEndEvent != null) { OnHandleBuffEndEvent.Invoke(hitter, state); } OnBuffEnd(hitter, state, replace); state.Tag = null; Dispose(); } public override int BuffHit(XmdsVirtual hitter, XmdsVirtual attacker, AttackSource source, ref XmdsVirtual.AtkResult result) { return OnBuffHit(hitter, attacker, source, ref result); } public override void BuffUpdate(XmdsVirtual unit, InstanceUnit.BuffState state) { } protected virtual void OnBuffBegin(XmdsVirtual hitter, XmdsVirtual attacker, InstanceUnit.BuffState state) { } protected virtual void OnBuffEnd(XmdsVirtual hitter, InstanceUnit.BuffState state, bool replace) { } protected virtual int OnBuffHit(XmdsVirtual hitter, XmdsVirtual attacker, AttackSource source, ref XmdsVirtual.AtkResult result) { if (OnXmdsBuffHitEvent != null) { BattleParams param = BattleParams.AllocAutoRelease(); try { //param.AttackRlt = result.rlt; param.Attacker = attacker; param.Hitter = hitter; param.Source = source; param.GameSkill = mGameSkill; OnXmdsBuffHitEvent.Invoke(param); int ret = param.FinalSkillDamage; //result.rlt = param.AttackRlt; return ret; } finally { param.Dispose(); } } return 0; } public GameSkill GetGameSkill() { return mGameSkill; } public void SetOnHitCallBack(GameSkill gs, XmdsSkillBase.ScriptHandler callBack) { mGameSkill = gs; OnXmdsBuffHitEvent = callBack; } protected override void OnDispose() { OnHandleBuffBeginEvent = null; OnHandleBuffEndEvent = null; OnXmdsBuffHitEvent = null; base.OnDispose(); } public override void CopyTo(UnitBuff other) { var ret = (other as XmdsBuffBase); ret.mGameSkill = this.mGameSkill; ret.OnHandleBuffBeginEvent = this.OnHandleBuffBeginEvent; ret.OnHandleBuffEndEvent = this.OnHandleBuffEndEvent; ret.OnXmdsBuffHitEvent = this.OnXmdsBuffHitEvent; ret.BuffUseType = this.BuffUseType; ret.BuffUseTime = this.BuffUseTime; ret.ShowBuffTips = this.ShowBuffTips; this.OnHandleBuffBeginEvent = null; this.OnHandleBuffEndEvent = null; this.OnXmdsBuffHitEvent = null; this.mGameSkill = null; base.CopyTo(other); } } }