1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Tokuno Artifacts

Discussion in 'Script Support' started by Macil, Jan 21, 2014.

  1. Macil
    Offline

    Macil Member

    Joined:
    Nov 6, 2013
    Messages:
    35
    Likes Received:
    1
    Publish Number:
    54
    Just wondering where I can turn on Tokuno Artifact drops at. I don't think ServUO manages the Tokuno Arties the same way RunUO did in the past.

    Code (C#):
    1.  
    2. using System;
    3. using System.Collections;
    4. using System.Collections.Generic;
    5. using Server.Gumps;
    6. using Server.Items;
    7. using Server.Misc;
    8. using Server.Mobiles;
    9. using Server.Network;
    10.  
    11. namespace Server.Misc
    12. {
    13.     public enum TreasuresOfTokunoEra
    14.     {
    15.         None,
    16.         ToTOne,
    17.         ToTTwo,
    18.         ToTThree
    19.     }
    20.    
    21.     public class TreasuresOfTokuno
    22.     {
    23.         public const int ItemsPerReward = 10;
    24.        
    25.         private static readonly Type[] m_LesserArtifactsTotal = new Type[]
    26.         {
    27.             typeof(AncientFarmersKasa), typeof(AncientSamuraiDo), typeof(ArmsOfTacticalExcellence), typeof(BlackLotusHood),
    28.             typeof(DaimyosHelm), typeof(DemonForks), typeof(DragonNunchaku), typeof(Exiler), typeof(GlovesOfTheSun),
    29.             typeof(HanzosBow), typeof(LegsOfStability), typeof(PeasantsBokuto), typeof(PilferedDancerFans), typeof(TheDestroyer),
    30.             typeof(TomeOfEnlightenment), typeof(AncientUrn), typeof(HonorableSwords), typeof(PigmentsOfTokuno), typeof(FluteOfRenewal),
    31.             typeof(LeurociansMempoOfFortune), typeof(LesserPigmentsOfTokuno), typeof(MetalPigmentsOfTokuno), typeof(ChestOfHeirlooms)
    32.         };
    33.        
    34.         public static Type[] LesserArtifactsTotal
    35.         {
    36.             get
    37.             {
    38.                 return m_LesserArtifactsTotal;
    39.             }
    40.         }
    41.        
    42.         private static TreasuresOfTokunoEra _DropEra = TreasuresOfTokunoEra.None;
    43.         private static TreasuresOfTokunoEra _RewardEra = TreasuresOfTokunoEra.ToTOne;
    44.        
    45.         public static TreasuresOfTokunoEra DropEra
    46.         {
    47.             get
    48.             {
    49.                 return _DropEra;
    50.             }
    51.             set
    52.             {
    53.                 _DropEra = value;
    54.             }
    55.         }
    56.        
    57.         public static TreasuresOfTokunoEra RewardEra
    58.         {
    59.             get
    60.             {
    61.                 return _RewardEra;
    62.             }
    63.             set
    64.             {
    65.                 _RewardEra = value;
    66.             }
    67.         }
    68.  
    69.         private static readonly Type[][] m_LesserArtifacts = new Type[][]
    70.         {
    71.             // ToT One Rewards
    72.             new Type[]
    73.             {
    74.                 typeof(AncientFarmersKasa), typeof(AncientSamuraiDo), typeof(ArmsOfTacticalExcellence), typeof(BlackLotusHood),
    75.                 typeof(DaimyosHelm), typeof(DemonForks), typeof(DragonNunchaku), typeof(Exiler), typeof(GlovesOfTheSun),
    76.                 typeof(HanzosBow), typeof(LegsOfStability), typeof(PeasantsBokuto), typeof(PilferedDancerFans), typeof(TheDestroyer),
    77.                 typeof(TomeOfEnlightenment), typeof(AncientUrn), typeof(HonorableSwords), typeof(PigmentsOfTokuno),
    78.                 typeof(FluteOfRenewal), typeof(ChestOfHeirlooms)
    79.             },
    80.             // ToT Two Rewards
    81.             new Type[]
    82.             {
    83.                 typeof(MetalPigmentsOfTokuno), typeof(AncientFarmersKasa), typeof(AncientSamuraiDo), typeof(ArmsOfTacticalExcellence),
    84.                 typeof(MetalPigmentsOfTokuno), typeof(BlackLotusHood), typeof(DaimyosHelm), typeof(DemonForks),
    85.                 typeof(MetalPigmentsOfTokuno), typeof(DragonNunchaku), typeof(Exiler), typeof(GlovesOfTheSun), typeof(HanzosBow),
    86.                 typeof(MetalPigmentsOfTokuno), typeof(LegsOfStability), typeof(PeasantsBokuto), typeof(PilferedDancerFans), typeof(TheDestroyer),
    87.                 typeof(MetalPigmentsOfTokuno), typeof(TomeOfEnlightenment), typeof(AncientUrn), typeof(HonorableSwords),
    88.                 typeof(MetalPigmentsOfTokuno), typeof(FluteOfRenewal), typeof(ChestOfHeirlooms)
    89.             },
    90.             // ToT Three Rewards
    91.             new Type[]
    92.             {
    93.                 typeof(LesserPigmentsOfTokuno), typeof(AncientFarmersKasa), typeof(AncientSamuraiDo), typeof(ArmsOfTacticalExcellence),
    94.                 typeof(LesserPigmentsOfTokuno), typeof(BlackLotusHood), typeof(DaimyosHelm), typeof(HanzosBow),
    95.                 typeof(LesserPigmentsOfTokuno), typeof(DemonForks), typeof(DragonNunchaku), typeof(Exiler), typeof(GlovesOfTheSun),
    96.                 typeof(LesserPigmentsOfTokuno), typeof(LegsOfStability), typeof(PeasantsBokuto), typeof(PilferedDancerFans), typeof(TheDestroyer),
    97.                 typeof(LesserPigmentsOfTokuno), typeof(TomeOfEnlightenment), typeof(AncientUrn), typeof(HonorableSwords), typeof(FluteOfRenewal),
    98.                 typeof(LesserPigmentsOfTokuno), typeof(LeurociansMempoOfFortune), typeof(ChestOfHeirlooms)
    99.             }
    100.         };
    101.  
    102.         public static Type[] LesserArtifacts
    103.         {
    104.             get
    105.             {
    106.                 return m_LesserArtifacts[(int)RewardEra - 1];
    107.             }
    108.         }
    109.  
    110.         private static Type[][] m_GreaterArtifacts = null;
    111.        
    112.         public static Type[] GreaterArtifacts
    113.         {
    114.             get
    115.             {
    116.                 if (m_GreaterArtifacts == null)
    117.                 {
    118.                     m_GreaterArtifacts = new Type[ToTRedeemGump.NormalRewards.Length][];
    119.                    
    120.                     for (int i = 0; i < m_GreaterArtifacts.Length; i++)
    121.                     {
    122.                         m_GreaterArtifacts[i] = new Type[ToTRedeemGump.NormalRewards[i].Length];
    123.                        
    124.                         for (int j = 0; j < m_GreaterArtifacts[i].Length; j++)
    125.                         {
    126.                             m_GreaterArtifacts[i][j] = ToTRedeemGump.NormalRewards[i][j].Type;
    127.                         }
    128.                     }
    129.                 }
    130.  
    131.                 return m_GreaterArtifacts[(int)RewardEra - 1];
    132.             }
    133.         }
    134.  
    135.         private static bool CheckLocation(Mobile m)
    136.         {
    137.             Region r = m.Region;
    138.  
    139.             if (r.IsPartOf(typeof(Server.Regions.HouseRegion)) || Server.Multis.BaseBoat.FindBoatAt(m, m.Map) != null)
    140.                 return false;
    141.             //TODO: a CanReach of something check as opposed to above?
    142.  
    143.             if (r.IsPartOf("Yomotsu Mines") || r.IsPartOf("Fan Dancer's Dojo"))
    144.                 return true;
    145.  
    146.             return (m.Map == Map.Tokuno);
    147.         }
    148.  
    149.         public static void HandleKill(Mobile victim, Mobile killer)
    150.         {
    151.             PlayerMobile pm = killer as PlayerMobile;
    152.             BaseCreature bc = victim as BaseCreature;
    153.  
    154.             if (DropEra == TreasuresOfTokunoEra.None || pm == null || bc == null || !CheckLocation(bc) || !CheckLocation(pm) || !killer.InRange(victim, 18))
    155.                 return;
    156.  
    157.             if (bc.Controlled || bc.Owners.Count > 0 || bc.Fame <= 0)
    158.                 return;
    159.  
    160.             //25000 for 1/100 chance, 10 hyrus
    161.             //1500, 1/1000 chance, 20 lizard men for that chance.
    162.  
    163.             pm.ToTTotalMonsterFame += (int)(bc.Fame * (1 + Math.Sqrt(pm.Luck) / 100));
    164.  
    165.             //This is the Exponentional regression with only 2 datapoints.
    166.             //A log. func would also work, but it didn't make as much sense.
    167.             //This function isn't OSI exact beign that I don't know OSI's func they used ;p
    168.             int x = pm.ToTTotalMonsterFame;
    169.  
    170.             //const double A = 8.63316841 * Math.Pow( 10, -4 );
    171.             const double A = 0.000863316841;
    172.             //const double B = 4.25531915 * Math.Pow( 10, -6 );
    173.             const double B = 0.00000425531915;
    174.  
    175.             double chance = A * Math.Pow(10, B * x);
    176.  
    177.             if (chance > Utility.RandomDouble())
    178.             {
    179.                 Item i = null;
    180.                
    181.                 try
    182.                 {
    183.                     i = Activator.CreateInstance(m_LesserArtifacts[(int)DropEra - 1][Utility.Random(m_LesserArtifacts[(int)DropEra - 1].Length)]) as Item;
    184.                 }
    185.                 catch
    186.                 {
    187.                 }
    188.  
    189.                 if (i != null)
    190.                 {
    191.                     pm.SendLocalizedMessage(1062317); // For your valor in combating the fallen beast, a special artifact has been bestowed on you.
    192.                    
    193.                     if (!pm.PlaceInBackpack(i))
    194.                     {
    195.                         if (pm.BankBox != null && pm.BankBox.TryDropItem(killer, i, false))
    196.                             pm.SendLocalizedMessage(1079730); // The item has been placed into your bank box.
    197.                         else
    198.                         {
    199.                             pm.SendLocalizedMessage(1072523); // You find an artifact, but your backpack and bank are too full to hold it.
    200.                             i.MoveToWorld(pm.Location, pm.Map);
    201.                         }
    202.                     }
    203.                    
    204.                     pm.ToTTotalMonsterFame = 0;
    205.                 }
    206.             }
    207.         }
    208.     }
    209. }
    210.  
    211. namespace Server.Mobiles
    212. {
    213.     public class IharaSoko : BaseVendor
    214.     {
    215.         public override bool IsActiveVendor
    216.         {
    217.             get
    218.             {
    219.                 return false;
    220.             }
    221.         }
    222.         public override bool IsInvulnerable
    223.         {
    224.             get
    225.             {
    226.                 return true;
    227.             }
    228.         }
    229.         public override bool DisallowAllMoves
    230.         {
    231.             get
    232.             {
    233.                 return true;
    234.             }
    235.         }
    236.         public override bool ClickTitle
    237.         {
    238.             get
    239.             {
    240.                 return true;
    241.             }
    242.         }
    243.         public override bool CanTeach
    244.         {
    245.             get
    246.             {
    247.                 return false;
    248.             }
    249.         }
    250.  
    251.         protected List<SBInfo> m_SBInfos = new List<SBInfo>();
    252.         protected override List<SBInfo> SBInfos
    253.         {
    254.             get
    255.             {
    256.                 return this.m_SBInfos;
    257.             }
    258.         }
    259.        
    260.         public override void InitSBInfo()
    261.         {
    262.         }
    263.  
    264.         public override void InitOutfit()
    265.         {
    266.             this.AddItem(new Waraji(0x711));
    267.             this.AddItem(new Backpack());
    268.             this.AddItem(new Kamishimo(0x483));
    269.  
    270.             Item item = new LightPlateJingasa();
    271.             item.Hue = 0x711;
    272.  
    273.             this.AddItem(item);
    274.         }
    275.  
    276.         [Constructable]
    277.         public IharaSoko()
    278.             : base("the Imperial Minister of Trade")
    279.         {
    280.             this.Name = "Ihara Soko";
    281.             this.Female = false;
    282.             this.Body = 0x190;
    283.             this.Hue = 0x8403;
    284.         }
    285.  
    286.         public IharaSoko(Serial serial)
    287.             : base(serial)
    288.         {
    289.         }
    290.  
    291.         public override void Serialize(GenericWriter writer)
    292.         {
    293.             base.Serialize(writer);
    294.  
    295.             writer.Write((int)0);
    296.         }
    297.        
    298.         public override void Deserialize(GenericReader reader)
    299.         {
    300.             base.Deserialize(reader);
    301.  
    302.             int version = reader.ReadInt();
    303.         }
    304.  
    305.         public override bool CanBeDamaged()
    306.         {
    307.             return false;
    308.         }
    309.  
    310.         public override void OnMovement(Mobile m, Point3D oldLocation)
    311.         {
    312.             if (m.Alive && m is PlayerMobile)
    313.             {
    314.                 PlayerMobile pm = (PlayerMobile)m;
    315.  
    316.                 int range = 3;
    317.  
    318.                 if (m.Alive && Math.Abs(this.Z - m.Z) < 16 && this.InRange(m, range) && !this.InRange(oldLocation, range))
    319.                 {
    320.                     if (pm.ToTItemsTurnedIn >= TreasuresOfTokuno.ItemsPerReward)
    321.                     {
    322.                         this.SayTo(pm, 1070980); // Congratulations! You have turned in enough minor treasures to earn a greater reward.
    323.  
    324.                         pm.CloseGump(typeof(ToTTurnInGump));    //Sanity
    325.                        
    326.                         if (!pm.HasGump(typeof(ToTRedeemGump)))
    327.                             pm.SendGump(new ToTRedeemGump(this, false));
    328.                     }
    329.                     else
    330.                     {
    331.                         if (pm.ToTItemsTurnedIn == 0)
    332.                             this.SayTo(pm, 1071013); // Bring me 10 of the lost treasures of Tokuno and I will reward you with a valuable item.
    333.                         else
    334.                             this.SayTo(pm, 1070981, String.Format("{0}\t{1}", pm.ToTItemsTurnedIn, TreasuresOfTokuno.ItemsPerReward)); // You have turned in ~1_COUNT~ minor artifacts. Turn in ~2_NUM~ to receive a reward.
    335.  
    336.                         ArrayList buttons = ToTTurnInGump.FindRedeemableItems(pm);
    337.  
    338.                         if (buttons.Count > 0 && !pm.HasGump(typeof(ToTTurnInGump)))
    339.                             pm.SendGump(new ToTTurnInGump(this, buttons));
    340.                     }
    341.                 }
    342.  
    343.                 int leaveRange = 7;
    344.  
    345.                 if (!this.InRange(m, leaveRange) && this.InRange(oldLocation, leaveRange))
    346.                 {
    347.                     pm.CloseGump(typeof(ToTRedeemGump));
    348.                     pm.CloseGump(typeof(ToTTurnInGump));
    349.                 }
    350.             }
    351.         }
    352.  
    353.         public override void TurnToTokuno()
    354.         {
    355.         }
    356.     }
    357. }
    358.  
    359. namespace Server.Gumps
    360. {
    361.     public class ItemTileButtonInfo : ImageTileButtonInfo
    362.     {
    363.         private Item m_Item;
    364.  
    365.         public Item Item
    366.         {
    367.             get
    368.             {
    369.                 return this.m_Item;
    370.             }
    371.             set
    372.             {
    373.                 this.m_Item = value;
    374.             }
    375.         }
    376.  
    377.         public ItemTileButtonInfo(Item i)
    378.             : base(i.ItemID, i.Hue, ((i.Name == null || i.Name.Length <= 0) ? (TextDefinition)i.LabelNumber : (TextDefinition)i.Name))
    379.         {
    380.             this.m_Item = i;
    381.         }
    382.     }
    383.  
    384.     public class ToTTurnInGump : BaseImageTileButtonsGump
    385.     {
    386.         public static ArrayList FindRedeemableItems(Mobile m)
    387.         {
    388.             Backpack pack = (Backpack)m.Backpack;
    389.             if (pack == null)
    390.                 return new ArrayList();
    391.  
    392.             ArrayList items = new ArrayList(pack.FindItemsByType(TreasuresOfTokuno.LesserArtifactsTotal));
    393.             ArrayList buttons = new ArrayList();
    394.  
    395.             for (int i = 0; i < items.Count; i++)
    396.             {
    397.                 Item item = (Item)items[i];
    398.                 if (item is ChestOfHeirlooms && !((ChestOfHeirlooms)item).Locked)
    399.                     continue;
    400.                
    401.                 if (item is ChestOfHeirlooms && ((ChestOfHeirlooms)item).TrapLevel != 10)
    402.                     continue;
    403.                
    404.                 if (item is PigmentsOfTokuno && ((PigmentsOfTokuno)item).Type != PigmentType.None)
    405.                     continue;
    406.  
    407.                 buttons.Add(new ItemTileButtonInfo(item));
    408.             }
    409.  
    410.             return buttons;
    411.         }
    412.  
    413.         readonly Mobile m_Collector;
    414.  
    415.         public ToTTurnInGump(Mobile collector, ArrayList buttons)
    416.             : base(1071012, buttons)// Click a minor artifact to give it to Ihara Soko.
    417.         {
    418.             this.m_Collector = collector;
    419.         }
    420.  
    421.         public ToTTurnInGump(Mobile collector, ItemTileButtonInfo[] buttons)
    422.             : base(1071012, buttons)// Click a minor artifact to give it to Ihara Soko.
    423.         {
    424.             this.m_Collector = collector;
    425.         }
    426.  
    427.         public override void HandleButtonResponse(NetState sender, int adjustedButton, ImageTileButtonInfo buttonInfo)
    428.         {
    429.             PlayerMobile pm = sender.Mobile as PlayerMobile;
    430.  
    431.             Item item = ((ItemTileButtonInfo)buttonInfo).Item;
    432.  
    433.             if (!(pm != null && item.IsChildOf(pm.Backpack) && pm.InRange(this.m_Collector.Location, 7)))
    434.                 return;
    435.  
    436.             item.Delete();
    437.  
    438.             if (++pm.ToTItemsTurnedIn >= TreasuresOfTokuno.ItemsPerReward)
    439.             {
    440.                 this.m_Collector.SayTo(pm, 1070980); // Congratulations! You have turned in enough minor treasures to earn a greater reward.
    441.  
    442.                 pm.CloseGump(typeof(ToTTurnInGump));    //Sanity
    443.  
    444.                 if (!pm.HasGump(typeof(ToTRedeemGump)))
    445.                     pm.SendGump(new ToTRedeemGump(this.m_Collector, false));
    446.             }
    447.             else
    448.             {
    449.                 this.m_Collector.SayTo(pm, 1070981, String.Format("{0}\t{1}", pm.ToTItemsTurnedIn, TreasuresOfTokuno.ItemsPerReward)); // You have turned in ~1_COUNT~ minor artifacts. Turn in ~2_NUM~ to receive a reward.
    450.  
    451.                 ArrayList buttons = FindRedeemableItems(pm);
    452.  
    453.                 pm.CloseGump(typeof(ToTTurnInGump)); //Sanity
    454.  
    455.                 if (buttons.Count > 0)
    456.                     pm.SendGump(new ToTTurnInGump(this.m_Collector, buttons));
    457.             }
    458.         }
    459.  
    460.         public override void HandleCancel(NetState sender)
    461.         {
    462.             PlayerMobile pm = sender.Mobile as PlayerMobile;
    463.  
    464.             if (pm == null || !pm.InRange(this.m_Collector.Location, 7))
    465.                 return;
    466.            
    467.             if (pm.ToTItemsTurnedIn == 0)
    468.                 this.m_Collector.SayTo(pm, 1071013); // Bring me 10 of the lost treasures of Tokuno and I will reward you with a valuable item.
    469.             else if (pm.ToTItemsTurnedIn < TreasuresOfTokuno.ItemsPerReward)    //This case should ALWAYS be true with this gump, jsut a sanity check
    470.                 this.m_Collector.SayTo(pm, 1070981, String.Format("{0}\t{1}", pm.ToTItemsTurnedIn, TreasuresOfTokuno.ItemsPerReward)); // You have turned in ~1_COUNT~ minor artifacts. Turn in ~2_NUM~ to receive a reward.
    471.             else
    472.                 this.m_Collector.SayTo(pm, 1070982); // When you wish to choose your reward, you have but to approach me again.
    473.         }
    474.     }
    475. }
    476.  
    477. namespace Server.Gumps
    478. {
    479.     public class ToTRedeemGump : BaseImageTileButtonsGump
    480.     {
    481.         public class TypeTileButtonInfo : ImageTileButtonInfo
    482.         {
    483.             private readonly Type m_Type;
    484.  
    485.             public Type Type
    486.             {
    487.                 get
    488.                 {
    489.                     return this.m_Type;
    490.                 }
    491.             }
    492.  
    493.             public TypeTileButtonInfo(Type type, int itemID, int hue, TextDefinition label, int localizedToolTip)
    494.                 : base(itemID, hue, label, localizedToolTip)
    495.             {
    496.                 this.m_Type = type;
    497.             }
    498.  
    499.             public TypeTileButtonInfo(Type type, int itemID, TextDefinition label)
    500.                 : this(type, itemID, 0, label, -1)
    501.             {
    502.             }
    503.  
    504.             public TypeTileButtonInfo(Type type, int itemID, TextDefinition label, int localizedToolTip)
    505.                 : this(type, itemID, 0, label, localizedToolTip)
    506.             {
    507.             }
    508.         }
    509.  
    510.         public class PigmentsTileButtonInfo : ImageTileButtonInfo
    511.         {
    512.             private PigmentType m_Pigment;
    513.  
    514.             public PigmentType Pigment
    515.             {
    516.                 get
    517.                 {
    518.                     return this.m_Pigment;
    519.                 }
    520.  
    521.                 set
    522.                 {
    523.                     this.m_Pigment = value;
    524.                 }
    525.             }
    526.  
    527.             public PigmentsTileButtonInfo(PigmentType p)
    528.                 : base(0xEFF, PigmentsOfTokuno.GetInfo(p)[0], PigmentsOfTokuno.GetInfo(p)[1])
    529.             {
    530.                 this.m_Pigment = p;
    531.             }
    532.         }
    533.  
    534.         #region ToT Normal Rewards Table
    535.         private static readonly TypeTileButtonInfo[][] m_NormalRewards = new TypeTileButtonInfo[][]
    536.         {
    537.             // ToT One Rewards
    538.             new TypeTileButtonInfo[]
    539.             {
    540.                 new TypeTileButtonInfo(typeof(SwordsOfProsperity), 0x27A9, 1070963, 1071002),
    541.                 new TypeTileButtonInfo(typeof(SwordOfTheStampede), 0x27A2, 1070964, 1070978),
    542.                 new TypeTileButtonInfo(typeof(WindsEdge), 0x27A3, 1070965, 1071003),
    543.                 new TypeTileButtonInfo(typeof(DarkenedSky), 0x27AD, 1070966, 1071004),
    544.                 new TypeTileButtonInfo(typeof(TheHorselord), 0x27A5, 1070967, 1071005),
    545.                 new TypeTileButtonInfo(typeof(RuneBeetleCarapace), 0x277D, 1070968, 1071006),
    546.                 new TypeTileButtonInfo(typeof(KasaOfTheRajin), 0x2798, 1070969, 1071007),
    547.                 new TypeTileButtonInfo(typeof(Stormgrip), 0x2792, 1070970, 1071008),
    548.                 new TypeTileButtonInfo(typeof(TomeOfLostKnowledge), 0x0EFA, 0x530, 1070971, 1071009),
    549.                 new TypeTileButtonInfo(typeof(PigmentsOfTokuno), 0x0EFF, 1070933, 1071011)
    550.             },
    551.             // ToT Two Rewards
    552.             new TypeTileButtonInfo[]
    553.             {
    554.                 new TypeTileButtonInfo(typeof(SwordsOfProsperity), 0x27A9, 1070963, 1071002),
    555.                 new TypeTileButtonInfo(typeof(SwordOfTheStampede), 0x27A2, 1070964, 1070978),
    556.                 new TypeTileButtonInfo(typeof(WindsEdge), 0x27A3, 1070965, 1071003),
    557.                 new TypeTileButtonInfo(typeof(DarkenedSky), 0x27AD, 1070966, 1071004),
    558.                 new TypeTileButtonInfo(typeof(TheHorselord), 0x27A5, 1070967, 1071005),
    559.                 new TypeTileButtonInfo(typeof(RuneBeetleCarapace), 0x277D, 1070968, 1071006),
    560.                 new TypeTileButtonInfo(typeof(KasaOfTheRajin), 0x2798, 1070969, 1071007),
    561.                 new TypeTileButtonInfo(typeof(Stormgrip), 0x2792, 1070970, 1071008),
    562.                 new TypeTileButtonInfo(typeof(TomeOfLostKnowledge), 0x0EFA, 0x530, 1070971, 1071009),
    563.                 new TypeTileButtonInfo(typeof(PigmentsOfTokuno), 0x0EFF, 1070933, 1071011)
    564.             },
    565.             // ToT Three Rewards
    566.             new TypeTileButtonInfo[]
    567.             {
    568.                 new TypeTileButtonInfo(typeof(SwordsOfProsperity), 0x27A9, 1070963, 1071002),
    569.                 new TypeTileButtonInfo(typeof(SwordOfTheStampede), 0x27A2, 1070964, 1070978),
    570.                 new TypeTileButtonInfo(typeof(WindsEdge), 0x27A3, 1070965, 1071003),
    571.                 new TypeTileButtonInfo(typeof(DarkenedSky), 0x27AD, 1070966, 1071004),
    572.                 new TypeTileButtonInfo(typeof(TheHorselord), 0x27A5, 1070967, 1071005),
    573.                 new TypeTileButtonInfo(typeof(RuneBeetleCarapace), 0x277D, 1070968, 1071006),
    574.                 new TypeTileButtonInfo(typeof(KasaOfTheRajin), 0x2798, 1070969, 1071007),
    575.                 new TypeTileButtonInfo(typeof(Stormgrip), 0x2792, 1070970, 1071008),
    576.                 new TypeTileButtonInfo(typeof(TomeOfLostKnowledge), 0x0EFA, 0x530, 1070971, 1071009)
    577.             }
    578.         };
    579.         #endregion
    580.  
    581.         public static TypeTileButtonInfo[][] NormalRewards
    582.         {
    583.             get
    584.             {
    585.                 return m_NormalRewards;
    586.             }
    587.         }
    588.  
    589.         #region ToT Pigment Rewards Table
    590.         private static readonly PigmentsTileButtonInfo[][] m_PigmentRewards = new PigmentsTileButtonInfo[][]
    591.         {
    592.             // ToT One Pigment Rewards
    593.             new PigmentsTileButtonInfo[]
    594.             {
    595.                 new PigmentsTileButtonInfo(PigmentType.ParagonGold),
    596.                 new PigmentsTileButtonInfo(PigmentType.VioletCouragePurple),
    597.                 new PigmentsTileButtonInfo(PigmentType.InvulnerabilityBlue),
    598.                 new PigmentsTileButtonInfo(PigmentType.LunaWhite),
    599.                 new PigmentsTileButtonInfo(PigmentType.DryadGreen),
    600.                 new PigmentsTileButtonInfo(PigmentType.ShadowDancerBlack),
    601.                 new PigmentsTileButtonInfo(PigmentType.BerserkerRed),
    602.                 new PigmentsTileButtonInfo(PigmentType.NoxGreen),
    603.                 new PigmentsTileButtonInfo(PigmentType.RumRed),
    604.                 new PigmentsTileButtonInfo(PigmentType.FireOrange)
    605.             },
    606.             // ToT Two Pigment Rewards
    607.             new PigmentsTileButtonInfo[]
    608.             {
    609.                 new PigmentsTileButtonInfo(PigmentType.FadedCoal),
    610.                 new PigmentsTileButtonInfo(PigmentType.Coal),
    611.                 new PigmentsTileButtonInfo(PigmentType.FadedGold),
    612.                 new PigmentsTileButtonInfo(PigmentType.StormBronze),
    613.                 new PigmentsTileButtonInfo(PigmentType.Rose),
    614.                 new PigmentsTileButtonInfo(PigmentType.MidnightCoal),
    615.                 new PigmentsTileButtonInfo(PigmentType.FadedBronze),
    616.                 new PigmentsTileButtonInfo(PigmentType.FadedRose),
    617.                 new PigmentsTileButtonInfo(PigmentType.DeepRose)
    618.             },
    619.             // ToT Three Pigment Rewards
    620.             new PigmentsTileButtonInfo[]
    621.             {
    622.                 new PigmentsTileButtonInfo(PigmentType.ParagonGold),
    623.                 new PigmentsTileButtonInfo(PigmentType.VioletCouragePurple),
    624.                 new PigmentsTileButtonInfo(PigmentType.InvulnerabilityBlue),
    625.                 new PigmentsTileButtonInfo(PigmentType.LunaWhite),
    626.                 new PigmentsTileButtonInfo(PigmentType.DryadGreen),
    627.                 new PigmentsTileButtonInfo(PigmentType.ShadowDancerBlack),
    628.                 new PigmentsTileButtonInfo(PigmentType.BerserkerRed),
    629.                 new PigmentsTileButtonInfo(PigmentType.NoxGreen),
    630.                 new PigmentsTileButtonInfo(PigmentType.RumRed),
    631.                 new PigmentsTileButtonInfo(PigmentType.FireOrange)
    632.             }
    633.         };
    634.         #endregion
    635.  
    636.         public static PigmentsTileButtonInfo[][] PigmentRewards
    637.         {
    638.             get
    639.             {
    640.                 return m_PigmentRewards;
    641.             }
    642.         }
    643.  
    644.         private readonly Mobile m_Collector;
    645.  
    646.         public ToTRedeemGump(Mobile collector, bool pigments)
    647.             : base(pigments ? 1070986 : 1070985, pigments ? (ImageTileButtonInfo[])m_PigmentRewards[(int)TreasuresOfTokuno.RewardEra - 1] : (ImageTileButtonInfo[])m_NormalRewards[(int)TreasuresOfTokuno.RewardEra - 1])
    648.         {
    649.             this.m_Collector = collector;
    650.         }
    651.  
    652.         public override void HandleButtonResponse(NetState sender, int adjustedButton, ImageTileButtonInfo buttonInfo)
    653.         {
    654.             PlayerMobile pm = sender.Mobile as PlayerMobile;
    655.  
    656.             if (pm == null || !pm.InRange(this.m_Collector.Location, 7) || !(pm.ToTItemsTurnedIn >= TreasuresOfTokuno.ItemsPerReward))
    657.                 return;
    658.  
    659.             bool pigments = (buttonInfo is PigmentsTileButtonInfo);
    660.  
    661.             Item item = null;
    662.  
    663.             if (pigments)
    664.             {
    665.                 PigmentsTileButtonInfo p = buttonInfo as PigmentsTileButtonInfo;
    666.  
    667.                 item = new PigmentsOfTokuno(p.Pigment);
    668.             }
    669.             else
    670.             {
    671.                 TypeTileButtonInfo t = buttonInfo as TypeTileButtonInfo;
    672.  
    673.                 if (t.Type == typeof(PigmentsOfTokuno))    //Special case of course.
    674.                 {
    675.                     pm.CloseGump(typeof(ToTTurnInGump));    //Sanity
    676.                     pm.CloseGump(typeof(ToTRedeemGump));
    677.  
    678.                     pm.SendGump(new ToTRedeemGump(this.m_Collector, true));
    679.  
    680.                     return;
    681.                 }
    682.  
    683.                 try
    684.                 {
    685.                     item = (Item)Activator.CreateInstance(t.Type);
    686.                 }
    687.                 catch
    688.                 {
    689.                 }
    690.             }
    691.  
    692.             if (item == null)
    693.                 return; //Sanity
    694.  
    695.             if (pm.AddToBackpack(item))
    696.             {
    697.                 pm.ToTItemsTurnedIn -= TreasuresOfTokuno.ItemsPerReward;
    698.                 this.m_Collector.SayTo(pm, 1070984, (item.Name == null || item.Name.Length <= 0) ? String.Format("#{0}", item.LabelNumber) : item.Name); // You have earned the gratitude of the Empire. I have placed the ~1_OBJTYPE~ in your backpack.
    699.             }
    700.             else
    701.             {
    702.                 item.Delete();
    703.                 this.m_Collector.SayTo(pm, 500722); // You don't have enough room in your backpack!
    704.                 this.m_Collector.SayTo(pm, 1070982); // When you wish to choose your reward, you have but to approach me again.
    705.             }
    706.         }
    707.  
    708.         public override void HandleCancel(NetState sender)
    709.         {
    710.             PlayerMobile pm = sender.Mobile as PlayerMobile;
    711.  
    712.             if (pm == null || !pm.InRange(this.m_Collector.Location, 7))
    713.                 return;
    714.  
    715.             if (pm.ToTItemsTurnedIn == 0)
    716.                 this.m_Collector.SayTo(pm, 1071013); // Bring me 10 of the lost treasures of Tokuno and I will reward you with a valuable item.
    717.             else if (pm.ToTItemsTurnedIn < TreasuresOfTokuno.ItemsPerReward)    //This and above case should ALWAYS be FALSE with this gump, jsut a sanity check
    718.                 this.m_Collector.SayTo(pm, 1070981, String.Format("{0}\t{1}", pm.ToTItemsTurnedIn, TreasuresOfTokuno.ItemsPerReward)); // You have turned in ~1_COUNT~ minor artifacts. Turn in ~2_NUM~ to receive a reward.
    719.             else
    720.                 this.m_Collector.SayTo(pm, 1070982); // When you wish to choose your reward, you have but to approach me again.
    721.         }
    722.     }
    723. }
    724.  
    725. /* Notes
    726.  
    727. Pigments of tokuno do NOT check for if item is already hued 0;  APPARENTLY he still accepts it if it's < 10 charges.
    728.  
    729. Chest of Heirlooms don't show if unlocked.
    730.  
    731. Chest of heirlooms, locked, HARD to pick at 100 lock picking but not impossible.  had 95 health to 0, cause it's trapped >< (explosion i think)
    732. */
     
  2. Ravenwolfe
    Offline

    Moderator ServUO Developer

    Joined:
    Sep 7, 2013
    Messages:
    1,155
    Likes Received:
    125
    Use the command [totadmin

    You can set the drop era and reward era and activate whichever you want, on the fly, and in game.

    I think you have to place Ihara Soko manually.
     
    • Like Like x 2
  3. Macil
    Offline

    Macil Member

    Joined:
    Nov 6, 2013
    Messages:
    35
    Likes Received:
    1
    Get the eff out of here. That is too cool! Thank you so much! =)
     
    • Two Thumbs Up Two Thumbs Up x 1
Similar Threads: Tokuno Artifacts
Forum Title Date
Archived Bug Reports Ranger's Cloak of Augmentation cannot be dyed with Tokuno pigments May 1, 2017
Archived Bug Reports Cannot Paint some itens with tokuno dies Feb 5, 2017
Archived Bug Reports BLackthorn items and tokuno dyes Feb 1, 2017
Archived Bug Reports Treasures of Tokuno point bug Jan 17, 2017
General Discussion Tokuno New Island? Aug 15, 2016
Shard Discussion Treasures of Tokuno Season Duration(s) May 21, 2016
Archived Bug Reports BasePigmentsOfTokuno should not be Artifact Apr 25, 2016