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(); }
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(); }
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(); }
/// <summary> /// Adds all the original vanilla items. /// </summary> internal static void FillVanilla() { for (int i = -65; i < NPCID.Count; i++) { if (i == 0) continue; NPC n = new NPC(); n.RealSetDefaults(i); NpcDef def = new NpcDef(Lang.npcName(n.type, true)); def.InternalName = n.name; def.Type = n.type; def.NetID = i; CopyNpcToDef(def, n); DefFromType.Add(i, def); VanillaDefFromName.Add(n.name, def); } }
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(); }
public NpcInst(NpcDef def) : base(def) { }
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(); }
static void LoadTextures(NpcDef def) { // def.GetTexture and GetBossHeadTexture values should be checked when it's loaded var texture = def.GetTexture(); if (texture == null) throw new ArgumentNullException("GetTexture return value is null for NpcDef " + def.InternalName + " from mod " + def.Mod + "."); Main.npcTexture[def.Type] = def.GetTexture(); Main.NPCLoaded[def.Type] = true; if (def.IsTechnicallyABoss) { var bossHeadTex = def.GetBossHeadTexture(); if (bossHeadTex != null) { // this shouldn't be -1, because new entries were allocated in ExtendArrays int firstNull = Array.IndexOf(Main.npcHeadBossTexture, null); Main.npcHeadBossTexture[firstNull] = def.GetBossHeadTexture(); NPCID.Sets.BossHeadTextures[def.Type] = firstNull; def.BossHeadTextureIndex = firstNull; } } // Might have to do something else here or something idk meh //TODO: npc head textures, head-in-chat-bubble textures(?) }
static void LoadSetProperties(NpcDef def) { // assuming space is allocated in the ExtendArrays call Main.npcName[def.Type] = def.DisplayName; Main.npcFrameCount[def.Type] = def.TotalFrameCount; NPCID.Sets.AttackAverageChance [def.Type] = def.AttackAverageChance; NPCID.Sets.AttackFrameCount [def.Type] = def.AttackFrameCount; NPCID.Sets.AttackTime [def.Type] = def.AttackTime; NPCID.Sets.AttackType [def.Type] = def.AttackType; NPCID.Sets.DangerDetectRange [def.Type] = def.DangerDetectRange; NPCID.Sets.ExtraFramesCount [def.Type] = def.ExtraFramesCount; NPCID.Sets.FaceEmote [def.Type] = def.FaceEmote; NPCID.Sets.PrettySafe [def.Type] = def.PrettySafe; NPCID.Sets.TrailCacheLength [def.Type] = def.TrailCacheLength; NPCID.Sets.ExcludedFromDeathTally[def.Type] = def.ExcludedFromDeathTally; NPCID.Sets.MPAllowedEnemies [def.Type] = def.IsAllowedInMP; NPCID.Sets.MustAlwaysDraw [def.Type] = def.MustAlwaysDraw; NPCID.Sets.NeedsExpertScaling [def.Type] = def.NeedsExpertScaling; NPCID.Sets.ProjectileNPC [def.Type] = def.IsProjectileNPC; NPCID.Sets.SavesAndLoads [def.Type] = def.SavesAndLoads; NPCID.Sets.TechnicallyABoss [def.Type] = def.IsTechnicallyABoss; NPCID.Sets.TownCritter [def.Type] = def.IsTownCritter; if (def.IsSkeleton) NPCID.Sets.Skeletons.Add(def.Type); NPCID.Sets.MagicAuraColor[def.Type] = def.MagicAuraColour; }
static void CopyNpcToDef(NpcDef tar, NPC source) { tar.Damage = source.damage; tar.Width = source.width; tar.Height = source.height; tar.Defense = source.defense; tar.Alpha = source.alpha; tar.MaxLife = source.lifeMax; tar.SoundOnHit = source.soundHit; tar.SoundOnDeath = source.soundKilled; tar.IgnoreTileCollision = source.noTileCollide; tar.IgnoreGravity = source.noGravity; tar.IsBoss = source.boss; tar.IsTownNpc = source.townNPC; tar.Scale = source.scale; tar.KnockbackResistance = source.knockBackResist; tar.NpcSlots = source.npcSlots; tar.Colour = source.color; tar.Value = new NpcValue(new CoinValue((int)(source.value * 0.8f)), new CoinValue((int)(source.value * 1.2f))); tar.AiStyle = (NpcAiStyle)source.aiStyle; tar.MaxLife = source.lifeMax; tar.BuffImmunities.Clear(); for (int i = 0; i < source.buffImmune.Length; i++) if (source.buffImmune[i]) tar.BuffImmunities.Add(i); tar.GetTexture = () => Main.npcTexture[source.type]; tar.GetTexture = () => Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[source.type]]; tar.InternalName = source.name; tar.DisplayName = source.displayName; }
// set properties aren't copied, type/netid is preserved static void CopyDefToNpc(NPC tar, NpcDef source) { tar.damage = source.Damage; tar.width = source.Width; tar.height = source.Height; tar.defense = source.Defense; tar.alpha = source.Alpha; tar.lifeMax = source.MaxLife; tar.soundHit = source.SoundOnHit; tar.soundKilled = source.SoundOnDeath; tar.noTileCollide = source.IgnoreTileCollision; tar.noGravity = source.IgnoreGravity; tar.boss = source.IsBoss; tar.townNPC = source.IsTownNpc; tar.scale = source.Scale; tar.knockBackResist = source.KnockbackResistance; tar.npcSlots = source.NpcSlots; tar.color = source.Colour; //(float)(source.Value.Min.Value); //TODO: Look at NpcValue xmldoc lmao tar.value = Main.rand.Next(source.Value.Min.Value, source.Value.Max.Value); // close enough tar.aiStyle = (int)source.AiStyle; for (int i = 0; i < source.BuffImmunities.Count; i++) tar.buffImmune[i] = true; tar.name = source.InternalName; tar.displayName = source.DisplayName; }
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(); }
public void BuildDefinition() { // HUMAN MODEL ModelDef m = new ModelDef("humans", "HUMANS.MDS"); m.SetAniCatalog(new NPCCatalog()); AddFistAnis(m); Add1HAnis(m); Add2hAnis(m); AddJumpAnis(m); AddClimbAnis(m); AddBowAnis(m); AddXBowAnis(m); AddUnconsciousAnis(m); AddItemAnis(m); AddGestureAnis(m); m.AddOverlay(new ScriptOverlay("Humans_Torch", "Humans_Torch.mds")); m.AddOverlay(new ScriptOverlay("Humans_Skeleton", "Humans_Skeleton.mds")); m.Radius = 40; m.HalfHeight = 90; m.FistRange = 40; m.Create(); // NPCs NpcDef npcDef = new NpcDef("maleplayer", _BaseDefFactory, _Registration); npcDef.Name = "Spieler"; npcDef.Model = m; npcDef.BodyMesh = HumBodyMeshs.HUM_BODY_NAKED0.ToString(); npcDef.BodyTex = (int)HumBodyTexs.G1Hero; npcDef.HeadMesh = HumHeadMeshs.HUM_HEAD_PONY.ToString(); npcDef.HeadTex = (int)HumHeadTexs.Face_N_Player; npcDef.Guild = 1; npcDef.Create(); npcDef = new NpcDef("femaleplayer", _BaseDefFactory, _Registration); npcDef.Name = "Spielerin"; npcDef.Model = m; npcDef.BodyMesh = HumBodyMeshs.HUM_BODY_BABE0.ToString(); npcDef.BodyTex = (int)HumBodyTexs.F_Babe1; npcDef.HeadMesh = HumHeadMeshs.HUM_HEAD_BABE.ToString(); npcDef.HeadTex = (int)HumHeadTexs.FaceBabe_N_Anne; npcDef.Guild = 1; npcDef.Create(); npcDef = new NpcDef("skeleton", _BaseDefFactory, _Registration); npcDef.Name = "Skelett"; npcDef.Model = m; npcDef.BodyMesh = "Ske_Body"; npcDef.BodyTex = 0; npcDef.HeadMesh = ""; npcDef.HeadTex = 0; npcDef.Guild = 31; npcDef.Create(); npcDef = new NpcDef("skeleton2", _BaseDefFactory, _Registration); npcDef.Name = "Skelett"; npcDef.Model = m; npcDef.BodyMesh = "Ske_Body2"; npcDef.BodyTex = 0; npcDef.HeadMesh = ""; npcDef.HeadTex = 0; npcDef.Guild = 31; npcDef.Create(); npcDef = new NpcDef("skeleton_lord", _BaseDefFactory, _Registration); npcDef.Name = "Schattenlord"; npcDef.Model = m; npcDef.BodyMesh = HumBodyMeshs.HUM_BODY_NAKED0.ToString(); npcDef.BodyTex = 0; npcDef.HeadMesh = "Ske_Head"; npcDef.HeadTex = 0; npcDef.Guild = 31; npcDef.Create(); }