Beispiel #1
0
        void AddUnconsciousAnis(ModelDef model)
        {
            var ani1 = new ScriptAniJob("uncon_dropfront", "t_Stand_2_Wounded", new ScriptAni(0, 20));

            ani1.DefaultAni.FPS = 10;

            var ani2 = new ScriptAniJob("uncon_front", "s_wounded", new ScriptAni());

            model.AddAniJob(ani1);
            model.AddAniJob(ani2);
            ani1.NextAni = ani2;

            ani1 = new ScriptAniJob("uncon_dropback", "t_Stand_2_Woundedb", new ScriptAni(0, 14));
            ani1.DefaultAni.FPS = 10;

            ani2 = new ScriptAniJob("uncon_back", "s_woundedb", new ScriptAni());

            model.AddAniJob(ani1);
            model.AddAniJob(ani2);

            ani1.NextAni = ani2;

            // STAND UP
            var ani = new ScriptAniJob("uncon_standupfront", "t_Wounded_2_Stand", new ScriptAni(0, 34));

            ani.DefaultAni.FPS = 10;
            model.AddAniJob(ani);

            ani = new ScriptAniJob("uncon_standupback", "t_Woundedb_2_Stand", new ScriptAni(0, 40));
            ani.DefaultAni.FPS = 10;
            model.AddAniJob(ani);
        }
Beispiel #2
0
        public void DropUnconscious(long duration = -1, bool toFront = true)
        {
            var          cat = AniCatalog.Unconscious;
            ScriptAniJob job = toFront ? cat.DropFront : cat.DropBack;

            if (job != null)
            {
                ModelInst.StartAniJob(job);
            }

            _Uncon = toFront ? Unconsciousness.Front : Unconsciousness.Back;

            var strm = BaseInst.GetScriptVobStream();

            strm.Write((byte)ScriptVobMessageIDs.Uncon);
            strm.Write((byte)_Uncon);
            BaseInst.SendScriptVobStream(strm);

            if (duration >= 0)
            {
                if (unconTimer == null)
                {
                    unconTimer = new GUCTimer(LiftUnconsciousness);
                }

                unconTimer.SetInterval(duration);
                unconTimer.Start();
            }

            OnUnconChange?.Invoke(this);
        }
Beispiel #3
0
        void AddClimbAnis(ModelDef model)
        {
            var ani1 = new ScriptAniJob("climb_low", "t_Stand_2_JumpUpLow", new ScriptAni(0, 4));
            var ani2 = new ScriptAniJob("climb_low1", "s_JumpUpLow", new ScriptAni(0, 1));
            var ani3 = new ScriptAniJob("climb_low2", "t_JumpUpLow_2_Stand", new ScriptAni(0, 9));

            model.AddAniJob(ani1);
            model.AddAniJob(ani2);
            model.AddAniJob(ani3);

            ani1.NextAni = ani2;
            ani2.NextAni = ani3;

            ani1 = new ScriptAniJob("climb_mid", "t_Stand_2_JumpUpMid", new ScriptAni(0, 9));
            ani2 = new ScriptAniJob("climb_mid1", "s_JumpUpMid", new ScriptAni(0, 1));
            ani3 = new ScriptAniJob("climb_mid2", "t_JumpUpMid_2_Stand", new ScriptAni(0, 20));

            model.AddAniJob(ani1);
            model.AddAniJob(ani2);
            model.AddAniJob(ani3);

            ani1.NextAni = ani2;
            ani2.NextAni = ani3;

            ani1 = new ScriptAniJob("climb_high", "t_Jump_2_Hang", new ScriptAni(0, 17));
            ani2 = new ScriptAniJob("climb_high1", "s_hang", new ScriptAni(0, 1));
            ani3 = new ScriptAniJob("climb_high2", "t_Hang_2_Stand", new ScriptAni(0, 25));

            model.AddAniJob(ani1);
            model.AddAniJob(ani2);
            model.AddAniJob(ani3);

            ani1.NextAni = ani2;
            ani2.NextAni = ani3;
        }
Beispiel #4
0
        void AddItemAnis(ModelDef m)
        {
            // take item
            ScriptAniJob aniJob1 = new ScriptAniJob("take_item", "t_Stand_2_IGet", new ScriptAni(0, 9)
            {
                { SpecialFrame.ItemHandle, 9 }
            });

            m.AddAniJob(aniJob1);

            ScriptAniJob aniJob2 = new ScriptAniJob("take_item2", "s_IGet", new ScriptAni(0, 1));

            m.AddAniJob(aniJob2);
            aniJob1.NextAni = aniJob2;

            ScriptAniJob aniJob3 = new ScriptAniJob("take_item3", "t_IGet_2_Stand", new ScriptAni(0, 9));

            m.AddAniJob(aniJob3);
            aniJob2.NextAni = aniJob3;


            // drop item
            aniJob1 = new ScriptAniJob("drop_item", "t_Stand_2_IDrop", new ScriptAni(0, 6)
            {
                { SpecialFrame.ItemHandle, 6 }
            });
            m.AddAniJob(aniJob1);

            aniJob2 = new ScriptAniJob("drop_item2", "s_IDrop", new ScriptAni(0, 1));
            m.AddAniJob(aniJob2);
            aniJob1.NextAni = aniJob2;

            aniJob3 = new ScriptAniJob("drop_item3", "t_IDrop_2_Stand", new ScriptAni(0, 6));
            m.AddAniJob(aniJob3);
            aniJob2.NextAni = aniJob3;


            // drink potion
            aniJob1 = new ScriptAniJob("chug_potion", "t_potionfast_Stand_2_S0", new ScriptAni(0, 5)
            {
                { SpecialFrame.ItemHandle, 30 }
            });
            m.AddAniJob(aniJob1);

            aniJob2 = new ScriptAniJob("chug_potion2", "s_potionfast_S0", new ScriptAni(0, 1));
            m.AddAniJob(aniJob2);
            aniJob1.NextAni = aniJob2;

            aniJob3 = new ScriptAniJob("chug_potion3", "t_potionfast_S0_2_Stand", new ScriptAni(0, 32));
            m.AddAniJob(aniJob3);
            aniJob2.NextAni = aniJob3;
        }
Beispiel #5
0
        public void DoUndrawWeapon(ItemInst item)
        {
            NPCCatalog.DrawWeaponAnis catalog;
            switch (item.ItemType)
            {
            default:
            case ItemTypes.Wep1H:
                catalog = AniCatalog.Draw1H;
                break;

            case ItemTypes.Wep2H:
                catalog = AniCatalog.Draw2H;
                break;

            case ItemTypes.WepBow:
                catalog = AniCatalog.DrawBow;
                break;

            case ItemTypes.WepXBow:
                catalog = AniCatalog.DrawXBow;
                break;

            case ItemTypes.Rune:
            case ItemTypes.Scroll:
                catalog = AniCatalog.DrawMagic;
                break;
            }

            if (GetDrawnWeapon() == null)
            {
            }
            else
            {
                ScriptAniJob job = Movement == NPCMovement.Stand && !Environment.InAir
                    ? catalog.Undraw
                    : catalog.UndrawWhileRunning;
                if (job == null || !ModelInst.TryGetAniFromJob(job, out ScriptAni ani)) // no animation
                {
                    UndrawWeapon(item);
                }
                else
                {
                    if (!ani.TryGetSpecialFrame(SpecialFrame.Draw, out float drawFrame))
                    {
                        drawFrame = 0;
                    }

                    ModelInst.StartAniJob(job, new FrameActionPair(drawFrame, () => UndrawWeapon(item)));
                }
            }
        }
Beispiel #6
0
 public bool ContainsPropertyForJob(ScriptAniJob job)
 {
     if (aniDict != null)
     {
         string propName;
         if (aniDict.TryGetValue(job.CodeName, out propName))
         {
             AniCatalog catalog;
             int        collectionIndex;
             return(FindProperty(propName, out catalog, out collectionIndex) != null);
         }
     }
     return(false);
 }
Beispiel #7
0
        public void DoUnaim()
        {
            var          drawnWeapon = GetDrawnWeapon();
            ScriptAniJob job         = (drawnWeapon != null && drawnWeapon.ItemType == ItemTypes.WepXBow) ? AniCatalog.FightXBow.Unaim : AniCatalog.FightBow.Unaim;

            if (job == null || !ModelInst.TryGetAniFromJob(job, out ScriptAni ani))
            {
                return;
            }
            else
            {
                this.ModelInst.StartAniJob(job);
            }
        }
