Inheritance: global::ProtoBuf.IExtensible
 private void OnAiAddImpact(EntityInfo npc, int impactId)
 {
     Scene scene = npc.SceneContext.CustomData as Scene;
     if (null != scene) {
         ImpactInfo impactInfo = new ImpactInfo(impactId);
         impactInfo.StartTime = TimeUtility.GetLocalMilliseconds();
         impactInfo.ImpactSenderId = npc.GetId();
         impactInfo.SkillId = 0;
         if (null != impactInfo.ConfigData) {
             npc.GetSkillStateInfo().AddImpact(impactInfo);
             int seq = impactInfo.Seq;
             if (scene.SkillSystem.StartSkill(npc.GetId(), impactInfo.ConfigData, seq)) {
                 Msg_RC_AddImpact addImpactBuilder = new Msg_RC_AddImpact();
                 addImpactBuilder.sender_id = npc.GetId();
                 addImpactBuilder.target_id = npc.GetId();
                 addImpactBuilder.impact_id = impactId;
                 addImpactBuilder.skill_id = -1;
                 addImpactBuilder.duration = impactInfo.DurationTime;
                 scene.NotifyAllUser(RoomMessageDefine.Msg_RC_AddImpact, addImpactBuilder);
             }
         }
     }
 }
 protected override bool ExecCommand(StoryInstance instance, long delta)
 {
     Scene scene = instance.Context as Scene;
     if (null != scene) {
         int unitId = m_UnitId.Value;
         int impactId = m_ImpactId.Value;
         int seq = 0;
         Dictionary<string, object> locals = new Dictionary<string, object>();
         for (int i = 0; i < m_Args.Count - 1; i += 2) {
             string key = m_Args[i].Value as string;
             object val = m_Args[i + 1].Value;
             if (!string.IsNullOrEmpty(key)) {
                 locals.Add(key, val);
             }
         }
         EntityInfo obj = scene.SceneContext.GetEntityByUnitId(unitId);
         if (null != obj) {
             ImpactInfo impactInfo = new ImpactInfo(impactId);
             impactInfo.StartTime = TimeUtility.GetLocalMilliseconds();
             impactInfo.ImpactSenderId = obj.GetId();
             impactInfo.SkillId = 0;
             if (null != impactInfo.ConfigData) {
                 obj.GetSkillStateInfo().AddImpact(impactInfo);
                 seq = impactInfo.Seq;
                 if (scene.SkillSystem.StartSkill(obj.GetId(), impactInfo.ConfigData, seq, locals)) {
                     Msg_RC_AddImpact addImpactBuilder = new Msg_RC_AddImpact();
                     addImpactBuilder.sender_id = obj.GetId();
                     addImpactBuilder.target_id = obj.GetId();
                     addImpactBuilder.impact_id = impactId;
                     addImpactBuilder.skill_id = -1;
                     addImpactBuilder.duration = impactInfo.DurationTime;
                     scene.NotifyAllUser(RoomMessageDefine.Msg_RC_AddImpact, addImpactBuilder);
                 }
             }
         }
         if (m_HaveSeq) {
             string varName = m_SeqVarName.Value;
             instance.SetVariable(varName, seq);
         }
     }
     return false;
 }