public EventCommandStartCommonEvent(StartCommmonEventCommand refCommand, FrmEvent editor)
 {
     InitializeComponent();
     mMyCommand   = refCommand;
     mEventEditor = editor;
     InitLocalization();
     cmbEvent.Items.Clear();
     cmbEvent.Items.AddRange(EventBase.Names);
     cmbEvent.SelectedIndex = EventBase.ListIndex(refCommand.EventId);
 }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
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();
        }
Exemplo n.º 4
0
        private void RefreshExtendedData()
        {
            grpConsumable.Visible = false;
            grpSpell.Visible      = false;
            grpEquipment.Visible  = false;
            grpEvent.Visible      = false;
            grpBags.Visible       = false;

            if ((int)mEditorItem.ItemType != cmbType.SelectedIndex)
            {
                mEditorItem.Consumable.Type  = ConsumableType.Health;
                mEditorItem.Consumable.Value = 0;

                mEditorItem.TwoHanded         = false;
                mEditorItem.EquipmentSlot     = 0;
                mEditorItem.Effect.Type       = EffectType.None;
                mEditorItem.Effect.Percentage = 0;

                mEditorItem.SlotCount = 0;

                mEditorItem.Damage = 0;
                mEditorItem.Tool   = -1;

                mEditorItem.Spell = null;
                mEditorItem.Event = null;
            }

            if (cmbType.SelectedIndex == (int)ItemTypes.Consumable)
            {
                cmbConsume.SelectedIndex    = (int)mEditorItem.Consumable.Type;
                nudInterval.Value           = mEditorItem.Consumable.Value;
                nudIntervalPercentage.Value = mEditorItem.Consumable.Percentage;
                grpConsumable.Visible       = true;
            }
            else if (cmbType.SelectedIndex == (int)ItemTypes.Spell)
            {
                cmbTeachSpell.SelectedIndex = SpellBase.ListIndex(mEditorItem.SpellId) + 1;
                chkQuickCast.Checked        = mEditorItem.QuickCast;
                chkDestroy.Checked          = mEditorItem.DestroySpell;
                grpSpell.Visible            = true;
            }
            else if (cmbType.SelectedIndex == (int)ItemTypes.Event)
            {
                cmbEvent.SelectedIndex = EventBase.ListIndex(mEditorItem.EventId) + 1;
                grpEvent.Visible       = true;
            }
            else if (cmbType.SelectedIndex == (int)ItemTypes.Equipment)
            {
                grpEquipment.Visible = true;
                if (mEditorItem.EquipmentSlot < -1 || mEditorItem.EquipmentSlot >= cmbEquipmentSlot.Items.Count)
                {
                    mEditorItem.EquipmentSlot = 0;
                }

                cmbEquipmentSlot.SelectedIndex  = mEditorItem.EquipmentSlot;
                cmbEquipmentBonus.SelectedIndex = (int)mEditorItem.Effect.Type;
            }
            else if (cmbType.SelectedIndex == (int)ItemTypes.Bag)
            {
                // Cant have no space or negative space.
                mEditorItem.SlotCount = Math.Max(1, mEditorItem.SlotCount);
                grpBags.Visible       = true;
                nudBag.Value          = mEditorItem.SlotCount;
            }

            mEditorItem.ItemType = (ItemTypes)cmbType.SelectedIndex;
        }