Beispiel #8
0
        public void BuildDefinition()
        {
            // Dragon
            ModelDef m = new ModelDef("Dragon", "Dragon.mds");

            m.SetAniCatalog(new NPCCatalog());

            var aniJob = new ScriptAniJob("fistattack_fwd0", "s_FistAttack", new ScriptAni(0, 40));

            aniJob.DefaultAni.SetSpecialFrame(SpecialFrame.Hit, 24);
            m.AddAniJob(aniJob);

            // strafe anis for block
            aniJob = new ScriptAniJob("fist_parade", "t_FistRunStrafeL", new ScriptAni(0, 50));
            m.AddAniJob(aniJob);

            aniJob = new ScriptAniJob("fist_jumpback", "t_FistRunStrafeR", new ScriptAni(0, 50));
            m.AddAniJob(aniJob);

            m.Radius       = 120;
            m.HalfHeight   = 200;
            m.FistRange    = 300;
            m.CenterOffset = 20;
            m.Create();

            // NPCs
            NpcDef npcDef = new NpcDef("dragon_fire", _BaseDefFactory, _Registration);

            npcDef.Name     = "Feuerdrache";
            npcDef.Model    = m;
            npcDef.BodyMesh = "Dragon_FIRE_Body";
            npcDef.BodyTex  = 0;
            npcDef.HeadMesh = "";
            npcDef.HeadTex  = 0;
            npcDef.Guild    = 47;
            npcDef.Create();

            npcDef          = new NpcDef("dragon_undead", _BaseDefFactory, _Registration);
            npcDef.Name     = "Untoter Drache";
            npcDef.Model    = m;
            npcDef.BodyMesh = "Dragon_Undead_Body";
            npcDef.BodyTex  = 0;
            npcDef.HeadMesh = "";
            npcDef.HeadTex  = 0;
            npcDef.Guild    = 47;
            npcDef.Create();
        }
Beispiel #9
0
        public void DoTakeItem(ItemInst item)
        {
            ScriptAniJob job = AniCatalog?.ItemHandling.TakeItem;

            if (job != null && ModelInst.TryGetAniFromJob(job, out ScriptAni ani))
            {
                if (!ani.TryGetSpecialFrame(SpecialFrame.ItemHandle, out float frame))
                {
                    frame = float.MaxValue;
                }

                var pair = new Animations.FrameActionPair(frame, () => this.TakeItem(item));
                this.ModelInst.StartAniJob(job, 0.8f, 0, pair);
                return;
            }
            TakeItem(item);
        }
Beispiel #10
0
        void SetProperty(PropertyInfo prop, ScriptAniJob value, int index)
        {
            if (prop == null)
            {
                return;
            }

            if (prop.PropertyType == typeof(ScriptAniJob))
            {
                prop.SetValue(this, value, null);
            }
            else if (prop.PropertyType == typeof(AniJobCollection))
            {
                var collection = (AniJobCollection)prop.GetValue(this, null);
                collection[index] = value;
            }
        }
Beispiel #11
0
 public bool RemoveJob(ScriptAniJob job)
 {
     if (aniDict != null)
     {
         string propName;
         if (aniDict.TryGetValue(job.CodeName, out propName))
         {
             int          collectionIndex;
             AniCatalog   catalog;
             PropertyInfo prop = FindProperty(propName, out catalog, out collectionIndex);
             if (prop != null)
             {
                 catalog.RemoveProperty(prop, job, collectionIndex);
             }
         }
     }
     return(false);
 }
Beispiel #12
0
        public void DoDropItem(ItemInst item, int amount, Vec3f position, Angles angles)
        {
            item = item.Split(amount);

            ScriptAniJob job = AniCatalog?.ItemHandling.DropItem;

            if (job != null && ModelInst.TryGetAniFromJob(job, out ScriptAni ani))
            {
                if (!ani.TryGetSpecialFrame(SpecialFrame.ItemHandle, out float frame))
                {
                    frame = float.MaxValue;
                }

                var pair = new Animations.FrameActionPair(frame, () => this.DropItem(item, position, angles));
                this.ModelInst.StartAniJob(job, 0.8f, 0, pair);
                return;
            }
            DropItem(item, position, angles);
        }
Beispiel #13
0
        private void DoAttack(ScriptAniJob job, FightMoves move, int fwdCombo = 0)
        {
            if (job == null)
            {
                return;
            }

            if (!ModelInst.TryGetAniFromJob(job, out ScriptAni ani))
            {
                return;
            }

            // combo window
            if (!ani.TryGetSpecialFrame(SpecialFrame.Combo, out float comboFrame))
            {
                comboFrame = ani.EndFrame;
            }

            var comboPair = new FrameActionPair(comboFrame, () => OpenCombo());

            // hit frame
            if (!ani.TryGetSpecialFrame(SpecialFrame.Hit, out float hitFrame))
            {
                hitFrame = comboFrame;
            }

            if (hitFrame > comboFrame)
            {
                hitFrame = comboFrame;
            }

            var hitPair = new FrameActionPair(hitFrame, () => CalcHit());

            // end of animation
            var endPair = FrameActionPair.OnEnd(() => EndFightAni());

            // start ani first, because the OnEnd-Callback from the former attack resets the fight stance
            FightAnimation   = ModelInst.StartAniJob(job, comboPair, hitPair, endPair);
            CurrentFightMove = move;
            CanCombo         = false;
            ComboNum         = fwdCombo;
        }
Beispiel #14
0
        private void DoDodge(ScriptAniJob job)
        {
            if (job == null)
            {
                return;
            }

            if (!ModelInst.TryGetAniFromJob(job, out ScriptAni ani))
            {
                return;
            }

            // end of animation
            var endPair = FrameActionPair.OnEnd(() => EndFightAni());

            FightAnimation   = ModelInst.StartAniJob(job, endPair);
            CurrentFightMove = FightMoves.Dodge;
            CanCombo         = false;
            ComboNum         = 0;
        }
Beispiel #15
0
        void DoDodge(ScriptAniJob job)
        {
            if (job == null)
            {
                return;
            }

            if (!ModelInst.TryGetAniFromJob(job, out ScriptAni ani))
            {
                return;
            }

            // end of animation
            var endPair = Animations.FrameActionPair.OnEnd(() => EndFightAni());

            this.fightAni         = this.ModelInst.StartAniJob(job, endPair);
            this.currentFightMove = FightMoves.Dodge;
            this.canCombo         = false;
            this.comboNum         = 0;
        }
Beispiel #16
0
        public void BuildDefinition()
        {
            // Lurker
            ModelDef m = new ModelDef("Lurker", "Lurker.mds");

            m.SetAniCatalog(new NPCCatalog());

            var aniJob = new ScriptAniJob("fistattack_fwd0", "s_FistAttack", new ScriptAni(0, 20));

            aniJob.DefaultAni.SetSpecialFrame(SpecialFrame.Hit, 9);
            m.AddAniJob(aniJob);

            aniJob       = new ScriptAniJob("fistattack_run", "t_FistAttackMove", new ScriptAni(1, 15));
            aniJob.Layer = 2;
            aniJob.DefaultAni.SetSpecialFrame(SpecialFrame.Hit, 16);
            m.AddAniJob(aniJob);

            aniJob = new ScriptAniJob("fist_parade", "t_FistParade_0", new ScriptAni(0, 29));
            m.AddAniJob(aniJob);

            aniJob = new ScriptAniJob("fist_jumpback", "t_FistParadeJumpB", new ScriptAni(1, 20));
            m.AddAniJob(aniJob);

            m.Radius       = 60;
            m.HalfHeight   = 30;
            m.CenterOffset = 50;
            m.FistRange    = 100;
            m.Create();

            // NPCs
            NpcDef npcDef = new NpcDef("lurker", _BaseDefFactory, _Registration);

            npcDef.Name     = "Lurker";
            npcDef.Model    = m;
            npcDef.BodyMesh = "Lur_Body";
            npcDef.BodyTex  = 0;
            npcDef.HeadMesh = "";
            npcDef.HeadTex  = 0;
            npcDef.Guild    = 30;
            npcDef.Create();
        }
Beispiel #17
0
        public void BuildDefinition()
        {
            // Bloodfly
            ModelDef m = new ModelDef("Bloodfly", "Bloodfly.mds");

            m.SetAniCatalog(new NPCCatalog());

            var aniJob = new ScriptAniJob("fistattack_fwd0", "s_FistAttack", new ScriptAni(0, 59));

            aniJob.DefaultAni.SetSpecialFrame(SpecialFrame.Hit, 9);
            m.AddAniJob(aniJob);

            aniJob       = new ScriptAniJob("fistattack_run", "t_FistAttackMove", new ScriptAni(0, 29));
            aniJob.Layer = 2;
            aniJob.DefaultAni.SetSpecialFrame(SpecialFrame.Hit, 16);
            m.AddAniJob(aniJob);

            aniJob = new ScriptAniJob("fist_parade", "t_FistParade_0", new ScriptAni(0, 29));
            m.AddAniJob(aniJob);

            aniJob = new ScriptAniJob("fist_jumpback", "t_FistParadeJumpB", new ScriptAni(1, 19));
            m.AddAniJob(aniJob);

            m.Radius     = 40;
            m.HalfHeight = 40;
            m.FistRange  = 60;
            m.Create();

            // NPCs
            NpcDef npcDef = new NpcDef("bloodfly", _BaseDefFactory, _Registration);

            npcDef.Name     = "Blutfliege";
            npcDef.Model    = m;
            npcDef.BodyMesh = "Blo_Body";
            npcDef.BodyTex  = 0;
            npcDef.HeadMesh = "";
            npcDef.HeadTex  = 0;
            npcDef.Guild    = 25;
            npcDef.Create();
        }
