Ejemplo n.º 1
0
    // Use this for initialization
    public GUIManager()
    {
        // Going to make the layout of the screen in 6s
        sizeDivisor = 6;

        manaInvasion = new ManaInvasion (Screen.width - Screen.width/sizeDivisor, 0, Screen.width/sizeDivisor,Screen.height/sizeDivisor);

        /*
        timeZone = "Future";
        loadCount = 0;

        width = 300;
        height = 120;
        loadTime = 5;
        x = 0;
        y = Screen.height-height;*/
        int height = 120;
        futureButton = new FutureButton("Future", 0, 300,  height, 5, 0, Screen.height - height);

        /*
        width = 100;
        height = 90;
        spacing = 10;*/
        rollingButton = new RollingButton (100,90,10);

        selectorOverlay = new SelectorOverlay();
        castSpell = new CastSpell();
        readyButton = new ReadyButton (Screen.width - Screen.width/sizeDivisor, Screen.height-Screen.height/sizeDivisor, Screen.width/sizeDivisor,Screen.height/sizeDivisor);
        infoWindow = new InfoWindow (Screen.width - Screen.width/sizeDivisor, Screen.height-Screen.height/sizeDivisor*3, Screen.width/sizeDivisor, Screen.height/sizeDivisor*2);
    }
Ejemplo n.º 2
0
        public DetourCastSpell()
        {
            try {

                CastSpellPointer = Memory.LOLBaseAddress+Offsets.CastSpell;

                CastSpellDelegate = (CastSpell)Marshal.GetDelegateForFunctionPointer(new IntPtr(CastSpellPointer), typeof(CastSpell));
                Memory.GetMagic.Detours.CreateAndApply(CastSpellDelegate,new CastSpell(this.castSpellDetour),"castSpell");

            } catch (Exception ex) {

                Frame.Log(ex.ToString());
            }
        }
Ejemplo n.º 3
0
 private IResponse TryCastSpell(CastSpell castSpell)
 {
     Assert.IsNotNull(castSpell);
     return(NotImplemented(castSpell, $"{castSpell}"));
 }
Ejemplo n.º 4
0
        void HandleCastSpell(CastSpell cast)
        {
            // ignore for remote control state (for player case)
            Unit mover = GetPlayer().m_unitMovedByMe;

            if (mover != GetPlayer() && mover.IsTypeId(TypeId.Player))
            {
                return;
            }

            SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(cast.Cast.SpellID);

            if (spellInfo == null)
            {
                Log.outError(LogFilter.Network, "WORLD: unknown spell id {0}", cast.Cast.SpellID);
                return;
            }

            if (spellInfo.IsPassive())
            {
                return;
            }

            Unit caster = mover;

            if (caster.IsTypeId(TypeId.Unit) && !caster.ToCreature().HasSpell(spellInfo.Id))
            {
                // If the vehicle creature does not have the spell but it allows the passenger to cast own spells
                // change caster to player and let him cast
                if (!GetPlayer().IsOnVehicle(caster) || spellInfo.CheckVehicle(GetPlayer()) != SpellCastResult.SpellCastOk)
                {
                    return;
                }

                caster = GetPlayer();
            }

            // check known spell or raid marker spell (which not requires player to know it)
            if (caster.IsTypeId(TypeId.Player) && !caster.ToPlayer().HasActiveSpell(spellInfo.Id) && !spellInfo.HasEffect(SpellEffectName.ChangeRaidMarker) && !spellInfo.HasAttribute(SpellAttr8.RaidMarker))
            {
                return;
            }

            // Check possible spell cast overrides
            spellInfo = caster.GetCastSpellInfo(spellInfo);

            // Client is resending autoshot cast opcode when other spell is casted during shoot rotation
            // Skip it to prevent "interrupt" message
            if (spellInfo.IsAutoRepeatRangedSpell() && GetPlayer().GetCurrentSpell(CurrentSpellTypes.AutoRepeat) != null &&
                GetPlayer().GetCurrentSpell(CurrentSpellTypes.AutoRepeat).m_spellInfo == spellInfo)
            {
                return;
            }

            // can't use our own spells when we're in possession of another unit,
            if (GetPlayer().isPossessing())
            {
                return;
            }

            // client provided targets
            SpellCastTargets targets = new SpellCastTargets(caster, cast.Cast);

            // auto-selection buff level base at target level (in spellInfo)
            if (targets.GetUnitTarget() != null)
            {
                SpellInfo actualSpellInfo = spellInfo.GetAuraRankForLevel(targets.GetUnitTarget().getLevel());

                // if rank not found then function return NULL but in explicit cast case original spell can be casted and later failed with appropriate error message
                if (actualSpellInfo != null)
                {
                    spellInfo = actualSpellInfo;
                }
            }

            if (cast.Cast.MoveUpdate.HasValue)
            {
                HandleMovementOpcode(ClientOpcodes.MoveStop, cast.Cast.MoveUpdate.Value);
            }

            Spell spell = new Spell(caster, spellInfo, TriggerCastFlags.None, ObjectGuid.Empty, false);

            SpellPrepare spellPrepare = new SpellPrepare();

            spellPrepare.ClientCastID = cast.Cast.CastID;
            spellPrepare.ServerCastID = spell.m_castId;
            SendPacket(spellPrepare);

            spell.m_fromClient = true;
            spell.m_misc.Data0 = cast.Cast.Misc[0];
            spell.m_misc.Data1 = cast.Cast.Misc[1];
            spell.prepare(targets);
        }
