public AddBuffPacket(Mobile mob, BuffIcon iconID, int titleCliloc, int secondaryCliloc, TextDefinition args, TimeSpan length) : base(0xDF) { bool hasArgs = (args != null); EnsureCapacity((hasArgs ? (48 + args.ToString().Length * 2) : 44)); m_Stream.Write(mob.Serial); m_Stream.Write((short)iconID); //ID m_Stream.Write((short)0x1); //Type 0 for removal. 1 for add 2 for Data m_Stream.Fill(4); m_Stream.Write((short)iconID); //ID m_Stream.Write((short)0x01); //Type 0 for removal. 1 for add 2 for Data m_Stream.Fill(4); if (length < TimeSpan.Zero) { length = TimeSpan.Zero; } m_Stream.Write((short)length.TotalSeconds); //Time in seconds m_Stream.Fill(3); m_Stream.Write(titleCliloc); m_Stream.Write(secondaryCliloc); if (!hasArgs) { //m_Stream.Fill( 2 ); m_Stream.Fill(10); } else { m_Stream.Fill(4); m_Stream.Write((short)0x1); //Unknown -> Possibly something saying 'hey, I have more data!'? m_Stream.Fill(2); //m_Stream.WriteLittleUniNull( "\t#1018280" ); m_Stream.WriteLittleUniNull(string.Format("\t{0}", args.ToString())); m_Stream.Write((short)0x1); //Even more Unknown -> Possibly something saying 'hey, I have more data!'? m_Stream.Fill(2); } }
public override void GetProperties(ObjectPropertyList list) { base.GetProperties(list); list.Add(1155708, m_Owner != null ? m_Owner : "Unknown"); // Hunter: ~1_NAME~ list.Add(1155709, m_DateKilled); // Date of Kill: ~1_DATE~ if (m_Location != null) { list.Add(1061114, m_Location); // Location: ~1_val~ } list.Add(1155718, m_Species.ToString()); if (m_MeasuredBy == MeasuredBy.Length) { list.Add(1155711, m_Measurement.ToString()); // Length: ~1_VAL~ } else if (m_MeasuredBy == MeasuredBy.Wingspan) { list.Add(1155710, m_Measurement.ToString()); // Wingspan: ~1_VAL~ } else { list.Add(1072225, m_Measurement.ToString()); // Weight: ~1_WEIGHT~ stones } }
public override string ToString() { if (m_Message != null) { return(m_Message.ToString()); } return(base.ToString()); }
public override void GetProperties(ObjectPropertyList list) { base.GetProperties(list); list.Add(1071345, String.Format("{0:F1}", m_SkillLevel)); // Skill: ~1_val~ TextDefinition desc = RepairSkillInfo.GetInfo(m_Skill).Description; if (desc != null) { list.Add(desc.ToString()); } }
public AddBuffPacket( Serial mob, BuffIcon iconID, int titleCliloc, int secondaryCliloc, TextDefinition args, TimeSpan length ) : base(0xDF) { var hasArgs = args != null; EnsureCapacity(hasArgs ? 48 + args.ToString().Length * 2 : 44); Stream.Write(mob); Stream.Write((short)iconID); // ID Stream.Write((short)0x1); // Type 0 for removal. 1 for add 2 for Data Stream.Fill(4); Stream.Write((short)iconID); // ID Stream.Write((short)0x01); // Type 0 for removal. 1 for add 2 for Data Stream.Fill(4); if (length < TimeSpan.Zero) { length = TimeSpan.Zero; } Stream.Write((short)length.TotalSeconds); // Time in seconds Stream.Fill(3); Stream.Write(titleCliloc); Stream.Write(secondaryCliloc); if (!hasArgs) { // m_Stream.Fill( 2 ); Stream.Fill(10); } else { Stream.Fill(4); Stream.Write((short)0x1); // Unknown -> Possibly something saying 'hey, I have more data!'? Stream.Fill(2); // m_Stream.WriteLittleUniNull( "\t#1018280" ); Stream.WriteLittleUniNull($"\t{args}"); Stream.Write((short)0x1); // Even more Unknown -> Possibly something saying 'hey, I have more data!'? Stream.Fill(2); } }
public override void AddGumpLayout() { if (!Imbuing.CheckSoulForge(User, 2, out double bonus)) { return; } ImbuingContext context = Imbuing.GetContext(User); if (!ItemPropertyInfo.Table.ContainsKey(m_ID)) { return; } m_Info = ItemPropertyInfo.Table[m_ID]; int minInt = ItemPropertyInfo.GetMinIntensity(m_Item, m_ID); int maxInt = ItemPropertyInfo.GetMaxIntensity(m_Item, m_ID, true); int weight = m_Info.Weight; int scale = ItemPropertyInfo.GetScale(m_Item, m_ID); int start = minInt - scale; if (m_Value < minInt) { m_Value = minInt; } if (m_Value > maxInt) { m_Value = maxInt; } //double currentIntensity = Math.Floor((m_Value / (double)maxInt) * m_Info.Weight); double currentIntensity = Math.Floor(((m_Value - start) / ((double)maxInt - start)) * m_Info.Weight); // Set context context.LastImbued = m_Item; context.Imbue_Mod = m_ID; context.Imbue_ModVal = weight; // context.ImbMenu_ModInc = ItemPropertyInfo.GetScale(m_Item, m_ID); // Current Mod Weight m_TotalItemWeight = Imbuing.GetTotalWeight(m_Item, m_ID, false, true); m_TotalProps = Imbuing.GetTotalMods(m_Item, m_ID); if (maxInt <= 1) { currentIntensity = m_Info.Weight; } int propWeight = (int)Math.Floor((weight / (double)maxInt) * m_Value); // Maximum allowed Property Weight & Item Mod Count m_MaxWeight = Imbuing.GetMaxWeight(m_Item); // Times Item has been Imbued int timesImbued = Imbuing.TimesImbued(m_Item); // Check Ingredients needed at the current Intensity int gemAmount = Imbuing.GetGemAmount(m_Item, m_ID, m_Value); int primResAmount = Imbuing.GetPrimaryAmount(m_Item, m_ID, m_Value); int specResAmount = Imbuing.GetSpecialAmount(m_Item, m_ID, m_Value); AddPage(0); AddBackground(0, 0, 520, 440, 5054); AddImageTiled(10, 10, 500, 20, 2624); AddImageTiled(10, 40, 245, 140, 2624); AddImageTiled(265, 40, 245, 140, 2624); AddImageTiled(10, 190, 245, 140, 2624); AddImageTiled(265, 190, 245, 140, 2624); AddImageTiled(10, 340, 500, 60, 2624); AddImageTiled(10, 410, 500, 20, 2624); AddAlphaRegion(10, 10, 500, 420); AddHtmlLocalized(10, 12, 520, 20, 1079717, LabelColor, false, false); // <CENTER>IMBUING CONFIRMATION</CENTER> AddHtmlLocalized(50, 50, 250, 20, 1114269, LabelColor, false, false); // PROPERTY INFORMATION AddHtmlLocalized(25, 80, 390, 20, 1114270, LabelColor, false, false); // Property: if (m_Info.AttributeName != null) { AddHtmlLocalized(95, 80, 150, 20, 1114057, m_Info.AttributeName.ToString(), LabelColor, false, false); } AddHtmlLocalized(25, 100, 390, 20, 1114271, LabelColor, false, false); // Replaces: TextDefinition replace = WhatReplacesWhat(m_ID, m_Item); if (replace != null) { AddHtmlLocalized(95, 100, 150, 20, 1114057, replace.ToString(), LabelColor, false, false); } // Weight Modifier AddHtmlLocalized(25, 120, 200, 20, 1114272, 0xFFFFFF, false, false); // Weight: AddLabel(95, 120, IceHue, string.Format("{0}x", (m_Info.Weight / 100.0).ToString("0.0"))); AddHtmlLocalized(25, 140, 200, 20, 1114273, LabelColor, false, false); // Intensity: AddLabel(95, 140, IceHue, string.Format("{0}%", currentIntensity)); // Materials needed AddHtmlLocalized(100, 200, 80, 20, 1044055, LabelColor, false, false); // <CENTER>MATERIALS</CENTER> AddHtmlLocalized(40, 220, 390, 20, 1114057, string.Format("#{0}", m_Info.PrimaryName.Number), LabelColor, false, false); AddLabel(210, 220, IceHue, primResAmount.ToString()); AddHtmlLocalized(40, 240, 390, 20, 1114057, string.Format("#{0}", m_Info.GemName.Number), LabelColor, false, false); AddLabel(210, 240, IceHue, gemAmount.ToString()); if (specResAmount > 0) { AddHtmlLocalized(40, 260, 390, 20, 1114057, string.Format("#{0}", ItemPropertyInfo.GetSpecialResName(m_Item, m_Info).Number), LabelColor, false, false); AddLabel(210, 260, IceHue, specResAmount.ToString()); } // Mod Description AddHtmlLocalized(280, 55, 205, 115, m_Info.Description, LabelColor, false, false); AddHtmlLocalized(350, 200, 65, 20, 1113650, LabelColor, false, false); // RESULTS AddHtmlLocalized(280, 220, 140, 20, 1113645, LabelColor, false, false); // Properties: AddLabel(430, 220, GetColor(m_TotalProps + 1, 5), string.Format("{0}/{1}", m_TotalProps + 1, Imbuing.GetMaxProps(m_Item))); int projWeight = m_TotalItemWeight + propWeight; AddHtmlLocalized(280, 240, 260, 20, 1113646, LabelColor, false, false); // Total Property Weight: AddLabel(430, 240, GetColor(projWeight, m_MaxWeight), string.Format("{0}/{1}", projWeight, m_MaxWeight)); AddHtmlLocalized(280, 260, 200, 20, 1113647, LabelColor, false, false); // Times Imbued: AddLabel(430, 260, GetColor(timesImbued, 20), string.Format("{0}/20", timesImbued)); // ===== CALCULATE DIFFICULTY ===== int truePropWeight = (int)((propWeight / (double)weight) * 100); int trueTotalWeight = Imbuing.GetTotalWeight(m_Item, -1, true, true); double suc = Imbuing.GetSuccessChance(User, m_Item, trueTotalWeight, truePropWeight, bonus); AddHtmlLocalized(300, 300, 250, 20, 1044057, 0xFFFFFF, false, false); // Success Chance: AddLabel(420, 300, GetSuccessChanceHue(suc), string.Format("{0}%", suc.ToString("0.0"))); // - Attribute Level if (maxInt > 1) { AddHtmlLocalized(235, 350, 200, 20, 1062300, LabelColor, false, false); // New Value: if (m_ID == 41) // - Mage Weapon Value ( i.e [Mage Weapon -25] ) { AddLabel(250, 370, IceHue, string.Format("-{0}", 30 - m_Value)); } else if (m_ID > 150 && m_ID < 184) // Skill Property { AddLabel(m_Value > 9 ? 252 : 256, 370, IceHue, string.Format("+{0}", m_Value)); } else if (maxInt <= 8 || m_ID == 21 || m_ID == 17) // - Show Property Value as just Number ( i.e [Mana Regen 2] ) { AddLabel(m_Value > 9 ? 252 : 256, 370, IceHue, string.Format("{0}", m_Value)); // - Show Property Value as % ( i.e [Hit Fireball 25%] ) } else { int val = m_Value; if (m_ID >= 51 && m_ID <= 55) { int[] resistances = Imbuing.GetBaseResists(m_Item); switch (m_ID) { case 51: val += resistances[0]; break; case 52: val += resistances[1]; break; case 53: val += resistances[2]; break; case 54: val += resistances[3]; break; case 55: val += resistances[4]; break; } } AddLabel(val > 9 ? 252 : 256, 370, IceHue, string.Format("{0}%", val)); } // Buttons AddButton(179, 372, 0x1464, 0x1464, 10053, GumpButtonType.Reply, 0); AddButton(187, 372, 0x1466, 0x1466, 10053, GumpButtonType.Reply, 0); AddButton(199, 372, 0x1464, 0x1464, 10052, GumpButtonType.Reply, 0); AddButton(207, 372, 0x1466, 0x1466, 10052, GumpButtonType.Reply, 0); AddButton(221, 372, 0x1464, 0x1464, 10051, GumpButtonType.Reply, 0); AddButton(229, 372, 0x1466, 0x1466, 10051, GumpButtonType.Reply, 0); AddButton(280, 372, 0x1464, 0x1464, 10054, GumpButtonType.Reply, 0); AddButton(288, 372, 0x1466, 0x1466, 10054, GumpButtonType.Reply, 0); AddButton(300, 372, 0x1464, 0x1464, 10055, GumpButtonType.Reply, 0); AddButton(308, 372, 0x1466, 0x1466, 10055, GumpButtonType.Reply, 0); AddButton(320, 372, 0x1464, 0x1464, 10056, GumpButtonType.Reply, 0); AddButton(328, 372, 0x1466, 0x1466, 10056, GumpButtonType.Reply, 0); AddLabel(322, 370, 0, ">"); AddLabel(326, 370, 0, ">"); AddLabel(330, 370, 0, ">"); AddLabel(304, 370, 0, ">"); AddLabel(308, 370, 0, ">"); AddLabel(286, 370, 0, ">"); AddLabel(226, 370, 0, "<"); AddLabel(203, 370, 0, "<"); AddLabel(207, 370, 0, "<"); AddLabel(181, 370, 0, "<"); AddLabel(185, 370, 0, "<"); AddLabel(189, 370, 0, "<"); } AddButton(15, 410, 4005, 4007, 10099, GumpButtonType.Reply, 0); AddHtmlLocalized(50, 412, 100, 20, 1114268, LabelColor, false, false); // Back AddButton(390, 410, 4005, 4007, 10100, GumpButtonType.Reply, 0); AddHtmlLocalized(425, 412, 120, 18, 1114267, LabelColor, false, false); // Imbue Item }
public override void GetProperties(ObjectPropertyList list) { base.GetProperties(list); list.Add(1070998, ItemName.ToString()); // Use this to redeem<br>Your ~1_PROMO~ : race change }