Beispiel #18
0
 public bool AddJob(ScriptAniJob job)
 {
     if (aniDict != null)
     {
         string propName;
         if (aniDict.TryGetValue(job.CodeName, out propName))
         {
             int          collectionIndex;
             AniCatalog   catalog;
             PropertyInfo prop = FindProperty(propName, out catalog, out collectionIndex);
             if (prop != null)
             {
                 catalog.SetProperty(prop, job, collectionIndex);
             }
             else
             {
                 GUC.Log.Logger.Log("AniParser: Couldn't find property '{0}' for animation '{1}'.", propName, job.CodeName);
             }
         }
     }
     return(false);
 }
Beispiel #19
0
        public void DoShoot(Vec3f start, Vec3f end, ProjInst proj)
        {
            proj.Destination = end;
            proj.Shooter     = this;

            Angles rotation = Angles.FromAtVector(end - start);
            var    p        = rotation.Pitch; // rotate arrow correctly

            rotation.Pitch = rotation.Roll;
            rotation.Yaw  -= Angles.PI / 2;
            rotation.Roll  = p;

            proj.Spawn(this.World, start, rotation);

            var          drawnWeapon = GetDrawnWeapon();
            ScriptAniJob job         = (drawnWeapon != null && drawnWeapon.ItemType == ItemTypes.WepXBow) ? AniCatalog.FightXBow.Reload : AniCatalog.FightBow.Reload;

            if (job != null && ModelInst.TryGetAniFromJob(job, out ScriptAni ani))
            {
                this.ModelInst.StartAniJob(job);
            }
        }
Beispiel #20
0
        void RemoveProperty(PropertyInfo prop, ScriptAniJob value, int index)
        {
            if (prop == null)
            {
                return;
            }

            if (prop.PropertyType == typeof(ScriptAniJob))
            {
                ScriptAniJob other = (ScriptAniJob)prop.GetValue(this, null);
                if (other == value)
                {
                    prop.SetValue(this, null, null);
                }
            }
            else if (prop.PropertyType == typeof(AniJobCollection))
            {
                var collection = (AniJobCollection)prop.GetValue(this, null);
                if (collection[index] == value)
                {
                    collection[index] = null;
                }
            }
        }
Beispiel #21
0
        public void UseItem(ItemInst item)
        {
            if (item.ItemType != ItemTypes.Drinkable)
            {
                return;
            }

            ScriptAniJob job = AniCatalog?.ItemHandling.DrinkPotion;

            if (job != null && ModelInst.TryGetAniFromJob(job, out ScriptAni ani))
            {
                if (!ani.TryGetSpecialFrame(SpecialFrame.ItemHandle, out float frame))
                {
                    frame = float.MaxValue;
                }

                EquipItem(NPCSlots.RightHand, item);
                var pair = new FrameActionPair(frame, () => ChugPotion(item));
                ModelInst.StartAniJob(job, pair);
                return;
            }

            ChugPotion(item);
        }
Beispiel #22
0
        public void LiftUnconsciousness()
        {
            if (!IsUnconscious)
            {
                return;
            }

            var          cat = AniCatalog.Unconscious;
            ScriptAniJob job = _Uncon == Unconsciousness.Front ? cat.StandUpFront : cat.StandUpBack;

            if (job != null)
            {
                ModelInst.StartAniJob(job, DoLiftUncon);
            }
            else
            {
                DoLiftUncon();
            }

            if (unconTimer != null && unconTimer.Started)
            {
                unconTimer.Stop();
            }
        }
Beispiel #23
0
        public void BuildDefinition()
        {
            ModelDef m = new ModelDef("draconian", "draconian.mds");

            m.SetAniCatalog(new NPCCatalog());

            #region Draw

            // Draw 2h
            ScriptAniJob aniJob1 = new ScriptAniJob("draw2h_part0", "t_Run_2_2h");
            m.AddAniJob(aniJob1);
            aniJob1.SetDefaultAni(new ScriptAni(0, 5)
            {
                { SpecialFrame.Draw, 5 }
            });

            ScriptAniJob aniJob2 = new ScriptAniJob("draw2h_part1", "s_2h");
            m.AddAniJob(aniJob2);
            aniJob2.SetDefaultAni(new ScriptAni(0, 1));
            aniJob1.NextAni = aniJob2;

            ScriptAniJob aniJob3 = new ScriptAniJob("draw2h_part2", "t_2h_2_2hRun");
            m.AddAniJob(aniJob3);
            aniJob3.SetDefaultAni(new ScriptAni(0, 12));
            aniJob2.NextAni = aniJob3;

            // Draw 2h running
            ScriptAniJob aniJob = new ScriptAniJob("draw2h_running", "t_Move_2_2hMove", new ScriptAni(0, 20));
            aniJob.Layer = 2;
            aniJob.DefaultAni.SetSpecialFrame(SpecialFrame.Draw, 7);
            m.AddAniJob(aniJob);

            // Undraw 2h
            aniJob1 = new ScriptAniJob("undraw2h_part0", "t_2hRun_2_2h");
            m.AddAniJob(aniJob1);
            aniJob1.SetDefaultAni(new ScriptAni(0, 12)
            {
                { SpecialFrame.Draw, 12 }
            });

            aniJob2 = new ScriptAniJob("undraw2h_part1", "s_2h");
            m.AddAniJob(aniJob2);
            aniJob2.SetDefaultAni(new ScriptAni(0, 1));
            aniJob1.NextAni = aniJob2;

            aniJob3 = new ScriptAniJob("undraw2h_part2", "t_2h_2_Run");
            m.AddAniJob(aniJob3);
            aniJob3.SetDefaultAni(new ScriptAni(0, 5));
            aniJob2.NextAni = aniJob3;

            // Undraw 2h running
            aniJob       = new ScriptAniJob("undraw2h_running", "t_2hMove_2_Move", new ScriptAni(0, 20));
            aniJob.Layer = 2;
            aniJob.DefaultAni.SetSpecialFrame(SpecialFrame.Draw, 13);
            m.AddAniJob(aniJob);

            #endregion

            #region Fighting

            // Fwd attack 1
            ScriptAniJob job = new ScriptAniJob("2hattack_fwd0", "s_2hattack");
            m.AddAniJob(job);
            job.SetDefaultAni(new ScriptAni(0, 24)
            {
                { SpecialFrame.Hit, 6 }, { SpecialFrame.Combo, 11 }
            });

            // fwd combo 2
            job = new ScriptAniJob("2hattack_fwd1", "s_2hattack");
            m.AddAniJob(job);
            job.SetDefaultAni(new ScriptAni(25, 70)
            {
                { SpecialFrame.Hit, 20 }
            });

            // left attack
            job = new ScriptAniJob("2hattack_left", "t_2hAttackL");
            m.AddAniJob(job);
            job.SetDefaultAni(new ScriptAni(0, 24)
            {
                { SpecialFrame.Hit, 3 }, { SpecialFrame.Combo, 8 }
            });

            // right attack
            job = new ScriptAniJob("2hattack_right", "t_2hAttackR");
            m.AddAniJob(job);
            job.SetDefaultAni(new ScriptAni(0, 24)
            {
                { SpecialFrame.Hit, 3 }, { SpecialFrame.Combo, 8 }
            });

            // run attack
            job       = new ScriptAniJob("2hattack_run", "t_2hAttackMove");
            job.Layer = 2;
            m.AddAniJob(job);
            job.SetDefaultAni(new ScriptAni(0, 19)
            {
                { SpecialFrame.Hit, 13 }
            });

            // parades
            job = new ScriptAniJob("2h_parade0", "t_2hParade_0");
            m.AddAniJob(job);
            job.SetDefaultAni(new ScriptAni(0, 30));

            // dodge
            job = new ScriptAniJob("2h_dodge", "t_2hParadeJumpB");
            m.AddAniJob(job);
            job.SetDefaultAni(new ScriptAni(0, 14));

            #endregion

            #region Jump Anis

            m.AddAniJob(new ScriptAniJob("jump_fwd", "t_Stand_2_Jump"));
            m.AddAniJob(new ScriptAniJob("jump_run", "t_RunL_2_Jump"));


            #endregion

            #region Climb Anis

            var ani1 = new ScriptAniJob("climb_low", "t_Stand_2_JumpUpLow", new ScriptAni(0, 10));
            var ani2 = new ScriptAniJob("climb_low1", "s_JumpUpLow", new ScriptAni(0, 4));
            var ani3 = new ScriptAniJob("climb_low2", "t_JumpUpLow_2_Stand", new ScriptAni(0, 15));

            m.AddAniJob(ani1);
            m.AddAniJob(ani2);
            m.AddAniJob(ani3);

            ani1.NextAni = ani2;
            ani2.NextAni = ani3;

            ani1 = new ScriptAniJob("climb_mid", "t_Stand_2_JumpUpMid", new ScriptAni(0, 10));
            ani2 = new ScriptAniJob("climb_mid1", "s_JumpUpMid", new ScriptAni(0, 2));
            ani3 = new ScriptAniJob("climb_mid2", "t_JumpUpMid_2_Stand", new ScriptAni(0, 23));

            m.AddAniJob(ani1);
            m.AddAniJob(ani2);
            m.AddAniJob(ani3);

            ani1.NextAni = ani2;
            ani2.NextAni = ani3;

            ani1 = new ScriptAniJob("climb_high", "t_Stand_2_JumpUp", new ScriptAni(0, 9));
            ani2 = new ScriptAniJob("climb_high1", "t_JumpUp_2_Hang", new ScriptAni(0, 2));
            ani3 = new ScriptAniJob("climb_high2", "t_Hang_2_Stand", new ScriptAni(0, 40));

            m.AddAniJob(ani1);
            m.AddAniJob(ani2);
            m.AddAniJob(ani3);

            ani1.NextAni = ani2;
            ani2.NextAni = ani3;

            #endregion

            m.Radius       = 80;
            m.HalfHeight   = 100;
            m.CenterOffset = 20;
            m.Create();

            // NPCs
            NpcDef npcDef = new NpcDef("draconian", _BaseDefFactory, _Registration);
            npcDef.Name     = "Echsenmensch";
            npcDef.Model    = m;
            npcDef.BodyMesh = "Draconian_Body";
            npcDef.BodyTex  = 0;
            npcDef.HeadMesh = "";
            npcDef.HeadTex  = 0;
            npcDef.Guild    = 62;
            npcDef.Create();
        }
