Ejemplo n.º 1
0
			public static XmlTeam SETTEAM(
				TriggerObject trigObject, Mobile mob, string teamString, bool allyGreen, bool teamHarm, bool enemyHeal)
			{
				XmlTeam team = new XmlTeam
				{
					TeamGreen = allyGreen,
					TeamHarmAllowed = teamHarm,
					HealEnemyAllowed = enemyHeal,
					TeamVal = (XmlTeam.Team)Enum.Parse(typeof(XmlTeam.Team), teamString, true)
				};

				XmlAttach.AttachTo(mob, team);
				return team;
			}
Ejemplo n.º 2
0
			public static ArrayList ONLINETEAMMOBS(TriggerObject trigObject, XmlTeam team)
			{
				if (team == null)
				{
					return new ArrayList();
				}

				var fromTeams = new List<XmlTeam>
				{
					team
				};

				ArrayList output = new ArrayList(10);

				foreach (NetState nextstate in NetState.Instances.Where(ns => ns.Mobile != null))
				{
					if (nextstate.Mobile.CustomTeam)
					{
						var toTeams = XmlAttach.GetTeams(nextstate.Mobile);

						if (XmlTeam.SameTeam(fromTeams, toTeams))
						{
							output.Add(nextstate.Mobile);
						}
					}
				}

				return output;
			}
Ejemplo n.º 3
0
			public static void TEAMMESSAGE(TriggerObject trigObject, XmlTeam team, string msg)
			{
				if (team == null || String.IsNullOrWhiteSpace(msg))
				{
					return;
				}

				var fromTeams = new List<XmlTeam>
				{
					team
				};

				foreach (NetState nextstate in NetState.Instances.Where(ns => ns.Mobile != null))
				{
					if (nextstate.Mobile.AccessLevel >= AccessLevel.GameMaster)
					{
						// just get the first team
						nextstate.Mobile.SendMessage(101, "[" + team.TeamVal + "] " + msg);
					}
					else
					{
						if (nextstate.Mobile.CustomTeam)
						{
							var toTeams = XmlAttach.GetTeams(nextstate.Mobile);

							if (XmlTeam.SameTeam(fromTeams, toTeams))
							{
								nextstate.Mobile.SendMessage(101, msg);
							}
						}
					}
				}
			}
Ejemplo n.º 4
0
			public static XmlAttachment NEWATTACHMENT(TriggerObject trigObj, string attachmenttype, string name)
			{
				attachmenttype = attachmenttype.ToLower().Trim();

				XmlAttachment attachment = null;

				switch (attachmenttype)
				{
					case "xmlvalue":
						attachment = new XmlValue("", 0);
						break;
					case "xmllocalvariable":
						attachment = new XmlLocalVariable("");
						break;
					case "xmlscript":
						attachment = new XmlScript();
						break;
					case "xmlteam":
						attachment = new XmlTeam();
						break;
					case "xmldouble":
						attachment = new XmlDouble("", 0.0);
						break;
					case "xmlgroup":
						attachment = new XmlGroup();
						break;
					case "xmlslayer":
						attachment = new XmlSlayer("orcslaying", name);
						break;
					case "xmldate":
						attachment = new XmlDate("");
						break;
					case "xmlcorpseaction":
						attachment = new XmlCorpseAction();
						break;
					case "xmldeathaction":
						attachment = new XmlDeathAction();
						break;
					case "xmluse":
						attachment = new XmlUse();
						break;
					case "xmlonhit":
						attachment = new XmlOnHit();
						break;
					case "xmladdfame":
						attachment = new XmlAddFame(0);
						break;
					case "xmladdkarma":
						attachment = new XmlAddKarma(0);
						break;
					case "xmldex":
						attachment = new XmlDex();
						break;
					case "xmldialog":
						attachment = new XmlDialog();
						break;
					case "xmlenemymastery":
						attachment = new XmlEnemyMastery("");
						break;
					case "xmlfire":
						attachment = new XmlFire(1);
						break;
					case "xmlfreeze":
						attachment = new XmlFreeze();
						break;
					case "xmlhue":
						attachment = new XmlHue(0);
						break;
					case "xmllifedrain":
						attachment = new XmlLifeDrain(1);
						break;
					case "xmllightning":
						attachment = new XmlLightning(1);
						break;
					case "xmlmagicword":
						attachment = new XmlMagicWord();
						break;
					case "xmlmanadrain":
						attachment = new XmlManaDrain(1);
						break;
					case "xmlmessage":
						attachment = new XmlMessage("");
						break;
					case "xmlsaveitem":
						attachment = new XmlSaveItem();
						break;
					case "xmlskill":
						attachment = new XmlSkill("", "wrestling");
						break;
					case "xmlsound":
						attachment = new XmlSound();
						break;
					case "xmlstamdrain":
						attachment = new XmlStamDrain(1);
						break;
					case "xmlstr":
						attachment = new XmlStr();
						break;
					case "xmlint":
						attachment = new XmlInt();
						break;
				}

				if (attachment == null)
				{
					throw new UberScriptException("NEWATTACHMENT error: " + attachmenttype + " is not an available xmlattachment!");
				}

				if (attachment.Name == "" && name == null) // those attachments that require a name
				{
					return attachment;
				}

				attachment.Name = name;

				return attachment;
			}