20250530 Late Update
Added @Rakiov's brilliant NUI spellcast system & power attack GUI. Fixed incorrect constants for Charming the Arrow and Investigator. Updated loadhints.2da.
This commit is contained in:
@@ -187,7 +187,7 @@ const int FEAT_SANCTIFY_MARTIAL_ELVEN_THINBLADE = 24864;
|
||||
const int FEAT_SANCTIFY_MARTIAL_ELVEN_COURTBLADE = 24865;
|
||||
|
||||
//:: Web Enhancement Feats
|
||||
const int FEAT_CHARMING_THE_ARROW = 25997;
|
||||
const int FEAT_CHARMING_THE_ARROW = 25998;
|
||||
|
||||
//:: Skill Based Feats
|
||||
const int FEAT_JUMP = 2884;
|
||||
@@ -3906,7 +3906,7 @@ const int FEAT_IMPROVED_TRIP = 2807;
|
||||
const int FEAT_PRC_IMP_DISARM = 5196;
|
||||
const int FEAT_AWESOME_BLOW = 5370;
|
||||
const int FEAT_IMPROVED_SHIELD_BASH = 3250;
|
||||
const int FEAT_INVESTIGATOR = 25997;
|
||||
const int FEAT_INVESTIGATOR = 25998;
|
||||
|
||||
// Player's Handbook II Feats
|
||||
const int FEAT_STEADFAST_DETERMINATION = 3267;
|
||||
|
113
nwn/nwnprc/trunk/include/prc_nui_consts.nss
Normal file
113
nwn/nwnprc/trunk/include/prc_nui_consts.nss
Normal file
@@ -0,0 +1,113 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: NUI Constants
|
||||
//:: prc_nui_consts
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
This file holds all the constants used by the various PRC NUI scripts.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Rakiov
|
||||
//:: Created On: 24.05.2005
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
const int NUI_PAYLOAD_BUTTON_LEFT_CLICK = 0;
|
||||
const int NUI_PAYLOAD_BUTTON_MIDDLE_CLICK = 1;
|
||||
const int NUI_PAYLOAD_BUTTON_RIGHT_CLICK = 2;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
// //
|
||||
// NUI Spellbook //
|
||||
// //
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
// This is the NUI Spellbook window ID
|
||||
const string PRC_SPELLBOOK_NUI_WINDOW_ID = "prcSpellbookNui";
|
||||
|
||||
// This is the base Id for the Class buttons in the NUI Spellbook, the ID will
|
||||
// have the ClassID attached to it (i.e. spellbookClassButton_123)
|
||||
const string PRC_SPELLBOOK_NUI_CLASS_BUTTON_BASEID = "spellbookClassButton_";
|
||||
|
||||
// This is the base Id for the Spell Circle buttons in the NUI Spellbook, the ID will
|
||||
// have the Circle attached to it (i.e. spellbookCircleButton__6)
|
||||
const string PRC_SPELLBOOK_NUI_CIRCLE_BUTTON_BASEID = "spellbookCircleButton_";
|
||||
|
||||
// This is the base Id for the Spell Buttons in the NUI Spellbook, the ID will
|
||||
// have the SpellbookId (the row of the class's spell's 2da or equivalent)
|
||||
// attached to it (i.e. spellbookSpellButton_6)
|
||||
const string PRC_SPELLBOOK_NUI_SPELL_BUTTON_BASEID = "spellbookSpellButton_";
|
||||
|
||||
// This is the base Id for the Meta Feat buttons in the NUI Spellbook, the ID will
|
||||
// have the FeatID attached to it (i.e. spellbookMetaButton_12345)
|
||||
const string PRC_SPELLBOOK_NUI_META_BUTTON_BASEID = "spellbookMetaButton_";
|
||||
|
||||
// This is the selected ClassID var used to store what class was selected to the Player
|
||||
// locally
|
||||
const string PRC_SPELLBOOK_SELECTED_CLASSID_VAR = "prcSpellbookSelectedClassID";
|
||||
|
||||
// This is the selected Circle var used to store what spell circle was selected
|
||||
// to the Player locally
|
||||
const string PRC_SPELLBOOK_SELECTED_CIRCLE_VAR = "prcSpellbookSelectedCircle";
|
||||
|
||||
// This is the Spellbook NUI geomeotry var, used to allow the location and sizing
|
||||
// of the NUI to be remembered if it is ever rerendered.
|
||||
const string PRC_SPELLBOOK_NUI_GEOMETRY_VAR = "sbNuiGeometry";
|
||||
|
||||
// This is the Selected SpellID Var, used to tell the OnTarget script what spell
|
||||
// we are using after manual targetting
|
||||
const string NUI_SPELLBOOK_SELECTED_SPELLID_VAR = "NUI_Spellbook_SpellId";
|
||||
|
||||
// This is the Selected FeatID Var, used to tell the OnTarget script what feat
|
||||
// we are using after manual targetting
|
||||
const string NUI_SPELLBOOK_SELECTED_FEATID_VAR = "NUI_Spellbook_FeatID";
|
||||
|
||||
// This is the Selected SubSpellID Var, used in conjuncture with the Selected FeatID
|
||||
// to allow radial spells to work (it needs the master spell's featID and the sub spell's
|
||||
// SpellID for it to work.
|
||||
const string NUI_SPELLBOOK_SELECTED_SUBSPELL_SPELLID_VAR = "NUI_Spellbook_SubSpellID";
|
||||
|
||||
// This is the OnTarget action var saved to the player locally to say if we are
|
||||
// using the NUI Spellbook spell or not.
|
||||
const string NUI_SPELLBOOK_ON_TARGET_ACTION_VAR = "ONPLAYERTARGET_ACTION";
|
||||
|
||||
// This is a Boolean to tell the target script if the selected feat is a persoanl feat
|
||||
// and can only be used on the executing object.
|
||||
const string NUI_SPELLBOOK_ON_TARGET_IS_PERSONAL_FEAT = "NUI_Spellbook_IsPersonalFeat";
|
||||
|
||||
const string NUI_SPELL_DESCRIPTION_WINDOW_ID = "NUI_Spell_Description";
|
||||
const string NUI_SPELL_DESCRIPTION_OK_BUTTON = "NUIDescriptionOKButton";
|
||||
|
||||
// This is the limit of how many spell buttons we can have in a row before we
|
||||
// need to start a new row on the NUI Spellbook.
|
||||
const int NUI_SPELLBOOK_SPELL_BUTTON_LENGTH = 9;
|
||||
|
||||
const string NUI_SPELLBOOK_BINDER_DICTIONARY_CACHE_VAR = "NUI_Spellbook_GetBinderSpellToFeatDictionaryCache";
|
||||
const string NUI_SPELLBOOK_CLASS_STANCES_CACHE_BASE_VAR = "NUI_Spellbook_GetToBStanceSpellListCache_";
|
||||
const string NUI_SPELLBOOK_CLASS_SHAPES_CACHE_BASE_VAR = "NUI_Spellbook_GetInvokerShapeSpellListCache_";
|
||||
const string NUI_SPELLBOOK_CLASS_ESSENCE_CACHE_BASE_VAR = "NUISpellbookClassEssence_";
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
// //
|
||||
// NUI Power Attack //
|
||||
// //
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
// The Window ID for the Power Attack NUI
|
||||
const string NUI_PRC_POWER_ATTACK_WINDOW = "nui_prc_power_attack_window";
|
||||
|
||||
// LocalVar for the geometry of the Power Attack NUI window
|
||||
const string NUI_PRC_PA_GEOMETRY_VAR = "paNuiGeometry";
|
||||
|
||||
// Event For Left "-" button of the Power Attack NUI
|
||||
const string NUI_PRC_PA_LEFT_BUTTON_EVENT = "nui_prc_pa_left_button_event";
|
||||
// Event For Right "+" Button of the Power Attack NUI
|
||||
const string NUI_PRC_PA_RIGHT_BUTTON_EVENT = "nui_prc_pa_right_button_event";
|
||||
|
||||
// Bind for Text of the Power Attack NUI saying what the current Power Attack level is
|
||||
const string NUI_PRC_PA_TEXT_BIND = "nui_prc_pa_text_bind";
|
||||
// Left Button Enabled Bind for Power Attack NUI
|
||||
const string NUI_PRC_PA_LEFT_BUTTON_ENABLED_BIND = "leftButtonEnabled";
|
||||
// Right Button Enabled Bind for Power Attack NUI
|
||||
const string NUI_PRC_PA_RIGHT_BUTTON_ENABLED_BIND = "rightButtonEnabled";
|
1124
nwn/nwnprc/trunk/include/prc_nui_sb_inc.nss
Normal file
1124
nwn/nwnprc/trunk/include/prc_nui_sb_inc.nss
Normal file
File diff suppressed because it is too large
Load Diff
98
nwn/nwnprc/trunk/include/prc_nui_sbd_inc.nss
Normal file
98
nwn/nwnprc/trunk/include/prc_nui_sbd_inc.nss
Normal file
@@ -0,0 +1,98 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: PRC Spellbook Description NUI
|
||||
//:: prc_nui_sbd_inc
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
This is the view for the Spell Description NUI
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Rakiov
|
||||
//:: Created On: 29.05.2005
|
||||
//:://////////////////////////////////////////////
|
||||
#include "nw_inc_nui"
|
||||
#include "prc_nui_consts"
|
||||
#include "inc_2dacache"
|
||||
|
||||
//
|
||||
// CreateSpellDescriptionNUI
|
||||
// Creates a Spell Description NUI mimicing the description GUI of NWN
|
||||
//
|
||||
// Arguments:
|
||||
// oPlayer:Object the player object
|
||||
// featID:int the FeatID
|
||||
// spellId:int the SpellID
|
||||
// realSpellId:int the RealSpellID
|
||||
//
|
||||
void CreateSpellDescriptionNUI(object oPlayer, int featID, int spellId=0, int realSpellId=0);
|
||||
|
||||
void CreateSpellDescriptionNUI(object oPlayer, int featID, int spellId=0, int realSpellId=0)
|
||||
{
|
||||
// look for existing window and destroy
|
||||
int nPreviousToken = NuiFindWindow(OBJECT_SELF, NUI_SPELL_DESCRIPTION_WINDOW_ID);
|
||||
if(nPreviousToken != 0)
|
||||
{
|
||||
NuiDestroy(OBJECT_SELF, nPreviousToken);
|
||||
}
|
||||
|
||||
// in order of accuracy for names it goes RealSpellID > SpellID > FeatID
|
||||
string spellName;
|
||||
if (realSpellId)
|
||||
spellName = GetStringByStrRef(StringToInt(Get2DACache("spells", "Name", realSpellId)));
|
||||
else if (spellId)
|
||||
spellName = GetStringByStrRef(StringToInt(Get2DACache("spells", "Name", spellId)));
|
||||
else
|
||||
spellName = GetStringByStrRef(StringToInt(Get2DACache("feat", "FEAT", featID)));
|
||||
// Descriptions and Icons are accuratly stored on the feat
|
||||
string spellDesc = GetStringByStrRef(StringToInt(Get2DACache("feat", "DESCRIPTION", featID)));
|
||||
string spellIcon = Get2DACache("feat", "ICON", featID);
|
||||
|
||||
json jRoot = JsonArray();
|
||||
json jGroup = JsonArray();
|
||||
|
||||
json jRow = JsonArray();
|
||||
|
||||
json jImage = NuiImage(JsonString(spellIcon), JsonInt(NUI_ASPECT_EXACT), JsonInt(NUI_HALIGN_LEFT), JsonInt(NUI_VALIGN_TOP));
|
||||
jImage = NuiWidth(jImage, 32.0f);
|
||||
jRow = JsonArrayInsert(jRow, jImage);
|
||||
jRow = NuiCol(jRow);
|
||||
jGroup = JsonArrayInsert(jGroup, jRow);
|
||||
|
||||
jRow = JsonArray();
|
||||
json jText = NuiText(JsonString(spellDesc), FALSE, NUI_SCROLLBARS_AUTO);
|
||||
jRow = JsonArrayInsert(jRow, jText);
|
||||
jRow = NuiCol(jRow);
|
||||
jGroup = JsonArrayInsert(jGroup, jRow);
|
||||
|
||||
jGroup = NuiRow(jGroup);
|
||||
jGroup = NuiGroup(jGroup, TRUE, NUI_SCROLLBARS_NONE);
|
||||
jRoot = JsonArrayInsert(jRoot, jGroup);
|
||||
|
||||
jRow = JsonArray();
|
||||
jRow = JsonArrayInsert(jRow, NuiSpacer());
|
||||
json jButton = NuiId(NuiButton(JsonString("OK")), NUI_SPELL_DESCRIPTION_OK_BUTTON);
|
||||
jButton = NuiWidth(jButton, 175.0f);
|
||||
jButton = NuiHeight(jButton, 48.0f);
|
||||
jRow = JsonArrayInsert(jRow, jButton);
|
||||
jRow = NuiRow(jRow);
|
||||
|
||||
jRoot = JsonArrayInsert(jRoot, jRow);
|
||||
jRoot = NuiCol(jRoot);
|
||||
|
||||
|
||||
// This is the main window with jRoot as the main pane. It includes titles and parameters (more on those later)
|
||||
json nui = NuiWindow(jRoot, JsonString(spellName), NuiBind("geometry"), NuiBind("resizable"), JsonBool(FALSE), NuiBind("closable"), NuiBind("transparent"), NuiBind("border"));
|
||||
|
||||
// finally create it and it'll return us a non-zero token.
|
||||
int nToken = NuiCreate(oPlayer, nui, NUI_SPELL_DESCRIPTION_WINDOW_ID);
|
||||
|
||||
// get the geometry of the window in case we opened this before and have a
|
||||
// preference for location
|
||||
json geometry = NuiRect(893.0f,346.0f, 426.0f, 446.0f);
|
||||
|
||||
// Set the binds to their default values
|
||||
NuiSetBind(oPlayer, nToken, "geometry", geometry);
|
||||
NuiSetBind(oPlayer, nToken, "resizable", JsonBool(FALSE));
|
||||
NuiSetBind(oPlayer, nToken, "closable", JsonBool(FALSE));
|
||||
NuiSetBind(oPlayer, nToken, "transparent", JsonBool(FALSE));
|
||||
NuiSetBind(oPlayer, nToken, "border", JsonBool(TRUE));
|
||||
}
|
74
nwn/nwnprc/trunk/include/prc_string_inc.nss
Normal file
74
nwn/nwnprc/trunk/include/prc_string_inc.nss
Normal file
@@ -0,0 +1,74 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: String Util
|
||||
//:: prc_string_inc
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
A util class for providing useful string functions.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Rakiov
|
||||
//:: Created On: 22.05.2005
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "inc_utility"
|
||||
|
||||
//
|
||||
// StringSplit
|
||||
// Takes a string and splits it by " " into a json list of strings
|
||||
// i.e. "this is a test" returns
|
||||
// {
|
||||
// "this",
|
||||
// "is",
|
||||
// "a",
|
||||
// "test"
|
||||
// }
|
||||
//
|
||||
// Parameters:
|
||||
// string input the string input
|
||||
//
|
||||
// Returns:
|
||||
// json the json list of words
|
||||
//
|
||||
json StringSplit(string input);
|
||||
|
||||
json StringSplit(string input)
|
||||
{
|
||||
json retValue = JsonArray();
|
||||
|
||||
string subString = "";
|
||||
//trim any whitespace characters first
|
||||
string currString = PRCTrimString(input);
|
||||
|
||||
// loop until we process the whole string
|
||||
while(currString != "")
|
||||
{
|
||||
string currChar = GetStringLeft(currString, 1);
|
||||
if (currChar != "" && currChar != " ")
|
||||
{
|
||||
// if the current character isn't nothing or whitespace, then add it
|
||||
// to the current sub string.
|
||||
subString += currChar;
|
||||
}
|
||||
else
|
||||
{
|
||||
// otherwise if the substring is not empty, then add it to the list
|
||||
// of words to return
|
||||
if(subString != "")
|
||||
{
|
||||
retValue = JsonArrayInsert(retValue, JsonString(subString));
|
||||
subString = "";
|
||||
}
|
||||
}
|
||||
|
||||
// pop and move to next character
|
||||
currString = GetStringRight(currString, GetStringLength(currString)-1);
|
||||
}
|
||||
|
||||
// if there is any sub string left at the end of the loop, add it to the list
|
||||
if(subString != "")
|
||||
{
|
||||
retValue = JsonArrayInsert(retValue, JsonString(subString));
|
||||
}
|
||||
|
||||
return retValue;
|
||||
}
|
Reference in New Issue
Block a user