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 
 
My personal modified version of Terra's cool

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



Joined: 20 Aug 2005
Posts: 584

PostPosted: Fri Jul 05, 2013 19:39    Post subject: My personal modified version of Terra's cool Reply with quote

I made some modifications and added several new functions/hooks into cool that maybe someone find usefull.

DOWNLOAD - source
DOWNLOAD - compiled plugin

Im not able to separate them into new plugin, so seeking help for that, aka there is lots of 3.5dnd rules stuff depending on custom feats too. Would be nice to either:
- detach into new plugin nwnx_35dnd
or
- propose better idea of how to deactivate these changes (which not everyone want to use) in a nice way Smile

Best would be to add default cool into github and try to add some of my changes in there for everyone. I already sent this to terra like half year ago, but seems he/she is away nwnx for a while.

Its also 3months till I was working on it and I dont know if I will continue, there is lots of unused code and many uncommented code too so might be messy to read it after me - i kept it in there so i wouldnt try to hook something i found not working twice.

From what I remember its there:
- modified combat modes to always stay sticky until pc turns them off
- 3.5 improved uncanny dodge - aka immunity to sneak attack unless rogue is 4lvl higher
- natural spell - quite unstable and requires heavy nwscript workarounds, rather stay away from that
- ILR override by variable, works only for modules with ILR on, then it uses variable ILR on item, if not present item can be used without (aka 0)
- unarmed damage hook (so you can modify unarmed damage for everyone)
- resolvedefensivemodifiers hook (where i made an adjustion to allow multiple deflect arrows)
- addAttackOfOpportunity hook (where i made an adjustion to allow multiple AOOs)
- GetBaseAttackbonus (where i made an adjustion with regards to the divine power (as per 3.5dnd))
- InitializeNumberOfAttacks
- some new events


INI
Code:
LearnScroll = 1;
ILR = 1
OnPreLevelUp = 1 ;fires script when player hits the level up button
ImprovedUncannyDodge = 1 ;enables improved uncanny dodge per DnD 3.5 feats.2da line 205
AOO = 1 ;enables Combat Reflexes feat
SavingThrows = 1
Deflect = 1 ;enables Infinite Deflection and Precise Shot feats
Unarmed = 1 ;enables to override Unarmed Damage
Save = 1 ;enables internal save char hook - required for natural spell
Haste/Slow = 1 ;enables custom haste/slow bonuses/penalties
Item = 1 ;enables equip/use hook
DDStance = 1
FavoredEnemy = 1
Test = 1
Ability = 0;


atm the feats numbers are hardcoded inside...


code snippet from nwnx_cool.nss

Code:

    else if(nEvent == 90)
    {
    object oTarget = GetEventTarget();
//        DebugString("OnPCPhysicalAttacked: target",GetName(oTarget));
    //runs when call exportsinglecharacter or before exiting from game
    //SendMessageToPC(oPC,"save server character");
    }
    else if(nEvent == 91)
    {
    //runs when call exportsinglecharacter or before exiting from game
    //SendMessageToPC(oPC,"save server character");
    }
    else if(nEvent == 94)//OnWillSave
    {
        if(!GetHasFeat(300,oPC))
        {
            int nTh = 1;
            object oAlly = GetNearestCreature(CREATURE_TYPE_REPUTATION,REPUTATION_TYPE_FRIEND,oPC,nTh,CREATURE_TYPE_IS_ALIVE,TRUE);
            while(GetIsObjectValid(oAlly) && GetDistanceBetween(oPC,oAlly) <= 10.0)
            {
                if(GetHasFeat(300,oAlly))
                {
                    SetLocalInt(oPC,"AoC_BONUS",4);
                    return;
                }
                oAlly = GetNearestCreature(CREATURE_TYPE_REPUTATION,REPUTATION_TYPE_FRIEND,oPC,++nTh,CREATURE_TYPE_IS_ALIVE,TRUE);
            }
            SetLocalInt(oPC,"AoC_BONUS",0);
        }
        else
        {
            SetLocalInt(oPC,"AoC_BONUS",4);
        }
    }
    else if(nEvent == 95)
    {
    effect e = GetFirstEffect(oPC);
     while(GetIsEffectValid(e))
     {
      if(GetEffectType(e) == EFFECT_TYPE_POLYMORPH)
      {
      SendMessageToPC(oPC,"Cant levelup in polymorph!");
      ByPass();
      }
     e = GetNextEffect(oPC);
     }
    }
    else if(nEvent == 96)
    {
    //SendMessageToPC(oPC,"attempt to learn scroll: "+GetName(GetEventTarget()));
    }
    else if(nEvent == 98)
    {
     if(GetEventData())
     {
     //SendMessageToPC(oPC,"defensive stance canceled");
     }
    }
    else if(nEvent == 99)
    {
    SendMessageToPC(oPC,"defensive stance: "+IntToString(nData));
     if(nData)
     {
     effect eIcon = SupernaturalEffect(EffectCutsceneImmobilize());
     ApplyEffectToObject(DURATION_TYPE_PERMANENT, eIcon, oPC);
     }
     else
     {
     effect e = GetFirstEffect(oPC);
      while(GetIsEffectValid(e))
      {
       if(GetEffectSpellId(e) == -1 && GetEffectType(e) == EFFECT_TYPE_CUTSCENEIMMOBILIZE && GetEffectDurationType(e) == DURATION_TYPE_PERMANENT)
       {
       RemoveEffect(oPC,e);
       }
      e = GetNextEffect(oPC);
      }
     }
    }