Beispiel #24
0
        void Add1HAnis(ModelDef model)
        {
            var ov1 = new ScriptOverlay("1HST1", "Humans_1hST1"); model.AddOverlay(ov1);
            var ov2 = new ScriptOverlay("1HST2", "Humans_1hST2"); model.AddOverlay(ov2);

            // Draw 1h
            ScriptAniJob aniJob1 = new ScriptAniJob("draw1h_part0", "t_Run_2_1h");

            model.AddAniJob(aniJob1);
            aniJob1.SetDefaultAni(new ScriptAni(0, 2)
            {
                { SpecialFrame.Draw, 2 }
            });
            aniJob1.AddOverlayAni(new ScriptAni(0, 3)
            {
                { SpecialFrame.Draw, 3 }
            }, ov1);
            aniJob1.AddOverlayAni(new ScriptAni(0, 1)
            {
                { SpecialFrame.Draw, 1 }
            }, ov2);

            ScriptAniJob aniJob2 = new ScriptAniJob("draw1h_part1", "s_1h");

            model.AddAniJob(aniJob2);
            aniJob2.SetDefaultAni(new ScriptAni(0, 1));
            aniJob2.AddOverlayAni(new ScriptAni(0, 1), ov1);
            aniJob2.AddOverlayAni(new ScriptAni(0, 1), ov2);
            aniJob1.NextAni = aniJob2;

            ScriptAniJob aniJob3 = new ScriptAniJob("draw1h_part2", "t_1h_2_1hRun");

            model.AddAniJob(aniJob3);
            aniJob3.SetDefaultAni(new ScriptAni(0, 12));
            aniJob3.AddOverlayAni(new ScriptAni(0, 6), ov1);
            aniJob2.AddOverlayAni(new ScriptAni(0, 8), ov2);
            aniJob2.NextAni = aniJob3;

            // Draw 1h running
            ScriptAniJob aniJob = new ScriptAniJob("draw1h_running", "t_Move_2_1hMove", new ScriptAni(0, 24));

            aniJob.Layer = 2;
            aniJob.DefaultAni.SetSpecialFrame(SpecialFrame.Draw, 6);
            model.AddAniJob(aniJob);

            // Undraw 1h
            aniJob1 = new ScriptAniJob("undraw1h_part0", "t_1hRun_2_1h");
            model.AddAniJob(aniJob1);
            aniJob1.SetDefaultAni(new ScriptAni(0, 12)
            {
                { SpecialFrame.Draw, 12 }
            });
            aniJob1.AddOverlayAni(new ScriptAni(0, 6)
            {
                { SpecialFrame.Draw, 6 }
            }, ov1);
            aniJob1.AddOverlayAni(new ScriptAni(0, 8)
            {
                { SpecialFrame.Draw, 8 }
            }, ov2);

            aniJob2 = new ScriptAniJob("undraw1h_part1", "s_1h");
            model.AddAniJob(aniJob2);
            aniJob2.SetDefaultAni(new ScriptAni(0, 1));
            aniJob2.AddOverlayAni(new ScriptAni(0, 1), ov1);
            aniJob2.AddOverlayAni(new ScriptAni(0, 1), ov2);
            aniJob1.NextAni = aniJob2;

            aniJob3 = new ScriptAniJob("undraw1h_part2", "t_1h_2_Run");
            model.AddAniJob(aniJob3);
            aniJob3.SetDefaultAni(new ScriptAni(0, 2));
            aniJob3.AddOverlayAni(new ScriptAni(0, 3), ov1);
            aniJob2.AddOverlayAni(new ScriptAni(0, 1), ov2);
            aniJob2.NextAni = aniJob3;

            // Undraw 1h running
            aniJob       = new ScriptAniJob("undraw1h_running", "t_1hMove_2_Move", new ScriptAni(0, 24));
            aniJob.Layer = 2;
            aniJob.DefaultAni.SetSpecialFrame(SpecialFrame.Draw, 18);
            model.AddAniJob(aniJob);

            // Fwd attack 1
            ScriptAniJob job = new ScriptAniJob("1hattack_fwd0", "s_1hattack");

            model.AddAniJob(job);
            job.SetDefaultAni(new ScriptAni(0, 23)
            {
                { SpecialFrame.Hit, 6 }, { SpecialFrame.Combo, 15 }
            });
            job.AddOverlayAni(new ScriptAni(0, 33)
            {
                { SpecialFrame.Hit, 4 }, { SpecialFrame.Combo, 14 }
            }, ov1);
            job.AddOverlayAni(new ScriptAni(0, 29)
            {
                { SpecialFrame.Hit, 4 }, { SpecialFrame.Combo, 10 }
            }, ov2);

            // fwd combo 2
            job = new ScriptAniJob("1hattack_fwd1", "s_1hattack");
            model.AddAniJob(job);
            job.SetDefaultAni(new ScriptAni(26, 40)
            {
                { SpecialFrame.Hit, 7 }
            });
            job.AddOverlayAni(new ScriptAni(33, 68)
            {
                { SpecialFrame.Hit, 4 }, { SpecialFrame.Combo, 15 }
            }, ov1);
            job.AddOverlayAni(new ScriptAni(33, 60)
            {
                { SpecialFrame.Hit, 3 }, { SpecialFrame.Combo, 9 }
            }, ov2);

            // fwd combo 3
            job = new ScriptAniJob("1hattack_fwd2", "s_1hattack");
            model.AddAniJob(job);
            job.AddOverlayAni(new ScriptAni(68, 103)
            {
                { SpecialFrame.Hit, 6 }, { SpecialFrame.Combo, 17 }
            }, ov1);
            job.AddOverlayAni(new ScriptAni(65, 92)
            {
                { SpecialFrame.Hit, 8 }, { SpecialFrame.Combo, 13 }
            }, ov2);

            // fwd combo 4
            job = new ScriptAniJob("1hattack_fwd3", "s_1hattack");
            model.AddAniJob(job);
            job.AddOverlayAni(new ScriptAni(103, 120)
            {
                { SpecialFrame.Hit, 7 }
            }, ov1);
            job.AddOverlayAni(new ScriptAni(97, 113)
            {
                { SpecialFrame.Hit, 10 }
            }, ov2);

            // left attack
            job = new ScriptAniJob("1hattack_left", "t_1HAttackL");
            model.AddAniJob(job);
            job.SetDefaultAni(new ScriptAni(0, 30)
            {
                { SpecialFrame.Hit, 5 }, { SpecialFrame.Combo, 15 }
            });
            job.AddOverlayAni(new ScriptAni(0, 24)
            {
                { SpecialFrame.Hit, 4 }, { SpecialFrame.Combo, 10 }
            }, ov1);
            job.AddOverlayAni(new ScriptAni(0, 20)
            {
                { SpecialFrame.Hit, 3 }, { SpecialFrame.Combo, 8 }
            }, ov2);

            // right attack
            job = new ScriptAniJob("1hattack_right", "t_1HAttackR");
            model.AddAniJob(job);
            job.SetDefaultAni(new ScriptAni(0, 30)
            {
                { SpecialFrame.Hit, 5 }, { SpecialFrame.Combo, 15 }
            });
            job.AddOverlayAni(new ScriptAni(0, 24)
            {
                { SpecialFrame.Hit, 4 }, { SpecialFrame.Combo, 10 }
            }, ov1);
            job.AddOverlayAni(new ScriptAni(0, 20)
            {
                { SpecialFrame.Hit, 3 }, { SpecialFrame.Combo, 8 }
            }, ov2);

            // run attack
            job       = new ScriptAniJob("1hattack_run", "t_1HAttackMove");
            job.Layer = 2;
            model.AddAniJob(job);
            job.SetDefaultAni(new ScriptAni(0, 29)
            {
                { SpecialFrame.Hit, 16 }
            });

            // parades
            job = new ScriptAniJob("1h_parade0", "t_1HParade_0");
            model.AddAniJob(job);
            job.SetDefaultAni(new ScriptAni(0, 15));

            job = new ScriptAniJob("1h_parade1", "t_1HParade_0_A2");
            model.AddAniJob(job);
            job.SetDefaultAni(new ScriptAni(0, 15));

            job = new ScriptAniJob("1h_parade2", "t_1HParade_0_A3");
            model.AddAniJob(job);
            job.SetDefaultAni(new ScriptAni(0, 15));

            // dodge
            job = new ScriptAniJob("1h_dodge", "t_1HParadeJumpB");
            model.AddAniJob(job);
            job.SetDefaultAni(new ScriptAni(0, 14));
        }
