public static void ClearCurrentAbility(Mobile m) { m_Table.Remove(m); CustomWeaponAbilities.Check(m); if (Core.AOS && m.NetState != null) { m.Send(ClearWeaponAbility.Instance); } }
private void InitializeGump(Mobile from) { Closable = false; Disposable = true; Dragable = true; Resizable = false; int nDown = -90; int nRight = 5; int nPos = 1024; AddButton((nPos + 34) + nRight, 90 + nDown, 0x082D, 0x082D, 0, GumpButtonType.Reply, 0); CustomWeaponAbilities.SetAbilities(m_weapon, ref Primary, ref Secondary, ref Third, ref Fourth, ref Fifth); AddImage((nPos + 34) + nRight, 109 + nDown, 0x5DD0); AddButton((nPos + 34) + nRight, 109 + nDown, PrimaryIcon, PrimaryIcon, 1, GumpButtonType.Reply, 0); AddImage(nPos + nRight, 109 + nDown, PrimaryState); if (AbilityNamesWeapon.From(from)) { AddLabel((nPos + 86) + nRight, 120 + nDown, 0x481, @"" + GetAbilName(Primary) + ""); } if (Abilities >= 2) { AddImage((nPos + 34) + nRight, 150 + nDown, 0x5DD0); AddButton((nPos + 34) + nRight, 150 + nDown, SecondaryIcon, SecondaryIcon, 2, GumpButtonType.Reply, 0); AddImage(nPos + nRight, 150 + nDown, SecondaryState); if (AbilityNamesWeapon.From(from)) { AddLabel((nPos + 86) + nRight, 161 + nDown, 0x481, @"" + GetAbilName(Secondary) + ""); } } if (Abilities >= 3) { AddImage((nPos + 34) + nRight, 191 + nDown, 0x5DD0); AddButton((nPos + 34) + nRight, 191 + nDown, ThirdIcon, ThirdIcon, 3, GumpButtonType.Reply, 0); AddImage(nPos + nRight, 191 + nDown, ThirdState); if (AbilityNamesWeapon.From(from)) { AddLabel((nPos + 86) + nRight, 202 + nDown, 0x481, @"" + GetAbilName(Third) + ""); } } if (Abilities >= 4) { AddImage((nPos + 34) + nRight, 232 + nDown, 0x5DD0); AddButton((nPos + 34) + nRight, 232 + nDown, FourthIcon, FourthIcon, 4, GumpButtonType.Reply, 0); AddImage(nPos + nRight, 232 + nDown, FourthState); if (AbilityNamesWeapon.From(from)) { AddLabel((nPos + 86) + nRight, 243 + nDown, 0x481, @"" + GetAbilName(Fourth) + ""); } } if (Abilities >= 5) { AddImage((nPos + 34) + nRight, 273 + nDown, 0x5DD0); AddButton((nPos + 34) + nRight, 273 + nDown, FifthIcon, FifthIcon, 5, GumpButtonType.Reply, 0); AddImage(nPos + nRight, 273 + nDown, FifthState); if (AbilityNamesWeapon.From(from)) { AddLabel((nPos + 86) + nRight, 284 + nDown, 0x481, @"" + GetAbilName(Fifth) + ""); } } }
public override void OnResponse(NetState sender, RelayInfo info) { int idx = info.ButtonID; if (idx == 0) { sender.Mobile.CloseGump(typeof(SpecialAttackGump)); } if (idx == 1) { if (PrimaryState == 9781) { if (CustomWeaponAbilities.ServerSideSetAbility(sender.Mobile, Primary)) { PrimaryState = 9780; SecondaryState = 9781; ThirdState = 9781; FourthState = 9781; FifthState = 9781; } sender.Mobile.CloseGump(typeof(SpecialAttackGump)); sender.Mobile.SendGump(new SpecialAttackGump(m_weapon, sender.Mobile, Abilities, PrimaryState, SecondaryState, ThirdState, FourthState, FifthState)); } else { PrimaryState = 9781; WeaponAbility.ClearCurrentAbility(sender.Mobile); } } if (idx == 2) { if (SecondaryState == 9781) { if (CustomWeaponAbilities.ServerSideSetAbility(sender.Mobile, Secondary)) { SecondaryState = 9780; PrimaryState = 9781; ThirdState = 9781; FourthState = 9781; FifthState = 9781; } sender.Mobile.CloseGump(typeof(SpecialAttackGump)); sender.Mobile.SendGump(new SpecialAttackGump(m_weapon, sender.Mobile, Abilities, PrimaryState, SecondaryState, ThirdState, FourthState, FifthState)); } else { SecondaryState = 9781; WeaponAbility.ClearCurrentAbility(sender.Mobile); } } if (idx == 3) { if (ThirdState == 9781) { if (CustomWeaponAbilities.ServerSideSetAbility(sender.Mobile, Third)) { ThirdState = 9780; SecondaryState = 9781; PrimaryState = 9781; FourthState = 9781; FifthState = 9781; } sender.Mobile.CloseGump(typeof(SpecialAttackGump)); sender.Mobile.SendGump(new SpecialAttackGump(m_weapon, sender.Mobile, Abilities, PrimaryState, SecondaryState, ThirdState, FourthState, FifthState)); } else { ThirdState = 9781; WeaponAbility.ClearCurrentAbility(sender.Mobile); } } if (idx == 4) { if (FourthState == 9781) { if (CustomWeaponAbilities.ServerSideSetAbility(sender.Mobile, Fourth)) { FourthState = 9780; SecondaryState = 9781; PrimaryState = 9781; ThirdState = 9781; FifthState = 9781; } sender.Mobile.CloseGump(typeof(SpecialAttackGump)); sender.Mobile.SendGump(new SpecialAttackGump(m_weapon, sender.Mobile, Abilities, PrimaryState, SecondaryState, ThirdState, FourthState, FifthState)); } else { FourthState = 9781; WeaponAbility.ClearCurrentAbility(sender.Mobile); } } if (idx == 5) { if (FifthState == 9781) { if (CustomWeaponAbilities.ServerSideSetAbility(sender.Mobile, Fifth)) { FifthState = 9780; SecondaryState = 9781; PrimaryState = 9781; FourthState = 9781; ThirdState = 9781; } sender.Mobile.CloseGump(typeof(SpecialAttackGump)); sender.Mobile.SendGump(new SpecialAttackGump(m_weapon, sender.Mobile, Abilities, PrimaryState, SecondaryState, ThirdState, FourthState, FifthState)); } else { FifthState = 9781; WeaponAbility.ClearCurrentAbility(sender.Mobile); } } }
private void InitializeGump(Mobile from) { Closable = false; Disposable = true; Dragable = true; Resizable = false; AddPage(0); int nLeft = 50; int nDown = 45; int nButton = 50; int nText = 13 + nButton; int nClose = 1 + nButton; int nActivated = 0x22; CustomWeaponAbilities.SetAbilities(m_weapon, ref Primary, ref Secondary, ref Third, ref Fourth, ref Fifth); AddImage(nLeft + 7, nButton - 24, 3609); AddImage(nLeft, nButton, 0x5DD0); AddButton(nLeft, nButton, PrimaryIcon, PrimaryIcon, 1, GumpButtonType.Reply, 0); if (PrimaryState != 9781) { AddImage(nLeft, nButton, PrimaryIcon, nActivated); } else if (Server.Misc.GetPlayerInfo.isJester(from)) { AddImage(nLeft, nButton, PrimaryIcon, 32); } else if (Server.Misc.GetPlayerInfo.isSyth(from, false)) { AddImage(nLeft, nButton, PrimaryIcon, 0x22); } else if (Server.Misc.GetPlayerInfo.isJedi(from, false)) { AddImage(nLeft, nButton, PrimaryIcon, 2825); } if (AbilityNamesWeapon.From(from)) { AddLabel(nLeft + 52, nText, 0x481, @"" + GetAbilName(Primary) + ""); } nButton = nButton + nDown; nText = nText + nDown; nClose = nClose + nDown; if (Abilities > 1) { AddImage(nLeft, nButton, 0x5DD0); AddButton(nLeft, nButton, SecondaryIcon, SecondaryIcon, 2, GumpButtonType.Reply, 0); if (SecondaryState != 9781) { AddImage(nLeft, nButton, SecondaryIcon, nActivated); } else if (Server.Misc.GetPlayerInfo.isJester(from)) { AddImage(nLeft, nButton, SecondaryIcon, 69); } else if (Server.Misc.GetPlayerInfo.isSyth(from, false)) { AddImage(nLeft, nButton, SecondaryIcon, 0x22); } else if (Server.Misc.GetPlayerInfo.isJedi(from, false)) { AddImage(nLeft, nButton, SecondaryIcon, 2825); } if (AbilityNamesWeapon.From(from)) { AddLabel(nLeft + 52, nText, 0x481, @"" + GetAbilName(Secondary) + ""); } nButton = nButton + nDown; nText = nText + nDown; nClose = nClose + nDown; } if (Abilities > 2) { AddImage(nLeft, nButton, 0x5DD0); AddButton(nLeft, nButton, ThirdIcon, ThirdIcon, 3, GumpButtonType.Reply, 0); if (ThirdState != 9781) { AddImage(nLeft, nButton, ThirdIcon, nActivated); } else if (Server.Misc.GetPlayerInfo.isJester(from)) { AddImage(nLeft, nButton, ThirdIcon, 93); } else if (Server.Misc.GetPlayerInfo.isSyth(from, false)) { AddImage(nLeft, nButton, ThirdIcon, 0x22); } else if (Server.Misc.GetPlayerInfo.isJedi(from, false)) { AddImage(nLeft, nButton, ThirdIcon, 2825); } if (AbilityNamesWeapon.From(from)) { AddLabel(nLeft + 52, nText, 0x481, @"" + GetAbilName(Third) + ""); } nButton = nButton + nDown; nText = nText + nDown; nClose = nClose + nDown; } if (Abilities > 3) { AddImage(nLeft, nButton, 0x5DD0); AddButton(nLeft, nButton, FourthIcon, FourthIcon, 4, GumpButtonType.Reply, 0); if (FourthState != 9781) { AddImage(nLeft, nButton, FourthIcon, nActivated); } else if (Server.Misc.GetPlayerInfo.isJester(from)) { AddImage(nLeft, nButton, FourthIcon, 114); } else if (Server.Misc.GetPlayerInfo.isSyth(from, false)) { AddImage(nLeft, nButton, FourthIcon, 0x22); } else if (Server.Misc.GetPlayerInfo.isJedi(from, false)) { AddImage(nLeft, nButton, FourthIcon, 2825); } if (AbilityNamesWeapon.From(from)) { AddLabel(nLeft + 52, nText, 0x481, @"" + GetAbilName(Fourth) + ""); } nButton = nButton + nDown; nText = nText + nDown; nClose = nClose + nDown; } if (Abilities > 4) { AddImage(nLeft, nButton, 0x5DD0); AddButton(nLeft, nButton, FifthIcon, FifthIcon, 5, GumpButtonType.Reply, 0); if (FifthState != 9781) { AddImage(nLeft, nButton, FifthIcon, nActivated); } else if (Server.Misc.GetPlayerInfo.isJester(from)) { AddImage(nLeft, nButton, FifthIcon, 253); } else if (Server.Misc.GetPlayerInfo.isSyth(from, false)) { AddImage(nLeft, nButton, FifthIcon, 0x22); } else if (Server.Misc.GetPlayerInfo.isJedi(from, false)) { AddImage(nLeft, nButton, FifthIcon, 2825); } if (AbilityNamesWeapon.From(from)) { AddLabel(nLeft + 52, nText, 0x481, @"" + GetAbilName(Fifth) + ""); } nButton = nButton + nDown; nText = nText + nDown; nClose = nClose + nDown; } AddButton(nLeft + 7, nClose, 4017, 4017, 0, GumpButtonType.Reply, 0); }