hope that helps
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
Terra_777



Joined: 27 Jun 2008
Posts: 216
Location: Sweden

PostPosted: Sat Jul 06, 2013 23:35    Post subject: Reply with quote

Havent had time, you can take over the project if you want it.
_________________
I dun have any signature, I'm happy anyway.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Sun Jul 07, 2013 23:42    Post subject: Reply with quote

Terra_777 wrote:
Havent had time, you can take over the project if you want it.
well as you can see i have problem making thing global/general and to polish and clean code

i dont feel i can do it, but ill consider it then
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
addicted2rpg



Joined: 01 Aug 2008
Posts: 106

PostPosted: Wed Jul 10, 2013 3:59    Post subject: Reply with quote

I'm very interested in what happens to the cool source tree. Please let me know or post (perhaps in this thread) of where it goes.
Back to top
View user's profile Send private message
Terra_777



Joined: 27 Jun 2008
Posts: 216
Location: Sweden

PostPosted: Wed Jul 10, 2013 12:12    Post subject: Reply with quote

http://terrah.no-ip.org/terra/nwnx/

Most of my nwnx stuff
_________________
I dun have any signature, I'm happy anyway.


Last edited by Terra_777 on Fri Sep 13, 2013 12:57; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Wed Jul 10, 2013 12:27    Post subject: OMG Reply with quote

Terra - I think im falling in love with you.
Your repository is like a hidden treasure trove of goodies, and I wana marry you.

(Yes im a bloke Very Happy )


Are these Windows Plugins - do they work?
I didnt know nwnx names had a windows release.

Im gonna try them as soon as I get home.

Gonna have some fun with the nwnx_names one.
Back to top
View user's profile Send private message
Terra_777



Joined: 27 Jun 2008
Posts: 216
Location: Sweden

PostPosted: Wed Jul 10, 2013 12:39    Post subject: Reply with quote

Beware though! Its mostly for the code so some of these plugins wont work or they're unstable. I'll add my nwscript libs but some of these I've not written any nwscripts for.
_________________
I dun have any signature, I'm happy anyway.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Wed Jul 10, 2013 12:50    Post subject: Reply with quote

Do you know if nwnx names is working on windows?
Also- the nwnx-magic one looks interesting too.
Back to top
View user's profile Send private message
Terra_777



Joined: 27 Jun 2008
Posts: 216
Location: Sweden

PostPosted: Wed Jul 10, 2013 12:58    Post subject: Reply with quote

Names should but it wont change the name for everything, there was something about that which made me shelf it but I don't remember what it was.

Magic should work too, there was something in it that made it crash though but again I don't recall what it was. I had no problem when I screwed around with most of it though.
_________________
I dun have any signature, I'm happy anyway.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
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