void cmdGoHome(VPServices app, Avatar who, bool entering) { AvatarPosition target; var query = from h in connection.Table <sqlHome>() where h.UserID == who.Id select h; var home = query.FirstOrDefault(); if (home == null && entering) { return; } if (home != null) { target = new AvatarPosition(home.X, home.Y, home.Z, home.Pitch, home.Yaw); } else { target = AvatarPosition.GroundZero; } app.Bot.Avatars.Teleport(who.Session, "", target); Log.Debug(Name, "Teleported {0} home at {1:f3}, {2:f3}, {3:f3}", who.Name, target.X, target.Y, target.Z); }
bool cmdGround(VPServices app, Avatar who, string data) { var target = new AvatarPosition { X = who.X, Y = 0.1f, Z = who.Z, Pitch = who.Pitch, Yaw = who.Yaw }; app.Bot.Avatars.Teleport(who.Session, target); return(true); }
void createBloodSplat(AvatarPosition pos) { var offsetX = ((float)VPServices.Rand.Next(-100, 100)) / 2000; var offsetY = ((float)VPServices.Rand.Next(0, 100)) / 5000; var offsetZ = ((float)VPServices.Rand.Next(-100, 100)) / 2000; var size = VPServices.Rand.Next(80, 200); var hover = new VPObject { Model = "p:flat" + size + ".rwx", Rotation = Quaternion.ZeroEuler, Action = "create texture bloodsplat1.png, normalmap nmap-puddle1, specularmap smap-puddle1, specular .6 30, solid no", Position = new Vector3(pos.X + offsetX, pos.Y + offsetY, pos.Z + offsetZ) }; app.Bot.Property.AddObject(hover); spawned.Add(hover); }
void createHoverText(AvatarPosition pos, int damage, bool critical) { var offsetX = ((float)VPServices.Rand.Next(-100, 100)) / 2000; var offsetZ = ((float)VPServices.Rand.Next(-100, 100)) / 2000; var description = string.Format("{0}{1}", 0 - damage, critical ? " !!!" : ""); var color = damage == 0 ? "blue" : "red"; var hover = new VPObject { Model = "p:fac100x50,s.rwx", Rotation = Quaternion.ZeroEuler, Action = string.Format("create sign color={0} bcolor=ffff0000 hmargin=20, ambient 1, move 0 2 time=5 wait=10, solid no", color), Description = description, Position = new Vector3(pos.X + offsetX, pos.Y + .2f, pos.Z + offsetZ) }; app.Bot.Property.AddObject(hover); spawned.Add(hover); }
public void Properties() { using (var i = new Instance()) { string expectedName = ""; string expectedWorld = ""; AvatarPosition expectedPos = AvatarPosition.GroundZero; Assert.AreEqual(expectedName, i.Name); Assert.AreEqual(expectedWorld, i.World); Assert.AreEqual(expectedPos, i.Position); expectedName = Names.Data; expectedWorld = Settings.World; expectedPos = Samples.AvPosition; i.TestLogin(expectedName).EnterTestWorld(); i.GoTo(expectedPos); Assert.AreEqual(expectedName, i.Name); Assert.AreEqual(expectedWorld, i.World); Assert.AreEqual(expectedPos, i.Position); } }