Beispiel #25
0
        public void DoDrawWeapon(ItemInst item)
        {
            NPCCatalog.DrawWeaponAnis catalog;
            switch (item.ItemType)
            {
            default:
            case ItemTypes.Wep1H:
                catalog = AniCatalog.Draw1H;
                break;

            case ItemTypes.Wep2H:
                catalog = AniCatalog.Draw2H;
                break;

            case ItemTypes.WepBow:
                catalog = AniCatalog.DrawBow;
                break;

            case ItemTypes.WepXBow:
                catalog = AniCatalog.DrawXBow;
                break;

            case ItemTypes.Rune:
            case ItemTypes.Scroll:
                catalog = AniCatalog.DrawMagic;
                break;
            }

            if (IsInFightMode || GetDrawnWeapon() != null)
            {
                /*if (this.DrawnWeapon != null)
                 * {
                 *  ItemInst weapon = this.DrawnWeapon;
                 *  catalog = GetDrawWeaponCatalog(weapon.ItemType);
                 *  // weapon draw while running or when standing
                 *  if (this.Movement == NPCMovement.Forward || this.Movement == NPCMovement.Left || this.Movement == NPCMovement.Right)
                 *  {
                 *      this.ModelInst.StartAniJob(catalog.UndrawWhileRunning, 0.1f, () =>
                 *      {
                 *          this.UnequipItem(weapon); // take weapon from hand
                 *          this.EquipItem(weapon); // place weapon into parking slot
                 *      });
                 *  }
                 *  else
                 *  {
                 *      this.ModelInst.StartAniJob(catalog.Undraw, 0.1f, () =>
                 *      {
                 *          this.UnequipItem(weapon); // take weapon from hand
                 *          this.EquipItem(weapon); // place weapon into parking slot
                 *      });
                 *  }
                 * }
                 * this.SetFightMode(false);*/
            }
            else
            {
                ScriptAniJob job = Movement == NPCMovement.Stand && !Environment.InAir
                    ? catalog.Draw
                    : catalog.DrawWhileRunning;
                if (job == null || !ModelInst.TryGetAniFromJob(job, out ScriptAni ani)) // no animation
                {
                    DrawWeapon(item);
                }
                else
                {
                    if (!ani.TryGetSpecialFrame(SpecialFrame.Draw, out float drawFrame))
                    {
                        drawFrame = 0;
                    }

                    ModelInst.StartAniJob(job, new FrameActionPair(drawFrame, () => DrawWeapon(item)));
                }
            }
        }
Beispiel #26
0
        void Add2hAnis(ModelDef model)
        {
            var ov1 = new ScriptOverlay("2HST1", "Humans_2hST1"); model.AddOverlay(ov1);
            var ov2 = new ScriptOverlay("2HST2", "Humans_2hST2"); model.AddOverlay(ov2);

            // Draw 2h
            ScriptAniJob aniJob1 = new ScriptAniJob("draw2h_part0", "t_Run_2_2h");

            model.AddAniJob(aniJob1);
            aniJob1.SetDefaultAni(new ScriptAni(0, 4)
            {
                { SpecialFrame.Draw, 4 }
            });
            aniJob1.AddOverlayAni(new ScriptAni(0, 4)
            {
                { SpecialFrame.Draw, 4 }
            }, ov1);
            aniJob1.AddOverlayAni(new ScriptAni(0, 3)
            {
                { SpecialFrame.Draw, 3 }
            }, ov2);

            ScriptAniJob aniJob2 = new ScriptAniJob("draw2h_part1", "s_2h");

            model.AddAniJob(aniJob2);
            aniJob2.SetDefaultAni(new ScriptAni(0, 1));
            aniJob2.AddOverlayAni(new ScriptAni(0, 1), ov1);
            aniJob2.AddOverlayAni(new ScriptAni(0, 1), ov2);
            aniJob1.NextAni = aniJob2;

            ScriptAniJob aniJob3 = new ScriptAniJob("draw2h_part2", "t_2h_2_2hRun");

            model.AddAniJob(aniJob3);
            aniJob3.SetDefaultAni(new ScriptAni(0, 15));
            aniJob3.AddOverlayAni(new ScriptAni(0, 15), ov1);
            aniJob2.AddOverlayAni(new ScriptAni(0, 10), ov2);
            aniJob2.NextAni = aniJob3;

            // Draw 2h running
            ScriptAniJob aniJob = new ScriptAniJob("draw2h_running", "t_Move_2_2hMove", new ScriptAni(0, 24));

            aniJob.Layer = 2;
            aniJob.DefaultAni.SetSpecialFrame(SpecialFrame.Draw, 6);
            model.AddAniJob(aniJob);

            // Undraw 2h
            aniJob1 = new ScriptAniJob("undraw2h_part0", "t_2hRun_2_2h");
            model.AddAniJob(aniJob1);
            aniJob1.SetDefaultAni(new ScriptAni(0, 15)
            {
                { SpecialFrame.Draw, 15 }
            });
            aniJob1.AddOverlayAni(new ScriptAni(0, 15)
            {
                { SpecialFrame.Draw, 15 }
            }, ov1);
            aniJob1.AddOverlayAni(new ScriptAni(0, 10)
            {
                { SpecialFrame.Draw, 10 }
            }, ov2);

            aniJob2 = new ScriptAniJob("undraw2h_part1", "s_2h");
            model.AddAniJob(aniJob2);
            aniJob2.SetDefaultAni(new ScriptAni(0, 1));
            aniJob2.AddOverlayAni(new ScriptAni(0, 1), ov1);
            aniJob2.AddOverlayAni(new ScriptAni(0, 1), ov2);
            aniJob1.NextAni = aniJob2;

            aniJob3 = new ScriptAniJob("undraw2h_part2", "t_2h_2_Run");
            model.AddAniJob(aniJob3);
            aniJob3.SetDefaultAni(new ScriptAni(0, 4));
            aniJob3.AddOverlayAni(new ScriptAni(0, 4), ov1);
            aniJob2.AddOverlayAni(new ScriptAni(0, 3), ov2);
            aniJob2.NextAni = aniJob3;

            // Undraw 2h running
            aniJob       = new ScriptAniJob("undraw2h_running", "t_2hMove_2_Move", new ScriptAni(0, 24));
            aniJob.Layer = 2;
            aniJob.DefaultAni.SetSpecialFrame(SpecialFrame.Draw, 18);
            model.AddAniJob(aniJob);

            // Fwd attack 1
            ScriptAniJob job = new ScriptAniJob("2hattack_fwd0", "s_2hattack");

            model.AddAniJob(job);
            job.SetDefaultAni(new ScriptAni(0, 26)
            {
                { SpecialFrame.Hit, 8 }, { SpecialFrame.Combo, 14 }
            });
            job.AddOverlayAni(new ScriptAni(0, 35)
            {
                { SpecialFrame.Hit, 6 }, { SpecialFrame.Combo, 16 }
            }, ov1);
            job.AddOverlayAni(new ScriptAni(0, 34)
            {
                { SpecialFrame.Hit, 5 }, { SpecialFrame.Combo, 13 }
            }, ov2);

            // fwd combo 2
            job = new ScriptAniJob("2hattack_fwd1", "s_2hattack");
            model.AddAniJob(job);
            job.SetDefaultAni(new ScriptAni(31, 50)
            {
                { SpecialFrame.Hit, 6 }
            });
            job.AddOverlayAni(new ScriptAni(40, 75)
            {
                { SpecialFrame.Hit, 6 }, { SpecialFrame.Combo, 16 }
            }, ov1);
            job.AddOverlayAni(new ScriptAni(39, 75)
            {
                { SpecialFrame.Hit, 4 }, { SpecialFrame.Combo, 12 }
            }, ov2);

            // fwd combo 3
            job = new ScriptAniJob("2hattack_fwd2", "s_2hattack");
            model.AddAniJob(job);
            job.AddOverlayAni(new ScriptAni(80, 114)
            {
                { SpecialFrame.Hit, 6 }, { SpecialFrame.Combo, 16 }
            }, ov1);
            job.AddOverlayAni(new ScriptAni(79, 118)
            {
                { SpecialFrame.Hit, 9 }, { SpecialFrame.Combo, 17 }
            }, ov2);

            // fwd combo 4
            job = new ScriptAniJob("2hattack_fwd3", "s_2hattack");
            model.AddAniJob(job);
            job.AddOverlayAni(new ScriptAni(124, 146)
            {
                { SpecialFrame.Hit, 12 }
            }, ov2);

            // left attack
            job = new ScriptAniJob("2hattack_left", "t_2hAttackL");
            model.AddAniJob(job);
            job.SetDefaultAni(new ScriptAni(0, 36)
            {
                { SpecialFrame.Hit, 6 }, { SpecialFrame.Combo, 18 }
            });
            job.AddOverlayAni(new ScriptAni(0, 28)
            {
                { SpecialFrame.Hit, 5 }, { SpecialFrame.Combo, 14 }
            }, ov1);
            job.AddOverlayAni(new ScriptAni(0, 26)
            {
                { SpecialFrame.Hit, 5 }, { SpecialFrame.Combo, 14 }
            }, ov2);

            // right attack
            job = new ScriptAniJob("2hattack_right", "t_2hAttackR");
            model.AddAniJob(job);
            job.SetDefaultAni(new ScriptAni(0, 36)
            {
                { SpecialFrame.Hit, 6 }, { SpecialFrame.Combo, 18 }
            });
            job.AddOverlayAni(new ScriptAni(0, 29)
            {
                { SpecialFrame.Hit, 5 }, { SpecialFrame.Combo, 14 }
            }, ov1);
            job.AddOverlayAni(new ScriptAni(0, 26)
            {
                { SpecialFrame.Hit, 5 }, { SpecialFrame.Combo, 14 }
            }, ov2);

            // run attack
            job       = new ScriptAniJob("2hattack_run", "t_2hAttackMove");
            job.Layer = 2;
            model.AddAniJob(job);
            job.SetDefaultAni(new ScriptAni(0, 23)
            {
                { SpecialFrame.Hit, 12 }
            });

            // parades
            job = new ScriptAniJob("2h_parade0", "t_2hParade_0");
            model.AddAniJob(job);
            job.SetDefaultAni(new ScriptAni(0, 15));

            job = new ScriptAniJob("2h_parade1", "t_2hParade_0_A2");
            model.AddAniJob(job);
            job.SetDefaultAni(new ScriptAni(0, 15));

            job = new ScriptAniJob("2h_parade2", "t_2hParade_0_A3");
            model.AddAniJob(job);
            job.SetDefaultAni(new ScriptAni(0, 15));

            // dodge
            job = new ScriptAniJob("2h_dodge", "t_2hParadeJumpB");
            model.AddAniJob(job);
            job.SetDefaultAni(new ScriptAni(0, 24));
        }
