public AquariumGump(Aquarium aquarium, bool edit) : base(100, 100) { m_Aquarium = aquarium; Closable = true; Disposable = true; Dragable = true; Resizable = false; AddPage(0); AddBackground(0, 0, 350, 323, 0xE10); AddImage(0, 0, 0x2C96); if (m_Aquarium.Items.Count == 0) return; for (int i = 1; i <= m_Aquarium.Items.Count; i ++) DisplayPage(i, edit); }
// Cancel vacation mode public CancelVacationMode( Aquarium aquarium ) : base(6240, 2) { m_Aquarium = aquarium; }
// GM Open Container public GMOpen( Aquarium aquarium ) : base(6234, -1) { m_Aquarium = aquarium; }
// GM Fill Food and Water public GMFill( Aquarium aquarium ) : base(6236, -1) { m_Aquarium = aquarium; }
// GM Add Food public GMAddFood( Aquarium aquarium ) : base(6231, -1) { m_Aquarium = aquarium; }
public GMFill(Aquarium aquarium) : base(6236, -1)// GM Fill Food and Water { this.m_Aquarium = aquarium; }
public GMAddFood(Aquarium aquarium) : base(6231, -1)// GM Add Food { this.m_Aquarium = aquarium; }
public GMFill(Aquarium aquarium) : base(6236, -1) { m_Aquarium = aquarium; }
public GMOpen(Aquarium aquarium) : base(6234, -1) { m_Aquarium = aquarium; }
public GMForceEvaluate(Aquarium aquarium) : base(6233, -1) { m_Aquarium = aquarium; }
public GMAddWater(Aquarium aquarium) : base(6232, -1) { m_Aquarium = aquarium; }
public AquariumGump(Aquarium aquarium, Mobile from, int index) : base(10, 10) { if (aquarium == null || from == null) { return; } if (aquarium.Deleted || from.Deleted || index < 0) { return; } m_Aquarium = aquarium; m_ItemIndex = index; m_FishItemCount = m_Aquarium.m_FishItems.Count; m_DecorationItemCount = m_Aquarium.m_DecorationItems.Count; m_TotalItemCount = m_FishItemCount + m_DecorationItemCount; Closable = true; Disposable = true; Dragable = true; Resizable = false; AddImage(0, 0, 11414); AddImage(315, 0, 11414); List <Point2D> m_FishLocations = new List <Point2D>(); List <Point2D> m_DecorationLocations = new List <Point2D>(); //Fish Spots m_FishLocations.Add(new Point2D(432, 62)); m_FishLocations.Add(new Point2D(153, 87)); m_FishLocations.Add(new Point2D(574, 31)); m_FishLocations.Add(new Point2D(432, 96)); m_FishLocations.Add(new Point2D(240, 95)); m_FishLocations.Add(new Point2D(348, 35)); m_FishLocations.Add(new Point2D(562, 63)); m_FishLocations.Add(new Point2D(277, 22)); m_FishLocations.Add(new Point2D(241, 63)); m_FishLocations.Add(new Point2D(361, 86)); m_FishLocations.Add(new Point2D(15, 15)); m_FishLocations.Add(new Point2D(134, 57)); m_FishLocations.Add(new Point2D(83, 34)); m_FishLocations.Add(new Point2D(117, 27)); m_FishLocations.Add(new Point2D(159, 28)); m_FishLocations.Add(new Point2D(99, 95)); m_FishLocations.Add(new Point2D(228, 36)); m_FishLocations.Add(new Point2D(427, 24)); m_FishLocations.Add(new Point2D(563, 110)); m_FishLocations.Add(new Point2D(68, 63)); //Decoration Locations m_DecorationLocations.Add(new Point2D(336, 116)); m_DecorationLocations.Add(new Point2D(530, 135)); m_DecorationLocations.Add(new Point2D(164, 139)); m_DecorationLocations.Add(new Point2D(201, 115)); m_DecorationLocations.Add(new Point2D(583, 120)); m_DecorationLocations.Add(new Point2D(256, 132)); m_DecorationLocations.Add(new Point2D(20, 144)); m_DecorationLocations.Add(new Point2D(92, 127)); m_DecorationLocations.Add(new Point2D(439, 121)); m_DecorationLocations.Add(new Point2D(383, 139)); for (int a = 0; a < aquarium.m_FishItems.Count; a++) { AquariumItem item = aquarium.m_FishItems[a]; Point2D point = m_FishLocations[a]; AddItem(point.X + item.OffsetX, point.Y + item.OffsetY, item.ItemID, item.Hue); } //Decoration AddItem(597, 31, 3377, 2600); AddItem(296, 134, 3365, 2600); AddItem(458, 14, 3302, 2600); AddItem(32, 66, 3314, 2600); AddItem(273, 11, 3320, 2600); AddItem(493, 129, 3367, 2600); AddItem(389, 16, 3313, 2600); AddItem(58, 131, 3366, 2600); AddItem(400, 130, 3367, 2600); AddItem(58, 135, 3379, 2600); AddItem(193, 41, 3376, 2600); AddItem(118, 123, 3374, 2600); AddItem(574, 140, 3372, 2600); AddItem(420, 117, 3379, 2600); for (int a = 0; a < aquarium.m_DecorationItems.Count; a++) { AquariumItem item = aquarium.m_DecorationItems[a]; Point2D point = m_DecorationLocations[a]; AddItem(point.X + item.OffsetX, point.Y + item.OffsetY, item.ItemID, item.Hue); } int textHue = 2036; int rarityTextHue = textHue; if (m_ItemIndex < m_TotalItemCount && m_TotalItemCount > 0) { AddImage(79, 224, 103); //Wood Background AddImage(242, 186, 63); //Basket AddItem(212, 219, 3520); AddItem(275, 260, 3922); AddItem(250, 260, 3581); AquariumItem item; Point2D point; int iStartX = 150; int iStartY = 235; //Fish if (m_ItemIndex < m_FishItemCount) { item = m_Aquarium.m_FishItems[m_ItemIndex]; point = m_FishLocations[m_ItemIndex]; if (item != null) { rarityTextHue = AquariumItem.GetRarityTextColor(item.ItemRarity); AddItem(320 + item.OffsetX, 250 + item.OffsetY, item.ItemID, item.Hue); //Fish AddLabel(iStartX - (item.DescriptionA.Length * 3), iStartY, textHue, item.DescriptionA); iStartY += 20; AddLabel(iStartX - (item.DescriptionB.Length * 3), iStartY, textHue, item.DescriptionB); if (item.DescriptionB != "") { iStartY += 20; } string rarityText = AquariumItem.GetRarityTextName(item.ItemRarity); AddLabel(iStartX - (rarityText.Length * 3), iStartY, rarityTextHue, rarityText); iStartY += 20; string weightText = item.Weight.ToString() + " lbs"; AddLabel(iStartX - (weightText.Length * 3), iStartY, textHue, weightText); iStartY += 20; AddImage(point.X - 18, point.Y - 30, 30063); //Pointer } } //Decoration else { item = m_Aquarium.m_DecorationItems[m_ItemIndex - m_FishItemCount]; point = m_DecorationLocations[m_ItemIndex - m_FishItemCount]; if (item != null) { rarityTextHue = AquariumItem.GetRarityTextColor(item.ItemRarity); AddItem(320 + item.OffsetX, 250 + item.OffsetY, item.ItemID, item.Hue); //Decoration AddLabel(iStartX - (item.DescriptionA.Length * 3), iStartY, textHue, item.DescriptionA); iStartY += 20; AddLabel(iStartX - (item.DescriptionB.Length * 3), iStartY, textHue, item.DescriptionB); if (item.DescriptionB != "") { iStartY += 20; } string rarityText = AquariumItem.GetRarityTextName(item.ItemRarity); AddLabel(iStartX - (rarityText.Length * 3), iStartY, rarityTextHue, rarityText); iStartY += 20; AddImage(point.X - 18, point.Y - 30, 30063); //Pointer } } if (m_Aquarium.HasAccess(from)) { AddButton(456, 296, 2474, 2472, 3, GumpButtonType.Reply, 0); AddLabel(490, 298, textHue, "Remove"); } } if (m_ItemIndex > 0) { AddButton(455, 226, 4014, 4016, 1, GumpButtonType.Reply, 0); AddLabel(489, 229, textHue, "Previous"); } if (m_ItemIndex < m_TotalItemCount - 1) { AddButton(455, 261, 4005, 4007, 2, GumpButtonType.Reply, 0); AddLabel(490, 264, textHue, "Next"); } }
public virtual void Fill_OnTarget(Mobile from, object targ) { if (!IsEmpty || !Fillable || !ValidateUse(from, false)) { return; } if (targ is Aquarium) { Aquarium aquarium = targ as Aquarium; if (aquarium.WaterLevel < Aquarium.MaxWaterLevel) { int waterNeeded = Aquarium.MaxWaterLevel - aquarium.WaterLevel; int waterUsed = waterNeeded; if (Quantity < waterUsed) { waterUsed = Quantity; } aquarium.WaterLevel += waterUsed; Quantity -= waterUsed; from.PlaySound(0x4E); from.CloseGump(typeof(AquariumGump)); from.SendMessage("You add water to the aquarium."); } } if (targ is BaseBeverage) { BaseBeverage bev = (BaseBeverage)targ; if (bev.IsEmpty || !bev.ValidateUse(from, true)) { return; } this.Content = bev.Content; this.Poison = bev.Poison; this.Poisoner = bev.Poisoner; if (bev.Quantity > this.MaxQuantity) { this.Quantity = this.MaxQuantity; bev.Quantity -= this.MaxQuantity; } else { this.Quantity += bev.Quantity; bev.Quantity = 0; } } if (targ is Aquarium) { Aquarium aquarium = targ as Aquarium; if (aquarium.WaterLevel < Aquarium.MaxWaterLevel) { int waterNeeded = Aquarium.MaxWaterLevel - aquarium.WaterLevel; int waterAdded = waterNeeded; if (Quantity < waterAdded) { waterAdded = Quantity; } Quantity -= waterAdded; aquarium.WaterLevel += waterAdded; from.PlaySound(0x4E); from.CloseGump(typeof(AquariumGump)); from.SendMessage("You add water to the aquarium."); } else { from.SendMessage("That aquarium is already full of water."); } } else if (targ is BaseWaterContainer) { BaseWaterContainer bwc = targ as BaseWaterContainer; if (Quantity == 0 || (Content == BeverageType.Water && !IsFull)) { int iNeed = Math.Min((MaxQuantity - Quantity), bwc.Quantity); if (iNeed > 0 && !bwc.IsEmpty && !IsFull) { bwc.Quantity -= iNeed; Quantity += iNeed; Content = BeverageType.Water; from.PlaySound(0x4E); } } } else if (targ is Item) { Item item = (Item)targ; IWaterSource src; src = (item as IWaterSource); if (src == null && item is AddonComponent) { src = (((AddonComponent)item).Addon as IWaterSource); } if (src == null || src.Quantity <= 0) { return; } if (from.Map != item.Map || !from.InRange(item.GetWorldLocation(), 2) || !from.InLOS(item)) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. return; } this.Content = BeverageType.Water; this.Poison = null; this.Poisoner = null; if (src.Quantity > this.MaxQuantity) { this.Quantity = this.MaxQuantity; src.Quantity -= this.MaxQuantity; } else { this.Quantity += src.Quantity; src.Quantity = 0; } from.SendLocalizedMessage(1010089); // You fill the container with water. } else if (targ is LandTarget) { int tileID = ((LandTarget)targ).TileID; PlayerMobile player = from as PlayerMobile; if (player != null) { } } }
public ExamineEntry(Aquarium aquarium) : base(6235, 2) { m_Aquarium = aquarium; }
public ViewEventEntry(Aquarium aquarium) : base(6239, 2)// View events { this.m_Aquarium = aquarium; }
public CollectRewardEntry(Aquarium aquarium) : base(6237, 2) { m_Aquarium = aquarium; }
public GMForceEvaluate(Aquarium aquarium) : base(6233, -1)// GM Force Evaluate { this.m_Aquarium = aquarium; }
public ViewEventEntry(Aquarium aquarium) : base(6239, 2) { m_Aquarium = aquarium; }
public virtual void Pour_OnTarget(Mobile from, object targ) { if (IsEmpty || !Pourable || !ValidateUse(from, false)) { return; } if (targ is Aquarium) { Aquarium aquarium = targ as Aquarium; int waterNeeded = Aquarium.MaxWaterLevel - aquarium.WaterLevel; int waterUsed = waterNeeded; if (Quantity < waterUsed) { waterUsed = Quantity; } aquarium.WaterLevel += waterUsed; Quantity -= waterUsed; from.PlaySound(0x4E); from.CloseGump(typeof(AquariumGump)); from.SendMessage("You add water to the aquarium."); } else if (targ is BaseBeverage) { BaseBeverage bev = (BaseBeverage)targ; if (!bev.ValidateUse(from, true)) { return; } if (bev.IsFull && bev.Content == this.Content) { from.SendLocalizedMessage(500848); // Couldn't pour it there. It was already full. } else if (!bev.IsEmpty) { from.SendLocalizedMessage(500846); // Can't pour it there. } else { bev.Content = this.Content; bev.Poison = this.Poison; bev.Poisoner = this.Poisoner; if (this.Quantity > bev.MaxQuantity) { bev.Quantity = bev.MaxQuantity; this.Quantity -= bev.MaxQuantity; } else { bev.Quantity += this.Quantity; this.Quantity = 0; } from.PlaySound(0x4E); } } else if (from == targ) { if (from.Thirst < 20) { from.Thirst += 1; } if (ContainsAlchohol) { int bac = 0; switch (this.Content) { case BeverageType.Ale: bac = 1; break; case BeverageType.Wine: bac = 2; break; case BeverageType.Cider: bac = 3; break; case BeverageType.Liquor: bac = 4; break; } from.BAC += bac; if (from.BAC > 60) { from.BAC = 60; } CheckHeaveTimer(from); OnDrink(from); } from.PlaySound(Utility.RandomList(0x30, 0x2D6)); if (m_Poison != null) { from.ApplyPoison(m_Poisoner, m_Poison); } --Quantity; } else if (targ is BaseWaterContainer) { BaseWaterContainer bwc = targ as BaseWaterContainer; if (Content != BeverageType.Water) { from.SendLocalizedMessage(500842); // Can't pour that in there. } else if (bwc.Items.Count != 0) { from.SendLocalizedMessage(500841); // That has something in it. } else { int itNeeds = Math.Min((bwc.MaxQuantity - bwc.Quantity), Quantity); if (itNeeds > 0) { bwc.Quantity += itNeeds; Quantity -= itNeeds; from.PlaySound(0x4E); } } } else if (targ is AddonComponent && (((AddonComponent)targ).Addon is WaterVatEast || ((AddonComponent)targ).Addon is WaterVatSouth) && this.Content == BeverageType.Water) { PlayerMobile player = from as PlayerMobile; } else { from.SendLocalizedMessage(500846); // Can't pour it there. } }
public CancelVacationMode(Aquarium aquarium) : base(6240, 2) { m_Aquarium = aquarium; }
// Examine Aquarium public ExamineEntry( Aquarium aquarium ) : base(6235, 2) { m_Aquarium = aquarium; }
public GMAddFood(Aquarium aquarium) : base(6231, -1) { m_Aquarium = aquarium; }
// GM Add Water public GMAddWater( Aquarium aquarium ) : base(6232, -1) { m_Aquarium = aquarium; }
public ExamineEntry(Aquarium aquarium) : base(6235, 2)// Examine Aquarium { this.m_Aquarium = aquarium; }
// GM Force Evaluate public GMForceEvaluate( Aquarium aquarium ) : base(6233, -1) { m_Aquarium = aquarium; }
public CollectRewardEntry(Aquarium aquarium) : base(6237, 2)// Collect Reward { this.m_Aquarium = aquarium; }
// View events public ViewEventEntry( Aquarium aquarium ) : base(6239, 2) { m_Aquarium = aquarium; }
// Collect Reward public CollectRewardEntry( Aquarium aquarium ) : base(6237, 2) { m_Aquarium = aquarium; }
public CancelVacationMode(Aquarium aquarium) : base(6240, 2)// Cancel vacation mode { this.m_Aquarium = aquarium; }
public GMAddWater(Aquarium aquarium) : base(6232, -1)// GM Add Water { this.m_Aquarium = aquarium; }
public GMOpen(Aquarium aquarium) : base(6234, -1)// GM Open Container { this.m_Aquarium = aquarium; }
public AquariumState(Aquarium parent) => _aquarium = parent;