public static void DoLoopEvent(SkillStage stage, int curTick) { excel_skill_stage stageInfo = stage.mStageInfo; if (stageInfo.events == null) { return; } for (int i = 0; i < stageInfo.events.Length; ++i) { int eventID = stageInfo.events[i]; excel_skill_event eventInfo = excel_skill_event.Find(eventID); if ((int)SkillEventTriggerType.Loop != eventInfo.triggerType) { continue; } if (!IsEventTrait(SkillEventTrait.Server, eventInfo)) { continue; } int tick = curTick - eventInfo.triggerParam1; if (tick >= 0 && eventInfo.triggerParam2 > 0 && tick % eventInfo.triggerParam2 == 0) { SkillEventRegister.SkillEventMethod e = null; SkillEventType type = (SkillEventType)eventInfo.eventType; if (!SkillEventRegister.events.TryGetValue(type, out e)) { continue; } e(stage.mSkillContext.mOwner, null, stage.mSkillContext, eventInfo); } } }
public void DoLoopEvent() { if (mEvents == null) { return; } for (int i = 0; i < mEvents.Count; ++i) { excel_skill_event eventInfo = mEvents[i]; if (eventInfo.triggerType != (int)SkillEventTriggerType.Loop) { continue; } if (!IsServerEvent(eventInfo)) { continue; } int tick = mTick - eventInfo.triggerParam1; if (tick >= 0 && eventInfo.triggerParam2 > 0 && tick % eventInfo.triggerParam2 == 0) { SkillEventRegister.SkillEventMethod e = null; SkillEventType type = (SkillEventType)eventInfo.eventType; if (!SkillEventRegister.events.TryGetValue(type, out e)) { continue; } e(null, this, mContext, eventInfo); } } }
void DoEvent(SkillEventTriggerType triggerType, int param1 = -1, int param2 = -1) { if (mEvents == null) { return; } for (int i = 0; i < mEvents.Count; ++i) { excel_skill_event eventInfo = mEvents[i]; if (!IsServerEvent(eventInfo)) { continue; } if ((ushort)triggerType != eventInfo.triggerType) { continue; } if (param1 != -1 && param1 != eventInfo.triggerParam1) { continue; } if (param2 != -1 && param2 != eventInfo.triggerParam2) { continue; } SkillEventRegister.SkillEventMethod e = null; SkillEventType type = (SkillEventType)eventInfo.eventType; if (!SkillEventRegister.events.TryGetValue(type, out e)) { continue; } e(null, this, mContext, eventInfo); } }
public static void DoEvent(SkillStage stage, SkillEventTriggerType triggerType, int param1 = -1, int param2 = -1) { excel_skill_stage stageInfo = stage.mStageInfo; if (stageInfo.events == null) { return; } for (int i = 0; i < stageInfo.events.Length; ++i) { int eventID = stageInfo.events[i]; excel_skill_event eventInfo = excel_skill_event.Find(eventID); if ((int)triggerType != eventInfo.triggerType) { continue; } if (!IsEventTrait(SkillEventTrait.Server, eventInfo)) { continue; } if (param1 != -1 && param1 != eventInfo.triggerParam1) { continue; } if (param2 != -1 && param2 != eventInfo.triggerParam2) { continue; } SkillEventRegister.SkillEventMethod e = null; SkillEventType type = (SkillEventType)eventInfo.eventType; if (!SkillEventRegister.events.TryGetValue(type, out e)) { continue; } e(stage.Owner, null, stage.mSkillContext, eventInfo); } }