public override Rectangle2D GenerateGump(TriggerObject trigObject, UberScriptGump gump, int originX, int originY) { if (m_Condition != null && GetCondition(trigObject) == false) { return new Rectangle2D(); } Mobile mob = GetMobile(trigObject); if (mob == null) { return new Rectangle2D(GetX(trigObject), GetY(trigObject), GetWidth(trigObject), GetHeight(trigObject)); } var layers = new Item[NumLayers]; foreach (Item item in mob.Items) { byte byteLayer = (byte)item.Layer; if (byteLayer < 0x19) { layers[LayerMapping[byteLayer]] = item; } } if (layers[2] != null && (layers[2].ItemID == 0x1411 || layers[2].ItemID == 0x141a)) // plate legs go over shoes { layers[3] = null; // remove shoe layer } int x = originX + GetX(trigObject); int y = originY + GetY(trigObject); int mobHue = mob.Hue & 0x0FFF; // somehow 0x8000 bit is added to indicate it is a skin hue... but this doesn't work as a gumpart hue... weird :P if (mobHue > 0) { mobHue = mobHue - 1; // for some reason gump hues skip hue = 1 (pitch black), so anything above 0 needs to be offset by one } if (mob.BodyValue == 400) // human male { gump.AddImage(x, y, 0xC, mobHue); } else if (mob.BodyValue == 401) // human male { gump.AddImage(x, y, 0xD, mobHue); } else if (mob.BodyValue == 605) // elf male { gump.AddImage(x, y, 0xE, mobHue); } else if (mob.BodyValue == 606) // elf female { gump.AddImage(x, y, 0xF, mobHue); } else if (mob.BodyValue == 183 || mob.BodyValue == 185) // savage male? { gump.AddImage(x, y, 0x79, mobHue); } else if (mob.BodyValue == 184 || mob.BodyValue == 186) // savage female? { gump.AddImage(x, y, 0x78, mobHue); } else if (mob.BodyValue == 666) // gargoyle male { gump.AddImage(x, y, 0x29A, mobHue); } else if (mob.BodyValue == 667) // gargoyle female { gump.AddImage(x, y, 0x299, mobHue); } else if (mob.BodyValue == 990) // lord british { gump.AddImage(x, y, 0x3DE, mobHue); } else if (mob.BodyValue == 991) // lord blackthorn { gump.AddImage(x, y, 0x3DF, mobHue); } else if (mob.BodyValue == 994) // dupre { gump.AddImage(x, y, 0xC732, mobHue); } else { return new Rectangle2D(GetX(trigObject), GetY(trigObject), GetWidth(trigObject), GetHeight(trigObject)); // can't make a paperdoll } for (int i = 0; i < NumLayers; i++) { int mappedGumpID = 0; if (i == 13) // hair layer { PaperDollLookup.ItemIDtoGumpID.TryGetValue(mob.HairItemID, out mappedGumpID); if (mappedGumpID != 0) { if (mob.Female && HasFemaleOffset(mappedGumpID)) { mappedGumpID += 10000; // female offset } gump.AddImage(x, y, mappedGumpID, mob.HairHue == 0 ? 0 : mob.HairHue - 1); // weird gump art hue offset (skips jet black) } PaperDollLookup.ItemIDtoGumpID.TryGetValue(mob.FacialHairItemID, out mappedGumpID); if (mappedGumpID != 0) { if (mob.Female && HasFemaleOffset(mappedGumpID)) { mappedGumpID += 10000; // female offset } gump.AddImage(x, y, mappedGumpID, mob.FacialHairHue == 0 ? 0 : mob.FacialHairHue - 1); // weird gump art hue offset (skips jet black) } } else { if (layers[i] == null) { continue; } PaperDollLookup.ItemIDtoGumpID.TryGetValue(layers[i].ItemID, out mappedGumpID); if (mappedGumpID == 0) { continue; // not in the dictionary } if (mob.Female && HasFemaleOffset(mappedGumpID)) { mappedGumpID += 10000; // female offset } gump.AddImage(x, y, mappedGumpID, layers[i].Hue == 0 ? 0 : layers[i].Hue - 1); // weird gump art hue offset (skips jet black) } } return new Rectangle2D(GetX(trigObject), GetY(trigObject), GetWidth(trigObject), GetHeight(trigObject)); }
public override Rectangle2D GenerateGump(TriggerObject trigObject, UberScriptGump gump, int originX, int originY) { if (m_Condition != null && GetCondition(trigObject) == false) { return new Rectangle2D(); } gump.AddImage(originX + GetX(trigObject), originY + GetY(trigObject), GetGumpID(trigObject), GetHue(trigObject)); return new Rectangle2D(GetX(trigObject), GetY(trigObject), GetWidth(trigObject), GetHeight(trigObject)); }