1: Shield; If you have Greater Spell Focus Abjuration, makes immunity to Isaac's Greater and Lesser Misslestorm. Can someone tell me if this is scripted right?
#include "NW_I0_SPELLS"
#include "x2_inc_spellhook"
void main(){
/* Spellcast Hook Code Added 2003-06-20 by Georg If you want to make changes to all spells, check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode()) { // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell return; }
// End of Spell Cast Hook
//Declare major variables object oTarget = OBJECT_SELF; object oItem = GetItemInSlot(INVENTORY_SLOT_CARMOUR,oTarget); effect eVis = EffectVisualEffect(VFX_IMP_AC_BONUS); int nMetaMagic = GetMetaMagicFeat();
effect eArmor = EffectACIncrease(4, AC_DEFLECTION_BONUS); effect eSpell = EffectSpellImmunity(SPELL_MAGIC_MISSILE); effect eDur = EffectVisualEffect(VFX_DUR_GLOBE_MINOR);
effect eLink = EffectLinkEffects(eArmor, eDur); eLink = EffectLinkEffects(eLink, eSpell);
int nDuration = GetCasterLevel(OBJECT_SELF); // * Duration 1 turn if (nMetaMagic == METAMAGIC_EXTEND) //Duration is +100% { nDuration = nDuration * 2; } //Fire spell cast at event for target SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, 417, FALSE));
RemoveEffectsFromSpell(OBJECT_SELF, GetSpellId());
//Apply VFX impact and bonus effects ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, TurnsToSeconds(nDuration));
if (GetHasFeat(FEAT_GREATER_SPELL_FOCUS_ABJURATION, oTarget) == TRUE ) { int nSpell = SPELL_ISAACS_GREATER_MISSILE_STORM;
itemproperty ipAdd = ItemPropertySpellImmunitySpecific(nSpell); IPSafeAddItemProperty(oItem, ipAdd);
int nSpell2 = SPELL_ISAACS_LESSER_MISSILE_STORM;
itemproperty ipAdd2 = ItemPropertySpellImmunitySpecific(nSpell2); IPSafeAddItemProperty(oItem, ipAdd2); }
if (GetHasFeat(FEAT_SPELL_FOCUS_ABJURATION, oTarget) == TRUE ) {
int nSpell3 = SPELL_ISAACS_LESSER_MISSILE_STORM;
itemproperty ipAdd3 = ItemPropertySpellImmunitySpecific(nSpell3); IPSafeAddItemProperty(oItem, ipAdd3); }}
Now, how would I make the spells Flame Weapon, Greater Magic Weapon, Darkfire, and Magic Weapon not work on weapons that already have properties? Meaning, the items must have no other properties.
Spell Changes
Débuté par
Kingdom_Of_Hearts
, nov. 16 2013 09:59
#1
Posté 16 novembre 2013 - 09:59
#2
Posté 18 novembre 2013 - 07:03
if(GetIsObjectValid(oMyWeapon) )
{
//I copied part of the greater magic weapon code and inserted the following few lines
effect 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;
}
{
//I copied part of the greater magic weapon code and inserted the following few lines
effect 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 .





Retour en haut






