Some good news and some bad news.
The good news is that most of what you want can be done via tag based scripting with a script like so:
#include "x2_inc_switches"
void main()
{
// * This code runs when the item has the OnHitCastSpell: Unique power property
// * and it hits a target(weapon) or is being hit (armor)
// * Note that this event fires for non PC creatures as well.
int iEvent = GetUserDefinedItemEventNumber();
if (iEvent != X2_ITEM_EVENT_ONHITCAST) return;
int iPercent = d100();
if (iPercent <= 20)
{
object oTarget = GetSpellTargetObject();
object oPC = OBJECT_SELF;
object oItem = GetSpellCastItem();
int iDamage = 30 + d12();
effect eEffect = EffectDamage(iDamage, DAMAGE_TYPE_COLD);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oTarget);
//Example visual effect to apply to the target
//effect eVis = EffectVisualEffect(VFX_FNF_DEMON_HAND);
//ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
Just make sure you give this script the same name as the tag of the weapon or ammunition you are using for this.
The bad news is that I beleive there is no vfx for phantasmal killer. I think it is a hard coded visual. So the only thing you might be able to do is cast a fake spell in this script but that would require the player to stop in the middle of fighting and cast the spell, which includeds the hand gestures. Only other option would be to also add the actual On Hit Cast Spell (Phantasmal Killer) to the weapon in addition to the Unique power.
Hope that helps. Good luck.
Modifié par GhostOfGod, 30 septembre 2010 - 02:57 .