public static void Point(Player plr) { if (plr.Zone == null) { SendCsr(plr, "CAMPAIGN POINT: Must be in a zone to use this command."); return; } IBattlefrontFlag closestFlag = plr.Region.Bttlfront.GetClosestFlag(plr.WorldPosition); if (closestFlag == null) { SendCsr(plr, "CAMPAIGN POINT: Must be in an open-world RvR zone."); return; } else if (!(closestFlag is BattlefrontFlag)) { SendCsr(plr, "CAMPAIGN POINT: This command is supported in legacy RvR."); return; } plr.SendClientMessage("Flag: " + closestFlag.ObjectiveName); GameObject_proto proto = GameObjectService.GetGameObjectProto(429); GameObject_spawn spawn = new GameObject_spawn { Guid = (uint)GameObjectService.GenerateGameObjectSpawnGUID(), WorldX = plr.WorldPosition.X, WorldY = plr.WorldPosition.Y, WorldZ = plr.WorldPosition.Z, WorldO = plr.Heading, ZoneId = plr.Zone.ZoneId }; spawn.BuildFromProto(proto); plr.Region.CreateGameObject(spawn); BattlefrontResourceSpawn res = new BattlefrontResourceSpawn { Entry = ((BattlefrontFlag)closestFlag).ID, X = plr.X, Y = plr.Y, Z = plr.Z, O = plr.Heading }; WorldMgr.Database.AddObject(res); }
public static void Drop(Player plr, int realmIndex) { if (plr.Zone == null) { SendCsr(plr, "CAMPAIGN DROP: Must be in a zone to use this command."); return; } else if (!(plr.Region.Bttlfront is Battlefront)) { SendCsr(plr, "CAMPAIGN DROP: This command is supported in legacy RvR."); return; } Keep closestKeep = ((Battlefront)plr.Region.Bttlfront).GetZoneKeep(plr.Zone.ZoneId, realmIndex); if (closestKeep == null) { SendCsr(plr, "CAMPAIGN DROP: Must be in an open-world RvR zone."); return; } plr.SendClientMessage("Keep: " + closestKeep.Info.Name); BattlefrontResourceSpawn res = new BattlefrontResourceSpawn { Entry = closestKeep.Info.KeepId, X = plr.X, Y = plr.Y, Z = plr.Z, O = plr.Heading }; WorldMgr.Database.AddObject(res); closestKeep.SupplyReturnPoints.Clear(); closestKeep.SupplyReturnPoints.Add(res); closestKeep.CreateSupplyDrops(); }