Exemplo n.º 5
0
        private void UpdateSpellTypePanels()
        {
            grpTargetInfo.Hide();
            grpCombat.Hide();
            grpWarp.Hide();
            grpDash.Hide();
            grpEvent.Hide();
            cmbTargetType.Enabled = true;

            if (cmbType.SelectedIndex == (int)SpellTypes.CombatSpell ||
                cmbType.SelectedIndex == (int)SpellTypes.WarpTo ||
                cmbType.SelectedIndex == (int)SpellTypes.Event)
            {
                grpTargetInfo.Show();
                grpCombat.Show();
                cmbTargetType.SelectedIndex = (int)mEditorItem.Combat.TargetType;
                UpdateTargetTypePanel();

                nudHPDamage.Value = mEditorItem.Combat.VitalDiff[(int)Vitals.Health];
                nudMPDamage.Value = mEditorItem.Combat.VitalDiff[(int)Vitals.Mana];

                nudStr.Value = mEditorItem.Combat.StatDiff[(int)Stats.Attack];
                nudDef.Value = mEditorItem.Combat.StatDiff[(int)Stats.Defense];
                nudSpd.Value = mEditorItem.Combat.StatDiff[(int)Stats.Speed];
                nudMag.Value = mEditorItem.Combat.StatDiff[(int)Stats.AbilityPower];
                nudMR.Value  = mEditorItem.Combat.StatDiff[(int)Stats.MagicResist];

                nudStrPercentage.Value = mEditorItem.Combat.PercentageStatDiff[(int)Stats.Attack];
                nudDefPercentage.Value = mEditorItem.Combat.PercentageStatDiff[(int)Stats.Defense];
                nudMagPercentage.Value = mEditorItem.Combat.PercentageStatDiff[(int)Stats.AbilityPower];
                nudMRPercentage.Value  = mEditorItem.Combat.PercentageStatDiff[(int)Stats.MagicResist];
                nudSpdPercentage.Value = mEditorItem.Combat.PercentageStatDiff[(int)Stats.Speed];

                chkFriendly.Checked          = Convert.ToBoolean(mEditorItem.Combat.Friendly);
                cmbDamageType.SelectedIndex  = mEditorItem.Combat.DamageType;
                cmbScalingStat.SelectedIndex = mEditorItem.Combat.ScalingStat;
                nudScaling.Value             = mEditorItem.Combat.Scaling;
                nudCritChance.Value          = mEditorItem.Combat.CritChance;
                nudCritMultiplier.Value      = (decimal)mEditorItem.Combat.CritMultiplier;

                chkHOTDOT.Checked            = mEditorItem.Combat.HoTDoT;
                nudBuffDuration.Value        = mEditorItem.Combat.Duration;
                nudTick.Value                = mEditorItem.Combat.HotDotInterval;
                cmbExtraEffect.SelectedIndex = (int)mEditorItem.Combat.Effect;
                cmbExtraEffect_SelectedIndexChanged(null, null);
            }
            else if (cmbType.SelectedIndex == (int)SpellTypes.Warp)
            {
                grpWarp.Show();
                for (var i = 0; i < MapList.OrderedMaps.Count; i++)
                {
                    if (MapList.OrderedMaps[i].MapId == mEditorItem.Warp.MapId)
                    {
                        cmbWarpMap.SelectedIndex = i;

                        break;
                    }
                }

                nudWarpX.Value             = mEditorItem.Warp.X;
                nudWarpY.Value             = mEditorItem.Warp.Y;
                cmbDirection.SelectedIndex = mEditorItem.Warp.Dir;
            }
            else if (cmbType.SelectedIndex == (int)SpellTypes.Dash)
            {
                grpDash.Show();
                scrlRange.Value                    = mEditorItem.Combat.CastRange;
                lblRange.Text                      = Strings.SpellEditor.dashrange.ToString(scrlRange.Value);
                chkIgnoreMapBlocks.Checked         = mEditorItem.Dash.IgnoreMapBlocks;
                chkIgnoreActiveResources.Checked   = mEditorItem.Dash.IgnoreActiveResources;
                chkIgnoreInactiveResources.Checked = mEditorItem.Dash.IgnoreInactiveResources;
                chkIgnoreZDimensionBlocks.Checked  = mEditorItem.Dash.IgnoreZDimensionAttributes;
            }

            if (cmbType.SelectedIndex == (int)SpellTypes.Event)
            {
                grpEvent.Show();
                cmbEvent.SelectedIndex = EventBase.ListIndex(mEditorItem.EventId) + 1;
            }

            if (cmbType.SelectedIndex == (int)SpellTypes.WarpTo)
            {
                grpTargetInfo.Show();
                cmbTargetType.SelectedIndex = (int)SpellTargetTypes.Single;
                cmbTargetType.Enabled       = false;
                UpdateTargetTypePanel();
            }
        }