Ive been searching for awhile and only found scripts for NWN 1.
Is it possible to have an item with a Unique Power Self Only property that Gives the player a say 1000 xp?
Im not sure how you would go about doing it.
Giving Exp Script Help
Débuté par
Seipherwood
, juin 30 2012 11:19
#1
Posté 30 juin 2012 - 11:19
#2
Posté 01 juillet 2012 - 12:10
Sure, in fact the same script would probably work.
#3
Posté 01 juillet 2012 - 12:39
So something like this would still work in nwn2?
//::///////////////////////////////////////////////
//:: Lord Sullivan's Level Up / Level Down Script
//:: for Special Power Items i.e. "Level Up Stone"
//:: spec_power_items.nss
//:: Copyright © 2005 Lord Sullivan.
//:://////////////////////////////////////////////
/*
This script must be inserted in the Module events
tab in the "OnItemActivated" input box. In this
script Name the items appropriatly according to
the tags of the items in the proper fields:
I.E. if ( sItemName == "TagOfMySpecialPowerItem" )
OR
I.E. if ( sItemName == "MamasBoySpecialPowerItem" )
*/
//:://////////////////////////////////////////////
//:: Created By: Lord Sullivan
//:: Created On: July 4th, 2005
//:://////////////////////////////////////////////
int XPtoLevel(int nXP) {
return FloatToInt((1+sqrt(1+4.*nXP/500))/2);
}
void main()
{
object oLastUser = GetItemActivator();
string sItemName = GetTag ( GetItemActivated() );
int nXPER;
int nLevel = XPtoLevel(GetXP(oLastUser));
if ( sItemName == "LevelUpStone" )
{
if (nLevel != 40)
{
SetXP(oLastUser, nLevel*(nLevel+1)*500);
nXPER = GetXP(oLastUser);
string sResXP = IntToString(nXPER);
string sResLvl = IntToString(nLevel+1);
SendMessageToPC(oLastUser, " ");
SendMessageToPC(oLastUser, "Your XP is now = "+ sResXP);
SendMessageToPC(oLastUser, "Your new available level is = "+ sResLvl);
if((nLevel+1) == 21)
{
SendMessageToPC(oLastUser, " ");
SendMessageToPC(oLastUser, "Congradulations!... You have now graduated to an Epic Character!... Yaaaay!!!");
}
}
else
{
if(GetGender(oLastUser) == GENDER_FEMALE)
{
SendMessageToPC(oLastUser, " ");
SendMessageToPC(oLastUser, "Woooooh there Charlotte!... 40 Levels is not enough?");
}
else
{
SendMessageToPC(oLastUser, " ");
SendMessageToPC(oLastUser, "Woooooh there Charlie!... 40 Levels is not enough?");
}
}
}
//::///////////////////////////////////////////////
//:: Lord Sullivan's Level Up / Level Down Script
//:: for Special Power Items i.e. "Level Up Stone"
//:: spec_power_items.nss
//:: Copyright © 2005 Lord Sullivan.
//:://////////////////////////////////////////////
/*
This script must be inserted in the Module events
tab in the "OnItemActivated" input box. In this
script Name the items appropriatly according to
the tags of the items in the proper fields:
I.E. if ( sItemName == "TagOfMySpecialPowerItem" )
OR
I.E. if ( sItemName == "MamasBoySpecialPowerItem" )
*/
//:://////////////////////////////////////////////
//:: Created By: Lord Sullivan
//:: Created On: July 4th, 2005
//:://////////////////////////////////////////////
int XPtoLevel(int nXP) {
return FloatToInt((1+sqrt(1+4.*nXP/500))/2);
}
void main()
{
object oLastUser = GetItemActivator();
string sItemName = GetTag ( GetItemActivated() );
int nXPER;
int nLevel = XPtoLevel(GetXP(oLastUser));
if ( sItemName == "LevelUpStone" )
{
if (nLevel != 40)
{
SetXP(oLastUser, nLevel*(nLevel+1)*500);
nXPER = GetXP(oLastUser);
string sResXP = IntToString(nXPER);
string sResLvl = IntToString(nLevel+1);
SendMessageToPC(oLastUser, " ");
SendMessageToPC(oLastUser, "Your XP is now = "+ sResXP);
SendMessageToPC(oLastUser, "Your new available level is = "+ sResLvl);
if((nLevel+1) == 21)
{
SendMessageToPC(oLastUser, " ");
SendMessageToPC(oLastUser, "Congradulations!... You have now graduated to an Epic Character!... Yaaaay!!!");
}
}
else
{
if(GetGender(oLastUser) == GENDER_FEMALE)
{
SendMessageToPC(oLastUser, " ");
SendMessageToPC(oLastUser, "Woooooh there Charlotte!... 40 Levels is not enough?");
}
else
{
SendMessageToPC(oLastUser, " ");
SendMessageToPC(oLastUser, "Woooooh there Charlie!... 40 Levels is not enough?");
}
}
}
Modifié par Seipherwood, 01 juillet 2012 - 12:40 .
#4
Posté 01 juillet 2012 - 12:49
That looks like it would work, except nwn2 is only 30 levels by default of course.
#5
Posté 01 juillet 2012 - 12:52
Yeah, but if that will work, i can tweak it to my needs
Thanks for the help
#6
Posté 01 juillet 2012 - 12:59
( more info ) .. there's differences, you could try to leave the module's OnActivateItem script at default ( x2_mod_def_act, or whatever ) - there should be code in there that fires NwN2's version of tag-based scripting ......
here's a good page that starts out describing NwN tag-based, and at the bottom it describes the differences w/ NwN2
They're similar but by default NwN2 uses individual scripts for each event, with a special naming convention:
eg. i_<itemtag>_ac
said script then fires on activate. Lord Sullivan's script should work fine, but typically the sItemName codeblocks would be broken up into separate scripts.
note: apparently NwN2 can be set to work just like NwN does, as k_ suggests
here's a good page that starts out describing NwN tag-based, and at the bottom it describes the differences w/ NwN2
They're similar but by default NwN2 uses individual scripts for each event, with a special naming convention:
eg. i_<itemtag>_ac
said script then fires on activate. Lord Sullivan's script should work fine, but typically the sItemName codeblocks would be broken up into separate scripts.
note: apparently NwN2 can be set to work just like NwN does, as k_ suggests
#7
Posté 01 juillet 2012 - 10:25
Use a tag based script so that your item does what you want without risking breaking other items. As you have it above the only custom item with an activation script that will work in your module is your own. Tag based scripting is flat-out better than modifying the module activation script.
Regards
Regards





Retour en haut