Beispiel #27
0
        void AddBowAnis(ModelDef model)
        {
            var ov1 = new ScriptOverlay("BowT1", "Humans_BowT1"); model.AddOverlay(ov1);
            var ov2 = new ScriptOverlay("BowT2", "Humans_BowT2"); model.AddOverlay(ov2);

            ScriptAniJob aniJob1 = new ScriptAniJob("drawbow_part0", "t_Run_2_bow");

            model.AddAniJob(aniJob1);
            aniJob1.SetDefaultAni(new ScriptAni(0, 5)
            {
                { SpecialFrame.Draw, 5 }
            });
            aniJob1.AddOverlayAni(new ScriptAni(0, 5)
            {
                { SpecialFrame.Draw, 5 }
            }, ov1);
            aniJob1.AddOverlayAni(new ScriptAni(0, 5)
            {
                { SpecialFrame.Draw, 5 }
            }, ov2);

            ScriptAniJob aniJob2 = new ScriptAniJob("drawbow_part1", "s_bow");

            model.AddAniJob(aniJob2);
            aniJob2.SetDefaultAni(new ScriptAni(0, 1));
            aniJob2.AddOverlayAni(new ScriptAni(0, 1), ov1);
            aniJob2.AddOverlayAni(new ScriptAni(0, 1), ov2);
            aniJob1.NextAni = aniJob2;

            ScriptAniJob aniJob3 = new ScriptAniJob("drawbow_part2", "t_bow_2_bowRun");

            model.AddAniJob(aniJob3);
            aniJob3.SetDefaultAni(new ScriptAni(0, 12));
            aniJob3.AddOverlayAni(new ScriptAni(0, 10), ov1);
            aniJob2.AddOverlayAni(new ScriptAni(0, 8), ov2);
            aniJob2.NextAni = aniJob3;

            ScriptAniJob aniJob = new ScriptAniJob("drawbow_running", "t_Move_2_BowMove", new ScriptAni(0, 19));

            aniJob.Layer = 2;
            aniJob.DefaultAni.SetSpecialFrame(SpecialFrame.Draw, 7);
            model.AddAniJob(aniJob);

            aniJob1 = new ScriptAniJob("undrawbow_part0", "t_BowRun_2_Bow");
            model.AddAniJob(aniJob1);
            aniJob1.SetDefaultAni(new ScriptAni(0, 12)
            {
                { SpecialFrame.Draw, 12 }
            });
            aniJob1.AddOverlayAni(new ScriptAni(0, 10)
            {
                { SpecialFrame.Draw, 10 }
            }, ov1);
            aniJob1.AddOverlayAni(new ScriptAni(0, 8)
            {
                { SpecialFrame.Draw, 8 }
            }, ov2);

            aniJob2 = new ScriptAniJob("undrawbow_part1", "s_Bow");
            model.AddAniJob(aniJob2);
            aniJob2.SetDefaultAni(new ScriptAni(0, 1));
            aniJob2.AddOverlayAni(new ScriptAni(0, 1), ov1);
            aniJob2.AddOverlayAni(new ScriptAni(0, 1), ov2);
            aniJob1.NextAni = aniJob2;

            aniJob3 = new ScriptAniJob("undrawbow_part2", "t_bow_2_Run");
            model.AddAniJob(aniJob3);
            aniJob3.SetDefaultAni(new ScriptAni(0, 5));
            aniJob3.AddOverlayAni(new ScriptAni(0, 5), ov1);
            aniJob2.AddOverlayAni(new ScriptAni(0, 5), ov2);
            aniJob2.NextAni = aniJob3;

            aniJob       = new ScriptAniJob("undrawbow_running", "t_BowMove_2_Move", new ScriptAni(0, 19));
            aniJob.Layer = 2;
            aniJob.DefaultAni.SetSpecialFrame(SpecialFrame.Draw, 12);
            model.AddAniJob(aniJob);

            aniJob1 = new ScriptAniJob("aim_bow", "t_bowwalk_2_bowaim");
            model.AddAniJob(aniJob1);
            aniJob1.SetDefaultAni(new ScriptAni(0, 11));
            aniJob1.AddOverlayAni(new ScriptAni(0, 11), ov1);
            aniJob1.AddOverlayAni(new ScriptAni(0, 11), ov2);

            aniJob2 = new ScriptAniJob("aiming_bow", "s_BowAim");
            model.AddAniJob(aniJob2);
            aniJob2.SetDefaultAni(new ScriptAni());
            aniJob2.AddOverlayAni(new ScriptAni(), ov1);
            aniJob2.AddOverlayAni(new ScriptAni(), ov2);
            aniJob1.NextAni = aniJob2;

            // fixme: add s_bowshoot too?
            aniJob1 = new ScriptAniJob("reload_bow", "t_BowReload");
            model.AddAniJob(aniJob1);
            aniJob1.SetDefaultAni(new ScriptAni(0, 28));
            aniJob1.AddOverlayAni(new ScriptAni(0, 26), ov1);
            aniJob1.AddOverlayAni(new ScriptAni(0, 22), ov2);
            aniJob1.NextAni = aniJob2;

            aniJob1 = new ScriptAniJob("unaim_bow", "t_BowAim_2_Bowwalk");
            model.AddAniJob(aniJob1);
            aniJob1.SetDefaultAni(new ScriptAni(0, 11));
            aniJob1.AddOverlayAni(new ScriptAni(0, 11), ov1);
            aniJob1.AddOverlayAni(new ScriptAni(0, 11), ov2);
        }
