Aller au contenu

Photo

Use magical Devices


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

#1
Talon

Talon
  • Members
  • 51 messages

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)



#2
Talon

Talon
  • Members
  • 51 messages

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?



#3
Shadooow

Shadooow
  • Members
  • 4 471 messages

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?



#4
Shadooow

Shadooow
  • Members
  • 4 471 messages

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.



#5
Talon

Talon
  • Members
  • 51 messages

Hii!! thanks for answer shadoow! but like a noob i must do it step by step or i go in panic :D

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 ?



#6
Shadooow

Shadooow
  • Members
  • 4 471 messages

 

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.



#7
Shadooow

Shadooow
  • Members
  • 4 471 messages

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();



#8
Talon

Talon
  • Members
  • 51 messages

Thanks shadoow! perfect :D