public static XDict <GameData.AttrType, long> GetEffectCasterTempAttr(Effect effectData, EntityParent caster, int fromSkillID) { XDict <GameData.AttrType, long> xDict = new XDict <GameData.AttrType, long>(); int skillLevelByID = caster.GetSkillLevelByID(fromSkillID); XDict <GameData.AttrType, BattleSkillAttrAdd> skillAttrChangeByID = caster.GetSkillAttrChangeByID(fromSkillID); if ((caster.IsEntitySelfType || caster.IsEntityPlayerType || caster.IsEntityPetType) && effectData.rolePropId.get_Count() > 0 && skillLevelByID > 0) { for (int i = 0; i < effectData.rolePropId.get_Count(); i++) { if (effectData.rolePropId.get_Item(i).key == skillLevelByID) { Attrs attrs = DataReader <Attrs> .Get(effectData.rolePropId.get_Item(i).value); if (attrs != null) { for (int j = 0; j < attrs.attrs.get_Count(); j++) { xDict.Add((GameData.AttrType)attrs.attrs.get_Item(j), (long)attrs.values.get_Item(j)); } } break; } } } else if (effectData.propId > 0) { Attrs attrs2 = DataReader <Attrs> .Get(effectData.propId); if (attrs2 != null) { for (int k = 0; k < attrs2.attrs.get_Count(); k++) { xDict.Add((GameData.AttrType)attrs2.attrs.get_Item(k), (long)attrs2.values.get_Item(k)); } } } if (skillAttrChangeByID != null) { for (int l = 0; l < skillAttrChangeByID.Count; l++) { if (xDict.ContainsKey(skillAttrChangeByID.Keys.get_Item(l))) { xDict[skillAttrChangeByID.Keys.get_Item(l)] = (long)((double)(xDict[skillAttrChangeByID.Keys.get_Item(l)] + (long)skillAttrChangeByID.Values.get_Item(l).addiAdd) * (1.0 + (double)skillAttrChangeByID.Values.get_Item(l).multiAdd * 0.001)); } } } return(xDict); }
protected void InitBuff(Buff buffData, EntityParent caster, EntityParent target, int fromSkillID, int elementType, bool isCommunicateMix = false) { double num = BattleCalculator.CalculateBuffTime(caster.BattleBaseAttrs.GetBuffCtrlAttrs(elementType), target.BattleBaseAttrs.GetBuffCtrlAttrs(elementType), (double)buffData.time); if (LocalAgent.CheckBuffByTargetIDAndBuffID(target.ID, buffData.id)) { int overlayModeId = buffData.overlayModeId; if (overlayModeId != 1) { if (overlayModeId == 2) { this.buffStateTable[target.ID][buffData.id].removeLeftTime = num; } } else { this.buffStateTable[target.ID][buffData.id].removeLeftTime += num; } return; } BuffState buffState = new BuffState(); buffState.isBlock = false; buffState.isCommunicateMix = isCommunicateMix; buffState.isGlobalBuff = false; buffState.casterID = caster.ID; buffState.fromSkillID = fromSkillID; buffState.fromSkillLevel = caster.GetSkillLevelByID(fromSkillID); buffState.fromSkillAttrChange = caster.GetSkillAttrChangeByID(fromSkillID); buffState.intervalDefaultTime = (float)buffData.interval; buffState.intervalLeftTime = (float)buffData.interval; buffState.removeLeftTime = num; if (!this.buffStateTable.ContainsKey(target.ID)) { this.buffStateTable.Add(target.ID, new XDict <int, BuffState>()); } this.buffStateTable[target.ID].Add(buffData.id, buffState); this.HandleBuff(buffData, caster, target, fromSkillID, buffState.fromSkillLevel, buffState.fromSkillAttrChange, isCommunicateMix); AddBuffAnnouncer.Announce(LocalAgent.GetEntityByID(target.ID), buffData.id); LocalBattleProtocolSimulator.SendAddBuff(caster.ID, target.ID, buffData.id, (int)num); }
protected void HandleTriggerEffect(long casterID, int skillID, int effectID, List <EffectTargetInfo> effectTargetInfos, XPoint basePoint, int effectUniqueID, bool isAddEffect = true, bool isCommunicateMix = false) { Effect effectDataByID = LocalAgent.GetEffectDataByID(effectID); EntityParent entityByID = LocalAgent.GetEntityByID(casterID); List <long> list = new List <long>(); for (int i = 0; i < effectTargetInfos.get_Count(); i++) { list.Add(effectTargetInfos.get_Item(i).targetId); } if (isAddEffect) { if (list.get_Count() > 0 && LocalAgent.GetEntityUsable(entityByID, isCommunicateMix)) { int num = BattleCalculator.CalculateEffectCasterActPoint(entityByID.BattleBaseAttrs, (double)effectDataByID.casterPoint); entityByID.SetValue(GameData.AttrType.ActPoint, entityByID.TryAddValue(GameData.AttrType.ActPoint, (long)num), true); } if (isCommunicateMix && effectDataByID.type1 != 0 && effectDataByID.type1 != 1 && effectDataByID.type1 != 2) { GlobalBattleNetwork.Instance.SendClientDriveBattleEffectDamage(casterID, 0L, (!LocalAgent.GetEntityUsable(entityByID, isCommunicateMix)) ? 0L : entityByID.Hp, 0L, 0L, skillID, effectID, true, false, null, null, basePoint, new List <long>(), string.Empty, true); } } for (int j = 0; j < list.get_Count(); j++) { EntityParent entityByID2 = LocalAgent.GetEntityByID(list.get_Item(j)); if (LocalAgent.GetEntityUsable(entityByID2, isCommunicateMix)) { entityByID2.SetValue(GameData.AttrType.ActPoint, entityByID2.TryAddValue(GameData.AttrType.ActPoint, (long)effectDataByID.targetPoint), true); } } switch (effectDataByID.type1) { case 1: LocalBattleEffectCalculatorDamageHandler.AppDamage(effectDataByID, entityByID, list, basePoint, skillID, isAddEffect, isCommunicateMix); break; case 2: LocalBattleEffectCalculatorTreatHandler.AppTheat(effectDataByID, entityByID, list, basePoint, skillID, isAddEffect, isCommunicateMix); break; case 3: LocalBattleEffectSummonMonsterHandler.AppSummonMonster(effectDataByID, entityByID, basePoint, isCommunicateMix); break; case 4: LocalBattleEffectReliveHandler.AppRelive(list, isCommunicateMix); break; case 5: LocalBattleEffectDrainHandler.AppDrain(effectDataByID, entityByID, list, isCommunicateMix); break; case 7: this.AppFuse(entityByID, skillID, isCommunicateMix); break; case 8: LocalBattleEffectSummonPetHandler.AppSummonPet(effectDataByID, entityByID, skillID, isCommunicateMix); break; case 9: LocalBattleEffectPetManualSkillHandler.AppManualSkill(entityByID, list, skillID, isCommunicateMix); break; case 10: LocalBattleEffectBlinkHandler.AppBlink(effectDataByID, entityByID, basePoint, isCommunicateMix); break; case 11: LocalBattleEffectHitHandler.AppHit(effectDataByID, entityByID, list, basePoint, isAddEffect); break; } for (int k = 0; k < list.get_Count(); k++) { for (int l = 0; l < effectDataByID.addLoopBuff.get_Count(); l++) { this.AppAddBuff(effectDataByID.addLoopBuff.get_Item(l), entityByID, list.get_Item(k), skillID, effectDataByID.element, isCommunicateMix); } if (isAddEffect) { for (int m = 0; m < effectDataByID.addBuff.get_Count(); m++) { this.AppAddBuff(effectDataByID.addBuff.get_Item(m), entityByID, list.get_Item(k), skillID, effectDataByID.element, isCommunicateMix); } for (int n = 0; n < effectDataByID.removeBuff.get_Count(); n++) { this.AppRemoveBuff(effectDataByID.removeBuff.get_Item(n), list.get_Item(k)); } } if (entityByID != null) { int skillLevelByID = entityByID.GetSkillLevelByID(skillID); for (int num2 = 0; num2 < effectDataByID.gradeAddLoopBuffId.get_Count(); num2++) { if (effectDataByID.gradeAddLoopBuffId.get_Item(num2).key == skillLevelByID) { this.AppAddBuff(effectDataByID.gradeAddLoopBuffId.get_Item(num2).value, entityByID, list.get_Item(k), skillID, effectDataByID.element, isCommunicateMix); } } if (isAddEffect) { for (int num3 = 0; num3 < effectDataByID.gradeAddBuffId.get_Count(); num3++) { if (effectDataByID.gradeAddBuffId.get_Item(num3).key == skillLevelByID) { this.AppAddBuff(effectDataByID.gradeAddBuffId.get_Item(num3).value, entityByID, list.get_Item(k), skillID, effectDataByID.element, isCommunicateMix); } } } } } }