Ejemplo n.º 5
0
 private void OnCastSpell(CastSpell spell)
 {
     SpellsCast.Add(spell);
 }
Ejemplo n.º 6
0
    public void WeaponAttack()
    {
        if (spellSlot1rdy == true && player_.DieOnce == false)
        {
            switch (CurrentWeapon)
            {
            case 0:
                spellSlotCD = 0.5f;
                break;


            case 1:
                WeaponSpider spell = Weapons[CurrentWeapon].GetComponent <WeaponSpider>();
                spellSlotCD = spell.cooldown;
                GameObject spider1 = Instantiate(spell.ItemObject, transform.position, transform.rotation, transform);
                GameObject spider2 = Instantiate(spell.ItemObject, transform.position, transform.rotation, transform);

                spider1.transform.position += spider1.transform.right * 2;
                spider2.transform.position += spider2.transform.right * -2;

                spider1.transform.parent = null;
                spider2.transform.parent = null;

                break;

            case 2:
                Blink      spell2 = Weapons[CurrentWeapon].GetComponent <Blink>();
                Ray        ray    = Camera.main.ScreenPointToRay(Input.mousePosition);
                RaycastHit hit;
                if (Physics.Raycast(ray, out hit) && hit.collider.gameObject.tag == "Floor" || hit.collider.gameObject.tag == "Monster" || hit.collider.gameObject.tag == "Token" || hit.collider.gameObject.tag == "Door")
                {
                    TelePortDoor = false;
                    Tele1Effect  = Instantiate(TelePortEffect, Player1.transform.position, Player1.transform.rotation);
                    Tele1Effect.transform.parent = Player1.transform;

                    ParticleSystem Tele1Effect2 = Instantiate(TelePortEffect, hit.point, Player1.transform.rotation);
                    TeleLoc = hit.point;
                    Destroy(Tele1Effect.transform.gameObject, 3.1f);
                    Destroy(Tele1Effect2.transform.gameObject, 3.1f);

                    Invoke("TelePortPlayer", 1f);
                    spellSlotCD = spell2.cooldown;
                }
                else
                {
                    spellSlotCD = 0.5f;
                }
                break;

            case 3:
                Blink      spell3 = Weapons[CurrentWeapon].GetComponent <Blink>();
                Ray        ray2   = Camera.main.ScreenPointToRay(Input.mousePosition);
                RaycastHit hit2;
                if (Physics.Raycast(ray2, out hit2))
                {
                    // Code Here.
                    Vector3 Pos = new Vector3(Player1.transform.position.x, 1.5f, Player1.transform.position.z);
                    Player1.transform.LookAt(hit2.point);
                    GameObject PoolObj = Instantiate(spell3.ItemObject, Pos + Player1.transform.forward * 4, transform.rotation, transform);
                    PoolObj.transform.parent     = null;
                    PoolObj.transform.localScale = new Vector3(1, 1, 1);
                    PoolObj.GetComponent <BigBoyFire>().PoolNumb      = 10;
                    PoolObj.GetComponent <BigBoyFire>().PlayerCasting = true;
                    PoolObj.GetComponent <BigBoyFire>().duration      = 3f;
                    PoolObj.GetComponent <BigBoyFire>().damage        = 1f;

                    spellSlotCD = spell3.cooldown;
                }
                else
                {
                    spellSlotCD = 0.5f;
                }
                break;

            case 4:
                Blink spell4 = Weapons[CurrentWeapon].GetComponent <Blink>();
                // Code Here.
                float OrbFacing   = transform.rotation.eulerAngles.x;
                float attackTimer = 0;
                for (int i = 0; i < 5; i++)
                {
                    GameObject P1 = Instantiate(spell4.ItemObject, transform);
                    player_.SpellsCastInThisRoom.Add(P1);
                    P1.transform.Rotate(0, OrbFacing, 0);
                    P1.transform.position = new Vector3(transform.position.x, 3, transform.position.z) + P1.transform.forward * 1.5f;
                    P1.GetComponent <OldKingAttack3>().FloatUpTimer += attackTimer;
                    P1.GetComponent <OldKingAttack3>().damage        = 1;
                    P1.GetComponent <OldKingAttack3>().PlayerCast    = true;
                    OrbFacing   += 72;   //360/5
                    attackTimer += 0.2f;
                }
                spellSlotCD = spell4.cooldown;
                break;

            case 5:
                Blink spell5 = Weapons[CurrentWeapon].GetComponent <Blink>();
                player_.BlobWeaponEquppied = true;
                player_.W5.SetActive(true);
                player_.BlobWeaponObject = spell5.ItemObject;
                spellSlotCD = spell5.cooldown;
                break;

            case 6:
                Blink spell6 = Weapons[CurrentWeapon].GetComponent <Blink>();
                player_.TimeStaffCDS();
                player_.ResetCDVis(spell6.ItemObject);
                spellSlotCD = spell6.cooldown;
                break;

            case 7:
                Blink      spell7    = Weapons[CurrentWeapon].GetComponent <Blink>();
                Collider[] cols      = Physics.OverlapSphere(transform.position, 35);
                bool       AnySpells = false;
                foreach (Collider c in cols)
                {
                    Monster e = c.GetComponent <Monster>();
                    if (e != null && e.tag == "Monster")
                    {
                        AnySpells = true;
                        //Monster enemy = e.GetComponent<Monster>();
                        GameObject      test123     = Instantiate(spell7.ItemObject, transform.position, transform.rotation, transform);
                        SpellProjectile Frostmeteor = test123.GetComponent <SpellProjectile>();
                        Frostmeteor.projectilespeed    = 30;
                        Frostmeteor.damage             = 1;
                        Frostmeteor.FrostBoltSlow      = true;
                        Frostmeteor.SlowDuration       = 3f;
                        Frostmeteor.SlowPercent        = 1.4f;
                        Frostmeteor.aoeSizeMeteor      = 3f;
                        Frostmeteor.FrostStaff         = true;
                        Frostmeteor.spellCastLocation  = e.transform.position;
                        Frostmeteor.transform.position = new Vector3(transform.position.x, 20, transform.position.z);
                        player_.SpellsCastInThisRoom.Add(test123);
                    }
                }

                if (!AnySpells)
                {
                    GameObject      test12345   = Instantiate(spell7.ItemObject, transform.position, transform.rotation, transform);
                    SpellProjectile Frostmeteor = test12345.GetComponent <SpellProjectile>();
                    Frostmeteor.projectilespeed    = 15;
                    Frostmeteor.damage             = 1;
                    Frostmeteor.FrostBoltSlow      = true;
                    Frostmeteor.SlowDuration       = 3f;
                    Frostmeteor.SlowPercent        = 1.4f;
                    Frostmeteor.aoeSizeMeteor      = 3f;
                    Frostmeteor.FrostStaff         = true;
                    Frostmeteor.spellCastLocation  = transform.position;
                    Frostmeteor.transform.position = new Vector3(transform.position.x, 20, transform.position.z);
                    player_.SpellsCastInThisRoom.Add(test12345);
                }

                spellSlotCD = spell7.cooldown;
                break;

            case 8:
                Blink spell8 = Weapons[CurrentWeapon].GetComponent <Blink>();

                GameObject test1234 = Instantiate(spell8.ItemObject, transform.position, transform.rotation, transform);

                test1234.transform.parent = null;
                Destroy(test1234, 1f);

                Collider[] cols2 = Physics.OverlapSphere(transform.position, 10);
                foreach (Collider c in cols2)
                {
                    Monster e = c.GetComponent <Monster>();
                    if (e != null && e.tag == "Monster")
                    {
                        Monster enemy = e.GetComponent <Monster>();
                        enemy.Slow(true, 2, 1.25f);
                        Vector3 directionF = (enemy.transform.position - transform.position).normalized;
                        enemy.CancelInvoke("StopPush");
                        enemy.TakeDamage(1);
                        enemy.pushDir = directionF;
                        enemy.pushed  = true;
                    }
                }
                spellSlotCD = spell8.cooldown;
                break;

            case 9:
                // Blink spell9 = Weapons[CurrentWeapon].GetComponent<Blink>();

                Spellbook SB_ = FindObjectOfType <Spellbook>();
                CastSpell CS_ = FindObjectOfType <CastSpell>();

                int curS = CastSpell.FindObjectOfType <CastSpell>().currentSlot;
                CS_.MadWeapon = true;
                SB_.LeveloneSpell(Random.Range(1, 4));
                SB_.LeveltwoSpell(Random.Range(0, 4));
                SB_.LevelthreeSpell(Random.Range(0, 5));
                SB_.LevelfourSpell(Random.Range(0, 4));
                SB_.LevelfiveSpell(Random.Range(0, 4));
                SB_.LevelsixSpell(Random.Range(0, 6));



                Ray        ray3 = Camera.main.ScreenPointToRay(Input.mousePosition);
                RaycastHit hit3;
                if (Physics.Raycast(ray3, out hit3))
                {
                    CS_.spellCastLocation = hit3.point;
                    Vector3    targetPosition = hit3.point;
                    Vector3    direction      = (targetPosition - Player1.transform.position).normalized;
                    Quaternion lookRotation   = Quaternion.LookRotation(new Vector3(direction.x, 0, direction.z));      // flattens the vector3
                    Player1.transform.rotation = Quaternion.Slerp(transform.rotation, lookRotation, Time.deltaTime * 999f);
                }
                CS_.CastCurrentSpell();
                CS_.MadWeapon = false;

                switch (curS)
                {
                case 1:
                    SB_.SlotOne();
                    break;

                case 2:
                    SB_.SlotTwo();
                    break;

                case 3:
                    SB_.SlotThree();
                    break;
                }

                // spellSlotCD = spell9.cooldown;
                break;
            }
            CD1  = spellSlotCD;
            CD1_ = spellSlotCD;
        }
    }