Beispiel #28
0
        void AddXBowAnis(ModelDef model)
        {
            var ov1 = new ScriptOverlay("XBowT1", "Humans_CBowT1"); model.AddOverlay(ov1);
            var ov2 = new ScriptOverlay("XBowT2", "Humans_CBowT2"); model.AddOverlay(ov2);

            ScriptAniJob aniJob1 = new ScriptAniJob("drawXbow_part0", "t_Run_2_Cbow");

            model.AddAniJob(aniJob1);
            aniJob1.SetDefaultAni(new ScriptAni(0, 4)
            {
                { SpecialFrame.Draw, 4 }
            });
            aniJob1.AddOverlayAni(new ScriptAni(0, 4)
            {
                { SpecialFrame.Draw, 4 }
            }, ov1);
            aniJob1.AddOverlayAni(new ScriptAni(0, 4)
            {
                { SpecialFrame.Draw, 4 }
            }, ov2);

            ScriptAniJob aniJob2 = new ScriptAniJob("drawXbow_part1", "s_Cbow");

            model.AddAniJob(aniJob2);
            aniJob2.SetDefaultAni(new ScriptAni(0, 1));
            aniJob2.AddOverlayAni(new ScriptAni(0, 1), ov1);
            aniJob2.AddOverlayAni(new ScriptAni(0, 1), ov2);
            aniJob1.NextAni = aniJob2;

            ScriptAniJob aniJob3 = new ScriptAniJob("drawXbow_part2", "t_Cbow_2_CbowRun");

            model.AddAniJob(aniJob3);
            aniJob3.SetDefaultAni(new ScriptAni(0, 33));
            aniJob3.AddOverlayAni(new ScriptAni(0, 29), ov1);
            aniJob2.AddOverlayAni(new ScriptAni(0, 25), ov2);
            aniJob2.NextAni = aniJob3;

            ScriptAniJob aniJob = new ScriptAniJob("drawXbow_running", "t_Move_2_CBowMove", new ScriptAni(0, 39));

            aniJob.Layer = 2;
            aniJob.DefaultAni.SetSpecialFrame(SpecialFrame.Draw, 7);
            model.AddAniJob(aniJob);

            aniJob1 = new ScriptAniJob("undrawXbow_part0", "t_CBowRun_2_CBow");
            model.AddAniJob(aniJob1);
            aniJob1.SetDefaultAni(new ScriptAni(0, 33)
            {
                { SpecialFrame.Draw, 33 }
            });
            aniJob1.AddOverlayAni(new ScriptAni(0, 29)
            {
                { SpecialFrame.Draw, 29 }
            }, ov1);
            aniJob1.AddOverlayAni(new ScriptAni(0, 25)
            {
                { SpecialFrame.Draw, 25 }
            }, ov2);

            aniJob2 = new ScriptAniJob("undrawXbow_part1", "s_CBow");
            model.AddAniJob(aniJob2);
            aniJob2.SetDefaultAni(new ScriptAni(0, 1));
            aniJob2.AddOverlayAni(new ScriptAni(0, 1), ov1);
            aniJob2.AddOverlayAni(new ScriptAni(0, 1), ov2);
            aniJob1.NextAni = aniJob2;

            aniJob3 = new ScriptAniJob("undrawXbow_part2", "t_Cbow_2_Run");
            model.AddAniJob(aniJob3);
            aniJob3.SetDefaultAni(new ScriptAni(0, 4));
            aniJob3.AddOverlayAni(new ScriptAni(0, 4), ov1);
            aniJob2.AddOverlayAni(new ScriptAni(0, 4), ov2);
            aniJob2.NextAni = aniJob3;

            aniJob       = new ScriptAniJob("undrawXbow_running", "t_CBowMove_2_Move", new ScriptAni(0, 39));
            aniJob.Layer = 2;
            aniJob.DefaultAni.SetSpecialFrame(SpecialFrame.Draw, 32);
            model.AddAniJob(aniJob);

            aniJob1 = new ScriptAniJob("aim_xbow", "t_cbowwalk_2_cbowaim");
            model.AddAniJob(aniJob1);
            aniJob1.SetDefaultAni(new ScriptAni(0, 5));
            aniJob1.AddOverlayAni(new ScriptAni(0, 6), ov1);
            aniJob1.AddOverlayAni(new ScriptAni(0, 6), ov2);

            aniJob2 = new ScriptAniJob("aiming_xbow", "s_CBowAim");
            model.AddAniJob(aniJob2);
            aniJob2.SetDefaultAni(new ScriptAni());
            aniJob2.AddOverlayAni(new ScriptAni(), ov1);
            aniJob2.AddOverlayAni(new ScriptAni(), ov2);
            aniJob1.NextAni = aniJob2;

            // fixme: add s_bowshoot too?
            aniJob1 = new ScriptAniJob("reload_xbow", "t_CBowReload");
            model.AddAniJob(aniJob1);
            aniJob1.SetDefaultAni(new ScriptAni(0, 32));
            aniJob1.AddOverlayAni(new ScriptAni(0, 29), ov1);
            aniJob1.AddOverlayAni(new ScriptAni(0, 23), ov2);
            aniJob1.NextAni = aniJob2;

            aniJob1 = new ScriptAniJob("unaim_xbow", "t_CBowAim_2_CBowwalk");
            model.AddAniJob(aniJob1);
            aniJob1.SetDefaultAni(new ScriptAni(0, 6));
            aniJob1.AddOverlayAni(new ScriptAni(0, 6), ov1);
            aniJob1.AddOverlayAni(new ScriptAni(0, 6), ov2);
        }
