Aller au contenu

Photo

onhit add ability


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

#1
Surek

Surek
  • Members
  • 94 messages

Is there any way to add an ability increase on a successful on hit? Specifically a temporary strength increase.



#2
henesua

henesua
  • Members
  • 3 878 messages

on hit cast spell would work if you created a spell that does what you want.



#3
Pstemarie

Pstemarie
  • Members
  • 2 745 messages

Use OnHit Cast Spell: Unique Power (OnHit) as the weapon's item property. Then you'll need a unique item script whose name matches the tag of the item you created. Below is an example script that casts Bull's Strength on the weapon wielder when the target is hit.

#include "x2_inc_switches"
 
void main()
{
    int nEvent =GetUserDefinedItemEventNumber();
    object oPC, oItem;
 
    if (nEvent ==X2_ITEM_EVENT_ONHITCAST)
    {
        //do bull's strength bonus on the wielder for one hour
        oItem = GetSpellCastItem();
        oPC = GetItemPossessor(oItem);
        
        effect eStr = EffectAbilityIncrease(ABILITY_STRENGTH, 4);
        effect eVis = EffectVisualEffect(VFX_IMP_IMPROVE_ABILITY_SCORE);
        effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
        effect eLink = EffectLinkEffects(eStr, eDur);
 
        ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC);
        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, HoursToSeconds(1));
    }
}

  • Squatting Monk et henesua aiment ceci