QUOTE |
- value keywords: RND, RNDBOOL, RNDLIST, RNDSTRLIST, RANDNAME, INC, MUL, MOB, SERIAL, SKILL - control keywords: WAITUNTIL, IF, WHILE, and GOTO - action keywords: ADD, EQUIP, GIVE, TAKE, TAKEBYTYPE, CAST, SAY, MSG, SENDMSG, BCAST, RESURRECT, POISON, DAMAGE, MUSIC, EFFECT, MEFFECT, SOUND, GUMP, DESPAWN, DELETE, KILL, ANIMATE, OFFSET, BROWSER - loot keywords: ARMOR, WEAPON, JEWELRY, JARMOR, JWEAPON, SARMOR, SHIELD, LOOT, LOOTPACK, POTION, SCROLL, NECROSCROLL, TAKEN, GIVEN, ITEM - access keywords: GET, GETONTHIS, GETONPARENT, GETFROMFILE, GETONSPAWN, GETONCARRIED, GETONMOB, GETONTRIGMOB, GETONNEARBY, SET, SETONTHIS, SETONPARENT, SETONSPAWN, SETONSPAWNENTRY, SETONCARRIED, SETONMOB, SETONTRIGMOB, SETONNEARBY, PLAYERSINRANGE, TRIGSKILL, AMOUNTCARRIED |
QUOTE |
- added the 'GETONNEARBY,range,name[,type][,searchcontainers],property' keyword that can be used to get or test properties on nearby items or mobiles. This can be used in property assignments or property tests. If more than one of the specified object is found, it will only return the value from one. For example, to test to see if someone has placed the longsword named "Grizzleblag" on the ground near the spawner you could use a condition test like GETONNEARBY,1,Grizzleblag,longsword,visible=true Or you could get the size of a pile of gold in a nearby container with SENDMSG/{GETONNEARBY,1,,gold,true,amount} gold pieces are in the container |
QUOTE |
condiction:SETONNEARBY,5,*,head,visible=true |
QUOTE |
else if ((kw == valueKeyword.GETONNEARBY) && arglist.Length > 3) { // syntax is GETONNEARBY,range,name[,type][,searchcontainers],property // or GETONNEARBY,range,name[,type][,searchcontainers],[ATTACHMENT,type,name,property] string targetname = arglist[2]; string propname = arglist[3]; string typestr = null; bool searchcontainers = false; int range = -1; try { range = int.Parse(arglist[1]); } catch { } if (arglist.Length > 4) { typestr = arglist[3]; propname = arglist[4]; } if (arglist.Length > 5) { try { searchcontainers = bool.Parse(arglist[4]); } catch { } propname = arglist[5]; } Type targettype = null; if (typestr != null) { targettype = SpawnerType.GetType(typestr); } if (range >= 0) { // get all of the nearby objects object relativeto = spawner; if (o is XmlAttachment) { relativeto = ((XmlAttachment)o).AttachedTo; } ArrayList nearbylist = GetNearbyObjects(relativeto, targetname, targettype, typestr, range, searchcontainers, null);[/color] // apply the properties from the first valid thing on the list foreach (object nearbyobj in nearbylist) { string getvalue = GetPropertyValue(spawner, nearbyobj, propname, out ptype); return ParseGetValue(getvalue, ptype); } } else return null; } |