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 
 
NWNX_Patch
Goto page Previous  1, 2, 3 ... 32, 33, 34 ... 42, 43, 44  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development
View previous topic :: View next topic  
Author Message
Antegate



Joined: 20 Apr 2012
Posts: 100

PostPosted: Thu Sep 28, 2017 20:35    Post subject: Reply with quote

is working =)

ShaDoOoW, whether it is possible to make that some spells can not be chosen on the levelup, but they be added by reading the scrolls?
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Thu Sep 28, 2017 21:01    Post subject: Reply with quote

NWNCX_Patch and NWNX_Patch v1.33d

DOWNLOAD

Just quick update with one feature.

Revisited fixes/features:
- unlimited casting feature will now work for prepared-type of spellcasters as well
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Thu Sep 28, 2017 21:05    Post subject: Reply with quote

Antegate wrote:
ShaDoOoW, whether it is possible to make that some spells can not be chosen on the levelup, but they be added by reading the scrolls?

Yes its doable. I was already experimenting with this long time ago with hooking function GetSpellExpansionLevel and it worked. But I will try to remake this in another way.

EDIT: ok found better and easier way. I can enable this with new column Hidden in spells.2da. But I see no good way to make that spell hidden only for single class (if you had second wizard-like class).
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
Antegate



Joined: 20 Apr 2012
Posts: 100

PostPosted: Thu Sep 28, 2017 21:45    Post subject: Reply with quote

Quote:
EDIT: ok found better and easier way. I can enable this with new column Hidden in spells.2da. But I see no good way to make that spell hidden only for single class (if you had second wizard-like class).

2da.
Maybe I do not quite understand.
Maybe associate with SpellType?
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Thu Sep 28, 2017 22:20    Post subject: Reply with quote

Antegate wrote:
Quote:
EDIT: ok found better and easier way. I can enable this with new column Hidden in spells.2da. But I see no good way to make that spell hidden only for single class (if you had second wizard-like class).

2da.
Maybe I do not quite understand.
Maybe associate with SpellType?

Don't worry I already figured it out.

New column named "Hidden" in spells.2da, value 255 = hidden for all classes, other values = hidden for class with that id.

In situation where you would want the spell hidden for two classes but not all, you can make a copy of that spell. Remove class level from original and add class level to new one and then make it hidden as well. That will produce demanded effect. It will need to use hak pack but I see no other way to do it.

This feature is quite trivial and I could do it in less than hour but I will try to enable it for cleric-like casters who doesn't learn spells first if its doable. (Spontaneous casters bard, sorcerer, should work without problems if you use function NWNXPatch_AddKnownSpell)
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
Antegate



Joined: 20 Apr 2012
Posts: 100

PostPosted: Fri Sep 29, 2017 5:44    Post subject: Reply with quote

very cool ^)
Now can do spell research Smile)
Back to top
View user's profile Send private message
Valbor



Joined: 26 Dec 2016
Posts: 145

PostPosted: Fri Sep 29, 2017 11:40    Post subject: Reply with quote

AOOSetIsSneak(int nValue) not working in 70_s2_aoo?
My code:
Code:

        /*
        //Sneaky AOO test
        if(GetHasFeat(FEAT_SNEAK_ATTACK,oTarget) || GetHasFeat(FEAT_PRESTIGE_DEATH_ATTACK_1,oTarget))
        {
            AOOSetIsSneak(1);
        }
        */
// Effects
////////////////////////////////////////////////////////////////////////////////
        // Sneaky AOO
        if((GetHasFeat(FEAT_SNEAK_ATTACK, oSelf) || GetHasFeat(FEAT_BLACKGUARD_SNEAK_ATTACK_1D6, oSelf)) && GetHasFeat(FEAT_PRESTIGE_DEATH_ATTACK_1, oSelf))
        {AOOSetIsSneak(3);} // Sneak attack + Death attack
        else if(GetHasFeat(FEAT_SNEAK_ATTACK, oSelf) || GetHasFeat(FEAT_BLACKGUARD_SNEAK_ATTACK_1D6, oSelf))
        {AOOSetIsSneak(1);} // Sneak attack
        else if(GetHasFeat(FEAT_PRESTIGE_DEATH_ATTACK_1, oSelf))
        {AOOSetIsSneak(2);} // Death attack
////////////////////////////////////////////////////////////////////////////////


But it worked for me NWNXPatch_SetAttackSneak(oSelf, 3);} // Sneak attack + Death attack.
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Fri Sep 29, 2017 20:19    Post subject: Reply with quote

Valbor wrote:
AOOSetIsSneak(int nValue) not working in 70_s2_aoo?

It should work. Could you make some further tests? Basically, 70_s2_aoo sets variable AOO_SNEAK and this variable should be read in 70_s2_specattk - try add some debugging message in 70_s2_specattk into the code for the Attack of Opportunity whether the variable exists and whats its value.
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
Valbor



Joined: 26 Dec 2016
Posts: 145

PostPosted: Fri Sep 29, 2017 21:11    Post subject: Reply with quote

ShaDoOoW wrote:
Valbor wrote:
AOOSetIsSneak(int nValue) not working in 70_s2_aoo?

