public void OnTeleport(Obj_AI_Base sender, Teleport.TeleportEventArgs args) { var enemy = RandomUltUnits.Find(x => x.Unit.NetworkId == sender.NetworkId); if (enemy == null || args.Type != TeleportType.Recall) { return; } var recall = enemy.RecallData; switch (args.Status) { case TeleportStatus.Start: { recall.Status = RecallStatus.Active; recall.Started = Game.Time; recall.Duration = args.Duration; recall.Ended = recall.Started + recall.Duration; break; } case TeleportStatus.Abort: { recall.Status = RecallStatus.Abort; recall.Ended = Game.Time; break; } case TeleportStatus.Finish: { recall.Status = RecallStatus.Finished; recall.Ended = Game.Time; break; } } }
public static void OnTeleport(AIHeroClient sender , Teleport.TeleportEventArgs args) { if (Settings.TurnOff) return; if (args.Type != TeleportType.Recall || sender == null) return; if (!Settings.RecallAllies && sender.IsAlly)return; if (!Settings.RecallEnemies && sender.IsEnemy) return; switch (args.Status) { case TeleportStatus.Abort: foreach (var source in Recalls.Where(a => a.Unit == sender)) { source.Abort(); } break; case TeleportStatus.Start: var recall = Recalls.FirstOrDefault(a => a.Unit == sender); if (recall != null) { Recalls.Remove(recall); } Recalls.Add(new Recall(sender, Environment.TickCount, Environment.TickCount + args.Duration, args.Duration)); break; } }
protected override void Volatile_OnTeleport(Obj_AI_Base sender, Teleport.TeleportEventArgs args) { if (args.Type == TeleportType.Recall && sender is AIHeroClient && HackMenu["trackRecalls"].Cast<CheckBox>().CurrentValue && !sender.IsMe) { switch (args.Status) { case TeleportStatus.Abort: foreach (var source in Recalls.Where(r => r.Hero == sender)) { source.Abort(); } break; case TeleportStatus.Start: var recall = Recalls.FirstOrDefault(r => r.Hero == sender); if (recall != null) { Recalls.Remove(recall); } Recalls.Add(new Recall((AIHeroClient) sender, Environment.TickCount, Environment.TickCount + args.Duration, args.Duration)); break; } } }
private void TeleportOnOnTeleport(Obj_AI_Base sender, Teleport.TeleportEventArgs args) { var invisEnemiesEntry = Listing.invisEnemiesList.FirstOrDefault(x => x.sender == sender); switch (args.Status) { case TeleportStatus.Start: if (invisEnemiesEntry == null) return; if (Listing.teleportingEnemies.All(x => x.Sender != sender)) { Listing.teleportingEnemies.Add(new Listing.PortingEnemy { Sender = (AIHeroClient) sender, Duration = args.Duration, StartTick = args.Start, }); } break; case TeleportStatus.Abort: var teleportingEnemiesEntry = Listing.teleportingEnemies.FirstOrDefault(x => x.Sender.Equals(sender)); if (teleportingEnemiesEntry != null) Listing.teleportingEnemies.Remove(teleportingEnemiesEntry); break; case TeleportStatus.Finish: var teleportingEnemiesEntry2 = Listing.teleportingEnemies.FirstOrDefault(x => x.Sender.Equals(sender)); if (teleportingEnemiesEntry2 != null) Core.DelayAction(() => Listing.teleportingEnemies.Remove(teleportingEnemiesEntry2), 10000); break; } }
private static void Teleport_OnTeleport(Obj_AI_Base sender, Teleport.TeleportEventArgs args) { #region RecallTracker var hero = sender as AIHeroClient; Trackers.RecallTracker.OnTeleport(hero, args); #endregion RecallTracker }
void Start() { ++count; active = false; flame = transform.Find("Flame").gameObject; flame.SetActive(false); altarLight = transform.Find("Torchlight").gameObject; altarLight.SetActive(false); // Get references to the different ability scripts walk = Walk.S; teleport = Teleport.S; rewind = Rewind.S; }
/// <summary> /// /// </summary> /// <param name="script"></param> /// <param name="dungeon"></param> public TeleportControl(Teleport script, Dungeon dungeon) { InitializeComponent(); if (script != null) Action = script; else Action = new Teleport(); TargetBox.Dungeon = dungeon; TargetBox.SetTarget(((Teleport)Action).Target); TargetBox.TargetChanged +=new TargetControl.TargetChangedEventHandler(TargetBox_TargetChanged); }
void RaycastCheckForObject(Vector2 RayDirection) { //make sure the button is already switching if(!ButtonChange) { RaycastHit2D hit = Physics2D.Raycast(player.transform.position ,RayDirection,1,IgnoreMask); // chech if its hitting something if(hit.transform != null) { // check if hit dosent match currentTarget accordingly if (hit.transform.gameObject != CurrentTarget) { // check by tag and set buttonstate according if (hit.transform.tag == "NPC") { CurrentTarget = hit.transform.gameObject; npc = hit.transform.gameObject.GetComponent<NPC> (); buttonState = ButtonState.Talk; ButtonChange = true; } Debug.Log (hit.transform.tag); if (hit.transform.tag == "Teleport") { CurrentTarget = hit.transform.gameObject; tele = hit.transform.gameObject.GetComponent<Teleport>(); buttonState = ButtonState.Teleport; ButtonChange = true; } } } else if(CurrentTarget != null) { CurrentTarget = null; ButtonChange = true; buttonState = ButtonState.Attack; } } }
protected virtual bool GetTeleportLocation(GamePlayer player, string text) { // Battlegrounds are specials, as the teleport location depends on // the level of the player, so let's deal with that first. if (text.ToLower() == "battlegrounds") { if (!ServerProperties.Properties.BG_ZONES_OPENED && player.Client.Account.PrivLevel == (uint)ePrivLevel.Player) { SayTo(player, ServerProperties.Properties.BG_ZONES_CLOSED_MESSAGE); } else { AbstractGameKeep portalKeep = GameServer.KeepManager.GetBGPK(player); if (portalKeep != null) { Teleport teleport = new Teleport(); teleport.TeleportID = "battlegrounds"; teleport.Realm = (byte)portalKeep.Realm; teleport.RegionID = portalKeep.Region; teleport.X = portalKeep.X; teleport.Y = portalKeep.Y; teleport.Z = portalKeep.Z; teleport.Heading = 0; OnDestinationPicked(player, teleport); return(true); } else { if (player.Client.Account.PrivLevel > (uint)ePrivLevel.Player) { player.Out.SendMessage("No portal keep found.", eChatType.CT_Skill, eChatLoc.CL_SystemWindow); } return(true); } } } // Another special case is personal house, as there is no location // that will work for every player. if (text.ToLower() == "personal") { House house = HouseMgr.GetHouseByPlayer(player); if (house == null) { text = "entrance"; // Fall through, port to housing entrance. } else { IGameLocation location = house.OutdoorJumpPoint; Teleport teleport = new Teleport(); teleport.TeleportID = "personal"; teleport.Realm = (int)DestinationRealm; teleport.RegionID = location.RegionID; teleport.X = location.X; teleport.Y = location.Y; teleport.Z = location.Z; teleport.Heading = location.Heading; OnDestinationPicked(player, teleport); return(true); } } // Yet another special case the port to the 'hearth' what means // that the player will be ported to the defined house bindstone if (text.ToLower() == "hearth") { // Check if player has set a house bind if (!(player.DBCharacter.BindHouseRegion > 0)) { SayTo(player, "Sorry, you haven't set any house bind point yet."); return(false); } // Check if the house at the player's house bind location still exists ArrayList houses = (ArrayList)HouseMgr.GetHousesCloseToSpot((ushort)player. DBCharacter.BindHouseRegion, player.DBCharacter.BindHouseXpos, player. DBCharacter.BindHouseYpos, 700); if (houses.Count == 0) { SayTo(player, "I'm afraid I can't teleport you to your hearth since the house at your " + "house bind location has been torn down."); return(false); } // Check if the house at the player's house bind location contains a bind stone House targetHouse = (House)houses[0]; IDictionary <uint, DBHouseHookpointItem> hookpointItems = targetHouse.HousepointItems; Boolean hasBindstone = false; foreach (KeyValuePair <uint, DBHouseHookpointItem> targetHouseItem in hookpointItems) { if (((GameObject)targetHouseItem.Value.GameObject).GetName(0, false).ToLower().EndsWith("bindstone")) { hasBindstone = true; break; } } if (!hasBindstone) { SayTo(player, "I'm sorry to tell that the bindstone of your current house bind location " + "has been removed, so I'm not able to teleport you there."); return(false); } // Check if the player has the permission to bind at the house bind stone if (!targetHouse.CanBindInHouse(player)) { SayTo(player, "You're no longer allowed to bind at the house bindstone you've previously " + "chosen, hence I'm not allowed to teleport you there."); return(false); } Teleport teleport = new Teleport(); teleport.TeleportID = "hearth"; teleport.Realm = (int)DestinationRealm; teleport.RegionID = player.DBCharacter.BindHouseRegion; teleport.X = player.DBCharacter.BindHouseXpos; teleport.Y = player.DBCharacter.BindHouseYpos; teleport.Z = player.DBCharacter.BindHouseZpos; teleport.Heading = player.DBCharacter.BindHouseHeading; OnDestinationPicked(player, teleport); return(true); } if (text.ToLower() == "guild") { House house = HouseMgr.GetGuildHouseByPlayer(player); if (house == null) { return(false); // no teleport when guild house not found } else { IGameLocation location = house.OutdoorJumpPoint; Teleport teleport = new Teleport(); teleport.TeleportID = "guild house"; teleport.Realm = (int)DestinationRealm; teleport.RegionID = location.RegionID; teleport.X = location.X; teleport.Y = location.Y; teleport.Z = location.Z; teleport.Heading = location.Heading; OnDestinationPicked(player, teleport); return(true); } } // Find the teleport location in the database. Teleport port = WorldMgr.GetTeleportLocation(DestinationRealm, String.Format("{0}:{1}", Type, text)); if (port != null) { if (port.RegionID == 0 && port.X == 0 && port.Y == 0 && port.Z == 0) { OnSubSelectionPicked(player, port); } else { OnDestinationPicked(player, port); } return(false); } return(true); // Needs further processing. }
/// <summary> /// Command list for the game /// </summary> /// <param name="commandOptions">Everything after the 1st occurance of a space</param> /// <param name="commandKey">The string before the 1st occurance of a space</param> /// <param name="playerData">Player Data</param> /// <param name="room">Current room</param> /// <returns>Returns Dictionary of commands</returns> public static Dictionary <string, Action> Commands(string commandOptions, string commandKey, PlayerSetup.Player playerData, Room.Room room) { var commandList = new Dictionary <String, Action> { { "north", () => Movement.Move(playerData, room, "North") }, { "south", () => Movement.Move(playerData, room, "South") }, { "east", () => Movement.Move(playerData, room, "East") }, { "west", () => Movement.Move(playerData, room, "West") }, { "down", () => Movement.Move(playerData, room, "Down") }, { "up", () => Movement.Move(playerData, room, "Up") }, { "look", () => LoadRoom.ReturnRoom(playerData, room, commandOptions, "look") }, { "l in", () => LoadRoom.ReturnRoom(playerData, room, commandOptions, "look in") }, { "look in", () => LoadRoom.ReturnRoom(playerData, room, commandOptions, "look in") }, { "examine", () => LoadRoom.ReturnRoom(playerData, room, commandOptions, "examine") }, { "touch", () => LoadRoom.ReturnRoom(playerData, room, commandOptions, "touch") }, { "smell", () => LoadRoom.ReturnRoom(playerData, room, commandOptions, "smell") }, { "taste", () => LoadRoom.ReturnRoom(playerData, room, commandOptions, "taste") }, { "score", () => Score.ReturnScore(playerData) }, { "inventory", () => Inventory.ReturnInventory(playerData.Inventory, playerData) }, { "equipment", () => Equipment.ShowEquipment(playerData) }, { "garb", () => Equipment.ShowEquipment(playerData) }, { "get", () => ManipulateObject.GetItem(room, playerData, commandOptions, commandKey, "item") }, { "take", () => ManipulateObject.GetItem(room, playerData, commandOptions, commandKey, "item") }, { "drop", () => ManipulateObject.DropItem(room, playerData, commandOptions, commandKey) }, { "give", () => ManipulateObject.GiveItem(room, playerData, commandOptions, commandKey, "killable") }, { "put", () => ManipulateObject.DropItem(room, playerData, commandOptions, commandKey) }, { "save", () => Save.UpdatePlayer(playerData) }, { "'", () => Communicate.Say(commandOptions, playerData, room) }, { "newbie", () => Communicate.NewbieChannel(commandOptions, playerData) }, { "gossip", () => Communicate.GossipChannel(commandOptions, playerData) }, { "ooc", () => Communicate.OocChannel(commandOptions, playerData) }, { "say", () => Communicate.Say(commandOptions, playerData, room) }, { "sayto", () => Communicate.SayTo(commandOptions, room, playerData) }, { ">", () => Communicate.SayTo(commandOptions, room, playerData) }, { "talkto", () => Talk.TalkTo(commandOptions, room, playerData) }, { "emote", () => Emote.EmoteActionToRoom(commandOptions, playerData) }, { "quit", () => HubContext.Quit(playerData.HubGuid, room) }, { "wear", () => Equipment.WearItem(playerData, commandOptions) }, { "remove", () => Equipment.RemoveItem(playerData, commandOptions) }, { "doff", () => Equipment.RemoveItem(playerData, commandOptions) }, { "wield", () => Equipment.WearItem(playerData, commandOptions, true) }, { "unwield", () => Equipment.RemoveItem(playerData, commandOptions, false, true) }, { "kill", () => Fight2.PerpareToFight(playerData, room, commandOptions) }, { "flee", () => Flee.fleeCombat(playerData, room) }, //spells { "c magic missile", () => MagicMissile.StartMagicMissile(playerData, room, commandOptions) }, { "cast magic missile", () => MagicMissile.StartMagicMissile(playerData, room, commandOptions) }, { "c armour", () => Armour.StartArmour(playerData, room, commandOptions) }, { "cast armour", () => Armour.StartArmour(playerData, room, commandOptions) }, { "c armor", () => Armour.StartArmour(playerData, room, commandOptions) }, { "cast armor", () => Armour.StartArmour(playerData, room, commandOptions) }, { "c continual light", () => ContinualLight.StarContinualLight(playerData, room, commandOptions) }, { "cast continual light", () => ContinualLight.StarContinualLight(playerData, room, commandOptions) }, { "c invis", () => Invis.StartInvis(playerData, room, commandOptions) }, { "cast invis", () => Invis.StartInvis(playerData, room, commandOptions) }, { "c weaken", () => Weaken.StartWeaken(playerData, room, commandOptions) }, { "cast weaken", () => Weaken.StartWeaken(playerData, room, commandOptions) }, { "c chill touch", () => ChillTouch.StartChillTouch(playerData, room, commandOptions) }, { "cast chill touch", () => ChillTouch.StartChillTouch(playerData, room, commandOptions) }, { "c fly", () => Fly.StartFly(playerData, room, commandOptions) }, { "cast fly", () => Fly.StartFly(playerData, room, commandOptions) }, { "c refresh", () => Refresh.StartRefresh(playerData, room, commandOptions) }, { "cast refresh", () => Refresh.StartRefresh(playerData, room, commandOptions) }, { "c faerie fire", () => FaerieFire.StartFaerieFire(playerData, room, commandOptions) }, { "cast faerie fire", () => FaerieFire.StartFaerieFire(playerData, room, commandOptions) }, { "c teleport", () => Teleport.StartTeleport(playerData, room) }, { "cast teleport", () => Teleport.StartTeleport(playerData, room) }, { "c blindness", () => Blindness.StartBlind(playerData, room, commandOptions) }, { "cast blindess", () => Blindness.StartBlind(playerData, room, commandOptions) }, { "c haste", () => Haste.StartHaste(playerData, room, commandOptions) }, { "cast haste", () => Haste.StartHaste(playerData, room, commandOptions) }, { "c create spring", () => CreateSpring.StartCreateSpring(playerData, room) }, { "cast create spring", () => CreateSpring.StartCreateSpring(playerData, room) }, { "c shocking grasp", () => { var shockingGRasp = new ShockingGrasp(); shockingGRasp.StartShockingGrasp(playerData, room, commandOptions); } }, { "cast shocking grasp", () => { var shockingGRasp = new ShockingGrasp(); shockingGRasp.StartShockingGrasp(playerData, room, commandOptions); } }, //skills { "punch", () => Punch.StartPunch(playerData, room) }, { "kick", () => Kick.StartKick(playerData, room) }, // { "unlock", () => ManipulateObject.UnlockItem(room, playerData, commandOptions, commandKey) }, { "lock", () => ManipulateObject.LockItem(room, playerData, commandOptions, commandKey) }, { "open", () => ManipulateObject.Open(room, playerData, commandOptions, commandKey) }, { "close", () => ManipulateObject.Close(room, playerData, commandOptions, commandKey) }, { "drink", () => ManipulateObject.Drink(room, playerData, commandOptions, commandKey) }, { "help", () => Help.ShowHelp(commandOptions, playerData) }, { "time", Update.Time.ShowTime }, { "clock", Update.Time.ShowTime }, { "skills", () => ShowSkills.ShowPlayerSkills(playerData, commandOptions) }, { "skills all", () => ShowSkills.ShowPlayerSkills(playerData, commandOptions) }, { "practice", () => Trainer.Practice(playerData, room, commandOptions) }, { "list", () => Shop.listItems(playerData, room) }, { "buy", () => Shop.buyItems(playerData, room, commandOptions) }, { "quest log", () => Quest.QuestLog(playerData) }, { "qlog", () => Quest.QuestLog(playerData) }, { "wake", () => Status.WakePlayer(playerData, room) }, { "sleep", () => Status.SleepPlayer(playerData, room) }, { "greet", () => Greet.GreetMob(playerData, room, commandOptions) }, { "who", () => Who.Connected(playerData) }, { "affects", () => Affect.Show(playerData) }, { "follow", () => Follow.FollowThing(playerData, room, commandOptions) }, //admin { "/debug", () => PlayerSetup.Player.DebugPlayer(playerData) } }; return(commandList); }
//public Vector3 teleLocation = new Vector3(player.position.x + 2, player.position.y, player.position.z); private void Awake() { instance = this; }
private void Teleport_OnTeleport(Obj_AI_Base sender, Teleport.TeleportEventArgs args) { if (sender.Type != GameObjectType.AIHeroClient || args.Type != TeleportType.Recall) return; AIHeroClient player = sender as AIHeroClient; if (player == null || player.IsMe || player.IsAlly) return; switch (args.Status) { case TeleportStatus.Start: Recall startedRecall = Recalls.FirstOrDefault(x => x.Name == player.ChampionName); if (startedRecall != null) Recalls.Remove(startedRecall); Recalls.Add(new Recall(player.ChampionName, player.HealthPercent, Game.Time + (args.Duration / 1000f), args.Duration / 1000f)); break; case TeleportStatus.Abort: Recall abortedRecall = Recalls.FirstOrDefault(x => x.Name == player.ChampionName); if (abortedRecall != null) { abortedRecall.Abort(); Core.DelayAction(() => Recalls.Remove(abortedRecall), 2000); } break; case TeleportStatus.Finish: //BUG: Procs when recall aborts with less than 0.3 second left. Recall finishedRecall = Recalls.FirstOrDefault(x => x.Name == player.ChampionName); if (finishedRecall != null) Recalls.Remove(finishedRecall); break; } }
public UniPortal(GameLiving caster, Spell spell, SpellLine spellLine, Teleport destination) : base(caster, spell, spellLine) { m_destination = destination; }
private void Teleport_OnTeleport(Obj_AI_Base sender, Teleport.TeleportEventArgs args) { Volatile_OnTeleport(sender, args); }
protected virtual void Volatile_OnTeleport(Obj_AI_Base sender, Teleport.TeleportEventArgs args) { //for extensions }
/// <summary> /// Player has picked a destination. /// </summary> /// <param name="player"></param> /// <param name="destination"></param> protected override void OnDestinationPicked(GamePlayer player, Teleport destination) { switch (destination.TeleportID.ToLower()) { case "avalon marsh": SayTo(player, "You shall soon arrive in the Avalon Marsh."); break; case "battlegrounds": if (!ServerProperties.Properties.BG_ZONES_OPENED && player.Client.Account.PrivLevel == (uint)ePrivLevel.Player) { SayTo(player, ServerProperties.Properties.BG_ZONES_CLOSED_MESSAGE); return; } SayTo(player, "I will teleport you to the appropriate battleground for your level and Realm Rank. If you exceed the Realm Rank for a battleground, you will not teleport. Please gain more experience to go to the next battleground."); break; case "camelot": SayTo(player, "The great city awaits!"); break; case "castle sauvage": SayTo(player, "Castle Sauvage is what you seek, and Castle Sauvage is what you shall find."); break; case "diogel": break; // No text? case "entrance": break; // No text? case "forest sauvage": SayTo(player, "Now to the Frontiers for the glory of the realm!"); break; case "gothwaite": SayTo(player, "The Shrouded Isles await you."); break; case "gwyntell": break; // No text? case "inconnu crypt": if (player.HasFinishedQuest(typeof(InconnuCrypt)) <= 0) { SayTo(player, String.Format("I may only send those who know the way to this {0} {1}", "city. Seek out the path to the city and in future times I will aid you in", "this journey.")); return; } break; case "oceanus": if (player.Client.Account.PrivLevel < ServerProperties.Properties.ATLANTIS_TELEPORT_PLVL) { SayTo(player, "I'm sorry, but you are not authorized to enter Atlantis at this time."); return; } SayTo(player, "You will soon arrive in the Haven of Oceanus."); break; case "personal": break; case "hearth": break; case "snowdonia fortress": SayTo(player, "Snowdonia Fortress is what you seek, and Snowdonia Fortress is what you shall find."); break; // text for the following ? case "wearyall": break; case "holtham": if (ServerProperties.Properties.DISABLE_TUTORIAL) { SayTo(player, "Sorry, this place is not available for now !"); return; } if (player.Level > 15) { SayTo(player, "Sorry, you are far too experienced to enjoy this place !"); return; } break; default: SayTo(player, "This destination is not yet supported."); return; } base.OnDestinationPicked(player, destination); }
private void Start() { _firstTeleport = transform.GetChild(0).GetComponent<Teleport>(); _secondTeleport = transform.GetChild(1).GetComponent<Teleport>(); }
public virtual void ActivateContent(Teleport t) { }
/** * <summary> * Teleports the platform and the players on it back to the return point by setting their transform positions. * Also uses the <see cref="Teleport"/> behavior for visual effect. * </summary> */ private void ReturnPlatform() { // == 1. Find all objects of the "Player" layer which are in contact with the platform == var playerContactFilter = new ContactFilter2D(); playerContactFilter.SetLayerMask(LayerMask.GetMask("Player")); var contactsOfPlatform = new List <Collider2D>(); platformPlayerCollider .OverlapCollider(playerContactFilter, contactsOfPlatform); // == 2. Of those objects, only keep the players and determine their position relative to the platform == var platformPosition = platformToReturn.transform.position; var playersInContact = contactsOfPlatform // Get the players of the objects in contact .SelectNotNull(collider => collider.GetComponent <PlayerController>()) // For each player, build a pair containing the player and its position relative to the platform .Select(player => ( player, player.transform.position - platformPosition ) ) .ToArray(); // == 3. Teleport out all players standing on the platform (visual effect) == foreach (var(player, _) in playersInContact) { Teleport.TeleportOut(player.gameObject, player.Color.ToRGB(), null, 0.7f); } // == 4. Teleport out the platform (visual effect, slightly delayed to ensure players teleport out first) == Teleport.TeleportOut( platformToReturn, Color.white, () => { // == 5. Move the platform to the return point, when the teleport-out effect finishes == platformToReturn.transform.position = _platformReturnPoint; // == 6. Teleport in the platform again (visual effect) Teleport.TeleportIn( platformToReturn, Color.white, null, 0.7f ); foreach (var(player, relativePositionToPlatform) in playersInContact) { // == 7. Move all players to the return point, offset by their relative position to the platform we determined beforehand == player.PhysicsEffects.Teleport(_platformReturnPoint + relativePositionToPlatform); // == 8. Teleport the players in (visual effect, slightly delayed, to ensure the platform appears first) == Teleport.TeleportIn( player.gameObject, player.Color.ToRGB(), null, 0.75f ); } },
/// <summary> /// Picking best Position to move to. /// </summary> public static void BestPosition() { if (EnableTeleport && ObjectsManager.ClosestAlly != null) { Program.Moveto = "Teleporting"; Teleport.Cast(); } // If player is Zombie moves follow nearest Enemy. if (Player.Instance.IsZombie()) { var ZombieTarget = TargetSelector.GetTarget(1000, DamageType.Mixed); if (ZombieTarget != null) { Program.Moveto = "ZombieTarget"; Position = ZombieTarget.PredictPosition(); return; } if (ObjectsManager.NearestEnemy != null) { Program.Moveto = "NearestEnemy"; Position = ObjectsManager.NearestEnemy.PredictPosition(); return; } if (ObjectsManager.NearestEnemyMinion != null) { Program.Moveto = "NearestEnemyMinion"; Position = ObjectsManager.NearestEnemyMinion.PredictPosition(); return; } } // Feeding Poros var poro = ObjectsManager.ClosesetPoro; if (poro != null) { var porosnax = new Item(2052); if (porosnax != null && porosnax.IsOwned(Player.Instance) && porosnax.IsReady()) { porosnax.Cast(poro); Logger.Send("Feeding ClosesetPoro"); } } // Moves to HealthRelic if the bot needs heal. var needHR = Player.Instance.PredictHealthPercent() <= HealthRelicHP || Player.Instance.ManaPercent <= HealthRelicMP && !Player.Instance.IsNoManaHero(); var healthRelic = ObjectsManager.HealthRelic; if (needHR && healthRelic != null) { var allyneedHR = EntityManager.Heroes.Allies.Any(a => !a.IsMe && Player.Instance.PredictHealth() > a.PredictHealth() && a.Path.LastOrDefault(p => p.IsInRange(healthRelic, a.BoundingRadius + healthRelic.BoundingRadius)) != null); if (!allyneedHR && DontStealHR || !DontStealHR) { var safeHR = Player.Instance.SafePath(healthRelic) || Player.Instance.Distance(healthRelic) <= 200; if (safeHR) { var formana = Player.Instance.ManaPercent <= HealthRelicMP && !Player.Instance.IsNoManaHero(); if (healthRelic.Name.Contains("Bard") && !formana) { Program.Moveto = "BardShrine"; Position = healthRelic.Position; return; } Program.Moveto = "HealthRelic"; Position = healthRelic.Position; return; } } } // Hunting Bard chimes kappa. var BardChime = ObjectsManager.BardChime; if (PickBardChimes && BardChime != null) { Program.Moveto = "BardChime"; Position = BardChime.Position.Random(); return; } // Pick Thresh Lantern var ThreshLantern = ObjectsManager.ThreshLantern; if (ThreshLantern != null) { if (Player.Instance.Distance(ThreshLantern) > 300) { Program.Moveto = "ThreshLantern"; Position = ThreshLantern.Position.Random(); } else { Program.Moveto = "ThreshLantern"; Player.UseObject(ThreshLantern); } return; } if (PickDravenAxe && ObjectsManager.DravenAxe != null) { Program.Moveto = "DravenAxe"; Position = ObjectsManager.DravenAxe.Position; return; } if (PickOlafAxe && ObjectsManager.OlafAxe != null) { Program.Moveto = "OlafAxe"; Position = ObjectsManager.OlafAxe.Position; return; } if (PickZacBlops && ObjectsManager.ZacBlop != null) { Program.Moveto = "ZacBlop"; Position = ObjectsManager.ZacBlop.Position; return; } /* fix core pls not working :pepe: * if (PickCorkiBomb && ObjectsManager.CorkiBomb != null) * { * Program.Moveto = "CorkiBomb"; * if (Player.Instance.IsInRange(ObjectsManager.CorkiBomb, 300)) * { * Program.Moveto = "UsingCorkiBomb"; * Player.UseObject(ObjectsManager.CorkiBomb); * } * Position = ObjectsManager.CorkiBomb.Position; * return; * }*/ // Moves to the Farthest Ally if the bot has Autsim if (Brain.Alone() && ObjectsManager.FarthestAllyToFollow != null && Player.Instance.Distance(ObjectsManager.AllySpawn) <= 3000) { Program.Moveto = "FarthestAllyToFollow"; Position = ObjectsManager.FarthestAllyToFollow.PredictPosition().Random(); return; } // Stays Under tower if the bot health under 10%. if ((ModesManager.CurrentMode == ModesManager.Modes.Flee || (Player.Instance.PredictHealthPercent() < 10 && Player.Instance.CountAllyHeros(SafeValue + 2000) < 3)) && EntityManager.Heroes.Enemies.Count(e => e.IsValid && !e.IsDead && e.IsInRange(Player.Instance, SafeValue + 200)) > 0) { if (ObjectsManager.SafeAllyTurret != null) { Program.Moveto = "SafeAllyTurretFlee"; Position = ObjectsManager.SafeAllyTurret.PredictPosition().Random().Extend(ObjectsManager.AllySpawn.Position.Random(), 400).To3D(); return; } if (ObjectsManager.AllySpawn != null) { Program.Moveto = "AllySpawnFlee"; Position = ObjectsManager.AllySpawn.Position.Random(); return; } } // Moves to AllySpawn if the bot is diving and it's not safe to dive. if (((Player.Instance.UnderEnemyTurret() && !SafeToDive) || MyHero.TurretAttackingMe) && ObjectsManager.AllySpawn != null) { Program.Moveto = "AllySpawn2"; Position = ObjectsManager.AllySpawn.Position.Random(); return; } if (Player.Instance.GetAutoAttackRange() < 425) { MeleeLogic(); } else { RangedLogic(); } }
void Update() { // Hold an object if (Input.GetKeyDown(KeyCode.E) && holdable != null) { currentlyHolding = holdable; currentlyHolding.Hold(transform); } // Holds and snaps an object if (Input.GetKeyDown(KeyCode.R) && holdable != null) { currentlyHolding = holdable; currentlyHolding.HoldSnap(transform); } // Drops the held object if ((Input.GetKeyUp(KeyCode.E) || Input.GetKeyUp(KeyCode.R)) && currentlyHolding != null) { currentlyHolding.Drop(rb.velocity, rb.angularVelocity); currentlyHolding = null; } // Hold snap toggle if (Input.GetKeyDown(KeyCode.T)) { if (!holdToggle && holdable != null) { currentlyHolding = holdable; currentlyHolding.HoldSnap(transform); holdToggle = true; } else if (holdToggle && currentlyHolding != null) { currentlyHolding.Drop(rb.velocity, rb.angularVelocity); currentlyHolding = null; holdToggle = false; } } // Press button if (Input.GetKeyDown(KeyCode.F) && button != null) { button.Press(); } if (Input.GetKey(KeyCode.E) && slider != null) { slider.Move(transform); } // If held object is gun, shoot if (Input.GetMouseButtonDown(0) && currentlyHolding != null) { var gun = currentlyHolding.GetComponent <Shooting>(); if (gun != null) { gun.Shoot(); } } if (Input.GetMouseButtonDown(1)) { Teleport.Tele(transform.parent, transform.parent); } }
public static PlayerClass MageClass() { var mage = new PlayerClass { Name = "Mage", IsBaseClass = true, ExperienceModifier = 3000, HelpText = new Help(), Skills = new List <Skill>(), ReclassOptions = new List <PlayerClass>(), MaxHpGain = 8, MinHpGain = 3, MaxManaGain = 15, MinManaGain = 10, MaxEnduranceGain = 15, MinEnduranceGain = 11, StatBonusInt = 2, StatBonusWis = 1 }; #region Give fighter punch skill var punch = Punch.PunchAb(); punch.LevelObtained = 2; punch.Proficiency = 1; punch.MaxProficiency = 95; mage.Skills.Add(punch); #endregion #region Give mage magic missile skill var magicMissile = MagicMissile.MagicMissileAb(); magicMissile.LevelObtained = 1; magicMissile.Proficiency = 50; magicMissile.MaxProficiency = 95; mage.Skills.Add(magicMissile); #endregion #region Give mage armor skill var armour = Armour.ArmourAb(); armour.LevelObtained = 1; armour.Proficiency = 50; armour.MaxProficiency = 95; mage.Skills.Add(armour); #endregion #region Give invis skill var invis = Invis.InvisAb(); invis.LevelObtained = 1; invis.Proficiency = 50; invis.MaxProficiency = 95; mage.Skills.Add(invis); #endregion #region Give continual light skill var continualLight = ContinualLight.ContinualLightAb(); continualLight.LevelObtained = 1; continualLight.Proficiency = 50; continualLight.MaxProficiency = 95; mage.Skills.Add(continualLight); #endregion #region Give weaken var weaken = Weaken.WeakenAb(); weaken.LevelObtained = 1; weaken.Proficiency = 50; weaken.MaxProficiency = 95; mage.Skills.Add(weaken); #endregion #region Give chill touch var chillTouch = ChillTouch.ChillTouchAb(); chillTouch.LevelObtained = 1; chillTouch.Proficiency = 50; chillTouch.MaxProficiency = 95; mage.Skills.Add(chillTouch); #endregion #region Give fly var fly = Fly.FlyAb(); fly.LevelObtained = 1; fly.Proficiency = 50; fly.MaxProficiency = 95; mage.Skills.Add(fly); #endregion #region Give Faerie Fire var faerieFire = FaerieFire.FaerieFireAB(); faerieFire.LevelObtained = 1; faerieFire.Proficiency = 50; faerieFire.MaxProficiency = 95; mage.Skills.Add(faerieFire); #endregion #region Give refresh var refresh = Refresh.RefreshAb(); refresh.LevelObtained = 1; refresh.Proficiency = 50; refresh.MaxProficiency = 95; mage.Skills.Add(refresh); #endregion #region Give teleport var teleport = Teleport.TeleporAb(); teleport.LevelObtained = 1; teleport.Proficiency = 50; teleport.MaxProficiency = 95; mage.Skills.Add(teleport); #endregion #region Give blindness var blindness = Blindness.BlindAb(); blindness.LevelObtained = 1; blindness.Proficiency = 50; blindness.MaxProficiency = 95; mage.Skills.Add(blindness); #endregion #region Give haste var haste = Haste.HasteAb(); haste.LevelObtained = 1; haste.Proficiency = 50; haste.MaxProficiency = 95; mage.Skills.Add(haste); #endregion #region Give create spring var createSpring = CreateSpring.CreateSpringAb(); createSpring.LevelObtained = 1; createSpring.Proficiency = 50; createSpring.MaxProficiency = 95; mage.Skills.Add(createSpring); #endregion mage.ReclassOptions.Add(Ranger.RangerClass()); return(mage); }
// Use this for initialization void Start () { rb = GetComponent<Rigidbody> (); teleportScript = GetComponent<Teleport> (); scoreText = scoreTextObject.GetComponent<TextMesh> (); winText.SetActive (false); }
public void TeleportAI(Teleport tele) { transform.position = tele.GetDestination(); }
public static void Teleport_OnTeleport(Obj_AI_Base sender, Teleport.TeleportEventArgs args) { var enemy = EntityManager.Heroes.Enemies.FirstOrDefault(x => x.Equals(sender)); if(enemy == null || args.Type != TeleportType.Recall) return; switch (args.Status) { case TeleportStatus.Start: { Recalls.Add(new Recall(enemy, RecallStatus.Active){ Started = args.Start, Duration = args.Duration }); break; } case TeleportStatus.Abort: { var abortedEnemy = Recalls.FirstOrDefault(x => x.Unit.Equals(enemy)); if(abortedEnemy == null) return; Recalls.Remove(abortedEnemy); removeFromBaseUlt(abortedEnemy.Unit); break; } case TeleportStatus.Finish: { var finishedEnemy = Recalls.FirstOrDefault(x => x.Unit.Equals(enemy)); if (finishedEnemy == null) return; Recalls.Remove(finishedEnemy); removeFromBaseUlt(finishedEnemy.Unit); break; } } }
/// <summary> /// Command list for the game /// </summary> /// <param name="commandOptions">Everything after the 1st occurance of a space</param> /// <param name="commandKey">The string before the 1st occurance of a space</param> /// <param name="playerData">Player Data</param> /// <param name="room">Current room</param> /// <returns>Returns Dictionary of commands</returns> public static void Commands(string commandOptions, string commandKey, PlayerSetup.Player playerData, Room.Room room) { var context = HubContext.Instance; switch (commandKey) { case "north": Movement.Move(playerData, room, "North"); break; case "east": Movement.Move(playerData, room, "East"); break; case "south": Movement.Move(playerData, room, "South"); break; case "west": Movement.Move(playerData, room, "West"); break; case "up": Movement.Move(playerData, room, "Up"); break; case "down": Movement.Move(playerData, room, "Down"); break; case "look": case "look at": case "l at": case "search": LoadRoom.ReturnRoom(playerData, room, commandOptions, "look"); break; case "l in": case "search in": LoadRoom.ReturnRoom(playerData, room, commandOptions, "look in"); break; case "examine": LoadRoom.ReturnRoom(playerData, room, commandOptions, "examine"); break; case "touch": LoadRoom.ReturnRoom(playerData, room, commandOptions, "touch"); break; case "smell": LoadRoom.ReturnRoom(playerData, room, commandOptions, "smell"); break; case "taste": LoadRoom.ReturnRoom(playerData, room, commandOptions, "taste"); break; case "score": Score.ReturnScore(playerData); break; case "inventory": Inventory.ReturnInventory(playerData.Inventory, playerData); break; case "eq": case "equip": case "equipment": case "garb": Equipment.ShowEquipment(playerData); break; case "loot": case "get": case "take": ManipulateObject.GetItem(room, playerData, commandOptions, commandKey, "item"); break; case "plunder": ManipulateObject.GetItem(room, playerData, "all " + commandOptions, commandKey, "item"); break; case "drop": case "put": ManipulateObject.DropItem(room, playerData, commandOptions, commandKey); break; case "give": ManipulateObject.GiveItem(room, playerData, commandOptions, commandKey, "killable"); break; case "save": Save.SavePlayer(playerData); break; case "say": case "'": Communicate.Say(commandOptions, playerData, room); break; case "sayto": case ">": Communicate.SayTo(commandOptions, room, playerData); break; case "newbie": Communicate.NewbieChannel(commandOptions, playerData); break; case "gossip": Communicate.GossipChannel(commandOptions, playerData); break; case "ooc": Communicate.OocChannel(commandOptions, playerData); break; case "yes": Communicate.Say("Yes", playerData, room); break; case "no": Communicate.Say("No", playerData, room); break; case "yell": Communicate.Yell(commandOptions, room, playerData); break; case "talkto": Talk.TalkTo(commandOptions, room, playerData); break; case "emote": Emote.EmoteActionToRoom(commandOptions, playerData); break; case "use": case "wear": case "wield": Equipment.WearItem(playerData, commandOptions); break; case "remove": case "doff": case "unwield": Equipment.RemoveItem(playerData, commandOptions); break; case "hit": case "kill": case "attack": Fight2.PerpareToFight(playerData, room, commandOptions); break; case "flee": Flee.fleeCombat(playerData, room); break; case "sacrifice": case "harvest": Harvest.Body(playerData, room, commandOptions); break; case "peek": Peak.DoPeak(context, playerData, room, commandOptions); break; case "steal": Steal.DoSteal(context, playerData, room, commandOptions); break; case "pick": LockPick.DoLockPick(context, playerData, room, commandOptions); break; case "c magic missile": case "cast magic missile": MagicMissile.StartMagicMissile(playerData, room, commandOptions); break; case "c armour": case "cast armour": case "c armor": case "cast armor": new Armour().StartArmour(playerData, room, commandOptions); break; case "c continual light": case "cast continual light": ContinualLight.StarContinualLight(playerData, room, commandOptions); break; case "c invis": case "cast invis": Invis.StartInvis(playerData, room, commandOptions); break; case "c weaken": case "cast weaken": Weaken.StartWeaken(playerData, room, commandOptions); break; case "c chill touch": case "cast chill touch": ChillTouch.StartChillTouch(playerData, room, commandOptions); break; case "c fly": case "cast fly": Fly.StartFly(playerData, room, commandOptions); break; case "c refresh": case "cast refresh": Refresh.StartRefresh(playerData, room, commandOptions); break; case "c faerie fire": case "cast faerie fire": FaerieFire.StartFaerieFire(playerData, room, commandOptions); break; case "c teleport": case "cast teleport": Teleport.StartTeleport(playerData, room); break; case "c blindness": case "cast blindness": Blindness.StartBlind(playerData, room, commandOptions); break; case "c haste": case "cast haste": Haste.StartHaste(playerData, room, commandOptions); break; case "c create spring": case "cast create spring": CreateSpring.StartCreateSpring(playerData, room); break; case "c shocking grasp": case "cast shocking grasp": new ShockingGrasp().StartShockingGrasp(playerData, room, commandOptions); break; case "c cause light": case "cast cause light": new CauseLight().StartCauseLight(context, playerData, room, commandOptions); break; case "c cure light": case "cast cure light": new CureLight().StartCureLight(context, playerData, room, commandOptions); break; case "c cure blindness": new CureBlindness().StartCureBlindness(context, playerData, room, commandOptions); break; case "c detect invis": case "cast detect invis": DetectInvis.DoDetectInvis(context, playerData, room); break; case "forage": new Foraging().StartForaging(playerData, room); break; case "fish": case "angle": case "line": case "trawl": case "lure": new Fishing().StartFishing(playerData, room); break; case "reel": Fishing.GetFish(playerData, room); break; case "dirt kick": new DirtKick().StartDirtKick(context, playerData, room, commandOptions); break; case "bash": new Bash().StartBash(context, playerData, room, commandOptions); break; case "shield bash": new ShieldBash().StartBash(context, playerData, room, commandOptions); break; case "punch": Punch.StartPunch(playerData, room); break; case "kick": new Kick().StartKick(context, playerData, room, commandOptions); break; case "spin kick": new SpinKick().StartKick(context, playerData, room, commandOptions); break; case "rescue": new Rescue().StartRescue(context, playerData, room, commandOptions); break; case "lunge": new Lunge().StartLunge(context, playerData, room, commandOptions); break; case "disarm": new Disarm().StartDisarm(context, playerData, room); break; case "backstab": new Backstab().StartBackstab(context, playerData, room, commandOptions); break; case "feint": new Feint().StartFeint(context, playerData, room, commandOptions); break; case "mount": case "ride": Mount.StartMount(playerData, room, commandOptions); break; case "dismount": Mount.Dismount(playerData, room, commandOptions); break; case "trip": new Trip().StartTrip(context, playerData, room, commandOptions); break; case "sneak": Sneak.DoSneak(context, playerData); break; case "hide": Hide.DoHide(context, playerData); break; case "lore": Lore.DoLore(context, playerData, commandOptions); break; case "unlock": ManipulateObject.UnlockItem(room, playerData, commandOptions, commandKey); break; case "lock": ManipulateObject.LockItem(room, playerData, commandOptions, commandKey); break; case "close": case "shut": ManipulateObject.Close(room, playerData, commandOptions, commandKey); break; case "drink": ManipulateObject.Drink(room, playerData, commandOptions, commandKey); break; case "help": case "/help": case "?": case "commands": Help.ShowHelp(commandOptions, playerData); break; case "time": case "clock": Update.Time.ShowTime(); break; case "skills": case "spells": case "skills all": ShowSkills.ShowPlayerSkills(playerData, commandOptions); break; case "practice": Trainer.Practice(playerData, room, commandOptions); break; case "list": Shop.listItems(playerData, room); break; case "buy": Shop.buyItems(playerData, room, commandOptions); break; case "sell": Shop.sellItems(playerData, room, commandOptions); break; case "quest log": case "qlog": Quest.QuestLog(playerData); break; case "wake": Status.WakePlayer(context, playerData, room); break; case "sleep": Status.SleepPlayer(context, playerData, room); break; case "rest": case "sit": Status.RestPlayer(context, playerData, room); break; case "stand": Status.StandPlayer(context, playerData, room); break; case "greet": Greet.GreetMob(playerData, room, commandOptions); break; case "who": Who.Connected(playerData); break; case "affects": Effect.Show(playerData); break; case "follow": Follow.FollowThing(playerData, room, commandOptions); break; case "nofollow": Follow.FollowThing(playerData, room, "noFollow"); break; case "quit": HubContext.Instance.Quit(playerData.HubGuid, room); break; case "craft": Craft.CraftItem(playerData, room, commandOptions, CraftType.Craft); break; case "chop": Craft.CraftItem(playerData, room, commandOptions, CraftType.Chop); break; case "cook": Craft.CraftItem(playerData, room, commandOptions, CraftType.Cook); break; case "brew": Craft.CraftItem(playerData, room, commandOptions, CraftType.Brew); break; case "forge": Craft.CraftItem(playerData, room, commandOptions, CraftType.Forge); break; case "carve": Craft.CraftItem(playerData, room, commandOptions, CraftType.Carve); break; case "knit": Craft.CraftItem(playerData, room, commandOptions, CraftType.Knitting); break; case "make": case "build": Craft.CraftItem(playerData, room, commandOptions, CraftType.Craft); break; case "show crafts": case "craftlist": Craft.CraftList(playerData); break; case "set up camp": Camp.SetUpCamp(playerData, room); break; case "repair": Events.Repair.RepairItem(playerData, room, commandOptions); break; case "/debug": PlayerSetup.Player.DebugPlayer(playerData); break; case "/setGold": PlayerSetup.Player.SetGold(playerData, commandOptions); break; case "/setAc": PlayerSetup.Player.SetAC(playerData, commandOptions); break; case "/map": SigmaMap.DrawMap(playerData.HubGuid); //not what you think it does break; default: HubContext.Instance.SendToClient("Sorry you can't do that. Try help commands or ask on the discord channel.", playerData.HubGuid); var log = new Error.Error { Date = DateTime.Now, ErrorMessage = commandKey + " " + commandOptions, MethodName = "Wrong command" }; Save.LogError(log); break; } }
public virtual void ActivateContent(Teleport t){}
/// <summary> /// Talk to the teleporter. /// </summary> /// <param name="source"></param> /// <param name="text"></param> /// <returns></returns> public override bool WhisperReceive(GameLiving source, string text) { GamePlayer player = source as GamePlayer; if (player == null) { return(false); } eRealm realmTarget = player.Realm; StringBuilder sRet = new StringBuilder(); switch (text.ToUpper()) { // Realm specific menus case "ALBION": SayTo(player, DisplayTeleportDestinations(eRealm.Albion)); return(true); case "MIDGARD": SayTo(player, DisplayTeleportDestinations(eRealm.Midgard)); return(true); case "HIBERNIA": SayTo(player, DisplayTeleportDestinations(eRealm.Hibernia)); return(true); case "ALBION FRONTIERS": sRet.Append("Where in the frontiers would you like to go?\n[Forest Sauvage]\n[Castle Sauvage]\n[Snowdonia Fortress]\n"); sRet.Append("[Albion Agramon]"); SayTo(player, sRet.ToString()); return(true); case "ALBION MAINLAND": sRet.Append("Where in Albion would you like to go?\n"); if (!ServerProperties.Properties.DISABLE_TUTORIAL && player.Level <= 15) { sRet.Append("[Holtham] (Levels 1-9)\n"); } sRet.Append("[Cotswold Village] (Levels 10-14)\n[Prydwen Keep] (Levels 15-19)\n"); sRet.Append("[Caer Ulfwych] (Levels 20-24)\n[Campacorentin Station] (Levels 25-29)\n[Adribard's Retreat] (Levels 30-34)\n"); sRet.Append("[Cornwall Station] (Levels 35+)\n[Swanton Keep] (Levels 35+)\n[Lyonesse] (Levels 45+)\n[Dartmoor] (Levels 45+) \n"); sRet.Append("[Inconnu Crypt]"); SayTo(player, sRet.ToString()); return(true); case "ALBION DUNGEONS": sRet.Append("Which dungeon would you like to teleport to?\n"); sRet.Append("[Tomb of Mithra] (Levels 10-18)\n[Keltoi Fogou] (Levels 18-26)\n[Tepok's Mine] (Levels 26-34)\n"); sRet.Append("[Catacombs of Cardova] (Levels 34-42)\n[Stonehenge Barrows] (Levels 42-50)\n"); sRet.Append("[Krondon] (Levels 50+)\n[Avalon City] (Epic)\n[Caer Sidi] (Epic)"); SayTo(player, sRet.ToString()); return(true); case "ALBION SHROUDED ISLES": sRet.Append("Where in Avalon would you like to go?\n"); sRet.Append("[Caer Gothwaite]\n[Wearyall Village]\n[Fort Gwyntell]\n[Caer Diogel]"); SayTo(player, sRet.ToString()); return(true); case "MIDGARD FRONTIERS": sRet.Append("Where in the frontiers would you like to go?\n[Uppland]\n[Svasud Faste]\n[Vindsaul Faste]\n"); sRet.Append("[Midgard Agramon]"); SayTo(player, sRet.ToString()); return(true); case "MIDGARD MAINLAND": sRet.Append("Where in Midgard would you like to go?\n"); if (!ServerProperties.Properties.DISABLE_TUTORIAL && player.Level <= 15) { sRet.Append("[Hafheim] (Levels 1-9)\n"); } sRet.Append("[Mularn] (Levels 10-14)\n[Fort Veldon] (Levels 15-19)\n"); sRet.Append("[Audliten] (Levels 20-24)\n[Huginfell] (Levels 25-29)\n[Fort Atla] (Levels 30-34)\n"); sRet.Append("[Gna Faste] (Levels 35+)\n[Vindsaul Faste] (Levels 35+)\n[Raumarik] (Levels 45+)\n[Malmohus] (Levels 45+)\n"); sRet.Append("[Kobold Undercity]"); SayTo(player, sRet.ToString()); return(true); case "MIDGARD DUNGEONS": sRet.Append("Which dungeon would you like to teleport to?\n"); sRet.Append("[Nisse's Lair] (Levels 10-18)\n[Cursed Tomb] (Levels 18-26)\n[Vendo Caverns] (Levels 26-34)\n"); sRet.Append("[Varulvhamn] (Levels 34-42)\n[Spindelhalla ] (Levels 42-50),\n"); sRet.Append("[Iarnvidiur's Lair] (Levels 50+)\n[Trollheim] (Epic)\n[Tuscaren Glacier] (Epic)"); SayTo(player, sRet.ToString()); return(true); case "MIDGARD SHROUDED ISLES": sRet.Append("Where in Aegir would you like to go?\n"); sRet.Append("[Aegirhamn]\n[Bjarken]\n[Hagall]\n[Knarr]"); SayTo(player, sRet.ToString()); return(true); case "HIBERNIA FRONTIERS": sRet.Append("Where in the frontiers would you like to go?\n[Cruachan Gorge]\n[Druim Ligen]\n[Druim Cain]\n"); sRet.Append("[Hibernia Agramon]"); SayTo(player, sRet.ToString()); return(true); case "HIBERNIA MAINLAND": sRet.Append("Where in Hibernia would you like to go?\n"); if (!ServerProperties.Properties.DISABLE_TUTORIAL && player.Level <= 15) { sRet.Append("[Fintain] (Levels 1-9)\n"); } sRet.Append("[Mag Mell] (Levels 10-14)\n[Tir na mBeo] (Levels 15-19)\n"); sRet.Append("[Ardagh] (Levels 20-24)\n[Howth] (Levels 25-29)\n[Connla] (Levels 30-34)\n"); sRet.Append("[Innis Carthaig] (Levels 35+)\n[Druim Cain] (Levels 35+)\n[Cursed Forest] (Levels 45+)\n[Sheeroe Hills] (Levels 45+)\n"); sRet.Append("[Shar Labyrinth]"); SayTo(player, sRet.ToString()); return(true); case "HIBERNIA DUNGEONS": sRet.Append("Which dungeon would you like to teleport to?\n"); sRet.Append("[Muire Tomb] (Levels 10-18)\n[Spraggon Den] (Levels 18-26)\n[Koalinth Caverns] (Levels 26-34)\n"); sRet.Append("[Treibh Caillte] (Levels 34-42)\n[Coruscating Mine] (Levels 42-50)\n"); sRet.Append("[Tur Suil] (Levels 50+)\n[Fomor] (Epic)\n[Galladoria] (Epic)"); SayTo(player, sRet.ToString()); return(true); case "HIBERNIA SHROUDED ISLES": sRet.Append("Where in Hy Brasil would you like to go?\n"); sRet.Append("[Domnann]\n[Droighaid]\n[Aalid Feie]\n[Necht]"); SayTo(player, sRet.ToString()); return(true); case "HOUSING": sRet.Append("\nI can send you to:\n Your [personal] house, if you have one,\n"); sRet.Append("The housing [entrance],\nYour [guild] house,\nor your [Hearth] bind."); SayTo(player, sRet.ToString()); return(true); // DF locations case "ALBION DARKNESS FALLS": realmTarget = eRealm.Albion; text = "Darkness Falls"; break; case "MIDGARD DARKNESS FALLS": realmTarget = eRealm.Midgard; text = "Darkness Falls"; break; case "HIBERNIA DARKNESS FALLS": realmTarget = eRealm.Hibernia; text = "Darkness Falls"; break; // Agramon case "ALBION AGRAMON": realmTarget = eRealm.Albion; text = "Agramon"; break; case "MIDGARD AGRAMON": realmTarget = eRealm.Midgard; text = "Agramon"; break; case "HIBERNIA AGRAMON": realmTarget = eRealm.Hibernia; text = "Agramon"; break; // Albion destinations case "CAMELOT": SayTo(player, "The great city awaits!"); realmTarget = eRealm.Albion; break; case "ALBION OCEANUS": if (player.Client.Account.PrivLevel < ServerProperties.Properties.ATLANTIS_TELEPORT_PLVL) { SayTo(player, "I'm sorry, but you are not authorized to enter Atlantis at this time."); return(true); } SayTo(player, "You will soon arrive in the Haven of Oceanus."); realmTarget = eRealm.Albion; text = "Oceanus"; break; // SI cities case "GOTHWAITE": case "DIOGEL": case "GWYNTELL": case "WEARYALL": SayTo(player, "The Shrouded Isles await you."); realmTarget = eRealm.Albion; break; // Mainland destinations case "COTSWOLD VILLAGE": case "PRYDWEN KEEP": case "CAER ULFWYCH": case "CAMPACORENTIN STATION": case "ADRIBARD'S RETREAT": case "CORNWALL STATION": case "SWANTON KEEP": case "LYONESSE": case "DARTMOOR": case "AVALON MARSH": // Dungeon destinations case "TOMB OF MITHRA": case "KELTOI FOGOU": case "TEPOK'S MINE": case "CATACOMBS OF CARDOVA": case "STONEHENGE BARROWS": case "KRONDON": case "AVALON CITY": case "CAER SIDI": sRet.Append("You shall soon arrive in "); sRet.Append(text); sRet.Append("."); SayTo(player, sRet.ToString()); realmTarget = eRealm.Albion; break; case "FOREST SAUVAGE": SayTo(player, "Now to the Frontiers for the glory of the realm!"); realmTarget = eRealm.Albion; break; case "CASTLE SAUVAGE": case "SNOWDONIA FORTRESS": sRet.Append(text); sRet.Append(" is what you seek, and "); sRet.Append(text); sRet.Append(" is what you shall find."); SayTo(player, sRet.ToString()); realmTarget = eRealm.Albion; break; case "INCONNU CRYPT": //if (player.HasFinishedQuest(typeof(InconnuCrypt)) <= 0) //{ // SayTo(player, String.Format("I may only send those who know the way to this {0} {1}", // "city. Seek out the path to the city and in future times I will aid you in", // "this journey.")); // return; //} realmTarget = eRealm.Albion; break; case "HOLTHAM": if (ServerProperties.Properties.DISABLE_TUTORIAL) { SayTo(player, "Sorry, this place is not available for now !"); } else if (player.Level > 15) { SayTo(player, "Sorry, you are far too experienced to enjoy this place !"); } else { realmTarget = eRealm.Albion; break; } return(true); // Midgard case "JORDHEIM": SayTo(player, "The great city awaits!"); realmTarget = eRealm.Midgard; break; case "MIDGARD OCEANUS": if (player.Client.Account.PrivLevel < ServerProperties.Properties.ATLANTIS_TELEPORT_PLVL) { SayTo(player, "I'm sorry, but you are not authorized to enter Atlantis at this time."); return(true); } SayTo(player, "You will soon arrive in the Haven of Oceanus."); realmTarget = eRealm.Midgard; text = "Oceanus"; break; // SI cities case "AEGIRHAMN": case "BJARKEN": case "HAGALL": case "KNARR": SayTo(player, "The Shrouded Isles await you."); realmTarget = eRealm.Midgard; break; // Mainland destinations case "MULARN": case "FORT VELDON": case "AUDLITEN": case "HUGINFELL": case "FORT ATLA": case "GNA FASTE": case "RAUMARIK": case "MALMOHUS": case "GOTAR": // Dungeon destinations case "NISSE'S LAIR": case "CURSED TOMB": case "VENDO CAVERNS": case "VARULVHAMN": case "SPINDELHALLA": case "IARNVIDIUR'S LAIR": case "TROLLHEIM": case "TUSCAREN GLACIER": sRet.Append("You shall soon arrive in "); sRet.Append(text); sRet.Append("."); SayTo(player, sRet.ToString()); realmTarget = eRealm.Midgard; break; case "KOBOLD UNDERCITY": //if (player.HasFinishedQuest(typeof(KoboldUndercity)) <= 0) //{ // SayTo(player, String.Format("I may only send those who know the way to this {0} {1}", // "city. Seek out the path to the city and in future times I will aid you in", // "this journey.")); // return; //} realmTarget = eRealm.Midgard; break; case "UPPLAND": SayTo(player, "Now to the Frontiers for the glory of the realm!"); realmTarget = eRealm.Midgard; break; case "SVASUD FASTE": case "VINDSAUL FASTE": sRet.Append(text); sRet.Append(" is what you seek, and "); sRet.Append(text); sRet.Append(" is what you shall find."); SayTo(player, sRet.ToString()); realmTarget = eRealm.Midgard; break; case "HAFHEIM": if (ServerProperties.Properties.DISABLE_TUTORIAL) { SayTo(player, "Sorry, this place is not available for now !"); } else if (player.Level > 15) { SayTo(player, "Sorry, you are far too experienced to enjoy this place !"); } else { realmTarget = eRealm.Midgard; break; } return(true); // Hibernia case "TIR NA NOG": SayTo(player, "The great city awaits!"); realmTarget = eRealm.Hibernia; break; case "HIBERNIA OCEANUS": if (player.Client.Account.PrivLevel < ServerProperties.Properties.ATLANTIS_TELEPORT_PLVL) { SayTo(player, "I'm sorry, but you are not authorized to enter Atlantis at this time."); return(true); } SayTo(player, "You will soon arrive in the Haven of Oceanus."); realmTarget = eRealm.Hibernia; text = "Oceanus"; break; // SI locations case "DOMNANN": case "NECHT": case "AALID FEIE": case "DROIGHAID": SayTo(player, "The Shrouded Isles await you."); realmTarget = eRealm.Hibernia; break; // Mainland locations case "MAG MELL": case "TIR NA MBEO": case "ARDAGH": case "HOWTH": case "CONNLA": case "INNIS CARTHAIG": case "CURSED FOREST": case "SHEEROE HILLS": case "SHANNON ESTUARY": // Dungeon destinations case "MUIRE TOMB": case "SPRAGGON DEN": case "KOALINTH CAVERNS": case "TREIBH CAILLTE": case "CORUSCATING MINE": case "TUR SUIL": case "FOMOR": case "GALLADORIA": sRet.Append("You shall soon arrive in "); sRet.Append(text); sRet.Append("."); SayTo(player, sRet.ToString()); realmTarget = eRealm.Hibernia; break; case "CRUACHAN GORGE": SayTo(player, "Now to the Frontiers for the glory of the realm!"); realmTarget = eRealm.Hibernia; break; case "DRUIM CAIN": case "DRUIM LIGEN": sRet.Append(text); sRet.Append(" is what you seek, and "); sRet.Append(text); sRet.Append(" is what you shall find."); SayTo(player, sRet.ToString()); realmTarget = eRealm.Hibernia; break; case "SHAR LABYRINTH": //if (player.HasFinishedQuest(typeof(SharLabyrinth)) <= 0) //{ // SayTo(player, String.Format("I may only send those who know the way to this {0} {1}", // "city. Seek out the path to the city and in future times I will aid you in", // "this journey.")); // return; //} realmTarget = eRealm.Hibernia; break; case "FINTAIN": if (ServerProperties.Properties.DISABLE_TUTORIAL) { SayTo(player, "Sorry, this place is not available for now !"); } else if (player.Level > 15) { SayTo(player, "Sorry, you are far too experienced to enjoy this place !"); } else { text = "Fintain"; realmTarget = eRealm.Hibernia; break; } return(true); // All realms case "BATTLEGROUNDS": if (!ServerProperties.Properties.BG_ZONES_OPENED && player.Client.Account.PrivLevel == (uint)ePrivLevel.Player) { SayTo(player, ServerProperties.Properties.BG_ZONES_CLOSED_MESSAGE); return(true); } SayTo(player, "I will teleport you to the appropriate battleground for your level and Realm Rank. If you exceed the Realm Rank for a battleground, you will not teleport. Please gain more experience to go to the next battleground."); break; case "ENTRANCE": case "PERSONAL": case "HEARTH": realmTarget = player.Realm; break; default: return(base.WhisperReceive(source, text)); } // switch (text.ToLower()) // Find the teleport location in the database. Teleport port = GetTeleportLocation(player, text, realmTarget); if (port != null) { OnTeleportSpell(player, port); } else { SayTo(player, "This destination is not yet supported."); } return(true); }
public void teleport(Teleport tele) { if (this.canTeleport) { this.teleporting = true; this.waitedAfterTeleport = false; this.transform.position = tele.destination.position; this.lookingDirection = tele.lookingDirection(); } }
// Start is called before the first frame update void Start() { teleport = Object.FindObjectOfType <Teleport>(); defaultPos = transform.position.y; }
public StoryEngine(GameModeController gameModeController, Move moveDelegate, Teleport teleport, Say say) { _teleport = teleport; _say = say; _moveDelegate = moveDelegate; _worldLoadEvents = new Dictionary <string, StoryEvent> { ["west_forest_west_entrance"] = (addEntity, removeEntity, sayDelegate, collisionDelegate) => { if (!Flags.PrincessKidnapped) { var guard = new Entity { Name = "Guard", SpriteSheet = "5", Script = "fake_guard.ink", Position = new Vector2(14, 8), }; var princess = new PrincessPreKidnapping(guard, removeEntity) { Position = new Vector2(14, 10), MoveDelegate = _moveDelegate }; addEntity.Invoke(princess); addEntity.Invoke(guard); } }, ["west_forest"] = (addEntity, removeEntity, sayDelegate, collisionDelegate) => { var swordBlocker = new SwordBlocker("sword_blocker_moved", new Vector2(2, 21), new Vector2(2, 20), collisionDelegate) { MoveDelegate = moveDelegate, }; addEntity.Invoke(swordBlocker); }, ["northern_desert"] = (addEntity, removeEntity, sayDelegate, collisionDelegate) => { if (!Flags.GameComplete) { var guard = new NorthDesertGuard(gameModeController, "first_guard_defeated", new Vector2(23, 35), new Vector2(24, 35), new Vector2(22, 35), collisionDelegate) { MoveDelegate = moveDelegate }; addEntity.Invoke(guard); var hideoutGuard = new HideoutGuard("hideout_guard.ink", gameModeController, "second_guard_defeated", new Vector2(21, 6), new Vector2(21, 5), new Vector2(21, 7), collisionDelegate, sayDelegate) { MoveDelegate = moveDelegate }; addEntity.Invoke(hideoutGuard); } }, ["north_desert_hideout_second_floor"] = (addEntity, removeEntity, sayDelegate, collisionDelegate) => { if (Flags.PrincessKidnapped && !Flags.GameComplete) { var hideoutGuard = new HideoutGuard("second_hideout_guard.ink", gameModeController, "third_guard_defeated", new Vector2(21, 12), new Vector2(20, 15), new Vector2(20, 10), collisionDelegate, sayDelegate) { MoveDelegate = moveDelegate }; addEntity.Invoke(hideoutGuard); var secondHideoutGuard = new HideoutGuard("hideout_guard.ink", gameModeController, "forth_guard_defeated", new Vector2(18, 12), new Vector2(17, 15), new Vector2(17, 10), collisionDelegate, sayDelegate) { MoveDelegate = moveDelegate }; addEntity.Invoke(secondHideoutGuard); var princess = new PrincessKidnapped(teleport, sayDelegate) { Position = new Vector2(13, 15), MoveDelegate = moveDelegate }; addEntity.Invoke(princess); var dojoMaster = new DojoMasterHideout(gameModeController, "master_defeat", new Vector2(13, 13), new Vector2(12, 13)) { MoveDelegate = moveDelegate }; addEntity.Invoke(dojoMaster); } }, ["perfect_house"] = (addEntity, removeEntity, sayDelegate, collisionDelegate) => { if (Flags.GameComplete) { var princess = new PrincessSafe { Position = new Vector2(7, 7) }; addEntity.Invoke(princess); } } }; }
private static void OnTeleport(Obj_AI_Base sender, Teleport.TeleportEventArgs args) { if (sender.Team == Player.Instance.Team) return; if (Return.SpyRecall) { if (args.Status == TeleportStatus.Start) { Chat.Print(sender.BaseSkinName + " [started] Recall with " + (int)sender.Health + " health"); } if (args.Status == TeleportStatus.Abort) { Chat.Print(sender.BaseSkinName + " [aborted] Recall with " + (int)sender.Health + " health"); } if (args.Status == TeleportStatus.Finish) { Chat.Print(sender.BaseSkinName + " [finished] Recall"); } } }
private static void Teleport_OnTeleport(Obj_AI_Base sender, Teleport.TeleportEventArgs args) { if (sender.Team == _Player.Team || !DrawMenu["draw.Recall"].Cast<CheckBox>().CurrentValue) return; if (args.Status == TeleportStatus.Start) { Chat.Print("<font color='#ffffff'>[" + FormatTime(Game.Time) + "]</font> " + sender.BaseSkinName + " has <font color='#00ff66'>started</font> recall."); } if (args.Status == TeleportStatus.Abort) { Chat.Print("<font color='#ffffff'>[" + FormatTime(Game.Time) + "]</font> " + sender.BaseSkinName + " has <font color='#ff0000'>aborted</font> recall."); } if (args.Status == TeleportStatus.Finish) { Chat.Print("<font color='#ffffff'>[" + FormatTime(Game.Time) + "]</font> " + sender.BaseSkinName + " has <font color='#fdff00'>finished</font> recall."); } }
public void Teleport(Teleport teleport) { Teleport(teleport.Map, teleport.TeleportPosition, teleport.Direction); }
/// <summary> /// Player has picked a subselection. /// Override to pass teleport options on to the player. /// </summary> /// <param name="player"></param> /// <param name="subSelection"></param> protected virtual void OnSubSelectionPicked(GamePlayer player, Teleport subSelection) { }
private void ShowConsumables() { GUILayout.Label("> Consumable", EditorStyles.boldLabel); //newConsumableType = (Enums.eConsumableType)EditorGUILayout.EnumPopup("Consumable: ", newConsumableType); ConsumableItem consumable = (ConsumableItem)mCurrentCreateType; switch (consumable.ConsumableType) { case Enums.eConsumableType.Recovery: GUILayout.Label(" > Recovery", EditorStyles.boldLabel); RecoveryItem recovery = (RecoveryItem)consumable; //newRecoveryStatType = (Enums.eConsumableStatType)EditorGUILayout.EnumPopup("Stat Type: ", newRecoveryStatType); GUILayout.Label("Recovery Type: " + recovery.ConsumableStatType, EditorStyles.boldLabel); recoveryAmount = EditorGUILayout.IntField("Recovery Amount: ", Mathf.Clamp(recoveryAmount, 0, 99)); //if (mCurrentItem.GetType() != typeof(RecoveryItem)) //{ // mCurrentItem = new RecoveryItem(); //} break; case Enums.eConsumableType.StatUpgrade: GUILayout.Label(" > Stat Upgrade", EditorStyles.boldLabel); StatUpgradeItem statUpgrade = (StatUpgradeItem)consumable; newStatType = (Enums.eStatType)EditorGUILayout.EnumPopup("Boost Max Stat: ", newStatType); statBoostAmount = EditorGUILayout.IntField("Amount: ", Mathf.Clamp(statBoostAmount, 0, 99)); //if (mCurrentItem.GetType() != typeof(StatUpgradeItem)) //{ // mCurrentItem = new StatUpgradeItem(); //} break; case Enums.eConsumableType.StatusEffect: GUILayout.Label(" > Status Effect", EditorStyles.boldLabel); StatusEffectItem status = (StatusEffectItem)consumable; newEffectType = (Enums.eStatusEffect)EditorGUILayout.EnumPopup("Effect: ", newEffectType); //if (mCurrentItem.GetType() != typeof(StatusEffectItem)) //{ // mCurrentItem = new StatusEffectItem(); //} break; case Enums.eConsumableType.WeaponUpgrade: GUILayout.Label(" > Weapon Upgrade", EditorStyles.boldLabel); WeaponUpgradeItem weaponUpgrade = (WeaponUpgradeItem)consumable; GUILayout.Label("Stat Boosted: ATT", EditorStyles.boldLabel); weaponUpgradeAmount = EditorGUILayout.IntField("Amount: ", Mathf.Clamp(weaponUpgradeAmount, 0, 99)); //if (mCurrentItem.GetType() != typeof(WeaponUpgradeItem)) //{ // mCurrentItem = new WeaponUpgradeItem(); //} break; case Enums.eConsumableType.CharacterSupport: GUILayout.Label(" > Character Support", EditorStyles.boldLabel); CharacterSupportItem support = (CharacterSupportItem)consumable; switch (support.SupportType) { case Enums.eCharacterSupportType.Teleport: GUILayout.Label(" > Teleport", EditorStyles.boldLabel); Teleport t = (Teleport)support; TeleportPrefab = (GameObject)EditorGUILayout.ObjectField("Prefab:", TeleportPrefab, typeof(GameObject), false); if (TeleportPrefab != null) { TeleportPrefabName = TeleportPrefab.name; } break; case Enums.eCharacterSupportType.Revive: GUILayout.Label(" > Revive", EditorStyles.boldLabel); // no fields break; case Enums.eCharacterSupportType.Resource: GUILayout.Label(" > Resource", EditorStyles.boldLabel); // will need fields filled in break; case Enums.eCharacterSupportType.Scroll: GUILayout.Label(" > Scroll", EditorStyles.boldLabel); ScrollTeachType = (Enums.eSpellType)EditorGUILayout.EnumPopup("Spell Type: ", ScrollTeachType); break; } break; } }
/// <summary> /// Should be called whenever a player teleports to a new location /// </summary> /// <param name="player"></param> /// <param name="source"></param> /// <param name="destination"></param> public override void OnPlayerTeleport(GamePlayer player, GameLocation source, Teleport destination) { // Since region change already starts an immunity timer we only want to do this if a player // is teleporting within the same region if (source.RegionID == destination.RegionID) { StartImmunityTimer(player, ServerProperties.Properties.TIMER_PVP_TELEPORT * 1000); } }
/// <summary> /// Player has picked a destination. /// </summary> /// <param name="player"></param> /// <param name="destination"></param> protected override void OnDestinationPicked(GamePlayer player, Teleport destination) { SayTo(player, "Have a safe journey!"); base.OnDestinationPicked(player, destination); }
// Use this for initialization void Start() { playerData = GameObject.Find("PlayerData"); lockSpells = warlock.transform.FindChild("Spells"); lockStatus = playerData.GetComponent<Variables>(); fireball = lockSpells.GetComponent<Fireball>(); fireblast = lockSpells.GetComponent<Fireblast>(); teleport = lockSpells.GetComponent<Teleport>(); windblast = lockSpells.GetComponent<Windblast>(); gui = GameObject.FindGameObjectWithTag("GUI").GetComponent<drawGUI>(); smartCast = false; }
public void Teleport_OnTeleport(Obj_AI_Base sender, Teleport.TeleportEventArgs args) { if (sender.NetworkId != hero.NetworkId) return; if (args.Status == TeleportStatus.Start) { teleStart = Game.Time; teleDuration = args.Duration / 1000f; teleporting = true; if(invisTime>.8f) invisTime -= .8f; } if (args.Status == TeleportStatus.Abort) { teleporting = false; } if (args.Status == TeleportStatus.Finish) { teleporting = false; invisTime = 0; position = spawn; health = hero.MaxHealth; } }
private void Start() { teleport = player.GetComponent <Teleport>(); }
public void Teleport_OnTeleport(Obj_AI_Base sender, Teleport.TeleportEventArgs args) { if (sender.NetworkId != hero.NetworkId||args.Type != TeleportType.Recall) return; if (args.Status == TeleportStatus.Start) { teleStart = Game.Time; teleDuration = args.Duration / 1000f; teleporting = true; if (invisTime > .8f) invisTime -= .8f; }else { teleporting = false; if (args.Status == TeleportStatus.Finish) { invisTime = 0; position = spawn; health = hero.MaxHealth; } } /*if (args.Status == TeleportStatus.Start && args.Type != TeleportType.Unknown) { teleStart = Game.Time; teleDuration = args.Duration / 1000f; teleporting = true; if (invisTime > .8f) invisTime -= .8f; } if (args.Type != TeleportType.Unknown) return; teleporting = false; if (!(Game.Time > teleStart + teleDuration - .3f)) return; invisTime = 0; position = spawn; health = hero.MaxHealth;*/ }
private static void OnTeleport(Obj_AI_Base sender, Teleport.TeleportEventArgs args) { if (sender.IsAlly || sender.IsMe) { return; } teleport = args.Status; if (!(sender is AIHeroClient)) { return; } var unit = Recalls.Find(h => h.Unit.NetworkId == sender.NetworkId); if (unit == null || args.Type != TeleportType.Recall) { return; } switch (teleport) { case TeleportStatus.Start: { unit.Status = RecallStatus.Active; unit.Started = Game.Time; unit.Duration = (float)args.Duration / 1000; break; } case TeleportStatus.Abort: { unit.Status = RecallStatus.Abort; unit.Ended = Game.Time; if (Game.Time == unit.Ended) { Core.DelayAction(() => unit.Status = RecallStatus.Inactive, 2000); } break; } case TeleportStatus.Finish: { unit.Status = RecallStatus.Finished; unit.Ended = Game.Time; if (Game.Time == unit.Ended) { Core.DelayAction(() => unit.Status = RecallStatus.Inactive, 2000); } break; } } }
void Teleport_OnTeleport(Obj_AI_Base sender, Teleport.TeleportEventArgs args) { if (_hero == null || !_hero.IsValid || _hero.IsAlly) { return; } if (args.Type != TeleportType.Recall || !(sender is AIHeroClient)) { return; } if (sender.NetworkId == _hero.NetworkId) { switch (args.Status) { case TeleportStatus.Start: _begin = Game.Time; _duration = args.Duration; _active = true; break; case TeleportStatus.Finish: int colorIndex = (int)((_hero.HealthPercent / 100) * 255); string color = (255 - colorIndex).ToString("X2") + colorIndex.ToString("X2") + "00"; Program.Instance().Notify(_hero.ChampionName + " has recalled with <font color='#" + color + "'>" + (int)_hero.HealthPercent + "% HP</font>"); _active = false; break; case TeleportStatus.Abort: _active = false; break; case TeleportStatus.Unknown: Program.Instance().Notify(_hero.ChampionName + " is <font color='#ff3232'>unknown</font> (" + _hero.Spellbook.GetSpell(SpellSlot.Recall).Name + ")"); _active = false; break; } } }
/// <summary> /// Teleport the player to the designated coordinates. /// </summary> /// <param name="player"></param> /// <param name="destination"></param> protected override void OnTeleport(GamePlayer player, Teleport destination) { OnTeleportSpell(player, destination); }
public static void RunScript(string inputText) { var arr = inputText.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None); for (var i = 0; i < arr.Length; i++) { var s = arr[i]; var args = Regex .Split(String.Join(" ", s), "(?<=^[^\"]*(?:\"[^\"]*\"[^\"]*)*) (?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)") .Where(item => !string.IsNullOrEmpty(item)) .ToList(); if (args.Count < 1) { continue; } var cmd = args[0].Trim().ToLower(); args.RemoveAt(0); if (cmd.StartsWith("#") || cmd.StartsWith("//") || cmd == string.Empty) { continue; } switch (cmd) { case "spawn": Spawn.Run(args, i); break; case "roundlock": RoundSummary.RoundLock = true; break; case "detonate": ScriptActions.scriptData.detonate = true; break; case "teleport": Teleport.Run(args, i); break; case "createclass": CreateClass.Run(args, i); break; case "clearitems": ClearItems.Run(args, i); break; case "give": Give.Run(args, i); break; case "infect": Infect.Run(args, i); break; case "hp": HP.Run(args, i); break; case "scale": Scale.Run(args, i); break; case "disabledecontamination": DisableDecontamination.Run(args, i); break; case "last": Last.Run(args, i); break; case "cassie": TextCommand.Run(args, i, "cassie"); break; case "broadcast": TextCommand.Run(args, i, "broadcast"); break; case "hint": TextCommand.Run(args, i, "hint"); break; case "lights": Lights.Run(args, i); break; case "disabledetonation": DisableDetonation.Run(args, i); break; case "escape": Commands.Escape.Run(args, i); break; default: throw new InvalidCommandException("The command \"" + cmd + "\" on line " + i + " was not found."); } } }
void Awake() { S = this; Reset(); Toggle(false); r = GetComponent<Rigidbody2D>(); walk = gameObject.GetComponent<Walk>(); teleportAudio = GetComponent<AudioSource>(); teleportAudio.volume = 0.6f; dashIndicator = GameObject.Find("Dash Indicator"); poof = (GameObject)Resources.Load("Poof"); dashIndicator.SetActive(false); Events.Register<OnResetEvent>(Reset); Events.Register<OnDeathEvent>(Reset); Events.Register<OnPauseEvent>(Pause); }
/// <summary> /// Player has picked a subselection. /// </summary> /// <param name="player"></param> /// <param name="subSelection"></param> protected override void OnSubSelectionPicked(GamePlayer player, Teleport subSelection) { switch (subSelection.TeleportID.ToLower()) { case "oceanus": { string reply = string.Format( "I can transport you to the Haven of Oceanus in {0} {1}", "Oceanus [Hesperos], the mouth of [Cetus' Pit], or the heights of the great", "[Temple] of Sobekite Eternal."); SayTo(player, reply); return; } case "stygia": { string reply = string.Format( "Do you seek the sandy Haven of Stygia in the Stygian {0}", "[Delta] or the distant [Land of Atum]?"); SayTo(player, reply); return; } case "volcanus": { string reply = string.Format( "Do you wish to approach [Typhon's Reach] from the Haven {0} {1}", "of Volcanus or do you perhaps have more ambitious plans, such as attacking", "[Thusia Nesos], the Temple of [Apollo], [Vazul's Fortress], or the [Chimera] herself?"); SayTo(player, reply); return; } case "aerus": { string reply = string.Format( "Do you seek the Haven of Aerus outside [Green Glades] or {0}", "perhaps the Temple of [Talos]?"); SayTo(player, reply); return; } case "dungeons of atlantis": { string reply = string.Format( "I can provide access to [Sobekite Eternal], the {0} {1}", "Temple of [Twilight], the [Great Pyramid], the [Halls of Ma'ati], [Deep] within", "Volcanus, or even the [City] of Aerus."); SayTo(player, reply); return; } case "twilight": { string reply = string.Format( "Do you seek an audience with one of the great ladies {0} {1}", "of that dark temple? I'm sure that [Moirai], [Kepa], [Casta], [Laodameia], [Antioos],", "[Sinovia], or even [Medusa] would love to have you over for dinner."); SayTo(player, reply); return; } case "halls of ma'ati": { string reply = string.Format( "Which interests you, the [entrance], the [Anubite] side, {0} {1}", "or the [An-Uat] side? Or are you already ready to face your final fate in the", "[Chamber of Ammut]?"); SayTo(player, reply); return; } case "deep": { string reply = string.Format( "Do you wish to meet with the Mediators of the [southwest] {0} {1}", "or [northeast] hall, face [Katorii's] gaze, or are you foolish enough to battle the", "likes of [Typhon himself]?"); SayTo(player, reply); return; } case "city": { string reply = string.Format( "I can send you to the entrance near the [portal], the great {0} {1} {2}", "Unifier, [Lethos], the [ancient kings] remembered now only for their reputations, the", "famous teacher, [Nelos], the most well known and honored avriel, [Katri], or even", "the [Phoenix] itself."); SayTo(player, reply); return; } } base.OnSubSelectionPicked(player, subSelection); }
private static void Teleport_OnTeleport(Obj_AI_Base sender, Teleport.TeleportEventArgs args) { if (args.Type != TeleportType.Recall || !(sender is AIHeroClient) || sender.IsAlly && !sender.IsMe && !Menu["trackAllies"].Cast<CheckBox>().CurrentValue || sender.IsMe && !Menu["trackMe"].Cast<CheckBox>().CurrentValue) return; switch (args.Status) { case TeleportStatus.Abort: foreach (var source in Recalls.Where(a => a.Unit == sender)) { source.Abort(); } break; case TeleportStatus.Start: var recall = Recalls.FirstOrDefault(a => a.Unit == sender); if (recall != null) { Recalls.Remove(recall); } Recalls.Add(new Recall((AIHeroClient)sender, Environment.TickCount, Environment.TickCount + args.Duration, args.Duration)); break; } }
private void TeleportPLayer() { BuildPortals?.Invoke(); Teleport?.Invoke(); }
private void OnTeleport(Obj_AI_Base sender, Teleport.TeleportEventArgs args) { // Only check for enemy Heroes and recall teleports if (sender.Type == GameObjectType.AIHeroClient && sender.IsEnemy && args.Type == TeleportType.Recall) { switch (args.Status) { case TeleportStatus.Start: RecallingHeroes[sender.NetworkId] = new Tuple<int, int>(Core.GameTickCount, args.Duration); break; case TeleportStatus.Abort: RecallingHeroes.Remove(sender.NetworkId); break; case TeleportStatus.Finish: LastSeen[sender.NetworkId] = Core.GameTickCount; LastSeenPosition[sender.NetworkId] = EnemySpawnPoint; LastSeenRange[sender.NetworkId] = 0; RecallingHeroes.Remove(sender.NetworkId); break; } } }
/// <summary> /// Loads actions /// </summary> /// <param name="filename">Xml node</param> public void LoadActions(XmlNode xml) { if (xml == null || xml.Name.ToLower() != "actions") return; foreach (XmlNode node in xml) { if (node.NodeType == XmlNodeType.Comment) continue; switch (node.Name.ToLower()) { case "teleport": { Teleport teleport = new Teleport(); teleport.Load(node); Actions.Add(teleport); } break; case "giveexperience": { GiveExperience script = new GiveExperience(); script.Load(node); Actions.Add(script); } break; case "activate": { ActivateTarget script = new ActivateTarget(); script.Load(node); Actions.Add(script); } break; case "changepicture": { ChangePicture script = new ChangePicture(); script.Load(node); Actions.Add(script); } break; case "changetext": { ChangeText script = new ChangeText(); script.Load(node); Actions.Add(script); } break; case "deactivate": { DeactivateTarget script = new DeactivateTarget(); script.Load(node); Actions.Add(script); } break; case "disablechoice": { DisableChoice script = new DisableChoice(); script.Load(node); Actions.Add(script); } break; case "disable": { DisableTarget script = new DisableTarget(); script.Load(node); Actions.Add(script); } break; case "enablechoice": { EnableChoice script = new EnableChoice(); script.Load(node); Actions.Add(script); } break; case "endchoice": { EndChoice script = new EndChoice(); script.Load(node); Actions.Add(script); } break; case "enddialog": { EndDialog script = new EndDialog(); script.Load(node); Actions.Add(script); } break; case "giveitem": { GiveItem script = new GiveItem(); script.Load(node); Actions.Add(script); } break; case "healing": { Healing script = new Healing(); script.Load(node); Actions.Add(script); } break; case "joincharacter": { JoinCharacter script = new JoinCharacter(); script.Load(node); Actions.Add(script); } break; case "playsound": { PlaySound script = new PlaySound(); script.Load(node); Actions.Add(script); } break; case "toggle": { ToggleTarget script = new ToggleTarget(); script.Load(node); Actions.Add(script); } break; default: { Trace.WriteLine("[ScriptChoice] LoadActions() : Unknown node \"{0}\"", node.Name); } break; } } }
private static void Teleport_OnTeleport(Obj_AI_Base sender, Teleport.TeleportEventArgs args) { if (args.Status == TeleportStatus.Start && sender.IsEnemy) { Core.DelayAction(() => SpellManager.E.Cast(sender.Position), 500); } }
public Manejador(Account cuenta, Map mapa, CharacterClass personaje) { movimientos = new Movimiento(cuenta, mapa, personaje); recoleccion = new Recoleccion(cuenta, movimientos, mapa); teleport = new Teleport(cuenta, movimientos, mapa); }
public void GenerateNewMap(string seed) { portalScript = GameObject.Find ("StartPortal").GetComponent<Teleport> (); rand = new System.Random (seed.GetHashCode()); ChooseGameMode (); InitMap (); SpawnMap (); }
public static Item CreateItem(ushort itemId, byte count = 0) { Item newItem = null; ItemTemplate it = ItemManager.Templates[itemId]; if (it.Group == ItemGroups.Deprecated) { return(null); } if (it.IsStackable && count == 0) { count = 1; } if (it.Id != 0) { if (it.Type == ItemTypes.Depot) { newItem = new DepotLocker(itemId); } else if (it.Group.HasFlag(ItemGroups.Container)) { newItem = new Container(itemId); } else if (it.Type == ItemTypes.Teleport) { newItem = new Teleport(itemId); } else if (it.Type == ItemTypes.MagicField) { newItem = new MagicField(itemId); } else if (it.Type == ItemTypes.Door) { newItem = new Door(itemId); } else if (it.Type == ItemTypes.TrashHolder) { newItem = new TrashHolder(itemId); } else if (it.Type == ItemTypes.Mailbox) { newItem = new Mailbox(itemId); } else if (it.Type == ItemTypes.Bed) { newItem = new BedItem(itemId); } else if (it.Id >= 2210 && it.Id <= 2212) { newItem = new Item((ushort)(itemId - 3), count); } else if (it.Id == 2215 || it.Id == 2216) { newItem = new Item((ushort)(itemId - 2), count); } else if (it.Id >= 2202 && it.Id <= 2206) { newItem = new Item((ushort)(itemId - 37), count); } else if (it.Id == 2640) { newItem = new Item(6132, count); } else if (it.Id == 6301) { newItem = new Item(6300, count); } else if (it.Id == 18528) { newItem = new Item(18408, count); } else { newItem = new Item(itemId, count); } newItem.IncrementReferenceCounter(); } return(newItem); }
public void OnTeleport(Obj_AI_Base sender, Teleport.TeleportEventArgs args) { var unit = Recalls.Find(h => h.Unit.NetworkId == sender.NetworkId); if (unit == null || args.Type != TeleportType.Recall || unit.Unit.IsAlly) { return; } switch (args.Status) { case TeleportStatus.Start: { unit.Status = RecallStatus.Active; unit.Started = Game.Time; unit.TextPos = 0; unit.Duration = (float) args.Duration / 1000; break; } case TeleportStatus.Abort: { unit.Status = RecallStatus.Abort; unit.Ended = Game.Time; break; } case TeleportStatus.Finish: { unit.Status = RecallStatus.Finished; unit.Ended = Game.Time; break; } } }
private void SnipePredictionOnTeleport(Obj_AI_Base sender, Teleport.TeleportEventArgs args) { if (sender != target) return; float timeElapsed_ms = Core.GameTickCount - invisibleStartTime; if (DoesCollide().Any()) SnipeChance = HitChance.Collision; if (args.Status == TeleportStatus.Start) { float maxWalkDist = target.Position.Distance(lastRealPath.Last()); float moveSpeed = target.MoveSpeed; float normalTime_ms = maxWalkDist/moveSpeed*1000; /*target hasn't reached end point*/ if (timeElapsed_ms <= normalTime_ms) { SnipeChance = HitChance.High; } else if (timeElapsed_ms > normalTime_ms) /*target reached endPoint and is nearby*/ { float extraTimeElapsed = timeElapsed_ms - normalTime_ms; float targetSafeZoneTime = ultBoundingRadius/moveSpeed*1000; if (extraTimeElapsed < targetSafeZoneTime) { /*target has reached end point but is still in danger zone*/ SnipeChance = HitChance.Medium; } else { /*target too far away*/ SnipeChance = HitChance.Low; } } float realDist = moveSpeed*(timeElapsed_ms/1000); CastPosition = GetCastPosition(realDist); lastEstimatedPosition = CastPosition; } if (args.Status == TeleportStatus.Abort) { SnipeChance = HitChance.Impossible; CancelProcess(); } int minHitChance = Listing.snipeMenu.Get<Slider>("minSnipeHitChance").CurrentValue; int currentHitChanceInt = 0; if ((int) SnipeChance <= 2) currentHitChanceInt = 0; else if (SnipeChance == HitChance.Low) currentHitChanceInt = 1; else if (SnipeChance == HitChance.Medium) currentHitChanceInt = 2; else if (SnipeChance == HitChance.High) currentHitChanceInt = 3; if (currentHitChanceInt >= minHitChance) { if (Listing.snipeMenu.Get<CheckBox>("snipeDraw").CurrentValue) Drawing.OnDraw += OnDraw; CheckUltCast(args.Start + args.Duration); } else CancelProcess(); }
private void handleInvenClickItem(Player player, Packet packet) { int slot = packet.readLEShortA(); int item = packet.readShortA(); int childId = packet.readLEShort(); int interfaceId = packet.readLEShort(); if (slot > 28 || slot < 0 || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null) { return; } SkillHandler.resetAllSkills(player); if (player.getInventory().getItemInSlot(slot) == item) { player.getPackets().closeInterfaces(); if (Consumables.isEating(player, player.getInventory().getItemInSlot(slot), slot)) { return; } else if (Herblore.idHerb(player, player.getInventory().getItemInSlot(slot))) { return; } else if (RuneCraft.fillPouch(player, (RuneCraftData.POUCHES)player.getInventory().getItemInSlot(slot))) { return; } else if (Prayer.wantToBury(player, player.getInventory().getItemInSlot(slot), slot)) { return; } else if (Teleport.useTeletab(player, player.getInventory().getItemInSlot(slot), slot)) { return; } else if (FarmingAmulet.showOptions(player, player.getInventory().getItemInSlot(slot))) { return; } switch (item) { case 4155: // Slayer gem Slayer.doDialogue(player, 1051); break; case 6: // Dwarf multicannon if (player.getCannon() != null) { player.getPackets().sendMessage("You already have a cannon set up!"); break; } player.setCannon(new DwarfCannon(player)); break; case 5073: // Nest with seeds. case 5074: // Nest with jewellery. Woodcutting.randomNestItem(player, item); break; case 952: // Spade player.setLastAnimation(new Animation(830)); if (Barrows.enterCrypt(player)) { player.getPackets().sendMessage("You've broken into a crypt!"); break; } player.getPackets().sendMessage("You find nothing."); break; } } }
/// <summary> /// Talk to the NPC. /// </summary> /// <param name="source"></param> /// <param name="str"></param> /// <returns></returns> public override bool WhisperReceive(GameLiving source, string text) { if (!base.WhisperReceive(source, text) || !(source is GamePlayer)) { return(false); } GamePlayer player = source as GamePlayer; if ((text.ToLower() == "king" || text.ToLower() == "exit") && GlobalConstants.IsExpansionEnabled((int)eClientExpansion.DarknessRising)) { uint throneRegionID = 0; string teleportThroneID = "error"; string teleportExitID = "error"; switch (Realm) { case eRealm.Albion: throneRegionID = 394; teleportThroneID = "AlbThroneRoom"; teleportExitID = "AlbThroneExit"; break; case eRealm.Midgard: throneRegionID = 360; teleportThroneID = "MidThroneRoom"; teleportExitID = "MidThroneExit"; break; case eRealm.Hibernia: throneRegionID = 395; teleportThroneID = "HibThroneRoom"; teleportExitID = "HibThroneExit"; break; } if (throneRegionID == 0) { log.ErrorFormat("Can't find King for player {0} speaking to {1} of realm {2}!", player.Name, Name, Realm); player.Out.SendMessage("Server error, can't find throne room.", DOL.GS.PacketHandler.eChatType.CT_Staff, DOL.GS.PacketHandler.eChatLoc.CL_SystemWindow); return(false); } Teleport teleport = null; if (player.CurrentRegionID == throneRegionID) { teleport = GameServer.Database.SelectObjects <Teleport>("`TeleportID` = @TeleportID", new QueryParameter("@TeleportID", teleportExitID)).FirstOrDefault(); if (teleport == null) { log.ErrorFormat("Can't find throne room exit TeleportID {0}!", teleportExitID); player.Out.SendMessage("Server error, can't find exit to this throne room. Moving you to your last bind point.", DOL.GS.PacketHandler.eChatType.CT_Staff, DOL.GS.PacketHandler.eChatLoc.CL_SystemWindow); player.MoveToBind(); } } else { teleport = GameServer.Database.SelectObjects <Teleport>("`TeleportID` = @TeleportID", new QueryParameter("@TeleportID", teleportThroneID)).FirstOrDefault(); if (teleport == null) { log.ErrorFormat("Can't find throne room TeleportID {0}!", teleportThroneID); player.Out.SendMessage("Server error, can't find throne room teleport location.", DOL.GS.PacketHandler.eChatType.CT_Staff, DOL.GS.PacketHandler.eChatLoc.CL_SystemWindow); } } if (teleport != null) { SayTo(player, "Very well ..."); player.MoveTo((ushort)teleport.RegionID, teleport.X, teleport.Y, teleport.Z, (ushort)teleport.Heading); } return(true); } if (text.ToLower() == "do") { if (player.Inventory.CountItemTemplate("Personal_Bind_Recall_Stone", eInventorySlot.Min_Inv, eInventorySlot.Max_Inv) == 0) { SayTo(player, "Very well then. Here's your Personal Bind Recall Stone, may it serve you well."); player.ReceiveItem(this, "Personal_Bind_Recall_Stone"); } return(false); } return(true); }