private void UpdateAnimationData(int index)
 {
     UpdateAnimations(true);
     cmbAnimation.SelectedIndex = AnimationBase.ListIndex(mEditorItem.Animations[index].AnimationId) + 1;
     scrlSpawnRange.Value       = Math.Min(mEditorItem.Animations[index].SpawnRange, scrlSpawnRange.Maximum);
     chkRotation.Checked        = mEditorItem.Animations[index].AutoRotate;
     UpdateAnimations(true);
 }
Example #2
0
        private void UpdateEditor()
        {
            if (mEditorItem != null)
            {
                pnlContainer.Show();

                txtName.Text          = mEditorItem.Name;
                cmbFolder.Text        = mEditorItem.Folder;
                txtDesc.Text          = mEditorItem.Description;
                cmbType.SelectedIndex = (int)mEditorItem.SpellType;

                nudCastDuration.Value           = mEditorItem.CastDuration;
                nudCooldownDuration.Value       = mEditorItem.CooldownDuration;
                cmbCooldownGroup.SelectedItem   = mEditorItem.CooldownGroup;
                chkIgnoreGlobalCooldown.Checked = mEditorItem.IgnoreGlobalCooldown;
                chkIgnoreCdr.Checked            = mEditorItem.IgnoreCooldownReduction;

                cmbCastAnimation.SelectedIndex = AnimationBase.ListIndex(mEditorItem.CastAnimationId) + 1;
                cmbHitAnimation.SelectedIndex  = AnimationBase.ListIndex(mEditorItem.HitAnimationId) + 1;

                chkBound.Checked = mEditorItem.Bound;

                cmbSprite.SelectedIndex = cmbSprite.FindString(TextUtils.NullToNone(mEditorItem.Icon));
                picSpell.BackgroundImage?.Dispose();
                picSpell.BackgroundImage = null;
                if (cmbSprite.SelectedIndex > 0)
                {
                    picSpell.BackgroundImage = Image.FromFile("resources/spells/" + cmbSprite.Text);
                }

                nudHPCost.Value = mEditorItem.VitalCost[(int)Vitals.Health];
                nudMpCost.Value = mEditorItem.VitalCost[(int)Vitals.Mana];

                txtCannotCast.Text = mEditorItem.CannotCastMessage;

                UpdateSpellTypePanels();
                if (mChanged.IndexOf(mEditorItem) == -1)
                {
                    mChanged.Add(mEditorItem);
                    mEditorItem.MakeBackup();
                }
            }
            else
            {
                pnlContainer.Hide();
            }

            UpdateToolStripItems();
        }
        public EventMoveRouteAnimationSelector(
            EventMoveRouteDesigner moveRouteDesigner,
            MoveRouteAction action,
            bool newAction = false
            )
        {
            InitializeComponent();
            cmbAnimation.Items.Clear();
            cmbAnimation.Items.Add(Strings.General.none);
            cmbAnimation.Items.AddRange(AnimationBase.Names);
            if (!newAction)
            {
                cmbAnimation.SelectedIndex = AnimationBase.ListIndex(action.AnimationId) + 1;
            }

            mNewAction     = newAction;
            mRouteDesigner = moveRouteDesigner;
            mMyAction      = action;
            InitLocalization();
        }
        private void UpdateEditor()
        {
            if (mEditorItem != null)
            {
                pnlContainer.Show();

                txtName.Text                      = mEditorItem.Name;
                cmbFolder.Text                    = mEditorItem.Folder;
                cmbToolType.SelectedIndex         = mEditorItem.Tool + 1;
                nudSpawnDuration.Value            = mEditorItem.SpawnDuration;
                cmbAnimation.SelectedIndex        = AnimationBase.ListIndex(mEditorItem.AnimationId) + 1;
                nudMinHp.Value                    = mEditorItem.MinHp;
                nudMaxHp.Value                    = mEditorItem.MaxHp;
                chkWalkableBefore.Checked         = mEditorItem.WalkableBefore;
                chkWalkableAfter.Checked          = mEditorItem.WalkableAfter;
                chkInitialFromTileset.Checked     = mEditorItem.Initial.GraphicFromTileset;
                chkExhaustedFromTileset.Checked   = mEditorItem.Exhausted.GraphicFromTileset;
                cmbEvent.SelectedIndex            = EventBase.ListIndex(mEditorItem.EventId) + 1;
                chkInitialBelowEntities.Checked   = mEditorItem.Initial.RenderBelowEntities;
                chkExhaustedBelowEntities.Checked = mEditorItem.Exhausted.RenderBelowEntities;
                txtCannotHarvest.Text             = mEditorItem.CannotHarvestMessage;

                //Regen
                nudHpRegen.Value = mEditorItem.VitalRegen;
                PopulateInitialGraphicList();
                PopulateExhaustedGraphicList();
                UpdateDropValues();
                Render();
                if (mChanged.IndexOf(mEditorItem) == -1)
                {
                    mChanged.Add(mEditorItem);
                    mEditorItem.MakeBackup();
                }
            }
            else
            {
                pnlContainer.Hide();
            }

            UpdateToolStripItems();
        }
