public override void loadItemData(int aDefId) { DataTable dt = Database.getData("item_lock_map", "item_def_id", aDefId, null); if (dt == null) { return; } if (dt.Rows.Count == 0) { return; } DataRow dataRow = dt.Rows[0]; mItemMapId = (int)dataRow["item_lock_map_id"]; EditorFactory.setupLink(linkPickSkill, EditorSystemType.Statistic, (int)dataRow["pick_statistic_def_id"]); ComboUtils.fillCombo(cboDifficulty, "ref_difficulty", "name", "ref_difficulty_id", (int)dataRow["pick_difficulty_id"]); int flags = (int)dataRow["flags"]; chkIsRelockable.Checked = ((flags & Globals.LOCK_FLAG_Relockable) != 0) ? true : false; EditorFactory.setupLink(linkKey, EditorSystemType.Item, Database.getNullableId(dataRow, "key_item_def_id")); dt.Dispose(); }
public override void loadItemData(int aDefId) { DataTable dt = Database.getData("item_trap_map", "item_def_id", aDefId, null); if (dt == null) { return; } if (dt.Rows.Count == 0) { return; } DataRow dataRow = dt.Rows[0]; mItemMapId = (int)dataRow["item_trap_map_id"]; EditorFactory.setupLink(linkDisarmSkill, EditorSystemType.Statistic, (int)dataRow["disarm_statistic_def_id"]); ComboUtils.fillCombo(cboDifficulty, "ref_difficulty", "name", "ref_difficulty_id", (int)dataRow["ref_difficulty_id"]); ComboUtils.fillCombo(cboTargetClass, "ref_target_class", "name", "ref_target_class_id", (int)dataRow["ref_target_class_id"]); int flags = (int)dataRow["flags"]; chkIsDestroyedOnUse.Checked = ((flags & Globals.TRAP_FLAG_DestroyedOnUse) != 0) ? true : false; chkIsAreaNotifier.Checked = ((flags & Globals.TRAP_FLAG_AreaNotifier) != 0) ? true : false; if (dataRow["notify_radius"] != DBNull.Value) { numNotifyRadius.Value = (int)dataRow["notify_radius"]; } EditorFactory.setupLink(linkSpaceEffect, EditorSystemType.SpaceEffect, Database.getNullableId(dataRow, "space_effect_def_id")); EditorFactory.setupLink(linkEffect, EditorSystemType.Effect, Database.getNullableId(dataRow, "effect_def_id")); dt.Dispose(); }
public override void loadItemData(int aDefId) { DataTable dt = Database.getData("item_weapon_map", "item_def_id", aDefId, null); if (dt == null) { return; } if (dt.Rows.Count == 0) { return; } DataRow dataRow = dt.Rows[0]; mItemMapId = (int)dataRow["item_weapon_map_id"]; EditorFactory.setupLink(linkEffect, EditorSystemType.Effect, Database.getNullableId(dataRow, "effect_def_id")); ComboUtils.fillCombo(cboWeaponType, "ref_weapon_type", "name", "ref_weapon_type_id", Database.getNullableId(dataRow, "ref_weapon_type_id")); ComboUtils.fillCombo(cboWeaponSpeed, "ref_speed_class", "name", "ref_speed_class_id", Database.getNullableId(dataRow, "ref_speed_class_id")); int flags = (int)dataRow["flags"]; chkIsThrowable.Checked = ((flags & Globals.WEAPON_FLAG_Throwable) != 0) ? true : false; dt.Dispose(); }
public override void loadItemData(int aDefId) { DataTable dt = Database.getData("item_container_map", "item_def_id", aDefId, null); if (dt == null) { return; } if (dt.Rows.Count == 0) { return; } DataRow dataRow = dt.Rows[0]; mItemMapId = (int)dataRow["item_container_map_id"]; numVolume.Value = (int)dataRow["volume_allowance"]; numWeight.Value = (int)dataRow["weight_allowance"]; ComboUtils.fillCombo(cboSize, "ref_size", "name", "ref_size_id", (int)dataRow["ref_size_id"]); int flags = (int)dataRow["flags"]; chkIsCloseable.Checked = ((flags & Globals.CONTAINER_FLAG_Closeable) != 0) ? true : false; chkIsLockable.Checked = ((flags & Globals.CONTAINER_FLAG_Lockable) != 0) ? true : false; chkIsLocked.Checked = ((flags & Globals.CONTAINER_FLAG_Locked) != 0) ? true : false; if (chkIsLockable.Checked) { EditorFactory.setupLink(linkLock, EditorSystemType.Item, Database.getNullableId(dataRow, "lock_item_def_id")); } dt.Dispose(); loadItemsGrid(aDefId); }
public override void loadItemData(int aDefId) { DataTable dt = Database.getData("item_drinkcontainer_map", "item_def_id", aDefId, null); if (dt == null) { return; } if (dt.Rows.Count == 0) { return; } DataRow dataRow = dt.Rows[0]; mItemMapId = (int)dataRow["item_drinkcontainer_map_id"]; numCharges.Value = (int)dataRow["max_charges"]; int flags = (int)dataRow["flags"]; chkIsCloseable.Checked = ((flags & Globals.CONTAINER_FLAG_Closeable) != 0) ? true : false; EditorFactory.setupLink(linkLiquid, EditorSystemType.Liquid, Database.getNullableId(dataRow, "liquid_def_id")); dt.Dispose(); }
public override void loadItemData(int aDefId) { DataTable dt = Database.getData("item_formula_map", "item_def_id", aDefId, null); if (dt == null) { return; } if (dt.Rows.Count == 0) { return; } DataRow dataRow = dt.Rows[0]; mItemMapId = (int)dataRow["item_formula_map_id"]; EditorFactory.setupLink(linkSkill, EditorSystemType.Statistic, Database.getNullableId(dataRow, "statistic_def_id")); numMinSkill.Value = (int)dataRow["min_skill"]; EditorFactory.setupLink(linkProduct, EditorSystemType.Item, Database.getNullableId(dataRow, "product_item_def_id")); numProductQty.Value = (int)dataRow["product_quantity"]; EditorFactory.setupLink(linkMachine, EditorSystemType.Item, Database.getNullableId(dataRow, "machine_item_def_id")); EditorFactory.setupLink(linkTool, EditorSystemType.Item, Database.getNullableId(dataRow, "tool_item_def_id")); numXpValue.Value = (int)dataRow["xp_value"]; dt.Dispose(); loadResourcesGrid(aDefId); }
public override void loadItemData(int aDefId) { DataTable dt = Database.getData("item_magicalnode_map", "item_def_id", aDefId, null); if (dt == null) { return; } if (dt.Rows.Count == 0) { return; } DataRow dataRow = dt.Rows[0]; mItemMapId = (int)dataRow["item_magicalnode_map_id"]; ComboUtils.fillComboBox(cboElementType, "ElementTypeTags", (int)dataRow["tag_def_id"], string.Empty); if (dataRow["effect_time"] != DBNull.Value) { numAuraTime.Value = (int)dataRow["effect_time"]; } if (dataRow["effect_def_id"] != DBNull.Value) { EditorFactory.setupLink(linkAuraEffect, EditorSystemType.Effect, Database.getNullableId(dataRow, "effect_def_id")); } dt.Dispose(); }
public override void loadItemData(int aDefId) { DataTable dt = Database.getData("item_light_map", "item_def_id", aDefId, null); if (dt == null) { return; } if (dt.Rows.Count == 0) { return; } DataRow dataRow = dt.Rows[0]; mItemMapId = (int)dataRow["item_light_map_id"]; //TagUtils.fillComboBox(cboFuelType, "FuelTypeTags", (int)dataRow["fuel_type_tag_def_id"], string.Empty); ComboUtils.fillCombo(cboFuelType, "ref_fuel_type", "name", "ref_fuel_type_id", (int)dataRow["ref_fuel_type_id"]); numBurnTime.Value = Database.getNullableId(dataRow, "solid_fuel_burn_time"); EditorFactory.setupLink(linkLiquidFuel, EditorSystemType.Liquid, Database.getNullableId(dataRow, "liquid_fuel_def_id")); numMaxCharges.Value = Database.getNullableId(dataRow, "liquid_fuel_max_charges"); numBurnRate.Value = Database.getNullableId(dataRow, "liquid_fuel_burn_rate"); dt.Dispose(); }
public override void loadEffectData(int aEffectDefId) { DataTable dt = Database.getData("effect_giveobject_map", "effect_def_id", aEffectDefId, null); if (dt == null) { return; } if (dt.Rows.Count == 0) { return; } DataRow dataRow = dt.Rows[0]; mEffectMapId = (int)dataRow["effect_giveobject_map_id"]; if (dataRow["give_ability_def_id"] != DBNull.Value) { radGiveAbility.Checked = true; lblGive.Text = "Ability"; linkGive.SystemType = EditorSystemType.Ability; EditorFactory.setupLink(linkGive, EditorSystemType.Ability, Database.getNullableId(dataRow, "give_ability_def_id")); } else if (dataRow["give_statistic_def_id"] != DBNull.Value) { radGiveStat.Checked = true; lblGive.Text = "Skill"; linkGive.SystemType = EditorSystemType.Statistic; EditorFactory.setupLink(linkGive, EditorSystemType.Statistic, Database.getNullableId(dataRow, "give_statistic_def_id")); } else if (dataRow["give_item_def_id"] != DBNull.Value) { radGiveItem.Checked = true; lblGive.Text = "Item"; linkGive.SystemType = EditorSystemType.Item; EditorFactory.setupLink(linkGive, EditorSystemType.Item, Database.getNullableId(dataRow, "give_item_def_id")); } else if (dataRow["give_quest_def_id"] != DBNull.Value) { radGiveQuest.Checked = true; lblGive.Text = "Quest"; linkGive.SystemType = EditorSystemType.Quest; EditorFactory.setupLink(linkGive, EditorSystemType.Quest, Database.getNullableId(dataRow, "give_quest_def_id")); } else if (dataRow["give_ritual_def_id"] != DBNull.Value) { radGiveRitual.Checked = true; lblGive.Text = "Ritual"; linkGive.SystemType = EditorSystemType.Ritual; EditorFactory.setupLink(linkGive, EditorSystemType.Ritual, Database.getNullableId(dataRow, "give_ritual_def_id")); } dt.Dispose(); }
public override void loadItemData(int aDefId) { DataTable dt = Database.getData("item_book_map", "item_def_id", aDefId, null); if (dt == null) { return; } if (dt.Rows.Count == 0) { return; } DataRow dataRow = dt.Rows[0]; mItemMapId = (int)dataRow["item_book_map_id"]; EditorFactory.setupLink(linkAbility, EditorSystemType.Ability, Database.getNullableId(dataRow, "ability_def_id")); DataTable pageTable = Database.getData("item_book_page_map", "item_def_id", aDefId, null); if (pageTable == null) { return; } if (pageTable.Rows.Count == 0) { return; } mPages.Clear(); listBoxPages.Items.Clear(); foreach (DataRow pageRow in pageTable.Rows) { BookPage bookPage = new BookPage(); bookPage.book_page_def_id = (int)pageRow["item_book_page_map_id"]; bookPage.page_number = (int)pageRow["page_number"]; bookPage.page_text = pageRow["page_text"].ToString(); mPages.Add(bookPage); /* Find the first page and select it by default */ listBoxPages.Items.Add(bookPage.page_number.ToString()); } pageTable.Dispose(); dt.Dispose(); loadListToUI(); if (listBoxPages.Items.Count != 0) { listBoxPages.SelectedIndex = 0; } }
public override void initContentImpl(int aId) { DataTable dt = Database.getData("npc_def", "npc_def_id", aId, null); if (dt == null) { Program.MainForm.logError("Could not load NPC [" + aId + "]"); return; } if (dt.Rows.Count == 0) { Program.MainForm.logError("Could not load NPC [" + aId + "]"); return; } Program.MainForm.logInfo("NPC loaded [" + aId + "]"); DataRow dataRow = dt.Rows[0]; txtSystemName.Text = dataRow["system_name"].ToString(); txtDisplayName.Text = dataRow["display_name"].ToString(); txtDisplayDescription.Text = dataRow["display_description"].ToString(); numAccessLevel.Value = (int)dataRow["access_level"]; ComboUtils.fillCombo(cboGender, "ref_gender", "name", "ref_gender_id", (int)dataRow["ref_gender_id"]); EditorFactory.setupLink(linkRace, EditorSystemType.Race, Database.getNullableId(dataRow, "race_def_id")); EditorFactory.setupLink(linkShop, EditorSystemType.Shop, Database.getNullableId(dataRow, "shop_def_id")); if (linkShop.Text != "") { chkIsShop.Checked = true; } EditorFactory.setupLink(linkFaction, EditorSystemType.Faction, Database.getNullableId(dataRow, "faction_def_id")); EditorFactory.setupLink(linkTreasure, EditorSystemType.Treasure, Database.getNullableId(dataRow, "treasure_def_id")); if (linkTreasure.Text != "") { chkHasTreasure.Checked = true; } numLevel.Value = Database.getNullableId(dataRow, "npc_level"); dt.Dispose(); ControlName = txtSystemName.Text; loadStatisticsGrid(aId); loadAbilitiesGrid(aId); loadItemsGrid(aId); loadNodesGrid(aId); loadConversationsGrid(aId); }
public override void loadEffectData(int aEffectDefId) { DataTable dt = Database.getData("effect_healthchange_map", "effect_def_id", aEffectDefId, null); if (dt == null) { return; } if (dt.Rows.Count == 0) { return; } DataRow dataRow = dt.Rows[0]; mEffectMapId = (int)dataRow["effect_healthchange_map_id"]; int healthChangeType = (int)dataRow["health_change_type_id"]; if (healthChangeType == Globals.HEALTH_CHANGE_TYPE_Damage) { rdoDamage.Checked = true; } else if (healthChangeType == Globals.HEALTH_CHANGE_TYPE_Heal) { rdoHeal.Checked = true; } else if (healthChangeType == Globals.HEALTH_CHANGE_TYPE_Steal) { rdoSteal.Checked = true; } else { rdoResurrect.Checked = true; } numHealthMin.Value = Database.getNullableId(dataRow, "health_change_min"); numHealthMax.Value = Database.getNullableId(dataRow, "health_change_max"); numHealthBonus.Value = Database.getNullableId(dataRow, "health_change_bonus"); EditorFactory.setupLink(linkResistStat, EditorSystemType.Statistic, Database.getNullableId(dataRow, "resist_statistic_def_id")); EditorFactory.setupLink(linkOnFail, EditorSystemType.Effect, Database.getNullableId(dataRow, "onfail_effect_def_id")); EditorFactory.setupLink(linkOnResist, EditorSystemType.Effect, Database.getNullableId(dataRow, "onresist_effect_def_id")); ComboUtils.fillCombo(cboDamage, "ref_damage_type", "name", "ref_damage_type_id", Database.getNullableId(dataRow, "ref_damage_type_id")); dt.Dispose(); }
public override void loadEffectData(int aEffectDefId) { DataTable dt = Database.getData("effect_spaceeffect_map", "effect_def_id", aEffectDefId, null); if (dt == null) { return; } if (dt.Rows.Count == 0) { return; } DataRow dataRow = dt.Rows[0]; mEffectMapId = (int)dataRow["effect_spaceeffect_map_id"]; EditorFactory.setupLink(linkSpaceEffect, EditorSystemType.SpaceEffect, Database.getNullableId(dataRow, "space_effect_def_id")); dt.Dispose(); }
public override void initContentImpl(int aId) { DataTable dt = Database.getData("barrier_def", "barrier_def_id", aId, null); if (dt == null) { Program.MainForm.logError("Could not load Barrier [" + aId + "]"); return; } if (dt.Rows.Count == 0) { Program.MainForm.logError("Could not load Barrier [" + aId + "]"); return; } Program.MainForm.logInfo("Barrier loaded [" + aId + "]"); DataRow dataRow = dt.Rows[0]; txtSystemName.Text = dataRow["system_name"].ToString(); ComboUtils.fillCombo(cboMaterialTypes, "ref_material", "name", "ref_material_id", (int)dataRow["ref_material_id"]); EditorFactory.setupLink(linkLock, EditorSystemType.Item, Database.getNullableId(dataRow, "lock_item_def_id")); EditorFactory.setupLink(linkTrap, EditorSystemType.Item, Database.getNullableId(dataRow, "trap_item_def_id")); ComboUtils.fillCombo(cboCondition, "ref_condition", "name", "ref_condition_id", (int)dataRow["ref_condition_id"]); EditorFactory.setupLink(linkKey, EditorSystemType.Item, Database.getNullableId(dataRow, "key_item_def_id")); int flags = (int)dataRow["flags"]; chkCloseable.Checked = ((flags & Globals.BARRIER_FLAG_Closeable) != 0) ? true : false; chkClosed.Checked = ((flags & Globals.BARRIER_FLAG_Closed) != 0) ? true : false; chkOneWay.Checked = ((flags & Globals.BARRIER_FLAG_OneWay) != 0) ? true : false; chkTransparent.Checked = ((flags & Globals.BARRIER_FLAG_Transparent) != 0) ? true : false; chkDestroyable.Checked = ((flags & Globals.BARRIER_FLAG_Destroyable) != 0) ? true : false; chkDestroyed.Checked = ((flags & Globals.BARRIER_FLAG_Destroyed) != 0) ? true : false; chkDispellable.Checked = ((flags & Globals.BARRIER_FLAG_Dispellable) != 0) ? true : false; chkLockable.Checked = ((flags & Globals.BARRIER_FLAG_Lockable) != 0) ? true : false; chkTrapable.Checked = ((flags & Globals.BARRIER_FLAG_Trapable) != 0) ? true : false; chkJumpable.Checked = ((flags & Globals.BARRIER_FLAG_Jumpable) != 0) ? true : false; chkClimbable.Checked = ((flags & Globals.BARRIER_FLAG_Climbable) != 0) ? true : false; chkSwimable.Checked = ((flags & Globals.BARRIER_FLAG_Swimmable) != 0) ? true : false; dt.Dispose(); ControlName = txtSystemName.Text; }
public override void loadItemData(int aDefId) { DataTable dt = Database.getData("item_treasure_map", "item_def_id", aDefId, null); if (dt == null) { return; } if (dt.Rows.Count == 0) { return; } DataRow dataRow = dt.Rows[0]; mItemMapId = (int)dataRow["item_treasure_map_id"]; numQuantity.Value = (int)dataRow["quantity"]; EditorFactory.setupLink(linkTreasure, EditorSystemType.Treasure, Database.getNullableId(dataRow, "treasure_def_id")); dt.Dispose(); }
public override void loadItemData(int aDefId) { DataTable dt = Database.getData("item_potion_map", "item_def_id", aDefId, null); if (dt == null) { return; } if (dt.Rows.Count == 0) { return; } DataRow dataRow = dt.Rows[0]; mItemMapId = (int)dataRow["item_potion_map_id"]; numCharges.Value = (int)dataRow["charges"]; EditorFactory.setupLink(linkAbility, EditorSystemType.Ability, Database.getNullableId(dataRow, "ability_def_id")); dt.Dispose(); }
public override void loadEffectData(int aEffectDefId) { DataTable dt = Database.getData("effect_statmod_map", "effect_def_id", aEffectDefId, null); if (dt == null) { return; } if (dt.Rows.Count == 0) { return; } DataRow dataRow = dt.Rows[0]; mEffectMapId = (int)dataRow["effect_statmod_map_id"]; EditorFactory.setupLink(linkStatAffected, EditorSystemType.Statistic, Database.getNullableId(dataRow, "stat_affected_def_id")); numStatMin.Value = Database.getNullableId(dataRow, "stat_change_min"); numStatMax.Value = Database.getNullableId(dataRow, "stat_change_max"); dt.Dispose(); }
public override void initContentImpl(int aId) { DataTable dt = Database.getData("space_def", "space_def_id", aId, null); if (dt == null) { Program.MainForm.logError("Could not load Space [" + aId + "]"); return; } if (dt.Rows.Count == 0) { Program.MainForm.logError("Could not load Space [" + aId + "]"); return; } Program.MainForm.logInfo("Space loaded [" + aId + "]"); DataRow dataRow = dt.Rows[0]; txtSystemName.Text = dataRow["system_name"].ToString(); txtDisplayName.Text = dataRow["display_name"].ToString(); txtDescription.Text = dataRow["display_description"].ToString(); ComboUtils.fillCombo(cboTerrain, "terrain_def", "system_name", "terrain_def_id", (int)dataRow["terrain_def_id"]); EditorFactory.setupLink(linkAccessLevel, EditorSystemType.AccessLevel, Database.getNullableId(dataRow, "access_def_id")); int flags = (int)dataRow["flags"]; chkNoMob.Checked = ((flags & Globals.SPACE_FLAG_NoMob) != 0) ? true : false; chkNoRecall.Checked = ((flags & Globals.SPACE_FLAG_NoRecall) != 0) ? true : false; chkNoSummon.Checked = ((flags & Globals.SPACE_FLAG_NoSummon) != 0) ? true : false; chkNoCombat.Checked = ((flags & Globals.SPACE_FLAG_Safe) != 0) ? true : false; chkNoMagic.Checked = ((flags & Globals.SPACE_FLAG_NoMagic) != 0) ? true : false; chkIsShrine.Checked = ((flags & Globals.SPACE_FLAG_Shrine) != 0) ? true : false; dt.Dispose(); ControlName = txtSystemName.Text; loadExitGrid(aId); loadNpcGrid(aId); loadItemGrid(aId); loadEffectsGrid(aId); }
public override void loadItemData(int aDefId) { DataTable dt = Database.getData("item_portal_map", "item_def_id", aDefId, null); if (dt == null) { return; } if (dt.Rows.Count == 0) { return; } DataRow dataRow = dt.Rows[0]; mItemMapId = (int)dataRow["item_portal_map_id"]; EditorFactory.setupLink(linkDestination, EditorSystemType.Space, Database.getNullableId(dataRow, "destination_space_def_id")); int flags = (int)dataRow["flags"]; chkOnUse.Checked = ((flags & Globals.PORTAL_FLAG_OnUse) != 0) ? true : false; chkOnEnter.Checked = ((flags & Globals.PORTAL_FLAG_OnEnter) != 0) ? true : false; dt.Dispose(); }
public override void initContentImpl(int aId) { DataTable dt = Database.getData("space_effect_def", "space_effect_def_id", aId, null); if (dt == null) { Program.MainForm.logError("Could not load Space Effect [" + aId + "]"); return; } if (dt.Rows.Count == 0) { Program.MainForm.logError("Could not load Space Effect [" + aId + "]"); return; } Program.MainForm.logInfo("Space Effect loaded [" + aId + "]"); DataRow dataRow = dt.Rows[0]; txtSystemName.Text = dataRow["system_name"].ToString(); //TextBoxUtils.populateTextBox(txtDisplayName, dataRow, "display_name"); txtDisplayName.Text = dataRow["display_name"].ToString(); ListUtils.fillCheckedFlags(lstMovementTypes, "MovementFlags", (int)dataRow["movement_flags"], null); EditorFactory.setupLink(linkEffect, EditorSystemType.Effect, Database.getNullableId(dataRow, "effect_def_id")); int flags = (int)dataRow["flags"]; chkOnEnter.Checked = (flags & Globals.SPACE_EFFECT_FLAG_OnEnter) != 0 ? true : false; chkOnTurn.Checked = (flags & Globals.SPACE_EFFECT_FLAG_OnTurn) != 0 ? true : false; int duration = (int)dataRow["duration"]; if (duration <= 0) { rdoDurationInstant.Checked = true; } else { rdoDuration.Checked = true; numDuration.Value = duration; } // Populate the Remove/Cleanse effects // Summoning Details EditorFactory.setupLink(linkSummoningNpc, EditorSystemType.Npc, Database.getNullableId(dataRow, "summon_npc_def_id")); int summonQty = Database.getNullableId(dataRow, "summon_npc_quantity"); if (summonQty < numSummoningQty.Minimum) { numSummoningQty.Value = numSummoningQty.Minimum; } else if (summonQty > numSummoningQty.Maximum) { numSummoningQty.Value = numSummoningQty.Maximum; } else { numSummoningQty.Value = summonQty; } dt.Dispose(); ControlName = txtSystemName.Text; }