Does anyone know if the spell scroll in Sands shop labeled fireburst was ever labeled correctly. The spell is listed as fireburst, but the spell describes the spell Repulsion. I was wondering if this was ever corrected, if so were can I find it. I’ve played a lot of modules and have never seen the spell anywhere else. Thank you in advance. Greenman
can you compile a script and run it from the console?
// 'fixsandstore'
/*
Console script to replace the bogus Fireburst scroll in Sand's store with
a legitimate Fireburst scroll.
- run this while your PC is inside the Sand's Shop area
- at the console:
`
debugmode 1
rs fixsandstore
debugmode 0
`
*/
void DestroyFireburst(object oStore)
{
SendMessageToPC(GetFirstPC(FALSE), "DestroyFireburst() ( " + GetTag(oStore) + " )");
object oItem = GetFirstItemInInventory(oStore);
while (GetIsObjectValid(oItem))
{
if (GetTag(oItem) == "n2_it_sparscr027")
{
SendMessageToPC(GetFirstPC(FALSE), ". destroy Fireburst");
DestroyObject(oItem);
break;
}
oItem = GetNextItemInInventory(oStore);
}
}
void CreateFireburst(object oStore)
{
SendMessageToPC(GetFirstPC(FALSE), "CreateFireburst() ( " + GetTag(oStore) + " )");
object oFireburst = CreateItemOnObject("n2_it_sparscr011", oStore);
SendMessageToPC(GetFirstPC(FALSE), ". is Valid= " + IntToString(GetIsObjectValid(oFireburst)));
}
//
void main()
{
object oStore = GetNearestObjectByTag("10_sand_store");
DestroyFireburst(oStore);
DelayCommand(0.1f, CreateFireburst(oStore));
oStore = GetNearestObjectByTag("10_2nd_sand_store");
DestroyFireburst(oStore);
DelayCommand(0.1f, CreateFireburst(oStore));
}
ps. As far as i’m aware there is no spell Repulsion.
2018 aug 12 - has been added to Nwn2Fixes
if you have an up to date Nwn2Fixes patch, there’s no need to run the console script above. It should happen auto in the OnClientEnter event (when your PC enters Sand’s Shop).
Is there a way to set an unlimited amount flag for a specific item in the store instance through NWScript?
should be: Get the store-object, cycle through its contents like any other container, search for and find a/the item and use
//RWT-OEI 03/14/07
//This script function can be used to set the Infinite flag on items.
//If an item is flagged infinite, a store's supply of this item will not
//deplete as players purchase the item.
//If oItem is not an Item object, nothing will happen
void SetInfiniteFlag(object oItem, int bInfinite = TRUE);
Thanks for the info. I wanted to modify trap kit descriptions to include information about trap effects, save, DC, etc, as it has been done here: https://neverwintervault.org/project/nwn2/prefab/placeable/trap-kits-detailed-info
But trap kit instances in containers and stores still used old generic descriptions.
But at least now stores are using new templates.
// ga_open_store
/*
Opens store with tag sTag for the PC Speaker.
nMarkUp/nMarkDown are a percentage value that modifies the base price for an item.
Function also adds or subtracts numbers to the markup and markdown values depending on the result of the appraise skill check.
*/
// ChazM 5/9/06 - changed to gplotAppraiseOpenStore
// ChazM 8/30/06 - new appraise open store function used.
#include "ginc_param_const"
#include "ginc_item"
#include "ginc_vars"
void CreateItemOnStore(string sResRef, object oStore, int nCount, int bInfinite)
{
object oItem = CreateItemOnObject(sResRef, oStore, 1, "", FALSE);
SetItemStackSize(oItem, nCount);
SetInfiniteFlag(oItem, bInfinite);
}
void main(string sTag, int nMarkUp, int nMarkDown)
{
object oPC = (GetPCSpeaker() == OBJECT_INVALID ? OBJECT_SELF : GetPCSpeaker());
object oStore = GetTarget(sTag);
if (!IsMarkedAsDone(oStore))
{
MarkAsDone(oStore);
string sResRef;
int nCount;
int bInfinite;
object oItem = GetFirstItemInInventory(oStore);
while (GetIsObjectValid(oItem))
{
sResRef = GetResRef(oItem);
if (GetStringLowerCase(GetStringLeft(sResRef, 10)) == "nw_it_trap"
|| GetStringLowerCase(GetStringLeft(sResRef, 10)) == "x2_it_trap"
|| GetStringLowerCase(GetStringLeft(sResRef, 11)) == "nx1_it_trap")
{
nCount = GetItemStackSize(oItem);
bInfinite = GetInfiniteFlag(oItem);
DestroyObject(oItem, 0.0f, FALSE);
DelayCommand(0.0f, CreateItemOnStore(sResRef, oStore, nCount, bInfinite));
}
oItem = GetNextItemInInventory(oStore);
}
}
N2_AppraiseOpenStore(oStore, oPC, nMarkUp, nMarkDown);
}
Consider using the ga_open_store script that’s in the SOZ campaign folder. It has the RecreateItemsFromBlueprint function. That function pretty much does everything you are asking for.
Thanks, a very neat function.