Aller au contenu

Photo

wand/potion making


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

#1
acomputerdood

acomputerdood
  • Members
  • 219 messages
so, i have a spell remove blindness/deafness, that can't be made into a wand.  i'm guessing it has something to do with the script itself.  what's the mechanism/trigger to allow a spell be made into a potion/wand?  is there a problem with below script:

//::///////////////////////////////////////////////
//:: Remove Effects
//:: NW_SO_RemEffect
//:: Copyright © 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
    Takes the place of
        Remove Disease
        Neutralize Poison
        Remove Paralysis
        Remove Curse
        Remove Blindness / Deafness
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 8, 2002
//:://////////////////////////////////////////////
#include "wm_include"
#include "NW_I0_SPELLS"
#include "ww_inc"
//#include "x2_inc_spellhook"




void main(){
    if (WildMagicOverride()) { return; }
    SendMessageToPC(OBJECT_SELF, "remeffect");
    //Declare major variables
    int nSpellID = GetSpellId();
    object oTarget = GetSpellTargetObject();
    int nEffect1;
    int nEffect2;
    int nEffect3;
    effect eVis = EffectVisualEffect(VFX_IMP_REMOVE_CONDITION);
    //Check for which removal spell is being cast.
    if(nSpellID == SPELL_REMOVE_BLINDNESS_AND_DEAFNESS)
    {
        nEffect1 = EFFECT_TYPE_BLINDNESS;
        nEffect2 = EFFECT_TYPE_DEAF;
    }
    else if(nSpellID == SPELL_REMOVE_CURSE)
    {
        nEffect1 = EFFECT_TYPE_CURSE;
        // Remove PC Lycanthropy
        if(GetLocalInt(oTarget,"AFF_WEREWOLF")) CureWerewolf(oTarget,3);
    }
    else if(nSpellID == SPELL_REMOVE_DISEASE || nSpellID == SPELLABILITY_REMOVE_DISEASE)
    {
        nEffect1 = EFFECT_TYPE_DISEASE;
        nEffect2 = EFFECT_TYPE_ABILITY_DECREASE;
        // Remove PC Lycanthropy
    object oToken = GetItemPossessedBy(oTarget,"DALA_CONVERTED");
    if(GetLocalInt(oToken,"AFF_WEREWOLF"))CureWerewolf(oTarget,2,OBJECT_SELF);
    }
    else if(nSpellID == SPELL_NEUTRALIZE_POISON)
    {
        nEffect1 = EFFECT_TYPE_POISON;
        nEffect2 = EFFECT_TYPE_DISEASE;
        nEffect3 = EFFECT_TYPE_ABILITY_DECREASE;
    }




    //Fire cast spell at event for the specified target
    SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, nSpellID, FALSE));
    //Remove effects
    RemoveSpecificEffect(nEffect1, oTarget);
    if(nEffect2 != 0)
    {
        RemoveSpecificEffect(nEffect2, oTarget);
    }
    if(nEffect3 != 0)
    {
        RemoveSpecificEffect(nEffect3, oTarget);
    }
    ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}






obviously, this part fires:

    SendMessageToPC(OBJECT_SELF, "remeffect");

when trying to make a potion, but then nothing happens.  no feedback messages.  it doesn't even check for gold because i can attempt with 0 gold and it gives no warning.

Modifié par acomputerdood, 02 février 2013 - 06:49 .


#2
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
is it listed in iprp_spells.2da

#3
Shadooow

Shadooow
  • Members
  • 4 471 messages
actually the reason this spell cannot be craft is in script

each script must have this line inside and at the top to allow bioware spell imbuing:

if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}

#4
henesua

henesua
  • Members
  • 3 883 messages
 Lightfoot8 nailed it (as usual)
iprp_spells.2da is the place to define spell properties that can be added to items.
The Krit created an improved framework for this process as well with A Better Craft Magic. You still need to use iprp_spells.2da, but his system opens up much more flexibility for item crafting in game.

Also, as an aside, for allowing players to cast a spell on an item you need to edit
des_crft_spells.2da


edit... and lastly  yes, that spellhook is essential. Thanks, ShaDoOoW, for catching that.

Modifié par henesua, 02 février 2013 - 07:34 .