Example #5
0
        private void UpdateEditor()
        {
            if (mEditorItem != null)
            {
                pnlContainer.Show();

                txtName.Text            = mEditorItem.Name;
                cmbFolder.Text          = mEditorItem.Folder;
                cmbSprite.SelectedIndex = cmbSprite.FindString(TextUtils.NullToNone(mEditorItem.Sprite));
                nudLevel.Value          = mEditorItem.Level;
                nudSpawnDuration.Value  = mEditorItem.SpawnDuration;

                //Behavior
                chkAggressive.Checked = mEditorItem.Aggressive;
                if (mEditorItem.Aggressive)
                {
                    btnAttackOnSightCond.Text = Strings.NpcEditor.dontattackonsightconditions;
                }
                else
                {
                    btnAttackOnSightCond.Text = Strings.NpcEditor.attackonsightconditions;
                }

                nudSightRange.Value          = mEditorItem.SightRange;
                cmbMovement.SelectedIndex    = Math.Min(mEditorItem.Movement, cmbMovement.Items.Count - 1);
                chkSwarm.Checked             = mEditorItem.Swarm;
                nudFlee.Value                = mEditorItem.FleeHealthPercentage;
                chkFocusDamageDealer.Checked = mEditorItem.FocusHighestDamageDealer;

                //Common Events
                cmbOnDeathEventKiller.SelectedIndex = EventBase.ListIndex(mEditorItem.OnDeathEventId) + 1;
                cmbOnDeathEventParty.SelectedIndex  = EventBase.ListIndex(mEditorItem.OnDeathPartyEventId) + 1;

                nudStr.Value            = mEditorItem.Stats[(int)Stats.Attack];
                nudMag.Value            = mEditorItem.Stats[(int)Stats.AbilityPower];
                nudDef.Value            = mEditorItem.Stats[(int)Stats.Defense];
                nudMR.Value             = mEditorItem.Stats[(int)Stats.MagicResist];
                nudSpd.Value            = mEditorItem.Stats[(int)Stats.Speed];
                nudHp.Value             = mEditorItem.MaxVital[(int)Vitals.Health];
                nudMana.Value           = mEditorItem.MaxVital[(int)Vitals.Mana];
                nudExp.Value            = mEditorItem.Experience;
                chkAttackAllies.Checked = mEditorItem.AttackAllies;
                chkEnabled.Checked      = mEditorItem.NpcVsNpcEnabled;

                //Combat
                nudDamage.Value                      = mEditorItem.Damage;
                nudCritChance.Value                  = mEditorItem.CritChance;
                nudCritMultiplier.Value              = (decimal)mEditorItem.CritMultiplier;
                nudScaling.Value                     = mEditorItem.Scaling;
                cmbDamageType.SelectedIndex          = mEditorItem.DamageType;
                cmbScalingStat.SelectedIndex         = mEditorItem.ScalingStat;
                cmbAttackAnimation.SelectedIndex     = AnimationBase.ListIndex(mEditorItem.AttackAnimationId) + 1;
                cmbAttackSpeedModifier.SelectedIndex = mEditorItem.AttackSpeedModifier;
                nudAttackSpeedValue.Value            = mEditorItem.AttackSpeedValue;

                //Regen
                nudHpRegen.Value = mEditorItem.VitalRegen[(int)Vitals.Health];
                nudMpRegen.Value = mEditorItem.VitalRegen[(int)Vitals.Mana];

                // Add the spells to the list
                lstSpells.Items.Clear();
                for (var i = 0; i < mEditorItem.Spells.Count; i++)
                {
                    if (mEditorItem.Spells[i] != Guid.Empty)
                    {
                        lstSpells.Items.Add(SpellBase.GetName(mEditorItem.Spells[i]));
                    }
                    else
                    {
                        lstSpells.Items.Add(Strings.General.none);
                    }
                }

                if (lstSpells.Items.Count > 0)
                {
                    lstSpells.SelectedIndex = 0;
                    cmbSpell.SelectedIndex  = SpellBase.ListIndex(mEditorItem.Spells[lstSpells.SelectedIndex]);
                }

                cmbFreq.SelectedIndex = mEditorItem.SpellFrequency;

                // Add the aggro NPC's to the list
                lstAggro.Items.Clear();
                for (var i = 0; i < mEditorItem.AggroList.Count; i++)
                {
                    if (mEditorItem.AggroList[i] != Guid.Empty)
                    {
                        lstAggro.Items.Add(NpcBase.GetName(mEditorItem.AggroList[i]));
                    }
                    else
                    {
                        lstAggro.Items.Add(Strings.General.none);
                    }
                }

                UpdateDropValues();

                DrawNpcSprite();
                if (mChanged.IndexOf(mEditorItem) == -1)
                {
                    mChanged.Add(mEditorItem);
                    mEditorItem.MakeBackup();
                }
            }
            else
            {
                pnlContainer.Hide();
            }

            UpdateToolStripItems();
        }
