public void UnequipItem(byte location)
        {
            var item = equippedItems[location];

            equippedItems[location] = null;
            if (item != null && Owner.AddItem(item))
            {
                //Track equipped super gems
                if (item.Gem1 % 10 == 3 || item.Gem2 % 10 == 3)
                {
                    if (superGems.Contains(item.Gem1 / 10))
                    {
                        superGems.Remove(item.Gem1 / 10);
                    }
                }
                Owner.SpawnPacket = SpawnEntityPacket.Create(Owner);
                if (DropManager.TwoHandWeaponTypes.Contains(item.EquipmentType) && equippedItems[5] != null)
                {
                    UnequipItem(5);
                }
                Owner.Send(ItemActionPacket.Create(item.UniqueID, (byte)item.Location, ItemAction.UnequipItem));
                Owner.SendToScreen(Owner.SpawnPacket);
                item.Location = 0;
                item.Save();
            }
        }
Example #2
0
        public void UnequipItem(byte location)
        {
            var item = equippedItems[location];

            equippedItems[location] = null;
            if (item != null && Owner.AddItem(item))
            {
                Owner.SpawnPacket = SpawnEntityPacket.Create(Owner);
                Owner.Send(ItemActionPacket.Create(item.UniqueID, (byte)item.Location, ItemAction.UnequipItem));
                Owner.SendToScreen(Owner.SpawnPacket);
                item.Location = 0;
                item.Save();
            }
        }
Example #3
0
    public override bool Activate(string activeCase)
    {
        if (canActivate)
        {
            canActivate = false;
        }
        else
        {
            return(false);
        }

        Debug.Log("Activate Sunnary Wings.");

        TileChooserManager tileChooser = TileChooserManager.GetInstance();

        IAction actionEndPhase = new LambdaAction(
            () => {
            Owner.AddItem(this);
            canActivate = true;
        });

        // Not Building tiles
        List <PLOT> banned = Plot.BuildingPlot.Union(Plot.TemplePlot).ToList();

        banned.Add(PLOT.TRAVEL);

        tileChooser.Listen(this,
                           actionEndPhase,
                           banned,
                           10f);

        Owner.RemoveItem(this);
        Remove(true);
        // player active animation


        // DO NOT add item back to Item pool
        // ItemManager.Ins.AddItemToPool(this);

        return(true);
    }
        public override bool Cast()
        {
            if (!base.Cast())
            {
                return(false);
            }

            double time = (int)(Owner.Niveau) * (Maitrise / 2.0);

            time *= getRatio();

            if (m_toClone == null)
            {
                return(false);
            }

            if (!Owner.makeTransfo(this))
            {
                Owner.SendMessage("Vous êtes déjà sous l'effet d'une transformation");
                return(true);
            }

            NubiaPlayer m = Owner as NubiaPlayer;

            Owner.BodyValue = m_toClone.BodyValue;
            Owner.HueMod    = m_toClone.Hue;
            m_nom           = Owner.Name;
            if (m_toClone.Name != "noname")
            {
                Owner.NameMod = m_toClone.Name;
            }

            Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z + 4), m.Map, 0x3728, 13);
            Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z), m.Map, 0x3728, 13);
            Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z - 4), m.Map, 0x3728, 13);
            Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z + 4), m.Map, 0x3728, 13);
            Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z), m.Map, 0x3728, 13);
            Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z - 4), m.Map, 0x3728, 13);

            Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z + 11), m.Map, 0x3728, 13);
            Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z + 7), m.Map, 0x3728, 13);
            Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z + 3), m.Map, 0x3728, 13);
            Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z - 1), m.Map, 0x3728, 13);

            m.PlaySound(0x228);

            m_listItem = new ArrayList();

            for (int i = 0; i < m_toClone.Items.Count; i++)
            {
                Item item = NubiaHelper.CopyItem(m_toClone.Items[i]);
                Owner.AddItem(item);
                item.Movable = false;
                m_listItem.Add(item);
            }

            int level = m_toClone.Niveau;// KonohaSkillHelper.getCreatureNiveau(m_toClone);

            m_bonusStr = (int)((level * 2) * TransfoHelper.getModusStr(energie));
            m_bonusDex = (int)((level * 2) * TransfoHelper.getModusDex(energie));
            m_bonusInt = (int)((level * 2) * TransfoHelper.getModusInt(energie));

            m_bonusStr = (int)(m_bonusStr * getRatio());
            m_bonusDex = (int)(m_bonusDex * getRatio());
            m_bonusInt = (int)(m_bonusInt * getRatio());

            m_bonusSkill  = (level * 2);
            m_bonusSkill *= getRatio();

            Owner.Str += m_bonusStr;
            Owner.Dex += m_bonusDex;
            Owner.Int += m_bonusInt;

/*SkillName[] sk = TransfoHelper.getSkillBonus(competence);
 *                      for(int i = 0; i < sk.Length; i++)
 *                      {
 *                              Owner.Skills[sk[i]].Cap += m_bonusSkill;
 *                              Owner.Skills[sk[i]].Base += m_bonusSkill;
 *                      }*/
            m_timer = new InternalTimer(this, time);
            m_timer.Start();
            return(true);
        }
Example #5
0
        /// <summary>
        ///     Push values to the player, based on this state.
        /// </summary>
        public bool Push()
        {
            if (Owner == null || Owner.Deleted)
            {
                return(false);
            }

            #region BankBox

            if (BankBox == null || BankBox.Deleted)
            {
                BankBox = new BankBox(Owner, Expansion);
            }

            BankBox.Layer      = Layer.Bank;
            BankBox.BlessedFor = null;
            BankBox.Visible    = true;
            BankBox.Hue        = 0;

            Owner.BankBox.Layer      = Layer.Invalid;
            Owner.BankBox.BlessedFor = Owner;
            Owner.BankBox.Visible    = false;
            Owner.BankBox.Hue        = 34;

            Owner.BankBox.Close();
            Owner.Send(Owner.BankBox.RemovePacket);

            Owner.AddItem(BankBox);

            Owner.BankBox = BankBox;

            Owner.BankBox.UpdateTotals();

            #endregion

            #region Backpack

            if (Backpack == null || Backpack.Deleted)
            {
                Backpack = new Backpack(Expansion);
            }

            Backpack.Layer      = Layer.Backpack;
            Backpack.BlessedFor = null;
            Backpack.Visible    = true;
            Backpack.Movable    = true;
            Backpack.Hue        = 0;

            Owner.Backpack.Layer      = Layer.Invalid;
            Owner.Backpack.BlessedFor = Owner;
            Owner.Backpack.Visible    = false;
            Owner.Backpack.Movable    = false;
            Owner.Backpack.Hue        = 34;

            Owner.Send(Owner.Backpack.RemovePacket);

            Owner.AddItem(Backpack);

            Owner.Backpack = Backpack;

            Owner.Backpack.UpdateTotals();

            #endregion

            Owner.StatCap = StatCap;

            Owner.RawStr = RawStr;
            Owner.RawDex = RawDex;
            Owner.RawInt = RawInt;

            Owner.SkillsCap = SkillsCap;

            Owner.Skills.For(
                (i, s) =>
            {
                Skill sk = Skills[i];

                s.SetCap(sk.Cap);
                s.SetBase(sk.Base, true, false);
            });

            return(true);
        }