protected override void Start() { trigger = triggerObj.GetComponent <AreaTrigger>(); trigger.playerEntered += Trigger_playerEntered; agro = false; base.Start(); }
public static void RegisterEvents() { var standEntry = GOMgr.GetEntry(SilverwingFlagStandId) as GOFlagStandEntry; standEntry.Side = BattlegroundSide.Alliance; var droppedEntry = GOMgr.GetEntry(SilverwingFlagId) as GOFlagDropEntry; droppedEntry.Side = BattlegroundSide.Alliance; standEntry = GOMgr.GetEntry(WarsongClanFlagStandId) as GOFlagStandEntry; standEntry.Side = BattlegroundSide.Horde; droppedEntry = GOMgr.GetEntry(WarsongFlagId) as GOFlagDropEntry; droppedEntry.Side = BattlegroundSide.Horde; // register AreaTrigger capture events AreaTrigger hordeFlagAT = AreaTriggerMgr.GetTrigger(AreaTriggerId.WarsongGulchHordeFlagSpawn); AreaTrigger allianceFlagAT = AreaTriggerMgr.GetTrigger(AreaTriggerId.WarsongGulchAllianceFlagSpawn); hordeFlagAT.Triggered += HordeCaptureTriggered; allianceFlagAT.Triggered += AllianceCaptureTriggered; GOMgr.GetEntry(WarsongClanFlagStandId).Used += HandleFlagStandUsed; GOMgr.GetEntry(SilverwingFlagStandId).Used += HandleFlagStandUsed; GOMgr.GetEntry(WarsongFlagId).Used += HandleDroppedFlagUsed; GOMgr.GetEntry(SilverwingFlagId).Used += HandleDroppedFlagUsed; }
public void ExitAreaTrigger(AreaTrigger trigger) { if (!areaTriggers.Contains(trigger)) { return; } if (areaTriggers.Count > 1) { if (trigger.alwaysExitActions) { trigger.OnAreaExit(this); } areaTriggers.Remove(trigger); if (trigger != areaTriggers[areaTriggers.Count - 1]) { areaTriggers[areaTriggers.Count - 1].OnAreaEnter(this); } } else { trigger.OnAreaExit(this); areaTriggers.Remove(trigger); } }
// Update is called once per frame void Update() { i += Time.deltaTime; if ((int)i == 5) { timer++; foodEated--; i = 0; txt.text = timer.ToString(); } if (foodEated == 0) { Destroy(gameObject); } if (timer % 5 == 0 && temp == 0 && timer != 0 && timer != 1) { GameObject thePlayer = gameObject; AreaTrigger playerScript = thePlayer.GetComponent <AreaTrigger>(); playerScript.GeneraCibo(); temp = 1; } if (timer % 5 != 0) { temp = 0; } }
// Start is called before the first frame update void Start() { trigger = triggerObj.GetComponent <AreaTrigger>(); trigger.areaClear += Trigger_areaClear; trigger.playerEntered += Trigger_playerEntered; transform.localScale = Vector3.zero; }
private void RegisterEvents() { AreaTrigger blacksmithAT = AreaTriggerMgr.GetTrigger(AreaTriggerId.ArathiBasinBlackSmith); AreaTrigger stablesAT = AreaTriggerMgr.GetTrigger(AreaTriggerId.ArathiBasinStables); AreaTrigger farmAT = AreaTriggerMgr.GetTrigger(AreaTriggerId.ArathiBasinFarm); AreaTrigger lumberMillAT = AreaTriggerMgr.GetTrigger(AreaTriggerId.ArathiBasinLumberMill); AreaTrigger goldMineAT = AreaTriggerMgr.GetTrigger(AreaTriggerId.ArathiBasinGoldMine); }
static void OnObservanceHallTriggered(AreaTrigger at, Character chr) { var instance = chr.Map as UtgardePinnacle; if (instance != null && !instance.m_EncounterStarted) { instance.StartEncounter(); } }
void HandleEffectPeriodic(AuraEffect aurEff) { AreaTrigger at = GetTarget().GetAreaTrigger(SpellIds.Consecration); if (at != null) { GetTarget().CastSpell(at.GetPosition(), SpellIds.ConsecrationDamage, new CastSpellExtraArgs()); } }
// Use this for initialization void Start() { //Assigning in AreaTriggers for (int k = 0; k < numOfBricks; k++) { bricksTrigger[k] = BricksParent[k].GetComponent<AreaTrigger>(); } tableBrickTrigger = TableBrickParent.GetComponent<AreaTrigger>(); }
public static void HandleAreaTriggerOpcode(ref PacketReader packet, ref WorldManager manager) { uint triggerID = packet.ReadUInt32(); if (Database.AreaTriggers.ContainsKey(triggerID)) { AreaTrigger a = Database.AreaTriggers.TryGet(triggerID); manager.Character.Teleport(a.Map, a.GetQuaternion()); } }
public void EnterAreaTrigger(AreaTrigger trigger) { if (areaTriggers.Contains(trigger)) { areaTriggers.Add(trigger); return; } areaTriggers.Add(trigger); trigger.OnAreaEnter(this); }
public void NotifyCollisionEnter(AreaTrigger trigger) { ++CollisionsThisFrame; if (TimeBetweenCollisions > 0f) { CollisionTimer = TimeBetweenCollisions; } OnHitboxEnter(trigger); }
public AreaTrigger BuildAreaTrigger(DataRow row) { var areaTrigger = new AreaTrigger(); areaTrigger.id = row["m_id"] != DBNull.Value ? CustomConverter.ToInt32(row["m_id"]) : -1; areaTrigger.map_id = row["m_mapId"] != DBNull.Value ? CustomConverter.ToInt32(row["m_mapId"]) : 0; areaTrigger.posX = row["m_posX"] != DBNull.Value ? (double)row["m_posX"] : 0; areaTrigger.posY = row["m_posY"] != DBNull.Value ? (double)row["m_posY"] : 0; areaTrigger.posZ = row["m_posZ"] != DBNull.Value ? (double)row["m_posZ"] : 0; return(areaTrigger); }
public override AreaTriggerAI GetAI(AreaTrigger me) { if (me.GetInstanceScript() != null) { return(GetInstanceAI <AI>(me)); } else { return((AI)Activator.CreateInstance(typeof(AI), new object[] { me }.Combine(_args))); } }
private void AddActionsFromAreaTrigger(DictionaryView <string, AGE.Action> actions) { AreaTrigger[] triggerArray = UnityEngine.Object.FindObjectsOfType <AreaTrigger>(); if ((triggerArray != null) && (triggerArray.Length != 0)) { for (int i = 0; i < triggerArray.Length; i++) { AreaTrigger trigger = triggerArray[i]; this.AddActionsFromSkillCombine(actions, trigger.BuffID); this.AddActionsFromSkillCombine(actions, trigger.UpdateBuffID); } } }
public void BuildAreaTrigger(ref ActorPreloadTab loadInfo) { AreaTrigger[] triggerArray = UnityEngine.Object.FindObjectsOfType <AreaTrigger>(); if ((triggerArray != null) && (triggerArray.Length != 0)) { for (int i = 0; i < triggerArray.Length; i++) { AreaTrigger trigger = triggerArray[i]; this.AnalyseSkillCombine(ref loadInfo, trigger.BuffID); this.AnalyseSkillCombine(ref loadInfo, trigger.UpdateBuffID); this.AnalyseSkillCombine(ref loadInfo, trigger.LeaveBuffID); } } }
private void AddActionsFromAreaTrigger(DictionaryView <string, Action> actions) { AreaTrigger[] array = Object.FindObjectsOfType <AreaTrigger>(); if (array == null || array.Length == 0) { return; } for (int i = 0; i < array.Length; i++) { AreaTrigger areaTrigger = array[i]; this.AddActionsFromSkillCombine(actions, areaTrigger.BuffID); this.AddActionsFromSkillCombine(actions, areaTrigger.UpdateBuffID); } }
public void BuildAreaTrigger(ref ActorPreloadTab loadInfo) { AreaTrigger[] array = Object.FindObjectsOfType <AreaTrigger>(); if (array == null || array.Length == 0) { return; } for (int i = 0; i < array.Length; i++) { AreaTrigger areaTrigger = array[i]; this.AnalyseSkillCombine(ref loadInfo, areaTrigger.BuffID); this.AnalyseSkillCombine(ref loadInfo, areaTrigger.UpdateBuffID); this.AnalyseSkillCombine(ref loadInfo, areaTrigger.LeaveBuffID); } }
public AreaTrigger BuildAreaTrigger(DataRow row) { var areaTrigger = new AreaTrigger(); areaTrigger.id = row["m_id"] != DBNull.Value ? XConverter.ToInt32(row["m_id"]) : -1; areaTrigger.map_id = row["m_mapId"] != DBNull.Value ? XConverter.ToInt32(row["m_mapId"]) : 0; areaTrigger.posX = row["m_posX"] != DBNull.Value ? (double)row["m_posX"] : 0; areaTrigger.posY = row["m_posY"] != DBNull.Value ? (double)row["m_posY"] : 0; areaTrigger.posZ = row["m_posZ"] != DBNull.Value ? (double)row["m_posZ"] : 0; areaTrigger.field5 = row["field5"] != DBNull.Value ? (int)row["field5"] : 0; areaTrigger.field6 = row["field6"] != DBNull.Value ? (int)row["field6"] : 0; areaTrigger.field7 = row["field7"] != DBNull.Value ? (int)row["field7"] : 0; areaTrigger.field8 = row["field8"] != DBNull.Value ? (double)row["field8"] : 0; areaTrigger.field9 = row["field9"] != DBNull.Value ? (double)row["field9"] : 0; return(areaTrigger); }
/// <summary> /// Somebody stepped on the Alliance capture areatrigger /// </summary> /// <param name="at"></param> /// <param name="chr"></param> private static void AllianceCaptureTriggered(AreaTrigger at, Character chr) { // Check whether the battle has started and the Character is actively participating BattlegroundTeam team = chr.Battlegrounds.Team; var wsg = chr.Map as WarsongGulch; if (team != null && wsg != null && wsg.IsActive) { if (team.Side == BattlegroundSide.Alliance) { if (wsg.WarsongClan.FlagCarrier == chr && wsg.Silverwing.IsFlagHome) { wsg.WarsongClan.CaptureFlag(chr); } } } }
public static void HandleAreaTrigger(IRealmClient client, RealmPacketIn packet) { uint id = packet.ReadUInt32(); Character activeCharacter = client.ActiveCharacter; if (!activeCharacter.IsAlive) { return; } AreaTrigger trigger = AreaTriggerMgr.GetTrigger(id); if (trigger == null) { return; } trigger.Trigger(activeCharacter); }
/// <summary> /// Register's the powerup AT triggers to cast the spell and remove the GO. /// </summary> private void RegisterPowerupEvents() { AreaTrigger allianceBerserker = AreaTriggerMgr.GetTrigger(AreaTriggerId.WarsongGulchAllianceElexirOfBerserkSpawn); AreaTrigger allianceFood = AreaTriggerMgr.GetTrigger(AreaTriggerId.WarsongGulchAllianceElexirOfRegenerationSpawn); AreaTrigger allianceSpeed = AreaTriggerMgr.GetTrigger(AreaTriggerId.WarsongGulchAllianceElexirOfSpeedSpawn); AreaTrigger hordeBerserker = AreaTriggerMgr.GetTrigger(AreaTriggerId.WarsongGulchHordeElexirOfBerserkSpawn); AreaTrigger hordeFood = AreaTriggerMgr.GetTrigger(AreaTriggerId.WarsongGulchHordeElexirOfRegenerationSpawn); AreaTrigger hordeSpeed = AreaTriggerMgr.GetTrigger(AreaTriggerId.WarsongGulchHordeElexirOfSpeedSpawn); allianceBerserker.Triggered += (at, unit) => HandlePowerUp(unit, SpellId.None, _allianceBerserkerBuff, SpawnAllianceBerserkerBuff); allianceFood.Triggered += (at, unit) => HandlePowerUp(unit, SpellId.None, _allianceFoodBuff, SpawnAllianceFoodBuff); allianceSpeed.Triggered += (at, unit) => HandlePowerUp(unit, SpellId.Speed_5, _allianceSpeedBuff, SpawnAllianceSpeedBuff); hordeBerserker.Triggered += (at, unit) => HandlePowerUp(unit, SpellId.None, _hordeBerserkerBuff, SpawnHordeBerserkerBuff); hordeFood.Triggered += (at, unit) => HandlePowerUp(unit, SpellId.None, _hordeFoodBuff, SpawnHordeFoodBuff); hordeSpeed.Triggered += (at, unit) => HandlePowerUp(unit, SpellId.Speed_5, _hordeSpeedBuff, SpawnHordeSpeedBuff); }
public static int loadAreaTriggers(string mapIdentifier) { if (!Constants.VFSSkip) { vfsDataProvider.Instance.unpackFromVFS("data\\map" + mapIdentifier + "\\map" + mapIdentifier + ".bin", "data\\maps\\map" + mapIdentifier + ".bin"); } if (!File.Exists(AppDomain.CurrentDomain.BaseDirectory + "data/maps/map" + mapIdentifier + ".bin")) { return(0); } int areaTrigger_counts = 0; int mapID = Convert.ToInt32(mapIdentifier); byte[] data = File.ReadAllBytes(AppDomain.CurrentDomain.BaseDirectory + "data/maps/map" + mapIdentifier + ".bin"); for (int i = 0; i < 12; i++) { if (BitConverter.ToSingle(data, 8 + (i * 8)) == 0 && 0 == BitConverter.ToSingle(data, 12 + (i * 8))) { continue; } AreaTrigger areaTrigger = new AreaTrigger(); areaTrigger.setFromPosition(new float[] { BitConverter.ToSingle(data, 8 + (i * 8)), BitConverter.ToSingle(data, 12 + (i * 8)) }); areaTrigger.setfMap((short)mapID); areaTrigger.setToPosition(new float[] { BitConverter.ToSingle(data, 200 + (i * 8)), BitConverter.ToSingle(data, 204 + (i * 8)) }); areaTrigger.settMap(BitConverter.ToInt16(data, 136 + (i * 4))); areaTrigger.setRequiredItem( (areaTrigger.getFromPosition()[0] == -1567 && areaTrigger.getFromPosition()[1] == 1991 && areaTrigger.gettMap() == 3) ? (213062201) : (areaTrigger.getFromPosition()[0] == -1634 && areaTrigger.getFromPosition()[1] == 3050 && areaTrigger.gettMap() == 3) ? (213062200) : (0)); // damn koreanz WMap.Instance.getGrid(mapID).getAreaByRound(areaTrigger.getFromPosition()[0], areaTrigger.getFromPosition()[1]).addAreaTrigger(areaTrigger); areaTrigger_counts++; } return(areaTrigger_counts); }
// Update is called once per frame void Update() { GameObject thePlayer = gameObject; AreaTrigger playerScript = thePlayer.GetComponent <AreaTrigger>(); obj = playerScript.ParameterPass; try { if (Vector3.Distance(transform.position, obj.transform.position) < 5f) { target = obj.transform; float step = speed * Time.deltaTime; transform.position = Vector3.MoveTowards(transform.position, target.position, step); } else { float step = speedWalk * Time.deltaTime; transform.position = Vector3.MoveTowards(transform.position, posizione, step); if ((int)transform.position.x == (int)posizione.x && (int)transform.position.z == (int)posizione.z) { posizione = new Vector3(Random.Range(-24.0f, 24.0f), 0.5f, Random.Range(-24.0f, 24.0f)); } } } catch (System.Exception) { float step = speedWalk * Time.deltaTime; transform.position = Vector3.MoveTowards(transform.position, posizione, step); if ((int)transform.position.x == (int)posizione.x && (int)transform.position.z == (int)posizione.z) { posizione = new Vector3(Random.Range(-24.0f, 24.0f), 0.5f, Random.Range(-24.0f, 24.0f)); } return; } }
public areatrigger_stormwind_teleport_unit(AreaTrigger areatrigger) : base(areatrigger) { }
public override AreaTriggerAI GetAI(AreaTrigger areaTrigger) { return(new SmartAreaTriggerAI(areaTrigger)); }
public virtual void JustUnregisteredAreaTrigger(AreaTrigger areaTrigger) { }
// Called when a AreaTriggerAI object is needed for the areatrigger. public virtual AreaTriggerAI GetAI(AreaTrigger at) { return(null); }
public override AreaTriggerAI GetAI(AreaTrigger areatrigger) { return(new areatrigger_pri_angelic_featherAI(areatrigger)); }
public areatrigger_pri_angelic_featherAI(AreaTrigger areatrigger) : base(areatrigger) { }
public NullAreaTriggerAI(AreaTrigger areaTrigger) : base(areaTrigger) { }
void Start() { //heldHammer.SetActive(false); hammerAreaTrig = HammerRegion.GetComponent<AreaTrigger>(); }