Is there any way to add an ability increase on a successful on hit? Specifically a temporary strength increase.
onhit add ability
Débuté par
Surek
, avril 07 2014 12:05
#1
Posté 07 avril 2014 - 12:05
#2
Posté 07 avril 2014 - 12:49
on hit cast spell would work if you created a spell that does what you want.
#3
Posté 07 avril 2014 - 12:55
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





Retour en haut






