Inheritance: MonoBehaviour
コード例 #1
0
ファイル: BowmanGuard.cs プロジェクト: theLionCount/KingPOC
 protected override void Start()
 {
     trigger = triggerObj.GetComponent <AreaTrigger>();
     trigger.playerEntered += Trigger_playerEntered;
     agro = false;
     base.Start();
 }
コード例 #2
0
ファイル: WarsongGulch.cs プロジェクト: NecroSharper/WCell
        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;
        }
コード例 #3
0
ファイル: Entity.cs プロジェクト: Wizerdy/Wild
    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);
        }
    }
コード例 #4
0
 // 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;
     }
 }
コード例 #5
0
ファイル: DungeonDoor.cs プロジェクト: theLionCount/KingPOC
 // 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;
 }
コード例 #6
0
 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);
 }
コード例 #7
0
        static void OnObservanceHallTriggered(AreaTrigger at, Character chr)
        {
            var instance = chr.Map as UtgardePinnacle;

            if (instance != null && !instance.m_EncounterStarted)
            {
                instance.StartEncounter();
            }
        }
コード例 #8
0
ファイル: Paladin.cs プロジェクト: lyosky/CypherCore
        void HandleEffectPeriodic(AuraEffect aurEff)
        {
            AreaTrigger at = GetTarget().GetAreaTrigger(SpellIds.Consecration);

            if (at != null)
            {
                GetTarget().CastSpell(at.GetPosition(), SpellIds.ConsecrationDamage, new CastSpellExtraArgs());
            }
        }
コード例 #9
0
ファイル: BrickLayer.cs プロジェクト: ma581/Scripts
 // 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>();
 }
コード例 #10
0
        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());
            }
        }
コード例 #11
0
ファイル: Entity.cs プロジェクト: Wizerdy/Wild
    public void EnterAreaTrigger(AreaTrigger trigger)
    {
        if (areaTriggers.Contains(trigger))
        {
            areaTriggers.Add(trigger); return;
        }
        areaTriggers.Add(trigger);

        trigger.OnAreaEnter(this);
    }
コード例 #12
0
ファイル: Hitbox.cs プロジェクト: ubla/Sonic-Realms
        public void NotifyCollisionEnter(AreaTrigger trigger)
        {
            ++CollisionsThisFrame;
            if (TimeBetweenCollisions > 0f)
            {
                CollisionTimer = TimeBetweenCollisions;
            }

            OnHitboxEnter(trigger);
        }
コード例 #13
0
        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);
        }
コード例 #14
0
ファイル: CoreScripts.cs プロジェクト: lyosky/CypherCore
 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)));
     }
 }
コード例 #15
0
 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);
         }
     }
 }
コード例 #16
0
 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);
         }
     }
 }
コード例 #17
0
 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);
     }
 }
コード例 #18
0
 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);
     }
 }
コード例 #19
0
ファイル: SQLiteDatabase.cs プロジェクト: GlassFace/OpenTools
        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);
        }
コード例 #20
0
ファイル: WarsongGulch.cs プロジェクト: NecroSharper/WCell
        /// <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);
                    }
                }
            }
        }
コード例 #21
0
        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);
        }
コード例 #22
0
ファイル: WarsongGulch.cs プロジェクト: NecroSharper/WCell
        /// <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);
        }
コード例 #23
0
        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);
        }
コード例 #24
0
    // 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;
        }
    }
コード例 #25
0
ファイル: AreaTrigger.cs プロジェクト: lyosky/CypherCore
 public areatrigger_stormwind_teleport_unit(AreaTrigger areatrigger) : base(areatrigger)
 {
 }
コード例 #26
0
ファイル: SmartAI.cs プロジェクト: aufbau1/CypherCore
 public override AreaTriggerAI GetAI(AreaTrigger areaTrigger)
 {
     return(new SmartAreaTriggerAI(areaTrigger));
 }
コード例 #27
0
 public virtual void JustUnregisteredAreaTrigger(AreaTrigger areaTrigger)
 {
 }
コード例 #28
0
ファイル: CoreScripts.cs プロジェクト: zgbjmy2009/CypherCore
 // Called when a AreaTriggerAI object is needed for the areatrigger.
 public virtual AreaTriggerAI GetAI(AreaTrigger at)
 {
     return(null);
 }
コード例 #29
0
 public override AreaTriggerAI GetAI(AreaTrigger areatrigger)
 {
     return(new areatrigger_pri_angelic_featherAI(areatrigger));
 }
コード例 #30
0
 public areatrigger_pri_angelic_featherAI(AreaTrigger areatrigger) : base(areatrigger)
 {
 }
コード例 #31
0
ファイル: AreaTriggerAI.cs プロジェクト: spadd/CypherCore
 public NullAreaTriggerAI(AreaTrigger areaTrigger) : base(areaTrigger)
 {
 }
コード例 #32
0
ファイル: PickUpJoint.cs プロジェクト: ma581/Scripts
 void Start()
 {
     //heldHammer.SetActive(false);
     hammerAreaTrig = HammerRegion.GetComponent<AreaTrigger>();
 }