Exemplo n.º 1
0
    public override bool Use(Creature obj)
    {
        switch(RefItemID)
        {
        case 21:
            obj.WeaponHolder.ActiveWeaponSkillFire(Const.NuclearRefItemId, obj.transform.eulerAngles.y);
            break;
        case 22:
            return obj.ApplyMachoSkill();
        case 23:
            return obj.ApplyHealingSkill();
        case 24:
            return obj.ApplyDamageMultiplySkill();
        case 25:
            Weapon weapon = obj.WeaponHolder.GetPassiveSkillWeapon(130);
            if (weapon != null)
            {
                weapon.LevelUp();
            }
            else
            {
                obj.EquipPassiveSkillWeapon(new ItemWeaponData(130), new RefMob.WeaponDesc());
            }
            break;

        }
        return true;
    }
Exemplo n.º 2
0
    public void ApplyOptions(Creature obj, bool levelup)
    {
        if (m_refItem.levelup == null || m_refItem.levelup.optionPerLevel == null)
            return;

        foreach(RefPriceCondition.RefOptionPerLevel op in m_refItem.levelup.optionPerLevel)
        {
            float optionValue = 0f;
            if (op.levelPer == false)
            {
                if (levelup == false)
                {
                    if (Level >= op.level)
                        optionValue = op.option.values[0];
                }
                else
                {
                    if (Level == op.level)
                        optionValue = op.option.values[0];
                }
            }
            else
            {
                if (levelup == false)
                    optionValue = op.option.values[0]*(Level/op.level);
                else
                {
                    if (Level%op.level == 0)
                        optionValue = op.option.values[0];
                }
            }

            switch(op.option.type)
            {
            case Option.DmgMultiplier:
                obj.m_creatureProperty.DamageMultiPlier += optionValue;

                break;
            case Option.MoveSpeed:
                obj.m_creatureProperty.AlphaMoveSpeed += optionValue;
                break;
            case Option.DmgReduction:
                obj.m_creatureProperty.DamageReduction += optionValue;
                break;
            case Option.Weapon:
                int weaponRefItemId = (int)optionValue;
                if (weaponRefItemId == 0)
                    break;

                if (weaponRefItemId == Const.EmbersRefItemId)
                {
                    obj.SetSubWeapon(obj.WeaponHolder.MainWeapon, new ItemWeaponData(Const.EmbersRefItemId), new RefMob.WeaponDesc());
                }
                else
                {
                    ItemWeaponData weaponData = new ItemWeaponData((int)optionValue);

                    weaponData.Level = (int)op.option.values[1];
                    obj.EquipPassiveSkillWeapon(weaponData, new RefMob.WeaponDesc());
                }
                break;
            case Option.Strength:
                obj.m_creatureProperty.AlphaPhysicalAttackDamage += (int)optionValue;
                break;
            case Option.MaxHp:
                obj.m_creatureProperty.AlphaMaxHP += (int)optionValue;
                break;
            case Option.MaxSp:
                obj.m_creatureProperty.AlphaMaxSP += (int)optionValue;
                break;
            case Option.RegenSp:
                obj.m_creatureProperty.AlphaSPRegen += optionValue;
                break;
            case Option.TapDamage:
                obj.m_creatureProperty.TapDamage += (int)optionValue;
                break;
            case Option.Critical:
                obj.m_creatureProperty.AlphaCriticalChance += optionValue;
                break;
            case Option.CriticalDmg:
                obj.m_creatureProperty.AlphaCriticalDamage += optionValue;
                break;
            case Option.LifeSteal:
                obj.m_creatureProperty.AlphaLifeSteal += optionValue;
                break;
            case Option.Dodge:
                obj.m_creatureProperty.Dodge += optionValue;
                break;
            case Option.GainExtraGold:
                obj.m_creatureProperty.GainExtraGold += optionValue;
                Creature owner = obj.GetOwner();
                if (owner != null)
                {
                    owner.m_creatureProperty.GainExtraGold += optionValue;
                }
                break;
            }

        }
    }