Example #6
0
        private void UpdateEditor()
        {
            if (mEditorItem != null)
            {
                pnlContainer.Show();

                txtName.Text          = mEditorItem.Name;
                cmbFolder.Text        = mEditorItem.Folder;
                txtDesc.Text          = mEditorItem.Description;
                cmbType.SelectedIndex = (int)mEditorItem.ItemType;
                cmbPic.SelectedIndex  = cmbPic.FindString(TextUtils.NullToNone(mEditorItem.Icon));
                cmbEquipmentAnimation.SelectedIndex = AnimationBase.ListIndex(mEditorItem.EquipmentAnimationId) + 1;
                nudPrice.Value          = mEditorItem.Price;
                cmbRarity.SelectedIndex = mEditorItem.Rarity;

                nudStr.Value = mEditorItem.StatsGiven[0];
                nudMag.Value = mEditorItem.StatsGiven[1];
                nudDef.Value = mEditorItem.StatsGiven[2];
                nudMR.Value  = mEditorItem.StatsGiven[3];
                nudSpd.Value = mEditorItem.StatsGiven[4];

                nudStrPercentage.Value = mEditorItem.PercentageStatsGiven[0];
                nudMagPercentage.Value = mEditorItem.PercentageStatsGiven[1];
                nudDefPercentage.Value = mEditorItem.PercentageStatsGiven[2];
                nudMRPercentage.Value  = mEditorItem.PercentageStatsGiven[3];
                nudSpdPercentage.Value = mEditorItem.PercentageStatsGiven[4];

                nudHealthBonus.Value  = mEditorItem.VitalsGiven[0];
                nudManaBonus.Value    = mEditorItem.VitalsGiven[1];
                nudHPPercentage.Value = mEditorItem.PercentageVitalsGiven[0];
                nudMPPercentage.Value = mEditorItem.PercentageVitalsGiven[1];
                nudHPRegen.Value      = mEditorItem.VitalsRegen[0];
                nudMpRegen.Value      = mEditorItem.VitalsRegen[1];

                nudDamage.Value         = mEditorItem.Damage;
                nudCritChance.Value     = mEditorItem.CritChance;
                nudCritMultiplier.Value = (decimal)mEditorItem.CritMultiplier;
                cmbAttackSpeedModifier.SelectedIndex = mEditorItem.AttackSpeedModifier;
                nudAttackSpeedValue.Value            = mEditorItem.AttackSpeedValue;
                nudScaling.Value                 = mEditorItem.Scaling;
                nudRange.Value                   = mEditorItem.StatGrowth;
                chkBound.Checked                 = Convert.ToBoolean(mEditorItem.Bound);
                chkStackable.Checked             = Convert.ToBoolean(mEditorItem.Stackable);
                cmbToolType.SelectedIndex        = mEditorItem.Tool + 1;
                cmbAttackAnimation.SelectedIndex = AnimationBase.ListIndex(mEditorItem.AttackAnimationId) + 1;
                RefreshExtendedData();
                if (mEditorItem.ItemType == ItemTypes.Equipment)
                {
                    cmbEquipmentBonus.SelectedIndex = (int)mEditorItem.Effect.Type;
                }

                nudEffectPercent.Value         = mEditorItem.Effect.Percentage;
                chk2Hand.Checked               = mEditorItem.TwoHanded;
                cmbMalePaperdoll.SelectedIndex =
                    cmbMalePaperdoll.FindString(TextUtils.NullToNone(mEditorItem.MalePaperdoll));

                cmbFemalePaperdoll.SelectedIndex =
                    cmbFemalePaperdoll.FindString(TextUtils.NullToNone(mEditorItem.FemalePaperdoll));

                if (mEditorItem.ItemType == ItemTypes.Consumable)
                {
                    cmbConsume.SelectedIndex    = (int)mEditorItem.Consumable.Type;
                    nudInterval.Value           = mEditorItem.Consumable.Value;
                    nudIntervalPercentage.Value = mEditorItem.Consumable.Percentage;
                }

                picItem.BackgroundImage?.Dispose();
                picItem.BackgroundImage = null;
                if (cmbPic.SelectedIndex > 0)
                {
                    picItem.BackgroundImage = System.Drawing.Image.FromFile("resources/items/" + cmbPic.Text);
                }

                picMalePaperdoll.BackgroundImage?.Dispose();
                picMalePaperdoll.BackgroundImage = null;
                if (cmbMalePaperdoll.SelectedIndex > 0)
                {
                    picMalePaperdoll.BackgroundImage =
                        System.Drawing.Image.FromFile("resources/paperdolls/" + cmbMalePaperdoll.Text);
                }

                picFemalePaperdoll.BackgroundImage?.Dispose();
                picFemalePaperdoll.BackgroundImage = null;
                if (cmbFemalePaperdoll.SelectedIndex > 0)
                {
                    picFemalePaperdoll.BackgroundImage =
                        System.Drawing.Image.FromFile("resources/paperdolls/" + cmbFemalePaperdoll.Text);
                }

                cmbDamageType.SelectedIndex  = mEditorItem.DamageType;
                cmbScalingStat.SelectedIndex = mEditorItem.ScalingStat;

                //External References
                cmbProjectile.SelectedIndex = ProjectileBase.ListIndex(mEditorItem.ProjectileId) + 1;
                cmbAnimation.SelectedIndex  = AnimationBase.ListIndex(mEditorItem.AnimationId) + 1;

                nudCooldown.Value = mEditorItem.Cooldown;

                if (mChanged.IndexOf(mEditorItem) == -1)
                {
                    mChanged.Add(mEditorItem);
                    mEditorItem.MakeBackup();
                }
            }
            else
            {
                pnlContainer.Hide();
            }

            UpdateToolStripItems();
        }
        public EventCommandPlayAnimation(
            FrmEvent eventEditor,
            MapBase currentMap,
            EventBase currentEvent,
            PlayAnimationCommand editingCommand
            )
        {
            InitializeComponent();
            mMyCommand    = editingCommand;
            mEventEditor  = eventEditor;
            mEditingEvent = currentEvent;
            mCurrentMap   = currentMap;
            InitLocalization();
            cmbAnimation.Items.Clear();
            cmbAnimation.Items.AddRange(AnimationBase.Names);
            cmbAnimation.SelectedIndex = AnimationBase.ListIndex(mMyCommand.AnimationId);
            if (mMyCommand.MapId != Guid.Empty)
            {
                cmbConditionType.SelectedIndex = 0;
            }
            else
            {
                cmbConditionType.SelectedIndex = 1;
            }

            nudWarpX.Maximum = Options.MapWidth;
            nudWarpY.Maximum = Options.MapHeight;
            UpdateFormElements();
            switch (cmbConditionType.SelectedIndex)
            {
            case 0:     //Tile spawn
                //Fill in the map cmb
                nudWarpX.Value             = mMyCommand.X;
                nudWarpY.Value             = mMyCommand.Y;
                cmbDirection.SelectedIndex = mMyCommand.Dir;

                break;

            case 1:     //On/Around Entity Spawn
                mSpawnX = mMyCommand.X;
                mSpawnY = mMyCommand.Y;
                switch (mMyCommand.Dir)
                {
                //0 does not adhere to direction, 1 is Spawning Relative to Direction, 2 is Rotating Relative to Direction, and 3 is both.
                case 1:
                    chkRelativeLocation.Checked = true;

                    break;

                case 2:
                    chkRotateDirection.Checked = true;

                    break;

                case 3:
                    chkRelativeLocation.Checked = true;
                    chkRotateDirection.Checked  = true;

                    break;
                }

                UpdateSpawnPreview();

                break;
            }
        }
