예제 #1
0
 private void saveItemData(NpcData data)
 {
     if (hasPropertyChanges)
     {
         Console.WriteLine("Saving NPC Properties");
         data.ID   = txtID.Text;
         data.Name = StringUtils.setString(txtName.Text);
         lstProperties.SaveItem(data);
         hasPropertyChanges = false;
         selected_item.UpdateDisplayValues();
         npcMgr.HasChanges = true;
         //
         npcMgr.addAvailableType(data.Type);
         npcMgr.addAvailableClan(data.GetValue(NpcData.VAR_CLAN, null));
         npcMgr.addAvailableIgnoreClan(data.GetValue(NpcData.VAR_IGNORE_CLAN_LIST, null));
         npcMgr.addAvailableRace(data.GetValue(NpcData.VAR_RACE, null));
         npcMgr.addAvailableBaseAttackType(data.GetValue(NpcData.VAR_BASE_ATTACK_TYPE, null));
     }
     //
     if (hasDropChanges)
     {
         Console.WriteLine("Saving NPC Drop Groups");
         saveDropGroups(data);
         hasDropChanges    = false;
         npcMgr.HasChanges = true;
     }
     //
     if (hasSpoilChanges)
     {
         Console.WriteLine("Saving NPC Spoils");
         NpcSpoilGroup spoil_items = lstSpoilItems.Write();
         data.SetSpoilItems(spoil_items);
         hasSpoilChanges   = false;
         npcMgr.HasChanges = true;
     }
     //
     scriptControl.Save();
 }