Author Topic: wand/potion making  (Read 338 times)

Legacy_acomputerdood

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: +0/-0
wand/potion making
« on: February 02, 2013, 06:43:49 pm »


               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 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
wand/potion making
« Reply #1 on: February 02, 2013, 07:16:52 pm »


               is it listed in iprp_spells.2da
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
wand/potion making
« Reply #2 on: February 02, 2013, 07:32:02 pm »


               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;
   }
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
wand/potion making
« Reply #3 on: February 02, 2013, 07:33:05 pm »


                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 .