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); }