Example #8
0
        private void UpdateEditor()
        {
            if (mEditorItem != null)
            {
                pnlContainer.Show();

                txtName.Text          = mEditorItem.Name;
                cmbFolder.Text        = mEditorItem.Folder;
                txtDesc.Text          = mEditorItem.Description;
                cmbType.SelectedIndex = (int)mEditorItem.ItemType;
                cmbPic.SelectedIndex  = cmbPic.FindString(TextUtils.NullToNone(mEditorItem.Icon));
                nudRgbaR.Value        = mEditorItem.Color.R;
                nudRgbaG.Value        = mEditorItem.Color.G;
                nudRgbaB.Value        = mEditorItem.Color.B;
                nudRgbaA.Value        = mEditorItem.Color.A;
                cmbEquipmentAnimation.SelectedIndex = AnimationBase.ListIndex(mEditorItem.EquipmentAnimationId) + 1;
                nudPrice.Value          = mEditorItem.Price;
                cmbRarity.SelectedIndex = mEditorItem.Rarity;

                nudStr.Value = mEditorItem.StatsGiven[0];
                nudMag.Value = mEditorItem.StatsGiven[1];
                nudDef.Value = mEditorItem.StatsGiven[2];
                nudMR.Value  = mEditorItem.StatsGiven[3];
                nudSpd.Value = mEditorItem.StatsGiven[4];

                nudStrPercentage.Value = mEditorItem.PercentageStatsGiven[0];
                nudMagPercentage.Value = mEditorItem.PercentageStatsGiven[1];
                nudDefPercentage.Value = mEditorItem.PercentageStatsGiven[2];
                nudMRPercentage.Value  = mEditorItem.PercentageStatsGiven[3];
                nudSpdPercentage.Value = mEditorItem.PercentageStatsGiven[4];

                nudHealthBonus.Value  = mEditorItem.VitalsGiven[0];
                nudManaBonus.Value    = mEditorItem.VitalsGiven[1];
                nudHPPercentage.Value = mEditorItem.PercentageVitalsGiven[0];
                nudMPPercentage.Value = mEditorItem.PercentageVitalsGiven[1];
                nudHPRegen.Value      = mEditorItem.VitalsRegen[0];
                nudMpRegen.Value      = mEditorItem.VitalsRegen[1];

                nudDamage.Value         = mEditorItem.Damage;
                nudCritChance.Value     = mEditorItem.CritChance;
                nudCritMultiplier.Value = (decimal)mEditorItem.CritMultiplier;
                cmbAttackSpeedModifier.SelectedIndex = mEditorItem.AttackSpeedModifier;
                nudAttackSpeedValue.Value            = mEditorItem.AttackSpeedValue;
                nudScaling.Value                 = mEditorItem.Scaling;
                nudRange.Value                   = mEditorItem.StatGrowth;
                chkCanDrop.Checked               = Convert.ToBoolean(mEditorItem.CanDrop);
                chkCanBank.Checked               = Convert.ToBoolean(mEditorItem.CanBank);
                chkCanGuildBank.Checked          = Convert.ToBoolean(mEditorItem.CanGuildBank);
                chkCanBag.Checked                = Convert.ToBoolean(mEditorItem.CanBag);
                chkCanSell.Checked               = Convert.ToBoolean(mEditorItem.CanSell);
                chkCanTrade.Checked              = Convert.ToBoolean(mEditorItem.CanTrade);
                chkStackable.Checked             = Convert.ToBoolean(mEditorItem.Stackable);
                nudInvStackLimit.Value           = mEditorItem.MaxInventoryStack;
                nudBankStackLimit.Value          = mEditorItem.MaxBankStack;
                nudDeathDropChance.Value         = mEditorItem.DropChanceOnDeath;
                cmbToolType.SelectedIndex        = mEditorItem.Tool + 1;
                cmbAttackAnimation.SelectedIndex = AnimationBase.ListIndex(mEditorItem.AttackAnimationId) + 1;
                RefreshExtendedData();
                if (mEditorItem.ItemType == ItemTypes.Equipment)
                {
                    cmbEquipmentBonus.SelectedIndex = (int)mEditorItem.Effect.Type;
                }

                nudEffectPercent.Value         = mEditorItem.Effect.Percentage;
                chk2Hand.Checked               = mEditorItem.TwoHanded;
                cmbMalePaperdoll.SelectedIndex =
                    cmbMalePaperdoll.FindString(TextUtils.NullToNone(mEditorItem.MalePaperdoll));

                cmbFemalePaperdoll.SelectedIndex =
                    cmbFemalePaperdoll.FindString(TextUtils.NullToNone(mEditorItem.FemalePaperdoll));

                if (mEditorItem.ItemType == ItemTypes.Consumable)
                {
                    cmbConsume.SelectedIndex    = (int)mEditorItem.Consumable.Type;
                    nudInterval.Value           = mEditorItem.Consumable.Value;
                    nudIntervalPercentage.Value = mEditorItem.Consumable.Percentage;
                }

                picItem.BackgroundImage?.Dispose();
                picItem.BackgroundImage = null;
                if (cmbPic.SelectedIndex > 0)
                {
                    DrawItemIcon();
                }

                picMalePaperdoll.BackgroundImage?.Dispose();
                picMalePaperdoll.BackgroundImage = null;
                if (cmbMalePaperdoll.SelectedIndex > 0)
                {
                    DrawItemPaperdoll(Gender.Male);
                }

                picFemalePaperdoll.BackgroundImage?.Dispose();
                picFemalePaperdoll.BackgroundImage = null;
                if (cmbFemalePaperdoll.SelectedIndex > 0)
                {
                    DrawItemPaperdoll(Gender.Female);
                }

                cmbDamageType.SelectedIndex  = mEditorItem.DamageType;
                cmbScalingStat.SelectedIndex = mEditorItem.ScalingStat;

                //External References
                cmbProjectile.SelectedIndex = ProjectileBase.ListIndex(mEditorItem.ProjectileId) + 1;
                cmbAnimation.SelectedIndex  = AnimationBase.ListIndex(mEditorItem.AnimationId) + 1;

                nudCooldown.Value               = mEditorItem.Cooldown;
                cmbCooldownGroup.Text           = mEditorItem.CooldownGroup;
                chkIgnoreGlobalCooldown.Checked = mEditorItem.IgnoreGlobalCooldown;
                chkIgnoreCdr.Checked            = mEditorItem.IgnoreCooldownReduction;

                txtCannotUse.Text = mEditorItem.CannotUseMessage;

                if (mChanged.IndexOf(mEditorItem) == -1)
                {
                    mChanged.Add(mEditorItem);
                    mEditorItem.MakeBackup();
                }
            }
            else
            {
                pnlContainer.Hide();
            }

            UpdateToolStripItems();
        }