It should work. Could you make some further tests? Basically, 70_s2_aoo sets variable AOO_SNEAK and this variable should be read in 70_s2_specattk - try add some debugging message in 70_s2_specattk into the code for the Attack of Opportunity whether the variable exists and whats its value.

Hmm... working fine in 70_s2_specattk, and even better than in 70_s2_aoo:
Code:
        else if(nType == SPECIAL_ATTACK_ATTACK_OF_OPPORTUNITY)//attack of opportunity
        {
            if(GetHasFeat(FEAT_OPPORTUNIST)) nBonus = 4;
          //if(GetLocalInt(OBJECT_SELF,"AOO_SNEAK") != 0)
            {
              //NWNXPatch_SetAttackSneak(OBJECT_SELF, GetLocalInt(OBJECT_SELF,"AOO_SNEAK"));
                NWNXPatch_SetAttackSneak(OBJECT_SELF, 3); // Sneak attack + Death attack
            }
        }
Back to top
View user's profile Send private message
DarkSet



Joined: 06 Jun 2016
Posts: 98

PostPosted: Fri Sep 29, 2017 23:05    Post subject: Reply with quote

ShaDoOoW, thanks for your work.
Have you reworkes server plugin in use function to return plugin version instead of true/false? I've not seen this in updates, maybe missed?
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Sat Sep 30, 2017 9:54    Post subject: Reply with quote

DarkSet wrote:
ShaDoOoW, thanks for your work.
Have you reworkes server plugin in use function to return plugin version instead of true/false? I've not seen this in updates, maybe missed?

//Determines whether the nwnx_patch or nwncx_patch plugin is running and working. This is usefull in single player
//modules where builder wants to use some custom feature from patch plugin but doesn't want to restrict the module
//to require patch 1.72. If patch plugin won't run, he can code it differently and print some feedback stating he
//needs to play module with 1.72 to obtain that feature.
//The return value is a patch plugin version ie. 124 (for 1.24) or 0 if nwnx is not running.
int NWNXPatch_IsInUse();
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Sat Sep 30, 2017 13:41    Post subject: Reply with quote

NWNCX_Patch and NWNX_Patch v1.33e

DOWNLOAD

Spell researching.

Revisited fixes/features:
- function NWNXPatch_AddKnownSpell will work properly in case bIgnoreLimit is set to TRUE on non spontaneous caster

New fixes/features:
- plugin now allows to hide certain spells from player. This works for all spellcaster types and is controlled by new column in spells.2da Hidden, values: 255 - hidden for all classes, other values equal to "hidden for class with this id" ie. 10 - hidden for wizard only

Added spells.2da into folder with example 2da, this 2da has these changes to show nwnx_patch features:
- druid can cast summon creature I-IX spontaneously
- following spells are hidden to all classes: Bless, Mage Armor, Magic Missile
- following spells are hidden to cleric only: Doom
- following spells are hidden to druid only: Ultravision
- following spells are hidden to wizard only: Magic Weapon

Development notes:
Because learnining spells on lvlup or accessing spells in spellbook is controlled client-side and client doesn't know local variables, this has to be controlled by 2DA. Making spell hidden to player is easy and works flawlessly, however there might be a small problem making spell available again for certain player.

You might need to give player scroll with hidden spell (if he is wizard) or use function NWNXPatch_AddKnownSpell to grant player this spell. Once learned, spell will appear in spellbook properly and player will be able to prepare/cast it.

There is just one small problem with spontaneous casters like sorcerer or bard who have given limit on number of spells known. This means that you will have to use NWNXPatch_AddKnownSpell with parameter bIgnoreLimit = TRUE to force engine add this spell to their repertoar. This will however have side-effects you might not want - first of all, this spell or another might be removed upon login if your server uses ELC. Even if this doesn't happen, player still knows 1 more spell that he should known.

If you don't want that, you will probably have to create some conversation workaround where player choose which spell he wants to forgot.

Maybe I will find some way how to make specific spell available for given player, but right now you will have to suffice with this.
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
Antegate



Joined: 20 Apr 2012
Posts: 100

PostPosted: Sat Sep 30, 2017 15:47    Post subject: Reply with quote

Thanks much. =)

Could you add the softcode for the AnimalEmpathy skill? You said you could do it as well.
Back to top
View user's profile Send private message
Antegate



Joined: 20 Apr 2012
Posts: 100

PostPosted: Sat Sep 30, 2017 20:21    Post subject: Reply with quote

Exactly what is needed. Everything works as I dreamed. =)
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Sat Sep 30, 2017 20:57    Post subject: Reply with quote

Antegate wrote:
Thanks much. =)

Could you add the softcode for the AnimalEmpathy skill? You said you could do it as well.

I said its not a priority. Will see if I can find a time to do it...
Antegate wrote:
Exactly what is needed. Everything works as I dreamed. =)

It will be even better, I found a way how to unhide spell. My plan is to release a function NWNXPatch_SetSpellHidden with which you can make spell hidden or unhide it without 2DA. 2da column will probably stay as this would not be permanent and would have to be reapplied each login, but in situations like hiding certain spells from player before he finish a quest or levelup in class or acquire lvl 21, this might be better option as it would allow to learn the spell on lvlup by normal means.
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
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
Goto page Previous  1, 2, 3 ... 32, 33, 34 ... 42, 43, 44  Next
Page 33 of 44

 
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