Ejemplo n.º 1
0
        private void Game_OnGameUpdate(EventArgs args)
        {
            if (false)
            {
                return;
            }
            Bushes.RemoveAll(b => !b.isValid());
            switch (orbwalker.ActiveMode)
            {
            case Orbwalking.OrbwalkingMode.Combo:
                Combo();
                break;

            case Orbwalking.OrbwalkingMode.Mixed:
                Harass();
                break;

            case Orbwalking.OrbwalkingMode.LaneClear:
                Clear();
                break;

            case Orbwalking.OrbwalkingMode.LastHit:
                break;

            default:
                break;
            }
            if (IvernPet && R.IsReady())
            {
                PetHandler.MovePet(config, orbwalker.ActiveMode);
            }
        }
Ejemplo n.º 2
0
        public void Possess(int duration, Unit target, bool controllable = true, bool sendPetActionsWithSpells = true)
        {
            if (target == null)
            {
                return;
            }
            if (target is NPC)
            {
                Enslave((NPC)target, duration);
                target.Charmer     = this;
                Charm              = target;
                target.Brain.State = BrainState.Idle;

                if (sendPetActionsWithSpells)
                {
                    PetHandler.SendSpells(this, (NPC)target, PetAction.Stay);
                }
                else
                {
                    PetHandler.SendVehicleSpells(this, (NPC)target);
                }

                SetMover(target, controllable);
                target.UnitFlags |= UnitFlags.Possessed;
            }
            else if (target is Character)
            {
                PetHandler.SendPlayerPossessedPetSpells(this, (Character)target);
                SetMover(target, controllable);
            }
            Observing = target;
            FarSight  = target.EntityId;
        }
