public static bool OnSkillFuncProtect(ref SSkillFuncContext inContext) { if (inContext.inStage == ESkillFuncStage.Enter) { int skillFuncProtectValue = SkillFuncHurtDelegator.GetSkillFuncProtectValue(ref inContext); int skillFuncParam = inContext.GetSkillFuncParam(0, false); int skillFuncParam2 = inContext.GetSkillFuncParam(5, false); int skillFuncParam3 = inContext.GetSkillFuncParam(6, false); if (skillFuncParam == 1) { inContext.inBuffSkill.get_handle().CustomParams[0] += skillFuncProtectValue; SkillFuncHurtDelegator.SendProtectEvent(ref inContext, 0, skillFuncProtectValue); } else if (skillFuncParam == 2) { inContext.inBuffSkill.get_handle().CustomParams[1] += skillFuncProtectValue; SkillFuncHurtDelegator.SendProtectEvent(ref inContext, 1, skillFuncProtectValue); } else if (skillFuncParam == 3) { inContext.inBuffSkill.get_handle().CustomParams[2] += skillFuncProtectValue; SkillFuncHurtDelegator.SendProtectEvent(ref inContext, 2, skillFuncProtectValue); } else if (skillFuncParam == 4) { inContext.inBuffSkill.get_handle().CustomParams[3] += skillFuncProtectValue; SkillFuncHurtDelegator.SendProtectEvent(ref inContext, 3, skillFuncProtectValue); } inContext.inBuffSkill.get_handle().CustomParams[4] = skillFuncParam2; inContext.inBuffSkill.get_handle().CustomParams[5] = skillFuncParam3; inContext.inBuffSkill.get_handle().SlotType = inContext.inUseContext.SlotType; return(true); } return(false); }
private static bool HandleSkillFuncHurt(ref SSkillFuncContext inContext, HurtTypeDef hurtType) { int num = 0; if (inContext.inStage == ESkillFuncStage.Enter) { PoolObjHandle <ActorRoot> inTargetObj = inContext.inTargetObj; PoolObjHandle <ActorRoot> inOriginator = inContext.inOriginator; if (inTargetObj && !inTargetObj.get_handle().ActorControl.IsDeadState) { inContext.inCustomData = default(HurtAttackerInfo); inContext.inCustomData.Init(inOriginator, inTargetObj); HurtDataInfo hurtDataInfo; hurtDataInfo.atker = inOriginator; hurtDataInfo.target = inTargetObj; hurtDataInfo.attackInfo = inContext.inCustomData; hurtDataInfo.atkSlot = inContext.inUseContext.SlotType; hurtDataInfo.hurtType = hurtType; hurtDataInfo.extraHurtType = (ExtraHurtTypeDef)inContext.GetSkillFuncParam(0, false); hurtDataInfo.hurtValue = inContext.GetSkillFuncParam(1, true); hurtDataInfo.adValue = inContext.GetSkillFuncParam(2, true); hurtDataInfo.apValue = inContext.GetSkillFuncParam(3, true); hurtDataInfo.hpValue = inContext.GetSkillFuncParam(4, true); hurtDataInfo.loseHpValue = inContext.GetSkillFuncParam(5, true); hurtDataInfo.iConditionType = inContext.GetSkillFuncParam(6, false); hurtDataInfo.iConditionParam = inContext.GetSkillFuncParam(7, true); hurtDataInfo.hurtCount = inContext.inDoCount; hurtDataInfo.firstHemoFadeRate = inContext.inBuffSkill.get_handle().cfgData.iFirstLifeStealAttenuation; hurtDataInfo.followUpHemoFadeRate = inContext.inBuffSkill.get_handle().cfgData.iFollowUpLifeStealAttenuation; hurtDataInfo.iEffectCountInSingleTrigger = inContext.inEffectCountInSingleTrigger; hurtDataInfo.bExtraBuff = inContext.inBuffSkill.get_handle().bExtraBuff; hurtDataInfo.gatherTime = inContext.inUseContext.GatherTime; bool bBounceHurt = inContext.inBuffSkill.get_handle().cfgData.bEffectSubType == 9; hurtDataInfo.bBounceHurt = bBounceHurt; hurtDataInfo.bLastHurt = inContext.inLastEffect; hurtDataInfo.iAddTotalHurtValueRate = 0; hurtDataInfo.iAddTotalHurtValue = 0; hurtDataInfo.iCanSkillCrit = (int)inContext.inBuffSkill.get_handle().cfgData.bCanSkillCrit; hurtDataInfo.iDamageLimit = inContext.inBuffSkill.get_handle().cfgData.iDamageLimit; hurtDataInfo.iMonsterDamageLimit = inContext.inBuffSkill.get_handle().cfgData.iMonsterDamageLimit; hurtDataInfo.iLongRangeReduction = inContext.inBuffSkill.get_handle().cfgData.iLongRangeReduction; hurtDataInfo.iEffectiveTargetType = (int)inContext.inBuffSkill.get_handle().cfgData.bEffectiveTargetType; hurtDataInfo.iOverlayFadeRate = SkillFuncHurtDelegator.GetOverlayFadeRate(ref inContext); hurtDataInfo.iEffectFadeRate = SkillFuncHurtDelegator.GetEffectFadeRate(ref inContext); hurtDataInfo.iReduceDamage = 0; num = inTargetObj.get_handle().ActorControl.TakeDamage(ref hurtDataInfo); inContext.inAction.get_handle().refParams.AddRefParam("HurtValue", -num); } } else if (inContext.inStage == ESkillFuncStage.Update) { PoolObjHandle <ActorRoot> inTargetObj2 = inContext.inTargetObj; PoolObjHandle <ActorRoot> inOriginator2 = inContext.inOriginator; if (inTargetObj2 && !inTargetObj2.get_handle().ActorControl.IsDeadState) { HurtDataInfo hurtDataInfo2; hurtDataInfo2.atker = inOriginator2; hurtDataInfo2.target = inTargetObj2; hurtDataInfo2.attackInfo = inContext.inCustomData; hurtDataInfo2.atkSlot = inContext.inUseContext.SlotType; hurtDataInfo2.hurtType = hurtType; hurtDataInfo2.extraHurtType = (ExtraHurtTypeDef)inContext.GetSkillFuncParam(0, false); hurtDataInfo2.hurtValue = inContext.GetSkillFuncParam(1, true); hurtDataInfo2.adValue = inContext.GetSkillFuncParam(2, true); hurtDataInfo2.apValue = inContext.GetSkillFuncParam(3, true); hurtDataInfo2.hpValue = inContext.GetSkillFuncParam(4, true); hurtDataInfo2.loseHpValue = inContext.GetSkillFuncParam(5, true); hurtDataInfo2.iConditionType = inContext.GetSkillFuncParam(6, false); hurtDataInfo2.iConditionParam = inContext.GetSkillFuncParam(7, true); hurtDataInfo2.hurtCount = inContext.inDoCount; hurtDataInfo2.firstHemoFadeRate = inContext.inBuffSkill.get_handle().cfgData.iFirstLifeStealAttenuation; hurtDataInfo2.followUpHemoFadeRate = inContext.inBuffSkill.get_handle().cfgData.iFollowUpLifeStealAttenuation; hurtDataInfo2.iEffectCountInSingleTrigger = inContext.inEffectCountInSingleTrigger; hurtDataInfo2.bExtraBuff = inContext.inBuffSkill.get_handle().bExtraBuff; hurtDataInfo2.gatherTime = inContext.inUseContext.GatherTime; bool bBounceHurt2 = inContext.inBuffSkill.get_handle().cfgData.bEffectSubType == 9; hurtDataInfo2.bBounceHurt = bBounceHurt2; hurtDataInfo2.bLastHurt = inContext.inLastEffect; hurtDataInfo2.iAddTotalHurtValueRate = 0; hurtDataInfo2.iAddTotalHurtValue = 0; hurtDataInfo2.iCanSkillCrit = (int)inContext.inBuffSkill.get_handle().cfgData.bCanSkillCrit; hurtDataInfo2.iDamageLimit = inContext.inBuffSkill.get_handle().cfgData.iDamageLimit; hurtDataInfo2.iMonsterDamageLimit = inContext.inBuffSkill.get_handle().cfgData.iMonsterDamageLimit; hurtDataInfo2.iLongRangeReduction = inContext.inBuffSkill.get_handle().cfgData.iLongRangeReduction; hurtDataInfo2.iEffectiveTargetType = (int)inContext.inBuffSkill.get_handle().cfgData.bEffectiveTargetType; hurtDataInfo2.iOverlayFadeRate = SkillFuncHurtDelegator.GetOverlayFadeRate(ref inContext); hurtDataInfo2.iEffectFadeRate = SkillFuncHurtDelegator.GetEffectFadeRate(ref inContext); hurtDataInfo2.iReduceDamage = 0; num = inTargetObj2.get_handle().ActorControl.TakeDamage(ref hurtDataInfo2); inContext.inAction.get_handle().refParams.AddRefParam("HurtValue", -num); } } return(num != 0); }
public static bool OnSkillFuncAddHp(ref SSkillFuncContext inContext) { return(inContext.inStage != ESkillFuncStage.Leave && SkillFuncHurtDelegator.HandleSkillFuncHurt(ref inContext, HurtTypeDef.Therapic)); }