Author Topic: Use magical Devices  (Read 366 times)

Legacy_Talon

  • Jr. Member
  • **
  • Posts: 93
  • Karma: +0/-0
Use magical Devices
« on: June 30, 2014, 10:16:32 am »


               

I need to add a better script for this skill...like failure, critical fail etc.. and not only for spells but for every magical device used by player (rod,staff, etc..).


 


i saw this page http://nwn.wikia.com...ice_and_scrolls


Don't know if there is something better..


but i didn't understand how add it to my module (with 1.71 patch) or how download it (no links)



               
               

               
            

Legacy_Talon

  • Jr. Member
  • **
  • Posts: 93
  • Karma: +0/-0
Use magical Devices
« Reply #1 on: July 06, 2014, 10:07:55 am »


               

I saw that i must add the code for EVERY spell script..it is a bit long!!


there is not a better way or a simple script that only check the cost in gp of the object and add a standard server +x difficult to all items?



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Use magical Devices
« Reply #2 on: July 06, 2014, 11:46:10 am »


               

there is, with 1.71 you can alter the internal spellhook without need to change every script. Internal spellhook is a script that runs ffrom the X2PreSpellCastCode function which all spells has. In this script you can cancel the spell.


 


check the script 70_spellhook - you should be able to incorporate the above "fix" into it.


 


PS. I think that usual spellhook (http://nwn.wikia.com/wiki/Spellhook) wont be useable because you want to replace the standard UMD scroll check, doesnt you?



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Use magical Devices
« Reply #3 on: July 06, 2014, 12:28:33 pm »


               

Ok I realized that there is a way to do that in ordinary spellhook.


 


Just disable the module switch for UMD on scrolls and there won't be a reason why this wouldnt work in ordinary spellhook. I didn't realized that this feature is not enabled by default and is a module switch.


 


At any way it doesn't matter which type of spellhook you choose. Functionality will be the same.



               
               

               
            

Legacy_Talon

  • Jr. Member
  • **
  • Posts: 93
  • Karma: +0/-0
Use magical Devices
« Reply #4 on: July 07, 2014, 02:02:03 pm »


               

Hii!! thanks for answer shadoow! but like a noob i must do it step by step or i go in panic '<img'>


how disable the module switch for UMD?


i don't have 70_spellhook in my module..but i suppose is already inside with your patch no? so i must add it (with the script above) copyng in temp dir of module ?


               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Use magical Devices
« Reply #5 on: July 07, 2014, 02:20:40 pm »


               

 


i don't have 70_spellhook in my module..but i suppose is already inside with your patch no? so i must add it (with the script above) copyng in temp dir of module ?



Will answer this first because its related to the second question. scripts from CPP (prefix 70_) are treated as a core game resources (lowest priority)


 


To open such script, you need to toggle "game resources" checkbox in the open script window, then you will be able to find it and open it.


 




how disable the module switch for UMD?




 


Open standard script x2_mod_def_load (if not in your module follow the step above).


 


There is line:


SetModuleSwitch (MODULE_SWITCH_ENABLE_UMD_SCROLLS, TRUE);


comment this line out and compile the script


 


At any way. Since you are not a scripter expert it will be probably better to use the "standard spellhook" instead of the internal (70_spellhook). The internal contains quite a load of already present code which you would have to orient in first. Using standard user spellhook - instructions here - will give you clean script.



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Use magical Devices
« Reply #6 on: July 07, 2014, 03:21:05 pm »


               

Or even better and easier, do it in x2_pc_umdcheck script. No need to disable anything - no need to enable anything.


 


All you need is to paste the first code somewhere above there and then replace line


 


int nRet = X2_UMD();


 


with


 


int nRet = SpellFailure();



               
               

               
            

Legacy_Talon

  • Jr. Member
  • **
  • Posts: 93
  • Karma: +0/-0
Use magical Devices
« Reply #7 on: July 08, 2014, 11:11:16 am »


               

Thanks shadoow! perfect '<img'>