SlotID WornSlot(WORN type) { switch (type) { case WORN.HEAD: return(SlotID.HEAD); case WORN.NECK: return(SlotID.NECK); case WORN.SHOULDER: return(SlotID.SHOULDERS); case WORN.SHIRT: return(SlotID.SHIRT); case WORN.CHEST: return(SlotID.CHEST); case WORN.WAIST: return(SlotID.WAIST); case WORN.PANTS: return(SlotID.LEGS); case WORN.BOOTS: return(SlotID.FEET); case WORN.BRACERS: return(SlotID.WRISTS); case WORN.HAND: return(SlotID.HANDS); case WORN.FINGER: return(SlotID.FINGERL); case WORN.TRINKET: return(SlotID.TRINKETL); case WORN.ROBE: case WORN.BACK: return(SlotID.BACK); case WORN.MAINHAND: case WORN.H2: case WORN.H1: return(SlotID.MAINHAND); case WORN.OFFHAND: case WORN.SHIELD: return(SlotID.OFFHAND); case WORN.RANGED: case WORN.RANGEDRIGHT: case WORN.THROWN: return(SlotID.RANGED); case WORN.TABARD: return(SlotID.TABARD); } return(SlotID.BANK); }
protected virtual bool Create(Character c, Hashtable data, ByteArrayBase moredata) { if (!data.Contains("model")) { return(false); } base.Create(c.NextGUID()); model = (uint)(int)data["model"]; SetUpdateValue(UpdateFields.ITEM_FIELD_OWNER, c.GUID); //SetUpdateValue(UpdateFields.ITEM_FIELD_OWNER_01, c.GUID); SetUpdateValue(UpdateFields.ITEM_FIELD_CONTAINED, c.GUID); //SetUpdateValue(UpdateFields.ITEM_FIELD_CONTAINED_01, c.GUID); if (data.Contains("inventorytype")) { wornType = (WORN)(int)data["inventorytype"]; } if (data.Contains("quality")) { quality = (byte)(int)data["quality"]; } uint moreflags = 0; if (moredata != null) { moredata.Get(out mdurability).Get(out durability).Get(out stackcount).Get(out flags).Get(out moreflags); } else { if (data.Contains("durability")) { durability = mdurability = (ushort)(int)data["durability"]; } if (data.Contains("stackcount")) { stackcount = (byte)(int)data["stackcount"]; } } bonusData = data["bonus"] as int[]; damageData = data["damage"] as int[]; spellData = data["spell"] as int[]; resData = new int[7]; for (int i = 1; i <= 7; i++) { string str = "resistance" + i.ToString(); if (data.Contains(str)) { resData[i - 1] = (int)data[str]; } } if (data.Contains("delay")) { delay = (int)data["delay"]; } SetUpdateValue(UpdateFields.ITEM_FIELD_STACK_COUNT, stackcount); SetUpdateValue(UpdateFields.ITEM_FIELD_FLAGS, flags); SetUpdateValue(UpdateFields.ITEM_FIELD_DURABILITY, (uint)durability); SetUpdateValue(UpdateFields.ITEM_FIELD_MAXDURABILITY, (uint)mdurability); return(true); }