if(GetIsObjectValid(oMyWeapon) )
{
//I copied part of the greater magic weapon code and inserted the following few lineseffect e = GetFirstItemProperty(oMyWeapon);
if( GetIsItemPropertyValid(e) ) {
SendMessageToPC(GetItemPossessor(oMyWeapon),"This spell cannot enchant a weapon with existing properties.");
return;
}
//As long as there is an item property that is valid, this would exit the script and not try to enchant it. This is what I would try anyway. SignalEvent(GetItemPossessor(oMyWeapon), EventSpellCastAt(OBJECT_SELF, GetSpellId(), FALSE));
if (nDuration>0)
{
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, GetItemPossessor(oMyWeapon));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, GetItemPossessor(oMyWeapon), HoursToSeconds(nDuration));
AddGreaterEnhancementEffectToWeapon(oMyWeapon, (HoursToSeconds(nDuration)), nCasterLvl);
}
return;
}
Modifié par Terrorble, 18 novembre 2013 - 07:05 .