public override void OnResponse(NetState sender, RelayInfo info) { Mobile from = sender.Mobile; BonusPackOrb b_orb = null; RCCONTROL rc = null; BonusPackControl b_control = null; Bag d_bag = new Bag(); foreach (Item h in World.Items.Values) { if (h is BonusPackControl) { b_control = h as BonusPackControl; } } foreach (Item i in World.Items.Values) { if (i is BonusPackOrb) { b_orb = i as BonusPackOrb; if (info.ButtonID == b_orb.BPNumber) { foreach (Item j in World.Items.Values) { if (j is RCCONTROL) { rc = j as RCCONTROL; if (rc.BonusPack == b_orb.BPName) { d_bag.AddItem(rc); } } } d_bag.Delete(); foreach (Item k in World.Items.Values) { if (k is Bag && k.Name == b_orb.BPName + " Bonus Pack") { k.Delete(); break; } } b_control.A_BP -= 1; resetBOrbNums(); break; } } } if (info.ButtonID == 0) { } }
public override void OnResponse(NetState sender, RelayInfo info) { Mobile from = sender.Mobile; ClassOrb c_orb = null; RCCONTROL rc = null; ClassControl c_control = null; Bag d_bag = new Bag(); foreach (Item h in World.Items.Values) { if (h is ClassControl) { c_control = h as ClassControl; } } foreach (Item i in World.Items.Values) { if (i is ClassOrb) { c_orb = i as ClassOrb; if (info.ButtonID == c_orb.ClassNumber) { foreach (Item j in World.Items.Values) { if (j is RCCONTROL) { rc = j as RCCONTROL; if (rc.P_Class == c_orb.ClassName) { d_bag.AddItem(rc); } } } d_bag.Delete(); foreach (Item k in World.Items.Values) { if (k is Bag && k.Name == c_orb.ClassName + " Class") { k.Delete(); break; } } c_control.A_Classes -= 1; resetCOrbNums(); break; } } } if (info.ButtonID == 0) { } }
public static bool RestrictSB(Mobile from, Spellbook book) { ClassOrb c_orb = null; int rc_Exists = from.Backpack.GetAmount(typeof(RCCONTROL)); RCCONTROL rc = null; bool isRestricted = false; if (rc_Exists != 0) { rc = from.Backpack.FindItemByType(typeof(RCCONTROL)) as RCCONTROL; foreach (Item i in World.Items.Values) { if (i is ClassOrb) { c_orb = i as ClassOrb; if (rc.P_Class == c_orb.ClassName) { break; } } } for (int i = 0; i < 20; i++) { if (c_orb.Res_Books[i] != SpellbookType.Invalid) { if (c_orb.Res_Books[i] == book.SpellbookType) { from.SendMessage(6, "Your Class lacks the ability to use these Spells."); isRestricted = true; break; } } } if (isRestricted) { return(true); } else { return(false); } } return(false); }
public override void OnResponse(NetState sender, RelayInfo info) { Mobile from = sender.Mobile; RaceOrb r_orb = null; RaceControl r_control = null; RCCONTROL rc = from.Backpack.FindItemByType(typeof(RCCONTROL)) as RCCONTROL; foreach (Item h in World.Items.Values) { if (h is RaceControl) { r_control = h as RaceControl; } } foreach (Item i in World.Items.Values) { if (i is RaceOrb) { r_orb = i as RaceOrb; if (rc.Race == r_orb.RaceName) { break; } } } for (int i = 0; i < 5; i++) { if (info.ButtonID == i) { if (r_orb.BodyValue[i] != 0) { if (from.Mount != null) { from.Mount.Rider = null; } from.PlaySound(0x228); from.BodyMod = r_orb.BodyValue[i]; from.HueMod = r_orb.SS_Hue[i]; from.NameMod = r_orb.SS_Name[i]; } } } if (info.ButtonID == 0) { } }
public override void OnResponse(NetState sender, RelayInfo info) { Mobile from = sender.Mobile; RaceOrb r_orb = null; RCCONTROL rc = null; RaceControl r_control = null; Bag d_bag = new Bag(); foreach (Item h in World.Items.Values) { if (h is RaceControl) { r_control = h as RaceControl; } } foreach (Item i in World.Items.Values) { if (i is RaceOrb) { r_orb = i as RaceOrb; if (info.ButtonID == r_orb.RaceNumber) { foreach (Item j in World.Items.Values) { if (j is RCCONTROL) { rc = j as RCCONTROL; if (rc.Race == r_orb.RaceName) { d_bag.AddItem(rc); } } } d_bag.Delete(); r_orb.Delete(); r_control.A_Races -= 1; resetROrbNums(); break; } } } if (info.ButtonID == 0) { } }
private static void EventSink_Login(LoginEventArgs args) { Mobile from = args.Mobile; /******************Edited for Dynamic Race/Class System v2.0*******************************/ RCChest chest = null; RCCONTROL rc = null; PlayerMobile pm = (PlayerMobile)from; int rc_Exists = from.Backpack.GetAmount(typeof(RCCONTROL)); if (rc_Exists != 0) { rc = from.Backpack.FindItemByType(typeof(RCCONTROL)) as RCCONTROL; } if (rc_Exists == 0 || !rc.Active) { foreach (Item i in World.Items.Values) { if (i is RCChest) { chest = i as RCChest; if (chest.Active) { if (pm.AccessLevel == AccessLevel.Player || (pm.AccessLevel != AccessLevel.Player && chest.Staff_Login)) { pm.Location = new Point3D(chest.Start_X, chest.Start_Y, chest.Start_Z); pm.Map = chest.Start_Map; } } } } } /******************************************************************************************/ }
public static bool CanRaise(Mobile from, Stat stat) { ClassOrb c_orb = null; RCChest chest = null; RCCONTROL rc = null; /*If the System is Inactive, these are the Stat Cap values*/ int n_str = 125; int n_dex = 125; int n_int = 125; /*********************************************************/ int rc_Exists = 0; if (!(from is BaseCreature)) { rc_Exists = from.Backpack.GetAmount(typeof(RCCONTROL)); } if (rc_Exists != 0) { rc = from.Backpack.FindItemByType(typeof(RCCONTROL)) as RCCONTROL; foreach (Item i in World.Items.Values) { if (i is ClassOrb) { c_orb = i as ClassOrb; if (c_orb.ClassName == rc.P_Class) { break; } } } foreach (Item i in World.Items.Values) { if (i is RCChest) { chest = i as RCChest; if (chest.Active) { n_str = c_orb.Str_Cap; n_dex = c_orb.Dex_Cap; n_int = c_orb.Int_Cap; } } } } if (!(from is BaseCreature && ((BaseCreature)from).Controlled)) { if (from.RawStatTotal >= from.StatCap) { return(false); } } switch (stat) { case Stat.Str: return(from.StrLock == StatLockType.Up && from.RawStr < 125); case Stat.Dex: return(from.DexLock == StatLockType.Up && from.RawDex < 125); case Stat.Int: return(from.IntLock == StatLockType.Up && from.RawInt < 125); } return(false); }
private static void OnUpdate(CommandEventArgs e) { Mobile from = e.Mobile; bool r_active = false; ClassOrb c_orb = null; RaceOrb r_orb = null; BonusPackOrb b_orb = null; Bag c_bag = null; RCCONTROL rc = null; foreach (Item i in World.Items.Values) { if (i is RCChest) { r_active = true; } } if (r_active) { ArrayList items = new ArrayList(World.Items.Values); foreach (Item h in items) { if (h is ClassOrb) { c_orb = h as ClassOrb; foreach (Item i in items) { if (i is Bag && i.Name == c_orb.ClassName + " Class") { c_bag = i as Bag; Bag n_bag = new Bag(); n_bag.Name = c_orb.ClassName + " Restricted Armors"; Bag n_bag2 = new Bag(); n_bag2.Name = c_orb.ClassName + " Restricted Weapons"; c_bag.AddItem(n_bag); c_bag.AddItem(n_bag2); break; } } } } foreach (Item h in World.Items.Values) { if (h is RCCONTROL) { rc = h as RCCONTROL; foreach (Item i in World.Items.Values) { if (i is Bag && i.Name == rc.P_Class + " Restricted Armors") { rc.A_Bag = i as Bag; break; } } foreach (Item i in World.Items.Values) { if (i is Bag && i.Name == rc.P_Class + " Restricted Weapons") { rc.W_Bag = i as Bag; break; } } foreach (Item i in World.Items.Values) { if (i is ClassOrb) { c_orb = i as ClassOrb; c_orb.BackUpName = c_orb.ClassName; } } foreach (Item i in World.Items.Values) { if (i is RaceOrb) { r_orb = i as RaceOrb; r_orb.BackUpName = r_orb.RaceName; } } foreach (Item i in World.Items.Values) { if (i is BonusPackOrb) { b_orb = i as BonusPackOrb; b_orb.BackUpName = b_orb.BPName; } } } } } }
private static void OnSyncNames(CommandEventArgs e) { Mobile from = e.Mobile; bool r_active = false; ClassOrb c_orb = null; RCCONTROL rc = null; RaceOrb r_orb = null; BonusPackOrb b_orb = null; foreach (Item i in World.Items.Values) { if (i is RCChest) { r_active = true; } } if (r_active) { foreach (Item i in World.Items.Values) { if (i is ClassOrb) { c_orb = i as ClassOrb; if (c_orb.ClassName != c_orb.BackUpName) { c_orb.Name = c_orb.ClassName + " Orb"; foreach (Item j in World.Items.Values) { if (j is Bag && j.Name == c_orb.BackUpName + " Class") { j.Name = c_orb.ClassName + " Class"; } if (j is Bag && j.Name == c_orb.BackUpName + " Items") { j.Name = c_orb.ClassName + " Items"; } if (j is Bag && j.Name == c_orb.BackUpName + " Equip") { j.Name = c_orb.ClassName + " Equip"; } if (j is Bag && j.Name == c_orb.BackUpName + " Restricted Armors") { j.Name = c_orb.ClassName + " Restricted Armors"; } if (j is Bag && j.Name == c_orb.BackUpName + " Restricted Weapons") { j.Name = c_orb.ClassName + " Restricted Weapons"; } } foreach (Item k in World.Items.Values) { if (k is RCCONTROL) { rc = k as RCCONTROL; if (rc.P_Class == c_orb.BackUpName) { rc.P_Class = c_orb.ClassName; } } } c_orb.BackUpName = c_orb.ClassName; } } } foreach (Item i in World.Items.Values) { if (i is RaceOrb) { r_orb = i as RaceOrb; if (r_orb.RaceName != r_orb.BackUpName) { r_orb.Name = r_orb.RaceName + " Orb"; foreach (Item j in World.Items.Values) { if (j is Bag && j.Name == r_orb.BackUpName + " Race") { j.Name = r_orb.RaceName + " Race"; } if (j is Bag && j.Name == r_orb.BackUpName + " Items") { j.Name = r_orb.RaceName + " Items"; } } foreach (Item k in World.Items.Values) { if (k is RCCONTROL) { rc = k as RCCONTROL; if (rc.Race == r_orb.BackUpName) { rc.Race = r_orb.RaceName; } } } r_orb.BackUpName = r_orb.RaceName; } } } foreach (Item i in World.Items.Values) { if (i is BonusPackOrb) { b_orb = i as BonusPackOrb; if (b_orb.BPName != b_orb.BackUpName) { b_orb.Name = b_orb.BPName + " Orb"; foreach (Item j in World.Items.Values) { if (j is Bag && j.Name == b_orb.BackUpName + " Bonus Pack") { j.Name = b_orb.BPName + " Bonus Pack"; } if (j is Bag && j.Name == b_orb.BackUpName + " Items") { j.Name = b_orb.BPName + " Items"; } } foreach (Item k in World.Items.Values) { if (k is RCCONTROL) { rc = k as RCCONTROL; if (rc.BonusPack == b_orb.BackUpName) { rc.BonusPack = b_orb.BPName; } } } b_orb.BackUpName = b_orb.BPName; } } } } }
private static void OnSC(CommandEventArgs e) { Mobile from = e.Mobile; bool r_active = false; RCCONTROL rc = null; RaceOrb r_orb = null; int rc_Exists = from.Backpack.GetAmount(typeof(RCCONTROL)); int a_ss = 0; foreach (Item i in World.Items.Values) { if (i is RCChest) { r_active = true; } } if (rc_Exists != 0) { rc = from.Backpack.FindItemByType(typeof(RCCONTROL)) as RCCONTROL; foreach (Item i in World.Items.Values) { if (i is RaceOrb) { r_orb = i as RaceOrb; if (rc.Race == r_orb.RaceName) { break; } } } if (r_active) { for (int i = 0; i < 5; i++) { if (r_orb.BodyValue[i] != 0) { a_ss += 1; } } if (a_ss == 0) { from.SendMessage(6, "Your Race Cannot Shapeshift"); } if (a_ss == 1) { if (from.BodyMod != 0) { from.PlaySound(0x228); from.BodyMod = 0; from.HueMod = -1; from.NameMod = null; } else { for (int i = 0; i < 5; i++) { if (r_orb.BodyValue[i] != 0) { if (from.Mount != null) { from.Mount.Rider = null; } from.PlaySound(0x228); from.BodyMod = r_orb.BodyValue[i]; from.HueMod = r_orb.SS_Hue[i]; from.NameMod = r_orb.SS_Name[i]; } } } } if (a_ss > 1) { if (from.BodyMod != 0) { from.PlaySound(0x228); from.BodyMod = 0; from.HueMod = -1; from.NameMod = null; } else { from.SendGump(new PlayerShapeChange(from, r_orb)); } } } } }