Aller au contenu

Photo

Scripting Trouble: Accidentally added bonues attribute points on level-up


  • Veuillez vous connecter pour répondre
2 réponses à ce sujet

#1
Dassaur

Dassaur
  • Members
  • 2 messages
Hi all.

Firstly just pointing out I am a novice at scripting.

I was adding some new custom talents (basically giving an arcane warrior some shield talents such as overpower, etc) when somehow, whenever a character levels up and attribute points are allocated, they receive two points into a stat where only one was allocated. To be a bit more clear:

Normal:
Player levels up
Player has 3 attribute points to allocate
Player adds the points to strength, boosting it by 3 (if strength was on 17, it is now 20).

My custom:
Player levels up
Player has 3 attribute points to allocate
Player adds the points to strength, boosting it by 6 (if strength was on 17, it is now 23).

Essentially what has happened, is that upon allocation of attribute points, 2 are added intead of 1.

The only thing I changed were the following:
2da_constants (merely added in the talent, e.g. const int ABILITY_TALENT_MAGE_FLURRY = 499999; (and a few others)

talent_modal (mage flurry is essentially momentum, except for 1h + shield:

        case ABILITY_TALENT_MAGE_FLURRY:
        {
            eEffects[0] = EffectModifyProperty(PROPERTY_ATTRIBUTE_ATTACK_SPEED_MODIFIER, MOMENTUM_ANIMATION_SPEED_INCREASE);
            eEffects[1] = EffectModifyProperty(PROPERTY_ATTRIBUTE_REGENERATION_STAMINA_COMBAT, MOMENTUM_STAMINA_REGENERATION_PENALTY_COMBAT);
            eEffects[1] = SetEffectEngineInteger(eEffects[1], EFFECT_INTEGER_VFX, Ability_GetImpactObjectVfxId(stEvent.nAbility));

            break;
        }


talent_singletarget (this is my example for assault):
        case ABILITY_TALENT_MAGIC_FRENZY:
        {
            object oWeapon  = GetItemInEquipSlot(INVENTORY_SLOT_MAIN, stEvent.oCaster);

            // if the attack hit
            int nResult = Combat_GetAttackResult(stEvent.oCaster, stEvent.oTarget, oWeapon, ASSAULT_ATTACK_BONUS, stEvent.nAbility );
            if (IsCombatHit(nResult) == TRUE)
            {
                // shield mastery bonus
                int bMaximum = HasAbility(stEvent.oCaster, ABILITY_TALENT_GRANDMASTER_MANA_WALL);

                // normal damage
                float fDamage = Combat_Damage_GetAttackDamage(stEvent.oCaster, stEvent.oTarget, oWeapon, nResult, ASSAULT_AP_BONUS, bMaximum);
                fDamage *= ASSAULT_DAMAGE_MULTIPLIER;
                eEffect = EffectImpact(fDamage, oWeapon, 0, stEvent.nAbility);
                Combat_HandleAttackImpact(stEvent.oCaster, stEvent.oTarget, nResult, eEffect);
            }

            break;
        }

Extra Information:
I am certain that it is within these scripts; without them it does not happen (my talents appear due to being in ABI m2da but obviously have no effect.

Any help would be greatly appreciated

Thanks.

#2
TimelordDC

TimelordDC
  • Members
  • 923 messages
Does your module have module_core as your module script? If so, remove it and assign (none) to the module script.

#3
Dassaur

Dassaur
  • Members
  • 2 messages
Thanks mate! youre a champion!