Ejemplo n.º 3
0
        public void UnPossess(Unit target)
        {
            Observing = null;
            SetMover(this, true);
            ResetMover();
            FarSight = EntityId.Zero;
            PetHandler.SendEmptySpells(this);

            Charm = null;

            if (target == null)
            {
                return;
            }

            target.Charmer    = null;
            target.UnitFlags &= ~UnitFlags.Possessed;

            if (!(target is NPC))
            {
                return;
            }

            target.Brain.EnterDefaultState();
            ((NPC)target).RemainingDecayDelayMillis = 1;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Lets this Pet cast the given spell
        /// </summary>
        public void CastPetSpell(SpellId spellId, WorldObject target)
        {
            var spell = NPCSpells.GetReadySpell(spellId);
            SpellFailedReason err;

            if (spell != null)
            {
                if (spell.HasTargets)
                {
                    Target = m_master.Target;
                }

                err = spell.CheckCasterConstraints(this);
                if (err == SpellFailedReason.Ok)
                {
                    err = SpellCast.Start(spell, false, target != null ? new[] { target } : null);
                }
            }
            else
            {
                err = SpellFailedReason.NotReady;
            }

            if (err != SpellFailedReason.Ok && m_master is IPacketReceiver)
            {
                PetHandler.SendCastFailed((IPacketReceiver)m_master, spellId, err);
            }
        }
Ejemplo n.º 5
0
        private void Game_OnGameUpdate(EventArgs args)
        {
            if (FpsBalancer.CheckCounter())
            {
                return;
            }
            switch (orbwalker.ActiveMode)
            {
            case Orbwalking.OrbwalkingMode.Combo:
                Combo();
                break;

            case Orbwalking.OrbwalkingMode.Mixed:
                Harass();
                break;

            case Orbwalking.OrbwalkingMode.LaneClear:
                Clear();
                break;

            case Orbwalking.OrbwalkingMode.LastHit:
                break;

            default:
                break;
            }
            if (MordeGhost && R.IsReady())
            {
                PetHandler.MovePet(config, orbwalker.ActiveMode);
            }
        }
Ejemplo n.º 6
0
 protected override void Apply()
 {
     if (m_aura.Owner is Character)
     {
         var chr = m_aura.Owner as Character;
         PetHandler.SendStabledPetsList(chr, chr, (byte)chr.StableSlotCount, chr.StabledPetRecords);
     }
 }
Ejemplo n.º 7
0
		public static void ListStabledPets(Character chr, NPC stableMaster)
		{
			if (!CheckForStableMasterCheats(chr, stableMaster))
			{
				return;
			}

			PetHandler.SendStabledPetsList(chr, stableMaster, (byte)chr.StableSlotCount, chr.StabledPetRecords);
		}
Ejemplo n.º 8
0
        public static void DeStablePet(Character chr, NPC stableMaster, uint petNumber)
        {
            if (!PetMgr.CheckForStableMasterCheats(chr, stableMaster))
            {
                return;
            }
            PermanentPetRecord stabledPet = chr.GetStabledPet(petNumber);

            chr.DeStablePet(stabledPet);
            PetHandler.SendStableResult((IPacketReceiver)chr, StableResult.DeStableSuccess);
        }
Ejemplo n.º 9
0
        protected override void Apply()
        {
            if (!(m_aura.Owner is Character))
            {
                return;
            }
            Character owner = m_aura.Owner as Character;

            PetHandler.SendStabledPetsList(owner, owner, (byte)owner.StableSlotCount,
                                           owner.StabledPetRecords);
        }
Ejemplo n.º 10
0
		public static void DeStablePet(Character chr, NPC stableMaster, uint petNumber)
		{
			if (!CheckForStableMasterCheats(chr, stableMaster))
			{
				return;
			}

			var pet = chr.GetStabledPet(petNumber);
			chr.DeStablePet(pet);
			PetHandler.SendStableResult(chr, StableResult.DeStableSuccess);
		}
Ejemplo n.º 11
0
        protected override void Apply()
        {
            if (!(this.m_aura.Owner is Character))
            {
                return;
            }
            Character owner = this.m_aura.Owner as Character;

            PetHandler.SendStabledPetsList((IPacketReceiver)owner, (Unit)owner, (byte)owner.StableSlotCount,
                                           owner.StabledPetRecords);
        }
Ejemplo n.º 12
0
 public static void BuyStableSlot(Character chr, NPC stableMaster)
 {
     if (!CheckForStableMasterCheats(chr, stableMaster))
     {
         return;
     }
     if (!chr.TryBuyStableSlot())
     {
         PetHandler.SendStableResult(chr.Client, StableResult.NotEnoughMoney);
     }
     else
     {
         PetHandler.SendStableResult(chr.Client, StableResult.BuySlotSuccess);
     }
 }
Ejemplo n.º 13
0
        /// <summary>
        /// Add Passenger
        /// </summary>
        public void Enter(Unit passenger)
        {
            this._passenger = passenger;

            passenger.m_vehicleSeat        = this;
            passenger.MovementFlags       |= MovementFlags.OnTransport;
            passenger.TransportPosition    = Entry.AttachmentOffset;
            passenger.TransportOrientation = Entry.PassengerYaw;
            Vehicle._passengerCount++;

            if (IsDriverSeat)
            {
                Vehicle.Charmer    = passenger;
                passenger.Charm    = Vehicle;
                Vehicle.UnitFlags |= UnitFlags.Possessed;
            }

            var chr = passenger as Character;
            var pos = Vehicle.Position;

            // this will be null if its not a character
            if (chr != null)
            {
                VehicleHandler.Send_SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA(chr);
                VehicleHandler.SendBreakTarget(chr, Vehicle);
            }

            MovementHandler.SendEnterTransport(passenger);

            if (chr != null)
            {
                MiscHandler.SendCancelAutoRepeat(chr, Vehicle);
                //var orientation = Vehicle.m_vehicleSeat != null ? Vehicle.m_vehicleSeat.Entry.PassengerYaw : 0;
                //var moveflags = Vehicle.m_vehicleSeat != null ? MonsterMoveFlags.Flag_0x1000000 : MonsterMoveFlags.Walk;
                //MovementHandler.SendMoveToPacket(Vehicle, ref pos, orientation, 0, moveflags);
                PetHandler.SendVehicleSpells(chr, Vehicle);
            }

            passenger.IncMechanicCount(SpellMechanic.Rooted, true);
            passenger.HasPermissionToMove = false;
            passenger.MovementFlags      |= MovementFlags.Root;

            if (chr != null)
            {
                chr.SetMover(Vehicle, IsDriverSeat);
                chr.FarSight = Vehicle.EntityId;
            }
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Remove Passenger
        /// </summary>
        public void ClearSeat()
        {
            if (_passenger == null)
            {
                return;
            }

            if (IsDriverSeat)
            {
                Vehicle.Charmer    = null;
                _passenger.Charm   = null;
                Vehicle.UnitFlags &= ~UnitFlags.Possessed;
            }

            Vehicle._passengerCount--;
            if (_passenger.MovementFlags.HasFlag(MovementFlags.Flying))
            {
                var cast = Vehicle.SpellCast;
                if (cast != null)
                {
                    cast.Trigger(SpellId.EffectParachute);
                }
            }

            _passenger.MovementFlags &= ~MovementFlags.OnTransport;
            _passenger.Auras.RemoveFirstVisibleAura(aura => aura.Spell.IsVehicle);

            if (_passenger is Character)
            {
                var chr = (Character)_passenger;
                VehicleHandler.Send_SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA(chr);
                //SendTeleportAck
                MovementHandler.SendMoved(chr);
                MiscHandler.SendCancelAutoRepeat(chr, Vehicle);
                PetHandler.SendEmptySpells(chr);
                chr.ResetMover();
                chr.FarSight = EntityId.Zero;

                //MovementHandler.SendEnterTransport(chr);
            }
            _passenger.m_vehicleSeat = null;
            MovementHandler.SendHeartbeat(_passenger, _passenger.Position, _passenger.Orientation);
            _passenger.DecMechanicCount(SpellMechanic.Rooted, true);
            _passenger.HasPermissionToMove = true;
            _passenger.MovementFlags      &= ~MovementFlags.Root;
            _passenger = null;
        }
Ejemplo n.º 15
0
        /// <summary>Add Passenger</summary>
        public void Enter(Unit passenger)
        {
            this._passenger                = passenger;
            passenger.m_vehicleSeat        = this;
            passenger.MovementFlags       |= MovementFlags.OnTransport;
            passenger.TransportPosition    = this.Entry.AttachmentOffset;
            passenger.TransportOrientation = this.Entry.PassengerYaw;
            ++this.Vehicle._passengerCount;
            if (this.IsDriverSeat)
            {
                this.Vehicle.Charmer    = passenger;
                passenger.Charm         = (Unit)this.Vehicle;
                this.Vehicle.UnitFlags |= UnitFlags.Possessed;
            }

            Character chr      = passenger as Character;
            Vector3   position = this.Vehicle.Position;

            if (chr != null)
            {
                VehicleHandler.Send_SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA(chr);
                VehicleHandler.SendBreakTarget((IPacketReceiver)chr, (IEntity)this.Vehicle);
            }

            MovementHandler.SendEnterTransport(passenger);
            if (chr != null)
            {
                MiscHandler.SendCancelAutoRepeat((IPacketReceiver)chr, (IEntity)this.Vehicle);
                PetHandler.SendVehicleSpells((IPacketReceiver)chr, (NPC)this.Vehicle);
            }

            passenger.IncMechanicCount(SpellMechanic.Rooted, true);
            passenger.HasPermissionToMove = false;
            passenger.MovementFlags      |= MovementFlags.Root;
            if (chr == null)
            {
                return;
            }
            chr.SetMover((WorldObject)this.Vehicle, this.IsDriverSeat);
            chr.FarSight = this.Vehicle.EntityId;
        }
Ejemplo n.º 16
0
 public GameSocket(ISerializer serializer) : base(serializer)
 {
     _bagHandler           = new BagHandler(this);
     _battleHandler        = new BattleHandler(this);
     _dailyActivityHandler = new DailyActivityHandler(this);
     _equipHandler         = new EquipHandler(this);
     _itemHandler          = new ItemHandler(this);
     _messageHandler       = new MessageHandler(this);
     _npcHandler           = new NpcHandler(this);
     _petHandler           = new PetHandler(this);
     _petNewHandler        = new PetNewHandler(this);
     _playerHandler        = new PlayerHandler(this);
     _prepaidHandler       = new PrepaidHandler(this);
     _resourceHandler      = new ResourceHandler(this);
     _skillHandler         = new SkillHandler(this);
     _skillKeysHandler     = new SkillKeysHandler(this);
     _taskHandler          = new TaskHandler(this);
     _teamHandler          = new TeamHandler(this);
     _entryHandler         = new EntryHandler(this);
     _roleHandler          = new RoleHandler(this);
 }
Ejemplo n.º 17
0
        public static void SwapStabledPet(Character chr, NPC stableMaster, uint petNumber)
        {
            if (!CheckForStableMasterCheats(chr, stableMaster))
            {
                return;
            }
            NPC activePet = chr.ActivePet;
            PermanentPetRecord stabledPet = chr.GetStabledPet(petNumber);

            if (activePet.Health == 0)
            {
                PetHandler.SendStableResult(chr, StableResult.Fail);
            }
            else if (!chr.TrySwapStabledPet(stabledPet))
            {
                PetHandler.SendStableResult(chr, StableResult.Fail);
            }
            else
            {
                PetHandler.SendStableResult(chr, StableResult.DeStableSuccess);
            }
        }
Ejemplo n.º 18
0
        public static void StablePet(Character chr, NPC stableMaster)
        {
            if (!CheckForStableMasterCheats(chr, stableMaster))
            {
                return;
            }
            NPC activePet = chr.ActivePet;

            if (!chr.GodMode && activePet.Health == 0)
            {
                PetHandler.SendStableResult(chr, StableResult.Fail);
            }
            if (chr.StabledPetRecords.Count < chr.StableSlotCount)
            {
                chr.StablePet();
                PetHandler.SendStableResult(chr, StableResult.StableSuccess);
            }
            else
            {
                PetHandler.SendStableResult(chr, StableResult.Fail);
            }
        }
Ejemplo n.º 19
0
        private void Game_OnGameUpdate(EventArgs args)
        {
            AIHeroClient target = DrawHelper.GetBetterTarget(
                Q.Range + player.MoveSpeed * 3, TargetSelector.DamageType.Physical);

            if (ShacoStealth && target != null && target.Health > ComboDamage(target) &&
                CombatHelper.IsFacing(target, player.Position) &&
                orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo)
            {
                orbwalker.SetAttack(false);
            }
            else
            {
                orbwalker.SetAttack(true);
            }
            if (false)
            {
                return;
            }
            switch (orbwalker.ActiveMode)
            {
            case Orbwalking.OrbwalkingMode.Combo:
                Combo(target);
                break;

            case Orbwalking.OrbwalkingMode.Mixed:
                Harass();
                break;

            case Orbwalking.OrbwalkingMode.LaneClear:
                Clear();
                break;

            case Orbwalking.OrbwalkingMode.LastHit:
                break;

            default:
                break;
            }
            if (E.IsReady())
            {
                var ksTarget =
                    HeroManager.Enemies.FirstOrDefault(
                        h => h.IsValidTarget() && !CombatHelper.IsInvulnerable2(h) && h.Health < E.GetDamage(h));
                if (ksTarget != null)
                {
                    if ((config.Item("ks", true).GetValue <bool>() || config.Item("ksq", true).GetValue <bool>()) &&
                        E.CanCast(ksTarget))
                    {
                        E.CastOnUnit(ksTarget);
                    }
                    if (Q.IsReady() && config.Item("ks", true).GetValue <bool>() &&
                        ksTarget.Distance(player) < Q.Range + E.Range && ksTarget.Distance(player) > E.Range &&
                        !player.Position.Extend(ksTarget.Position, Q.Range).IsWall() &&
                        player.Mana > Q.Instance.SData.Mana + E.Instance.SData.Mana)
                    {
                        Q.Cast(player.Position.Extend(ksTarget.Position, Q.Range));
                    }
                }
            }

            if (config.Item("stackBox", true).GetValue <KeyBind>().Active&& W.IsReady())
            {
                var box =
                    ObjectManager.Get <Obj_AI_Minion>()
                    .Where(m => m.Distance(player) < W.Range && m.Name == "Jack In The Box" && !m.IsDead)
                    .OrderBy(m => m.Distance(Game.CursorPos))
                    .FirstOrDefault();

                if (box != null)
                {
                    W.Cast(box.Position);
                }
                else
                {
                    if (player.Distance(Game.CursorPos) < W.Range)
                    {
                        W.Cast(Game.CursorPos);
                    }
                    else
                    {
                        W.Cast(player.Position.Extend(Game.CursorPos, W.Range));
                    }
                }
            }
            if (R.IsReady() && ShacoClone)
            {
                PetHandler.MovePet(config, orbwalker.ActiveMode);
            }
            var data = Program.IncDamages.GetAllyData(player.NetworkId);

            if (config.Item("userCC", true).GetValue <bool>() && R.IsReady() && target != null &&
                player.Distance(target) < Q.Range && data.AnyCC)
            {
                R.Cast();
            }
        }
Ejemplo n.º 20
0
        public static void ServerHandlerReceive(InPacket ip, Client gc)
        {
            var Header = ip.ReadShort(); // Read header

            ip.ReadInt();                // Original length + CRC
            ip.ReadInt();
#if DEBUG
            Log.Hex("Received {0}({1}) packet from {2}: ", ip.Array, ((ClientOpcode)Header).ToString(), Header,
                    gc.Title);
#endif
            switch ((ClientOpcode)Header)
            {
            // Game
            case ClientOpcode.COMMAND_REQ:
                GameHandler.Command_Req(ip, gc);
                break;

            case ClientOpcode.GAMELOG_REQ:
                GameHandler.Game_Log_Req(ip, gc);
                break;

            case ClientOpcode.QUICK_SLOT_REQ:
                GameHandler.Quick_Slot_Req(ip, gc);
                break;

            //2019-09-01 16:48 GMT+7
            case ClientOpcode.CHARACTER_INFO_REQ:                     // OPCODE = 76  // Try Change test = E4
                GameHandler.Character_Info_Req(ip, gc);
                break;

            case ClientOpcode.GAME_ISACTIVE:
                GameHandler.GameisActive_Ack(ip, gc);
                break;

            // Shop
            case ClientOpcode.NPC_SHOP_BUY_REQ:
                NpcShopHandler.Buy_Req(ip, gc);
                break;

            case ClientOpcode.NPC_SHOP_SELL_REQ:
                NpcShopHandler.Sell_Req(ip, gc);
                break;

            // Status
            case ClientOpcode.CHAR_DAMAGE_REQ:
                StatusHandler.Char_Damage_Req(ip, gc);
                break;

            case ClientOpcode.CHAR_DEAD_REQ:
                StatusHandler.Char_Dead_Req(ip, gc);
                break;

            case ClientOpcode.CHAR_STATUP_REQ:
                StatusHandler.Char_Statup_Req(ip, gc);
                break;

            case ClientOpcode.CHAR_FURY:
                StatusHandler.Char_Fury_Req(ip, gc);
                break;

            // Inventory
            case ClientOpcode.MOVE_ITEM_REQ:
                InventoryHandler.MoveItem_Req(ip, gc);
                break;

            case ClientOpcode.INVEN_SELECTSLOT_REQ:
                InventoryHandler.SelectSlot_Req(ip, gc);
                break;

            case ClientOpcode.USE_SPEND_REQ:
                InventoryHandler.UseSpend_Req(ip, gc);
                break;

            case ClientOpcode.INVEN_USESPEND_REQ:
                InventoryHandler.InvenUseSpendStart_Req(ip, gc);
                break;

            case ClientOpcode.INVEN_USESPEND_SHOUT_REQ:
            case ClientOpcode.INVEN_USESPEND_SHOUT_ALL_REQ:
                InventoryHandler.InvenUseSpendShout_Req(ip, gc);
                break;

            case ClientOpcode.PICKUP_ITEM:
                InventoryHandler.PickupItem(ip, gc);
                break;

            // Skill
            case ClientOpcode.SKILL_LEVELUP_REQ:
                SkillHandler.SkillLevelUp_Req(ip, gc);
                break;

            //case ClientOpcode.USE_SKILL_REQ:
            //    SkillHandler.UseSkill_Req(ip, gc);
            //    break;
            // Quest
            case ClientOpcode.QUEST_ALL_REQ:
                QuestHandler.Quest_All_Req(ip, gc);
                break;

            case ClientOpcode.QUEST_GIVEUP_REQ:
                QuestHandler.Quest_GiveUp_Req(ip, gc);
                break;

            case ClientOpcode.QUEST_DONE_REQ:
                QuestHandler.Quest_Done_Req(ip, gc);
                break;

            case ClientOpcode.QUEST_RETURN_REQ:
                QuestHandler.Quest_Return_Req(ip, gc);
                break;

            case ClientOpcode.QUEST_DONE2_REQ:
                QuestHandler.Quest_Done2_Req(ip, gc);
                break;

            case ClientOpcode.QUEST_UPDATE_REQ:
                QuestHandler.Quest_Update_Req(ip, gc);
                break;

            // Map
            case ClientOpcode.ENTER_WARP_ACK_REQ:
                MapHandler.WarpToMap_Req(ip, gc);
                break;

            case ClientOpcode.CAN_WARP_ACK_REQ:
                MapHandler.WarpToMapAuth_Req(ip, gc);
                break;

            // Monster
            case ClientOpcode.ATTACK_MONSTER_REQ:
                MonsterHandler.AttackMonster_Req(ip, gc);
                break;

            // Storage
            case ClientOpcode.MOVE_ITEM_STORAGE_REQ:
                StorageHandler.MoveItemToStorage(ip, gc);
                break;

            case ClientOpcode.MOVE_ITEM_TO_BAG_REQ:
                StorageHandler.MoveItemToBag(ip, gc);
                break;

            case ClientOpcode.SAVE_MONEY_REQ:
                StorageHandler.SaveStorageMoney(ip, gc);
                break;

            case ClientOpcode.GIVE_MONEY_REQ:
                StorageHandler.GiveStorageMoney(ip, gc);
                break;

            // Coupon
            case ClientOpcode.CASH_SN:
                CouponHandler.Use_Coupon_Req(ip, gc);
                break;

            // Action
            case ClientOpcode.P_WARP_C:
                ActionHandler.p_Warp_c(ip, gc);
                break;

            case ClientOpcode.P_MOVE_C:
                ActionHandler.p_Move_c(ip, gc);
                break;

            case ClientOpcode.P_JUMP_C:
                ActionHandler.p_Jump_c(ip, gc);
                break;

            case ClientOpcode.P_SPEED_C:
                ActionHandler.p_Speed_c(ip, gc);
                break;

            case ClientOpcode.P_ATTACK_C:
                ActionHandler.p_Attack_c(ip, gc);
                break;

            //case ClientOpcode.P_DAMAGE_C:
            //    ActionHandler.p_Damage_c(ip, gc);
            //    break;
            //case ClientOpcode.P_DEAD_C:
            //    ActionHandler.p_Dead_c(ip, gc);
            //    break;
            case ClientOpcode.P_MOVE_C_2:
                ActionHandler.p_Move_c_2(ip, gc);
                break;

            //case ClientOpcode.PET_MOVE_C:
            //    ActionHandler.Pet_Move_C(ip, gc);
            //    break;
            //case ClientOpcode.PET_ATTACK_C:
            //    ActionHandler.Pet_Attack_C(ip, gc);
            //    break;
            // Trade
            case ClientOpcode.TRADE_INVITE_REQ:
                TradeHandler.TradeInvite(ip, gc);
                break;

            case ClientOpcode.TRADE_INVITE_RESPONSE_REQ:
                TradeHandler.TradeInviteResponses(ip, gc);
                break;

            case ClientOpcode.TRADE_READY_REQ:
                TradeHandler.TradeReady(ip, gc);
                break;

            case ClientOpcode.TRADE_CONFIRM_REQ:
                TradeHandler.TradeConfirm(ip, gc);
                break;

            case ClientOpcode.TRADE_CANCEL_REQ:
                TradeHandler.TradeCancel(ip, gc);
                break;

            case ClientOpcode.TRADE_PUT_REQ:
                TradeHandler.TradePutItem(ip, gc);
                break;

            // Party
            case ClientOpcode.PARTY_INVITE_REQ:
                PartyHandler.PartyInvite(ip, gc);
                break;

            case ClientOpcode.PARTY_INVITE_RESPONSES_REQ:
                PartyHandler.PartyInviteResponses(ip, gc);
                break;

            case ClientOpcode.PARTY_LEAVE:
                PartyHandler.PartyLeave(ip, gc);
                break;

            // PvP
            case ClientOpcode.PVP_REQ:
                PvPHandler.PvPInvite(ip, gc);
                break;

            case ClientOpcode.PVP_ACK_REQ:
                PvPHandler.PvPInviteResponses(ip, gc);
                break;

            // PlayerShop
            case ClientOpcode.PSHOP_OPEN_REQ:
                PlayerShopHandler.OpenShop_Req(ip, gc);
                break;

            case ClientOpcode.PSHOP_SELLSTART_REQ:
                PlayerShopHandler.SellStart_Req(ip, gc);
                break;

            case ClientOpcode.PSHOP_SELLEND_REQ:
                PlayerShopHandler.SellEnd_Req(ip, gc);
                break;

            case ClientOpcode.PSHOP_INFO_REQ:
                PlayerShopHandler.ShopInfo_Req(ip, gc);
                break;

            case ClientOpcode.PSHOP_BUYACK_REQ:
                PlayerShopHandler.Buy_Req(ip, gc);
                break;

            // Fish
            case ClientOpcode.FISH_REQ:
                FishHandler.Fish_Req(ip, gc);
                break;

            // CashShop
            //case ClientOpcode.CASHSHOP_LIST_REQ:
            //    CashShopHandler.CashShopList_Req(ip, gc);
            //    break;
            case ClientOpcode.CASH_MGAMECASH_REQ:
                CashShopHandler.MgameCash_Req(ip, gc);
                break;

            case ClientOpcode.CASH_BUY_REQ:
                CashShopHandler.BuyCommodity_Req(ip, gc);
                break;

            case ClientOpcode.CASH_GIFT_REQ:
                CashShopHandler.Gifts_Req(ip, gc);
                break;

            case ClientOpcode.CASH_TO_INVEN_REQ:
                CashShopHandler.CommodityToInventory_Req(ip, gc);
                break;

            case ClientOpcode.ABILITY_RECOVER_REQ:
                CashShopHandler.AbilityRecover_Req(ip, gc);
                break;

            case ClientOpcode.CASH_CHECKCHARNAME_REQ:
                CashShopHandler.CheckName_Req(ip, gc);
                break;

            case ClientOpcode.DISMANTLE_REQ:
                CashShopHandler.Dismantle_Req(ip, gc);
                break;

            // Pet
            case ClientOpcode.PET_NAME_REQ:
                PetHandler.Pet_Name_Req(ip, gc);
                break;

            case ClientOpcode.SPIRIT_MOVE_REQ:
                SpiritHandler.SpiritMove(ip, gc);
                break;

            case ClientOpcode.EQUIPMENT_COMPOUND_REQ:
                SpiritHandler.EquipmentCompound(ip, gc);
                break;

            case ClientOpcode.EVENTITEM_ACK:
                TradeHandler.TradeEventItem(ip, gc);
                break;
            }
        }
Ejemplo n.º 21
0
 public Owner()
 {
     PetHandlerInstance = new PetHandler(this);
 }
Ejemplo n.º 22
0
 public GameSocket(ISerializer serializer) : base(serializer)
 {
     _achievementHandler       = new AchievementHandler(this);
     _activityHandler          = new ActivityHandler(this);
     _activityFavorHandler     = new ActivityFavorHandler(this);
     _amuletHandler            = new AmuletHandler(this);
     _arenaHandler             = new ArenaHandler(this);
     _attendanceHandler        = new AttendanceHandler(this);
     _bagHandler               = new BagHandler(this);
     _battleHandler            = new BattleHandler(this);
     _cardHandler              = new CardHandler(this);
     _consignmentLineHandler   = new ConsignmentLineHandler(this);
     _crossServerHandler       = new CrossServerHandler(this);
     _dailyActivityHandler     = new DailyActivityHandler(this);
     _demonTowerHandler        = new DemonTowerHandler(this);
     _equipHandler             = new EquipHandler(this);
     _exchangeHandler          = new ExchangeHandler(this);
     _fashionHandler           = new FashionHandler(this);
     _fightLevelHandler        = new FightLevelHandler(this);
     _fleeHandler              = new FleeHandler(this);
     _friendHandler            = new FriendHandler(this);
     _functionHandler          = new FunctionHandler(this);
     _functionOpenHandler      = new FunctionOpenHandler(this);
     _giftOnlineHandler        = new GiftOnlineHandler(this);
     _goddessHandler           = new GoddessHandler(this);
     _guildBlessHandler        = new GuildBlessHandler(this);
     _guildBossHandler         = new GuildBossHandler(this);
     _guildDepotHandler        = new GuildDepotHandler(this);
     _guildHandler             = new GuildHandler(this);
     _guildShopHandler         = new GuildShopHandler(this);
     _guildTechHandler         = new GuildTechHandler(this);
     _hookSetHandler           = new HookSetHandler(this);
     _interactHandler          = new InteractHandler(this);
     _intergalMallHandler      = new IntergalMallHandler(this);
     _itemHandler              = new ItemHandler(this);
     _leaderBoardHandler       = new LeaderBoardHandler(this);
     _limitTimeActivityHandler = new LimitTimeActivityHandler(this);
     _mailHandler              = new MailHandler(this);
     _mapHandler               = new MapHandler(this);
     _masteryHandler           = new MasteryHandler(this);
     _medalHandler             = new MedalHandler(this);
     _messageHandler           = new MessageHandler(this);
     _mountHandler             = new MountHandler(this);
     _npcHandler               = new NpcHandler(this);
     _offlineAwardHandler      = new OfflineAwardHandler(this);
     _onlineGiftHandler        = new OnlineGiftHandler(this);
     _payGiftHandler           = new PayGiftHandler(this);
     _petHandler               = new PetHandler(this);
     _petNewHandler            = new PetNewHandler(this);
     _playerHandler            = new PlayerHandler(this);
     _prepaidHandler           = new PrepaidHandler(this);
     _rankHandler              = new RankHandler(this);
     _resourceDungeonHandler   = new ResourceDungeonHandler(this);
     _resourceHandler          = new ResourceHandler(this);
     _rewardHandler            = new RewardHandler(this);
     _saleHandler              = new SaleHandler(this);
     _shopMallHandler          = new ShopMallHandler(this);
     _skillHandler             = new SkillHandler(this);
     _skillKeysHandler         = new SkillKeysHandler(this);
     _soloHandler              = new SoloHandler(this);
     _stealHandler             = new StealHandler(this);
     _sysSetHandler            = new SysSetHandler(this);
     _taskHandler              = new TaskHandler(this);
     _teamHandler              = new TeamHandler(this);
     _tradeHandler             = new TradeHandler(this);
     _treasureHandler          = new TreasureHandler(this);
     _upLevelHandler           = new UpLevelHandler(this);
     _vipHandler               = new VipHandler(this);
     _vitalityHandler          = new VitalityHandler(this);
     _wingHandler              = new WingHandler(this);
     _activityRevelryHandler   = new ActivityRevelryHandler(this);
     _auctionHandler           = new AuctionHandler(this);
     _chatHandler              = new ChatHandler(this);
     _daoYouHandler            = new DaoYouHandler(this);
     _entryHandler             = new EntryHandler(this);
     _roleHandler              = new RoleHandler(this);
     _farmHandler              = new FarmHandler(this);
     _five2FiveHandler         = new Five2FiveHandler(this);
     _guildManagerHandler      = new GuildManagerHandler(this);
     _xianYuanHandler          = new XianYuanHandler(this);
 }
Ejemplo n.º 23
0
        protected override void OnDeath()
        {
            m_brain.IsRunning = false;

            // hand out experience
            bool heroic;

            if (m_Map != null)
            {
                m_Map.OnNPCDied(this);
                heroic = m_Map.IsHeroic;
            }
            else
            {
                heroic = false;
            }

            var looter = m_FirstAttacker;

            if (!HasPlayerMaster)               // not player-owned NPC
            {
                var playerLooter = looter != null ? looter.PlayerOwner : null;
                if (playerLooter != null &&
                    LootMgr.GetOrCreateLoot(this, playerLooter, LootEntryType.NPCCorpse, heroic) != null)
                {
                    // NPCs don't have Corpse objects -> Spawning NPC Corpses will cause client to crash
                    //RemainingDecayDelay = m_entry.DefaultDecayDelay * 10;
                    EnterLootableState();
                }
                else
                {
                    // no loot
                    EnterFinalState();
                }
            }

            // notify events
            m_entry.NotifyDied(this);

            UnitFlags |= UnitFlags.SelectableNotAttackable;

            // send off the tamer
            if (m_currentTamer != null)
            {
                PetHandler.SendTameFailure(m_currentTamer, TameFailReason.TargetDead);
                CurrentTamer.SpellCast.Cancel(SpellFailedReason.Ok);
            }

            // reset spawn timer
            if (m_spawnPoint != null)
            {
                m_spawnPoint.SignalSpawnlingDied(this);
            }

            if (m_master != null)
            {
                // notify master
                if (m_master.IsInWorld)
                {
                    m_master.OnMinionDied(this);
                }
                else
                {
                    Delete();
                }
            }
        }
Ejemplo n.º 24
0
        /// <summary>Remove Passenger</summary>
        public void ClearSeat()
        {
            if (this._passenger == null)
            {
                return;
            }
            if (this.IsDriverSeat)
            {
                this.Vehicle.Charmer    = (Unit)null;
                this._passenger.Charm   = (Unit)null;
                this.Vehicle.UnitFlags &= UnitFlags.CanPerformAction_Mask1 | UnitFlags.Flag_0_0x1 |
                                          UnitFlags.SelectableNotAttackable | UnitFlags.Influenced |
                                          UnitFlags.PlayerControlled | UnitFlags.Flag_0x10 | UnitFlags.Preparation |
                                          UnitFlags.PlusMob | UnitFlags.SelectableNotAttackable_2 |
                                          UnitFlags.NotAttackable | UnitFlags.Passive | UnitFlags.Looting |
                                          UnitFlags.PetInCombat | UnitFlags.Flag_12_0x1000 | UnitFlags.Silenced |
                                          UnitFlags.Flag_14_0x4000 | UnitFlags.Flag_15_0x8000 |
                                          UnitFlags.SelectableNotAttackable_3 | UnitFlags.Combat |
                                          UnitFlags.TaxiFlight | UnitFlags.Disarmed | UnitFlags.Confused |
                                          UnitFlags.Feared | UnitFlags.NotSelectable | UnitFlags.Skinnable |
                                          UnitFlags.Mounted | UnitFlags.Flag_28_0x10000000 |
                                          UnitFlags.Flag_29_0x20000000 | UnitFlags.Flag_30_0x40000000 |
                                          UnitFlags.Flag_31_0x80000000;
            }

            --this.Vehicle._passengerCount;
            if (this._passenger.MovementFlags.HasFlag((Enum)MovementFlags.Flying))
            {
                SpellCast spellCast = this.Vehicle.SpellCast;
                if (spellCast != null)
                {
                    spellCast.Trigger(SpellId.EffectParachute);
                }
            }

            this._passenger.MovementFlags &= MovementFlags.MaskMoving | MovementFlags.PitchUp |
                                             MovementFlags.PitchDown | MovementFlags.WalkMode |
                                             MovementFlags.DisableGravity | MovementFlags.Root |
                                             MovementFlags.PendingStop | MovementFlags.PendingStrafeStop |
                                             MovementFlags.PendingForward | MovementFlags.PendingBackward |
                                             MovementFlags.PendingStrafeLeft | MovementFlags.PendingStrafeRight |
                                             MovementFlags.PendingRoot | MovementFlags.Swimming | MovementFlags.CanFly |
                                             MovementFlags.Flying | MovementFlags.SplineElevation |
                                             MovementFlags.SplineEnabled | MovementFlags.Waterwalking |
                                             MovementFlags.CanSafeFall | MovementFlags.Hover | MovementFlags.LocalDirty;
            this._passenger.Auras.RemoveFirstVisibleAura((Predicate <Aura>)(aura => aura.Spell.IsVehicle));
            if (this._passenger is Character)
            {
                Character passenger = (Character)this._passenger;
                VehicleHandler.Send_SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA(passenger);
                MovementHandler.SendMoved(passenger);
                MiscHandler.SendCancelAutoRepeat((IPacketReceiver)passenger, (IEntity)this.Vehicle);
                PetHandler.SendEmptySpells((IPacketReceiver)passenger);
                passenger.ResetMover();
                passenger.FarSight = EntityId.Zero;
            }

            this._passenger.m_vehicleSeat = (VehicleSeat)null;
            MovementHandler.SendHeartbeat(this._passenger, this._passenger.Position, this._passenger.Orientation);
            this._passenger.DecMechanicCount(SpellMechanic.Rooted, true);
            this._passenger.HasPermissionToMove = true;
            this._passenger.MovementFlags      &= MovementFlags.MaskMoving | MovementFlags.PitchUp |
                                                  MovementFlags.PitchDown | MovementFlags.WalkMode |
                                                  MovementFlags.OnTransport | MovementFlags.DisableGravity |
                                                  MovementFlags.PendingStop | MovementFlags.PendingStrafeStop |
                                                  MovementFlags.PendingForward | MovementFlags.PendingBackward |
                                                  MovementFlags.PendingStrafeLeft | MovementFlags.PendingStrafeRight |
                                                  MovementFlags.PendingRoot | MovementFlags.Swimming | MovementFlags.CanFly |
                                                  MovementFlags.Flying | MovementFlags.SplineElevation |
                                                  MovementFlags.SplineEnabled | MovementFlags.Waterwalking |
                                                  MovementFlags.CanSafeFall | MovementFlags.Hover | MovementFlags.LocalDirty;
            this._passenger = (Unit)null;
        }
Ejemplo n.º 25
0
        protected override void OnDeath()
        {
            if (m_brain != null)
            {
                m_brain.IsRunning = false;
            }

            if (m_Map != null || this != null)
            {
                var       rcvrs  = this.GetNearbyClients(false);
                var       looter = CalcLooter();
                Asda2Loot loot   = null;
                if (looter != null && m_Map.DefenceTownEvent == null)
                {
                    loot = Asda2LootMgr.GetOrCreateLoot(this, looter,
                                                        Asda2LootEntryType.Npc);
                    if (loot != null && Template != null)
                    {
                        loot.MonstrId = (short?)Template.Id;
                    }
                }



                Loot = null;
                var map = m_Map;
                m_Map.CallDelayed(LastDamageDelay, () =>
                {
                    Asda2CombatHandler.SendMostrDeadToAreaResponse(rcvrs,
                                                                   (short)
                                                                   UniqIdOnMap,
                                                                   (short)
                                                                   Asda2Position.
                                                                   X,
                                                                   (short)
                                                                   Asda2Position.
                                                                   Y);
                    map.OnNPCDied(this);

                    var chr = LastKiller as Character;
                    if (chr != null)
                    {
                        Asda2TitleChecker.OnNpcDeath(this, chr);
                        if (chr.IsInGroup)
                        {
                            chr.Group.ForeachCharacter(x => KillMonsterEventManager.TryGiveReward(x, Template.Id));
                        }
                        else
                        {
                            KillMonsterEventManager.TryGiveReward(chr, Template.Id);
                        }
                    }
                    if (loot != null && loot.Lootable is NPC)
                    {
                        var npc = ((NPC)loot.Lootable);
                        if (npc != null && npc.Map != null)
                        {
                            npc.Map.SpawnLoot(loot);
                        }
                    }

                    if (m_entry != null && Entry != null && Template != null)
                    {
                        if (Entry.Rank >= CreatureRank.Boss)
                        {
                            if (LastKiller != null)
                            {
                                ChatMgr.SendGlobalMessageResponse(LastKiller.Name,
                                                                  ChatMgr.Asda2GlobalMessageType
                                                                  .HasDefeated, 0, 0,
                                                                  (short)Template.Id);
                            }
                            if (chr != null)
                            {
                                chr.GuildPoints += m_entry.MinLevel * CharacterFormulas.BossKillingGuildPointsPerLevel;
                            }
                        }
                        else
                        {
                            if (chr != null && chr.Level < m_entry.MinLevel + 3)
                            {
                                chr.GuildPoints += CharacterFormulas.MobKillingGuildPoints;
                            }
                        }
                        // notify events
                        m_entry.NotifyDied(this);
                    }
                    EnterFinalState();
                });
            }


            //UnitFlags |= UnitFlags.SelectableNotAttackable;

            // send off the tamer
            if (m_currentTamer != null)
            {
                PetHandler.SendTameFailure(m_currentTamer, TameFailReason.TargetDead);
                CurrentTamer.SpellCast.Cancel(SpellFailedReason.Ok);
            }

            // reset spawn timer
            if (m_spawnPoint != null)
            {
                m_spawnPoint.SignalSpawnlingDied(this);
            }
        }