logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Create Spells on the fly via Struct editing?

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development
View previous topic :: View next topic  
Author Message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Wed Jun 20, 2012 17:55    Post subject: Create Spells on the fly via Struct editing? Reply with quote

I was browsing the nwn32 sources, and found the struct definitions of for instance - Spells etc.

http://nwn.virusman.ru/svn/nwnx2-win32/branches/maxrock/include/CNWSpell.h

I was just wondering,
If we had a Spell Structure definition, like we have here.
Is it possible, with a little effort, to actually create a constructor, in nwnscript, that allows us to create a Spell?

Eg -
Specify all the offset information, and details
or even better, we call a NWNX Function like

struct sSpellInfo = sNWNX_Funcs_GetBaseSpell();

Which would return a detailed struct definition in nwn_script, which we then edit, and then we feed it back to nwnx, and then somehow force the server to cast the spell that we had just defined?

eg

Code:

struct sSpellInfo = NWNX_Funcs_GetBaseSpell();
sSpellInfo.sp_name_tlk = 53322;  //Change the spell name to something else in tlk.
sSpellInfo.sp_school = 4; // Change the spell school
sSpellInfo.sp_impactscript = "myNewSpell"l //The script to fire on spell impact.

NWNX_Funcs_CastCustomSpell(oPC,oTarget,sSpellInfo);


Does anyone think this has merit, or potential to be possible?
It would potentially open up the ability to create custom spells without needing to edit tlk or 2da's.
(If you can live with re-using tlk entries)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group