Beispiel #29
0
        public void BuildDefinition()
        {
            ModelDef m = new ModelDef("orc", "orc.mds");

            m.SetAniCatalog(new NPCCatalog());

            #region Draw

            // Draw 2h
            ScriptAniJob aniJob1 = new ScriptAniJob("draw2h_part0", "t_Run_2_2h");
            m.AddAniJob(aniJob1);
            aniJob1.SetDefaultAni(new ScriptAni(0, 5)
            {
                { SpecialFrame.Draw, 5 }
            });

            ScriptAniJob aniJob2 = new ScriptAniJob("draw2h_part1", "s_2h");
            m.AddAniJob(aniJob2);
            aniJob2.SetDefaultAni(new ScriptAni(0, 1));
            aniJob1.NextAni = aniJob2;

            ScriptAniJob aniJob3 = new ScriptAniJob("draw2h_part2", "t_2h_2_2hRun");
            m.AddAniJob(aniJob3);
            aniJob3.SetDefaultAni(new ScriptAni(0, 12));
            aniJob2.NextAni = aniJob3;

            // Draw 2h running
            ScriptAniJob aniJob = new ScriptAniJob("draw2h_running", "t_Move_2_2hMove", new ScriptAni(0, 20));
            aniJob.Layer = 2;
            aniJob.DefaultAni.SetSpecialFrame(SpecialFrame.Draw, 7);
            m.AddAniJob(aniJob);

            // Undraw 2h
            aniJob1 = new ScriptAniJob("undraw2h_part0", "t_2hRun_2_2h");
            m.AddAniJob(aniJob1);
            aniJob1.SetDefaultAni(new ScriptAni(0, 12)
            {
                { SpecialFrame.Draw, 12 }
            });

            aniJob2 = new ScriptAniJob("undraw2h_part1", "s_2h");
            m.AddAniJob(aniJob2);
            aniJob2.SetDefaultAni(new ScriptAni(0, 1));
            aniJob1.NextAni = aniJob2;

            aniJob3 = new ScriptAniJob("undraw2h_part2", "t_2h_2_Run");
            m.AddAniJob(aniJob3);
            aniJob3.SetDefaultAni(new ScriptAni(0, 5));
            aniJob2.NextAni = aniJob3;

            // Undraw 2h running
            aniJob       = new ScriptAniJob("undraw2h_running", "t_2hMove_2_Move", new ScriptAni(0, 20));
            aniJob.Layer = 2;
            aniJob.DefaultAni.SetSpecialFrame(SpecialFrame.Draw, 13);
            m.AddAniJob(aniJob);

            #endregion

            #region Fighting

            // Fwd attack 1
            ScriptAniJob job = new ScriptAniJob("2hattack_fwd0", "s_2hattack");
            m.AddAniJob(job);
            job.SetDefaultAni(new ScriptAni(0, 24)
            {
                { SpecialFrame.Hit, 6 }, { SpecialFrame.Combo, 11 }
            });

            // fwd combo 2
            job = new ScriptAniJob("2hattack_fwd1", "s_2hattack");
            m.AddAniJob(job);
            job.SetDefaultAni(new ScriptAni(25, 70)
            {
                { SpecialFrame.Hit, 20 }
            });

            // left attack
            job = new ScriptAniJob("2hattack_left", "t_2hAttackL");
            m.AddAniJob(job);
            job.SetDefaultAni(new ScriptAni(0, 24)
            {
                { SpecialFrame.Hit, 3 }, { SpecialFrame.Combo, 8 }
            });

            // right attack
            job = new ScriptAniJob("2hattack_right", "t_2hAttackR");
            m.AddAniJob(job);
            job.SetDefaultAni(new ScriptAni(0, 24)
            {
                { SpecialFrame.Hit, 3 }, { SpecialFrame.Combo, 8 }
            });

            // run attack
            job       = new ScriptAniJob("2hattack_run", "t_2hAttackMove");
            job.Layer = 2;
            m.AddAniJob(job);
            job.SetDefaultAni(new ScriptAni(0, 19)
            {
                { SpecialFrame.Hit, 13 }
            });

            // parades
            job = new ScriptAniJob("2h_parade0", "t_2hParade_0");
            m.AddAniJob(job);
            job.SetDefaultAni(new ScriptAni(0, 30));

            // dodge
            job = new ScriptAniJob("2h_dodge", "t_2hParadeJumpB");
            m.AddAniJob(job);
            job.SetDefaultAni(new ScriptAni(0, 14));

            #endregion

            #region XBow anis

            #region Draw

            aniJob1 = new ScriptAniJob("drawXbow_part0", "t_Run_2_Cbow");
            m.AddAniJob(aniJob1);
            aniJob1.SetDefaultAni(new ScriptAni(0, 4)
            {
                { SpecialFrame.Draw, 4 }
            });

            aniJob2 = new ScriptAniJob("drawXbow_part1", "s_Cbow");
            m.AddAniJob(aniJob2);
            aniJob2.SetDefaultAni(new ScriptAni(0, 1));
            aniJob1.NextAni = aniJob2;

            aniJob3 = new ScriptAniJob("drawXbow_part2", "t_Cbow_2_CbowRun");
            m.AddAniJob(aniJob3);
            aniJob3.SetDefaultAni(new ScriptAni(0, 34));
            aniJob2.NextAni = aniJob3;

            aniJob       = new ScriptAniJob("drawXbow_running", "t_Move_2_CBowMove", new ScriptAni(0, 20));
            aniJob.Layer = 2;
            aniJob.DefaultAni.SetSpecialFrame(SpecialFrame.Draw, 7);
            m.AddAniJob(aniJob);

            aniJob1 = new ScriptAniJob("undrawXbow_part0", "t_CBowRun_2_CBow");
            m.AddAniJob(aniJob1);
            aniJob1.SetDefaultAni(new ScriptAni(0, 34)
            {
                { SpecialFrame.Draw, 34 }
            });

            aniJob2 = new ScriptAniJob("undrawXbow_part1", "s_CBow");
            m.AddAniJob(aniJob2);
            aniJob2.SetDefaultAni(new ScriptAni(0, 1));
            aniJob1.NextAni = aniJob2;

            aniJob3 = new ScriptAniJob("undrawXbow_part2", "t_Cbow_2_Run");
            m.AddAniJob(aniJob3);
            aniJob3.SetDefaultAni(new ScriptAni(0, 4));
            aniJob2.NextAni = aniJob3;

            aniJob       = new ScriptAniJob("undrawXbow_running", "t_CBowMove_2_Move", new ScriptAni(0, 20));
            aniJob.Layer = 2;
            aniJob.DefaultAni.SetSpecialFrame(SpecialFrame.Draw, 14);
            m.AddAniJob(aniJob);

            #endregion

            #region Fight

            aniJob1 = new ScriptAniJob("aim_xbow", "t_cbowwalk_2_cbowaim");
            m.AddAniJob(aniJob1);
            aniJob1.SetDefaultAni(new ScriptAni(0, 11));

            aniJob2 = new ScriptAniJob("aiming_xbow", "s_CBowAim");
            m.AddAniJob(aniJob2);
            aniJob2.SetDefaultAni(new ScriptAni());
            aniJob1.NextAni = aniJob2;

            // fixme: add s_bowshoot too?
            aniJob1 = new ScriptAniJob("reload_xbow", "t_CBowReload");
            m.AddAniJob(aniJob1);
            aniJob1.SetDefaultAni(new ScriptAni(0, 20));
            aniJob1.NextAni = aniJob2;

            aniJob1 = new ScriptAniJob("unaim_xbow", "t_CBowAim_2_CBowwalk");
            m.AddAniJob(aniJob1);
            aniJob1.SetDefaultAni(new ScriptAni(0, 11));

            #endregion

            #endregion

            #region Jump Anis

            m.AddAniJob(new ScriptAniJob("jump_fwd", "t_Stand_2_Jump"));
            m.AddAniJob(new ScriptAniJob("jump_run", "t_RunL_2_Jump"));


            #endregion

            #region Climb Anis

            var ani1 = new ScriptAniJob("climb_low", "t_Stand_2_JumpUpLow", new ScriptAni(0, 10));
            var ani2 = new ScriptAniJob("climb_low1", "s_JumpUpLow", new ScriptAni(0, 4));
            var ani3 = new ScriptAniJob("climb_low2", "t_JumpUpLow_2_Stand", new ScriptAni(0, 15));

            m.AddAniJob(ani1);
            m.AddAniJob(ani2);
            m.AddAniJob(ani3);

            ani1.NextAni = ani2;
            ani2.NextAni = ani3;

            ani1 = new ScriptAniJob("climb_mid", "t_Stand_2_JumpUpMid", new ScriptAni(0, 10));
            ani2 = new ScriptAniJob("climb_mid1", "s_JumpUpMid", new ScriptAni(0, 2));
            ani3 = new ScriptAniJob("climb_mid2", "t_JumpUpMid_2_Stand", new ScriptAni(0, 23));

            m.AddAniJob(ani1);
            m.AddAniJob(ani2);
            m.AddAniJob(ani3);

            ani1.NextAni = ani2;
            ani2.NextAni = ani3;

            ani1 = new ScriptAniJob("climb_high", "t_Stand_2_JumpUp", new ScriptAni(0, 9));
            ani2 = new ScriptAniJob("climb_high1", "t_JumpUp_2_Hang", new ScriptAni(0, 2));
            ani3 = new ScriptAniJob("climb_high2", "t_Hang_2_Stand", new ScriptAni(0, 40));

            m.AddAniJob(ani1);
            m.AddAniJob(ani2);
            m.AddAniJob(ani3);

            ani1.NextAni = ani2;
            ani2.NextAni = ani3;

            #endregion

            m.Radius       = 80;
            m.HalfHeight   = 100;
            m.CenterOffset = 20;
            m.Create();

            // NPCs
            NpcDef npcDef = new NpcDef("orc_scout", _BaseDefFactory, _Registration);
            npcDef.Name     = "Ork-Späher";
            npcDef.Model    = m;
            npcDef.BodyMesh = "Orc_BodyWarrior";
            npcDef.BodyTex  = 0;
            npcDef.HeadMesh = "Orc_HeadWarrior";
            npcDef.HeadTex  = 0;
            npcDef.Guild    = 59;
            npcDef.Create();

            // NPCs
            npcDef          = new NpcDef("orc_warrior", _BaseDefFactory, _Registration);
            npcDef.Name     = "Ork-Krieger";
            npcDef.Model    = m;
            npcDef.BodyMesh = "Orc_BodyWarrior";
            npcDef.BodyTex  = 0;
            npcDef.HeadMesh = "Orc_HeadWarrior";
            npcDef.HeadTex  = 0;
            npcDef.Guild    = 59;
            npcDef.Create();

            npcDef          = new NpcDef("orc_elite", _BaseDefFactory, _Registration);
            npcDef.Name     = "Ork-Elite";
            npcDef.Model    = m;
            npcDef.BodyMesh = "Orc_BodyElite";
            npcDef.BodyTex  = 0;
            npcDef.HeadMesh = "Orc_HeadWarrior";
            npcDef.HeadTex  = 0;
            npcDef.Guild    = 59;
            npcDef.Create();

            npcDef          = new NpcDef("orc_oberst", _BaseDefFactory, _Registration);
            npcDef.Name     = "Orkischer Oberst";
            npcDef.Model    = m;
            npcDef.BodyMesh = "Orc_BodyElite";
            npcDef.BodyTex  = 0;
            npcDef.HeadMesh = "Orc_HeadWarrior";
            npcDef.HeadTex  = 0;
            npcDef.Guild    = 59;
            npcDef.Create();
        }
Beispiel #30
0
        public void BuildDefinition()
        {
            // HUMAN MODEL
            ModelDef m = new ModelDef("crawler", "crawler.mds");

            m.SetAniCatalog(new NPCCatalog());

            var aniJob = new ScriptAniJob("fistattack_fwd0", "s_FistAttack", new ScriptAni(0, 20));

            aniJob.DefaultAni.SetSpecialFrame(SpecialFrame.Hit, 9);
            m.AddAniJob(aniJob);

            aniJob       = new ScriptAniJob("fistattack_run", "t_FistAttackMove", new ScriptAni(0, 29));
            aniJob.Layer = 2;
            aniJob.DefaultAni.SetSpecialFrame(SpecialFrame.Hit, 16);
            m.AddAniJob(aniJob);

            aniJob = new ScriptAniJob("fist_parade", "t_FistParade_0", new ScriptAni(0, 29));
            m.AddAniJob(aniJob);

            aniJob = new ScriptAniJob("fist_jumpback", "t_FistParadeJumpB", new ScriptAni(0, 29));
            m.AddAniJob(aniJob);

            m.Radius       = 130;
            m.HalfHeight   = 80;
            m.FistRange    = 40;
            m.CenterOffset = 50;
            m.Create();

            // NPCs
            NpcDef npcDef = new NpcDef("minecrawler", _BaseDefFactory, _Registration);

            npcDef.Name     = "Minecrawler";
            npcDef.Model    = m;
            npcDef.BodyMesh = "Crw_Body";
            npcDef.BodyTex  = 0;
            npcDef.HeadMesh = "";
            npcDef.HeadTex  = 0;
            npcDef.Guild    = 29;
            npcDef.Create();

            npcDef          = new NpcDef("minecrawler_warrior", _BaseDefFactory, _Registration);
            npcDef.Name     = "Minecrawler-Krieger";
            npcDef.Model    = m;
            npcDef.BodyMesh = "Cr2_Body";
            npcDef.BodyTex  = 0;
            npcDef.HeadMesh = "";
            npcDef.HeadTex  = 0;
            npcDef.Guild    = 29;
            npcDef.Create();

            // CRAWLER KÖNIGIN
            m = new ModelDef("crawler_queen", "CRWQUEEN.mds");
            m.SetAniCatalog(new NPCCatalog());

            aniJob = new ScriptAniJob("fistattack_fwd0", "s_FistAttack", new ScriptAni(0, 24));
            aniJob.DefaultAni.SetSpecialFrame(SpecialFrame.Hit, 13);
            m.AddAniJob(aniJob);

            m.Radius     = 250;
            m.HalfHeight = 300;
            m.FistRange  = 100;
            m.Create();

            // NPCs
            npcDef          = new NpcDef("crawler_queen", _BaseDefFactory, _Registration);
            npcDef.Name     = "Minecrawler-Königin";
            npcDef.Model    = m;
            npcDef.BodyMesh = "CrQ_Body";
            npcDef.BodyTex  = 0;
            npcDef.HeadMesh = "";
            npcDef.HeadTex  = 0;
            npcDef.Guild    = 29;
            npcDef.Create();
        }