added things

added a crafting tool merchant,
added a training hall (not quite working yet)
fixed crafting issues,
exchanged the small cave area
This commit is contained in:
2024-09-01 14:11:15 -04:00
parent 65af23f08d
commit 7030eb2235
335 changed files with 55956 additions and 3946 deletions

View File

@@ -1,6 +1,5 @@
//#include "_persist_01a"
#include "nw_i0_plot"
#include "aps_include"
void GetNextItemPossessedBy(object oPC, string sItemTag);
object CreatePlaceable(string sObject, location lPlace, float fDuration);
@@ -28,13 +27,7 @@ void main()
string sOldTag = sItemTag;
//int iAlchemyChance = GetTokenPair(oPC,14,12);
//int iAlchemySkill = iAlchemyChance;
//Stores on NWN database
//int iAlchemySkill = GetCampaignInt("UOACraft","iAlchemySkill",oPC);
//Stores on external database (defined in NWNX.ini)
int iAlchemySkill = GetPersistentInt(oPC,"iAlchemySkill","UOACraft");
int iAlchemySkill = GetCampaignInt("UOACraft","iAlchemySkill",oPC);
int iAlchemyChance = iAlchemySkill;
int iSuccess = 0;
int iSkillGain = 0;
@@ -114,182 +107,176 @@ void main()
{
iSuccessNumber = 3;
sItemResRef = "dye001";
sSuccess = "You boil the iris, and extract the light-blue aqua pigment.";
sFail = "You fail to extract any pigment from this iris.";
}
if (sItemTag == "FLOWER_BLUEIRIRS")
{
iSuccessNumber = 3;
sItemResRef = "dye001";
sSuccess = "You boil the iris, and extract the light-blue aqua pigment.";
sSuccess = "You boil the iris and extract the light-blue aqua pigment.";
sFail = "You fail to extract any pigment from this iris.";
}
if (sItemTag == "FLOWER_BLACKTULIP")
{
iSuccessNumber = 3;
sItemResRef = "dye002";
sSuccess = "You boil the tulip, and extract the dark pigment.";
sSuccess = "You boil the tulip and extract the dark pigment.";
sFail = "You fail to extract any pigment from this tulip.";
}
if (sItemTag == "FLOWER_BLUETULIP")
{
iSuccessNumber = 3;
sItemResRef = "dye003";
sSuccess = "You boil the tulip, and extract the blue pigment.";
sSuccess = "You boil the tulip and extract the dark-blue pigment.";
sFail = "You fail to extract any pigment from this tulip.";
}
if (sItemTag == "FLOWER_YELLOWTULIP")
{
iSuccessNumber = 3;
sItemResRef = "dye004";
sSuccess = "You boil the tulip, and extract the yellow pigment.";
sSuccess = "You boil the tulip and extract the yellow pigment.";
sFail = "You fail to extract any pigment from this tulip.";
}
if (sItemTag == "SEED_GOOSEBERRY")
{
iSuccessNumber = 3;
sItemResRef = "dye005";
sSuccess = "You boil the gooseberries, and extract the green pigment.";
sSuccess = "You boil the gooseberries and extract the green pigment.";
sFail = "You fail to extract any pigment from these gooseberries.";
}
if (sItemTag == "ITEM_PINECONE")
{
iSuccessNumber = 3;
sItemResRef = "dye006";
sSuccess = "You boil the pinecone, and extract the greenish-brown pigment.";
sSuccess = "You boil the pinecone and extract the greenish-brown pigment.";
sFail = "You fail to extract any pigment from this pinecone.";
}
if (sItemTag == "SEED_MARIGOLD")
{
iSuccessNumber = 3;
sItemResRef = "dye007";
sSuccess = "You boil the marigold, and extract the golden pigment.";
sSuccess = "You boil the marigold and extract the golden pigment.";
sFail = "You fail to extract any pigment from this marigold.";
}
if (sItemTag == "SEED_SNAPDRAGON")
{
iSuccessNumber = 3;
sItemResRef = "dye008";
sSuccess = "You boil the snapdragon, and extract a bronze-toned pigment.";
sSuccess = "You boil the snapdragon and extract a bronze-toned pigment.";
sFail = "You fail to extract any pigment from this snapdragon.";
}
if (sItemTag == "SEED_TARRAGON")
{
iSuccessNumber = 3;
sItemResRef = "dye009";
sSuccess = "You boil the tarragon, and extract a silvery pigment.";
sSuccess = "You boil the tarragon and extract a silvery pigment.";
sFail = "You fail to extract any pigment from the tarragon.";
}
if (sItemTag == "FLOWER_WHITEIRIS")
{
iSuccessNumber = 3;
sItemResRef = "dye010";
sSuccess = "You boil the iris, and extract a greyish pigment.";
sSuccess = "You boil the iris and extract a greyish pigment.";
sFail = "You fail to extract any pigment from this iris.";
}
if (sItemTag == "SEED_LAVENDER")
{
iSuccessNumber = 3;
sItemResRef = "dye011";
sSuccess = "You boil the lavender, and extract a pink pigment.";
sSuccess = "You boil the lavender and extract a pink pigment.";
sFail = "You fail to extract any pigment from the lavender.";
}
if (sItemTag == "SEED_NASTURTIUM")
{
iSuccessNumber = 3;
sItemResRef = "dye012";
sSuccess = "You boil the nasturtium, and extract an orange pigment.";
sSuccess = "You boil the nasturtium and extract a greyish pigment.";
sFail = "You fail to extract any pigment from this nasturtium.";
}
if (sItemTag == "SEED_SAGE")
{
iSuccessNumber = 3;
sItemResRef = "dye013";
sSuccess = "You boil the sage, and extract a tan pigment.";
sSuccess = "You boil the sage and extract a tan pigment.";
sFail = "You fail to extract any pigment from the sage.";
}
if (sItemTag == "SEED_CHIVES")
{
iSuccessNumber = 3;
sItemResRef = "dye014";
sSuccess = "You boil the chives, and extract a coppery pigment.";
sSuccess = "You boil the chives and extract a coppery pigment.";
sFail = "You fail to extract any pigment from these chives.";
}
if (sItemTag == "FLOWER_WHITETULIP")
{
iSuccessNumber = 3;
sItemResRef = "dye015";
sSuccess = "You boil the tulip, and extract the white pigment.";
sSuccess = "You boil the tulip and extract the white pigment.";
sFail = "You fail to extract any pigment from this tulip.";
}
if (sItemTag == "FLOWER_YELLOWIRIS")
{
iSuccessNumber = 3;
sItemResRef = "dye016";
sSuccess = "You boil the iris, and extract a platinum-hued pigment.";
sSuccess = "You boil the iris and extract a platinum-hued pigment.";
sFail = "You fail to extract any pigment from this iris.";
}
if (sItemTag == "SEED_PERIWINKLE")
{
iSuccessNumber = 3;
sItemResRef = "dye017";
sSuccess = "You boil the periwinkle, and extract a purple pigment.";
sSuccess = "You boil the periwinkle and extract a purple pigment.";
sFail = "You fail to extract any pigment from this periwinkle.";
}
if (sItemTag == "FLOWER_BLACKIRIS")
{
iSuccessNumber = 3;
sItemResRef = "dye018";
sSuccess = "You boil the iris, and extract a dark grey pigment.";
sSuccess = "You boil the iris and extract a dark grey pigment.";
sFail = "You fail to extract any pigment from this iris.";
}
if (sItemTag == "SEED_SPEARMINT")
{
iSuccessNumber = 3;
sItemResRef = "dye019";
sSuccess = "You boil the spearmint, and extract a minty green pigment.";
sSuccess = "You boil the spearmint and extract a minty green pigment.";
sFail = "You fail to extract any pigment from this spearmint.";
}
if (sItemTag == "SEED_BEETS")
{
iSuccessNumber = 3;
sItemResRef = "dye020";
sSuccess = "You boil the beets, and extract a deep red pigment.";
sSuccess = "You boil the beets and extract a deep red pigment.";
sFail = "You fail to extract any pigment from these beets.";
}
if (sItemTag == "SEED_PEPPERMINT")
{
iSuccessNumber = 3;
sItemResRef = "dye021";
sSuccess = "You boil the peppermint, and extract a deep green pigment.";
sSuccess = "You boil the peppermint and extract a deep green pigment.";
sFail = "You fail to extract any pigment from this peppermint.";
}
if (sItemTag == "SEED_BLUEBERRY")
{
iSuccessNumber = 3;
sItemResRef = "dye022";
sSuccess = "You boil the blueberries, and extract a deep blue pigment.";
sSuccess = "You boil the blueberries and extract a deep blue pigment.";
sFail = "You fail to extract any pigment from these blueberries.";
}
if (sItemTag == "SEED_ORIENTALPOPPY")
{
iSuccessNumber = 3;
sItemResRef = "dye023";
sSuccess = "You boil the oriental poppy, and extract a peach-hued pigment.";
sSuccess = "You boil the oriental poppy and extract a peach-hued pigment.";
sFail = "You fail to extract any pigment from this oriental poppy.";
}
if (sItemTag == "SEED_MAYAPPLE")
{
iSuccessNumber = 3;
sItemResRef = "dye024";
sSuccess = "You boil the mayapple, and extract a smokey pigment.";
sSuccess = "You boil the mayapple and extract a greyish pigment.";
sFail = "You fail to extract any pigment from this mayapple.";
}
if (sItemTag == "SEED_TURNIP")
{
iSuccessNumber = 3;
sItemResRef = "dye025";
sSuccess = "You boil the turnip, and extract a fuschia pigment.";
sSuccess = "You boil the turnip and extract a fuschia pigment.";
sFail = "You fail to extract any pigment from this turnip.";
}
if (sItemTag == "ITEM_OLIVE")
@@ -303,28 +290,28 @@ void main()
{
iSuccessNumber = 3;
sItemResRef = "dye027";
sSuccess = "You boil the catnip, and extract a yellowish-green pigment.";
sSuccess = "You boil the catnip and extract a yellowish-green pigment.";
sFail = "You fail to extract any pigment from this catnip.";
}
if (sItemTag == "ITEM_FIG")
{
iSuccessNumber = 3;
sItemResRef = "dye028";
sSuccess = "You boil the figs, and extract a rusty pigment.";
sSuccess = "You boil the figs and extract a rusty pigment.";
sFail = "You fail to extract any pigment from these figs.";
}
if (sItemTag == "ITEM_KIWI")
{
iSuccessNumber = 3;
sItemResRef = "dye029";
sSuccess = "You boil the kiwi, and extract a chromatic pigment.";
sSuccess = "You boil the kiwi and extract a chromatic pigment.";
sFail = "You fail to extract any pigment from this kiwi.";
}
if (sItemTag == "SEED_ARTICHOKE")
{
iSuccessNumber = 3;
sItemResRef = "dye030";
sSuccess = "You boil the artichoke, and extract a metallic pigment.";
sSuccess = "You boil the artichoke and extract a metallic pigment.";
sFail = "You fail to extract any pigment from the artichoke.";
}
if (sItemTag == "FISH_BLUESHARK") // 80 lbs
@@ -566,7 +553,7 @@ void main()
}
//End code for fixing stackables issue
if (sDItemResRef == "pattern013") // Tanning Oil
if (GetStringRight(sDItemResRef,3)=="013") // Tanning Oil
{
FloatingTextStringOnCreature("To create tanning oil you need to drop a fish into this container.",oPC,FALSE);
CopyObject(oItem,GetLocation(OBJECT_SELF),OBJECT_SELF,GetTag(oItem));
@@ -580,7 +567,7 @@ void main()
sComponent1Name = "oaken logs";
iSuccessNumber = 10;
iStackable = 1;
sSuccess = "You strip the bark, and produce enough tannic acid for 10 uses.";
sSuccess = "You strip the bark and produce enough tannic acid for 10 uses.";
sFail = "You strip the bark, but the tannic acid produced is impure and unuseable.";
iFailNumber = 4;
iFailFlag = 1;
@@ -701,8 +688,8 @@ void main()
sComponent3 = "DYE_BLACK";
iComponent3 = 1;
iComponent3Stackable=1;
sSuccess = "You carefully powder the wooly ink cap, and combine it with the black dye.";
sFail = "The ink turns milky, and is ruined by impurities.";
sSuccess = "You carefully powder the wooly ink cap and combine it with the black dye.";
sFail = "The ink turns milky and is ruined by impurities..";
sItemResRef = "ink_black";
sFailResRef = "glassvial";
sComponent1Name = "wooly ink caps";
@@ -723,7 +710,7 @@ void main()
iComponent2 = 1;
sComponent3 = "ITEM_GLASSVIAL";
iComponent3 = 1;
sSuccess = "You carefully powder the ginger roots and stone fungus, and brew the potion.";
sSuccess = "You carefully powder the ginger roots and stone fungus and brew the potion.";
sFail = "The potion coagulates into a smelly, useless sludge.";
sItemResRef = "nw_it_mpotion001"; //Replace this with custom potion resref, if available
sFailResRef = "glassvial";
@@ -741,7 +728,7 @@ void main()
iComponent2 = 1;
sComponent3 = "ITEM_GLASSVIAL";
iComponent3 = 1;
sSuccess = "You carefully powder the mandrake roots and violet pouch fungus, and brew the potion.";
sSuccess = "You carefully powder the mandrake roots and violet pouch fungus and brew the potion.";
sFail = "The potion coagulates into a smelly, useless sludge.";
sItemResRef = "nw_it_mpotion020"; //Replace this with custom potion resref, if available
sFailResRef = "glassvial";
@@ -760,7 +747,7 @@ void main()
iComponent2 = 2;
sComponent3 = "ITEM_GLASSVIAL";
iComponent3 = 1;
sSuccess = "You carefully powder the witches butter, mixing in the powdered amethyst, and brew the potion.";
sSuccess = "You carefully powder the witches butter, mixing in the powdered amethyst and brew the potion.";
sFail = "The potion coagulates into a smelly, useless sludge.";
sItemResRef = "nw_it_mpotion002"; //Replace this with custom potion resref, if available
sFailResRef = "glassvial";
@@ -780,7 +767,7 @@ void main()
iComponent2Stackable=1;
sComponent3 = "ITEM_GLASSVIAL";
iComponent3 = 1;
sSuccess = "You carefully combine the powdered bloodstone with the essence of nature, and brew the potion.";
sSuccess = "You carefully combine the powdered bloodstone with the essence of nature and brew the potion.";
sFail = "The potion coagulates into a smelly, useless sludge.";
sItemResRef = "nw_it_mpotion003"; //Replace this with custom potion resref, if available
sFailResRef = "glassvial";
@@ -799,8 +786,8 @@ void main()
sComponent3 = "DYE_CHARCOAL";
iComponent3 = 1;
iComponent3Stackable=1;
sSuccess = "You carefully powder the shaggy ink cap, and combine it with the charcoal dye.";
sFail = "The ink turns milky, and is ruined by impurities.";
sSuccess = "You carefully powder the shaggy ink cap and combine it with the charcoal dye.";
sFail = "The ink turns milky and is ruined by impurities..";
sItemResRef = "ink_mapmaker";
sFailResRef = "glassvial";
sComponent1Name = "shaggy ink caps";
@@ -822,7 +809,7 @@ void main()
iFailFlag=1;
iFailNumber=1;
sSuccess = "You carefully powder the sulphur and coal, mixing it with the tar.";
sFail = "The tar hardens as you mix the coal and sulphur improperly, rendering this batch useless.";
sFail = "The tar hardens as you mix the coal and sulpher improperly, rending this batch useless.";
sItemResRef = "_uoa_alch_fire";
sFailResRef = "glassbottle";
sComponent1Name = "bottles of tar";
@@ -900,7 +887,7 @@ void main()
iFailFlag=1;
iFailNumber=1;
sSuccess = "The yeast culture grows within the vial, feeding on the powdered kindling.";
sFail = "The powdered kindling is contaminated, and the yeast fails to grow.";
sFail = "The powdered kindling is contaminated and the yeast fails to grow.";
sItemResRef = "item_yeast001";
sFailResRef = "yeastvial001";
sComponent1Name = "yeast vials";
@@ -916,7 +903,7 @@ void main()
iFailFlag=1;
iFailNumber=1;
sSuccess = "The yeast culture grows within the vial, feeding on the powdered kindling.";
sFail = "The powdered kindling is contaminated, and the yeast fails to grow.";
sFail = "The powdered kindling is contaminated and the yeast fails to grow.";
sItemResRef = "item_yeast002";
sFailResRef = "yeastvial001";
sComponent1Name = "yeast vials";
@@ -932,7 +919,7 @@ void main()
iFailFlag=1;
iFailNumber=1;
sSuccess = "The yeast culture grows within the vial, feeding on the powdered kindling.";
sFail = "The powdered kindling is contaminated, and the yeast fails to grow.";
sFail = "The powdered kindling is contaminated and the yeast fails to grow.";
sItemResRef = "item_yeast003";
sFailResRef = "yeastvial001";
sComponent1Name = "yeast vials";
@@ -945,7 +932,7 @@ void main()
iStackable=1;
iComponent1Stackable =1;
sItemResRef = "essence"+GetStringRight(sDItemResRef,3);
sFail = "The essence evaporates away as you fail to extract it properly.";
sFail = "The essence evaporates away as you fail to extract it properly...";
sSuccess = "You carefully extract the ";
iAlchemyChance=iAlchemyChance-150;
switch (StringToInt(GetStringRight(sDItemResRef,3)))
@@ -1177,7 +1164,7 @@ void main()
case 17:
{
sSuccess=sSuccess+"Essence of Cold";
sComponent1 = "GEM_POWDERED_JADE";
sComponent1 = "GEM_POWDER_JADE";
iComponent1 = 3;
sComponent2 = "SEED_SPEARMINT";
iComponent2 = 5;
@@ -1534,13 +1521,7 @@ void main()
if (iAlchemySkill <= 1000)
{
//DelayCommand(6.0,SetTokenPair(oPC,14,12,iAlchemySkill));
// Uses NWN Database
//DelayCommand(6.0,SetCampaignInt("UOACraft","iAlchemySkill",iAlchemySkill,oPC));
// Uses External Database
DelayCommand(6.0,SetPersistentInt(oPC,"iAlchemySkill",iAlchemySkill,0,"UOACraft"));
DelayCommand(6.0,SetCampaignInt("UOACraft","iAlchemySkill",iAlchemySkill,oPC));
DelayCommand(6.0,SendMessageToPC(oPC,"=================================="));
DelayCommand(6.0,SendMessageToPC(oPC,"Your skill in alchemy has gone up!"));
DelayCommand(6.0,SendMessageToPC(oPC,"Current alchemy skill : "+ sOldSkill+"%"));

View File

@@ -1,6 +1,5 @@
//#include "_persist_01a"
#include "nw_i0_plot"
#include "aps_include"
void CreateAnObject(string sResource, object oPC, int iStackSize);
void GetNextStackedItem(object oPC, string sItemTag, int iCount, int iMode, string sStackResRef);
@@ -105,33 +104,21 @@ void main()
if (GetLocalInt(OBJECT_SELF,"iAmInUse") != 0)
{
SendMessageToPC(oPC,"You must wait until the current weapon or armor is completed before starting another.");
SendMessageToPC(oPC,"You must wait till the current weapon or armor is completed before starting another.");
return;
}
if (GetTag(oTool) != "ITEM_SMITHHAMMER_NORMAL")
{
FloatingTextStringOnCreature("You must have a blacksmith hammer equipped in order to attempt this craft.",oPC,FALSE);
FloatingTextStringOnCreature("You must have a smithy hammer equipped in order to attempt this craft...",oPC,FALSE);
return;
}
//int iSmithSkill = GetTokenPair(oPC,13,4); // Weaponsmith
// uses NWN Database
//int iSmithSkill = GetCampaignInt("UOACraft","iSmithSkill",oPC);
// uses external database
int iSmithSkill = GetPersistentInt(oPC,"iSmithSkill","UOACraft");
int iSmithSkill = GetCampaignInt("UOACraft","iSmithSkill",oPC);
int iSmithChance = iSmithSkill;
//int iArmorSkill = GetTokenPair(oPC,13,5); // ArmorCraft
// uses NWN database
//int iArmorSkill = GetCampaignInt("UOACraft","iArmorSkill",oPC);
// external database
int iArmorSkill = GetPersistentInt(oPC,"iArmorSkill","UOACraft");
int iArmorSkill = GetCampaignInt("UOACraft","iArmorSkill",oPC);
int iArmorChance = iArmorSkill;
if (iSmithChance < 350)
@@ -163,7 +150,7 @@ void main()
{
iSmithChance = iSmithChance - 100;
sSuccess = "You carefully heat, fold, and pound the metal into the form of a dagger.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rendering the dagger useless.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rending the dagger useless.";
sItemResRefPoor = CraftLookup("wswdg002",iIngotType);
sItemResRef = CraftLookup("nw_wswdg001",iIngotType);
sItemResRefExceptional = CraftLookup("wswdg003",iIngotType);
@@ -176,7 +163,7 @@ void main()
{
iSmithChance = iSmithChance-150;
sSuccess = "You carefully heat, fold, and pound the metal into the form of a shortsword.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rendering the shortsword useless.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rending the shortsword useless.";
sItemResRefPoor = CraftLookup("wswss002",iIngotType);
sItemResRef = CraftLookup("nw_wswss001",iIngotType);
sItemResRefExceptional = CraftLookup("wswss003",iIngotType);
@@ -190,7 +177,7 @@ void main()
iCraftType=1;
iArmorChance = iArmorChance - 100;
sSuccess = "You carefully forge the rings and sew them into the leather backing to make ringmail armor.";
sFail = "The rings fail to link properly, and the leather backing is ruined.";
sFail = "The rings fail to link properly and the leather backing is ruined.";
sItemResRefPoor = CraftLookup("ringmail001",iIngotType);
sItemResRef = CraftLookup("ringmail",iIngotType);
sItemResRefExceptional = CraftLookup("ringmail002",iIngotType);
@@ -238,7 +225,7 @@ void main()
iCraftType=1;
iArmorChance = iArmorChance - 300;
sSuccess = "You carefully forge the small metal scales and hook them into the leather to make scale mail armor.";
sFail = "The scales do not hook together properly, and the scale mail armor is ruined.";
sFail = "The scales do not hook properly, and the scale mail armor is ruined.";
sItemResRefPoor = CraftLookup("aarcl006",iIngotType);
sItemResRef = CraftLookup("nw_aarcl003",iIngotType);
sItemResRefExceptional = CraftLookup("aarcl007",iIngotType);
@@ -269,7 +256,7 @@ void main()
iCraftType=1;
iArmorChance = iArmorChance - 400;
sSuccess = "You carefully forge the small metal bands and fix them into the leather to make banded mail armor.";
sFail = "The bands do not fix together properly, and the banded mail armor is ruined.";
sFail = "The bands do not fix properly, and the banded mail armor is ruined.";
sItemResRefPoor = CraftLookup("aarcl014",iIngotType);
sItemResRef = CraftLookup("nw_aarcl011",iIngotType);
sItemResRefExceptional = CraftLookup("aarcl015",iIngotType);
@@ -286,7 +273,7 @@ void main()
iCraftType=1;
iArmorChance = iArmorChance - 400;
sSuccess = "You carefully forge the small metal plates and fix them into the leather to make splint mail armor.";
sFail = "The small metal plates are too brittle to fix together properly, and the splint mail armor is ruined.";
sFail = "The small metal plates are too brittle to fix properly, and the splint mail armor is ruined.";
sItemResRefPoor = CraftLookup("aarcl018",iIngotType);
sItemResRef = CraftLookup("nw_aarcl005",iIngotType);
sItemResRefExceptional = CraftLookup("aarcl019",iIngotType);
@@ -336,7 +323,7 @@ void main()
{
iSmithChance = iSmithChance-250;
sSuccess = "You carefully heat, fold, and pound the metal into the form of a longsword.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rendering the longsword useless.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rending the longsword useless.";
sItemResRefPoor = CraftLookup("wswls002",iIngotType);
sItemResRef = CraftLookup("nw_wswls001",iIngotType);
sItemResRefExceptional = CraftLookup("wswls003",iIngotType);
@@ -349,7 +336,7 @@ void main()
{
iSmithChance = iSmithChance-350;
sSuccess = "You carefully heat, fold, and pound the metal into the form of a bastard sword.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rendering the bastard sword useless.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rending the bastard sword useless.";
sItemResRefPoor = CraftLookup("wswbs002",iIngotType);
sItemResRef = CraftLookup("nw_wswbs001",iIngotType);
sItemResRefExceptional = CraftLookup("wswbs003",iIngotType);
@@ -362,7 +349,7 @@ void main()
{
iSmithChance = iSmithChance-400;
sSuccess = "You carefully heat, fold, and pound the metal into the form of a greatsword.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rendering the greatsword useless.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rending the greatsword useless.";
sItemResRefPoor = CraftLookup("wswgs002",iIngotType);
sItemResRef = CraftLookup("nw_wswgs001",iIngotType);
sItemResRefExceptional = CraftLookup("wswgs003",iIngotType);
@@ -494,7 +481,7 @@ void main()
{
iSmithChance = iSmithChance-200;
sSuccess = "You carefully heat, fold, and pound the metal into the form of a mace.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rendering the mace useless.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rending the mace useless.";
sItemResRefPoor = CraftLookup("wblml002",iIngotType);
sItemResRef = CraftLookup("nw_wblml001",iIngotType);
sItemResRefExceptional = CraftLookup("wblml003",iIngotType);
@@ -507,7 +494,7 @@ void main()
{
iSmithChance = iSmithChance-300;
sSuccess = "You carefully heat, fold, and pound the metal into the form of a maorning star.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rendering the morning star useless.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rending the morning star useless.";
sItemResRefPoor = CraftLookup("wblms002",iIngotType);
sItemResRef = CraftLookup("nw_wblms001",iIngotType);
sItemResRefExceptional = CraftLookup("wblms003",iIngotType);
@@ -523,7 +510,7 @@ void main()
{
iSmithChance = iSmithChance-250;
sSuccess = "You carefully heat, fold, and pound the metal into the form of a light flail.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rendering the light flail useless.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rending the light flail useless.";
sItemResRefPoor = CraftLookup("wblfl002",iIngotType);
sItemResRef = CraftLookup("nw_wblfl001",iIngotType);
sItemResRefExceptional = CraftLookup("wblfl003",iIngotType);
@@ -536,7 +523,7 @@ void main()
{
iSmithChance = iSmithChance-350;
sSuccess = "You carefully heat, fold, and pound the metal into the form of a heavy flail.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rendering the heavy flail useless.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rending the heavy flail useless.";
sItemResRefPoor = CraftLookup("wblfh002",iIngotType);
sItemResRef = CraftLookup("nw_wblfh001",iIngotType);
sItemResRefExceptional = CraftLookup("wblfh003",iIngotType);
@@ -549,7 +536,7 @@ void main()
{
iSmithChance = iSmithChance-250;
sSuccess = "You carefully heat, fold, and pound the metal into the form of a light hammer.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rendering the light hammer useless.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rending the light hammer useless.";
sItemResRefPoor = CraftLookup("wblhl002",iIngotType);
sItemResRef = CraftLookup("nw_wblhl001",iIngotType);
sItemResRefExceptional = CraftLookup("wblhl003",iIngotType);
@@ -562,7 +549,7 @@ void main()
{
iSmithChance = iSmithChance-350;
sSuccess = "You carefully heat, fold, and pound the metal into the form of a warhammer.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rendering the warhammer useless.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rending the warhammer useless.";
sItemResRefPoor = CraftLookup("wblhw002",iIngotType);
sItemResRef = CraftLookup("nw_wblhw001",iIngotType);
sItemResRefExceptional = CraftLookup("wblhw003",iIngotType);
@@ -575,7 +562,7 @@ void main()
{
iSmithChance = iSmithChance-150;
sSuccess = "You carefully heat, fold, and pound the metal into the form of a handaxe.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rendering the handaxe useless.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rending the handaxe useless.";
sItemResRefPoor = CraftLookup("waxhn002",iIngotType);
sItemResRef = CraftLookup("nw_waxhn001",iIngotType);
sItemResRefExceptional = CraftLookup("waxhn003",iIngotType);
@@ -588,7 +575,7 @@ void main()
{
iSmithChance = iSmithChance-150;
sSuccess = "You carefully heat, fold, and pound the metal into the form of a battleaxe.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rendering the battleaxe useless.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rending the battleaxe useless.";
sItemResRefPoor = CraftLookup("waxbt002",iIngotType);
sItemResRef = CraftLookup("nw_waxbt001",iIngotType);
sItemResRefExceptional = CraftLookup("waxbt003",iIngotType);
@@ -602,7 +589,7 @@ void main()
iCraftStackSize = 50;
iSmithChance = iSmithChance-50;
sSuccess = "You carefully forge the throwing darts.";
sFail = "The metal fails to cool properly, and the throwing darts are ruined.";
sFail = "The metal fails to cool properly and the throwing darts are ruined.";
sItemResRefPoor = CraftLookup("wthdt002",iIngotType);
sItemResRef = CraftLookup("nw_wthdt001",iIngotType);
sItemResRefExceptional = CraftLookup("wthdt003",iIngotType);
@@ -616,7 +603,7 @@ void main()
iCraftStackSize = 50;
iSmithChance = iSmithChance-50;
sSuccess = "You carefully forge the shuriken.";
sFail = "The metal fails to cool properly, and the shuriken are ruined.";
sFail = "The metal fails to cool properly and the shuriken are ruined.";
sItemResRefPoor = CraftLookup("wthsh002",iIngotType);
sItemResRef = CraftLookup("nw_wthsh001",iIngotType);
sItemResRefExceptional = CraftLookup("wthsh003",iIngotType);
@@ -630,7 +617,7 @@ void main()
iCraftStackSize = 50;
iSmithChance = iSmithChance-150;
sSuccess = "You carefully forge the throwing axes.";
sFail = "The metal fails to cool properly, and the throwing axes are ruined.";
sFail = "The metal fails to cool properly and the throwing axes are ruined.";
sItemResRefPoor = CraftLookup("wthax002",iIngotType);
sItemResRef = CraftLookup("nw_wthax001",iIngotType);
sItemResRefExceptional = CraftLookup("wthax003",iIngotType);
@@ -642,8 +629,8 @@ void main()
if (sTag == "P_HALBERD")
{
iSmithChance = iSmithChance-400;
sSuccess = "You carefully forge the halberd blade, and affix it to the shaft.";
sFail = "The metal turns brittle as you attempt to forge it, and the halberd is ruined.";
sSuccess = "You carefully forge the halberd blade and affix it to the shaft.";
sFail = "The metal turns brittle as you attempt to forge and the halberd is ruined.";
sItemResRefPoor = CraftLookup("wplhb002",iIngotType);
sItemResRef = CraftLookup("nw_wplhb001",iIngotType);
sItemResRefExceptional = CraftLookup("wplhb003",iIngotType);
@@ -658,8 +645,8 @@ void main()
if (sTag == "P_SCYTHE")
{
iSmithChance = iSmithChance-400;
sSuccess = "You carefully forge the scythe blade, and affix it to the shaft.";
sFail = "The metal turns brittle as you attempt to forge it, and the scythe is ruined.";
sSuccess = "You carefully forge the scythe blade and affix it to the shaft.";
sFail = "The metal turns brittle as you attempt to forge and the scythe is ruined.";
sItemResRefPoor = CraftLookup("wplsc002",iIngotType);
sItemResRef = CraftLookup("nw_wplsc001",iIngotType);
sItemResRefExceptional = CraftLookup("wplsc003",iIngotType);
@@ -674,8 +661,8 @@ void main()
if (sTag == "P_SPEAR")
{
iSmithChance = iSmithChance-300;
sSuccess = "You carefully forge the spear tip, and affix it to the shaft.";
sFail = "The metal turns brittle as you attempt to forge it, and the spear is ruined.";
sSuccess = "You carefully forge the spear tip and affix it to the shaft.";
sFail = "The metal turns brittle as you attempt to forge and the spear is ruined.";
sItemResRefPoor = CraftLookup("wplss002",iIngotType);
sItemResRef = CraftLookup("nw_wplss001",iIngotType);
sItemResRefExceptional = CraftLookup("wplss003",iIngotType);
@@ -704,7 +691,7 @@ void main()
{
iSmithChance = iSmithChance-100;
sSuccess = "You carefully fold and pound the metal into the form of a kukri.";
sFail = "The metal turns brittle as you attempt to forge it, and the kukri is ruined.";
sFail = "The metal turns brittle as you attempt to forge and the kukri is ruined.";
sItemResRefPoor = CraftLookup("wspku002",iIngotType);
sItemResRef = CraftLookup("nw_wspku001",iIngotType);
sItemResRefExceptional = CraftLookup("wspku003",iIngotType);
@@ -717,7 +704,7 @@ void main()
{
iSmithChance = iSmithChance-150;
sSuccess = "You carefully fold and pound the metal into the form of a sickle.";
sFail = "The metal turns brittle as you attempt to forge it, and the sickle is ruined.";
sFail = "The metal turns brittle as you attempt to forge and the sickle is ruined.";
sItemResRefPoor = CraftLookup("wspsc002",iIngotType);
sItemResRef = CraftLookup("nw_wspsc001",iIngotType);
sItemResRefExceptional = CraftLookup("wspsc003",iIngotType);
@@ -730,7 +717,7 @@ void main()
{
iSmithChance = iSmithChance-450;
sSuccess = "You carefully fold and pound the metal into the form of a dire mace.";
sFail = "The metal turns brittle as you attempt to forge it, and the dire mace is ruined.";
sFail = "The metal turns brittle as you attempt to forge and the dire mace is ruined.";
sItemResRefPoor = CraftLookup("wdbma002",iIngotType);
sItemResRef = CraftLookup("nw_wdbma001",iIngotType);
sItemResRefExceptional = CraftLookup("wdbma003",iIngotType);
@@ -743,7 +730,7 @@ void main()
{
iSmithChance = iSmithChance-450;
sSuccess = "You carefully fold and pound the metal into the form of a double axe.";
sFail = "The metal turns brittle as you attempt to forge it, and the double axe is ruined.";
sFail = "The metal turns brittle as you attempt to forge and the double axe is ruined.";
sItemResRefPoor = CraftLookup("wdbax002",iIngotType);
sItemResRef = CraftLookup("nw_wdbax001",iIngotType);
sItemResRefExceptional = CraftLookup("wdbax003",iIngotType);
@@ -756,7 +743,7 @@ void main()
{
iSmithChance = iSmithChance-500;
sSuccess = "You carefully fold and pound the metal into the form of a two-bladed sword.";
sFail = "The metal turns brittle as you attempt to forge it, and the two-bladed sword is ruined.";
sFail = "The metal turns brittle as you attempt to forge and the two-bladed sword is ruined.";
sItemResRefPoor = CraftLookup("wdbsw002",iIngotType);
sItemResRef = CraftLookup("nw_wdbsw001",iIngotType);
sItemResRefExceptional = CraftLookup("wdbsw003",iIngotType);
@@ -770,7 +757,7 @@ void main()
iSmithChance = iSmithChance+50; //Bullets are easy to make
iCraftStackSize = 99;
sSuccess = "You carefully forge the bullets.";
sFail = "The metal fails to cool properly, and the bullets are ruined.";
sFail = "The metal fails to cool properly and the bullets are ruined.";
sItemResRefPoor = CraftLookup("wambu002",iIngotType);
sItemResRef = CraftLookup("nw_wambu001",iIngotType);
sItemResRefExceptional = CraftLookup("wambu003",iIngotType);
@@ -784,7 +771,7 @@ void main()
iSmithChance = iSmithChance - 50;
iCraftStackSize = 50;
sSuccess = "You carefully forge the arrowheads.";
sFail = "The metal fails to cool properly, and the arrowheads are ruined.";
sFail = "The metal fails to cool properly and the arrowheads are ruined.";
sItemResRefPoor = CraftLookup("arrowhead001",iIngotType);
sItemResRef = CraftLookup("arrowhead",iIngotType);
sItemResRefExceptional = CraftLookup("arrowhead002",iIngotType);
@@ -798,7 +785,7 @@ void main()
iSmithChance = iSmithChance - 50;
iCraftStackSize = 50;
sSuccess = "You carefully forge the bolt tips.";
sFail = "The metal fails to cool properly, and the bolt tips are ruined.";
sFail = "The metal fails to cool properly and the bolt tips are ruined.";
sItemResRefPoor = CraftLookup("arrowhead004",iIngotType);
sItemResRef = CraftLookup("arrowhead003",iIngotType);
sItemResRefExceptional = CraftLookup("arrowhead005",iIngotType);
@@ -813,7 +800,7 @@ void main()
iArmorChance = iArmorChance + 100; // metal studs are super-easy
iCraftStackSize = 99;
sSuccess = "You carefully forge the metal studs.";
sFail = "The metal fails to cool properly, and the metal studs are ruined.";
sFail = "The metal fails to cool properly and the metal studs are ruined.";
sItemResRefPoor = CraftLookup("metalstud001",iIngotType);
sItemResRef = CraftLookup("metalstud",iIngotType);
sItemResRefExceptional = CraftLookup("metalstud002",iIngotType);
@@ -826,7 +813,7 @@ void main()
{
iSmithChance = iSmithChance-350;
sSuccess = "You carefully fold and pound the metal into the form of a katana.";
sFail = "The metal turns brittle as you attempt to forge it, and the katana is ruined.";
sFail = "The metal turns brittle as you attempt to forge and the katana is ruined.";
sItemResRefPoor = CraftLookup("wswka002",iIngotType);
sItemResRef = CraftLookup("nw_wswka001",iIngotType);
sItemResRefExceptional = CraftLookup("wswka003",iIngotType);
@@ -839,7 +826,7 @@ void main()
{
iSmithChance = iSmithChance-250;
sSuccess = "You carefully fold and pound the metal into the form of a rapier.";
sFail = "The metal turns brittle as you attempt to forge it, and the rapier is ruined.";
sFail = "The metal turns brittle as you attempt to forge and the rapier is ruined.";
sItemResRefPoor = CraftLookup("wswrp002",iIngotType);
sItemResRef = CraftLookup("nw_wswrp001",iIngotType);
sItemResRefExceptional = CraftLookup("wswrp003",iIngotType);
@@ -852,7 +839,7 @@ void main()
{
iSmithChance = iSmithChance-300;
sSuccess = "You carefully fold and pound the metal into the form of a scimitar.";
sFail = "The metal turns brittle as you attempt to forge it, and the scimitar is ruined.";
sFail = "The metal turns brittle as you attempt to forge and the scimitar is ruined.";
sItemResRefPoor = CraftLookup("wswsc002",iIngotType);
sItemResRef = CraftLookup("nw_wswsc001",iIngotType);
sItemResRefExceptional = CraftLookup("wswsc003",iIngotType);
@@ -865,7 +852,7 @@ void main()
{
iSmithChance = iSmithChance-400;
sSuccess = "You carefully fold and pound the metal into the form of a great axe.";
sFail = "The metal turns brittle as you attempt to forge it, and the great axe is ruined.";
sFail = "The metal turns brittle as you attempt to forge and the great axe is ruined.";
sItemResRefPoor = CraftLookup("waxgr002",iIngotType);
sItemResRef = CraftLookup("nw_waxgr001",iIngotType);
sItemResRefExceptional = CraftLookup("waxgr003",iIngotType);
@@ -878,12 +865,12 @@ void main()
{
if (GetRacialType(oPC)!=RACIAL_TYPE_DWARF)
{
FloatingTextStringOnCreature("You are not a dwarf! You will be unable to craft a Dwarven Waraxe!",oPC,FALSE);
FloatingTextStringOnCreature("You are not a dwarf! You cannot craft a Dwarven Waraxe!",oPC,FALSE);
return;
}
iSmithChance = iSmithChance-400;
sSuccess = "You carefully fold and pound the metal into the form of a dwarven waraxe.";
sFail = "The metal turns brittle as you attempt to forge it, and the dwarven waraxe is ruined.";
sFail = "The metal turns brittle as you attempt to forge and the dwarven waraxe is ruined.";
sItemResRefPoor = CraftLookup("wdwraxe002",iIngotType);
sItemResRef = CraftLookup("x2_wdwraxe001",iIngotType);
sItemResRefExceptional = CraftLookup("wdwraxe003",iIngotType);
@@ -1259,13 +1246,7 @@ void main()
if (iSmithSkill <= 1000)
{
//DelayCommand(13.0,SetTokenPair(oPC,13,4,iSmithSkill));
// uses NWN database
DelayCommand(13.0,SetCampaignInt("UOACraft","iSmithSkill",iSmithSkill,oPC));
// uses external database
DelayCommand(13.0,SetPersistentInt(oPC,"iSmithSkill",iSmithSkill,0,"UOACraft"));
DelayCommand(13.0,SendMessageToPC(oPC,"========================================="));
DelayCommand(13.0,SendMessageToPC(oPC,"Your skill in weaponsmithing has gone up!"));
DelayCommand(13.0,SendMessageToPC(oPC,"Current weaponsmithing skill : "+ sOldSkill+"%"));
@@ -1289,13 +1270,7 @@ void main()
if (iArmorSkill <= 1000)
{
//DelayCommand(13.0,SetTokenPair(oPC,13,5,iArmorSkill));
//uses NWN database
DelayCommand(13.0,SetCampaignInt("UOACraft","iArmorSkill",iArmorSkill,oPC));
//uses external database
DelayCommand(13.0,SetPersistentInt(oPC,"iArmorSkill",iArmorSkill,0,"UOACraft"));
DelayCommand(13.0,SendMessageToPC(oPC,"====================================="));
DelayCommand(13.0,SendMessageToPC(oPC,"Your skill in armorcraft has gone up!"));
DelayCommand(13.0,SendMessageToPC(oPC,"Current armorcraft skill : "+ sOldSkill+"%"));

View File

@@ -1,5 +1,4 @@
//#include "_persist_01a"
#include "aps_include"
void CreateAnObject(string sResource, object oPC, int iStackSize);
void BeeAttackPC(object oPC, object oSelf);
@@ -59,13 +58,7 @@ void main()
int iHoney = GetLocalInt(oSelf,"iHoney");
//int iBeeSkill = GetTokenPair(oPC,13,1);
//uses NWN database
//int iBeeSkill = GetCampaignInt("UOACraft","iBeeSkill",oPC);
//uses external database
int iBeeSkill = GetPersistentInt(oPC,"iBeeSkill","UOACraft");
int iBeeSkill = GetCampaignInt("UOACraft","iBeeSkill",oPC);
int iBeeChance = iBeeSkill;
if (iBeeChance <350)
@@ -90,7 +83,7 @@ void main()
if (GetTag(oItem)=="ITEM_HONEYCOMB")
{
FloatingTextStringOnCreature("You begin to cut the honeycomb from the beehive.",oPC,FALSE);
FloatingTextStringOnCreature("You begin to cut the honeycomb from the beehive..",oPC,FALSE);
sItem = "honeycomb";
iBeeChance = iBeeChance - 250;
sSuccess = "You carefully cut the honeycomb from the hive.";
@@ -105,14 +98,14 @@ void main()
}
else
{
sFail = "You have destroyed the honeycomb while trying to remove it from the hive!";
sFail = "You have destroyed the honeycomb while trying to remove it from the hive.";
}
}
}
if (GetTag(oItem)=="ITEM_HONEY")
{
FloatingTextStringOnCreature("You begin gathering up some of the honey from the beehive.",oPC,FALSE);
FloatingTextStringOnCreature("You begin gathering up some of the honey from the beehive...",oPC,FALSE);
sItem = "honey";
iHoney--;
sSuccess = "You carefully collect the honey from the hive.";
@@ -191,13 +184,7 @@ void main()
if (iBeeSkill <= 1000)
{
//DelayCommand(6.0,SetTokenPair(oPC,13,1,iBeeSkill));
//uses NWN database
//DelayCommand(6.0,SetCampaignInt("UOACraft","iBeeSkill",iBeeSkill,oPC));
//uses external database
DelayCommand(6.0,SetPersistentInt(oPC,"iBeeSkill",iBeeSkill,0,"UOACraft"));
DelayCommand(6.0,SetCampaignInt("UOACraft","iBeeSkill",iBeeSkill,oPC));
DelayCommand(6.0,SendMessageToPC(oPC,"====================================="));
DelayCommand(6.0,SendMessageToPC(oPC,"Your skill in beekeeping has gone up!"));
DelayCommand(6.0,SendMessageToPC(oPC,"Current beekeeping skill : "+ sOldSkill+"%"));

View File

@@ -1,6 +1,5 @@
//#include "_persist_01a"
#include "nw_i0_plot"
#include "aps_include"
void CreateAnObject(string sResource, object oPC, int iStackSize);
void GetNextStackedItem(object oPC, string sItemTag, int iCount, int iMode, string sStackResRef);
@@ -103,13 +102,7 @@ void main()
}
//int iBowSkill = GetTokenPair(oPC,13,3);
// uses NWN database
//int iBowSkill = GetCampaignInt("UOACraft","iBowSkill",oPC);
//external database
int iBowSkill = GetPersistentInt(oPC,"iBowSkill","UOACraft");
int iBowSkill = GetCampaignInt("UOACraft","iBowSkill",oPC);
int iBowChance = iBowSkill;
if (iBowChance < 350)
{
@@ -368,13 +361,7 @@ void main()
if (iBowSkill <= 1000)
{
//DelayCommand(13.0,SetTokenPair(oPC,13,3,iBowSkill));
//NWN database
//DelayCommand(13.0,SetCampaignInt("UOACraft","iBowSkill",iBowSkill,oPC));
//external database
DelayCommand(13.0,SetPersistentInt(oPC,"iBowSkill",iBowSkill,0,"UOACraft"));
DelayCommand(13.0,SetCampaignInt("UOACraft","iBowSkill",iBowSkill,oPC));
DelayCommand(13.0,SendMessageToPC(oPC,"==================================="));
DelayCommand(13.0,SendMessageToPC(oPC,"Your skill in bowcraft has gone up!"));
DelayCommand(13.0,SendMessageToPC(oPC,"Current bowcraft skill : "+ sOldSkill+"%"));

View File

@@ -1,5 +1,4 @@
#include "nw_i0_plot"
#include "aps_include"
int CheckComponent(object oPC, string sTag, int iMinimum);
void RemoveComponent(object oPC, string sTag, int iMinimum);
@@ -93,8 +92,8 @@ void main()
RemoveComponent(oPC,"item_juice_001",1);
RemoveComponent(oPC,"item_yeast003",1);
RemoveComponent(oPC,"item_cask_006",1);
sSuccess="You carefully combine the ingredients, and seal the jug.";
sFail = "The yeast fails to ferment the ingredients and the cider is ruined.";
sSuccess="You carefully combine the ingredients and seal the jug.";
sFail = "The yeast fails to ferment the ingredients. The cider is ruined.";
sProduct = "item_fullkeg_001";
sByproduct1 = "glassbottle";
iByproduct1 = 1;
@@ -112,8 +111,8 @@ void main()
RemoveComponent(oPC,"item_yeast003",1);
RemoveComponent(oPC,"item_cask_006",1);
RemoveComponent(oPC,"item_syrup_003",1);
sSuccess="You carefully combine the ingredients, and seal the jug.";
sFail = "The yeast fails to ferment the ingredients, and the cider is ruined.";
sSuccess="You carefully combine the ingredients and seal the jug.";
sFail = "The yeast fails to ferment the ingredients. The cider is ruined.";
sProduct = "item_fullkeg_002";
sByproduct1 = "glassbottle";
iByproduct1 = 1;
@@ -132,7 +131,7 @@ void main()
RemoveComponent(oPC,"item_juice_022",1);
RemoveComponent(oPC,"item_yeast003",1);
RemoveComponent(oPC,"item_cask_006",1);
sSuccess="You carefully combine the ingredients, and seal the jug.";
sSuccess="You carefully combine the ingredients and seal the jug.";
sFail = "The yeast fails to ferment the ingredients. The scrumpy is ruined.";
sProduct = "item_fullkeg_003";
sByproduct1 = "glassbottle";
@@ -152,7 +151,7 @@ void main()
RemoveComponent(oPC,"item_yeast003",1);
RemoveComponent(oPC,"item_cask_006",1);
RemoveComponent(oPC,"ITEM_HONEY",1);
sSuccess="You carefully combine the ingredients, and seal the jug.";
sSuccess="You carefully combine the ingredients and seal the jug.";
sFail = "The yeast fails to ferment the ingredients. The cyser is ruined.";
sProduct = "item_fullkeg_004";
sByproduct1 = "glassbottle";
@@ -216,8 +215,8 @@ void main()
if (iMissing==1){SendMissingMessage(oPC);return;}
RemoveComponent(oPC,"item_fullkeg_001",1);
RemoveComponent(oPC,"item_yeast002",1);
sSuccess="You carefully combine the top yeast with the cider.";
sFail = "The mixture is contaminated as you attempt to add the top yeast.";
sSuccess="You carefully combine the topyeast with the cider.";
sFail = "The mixture is contaminated as you attempt to add the topyeast.";
sProduct = "item_fullkeg_008";
sFailKeg = "item_cask_006";
}
@@ -234,8 +233,8 @@ void main()
RemoveComponent(oPC,"item_yeast002",1);
RemoveComponent(oPC,"item_cask_001",1);
RemoveComponent(oPC,"item_syrup_003",1);
sSuccess="You carefully combine the ingredients, and seal the cask.";
sFail = "The yeast fails to ferment the ingredients, and the wine is ruined.";
sSuccess="You carefully combine the ingredients and seal the cask.";
sFail = "The yeast fails to ferment the ingredients. The wine is ruined.";
sProduct = "item_fullkeg_009";
sByproduct1 = "glassbottle";
iByproduct1 = 3;
@@ -253,7 +252,7 @@ void main()
RemoveComponent(oPC,"item_yeast002",1);
RemoveComponent(oPC,"item_cask_001",1);
RemoveComponent(oPC,"item_syrup_003",1);
sSuccess="You carefully combine the ingredients, and seal the cask.";
sSuccess="You carefully combine the ingredients and seal the cask.";
sFail = "The yeast fails to ferment the ingredients. The wine is ruined.";
sProduct = "item_fullkeg_010";
sByproduct1 = "glassbottle";
@@ -271,7 +270,7 @@ void main()
RemoveComponent(oPC,"item_fullkeg_009",1);
RemoveComponent(oPC,"item_yeast003",1);
RemoveComponent(oPC,"item_syrup_003",1);
sSuccess="You carefully combine the bottom yeast, sugar, and red wine and seal the cask.";
sSuccess="You carefully combine the bottomyeast, sugar, and red wine and seal the cask.";
sFail = "The yeast fails to ferment the ingredients. The sherry is ruined.";
sProduct = "item_fullkeg_012";
sFailKeg = "item_cask_001";
@@ -288,7 +287,7 @@ void main()
RemoveComponent(oPC,"item_yeast002",1);
RemoveComponent(oPC,"item_cask_001",1);
RemoveComponent(oPC,"item_syrup_003",1);
sSuccess="You carefully combine the ingredients, and seal the cask.";
sSuccess="You carefully combine the ingredients and seal the cask.";
sFail = "The yeast fails to ferment the ingredients. The wine is ruined.";
sProduct = "item_fullkeg_011";
sByproduct1 = "glassbottle";
@@ -310,7 +309,7 @@ void main()
RemoveComponent(oPC,"SEED_HOPS",3);
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",5);
RemoveComponent(oPC,"item_cask_002",1);
sSuccess="You combine the water, hops, barley wort, and bottom yeast and seal the barrel.";
sSuccess="You combine the water, hops, barley wort, and bottomyeast and seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The lager is ruined.";
sProduct = "item_fullkeg_013";
sByproduct1 = "item001";
@@ -331,7 +330,7 @@ void main()
RemoveComponent(oPC,"SEED_HOPS",4);
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",5);
RemoveComponent(oPC,"item_cask_002",1);
sSuccess="You combine the water, hops, barley wort, and bottom yeast and seal the barrel.";
sSuccess="You combine the water, hops, barley wort, and bottomyeast and seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The lager is ruined.";
sProduct = "item_fullkeg_014";
sByproduct1 = "item001";
@@ -353,7 +352,7 @@ void main()
RemoveComponent(oPC,"SEED_HOPS",3);
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",6);
RemoveComponent(oPC,"item_cask_002",1);
sSuccess="You combine the water, hops, barley wort, and bottom yeast and seal the barrel.";
sSuccess="You combine the water, hops, barley wort, and bottomyeast and seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The lager is ruined.";
sProduct = "item_fullkeg_015";
sByproduct1 = "item001";
@@ -377,7 +376,7 @@ void main()
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",4);
RemoveComponent(oPC,"item_cask_002",1);
RemoveComponent(oPC,"item_syrup_004",1);
sSuccess="You combine the water, hops, barley wort, caramel, and bottom yeast then seal the barrel.";
sSuccess="You combine the water, hops, barley wort, caramel, and bottomyeast and seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The draught is ruined.";
sProduct = "item_fullkeg_016";
sByproduct1 = "item001";
@@ -399,7 +398,7 @@ void main()
RemoveComponent(oPC,"SEED_HOPS",6);
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",4);
RemoveComponent(oPC,"item_cask_002",1);
sSuccess="You combine the water, hops, barley wort, and bottom yeast then seal the barrel.";
sSuccess="You combine the water, hops, barley wort, and bottomyeast and seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The red malt lager is ruined.";
sProduct = "item_fullkeg_017";
sByproduct1 = "item001";
@@ -423,7 +422,7 @@ void main()
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",4);
RemoveComponent(oPC,"item_cask_002",1);
RemoveComponent(oPC,"item_syrup_004",2);
sSuccess="You combine the water, hops, barley wort, caramel, and bottom yeast then seal the barrel.";
sSuccess="You combine the water, hops, barley wort, caramel, and bottomyeast and seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The gold malt lager is ruined.";
sProduct = "item_fullkeg_018";
sByproduct1 = "item001";
@@ -447,7 +446,7 @@ void main()
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",4);
RemoveComponent(oPC,"item_cask_002",1);
RemoveComponent(oPC,"item_syrup_002",3);
sSuccess="You combine the water, hops, barley wort, molasses, and bottom yeast then seal the barrel.";
sSuccess="You combine the water, hops, barley wort, molasses, and bottomyeast and seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The ice lager is ruined.";
sProduct = "item_fullkeg_019";
sByproduct1 = "item001";
@@ -471,7 +470,7 @@ void main()
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",4);
RemoveComponent(oPC,"item_cask_002",1);
RemoveComponent(oPC,"item_syrup_004",3);
sSuccess="You combine the water, hops, barley wort, caramel, and bottom yeast then seal the barrel.";
sSuccess="You combine the water, hops, barley wort, caramel, and bottomyeast and seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The stout lager is ruined.";
sProduct = "item_fullkeg_020";
sByproduct1 = "item001";
@@ -494,7 +493,7 @@ void main()
RemoveComponent(oPC,"SEED_HOPS",4);
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",5);
RemoveComponent(oPC,"item_cask_002",1);
sSuccess="You combine the water, hops, barley wort, and top yeast then seal the barrel.";
sSuccess="You combine the water, hops, barley wort, and topyeast and seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The ale is ruined.";
sProduct = "item_fullkeg_021";
sByproduct1 = "item001";
@@ -518,7 +517,7 @@ void main()
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",4);
RemoveComponent(oPC,"item_cask_002",1);
RemoveComponent(oPC,"item_syrup_004",2);
sSuccess="You combine the water, hops, barley wort, caramel, and top yeast then seal the barrel.";
sSuccess="You combine the water, hops, barley wort, caramel, and topyeast and seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The stout ale is ruined.";
sProduct = "item_fullkeg_022";
sByproduct1 = "item001";
@@ -544,7 +543,7 @@ void main()
RemoveComponent(oPC,"item_cask_002",1);
RemoveComponent(oPC,"item_syrup_004",2);
RemoveComponent(oPC,"item_syrup_004",1);
sSuccess="You combine the water, hops, barley wort, caramel, molasses, and top yeast then seal the barrel.";
sSuccess="You combine the water, hops, barley wort, caramel, molasses, and topyeast and seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The porter ale is ruined.";
sProduct = "item_fullkeg_023";
sByproduct1 = "item001";
@@ -570,7 +569,7 @@ void main()
RemoveComponent(oPC,"item_cask_002",1);
RemoveComponent(oPC,"item_syrup_004",2);
RemoveComponent(oPC,"item_juice_003",1);
sSuccess="You combine the water, hops, barley wort, caramel, grape juice, and top yeast then seal the barrel.";
sSuccess="You combine the water, hops, barley wort, caramel, grape juice, and topyeast and seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The barleywine ale is ruined.";
sProduct = "item_fullkeg_024";
sByproduct1 = "item001";
@@ -596,7 +595,7 @@ void main()
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",4);
RemoveComponent(oPC,"item_cask_002",1);
RemoveComponent(oPC,"item_syrup_004",3);
sSuccess="You combine the water, hops, barley wort, caramel, and top yeast then seal the barrel.";
sSuccess="You combine the water, hops, barley wort, caramel, and topyeast and seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The kolsch ale is ruined.";
sProduct = "item_fullkeg_025";
sByproduct1 = "item001";
@@ -620,7 +619,7 @@ void main()
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",2);
RemoveComponent(oPC,"item_cask_003",1);
RemoveComponent(oPC,"item_syrup_004",1);
sSuccess="You combine the water, honey, caramel, and top yeast then seal the barrel.";
sSuccess="You combine the water, honey, caramel, and topyeast and seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The honeymead is ruined.";
sProduct = "item_fullkeg_026";
sByproduct1 = "item001";
@@ -641,7 +640,7 @@ void main()
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",2);
RemoveComponent(oPC,"item_cask_003",1);
RemoveComponent(oPC,"item_syrup_004",1);
sSuccess="You combine the water, honey, caramel, and top yeast then seal the barrel.";
sSuccess="You combine the water, honey, caramel, and topyeast and seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The sackmead is ruined.";
sProduct = "item_fullkeg_027";
sByproduct1 = "item001";
@@ -665,7 +664,7 @@ void main()
RemoveComponent(oPC,"item_cask_003",1);
RemoveComponent(oPC,"item_syrup_004",1);
RemoveComponent(oPC,"ITEM_REDAPPLE",3);
sSuccess="You combine the water, honey, caramel, apples, and top yeast then seal the barrel.";
sSuccess="You combine the water, honey, caramel, apples, and topyeast and seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The apple muslin mead is ruined.";
sProduct = "item_fullkeg_028";
sByproduct1 = "item001";
@@ -691,7 +690,7 @@ void main()
RemoveComponent(oPC,"item_syrup_004",1);
RemoveComponent(oPC,"SEED_SPEARMINT",2);
RemoveComponent(oPC,"SEED_PEPPERMINT",2);
sSuccess="You combine the water, honey, caramel, mint leaves, and top yeast then seal the barrel.";
sSuccess="You combine the water, honey, caramel, mint leaves, and topyeast and seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The metheglin is ruined.";
sProduct = "item_fullkeg_029";
sByproduct1 = "item001";
@@ -715,7 +714,7 @@ void main()
RemoveComponent(oPC,"item_cask_003",1);
RemoveComponent(oPC,"item_syrup_004",1);
RemoveComponent(oPC,"SEED_BLUEBERRY",4);
sSuccess="You combine the water, honey, caramel, blueberries, and top yeast then seal the barrel.";
sSuccess="You combine the water, honey, caramel, blueberries, and topyeast and seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The morat is ruined.";
sProduct = "item_fullkeg_030";
sByproduct1 = "item001";
@@ -741,7 +740,7 @@ void main()
RemoveComponent(oPC,"item_syrup_004",1);
RemoveComponent(oPC,"SEED_GRAPE1",4);
RemoveComponent(oPC,"SEED_GINGER",2);
sSuccess="You combine the water, honey, caramel, grapes, ginger, and top yeast then seal the barrel.";
sSuccess="You combine the water, honey, caramel, grapes, ginger, and topyeast and seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The hippocras is ruined.";
sProduct = "item_fullkeg_031";
sByproduct1 = "item001";
@@ -765,7 +764,7 @@ void main()
RemoveComponent(oPC,"item_cask_003",1);
RemoveComponent(oPC,"item_syrup_004",1);
RemoveComponent(oPC,"SEED_GRAPE3",4);
sSuccess="You combine the water, honey, caramel, grapes, and top yeast then seal the barrel.";
sSuccess="You combine the water, honey, caramel, grapes, and topyeast and seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The pyment is ruined.";
sProduct = "item_fullkeg_032";
sByproduct1 = "item001";
@@ -789,7 +788,7 @@ void main()
RemoveComponent(oPC,"item_cask_003",1);
RemoveComponent(oPC,"item_syrup_004",1);
RemoveComponent(oPC,"item_wort_001",2);
sSuccess="You combine the water, honey, caramel, corn wort, and top yeast then seal the barrel.";
sSuccess="You combine the water, honey, caramel, corn wort, and topyeast and seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The braggot is ruined.";
sProduct = "item_fullkeg_033";
sByproduct1 = "item001";
@@ -813,7 +812,7 @@ void main()
RemoveComponent(oPC,"item_cask_003",1);
RemoveComponent(oPC,"item_syrup_004",1);
RemoveComponent(oPC,"item_juice_041",1);
sSuccess="You combine the water, honey, caramel, vinegar, and top yeast then seal the barrel.";
sSuccess="You combine the water, honey, caramel, vinegar, and topyeast and seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The oxymel is ruined.";
sProduct = "item_fullkeg_034";
sByproduct1 = "item001";
@@ -839,7 +838,7 @@ void main()
RemoveComponent(oPC,"item_cask_003",1);
RemoveComponent(oPC,"item_syrup_004",1);
RemoveComponent(oPC,"SEED_ORIENTALPOPPY",2);
sSuccess="You combine the water, honey, caramel, poppies, and top yeast then seal the barrel.";
sSuccess="You combine the water, honey, caramel, poppies, and topyeast and seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The rhodomel is ruined.";
sProduct = "item_fullkeg_035";
sByproduct1 = "item001";
@@ -858,7 +857,7 @@ void main()
RemoveComponent(oPC,"item_wort_010",2);
RemoveComponent(oPC,"item_cask_004",1);
RemoveComponent(oPC,"item_syrup_004",1);
sSuccess="You combine the distilled corn wort and caramel then seal the barrel.";
sSuccess="You combine the distilled corn wort and caramel and seal the barrel.";
sFail = "The whiskey fails to age properly and is ruined.";
sProduct = "item_fullkeg_036";
sFailKeg = "item_cask_004";
@@ -874,7 +873,7 @@ void main()
RemoveComponent(oPC,"item_wort_013",2);
RemoveComponent(oPC,"item_cask_004",1);
RemoveComponent(oPC,"item_syrup_004",2);
sSuccess="You combine the distilled acorn wort and caramel then seal the barrel.";
sSuccess="You combine the distilled acorn wort and caramel and seal the barrel.";
sFail = "The whiskey fails to age properly and is ruined.";
sProduct = "item_fullkeg_037";
sFailKeg = "item_cask_004";
@@ -890,7 +889,7 @@ void main()
RemoveComponent(oPC,"item_wort_016",2);
RemoveComponent(oPC,"item_cask_004",1);
RemoveComponent(oPC,"item_syrup_002",1);
sSuccess="You combine the distilled rice wort and molasses then seal the barrel.";
sSuccess="You combine the distilled rice wort and molasses and seal the barrel.";
sFail = "The sake fails to age properly and is ruined.";
sProduct = "item_fullkeg_038";
sFailKeg = "item_cask_004";
@@ -909,7 +908,7 @@ void main()
RemoveComponent(oPC,"item_cask_004",1);
RemoveComponent(oPC,"item_syrup_002",2);
RemoveComponent(oPC,"item_yeast003",1);
sSuccess="You combine the sugarcane, molasses, and yeast then seal the barrel.";
sSuccess="You combine the sugarcane, molasses, and yeast and seal the barrel.";
sFail = "The rum fails to age properly and is ruined.";
sProduct = "item_fullkeg_039";
sByproduct1 = "glassbottle";
@@ -931,7 +930,7 @@ void main()
RemoveComponent(oPC,"item_syrup_002",2);
RemoveComponent(oPC,"item_yeast003",2);
RemoveComponent(oPC,"drink_cup_010",1);
sSuccess="You combine the sugarcane, molasses, wine, and yeast then seal the barrel.";
sSuccess="You combine the sugarcane, molasses, wine, and yeast and seal the barrel.";
sFail = "The rum fails to age properly and is ruined.";
sProduct = "item_fullkeg_040";
sByproduct1 = "glassbottle";
@@ -953,7 +952,7 @@ void main()
RemoveComponent(oPC,"item_syrup_002",2);
RemoveComponent(oPC,"item_yeast003",2);
RemoveComponent(oPC,"item_syrup_004",2);
sSuccess="You combine the sugarcane, molasses, caramel, and yeast then seal the barrel.";
sSuccess="You combine the sugarcane, molasses, caramel, and yeast and seal the barrel.";
sFail = "The rum fails to age properly and is ruined.";
sProduct = "item_fullkeg_041";
sByproduct1 = "glassbottle";
@@ -977,7 +976,7 @@ void main()
RemoveComponent(oPC,"item_yeast003",2);
RemoveComponent(oPC,"ITEM_HONEY",2);
RemoveComponent(oPC,"item_syrup_001",1);
sSuccess="You combine the sugarcane, molasses, honey, syrup, and yeast then seal the barrel.";
sSuccess="You combine the sugarcane, molasses, honey, syrup, and yeast and seal the barrel.";
sFail = "The rum fails to age properly and is ruined.";
sProduct = "item_fullkeg_042";
sByproduct1 = "glassbottle";
@@ -999,7 +998,7 @@ void main()
RemoveComponent(oPC,"item_syrup_002",4);
RemoveComponent(oPC,"item_yeast003",2);
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",3);
sSuccess="You combine the sugar, molasses, water, molasses, and yeast then seal the barrel.";
sSuccess="You combine the sugar, molasses, water, molasses, and yeast and seal the barrel.";
sFail = "The rum fails to age properly and is ruined.";
sProduct = "item_fullkeg_043";
sByproduct1 = "glassbottle";
@@ -1010,7 +1009,7 @@ void main()
}
//Other
if (iBrew==74) // Vodka
if (iBrew==73) // Vodka
{
iDifficulty = 100;
if (CheckComponent(oPC,"item_wort_019",2)==FALSE) iMissing=1;
@@ -1022,7 +1021,7 @@ void main()
RemoveComponent(oPC,"item_cask_006",1);
RemoveComponent(oPC,"item_syrup_003",1);
RemoveComponent(oPC,"ITEM_BUCKETOFWATER",2);
sSuccess="You combine the distilled vodka base and sugar then seal the jug.";
sSuccess="You combine the distilled vodka base snd sugar and seal the jug.";
sFail = "The vodka fails to mature properly and is ruined.";
sProduct = "item_fullkeg_045";
sByproduct1= "item001";
@@ -1030,7 +1029,7 @@ void main()
sFailKeg = "item_cask_006";
}
if (iBrew==75) // Gin
if (iBrew==74) // Gin
{
iDifficulty = 100;
if (CheckComponent(oPC,"item_fullkeg_045",1)==FALSE) iMissing=1;
@@ -1040,7 +1039,7 @@ void main()
RemoveComponent(oPC,"item_fullkeg_045",1);
RemoveComponent(oPC,"item_juice_017",1);
RemoveComponent(oPC,"item_juice_031",1);
sSuccess="You combine the vodka, juniper berry juice, and sugarcane extract then seal the jug.";
sSuccess="You combine the vodka, juniper berry juice, snd sugarcane extract and seal the jug.";
sFail = "The gin fails to mature properly and is ruined.";
sProduct = "item_fullkeg_046";
sFailKeg = "item_cask_006";
@@ -1054,12 +1053,7 @@ void main()
return;
}
//nwn database
//int iBrewSkill = GetCampaignInt("UOACraft","iBrewSkill",oPC);
//external database
int iBrewSkill = GetPersistentInt(oPC,"iBrewSkill","UOACraft");
int iBrewSkill = GetCampaignInt("UOACraft","iBrewSkill",oPC);
int iBrewChance = iBrewSkill;
if (iBrewChance<350)
@@ -1143,15 +1137,9 @@ void main()
if (iBrewSkill <= 1000)
{
//DelayCommand(13.0,SetTokenPair(oPC,13,3,iBrewSkill));
//nwn database
//DelayCommand(12.5,SetCampaignInt("UOACraft","iBrewSkill",iBrewSkill,oPC));
//external database
DelayCommand(12.5,SetPersistentInt(oPC,"iBrewSkill",iBrewSkill,0,"UOACraft"));
DelayCommand(12.5,SetCampaignInt("UOACraft","iBrewSkill",iBrewSkill,oPC));
DelayCommand(12.5,SendMessageToPC(oPC,"=================================="));
DelayCommand(12.5,SendMessageToPC(oPC,"Your skill in brewing has gone up!"));
DelayCommand(12.5,SendMessageToPC(oPC,"Your skill in nrewing has gone up!"));
DelayCommand(12.5,SendMessageToPC(oPC,"Current brewing skill : "+ sOldSkill+"%"));
DelayCommand(12.5,SendMessageToPC(oPC,"=================================="));
if (GetLocalInt(GetModule(),"_UOACraft_XP")!=0) DelayCommand(12.4,GiveXPToCreature(oPC,GetLocalInt(GetModule(),"_UOACraft_XP")));

View File

@@ -1,5 +1,4 @@
#include "nw_i0_plot"
#include "aps_include"
void CreateAnObject(string sResource, object oPC, int iStackSize);
void GetNextStackedItem(object oPC, string sItemTag, int iCount, int iMode, string sStackResRef);
@@ -107,12 +106,7 @@ void main()
return;
}
// nwn database
//int iCarpentrySkill = GetCampaignInt("UOACraft","iCarpentrySkill",oPC);
//external database
int iCarpentrySkill = GetPersistentInt(oPC,"iCarpentrySkill","UOACraft");
int iCarpentrySkill = GetCampaignInt("UOACraft","iCarpentrySkill",oPC);
int iCarpentryChance = iCarpentrySkill;
@@ -185,7 +179,7 @@ void main()
sItemResRefPoor = sItemResRef;
sItemResRefExceptional = sItemResRef;
sComponent1 = "WOOD_NORMAL"; //Normal Wood
iComponent1 = 6;
iComponent1 = 8;
sComponent1Name="normal wood";
}
if (sTag == "pattern118") //Beer barrel
@@ -439,13 +433,7 @@ void main()
}
if (iCarpentrySkill <= 1000)
{
//nwn database
//DelayCommand(13.0,SetCampaignInt("UOACraft","iCarpentrySkill",iCarpentrySkill,oPC));
//external database
DelayCommand(13.0,SetPersistentInt(oPC,"iCarpentrySkill",iCarpentrySkill,0,"UOACraft"));
DelayCommand(13.0,SetCampaignInt("UOACraft","iCarpentrySkill",iCarpentrySkill,oPC));
DelayCommand(13.0,SendMessageToPC(oPC,"==================================="));
DelayCommand(13.0,SendMessageToPC(oPC,"Your skill in carpentry has gone up!"));
DelayCommand(13.0,SendMessageToPC(oPC,"Current carpentry skill : "+ sOldSkill+"%"));

View File

@@ -1,6 +1,4 @@
#include "nw_i0_plot"
#include "aps_include"
void CreateAnObject(string sResource, object oPC, int iStackSize);
void GetNextStackedItem(object oPC, string sItemTag, int iCount, int iMode, string sStackResRef);
void GetNextItemPossessedBy(object oPC, string sItemTag);
@@ -14,13 +12,7 @@ void main()
string sItemTag = GetTag(oItem);
string sTagSelf = GetTag(oSelf);
string sItemResRef;
//nwn database
//int iCookSkill = GetCampaignInt("UOACraft","iCookSkill",oPC);
//external database
int iCookSkill = GetPersistentInt(oPC,"iCookSkill","UOACraft");
int iCookSkill = GetCampaignInt("UOACraft","iCookSkill",oPC);
int iCookChance = iCookSkill;
int iDifficulty;
string sComponent1;
@@ -71,7 +63,7 @@ void main()
// End of compatability portion.
CopyItem(oItem,oPC,TRUE);
DestroyObject(oItem);
FloatingTextStringOnCreature("You can only cook by selecting a recipe!",oPC,FALSE);
FloatingTextStringOnCreature("You can only cook by selecting a recipe.",oPC,FALSE);
return;
}
@@ -291,7 +283,7 @@ void main()
}
case 30:
{
sComponent1 = "MEAT_WOOLYRAZORBACK";
sComponent1 = "MEAT_WOLLYRAZORBACK";
sComponent1Name = "wooly razorback meat";
break;
}
@@ -548,13 +540,7 @@ void main()
if (iCookSkill <= 1000)
{
//DelayCommand(13.0,SetTokenPair(oPC,13,3,iCookSkill));
//nwn database
//DelayCommand(14.5,SetCampaignInt("UOACraft","iCookSkill",iCookSkill,oPC));
//external database
DelayCommand(14.5,SetPersistentInt(oPC,"iCookSkill",iCookSkill,0,"UOACraft"));
DelayCommand(14.5,SetCampaignInt("UOACraft","iCookSkill",iCookSkill,oPC));
DelayCommand(14.5,SendMessageToPC(oPC,"=================================="));
DelayCommand(14.5,SendMessageToPC(oPC,"Your skill in cooking has gone up!"));
DelayCommand(14.5,SendMessageToPC(oPC,"Current cooking skill : "+ sOldSkill+"%"));

View File

@@ -1,5 +1,4 @@
//#include "_persist_01a"
#include "aps_include"
void CreateAnObject(string sResource, object oPC, int iStackSize);
@@ -60,13 +59,7 @@ void main()
}
//int iPaperSkill = GetTokenPair(oPC,13,13);
//nwn database
//int iPaperSkill = GetCampaignInt("UOACraft","iPaperSkill",oPC);
//external database
int iPaperSkill = GetPersistentInt(oPC,"iPaperSkill","UOACraft");
int iPaperSkill = GetCampaignInt("UOACraft","iPaperSkill",oPC);
int iPaperChance = iPaperSkill;
if (iPaperSkill <350)
{
@@ -346,7 +339,7 @@ void main()
float fDelay = 29.0;
for (iProduct; iProduct>0; iProduct=iProduct-10)
{
// SendMessageToPC(oPC,"iProduct = "+IntToString(iProduct));
SendMessageToPC(oPC,"iProduct = "+IntToString(iProduct));
fDelay=fDelay+1.0;
if (iProduct>10)
{
@@ -401,13 +394,7 @@ void main()
if (iPaperSkill <= 1000)
{
//DelayCommand(30.0,SetTokenPair(oPC,13,13,iPaperSkill));
//nwn database
//DelayCommand(30.0,SetCampaignInt("UOACraft","iPaperSkill",iPaperSkill,oPC));
//external database
DelayCommand(30.0,SetPersistentInt(oPC,"iPaperSkill",iPaperSkill,0,"UOACraft"));
DelayCommand(30.0,SetCampaignInt("UOACraft","iPaperSkill",iPaperSkill,oPC));
DelayCommand(30.0,SendMessageToPC(oPC,"======================================"));
DelayCommand(30.0,SendMessageToPC(oPC,"Your skill in papermaking has gone up!"));
DelayCommand(30.0,SendMessageToPC(oPC,"Current papermaking skill : "+ sOldSkill+"%"));

View File

@@ -1,5 +1,4 @@
//#include "_persist_01a"
#include "aps_include"
void CreateAnObject(string sResource, object oPC, int iStackSize);
@@ -132,13 +131,7 @@ void main()
if (iDye>9) sDyeResRef = sDyeResRef+IntToString(iDye);
//int iDyeSkill = GetTokenPair(oPC,13,12); //Cloth Dyeing Skill
//nwn database
//int iDyeSkill = GetCampaignInt("UOACraft","iDyeSkill",oPC);
//external database
int iDyeSkill = GetPersistentInt(oPC,"iDyeSkill","UOACraft");
int iDyeSkill = GetCampaignInt("UOACraft","iDyeSkill",oPC);
int iDyeChance = iDyeSkill;
if (iDyeChance < 350)
{
@@ -236,13 +229,7 @@ void main()
if (iDyeSkill <= 1000)
{
//DelayCommand(13.0,SetTokenPair(oPC,13,12,iDyeSkill));
//nwn database
//DelayCommand(13.0,SetCampaignInt("UOACraft","iDyeSkill",iDyeSkill,oPC));
//external database
DelayCommand(13.0,SetPersistentInt(oPC,"iDyeSkill",iDyeSkill,0,"UOACraft"));
DelayCommand(13.0,SetCampaignInt("UOACraft","iDyeSkill",iDyeSkill,oPC));
DelayCommand(13.0,SendMessageToPC(oPC,"======================================="));
DelayCommand(13.0,SendMessageToPC(oPC,"Your skill in cloth dyeing has gone up!"));
DelayCommand(13.0,SendMessageToPC(oPC,"Current cloth dyeing skill : "+ sOldSkill+"%"));

View File

@@ -1,5 +1,4 @@
//#include "_persist_01a"
#include "aps_include"
void CreatePlaceable(object oPC, string sObject, location lPlace, float fDuration);
void CreateAMonster(string sMonster, object oPC, int iNumberOfMonsters);
@@ -61,8 +60,7 @@ void main()
}
//iFishingSkill = GetTokenPair(oPC,14,13);
//iFishingSkill = GetCampaignInt("UOACraft","iFishingSkill",oPC);
iFishingSkill = GetPersistentInt(oPC,"iFishingSkill","UOACraft");
iFishingSkill = GetCampaignInt("UOACraft","iFishingSkill",oPC);
iFishingChance = iFishingSkill;
if (iFishingChance <350)
{
@@ -90,7 +88,7 @@ void main()
int iSkillGain = 0;
string sFishResRef = "";
string sSuccessMessage = "";
string sFailMessage = "You fish for a while but fail to catch anything.";
string sFailMessage = "You fish for a while but fail to catch anything...";
if (iRandom <= iFishingChance)
{
@@ -268,7 +266,7 @@ void main()
default:
{
AssignCommand(oPC,DelayCommand(11.5,(CreatePlaceable(oPC, "waterloggedcorps",GetLocation(oPC),600.0))));
sSuccessMessage = "You have pulled a heavy water-soaked corpse from the water!";
sSuccessMessage = "You have pulled a water-soaked corpse fromt he water!";
break;
}
}
@@ -428,7 +426,7 @@ void CreateAMonster(string sMonster, object oPC, int iNumberOfMonsters)
for (iNumberOfMonsters; iNumberOfMonsters>0; iNumberOfMonsters--)
{
SendMessageToPC(oPC,"Oops! You have disturbed something in the water!!");
SendMessageToPC(oPC,"Oops! You have disrurbed a Monster!!");
fSelf = GetFacing(oPC)+Random(360);
fDistance = (IntToFloat(Random(100)+1)/10.0);
@@ -473,7 +471,7 @@ void DelaySkill(object oPC, int iFishingSkill, string sOldSkill)
{
if (GetDistanceBetweenLocations(GetLocalLocation(oPC,"lIWasHere"),GetLocation(oPC))>0.8) return;
//SetTokenPair(oPC,14,13,iFishingSkill);
SetPersistentInt(oPC,"iFishingSkill",iFishingSkill,0,"UOACraft");
SetCampaignInt("UOACraft","iFishingSkill",iFishingSkill,oPC);
SendMessageToPC(oPC,"==================================");
SendMessageToPC(oPC,"Your skill in fishing has gone up!");
SendMessageToPC(oPC,"Current fishing skill : "+ sOldSkill+"%");

View File

@@ -1,6 +1,5 @@
//#include "_persist_01a"
#include "nw_i0_plot"
#include "aps_include"
void CreateAnObject(string sResource, object oPC, int iStackSize);
string CraftLookup(string sResRef, int iIngotType);
@@ -80,7 +79,7 @@ void main()
int iItemStack2;
object oItem2;
int iFletchingSkill = GetPersistentInt(oPC,"iFletchingSkill","UOACraft");
int iFletchingSkill = GetCampaignInt("UOACraft","iFletchingSkill",oPC);
int iFletchingChance = iFletchingSkill;
if (iFletchingChance <350)
@@ -339,8 +338,8 @@ void main()
DelayCommand(3.0,PlaySound("as_na_grassmove2"));
DelayCommand(6.0,PlaySound("as_na_bushmove1"));
DelayCommand(9.0,PlaySound("as_na_branchsnp2"));
if (iShaftType==1) AssignCommand(oPC,DelayCommand(9.5,FloatingTextStringOnCreature("You create "+IntToString(iItemStack)+" arrows.",oPC,FALSE)));
if (iShaftType==2) AssignCommand(oPC,DelayCommand(9.5,FloatingTextStringOnCreature("You create "+IntToString(iItemStack)+" bolts.",oPC,FALSE)));
if (iShaftType==1) AssignCommand(oPC,DelayCommand(9.5,FloatingTextStringOnCreature("You careate "+IntToString(iItemStack)+" arrows.",oPC,FALSE)));
if (iShaftType==2) AssignCommand(oPC,DelayCommand(9.5,FloatingTextStringOnCreature("You careate "+IntToString(iItemStack)+" bolts.",oPC,FALSE)));
//create the product on the PC
if (iQuality==1) DelayCommand(10.0,CreateAnObject(sItem1ResRef,oPC,iItemStack));
if (iQuality==2) DelayCommand(10.0,CreateAnObject(sItem2ResRef,oPC,iItemStack));
@@ -493,7 +492,7 @@ void main()
if (iFletchingSkill <= 1000)
{
//DelayCommand(12.0,SetTokenPair(oPC,13,2,iFletchingSkill));
DelayCommand(12.0,SetPersistentInt(oPC,"iFletchingSkill",iFletchingSkill,0,"UOACraft"));
DelayCommand(12.0,SetCampaignInt("UOACraft","iFletchingSkill",iFletchingSkill,oPC));
DelayCommand(12.0,SendMessageToPC(oPC,"===================================="));
DelayCommand(12.0,SendMessageToPC(oPC,"Your skill in fletching has gone up!"));
DelayCommand(12.0,SendMessageToPC(oPC,"Current fletching skill : "+ sOldSkill+"%"));

View File

@@ -1,5 +1,4 @@
//#include "_persist_01a"
#include "aps_include"
void CreateAnObject(string sResource, object oPC, int iStackSize);
object CreatePlaceable(string sObject, location lPlace, float fDuration);
string GetIngotType(object oItem, object oPC);
@@ -153,7 +152,7 @@ void main()
}
//int iSmeltChance = GetTokenPair(oPC,14,2);
int iSmeltSkill = GetPersistentInt(oPC,"iSmeltSkill","UOACraft");
int iSmeltSkill = GetCampaignInt("UOACraft","iSmeltSkill",oPC);
int iSmeltChance = iSmeltSkill;
//int iSmeltSkill = iSmeltChance;
string sOre;
@@ -510,7 +509,7 @@ void main()
if (iSmeltSkill <= 1000)
{
//DelayCommand(6.0,SetTokenPair(oPC,14,2,iSmeltSkill));
DelayCommand(6.0,SetPersistentInt(oPC,"iSmeltSkill",iSmeltSkill,0,"UOACraft"));
DelayCommand(6.0,SetCampaignInt("UOACraft","iSmeltSkill",iSmeltSkill,oPC));
DelayCommand(6.0,SendMessageToPC(oPC,"==================================="));
DelayCommand(6.0,SendMessageToPC(oPC,"Your skill in smelting has gone up!"));
DelayCommand(6.0,SendMessageToPC(oPC,"Current smelting skill : "+ sOldSkill+"%"));
@@ -552,7 +551,6 @@ string GetIngotType(object oItem, object oPC)
int iSmeltPenalty;
int iSmeltMinimum;
string sItemTag = GetTag(oItem);
string sResRef = GetResRef(oItem);
string sItemTagCut = GetStringRight(sItemTag,GetStringLength(sItemTag)-5);
//SendMessageToPC(oPC,sItemTagCut);
sIngotResRef = "INVALID";
@@ -660,7 +658,7 @@ string GetIngotType(object oItem, object oPC)
if (iBaseItem==BASE_ITEM_DAGGER) iMaxIngot=2;
if (iBaseItem==BASE_ITEM_DIREMACE) iMaxIngot=15;
if (iBaseItem==BASE_ITEM_DOUBLEAXE) iMaxIngot=15;
if (iBaseItem==BASE_ITEM_GREATAXE) iMaxIngot=9;
//if (iBaseItem==BASE_ITEM_GREATAXE) iMaxIngot=1;
if (iBaseItem==BASE_ITEM_GREATSWORD) iMaxIngot=10;
if (iBaseItem==BASE_ITEM_HALBERD) iMaxIngot=20;
if (iBaseItem==BASE_ITEM_HANDAXE) iMaxIngot=3;
@@ -764,18 +762,9 @@ string GetIngotType(object oItem, object oPC)
}
if (GetStringRight(sItemTag,11)=="_ADAMANTITE")
{
if ( (sResRef == "wblhl037") || (sResRef == "wblhl038") || (sResRef == "wblhl039") ) //platinum hammer
{
iSmeltPenalty=450;
iSmeltMinimum=990;
sIngotResRef= "ingot013";
}
else
{
iSmeltPenalty=450;
iSmeltMinimum=990;
sIngotResRef= "ingot012";
}
}
//Normal quality iron items have nwn default tags

View File

@@ -150,7 +150,7 @@ void main()
}
}
sSuccess = "The mineral bath reveals the gemstone to be "+sSuccess+".";
sSuccess = "The mineral bath revelas the gemstone to be "+sSuccess+".";
// This snippet of code is cut-n-paste direct from ATS
// Reason for this is because I had no clue how to assign an increase

View File

@@ -1,5 +1,4 @@
//#include "_persist_01a"
#include "aps_include"
void CreateAnObject(string sResource, object oPC, int iStackSize);
@@ -57,7 +56,7 @@ void main()
}
//int iGemSkill = GetTokenPair(oPC,13,7);
int iGemSkill = GetPersistentInt(oPC,"iGemSkill","UOACraft");
int iGemSkill = GetCampaignInt("UOACraft","iGemSkill",oPC);
int iGemChance = iGemSkill;
if (iGemSkill <350)
{
@@ -210,12 +209,12 @@ void main()
if (sItemResRef =="")
{
oItem = GetItemPossessedBy(OBJECT_SELF,sItemTag);
sItemResRef = GetStringLeft(GetStringRight(sItemTag,GetStringLength(sItemTag)-13), 13) +"002";
sItemResRef = GetStringRight(sItemTag,GetStringLength(sItemTag)-13)+"002";
}
int iStackGems = GetNumStackedItems(oItem)-1;
if (iStackGems>0) DelayCommand(1.0,CreateAnObject(sItemResRef,oPC,iStackGems));
//SendMessageToPC(oPC,sItemResRef);
SendMessageToPC(oPC,sItemResRef);
int iSuccess = 0;
if (Random(1000)<=iGemChance) iSuccess++;
if (Random(1000)<=iGemChance) iSuccess++;
@@ -234,7 +233,7 @@ void main()
}
case 1:
{
DelayCommand(16.0,FloatingTextStringOnCreature("You barely manage to cut the gem, producing a poor quality cut gem.",oPC,FALSE));
DelayCommand(16.0,FloatingTextStringOnCreature("You barely manage to cut the gem, produing a poor quality cut gem.",oPC,FALSE));
sGemResRef = sGemResRef+"4";
break;
}
@@ -242,17 +241,11 @@ void main()
{
DelayCommand(16.0,FloatingTextStringOnCreature("With an expert hand you produce the highest quality cut gem.",oPC,FALSE));
sGemResRef = GetStringLeft(sItemResRef,GetStringLength(sItemResRef)-3);
if (GetStringLeft (sGemResRef, 11) == "starrosequa") sGemResRef = "starrosequartz";
if (GetStringLeft (sGemResRef, 11) == "orientalame") sGemResRef = "orientalamethyst";
if (GetStringLeft (sGemResRef, 11) == "orientaleme") sGemResRef = "orientalemerald";
break;
}
default:
{
DelayCommand(16.0,FloatingTextStringOnCreature("You successfully cut the gem, producing an average quality cut gem.",oPC,FALSE));
DelayCommand(16.0,FloatingTextStringOnCreature("You successfully cut the gem, produing an average quality cut gem.",oPC,FALSE));
sGemResRef = sGemResRef+"3";
break;
}
@@ -307,7 +300,7 @@ void main()
if (iGemSkill <= 1000)
{
//DelayCommand(17.0,SetTokenPair(oPC,13,7,iGemSkill));
DelayCommand(17.0,SetPersistentInt(oPC,"iGemSkill",iGemSkill,0,"UOACraft"));
DelayCommand(17.0,SetCampaignInt("UOACraft","iGemSkill",iGemSkill,oPC));
DelayCommand(17.0,SendMessageToPC(oPC,"======================================"));
DelayCommand(17.0,SendMessageToPC(oPC,"Your skill in gem cutting has gone up!"));
DelayCommand(17.0,SendMessageToPC(oPC,"Current gem cutting skill : "+ sOldSkill+"%"));

View File

@@ -1,5 +1,4 @@
//#include "_persist_01a"
#include "aps_include"
void CreateAnObject(string sResource, object oPC, int iStackSize);
@@ -204,7 +203,7 @@ void main()
int iItem = GetNumStackedItems(oItem);
//int iPolishSkill = GetTokenPair(oPC,13,6);
int iPolishSkill = GetPersistentInt(oPC,"iPolishSkill","UOACraft");
int iPolishSkill = GetCampaignInt("UOACraft","iPolishSkill",oPC);
int iPolishChance = iPolishSkill;
if (iPolishChance <350)
{
@@ -293,7 +292,7 @@ void main()
if (iPolishSkill <= 1000)
{
//DelayCommand(31.0,SetTokenPair(oPC,13,6,iPolishSkill));
DelayCommand(31.0,SetPersistentInt(oPC,"iPolishSkill",iPolishSkill,0,"UOACraft"));
DelayCommand(31.0,SetCampaignInt("UOACraft","iPolishSkill",iPolishSkill,oPC));
DelayCommand(31.0,SendMessageToPC(oPC,"======================================="));
DelayCommand(31.0,SendMessageToPC(oPC,"Your skill in gem polishing has gone up!"));
DelayCommand(31.0,SendMessageToPC(oPC,"Current gem polishing skill : "+ sOldSkill+"%"));

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,3 @@
#include "aps_include"
void CreateAnObject(string sResource, object oPC);
void main()
@@ -312,7 +310,7 @@ void main()
oGlass = GetItemPossessedBy(oPC,"ITEM_GLASSVIAL");
if (oGlass==OBJECT_INVALID)
{
FloatingTextStringOnCreature("You must have an empty glass vial to extract oils.",oPC,FALSE);
FloatingTextStringOnCreature("You must have an empty glass bottle to extract oils.",oPC,FALSE);
CopyItem(oItem,oPC,TRUE);
DestroyObject(oItem,0.1);
return;
@@ -320,7 +318,7 @@ void main()
}
//DestroyObject(oGlass,0.1);
int iCookSkill = GetPersistentInt(oPC,"iCookSkill","UOACraft");
int iCookSkill = GetCampaignInt("UOACraft","iCookSkill",oPC);
int iCookChance = iCookSkill;
if (iCookChance<350)
@@ -401,7 +399,7 @@ void main()
if (iCookSkill <= 1000)
{
//DelayCommand(13.0,SetTokenPair(oPC,13,3,iCookSkill));
DelayCommand(6.5,SetPersistentInt(oPC,"iCookSkill",iCookSkill,0,"UOACraft"));
DelayCommand(6.5,SetCampaignInt("UOACraft","iCookSkill",iCookSkill,oPC));
DelayCommand(6.5,SendMessageToPC(oPC,"=================================="));
DelayCommand(6.5,SendMessageToPC(oPC,"Your skill in cooking has gone up!"));
DelayCommand(6.5,SendMessageToPC(oPC,"Current cooking skill : "+ sOldSkill+"%"));

View File

@@ -1,6 +1,5 @@
//#include "_persist_01a"
#include "nw_i0_plot"
#include "aps_include"
void CreateAnObject(string sResource, object oPC);
object CreatePlaceable(string sObject, location lPlace, float fDuration);
@@ -38,7 +37,7 @@ void main()
if (GetLocalInt(OBJECT_SELF,"iAmInUse")!=0)
{
FloatingTextStringOnCreature("You must wait until the kiln is at the right temprature before starting any other item.",oPC,FALSE);
FloatingTextStringOnCreature("You must wait until the kiln is cooled off before starting any other craft.",oPC,FALSE);
if (iAdded != 99)CopyItem(oItem,oPC,TRUE);
DestroyObject(oItem);
return;
@@ -194,7 +193,7 @@ void main()
//int iGlassSkill = GetTokenPair(oPC,14,4);
int iGlassSkill = GetPersistentInt(oPC,"iGlassSkill","UOACraft");
int iGlassSkill = GetCampaignInt("UOACraft","iGlassSkill",oPC);
int iGlassChance = iGlassSkill;
object oFire = CreatePlaceable("plc_flamemedium", lFire, 6.0);
@@ -227,7 +226,7 @@ void main()
if (iGlassChance < 250) iGlassChance = 0;
sCraft = "glassingot";
sSuccessString = "You melt the sand into a Glass Ingot";
sFailString = "The glass turns murky, and the ingot shatters as it cools.";
sFailString = "The glass turns murky and the ingot shatters as it cools.";
sSoundFail = "as_cv_glasbreak2";
sSoundSuccess = "as_cv_barglass2";
eFail = EffectVisualEffect(VFX_COM_BLOOD_SPARK_LARGE,FALSE);
@@ -243,7 +242,7 @@ void main()
iGlassChance = iGlassChance - 50;
sCraft = "smallcastmold";
sSuccessString = "You successfully glaze the small cast mold.";
sFailString = "The clay turns brittle, and the mold shatters as it cools.";
sFailString = "The clay turns brittle and the mold shatters as it cools.";
sSoundFail = "as_cv_claybreak3";
sSoundSuccess = "as_cv_claybreak1";
eFail = EffectVisualEffect(VFX_COM_BLOOD_SPARK_LARGE,FALSE);
@@ -257,7 +256,7 @@ void main()
iGlassChance = iGlassChance - 50;
sCraft = "smallcastmold003";
sSuccessString = "You successfully glaze the ring mold.";
sFailString = "The clay turns brittle, and the mold shatters as it cools.";
sFailString = "The clay turns brittle and the mold shatters as it cools.";
sSoundFail = "as_cv_claybreak3";
sSoundSuccess = "as_cv_claybreak1";
eFail = EffectVisualEffect(VFX_COM_BLOOD_SPARK_LARGE,FALSE);
@@ -270,7 +269,7 @@ void main()
iGlassChance = iGlassChance - 250;
sCraft = "smallcastmold004";
sSuccessString = "You successfully glaze the necklace mold.";
sFailString = "The clay turns brittle, and the mold shatters as it cools.";
sFailString = "The clay turns brittle and the mold shatters as it cools.";
sSoundFail = "as_cv_claybreak3";
sSoundSuccess = "as_cv_claybreak1";
eFail = EffectVisualEffect(VFX_COM_BLOOD_SPARK_LARGE,FALSE);
@@ -283,7 +282,7 @@ void main()
iGlassChance = iGlassChance - 350;
sCraft = "smallcastmold005";
sSuccessString = "You successfully glaze the amulet mold.";
sFailString = "The clay turns brittle, and the mold shatters as it cools.";
sFailString = "The clay turns brittle and the mold shatters as it cools.";
sSoundFail = "as_cv_claybreak3";
sSoundSuccess = "as_cv_claybreak1";
eFail = EffectVisualEffect(VFX_COM_BLOOD_SPARK_LARGE,FALSE);
@@ -296,7 +295,7 @@ void main()
iGlassChance = iGlassChance - 150;
sCraft = "smallcastmold001";
sSuccessString = "You successfully glaze the medium cast mold.";
sFailString = "The clay turns brittle, and the mold shatters as it cools.";
sFailString = "The clay turns brittle and the mold shatters as it cools.";
sSoundFail = "as_cv_claybreak3";
sSoundSuccess = "as_cv_claybreak1";
eFail = EffectVisualEffect(VFX_COM_BLOOD_SPARK_LARGE,FALSE);
@@ -309,7 +308,7 @@ void main()
iGlassChance = iGlassChance - 250;
sCraft = "smallcastmold002";
sSuccessString = "You successfully glaze the large cast mold.";
sFailString = "The clay turns brittle, and the mold shatters as it cools.";
sFailString = "The clay turns brittle and the mold shatters as it cools.";
sSoundFail = "as_cv_claybreak3";
sSoundSuccess = "as_cv_claybreak1";
eFail = EffectVisualEffect(VFX_COM_BLOOD_SPARK_LARGE,FALSE);
@@ -323,7 +322,7 @@ void main()
iGlassChance = iGlassChance - 75;
sCraft = "glassvial";
sSuccessString = "You successfully blow and shape the glass vial.";
sFailString = "The vial turns murky, and shatters as it cools.";
sFailString = "The vial turns murky and shatters as it cools.";
sSoundFail = "as_cv_glasbreak2";
sSoundSuccess = "as_cv_barglass2";
eFail = EffectVisualEffect(VFX_COM_BLOOD_SPARK_LARGE,FALSE);
@@ -337,7 +336,7 @@ void main()
iGlassChance = iGlassChance - 250;
sCraft = "glassbottle";
sSuccessString = "You successfully blow and shape the glass bottle.";
sFailString = "The bottle turns murky, and shatters as it cools.";
sFailString = "The bottle turns murky and shatters as it cools.";
sSoundFail = "as_cv_glasbreak2";
sSoundSuccess = "as_cv_barglass2";
eFail = EffectVisualEffect(VFX_COM_BLOOD_SPARK_LARGE,FALSE);
@@ -352,7 +351,7 @@ void main()
iCreated=2;
sCraft = "yeastvial001";
sSuccessString = "You successfully blow and shape the yeast vials.";
sFailString = "The vials turn murky, and shatter as they cool.";
sFailString = "The vials turn murky and shatter as they cool.";
sSoundFail = "as_cv_glasbreak2";
sSoundSuccess = "as_cv_barglass2";
eFail = EffectVisualEffect(VFX_COM_BLOOD_SPARK_LARGE,FALSE);
@@ -366,7 +365,7 @@ void main()
iGlassChance = iGlassChance - 400;
sCraft = "item_cask_006";
sSuccessString = "You successfully blow and shape the cider jug.";
sFailString = "The jug turns murky, and shatters as it cools.";
sFailString = "The jug turns murky and shatters as it cools.";
sSoundFail = "as_cv_glasbreak2";
sSoundSuccess = "as_cv_barglass2";
eFail = EffectVisualEffect(VFX_COM_BLOOD_SPARK_LARGE,FALSE);
@@ -457,7 +456,7 @@ void main()
if (iGlassSkill <= 1000)
{
//DelayCommand(5.0,SetTokenPair(oPC,14,4,iGlassSkill));
DelayCommand(6.0,SetPersistentInt(oPC,"iGlassSkill",iGlassSkill,0,"UOACraft"));
DelayCommand(6.0,SetCampaignInt("UOACraft","iGlassSkill",iGlassSkill,oPC));
DelayCommand(6.0,SendMessageToPC(oPC,"============================"));
DelayCommand(6.0,SendMessageToPC(oPC,"Your Kiln skill has gone up!"));
DelayCommand(6.0,SendMessageToPC(oPC,"Current Kiln skill : "+ sOldSkill+"%"));

View File

@@ -1,5 +1,3 @@
#include "aps_include"
void CreateAnObject(string sResource, object oPC, int iProduct);
void main()
@@ -116,7 +114,7 @@ void main()
}
DestroyObject(oSugar,0.2);
int iBrewSkill = GetPersistentInt(oPC,"iBrewSkill","UOACraft");
int iBrewSkill = GetCampaignInt("UOACraft","iBrewSkill",oPC);
int iBrewChance = iBrewSkill;
if (iBrewChance<350)
@@ -209,7 +207,7 @@ void main()
if (iBrewSkill <= 1000)
{
//DelayCommand(13.0,SetTokenPair(oPC,13,3,iBrewSkill));
DelayCommand(12.5,SetPersistentInt(oPC,"iBrewSkill",iBrewSkill,0,"UOACraft"));
DelayCommand(12.5,SetCampaignInt("UOACraft","iBrewSkill",iBrewSkill,oPC));
DelayCommand(12.5,SendMessageToPC(oPC,"=================================="));
DelayCommand(12.5,SendMessageToPC(oPC,"Your skill in brewing has gone up!"));
DelayCommand(12.5,SendMessageToPC(oPC,"Current brewing skill : "+ sOldSkill+"%"));

View File

@@ -1,6 +1,5 @@
//#include "_persist_01a"
#include "nw_i0_plot"
#include "aps_include"
void GetNextItemPossessedBy(object oPC, string sItemTag);
object CreatePlaceable(string sObject, location lPlace, float fDuration);
@@ -42,7 +41,7 @@ void main()
if (GetLocalInt(OBJECT_SELF,"iAmInUse") != 0)
{
CopyItem(oItem,oPC,TRUE);
SendMessageToPC(oPC,"You must wait till the hide currently being worked is done before starting another.");
SendMessageToPC(oPC,"You must wait till the hide in the tanning bath is done before starting another.");
DestroyObject(oItem);
return;
}
@@ -62,7 +61,7 @@ void main()
int iTanMode = GetLocalInt(oPC,"iTanningMode");
//int iTanChance = GetTokenPair(oPC,14,11);
//int iTanSkill = iTanChance;
int iTanSkill = GetPersistentInt(oPC,"iLeatherSkill","UOACraft");
int iTanSkill = GetCampaignInt("UOACraft","iLeatherSkill",oPC);
int iTanChance = iTanSkill;
int iTanOil = 1;
int iBeeswax = 1;
@@ -414,7 +413,7 @@ void main()
if (iTanSkill <= 1000)
{
//DelayCommand(6.0,SetTokenPair(oPC,14,11,iTanSkill));
DelayCommand(6.0,SetPersistentInt(oPC,"iLeatherSkill",iTanSkill,0,"UOACraft"));
DelayCommand(6.0,SetCampaignInt("UOACraft","iLeatherSkill",iTanSkill,oPC));
DelayCommand(6.0,SendMessageToPC(oPC,"========================================="));
DelayCommand(6.0,SendMessageToPC(oPC,"Your skill in leatherworking has gone up!"));
DelayCommand(6.0,SendMessageToPC(oPC,"Current leatherworking skill : "+ sOldSkill+"%"));

View File

@@ -1,6 +1,5 @@
//#include "_persist_01a"
#include "nw_i0_plot"
#include "aps_include"
void CreateAnObject(string sResource, object oPC, int iStackSize);
void GetNextItemPossessedBy(object oPC, string sItemTag);
@@ -41,7 +40,7 @@ void main()
CopyObject(oItem,GetLocation(oSelf),oSelf,GetTag(oItem));
//int iClothSkill = GetTokenPair(oPC,13,4); // Clothmaking
int iClothSkill = GetPersistentInt(oPC,"iClothSkill","UOACraft");
int iClothSkill = GetCampaignInt("UOACraft","iClothSkill",oPC);
int iClothChance = iClothSkill;
if (iClothChance < 350)
{
@@ -195,7 +194,7 @@ void main()
if (iClothSkill <= 1000)
{
//DelayCommand(13.0,SetTokenPair(oPC,13,4,iClothSkill));
DelayCommand(13.0,SetPersistentInt(oPC,"iClothSkill",iClothSkill,0,"UOACraft"));
DelayCommand(13.0,SetCampaignInt("UOACraft","iClothSkill",iClothSkill,oPC));
DelayCommand(13.0,SendMessageToPC(oPC,"========================================="));
DelayCommand(13.0,SendMessageToPC(oPC,"Your skill in clothmaking has gone up!"));
DelayCommand(13.0,SendMessageToPC(oPC,"Current clothmaking skill : "+ sOldSkill+"%"));

View File

@@ -1,4 +1,3 @@
#include "aps_include"
void CreateAnObject(string sResource, object oPC, int iProduct);
void main()
@@ -102,7 +101,7 @@ void main()
}
int iBrewSkill = GetPersistentInt(oPC,"iBrewSkill","UOACraft");
int iBrewSkill = GetCampaignInt("UOACraft","iBrewSkill",oPC);
int iBrewChance = iBrewSkill;
if (iBrewChance<350)
@@ -198,9 +197,9 @@ void main()
if (iBrewSkill <= 1000)
{
//DelayCommand(13.0,SetTokenPair(oPC,13,3,iBrewSkill));
DelayCommand(12.5,SetPersistentInt(oPC,"iBrewSkill",iBrewSkill,0,"UOACraft"));
DelayCommand(12.5,SetCampaignInt("UOACraft","iBrewSkill",iBrewSkill,oPC));
DelayCommand(12.5,SendMessageToPC(oPC,"=================================="));
DelayCommand(12.5,SendMessageToPC(oPC,"Your skill in brewing has gone up!"));
DelayCommand(12.5,SendMessageToPC(oPC,"Your skill in nrewing has gone up!"));
DelayCommand(12.5,SendMessageToPC(oPC,"Current brewing skill : "+ sOldSkill+"%"));
DelayCommand(12.5,SendMessageToPC(oPC,"=================================="));
if (GetLocalInt(GetModule(),"_UOACraft_XP")!=0) DelayCommand(12.4,GiveXPToCreature(oPC,GetLocalInt(GetModule(),"_UOACraft_XP")));

View File

@@ -1,4 +1,3 @@
#include "aps_include"
void CreateAnObject(string sResource, object oPC);
void main()
@@ -131,7 +130,7 @@ void main()
return;
}
int iCookSkill = GetPersistentInt(oPC,"iCookSkill","UOACraft");
int iCookSkill = GetCampaignInt("UOACraft","iCookSkill",oPC);
int iCookChance = iCookSkill;
DestroyObject(oItem,0.1);
@@ -214,7 +213,7 @@ void main()
if (iCookSkill <= 1000)
{
//DelayCommand(13.0,SetTokenPair(oPC,13,3,iCookSkill));
DelayCommand(14.5,SetPersistentInt(oPC,"iCookSkill",iCookSkill,0,"UOACraft"));
DelayCommand(14.5,SetCampaignInt("UOACraft","iCookSkill",iCookSkill,oPC));
DelayCommand(14.5,SendMessageToPC(oPC,"=================================="));
DelayCommand(14.5,SendMessageToPC(oPC,"Your skill in cooking has gone up!"));
DelayCommand(14.5,SendMessageToPC(oPC,"Current cooking skill : "+ sOldSkill+"%"));

View File

@@ -1,5 +1,4 @@
//#include "_persist_01a"
#include "aps_include"
void CreateAnObject(string sResource, object oPC, int iStackSize);
@@ -34,7 +33,7 @@ void main()
if (GetStringLeft(sItemTag,5)!="pulp_")
{
CopyItem(oItem,oPC,TRUE);
FloatingTextStringOnCreature("This is not bleached pulp.",oPC,FALSE);
FloatingTextStringOnCreature("This is not bleached pulp...",oPC,FALSE);
DestroyObject(oItem);
return;
}
@@ -42,7 +41,7 @@ void main()
if (GetStringRight(sItemTag,3)!="001") //pulp_wood_raw001, pulp_rice_raw001, pulp_silk_raw001
{
CopyItem(oItem,oPC,TRUE);
FloatingTextStringOnCreature("You must first bleach this pulp before pressing and making it into paper.",oPC,FALSE);
FloatingTextStringOnCreature("You must first bleach this pulp before pressing and baking it into paper.",oPC,FALSE);
DestroyObject(oItem);
return;
}
@@ -50,7 +49,7 @@ void main()
if (GetLocalInt(OBJECT_SELF,"iAmInUse")!=0)
{
CopyItem(oItem,oPC,TRUE);
FloatingTextStringOnCreature("The paper mill is not yet done with it's current task.",oPC,FALSE);
FloatingTextStringOnCreature("The paper mill is not yet done with it's current task....",oPC,FALSE);
DestroyObject(oItem);
return;
}
@@ -83,7 +82,7 @@ void main()
}
//int iPaperSkill = GetTokenPair(oPC,13,13);
int iPaperSkill = GetPersistentInt(oPC,"iPaperSkill","UOACraft");
int iPaperSkill = GetCampaignInt("UOACraft","iPaperSkill",oPC);
int iPaperChance = iPaperSkill;
if (iPaperSkill <350)
{
@@ -226,7 +225,7 @@ void main()
if (iPaperSkill <= 1000)
{
//DelayCommand(30.0,SetTokenPair(oPC,13,13,iPaperSkill));
DelayCommand(30.0,SetPersistentInt(oPC,"iPaperSkill",iPaperSkill,0,"UOACraft"));
DelayCommand(30.0,SetCampaignInt("UOACraft","iPaperSkill",iPaperSkill,oPC));
DelayCommand(30.0,SendMessageToPC(oPC,"======================================"));
DelayCommand(30.0,SendMessageToPC(oPC,"Your skill in papermaking has gone up!"));
DelayCommand(30.0,SendMessageToPC(oPC,"Current papermaking skill : "+ sOldSkill+"%"));
@@ -242,7 +241,7 @@ void main()
if (iStackSize>1) iStackSize = Random(iStackSize)-1;
if (iStackSize>0)
{
DelayCommand(31.0,FloatingTextStringOnCreature("You manage to recover some of the pulp.",oPC,FALSE));
DelayCommand(31.0,FloatingTextStringOnCreature("You manage to recover some of the pulp..",oPC,FALSE));
DelayCommand(31.0,CreateAnObject(sItemTag,oPC,iStackSize));
DestroyObject(oItem);
return;

View File

@@ -1,6 +1,5 @@
//#include "_persist_01a"
#include "nw_i0_plot"
#include "aps_include"
void CreateAnObject(string sResource, object oPC, int iStackSize);
void GetNextStackedItem(object oPC, string sItemTag, int iCount, int iMode, string sStackResRef);
@@ -34,7 +33,7 @@ void main()
{
if (iUseMode!=99) CopyItem(oItem,oPC,TRUE);
if (iUseMode==99) CopyObject(oItem,GetLocation(oSelf),oSelf,GetTag(oItem));
FloatingTextStringOnCreature("The pulp basin is not yet ready for more materials.",oPC,FALSE);
FloatingTextStringOnCreature("The pulp basin is not yet ready for more materials...",oPC,FALSE);
DestroyObject(oItem);
return;
}
@@ -50,7 +49,7 @@ void main()
if (sItemTag=="P_PULP_BLEACHED_SILK")
{
SetLocalInt(oPC,"iPulpType",1);
FloatingTextStringOnCreature("Setting up to bleach wood pulp with silk additive.",oPC,FALSE);
FloatingTextStringOnCreature("Setting up to bleach wood pulp with silk addative.",oPC,FALSE);
}
string sTagSelf = GetTag(oSelf);
AssignCommand(oPC,DoPlaceableObjectAction(oSelf,PLACEABLE_ACTION_USE));
@@ -97,7 +96,7 @@ void main()
//int iPaperSkill = GetTokenPair(oPC,13,7);
int iPaperSkill = GetPersistentInt(oPC,"iPaperSkill","UOACraft");
int iPaperSkill = GetCampaignInt("UOACraft","iPaperSkill",oPC);
int iPaperChance = iPaperSkill;
if (iPaperSkill <350)
{
@@ -155,7 +154,7 @@ void main()
if (iPulpType==1)
{
sResRef = "pulp_silk_raw001";
sSuccess = "You carefully stir in the silk strands, and process the silk and wood pulp with the pulp bleach.";
sSuccess = "You carefully stir in the silk strands and process the silk and wood pulp with the pulp bleach.";
}
}
if (sItemTag=="pulp_rice_raw")

View File

@@ -1,5 +1,4 @@
#include "nw_i0_plot"
#include "aps_include"
string GetInk(object oItem);
string GetComponent(object oItem);
@@ -58,7 +57,7 @@ void main()
int iDifficulty;
int iRandom;
int iSkillGain;
int iScribeSkill = GetPersistentInt(oPC,"iScribeSkill","UOACraft");
int iScribeSkill = GetCampaignInt("UOACraft","iScribeSkill",oPC);
int iScribeChance = iScribeSkill;
if (iScribeChance < 350)
{
@@ -184,7 +183,7 @@ void main()
if (iDifficulty>iScribeChance)
{
DelayCommand(1.0,FloatingTextStringOnCreature("You have no idea how to prepare this ink.",oPC,FALSE));
DelayCommand(1.0,FloatingTextStringOnCreature("You have no idea how to prepare this ink...",oPC,FALSE));
CopyObject(oItem,GetLocation(oSelf),oSelf,GetTag(oItem));
DestroyObject(oItem);
return;
@@ -212,7 +211,7 @@ void main()
//Check for components
if (CheckComponent(oPC,sComponent1,sComponent2,sComponent3,1,1,1,1,1,2)==0)
{
DelayCommand(12.0,FloatingTextStringOnCreature("You do not have all of the components required to mix this ink.",oPC,FALSE));
DelayCommand(12.0,FloatingTextStringOnCreature("You do not have all of the components required to mix this ink...",oPC,FALSE));
//CopyObject(oItem,GetLocation(oSelf),oSelf,sOldTag);
CreateItemOnObject(GetResRef(oItem),OBJECT_SELF,1);
DestroyObject(oItem);
@@ -270,7 +269,7 @@ void main()
if (iScribeSkill <= 1000)
{
//DelayCommand(13.0,SetTokenPair(oPC,13,12,iDyeSkill));
DelayCommand(13.0,SetPersistentInt(oPC,"iScribeSkill",iScribeSkill,0,"UOACraft"));
DelayCommand(13.0,SetCampaignInt("UOACraft","iScribeSkill",iScribeSkill,oPC));
DelayCommand(13.0,SendMessageToPC(oPC,"======================================"));
DelayCommand(13.0,SendMessageToPC(oPC,"Your skill in inscription has gone up!"));
DelayCommand(13.0,SendMessageToPC(oPC,"Current inscription skill : "+ sOldSkill+"%"));
@@ -361,7 +360,7 @@ void main()
if (CheckComponent(oPC,sComponent1,sComponent2,sComponent3,1,1,1,1,1,2)==0)
{
DelayCommand(15.0,FloatingTextStringOnCreature("The magic fails to imbue the scroll. You may be missing a vital component.",oPC,FALSE));
DelayCommand(15.0,FloatingTextStringOnCreature("The magic fails to imbue the scroll. You may be missing a vital component...",oPC,FALSE));
//CopyObject(oItem,GetLocation(oSelf),oSelf,sOldTag);
CreateItemOnObject(GetResRef(oItem),OBJECT_SELF,1);
DestroyObject(oItem);

View File

@@ -1,5 +1,4 @@
//#include "_persist_01a"
#include "aps_include"
void CreateAnObject(string sResource, object oPC, int iStackSize);
void SpinNextItemPossessedBy(object oSelf, object oPC, string sItemTag);
@@ -92,7 +91,7 @@ void main()
//int iSpindleSkill = GetTokenPair(oPC,13,10);
int iSpindleSkill = GetPersistentInt(oPC,"iSpindleSkill","UOACraft");
int iSpindleSkill = GetCampaignInt("UOACraft","iSpindleSkill",oPC);
int iSpindleChance = iSpindleSkill;
int iSuccess = 0;
int iSuccess2 = 0;
@@ -215,7 +214,7 @@ void main()
if (iSpindleSkill <= 1000)
{
//DelayCommand(10.0,SetTokenPair(oPC,13,10,iSpindleSkill));
DelayCommand(10.0,SetPersistentInt(oPC,"iSpindleSkill",iSpindleSkill,0,"UOACraft"));
DelayCommand(10.0,SetCampaignInt("UOACraft","iSpindleSkill",iSpindleSkill,oPC));
DelayCommand(10.0,SendMessageToPC(oPC,"==================================="));
DelayCommand(10.0,SendMessageToPC(oPC,"Your skill in spindling has gone up!"));
DelayCommand(10.0,SendMessageToPC(oPC,"Current spindling skill : "+ sOldSkill+"%"));
@@ -270,7 +269,7 @@ void SpinNextItemPossessedBy(object oSelf, object oPC, string sItemTag)
//int iSpindleSkill = GetTokenPair(oPC,13,10);
int iSpindleSkill = GetPersistentInt(oPC,"iSpindleSkill","UOACraft");
int iSpindleSkill = GetCampaignInt("UOACraft","iSpindleSkill",oPC);
int iSpindleChance = iSpindleSkill;
int iSuccess = 0;
int iSuccess2 = 0;
@@ -393,7 +392,7 @@ void SpinNextItemPossessedBy(object oSelf, object oPC, string sItemTag)
if (iSpindleSkill <= 1000)
{
//DelayCommand(10.0,SetTokenPair(oPC,13,10,iSpindleSkill));
DelayCommand(10.0,SetPersistentInt(oPC,"iSpindleSkill",iSpindleSkill,0,"UOACraft"));
DelayCommand(10.0,SetCampaignInt("UOACraft","iSpindleSkill",iSpindleSkill,oPC));
DelayCommand(10.0,SendMessageToPC(oPC,"==================================="));
DelayCommand(10.0,SendMessageToPC(oPC,"Your skill in spindling has gone up!"));
DelayCommand(10.0,SendMessageToPC(oPC,"Current spindling skill : "+ sOldSkill+"%"));

View File

@@ -1,5 +1,3 @@
#include "aps_include"
void CreateAnObject(string sResource, object oPC, int iProduct);
void main()
@@ -158,12 +156,13 @@ void main()
if (sProduct1=="INVALID")
{
SendMessageToPC(oPC,"You may not distill this item!");
CopyItem(oItem,oPC,TRUE);
DestroyObject(oItem,0.1);
return;
}
int iBrewSkill = GetPersistentInt(oPC,"iBrewSkill","UOACraft");
int iBrewSkill = GetCampaignInt("UOACraft","iBrewSkill",oPC);
int iBrewChance = iBrewSkill;
if (iBrewChance<350)
@@ -252,9 +251,9 @@ void main()
if (iBrewSkill <= 1000)
{
//DelayCommand(13.0,SetTokenPair(oPC,13,3,iBrewSkill));
DelayCommand(12.5,SetPersistentInt(oPC,"iBrewSkill",iBrewSkill,0,"UOACraft"));
DelayCommand(12.5,SetCampaignInt("UOACraft","iBrewSkill",iBrewSkill,oPC));
DelayCommand(12.5,SendMessageToPC(oPC,"=================================="));
DelayCommand(12.5,SendMessageToPC(oPC,"Your skill in brewing has gone up!"));
DelayCommand(12.5,SendMessageToPC(oPC,"Your skill in nrewing has gone up!"));
DelayCommand(12.5,SendMessageToPC(oPC,"Current brewing skill : "+ sOldSkill+"%"));
DelayCommand(12.5,SendMessageToPC(oPC,"=================================="));
if (GetLocalInt(GetModule(),"_UOACraft_XP")!=0) DelayCommand(12.4,GiveXPToCreature(oPC,GetLocalInt(GetModule(),"_UOACraft_XP")));

View File

@@ -1,6 +1,6 @@
//#include "_persist_01a"
#include "nw_i0_plot"
#include "aps_include"
void CreateAnObject(string sResource, object oPC, int iStackSize);
void GetNextStackedItem(object oPC, string sItemTag, int iCount, int iMode, string sStackResRef);
void GetNextItemPossessedBy(object oPC, string sItemTag);
@@ -98,7 +98,7 @@ void main()
}
//int iTailorSkill = GetTokenPair(oPC,13,9);
int iTailorSkill = GetPersistentInt(oPC,"iTailorSkill","UOACraft");
int iTailorSkill = GetCampaignInt("UOACraft","iTailorSkill",oPC);
int iTailorChance = iTailorSkill;
if (iTailorChance < 350)
{
@@ -727,7 +727,7 @@ void main()
if (iTailorSkill <= 1000)
{
//DelayCommand(13.0,SetTokenPair(oPC,13,9,iTailorSkill));
DelayCommand(13.0,SetPersistentInt(oPC,"iTailorSkill",iTailorSkill,0,"UOACraft"));
DelayCommand(13.0,SetCampaignInt("UOACraft","iTailorSkill",iTailorSkill,oPC));
DelayCommand(13.0,SendMessageToPC(oPC,"===================================="));
DelayCommand(13.0,SendMessageToPC(oPC,"Your skill in tailoring has gone up!"));
DelayCommand(13.0,SendMessageToPC(oPC,"Current tailoring skill : "+ sOldSkill+"%"));

View File

@@ -1,6 +1,6 @@
//#include "_persist_01a"
#include "nw_i0_plot"
#include "aps_include"
void CreateAnObject(string sResource, object oPC, int iStackSize);
void GetNextStackedItem(object oPC, string sItemTag, int iCount, int iMode, string sStackResRef);
void GetNextItemPossessedBy(object oPC, string sItemTag);
@@ -104,7 +104,7 @@ void main()
}
//int iTailorSkill = GetTokenPair(oPC,13,9);
int iTailorSkill = GetPersistentInt(oPC,"iTailorSkill","UOACraft");
int iTailorSkill = GetCampaignInt("UOACraft","iTailorSkill",oPC);
int iTailorChance = iTailorSkill;
if (iTailorChance < 350)
{
@@ -375,8 +375,8 @@ void main()
{
//iTailorChance = iTailorChance - 200;
sItemResRefPoor = CraftLookup("cloth002",iClothType);
sItemResRef = CraftLookup("cloth246",iClothType);
sItemResRefExceptional = CraftLookup("cloth247",iClothType);
sItemResRef = CraftLookup("cloth237",iClothType);
sItemResRefExceptional = CraftLookup("cloth238",iClothType);
sComponent1 = sComponentPre+"COPPER"; //
sComponent1Name = "bolts of copper dyed cloth";
}
@@ -574,7 +574,7 @@ void main()
if (iTailorSkill <= 1000)
{
//DelayCommand(13.0,SetTokenPair(oPC,13,9,iTailorSkill));
DelayCommand(13.0,SetPersistentInt(oPC,"iTailorSkill",iTailorSkill,0,"UOACraft"));
DelayCommand(13.0,SetCampaignInt("UOACraft","iTailorSkill",iTailorSkill,oPC));
DelayCommand(13.0,SendMessageToPC(oPC,"===================================="));
DelayCommand(13.0,SendMessageToPC(oPC,"Your skill in tailoring has gone up!"));
DelayCommand(13.0,SendMessageToPC(oPC,"Current tailoring skill : "+ sOldSkill+"%"));

View File

@@ -1,6 +1,6 @@
//#include "_persist_01a"
#include "nw_i0_plot"
#include "aps_include"
void GetNextItemPossessedBy(object oPC, string sItemTag);
object CreatePlaceable(string sObject, location lPlace, float fDuration);
void CreateAnObject(string sResource, object oPC, int iStackSize);
@@ -55,7 +55,7 @@ void main()
}
//int iTanChance = GetTokenPair(oPC,14,10);
int iTanSkill = GetPersistentInt(oPC,"iTanSkill","UOACraft");
int iTanSkill = GetCampaignInt("UOACraft","iTanSkill",oPC);
//int iTanSkill = iTanChance;
int iTanChance = iTanSkill;
int iTanAcid = 1;
@@ -362,7 +362,7 @@ void main()
if (iTanSkill <= 1000)
{
//DelayCommand(6.0,SetTokenPair(oPC,14,10,iTanSkill));
DelayCommand(6.0,SetPersistentInt(oPC,"iTanSkill",iTanSkill,0,"UOACraft"));
DelayCommand(6.0,SetCampaignInt("UOACraft","iTanSkill",iTanSkill,oPC));
DelayCommand(6.0,SendMessageToPC(oPC,"=================================="));
DelayCommand(6.0,SendMessageToPC(oPC,"Your skill in tanning has gone up!"));
DelayCommand(6.0,SendMessageToPC(oPC,"Current tanning skill : "+ sOldSkill+"%"));

View File

@@ -1,6 +1,6 @@
//#include "_persist_01a"
#include "nw_i0_plot"
#include "aps_include"
void CreateAnObject(string sResource, object oPC);
void GetNextItemPossessedBy(object oPC, string sItemTag);
object CreatePlaceable(string sObject, location lPlace, float fDuration);
@@ -57,7 +57,7 @@ void main()
//int iTanChance = GetTokenPair(oPC,14,9);
//int iTanSkill = iTanChance;
int iTanSkill = GetPersistentInt(oPC,"iCureSkill","UOACraft");
int iTanSkill = GetCampaignInt("UOACraft","iCureSkill",oPC);
int iTanChance = iTanSkill;
int iKindling = 1;
int iSalt = 1;
@@ -447,7 +447,7 @@ void main()
if (iTanSkill <= 1000)
{
//DelayCommand(6.0,SetTokenPair(oPC,14,9,iTanSkill));
DelayCommand(6.0,SetPersistentInt(oPC,"iCureSkill",iTanSkill,0,"UOACraft"));
DelayCommand(6.0,SetCampaignInt("UOACraft","iCureSkill",iTanSkill,oPC));
DelayCommand(6.0,SendMessageToPC(oPC,"================================="));
DelayCommand(6.0,SendMessageToPC(oPC,"Your skill in curing has gone up!"));
DelayCommand(6.0,SendMessageToPC(oPC,"Current curing skill : "+ sOldSkill+"%"));

View File

@@ -1,6 +1,6 @@
//#include "_persist_01a"
#include "nw_i0_plot"
#include "aps_include"
void CreateAnObject(string sResource, object oPC, int iStackCount);
object CreatePlaceable(string sObject, location lPlace, float fDuration);
void GetNextItemPossessedBy(object oPC, string sItemTag);
@@ -135,7 +135,7 @@ void main()
//check for tool
if (oTool==OBJECT_INVALID)
{
FloatingTextStringOnCreature("You do not have any tinker's toolset to work with.",oPC,FALSE);
FloatingTextStringOnCreature("You do not have any tools to work with..",oPC,FALSE);
if (iAdded==99)
{
CopyItem(oItem,oPC,TRUE); //Return stackable PC dropped into table
@@ -147,7 +147,7 @@ void main()
//Check for 'in use'
if (GetLocalInt(oSelf,"iAmInUse")!=0)
{
FloatingTextStringOnCreature("Only one item at a time may be tinkered here.",oPC,FALSE);
FloatingTextStringOnCreature("Only one item at a time may be tinkered here..",oPC,FALSE);
if (iAdded==99)
{
CopyItem(oItem,oPC,TRUE); //Return stackable PC dropped into table
@@ -160,7 +160,7 @@ void main()
//int iGlassSkill = GetTokenPair(oPC,14,5);
int iGlassSkill = GetPersistentInt(oPC,"iTinkerSkill","UOACraft");
int iGlassSkill = GetCampaignInt("UOACraft","iTinkerSkill",oPC);
int iGlassChance = iGlassSkill;
if (iGlassChance <350)
{
@@ -174,14 +174,14 @@ void main()
if (iAdded==0)
{
if (GetStringRight(sItemResRef,3)=="001") // Tinkers toolset
if (GetStringRight(sItemResRef,3)=="001") // Tinkers toolkit
{
iComponent1 =2;
sComponent1 = "INGOT_IRON";
sComponent1Name = "iron ingots";
sCraft = "tinkerstoolset";
sSuccessString = "You successfully create a new tinker toolset.";
sFailString = "Your measurements are off, and as a result the toolset is unuseable.";
sFailString = "Your measurements are off and as a result the toolset is unuseable.";
}
if (GetStringRight(sItemResRef,3)=="008") //shovel
@@ -192,7 +192,7 @@ void main()
iGlassChance = iGlassChance - 50;
sCraft = "shovel";
sSuccessString = "You successfully create a new shovel.";
sFailString = "The measurements are off, and as a result the shovel is unuseable.";
sFailString = "The measurements are off and as a result the shovel is unuseable.";
}
if (GetStringRight(sItemResRef,3)=="005") // sewing kit
@@ -203,7 +203,7 @@ void main()
iGlassChance = iGlassChance - 10;
sCraft = "sewingkit";
sSuccessString = "You successfully create a tailor's sewing kit.";
sFailString = "Your measurements are off, and as a result the sewing kit is unuseable.";
sFailString = "Your measurements are off and as a result the sewing kit is unuseable.";
}
if (GetStringRight(sItemResRef,3)=="006") // miners pick
@@ -214,7 +214,7 @@ void main()
iGlassChance = iGlassChance - 50;
sCraft = "minerspick";
sSuccessString = "You successfully create a new miner's pick.";
sFailString = "The measurements are off, and as a result the miner's pick is unuseable.";
sFailString = "The measurements are off and as a result the miner's pick is unuseable.";
}
if (GetStringRight(sItemResRef,3)=="007") // miners pickaxe
@@ -225,7 +225,7 @@ void main()
iGlassChance = iGlassChance - 50;
sCraft = "minerspickaxe";
sSuccessString = "You successfully create a new miner's pickaxe.";
sFailString = "The measurements are off, and as a result the miner's pickaxe is unuseable.";
sFailString = "The measurements are off and as a result the miner's pickaxe is unuseable.";
}
if (GetStringRight(sItemResRef,3)=="009") // woodcutters axe
@@ -236,7 +236,7 @@ void main()
iGlassChance = iGlassChance - 250;
sCraft = "woodsmansaxe";
sSuccessString = "You successfully create a new woodcutting axe.";
sFailString = "The measurements are off, and as a result the axe is unuseable.";
sFailString = "The measurements are off and as a result the axe is unuseable.";
}
if (GetStringRight(sItemResRef,3)=="012") // herbalist knife
@@ -247,7 +247,7 @@ void main()
iGlassChance = iGlassChance - 20;
sCraft = "herbalistsknife";
sSuccessString = "You successfully create a new herbalist's knife.";
sFailString = "The measurements are off, and as a result the knife is unuseable.";
sFailString = "The measurements are off and as a result the knife is unuseable.";
}
if (GetStringRight(sItemResRef,3)=="079") // Orchard Blade
@@ -257,8 +257,8 @@ void main()
sComponent1Name = "iron ingots";
iGlassChance = iGlassChance - 250;
sCraft = "orchardblade";
sSuccessString = "You successfully create a new orchard blade.";
sFailString = "The measurements are off, and as a result the blade is unuseable.";
sSuccessString = "You successfully create a new orchard blade..";
sFailString = "The measurements are off and as a result the blade is unuseable.";
}
if (GetStringRight(sItemResRef,3)=="080") // Fillet Knife
@@ -268,8 +268,8 @@ void main()
sComponent1Name = "iron ingots";
iGlassChance = iGlassChance - 300;
sCraft = "filletknife";
sSuccessString = "You successfully create a new fillet knife.";
sFailString = "The measurements are off, and as a result the knife is unuseable.";
sSuccessString = "You successfully create a new fillet knife..";
sFailString = "The measurements are off and as a result the knife is unuseable.";
}
if (GetStringRight(sItemResRef,3)=="081") // Glass Arrowhead
@@ -285,7 +285,7 @@ void main()
iGlassChance = iGlassChance - 500;
sCraft = "glassarrowhea";
iTemp = 50; //50 max stack
sFailString = "The measurements are off, and as a result the arrowheads shatter.";
sFailString = "The measurements are off and as a result the arrowheads shatter.";
}
if (GetStringRight(sItemResRef,3)=="082") // Glass Bolt Tip
{
@@ -300,7 +300,7 @@ void main()
iGlassChance = iGlassChance - 500;
sCraft = "glassbolttip";
iTemp = 50; //50 max stack
sFailString = "The measurements are off, and as a result the bolt tips shatter.";
sFailString = "The measurements are off and as a result the bolt tips shatter.";
}
if (GetStringRight(sItemResRef,3)=="083") // Glass Sling Bullets
{
@@ -315,19 +315,19 @@ void main()
iGlassChance = iGlassChance - 600;
sCraft = "glassbullet";
iTemp = 99; //50 max stack
sFailString = "The measurements are off, and as a result the glass bullets shatter.";
sFailString = "The measurements are off and as a result the glass bullets shatter.";
}
if (GetStringRight(sItemResRef,3)=="089") // Smith Hammer
if (GetStringRight(sItemResRef,3)=="089") // Excavation Tools
{
//iComponent1Stackable=0;
//iStackable=1;
iComponent1 =6;
sComponent1 = "INGOT_IRON";
sComponent1Name = "iron ingots";
iGlassChance = iGlassChance - 10;
sCraft = "blacksmithhammer";
sFailString = "The measurements are off, and as a result the smith hammer is useless.";
}
iGlassChance = iGlassChance - 400;
sCraft = "item_excavation";
sFailString = "The measurements are off and as a result the excavation tools are useless.";
}
if (GetStringRight(sItemResRef,3)=="112") // Carpenters Tools
{
//iComponent1Stackable=0;
@@ -337,7 +337,7 @@ void main()
sComponent1Name = "iron ingots";
//iGlassChance = iGlassChance - 400;
sCraft = "carpenters_tools";
sFailString = "The measurements are off, and as a result the carpenter's tools are useless.";
sFailString = "The measurements are off and as a result the carpenters tools are useless.";
}
}
@@ -794,7 +794,7 @@ void main()
if (iGlassSkill <= 1000)
{
//DelayCommand(5.0,SetTokenPair(oPC,14,5,iGlassSkill));
DelayCommand(6.0,SetPersistentInt(oPC,"iTinkerSkill",iGlassSkill,0,"UOACraft"));
DelayCommand(6.0,SetCampaignInt("UOACraft","iTinkerSkill",iGlassSkill,oPC));
DelayCommand(6.0,SendMessageToPC(oPC,"================================="));
DelayCommand(6.0,SendMessageToPC(oPC,"Your Tinkering skill has gone up!"));
DelayCommand(6.0,SendMessageToPC(oPC,"Current Tinkering skill : "+ sOldSkill+"%"));

View File

@@ -1,6 +1,5 @@
//#include "_persist_01a"
#include "nw_i0_plot"
#include "aps_include"
void main()
{
@@ -99,7 +98,7 @@ void main()
if (sTagSelf == "PLANT_SORGHUM")
{
sPlant = "sorghumgrains";
sMessageToPC = "You carefully cut the sorghum and gather the grain.";
sMessageToPC = "You carefully cut the rice stalks and gather the grain.";
}
if (sTagSelf == "PLANT_BAMBOO")
@@ -595,11 +594,11 @@ void main()
sMessageToPC = "You have chopped a log from the tree.";
}
}
if (sTagSelf == "TREE_TANGERINE")
if (sTagSelf == "TREE_TANGARINE")
{
if (iTreeMode == 99)
{
sPlant = "tangerine";
sPlant = "tangarine";
sMessageToPC = "You carefully harvest some ripe tangarines.";
}
else
@@ -922,6 +921,7 @@ void main()
}
if (sPlant == "") sMessageToPC = "There is nothing to gather from this with the tool being used.";
int iPlantMax = GetLocalInt(oSelf,"iMaxPlant");
int iFarmChance = 0;
int iFarmSkill = 0;
@@ -935,7 +935,7 @@ void main()
if (iPlantMax == 0)
{
//iFarmSkill = GetTokenPair(oPC,14,6);
iFarmSkill = GetPersistentInt(oPC,"iFarmSkill","UOACraft");
iFarmSkill = GetCampaignInt("UOACraft","iFarmSkill",oPC);
iFarmChance = iFarmSkill;
if (iFarmChance <350)
{
@@ -958,7 +958,7 @@ void main()
if (iTreeMode == 0)
{
//iFarmSkill = GetTokenPair(oPC,14,7);
iFarmSkill = GetPersistentInt(oPC,"iLumberjackSkill","UOACraft");
iFarmSkill = GetCampaignInt("UOACraft","iLumberjackSkill",oPC);
iFarmChance = iFarmSkill;
if (iFarmChance <350)
{
@@ -972,7 +972,7 @@ void main()
else
{
//iFarmSkill = GetTokenPair(oPC,14,6);
iFarmSkill = GetPersistentInt(oPC,"iFarmSkill","UOACraft");
iFarmSkill = GetCampaignInt("UOACraft","iFarmSkill",oPC);
iFarmChance = iFarmSkill;
if (iFarmChance <350)
{
@@ -1005,7 +1005,7 @@ void main()
}
if (iRandom <= iFarmChance)
{
SetIdentified (CreateItemOnObject(sPlant,oPC,1), TRUE);
CreateItemOnObject(sPlant,oPC,1);
FloatingTextStringOnCreature(sMessageToPC,oPC,FALSE);
if (Random(1000)>=iFarmSkill)
{
@@ -1051,7 +1051,7 @@ void main()
if (iFarmSkill <= 1000)
{
//DelayCommand(5.0,SetTokenPair(oPC,14,7,iFarmSkill));
DelayCommand(6.0,SetPersistentInt(oPC,"iLumberjackSkill",iFarmSkill,0,"UOACraft"));
DelayCommand(6.0,SetCampaignInt("UOACraft","iLumberjackSkill",iFarmSkill,oPC));
DelayCommand(6.0,SendMessageToPC(oPC,"=================================="));
DelayCommand(6.0,SendMessageToPC(oPC,"Your Lumberjack skill has gone up!"));
DelayCommand(6.0,SendMessageToPC(oPC,"Current Lumberjack skill : "+ sOldSkill+"%"));

View File

@@ -119,8 +119,8 @@ void main()
{
oSelf = CreateObject(OBJECT_TYPE_PLACEABLE, "temporaryplaceho",lSelf,FALSE);
}
AssignCommand(oSelf,DelayCommand(900.0,CreatePlaceable(sSelf,lSelf,0.0)));
DestroyObject(oSelf,930.0);
AssignCommand(oSelf,DelayCommand(1800.0,CreatePlaceable(sSelf,lSelf,0.0)));
DestroyObject(oSelf,1830.0);
}

View File

@@ -1,13 +1,11 @@
//#include "_persist_01a"
#include "aps_include"
void main()
{
object oPC = GetLastOpenedBy();
SetLocalObject(oPC,"oLastOpened",OBJECT_SELF);
//int iAlchemySkill = GetTokenPair(oPC,14,12);
int iAlchemySkill = GetPersistentInt(oPC,"iAlchemySkill","UOACraft"
);
int iAlchemySkill = GetCampaignInt("UOACraft","iAlchemySkill",oPC);
int iAlchemyChance = iAlchemySkill;
if (iAlchemyChance <350)

View File

@@ -1,16 +1,13 @@
//#include "_persist_01a"
#include "aps_include"
void main()
{
object oPC = GetLastOpenedBy();
//int iSmithSkill = GetTokenPair(oPC,13,4); // Weaponsmith
int iSmithSkill = GetPersistentInt(oPC,"iSmithSkill","UOACraft"
);
int iSmithSkill = GetCampaignInt("UOACraft","iSmithSkill",oPC);
int iSmithChance = iSmithSkill;
//int iArmorSkill = GetTokenPair(oPC,13,5); // ArmorCraft
int iArmorSkill = GetPersistentInt(oPC,"iArmorSkill","UOACraft"
);
int iArmorSkill = GetCampaignInt("UOACraft","iArmorSkill",oPC);
int iArmorChance = iArmorSkill;
int iIngotType = GetLocalInt(oPC,"iUseIngotType");
int iIngotMod = iIngotType*25;

View File

@@ -1,12 +1,10 @@
//#include "_persist_01a"
#include "aps_include"
void main()
{
object oPC = GetLastOpenedBy();
//int iBowSkill = GetTokenPair(oPC,13,3);
int iBowSkill = GetPersistentInt(oPC,"iBowSkill","UOACraft"
);
int iBowSkill = GetCampaignInt("UOACraft","iBowSkill",oPC);
int iBowChance = iBowSkill;
int iWoodType = GetLocalInt(oPC,"iUseThisWood");

View File

@@ -1,11 +1,8 @@
#include "aps_include"
void main()
{
object oPC = GetLastOpenedBy();
//int iBrewSkill = GetTokenPair(oPC,13,9); // Brewing (Credit Tony Edwards for catching a mis-typed token value here.. was originally using weaponcraft skill to determine Brew patterns. Thx Tony ;)
int iBrewSkill = GetPersistentInt(oPC,"iBrewSkill","UOACraft"
);
int iBrewSkill = GetCampaignInt("UOACraft","iBrewSkill",oPC);
int iBrewChance = iBrewSkill;
if (GetItemPossessedBy(oPC,"NoDrop_SkillLogBook")==OBJECT_INVALID)

View File

@@ -1,12 +1,10 @@
//#include "_persist_01a"
#include "aps_include"
void main()
{
object oPC = GetLastOpenedBy();
//int iCarpentrySkill = GetTokenPair(oPC,13,3);
int iCarpentrySkill = GetPersistentInt(oPC,"iCarpentrySkill","UOACraft"
);
int iCarpentrySkill = GetCampaignInt("UOACraft","iCarpentrySkill",oPC);
int iCarpentryChance = iCarpentrySkill;
int iWoodType = GetLocalInt(oPC,"iUseThisWood");

View File

@@ -1,5 +1,3 @@
#include "aps_include"
void main()
{
object oPC = GetLastOpenedBy();
@@ -7,8 +5,7 @@ void main()
string sTagSelf = GetTag(oSelf);
int iCookType = StringToInt(GetStringRight(sTagSelf,3));
int iCookSkill = GetPersistentInt(oPC,"iCookSkill","UOACraft"
);
int iCookSkill = GetCampaignInt("UOACraft","iCookSkill",oPC);
int iCookChance = iCookSkill;
if (GetItemPossessedBy(oPC,"NoDrop_SkillLogBook")==OBJECT_INVALID)

View File

@@ -1,12 +1,10 @@
//#include "_persist_01a"
#include "aps_include"
void main()
{
object oPC = GetLastOpenedBy();
//int iJewelSkill = GetTokenPair(oPC,12,4); // JewelCraft
int iJewelSkill = GetPersistentInt(oPC,"iJewelSkill","UOACraft"
);
int iJewelSkill = GetCampaignInt("UOACraft","iJewelSkill",oPC);
int iJewelChance = iJewelSkill;
int iIngotType = GetLocalInt(oPC,"iUseIngotType");

View File

@@ -1,12 +1,10 @@
//#include "_persist_01a"
#include "aps_include"
void main()
{
object oPC = GetLastOpenedBy();
//int iGlassSkill = GetTokenPair(oPC,14,4);
int iGlassSkill = GetPersistentInt(oPC,"iGlassSkill","UOACraft"
);
int iGlassSkill = GetCampaignInt("UOACraft","iGlassSkill",oPC);
int iGlassChance = iGlassSkill;
if (GetItemPossessedBy(oPC,"NoDrop_SkillLogBook")==OBJECT_INVALID)

View File

@@ -1,12 +1,10 @@
//#include "_persist_01a"
#include "aps_include"
void main()
{
object oPC = GetLastOpenedBy();
//int iWoodSkill = GetTokenPair(oPC,13,13);
int iWoodSkill = GetPersistentInt(oPC,"iPaperSkill","UOACraft"
);
int iWoodSkill = GetCampaignInt("UOACraft","iPaperSkill",oPC);
int iWoodChance = iWoodSkill;
if (GetItemPossessedBy(oPC,"NoDrop_SkillLogBook")==OBJECT_INVALID)

View File

@@ -1,12 +1,10 @@
//#include "_persist_01a"
#include "aps_include"
void main()
{
object oPC = GetLastOpenedBy();
//int iTailorSkill = GetTokenPair(oPC,13,9); // Tailoring (Credit Tony Edwards for catching a mis-typed token value here.. was originally using weaponcraft skill to determine tailor patterns. Thx Tony ;)
int iTailorSkill = GetPersistentInt(oPC,"iTailorSkill","UOACraft"
);
int iTailorSkill = GetCampaignInt("UOACraft","iTailorSkill",oPC);
int iTailorChance = iTailorSkill;
if (GetItemPossessedBy(oPC,"NoDrop_SkillLogBook")==OBJECT_INVALID)

View File

@@ -1,12 +1,10 @@
//#include "_persist_01a"
#include "aps_include"
void main()
{
object oPC = GetLastOpenedBy();
//int iTailorSkill = GetTokenPair(oPC,13,9); // Tailoring (Credit Tony Edwards for catching a mis-typed token value here.. was originally using weaponcraft skill to determine tailor patterns. Thx Tony ;)
int iTailorSkill = GetPersistentInt(oPC,"iTailorSkill","UOACraft"
);
int iTailorSkill = GetCampaignInt("UOACraft","iTailorSkill",oPC);
int iTailorChance = iTailorSkill;
if (GetItemPossessedBy(oPC,"NoDrop_SkillLogBook")==OBJECT_INVALID)

View File

@@ -1,11 +1,10 @@
//#include "_persist_01a"
#include "aps_include"
void main()
{
object oPC = GetLastOpenedBy();
//int iGlassSkill = GetTokenPair(oPC,14,5);
int iGlassSkill = GetPersistentInt(oPC,"iTinkerSkill","UOACraft");
int iGlassSkill = GetCampaignInt("UOACraft","iTinkerSkill",oPC);
int iGlassChance = iGlassSkill;
if (GetItemPossessedBy(oPC,"NoDrop_SkillLogBook")==OBJECT_INVALID)

View File

@@ -37,9 +37,6 @@ void main()
{
SignalEvent(GetAreaFromLocation(GetLocation(OBJECT_SELF)), EventUserDefined(1007));
}
ExecuteScript("prc_npc_death", OBJECT_SELF);
ExecuteScript("prc_pwondeath", OBJECT_SELF);
}
object CreatePlaceable(string sObject, location lPlace, float fDuration)

View File

@@ -13,7 +13,7 @@ void main()
int iTemp = GetNumItems(oPC,sItemTag);
SendMessageToPC(oPC,"Attempting to add "+IntToString(iTemp)+" "+sItemName+" to this bundle.");
SendMessageToPC(oPC,"This will take 30 seconds.");
object oGone = GetFirstItemInInventory(oPC);
float fDelay = 2.0;
@@ -40,7 +40,7 @@ void main()
iTotal = iTotal+iCounter;
SetLocalInt(oDeed,"iNumberStored",iTotal);
DelayCommand(fDelay+0.5,SendMessageToPC(oPC,"Successfully added "+IntToString(iCounter)+" "+sItemName+" to the bundle."));
DelayCommand(fDelay+0.6,SendMessageToPC(oPC,"There are now a total of "+IntToString(iTotal)+" "+sItemName+" in this bundle."));
AssignCommand(GetModule(),DelayCommand(30.0,SetLocalInt(oDeed,"iNumberStored",iTotal)));
DelayCommand(fDelay+30.5,SendMessageToPC(oPC,"Successfully added "+IntToString(iCounter)+" "+sItemName+" to the bundle."));
DelayCommand(fDelay+30.6,SendMessageToPC(oPC,"There are now a total of "+IntToString(iTotal)+" "+sItemName+" in this bundle."));
}

View File

@@ -1,5 +1,9 @@
#include "nw_i0_plot"
void DelayCreateDeed(object oPC, string sItemTag, string sItemResRef, string sItemName, int iCounter, int iStack);
void main()
{
object oPC = OBJECT_SELF;
@@ -18,6 +22,7 @@ void main()
return;
}
SendMessageToPC(oPC,"Attempting to fill commodity bundle with "+IntToString(iTotal)+" "+sItemName+".");
SendMessageToPC(oPC,"This will take 30 seconds.");
int iAmCommodity=0;
if (GetStringLeft(sItemTag,5)=="ITEM_") iAmCommodity=1;
@@ -81,12 +86,6 @@ void main()
return;
}
object oDeed = CreateItemOnObject("_uoa_commodity_f",oPC,1);
SetLocalString(oDeed,"sItemTag",sItemTag);
SetLocalString(oDeed,"sItemResRef",sItemResRef);
SetLocalString(oDeed,"sItemName",sItemName);
object oGone = GetFirstItemInInventory(oPC);
float fDelay = 2.0;
int iCounter;
@@ -109,7 +108,18 @@ void main()
if (oGone==OBJECT_INVALID) break;
}
}
AssignCommand(GetModule(),DelayCommand(fDelay+30.0,DelayCreateDeed(oPC,sItemTag,sItemResRef,sItemName,iCounter,iStack)));
DelayCommand(fDelay+30.5,SendMessageToPC(oPC,"Successfully added "+IntToString(iCounter)+" "+sItemName+" to the bundle."));
DelayCommand(fDelay+0.5,SendMessageToPC(oPC,"Your filled deed will be ready in 30 seconds."));
}
void DelayCreateDeed(object oPC, string sItemTag, string sItemResRef, string sItemName, int iCounter, int iStack)
{
object oDeed = CreateItemOnObject("_uoa_commodity_f",oPC,1);
SetLocalString(oDeed,"sItemTag",sItemTag);
SetLocalString(oDeed,"sItemResRef",sItemResRef);
SetLocalString(oDeed,"sItemName",sItemName);
SetLocalInt(oDeed,"iNumberStored",iCounter);
SetLocalInt(oDeed,"iStack",iStack);
DelayCommand(fDelay+0.5,SendMessageToPC(oPC,"Successfully added "+IntToString(iCounter)+" "+sItemName+" to the bundle."));
}
return;
}

View File

@@ -1,5 +1,4 @@
//#include "_persist_01a"
#include "aps_include"
void CreateAnObject(string sResource, object oPC, int iStackSize);
void CreatePlaceable(string sObject, location lPlace, float fDuration);
@@ -38,7 +37,7 @@ void main()
DelayCommand(8.1,SetLocalInt(oPC,"iAmDigging",0));
//int iShroomSkill = GetTokenPair(oPC,12,1);
int iShroomSkill = GetPersistentInt(oPC,"iShroomSkill","UOACraft");
int iShroomSkill = GetCampaignInt("UOACraft","iShroomSkill",oPC);
int iShroomChance = iShroomSkill;
if (iShroomSkill <350)
{
@@ -124,7 +123,7 @@ void main()
DelayCommand(4.5,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_COM_HIT_FIRE,FALSE),OBJECT_SELF,1.0));
DelayCommand(5.0,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_COM_HIT_FIRE,FALSE),OBJECT_SELF,1.0));
DelayCommand(3.5,PlaySound(""));
DelayCommand(3.0,FloatingTextStringOnCreature("You have triggered a candlesnuff fungus to spew forth its spores!!",oPC,FALSE));
DelayCommand(3.0,FloatingTextStringOnCreature("You have triggered a stag's horn fungus to spew forth its spores!!",oPC,FALSE));
if (Random(1000)<200) NewShroomPatch(OBJECT_SELF,oPC);
}
break;
@@ -285,7 +284,7 @@ void main()
{
SetLocalInt(OBJECT_SELF,"iTriggered",99);
DelayCommand(3.3,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_FNF_PWSTUN,FALSE),OBJECT_SELF,1.0));
DelayCommand(3.0,FloatingTextStringOnCreature("You have triggered an earth star fungus to spew forth its spores!!",oPC,FALSE));
DelayCommand(3.0,FloatingTextStringOnCreature("You have triggered a velvet earth star fungus to spew forth its spores!!",oPC,FALSE));
if (Random(1000)<200) NewShroomPatch(OBJECT_SELF,oPC);
}
break;
@@ -1008,7 +1007,7 @@ void main()
{
SetLocalInt(OBJECT_SELF,"iTriggered",99);
DelayCommand(3.0,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_COM_HIT_FROST,FALSE),OBJECT_SELF,1.0));
DelayCommand(3.0,FloatingTextStringOnCreature("You have triggered a spring agaric to spew forth its blinding spores!!",oPC,FALSE));
DelayCommand(3.0,FloatingTextStringOnCreature("You have triggered a spring agaric to spew forth its spores!!",oPC,FALSE));
AssignCommand(oPC,DelayCommand(3.0,DoSavingThrow(oPC,1,20,5,oSelf)));
}
break;
@@ -1171,7 +1170,7 @@ void main()
}
else
{
DelayCommand(8.0,FloatingTextStringOnCreature("You accidentally crush the fungi whilst picking it.",oPC,FALSE));
DelayCommand(8.0,FloatingTextStringOnCreature("You fail to find any mushrooms..",oPC,FALSE));
if (GetLocalInt(OBJECT_SELF,"iAmDestroyed")==99)
{
object oTemp = OBJECT_INVALID;
@@ -1222,7 +1221,7 @@ void main()
if (iShroomSkill <= 1000)
{
//DelayCommand(8.1,SetTokenPair(oPC,12,1,iShroomSkill));
DelayCommand(8.1,SetPersistentInt(oPC,"iShroomSkill",iShroomSkill,0,"UOACraft"));
DelayCommand(8.1,SetCampaignInt("UOACraft","iShroomSkill",iShroomSkill,oPC));
DelayCommand(8.1,SendMessageToPC(oPC,"==================================="));
DelayCommand(8.2,SendMessageToPC(oPC,"Your skill in mycology has gone up!"));
DelayCommand(8.3,SendMessageToPC(oPC,"Current mycology skill : "+ sOldSkill+"%"));

View File

@@ -16,14 +16,14 @@
//by UOAbigail on Aug. 19, 2003
//
//------End comment------
#include "aps_include"
void DelayText(object oPC, int iSkillNumber);
void main()
{
object oPC = OBJECT_SELF;
int iSkillNumber =34;
int iSkillNumber =33;
for (iSkillNumber; iSkillNumber>0; iSkillNumber--)
{
DelayText(oPC,iSkillNumber);
@@ -48,208 +48,202 @@ void DelayText(object oPC, int iSkillNumber)
{
case 1:
{
iSkillValue = GetPersistentInt(oPC,"iMiningSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iMiningSkill",oPC);
sSkillName = "Mining";
break;
}
case 2:
{
iSkillValue = GetPersistentInt(oPC,"iSmeltSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iSmeltSkill",oPC);
sSkillName = "Smelting";
break;
}
case 3:
{
iSkillValue = GetPersistentInt(oPC,"iDigSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iDigSkill",oPC);
sSkillName = "Digging";
break;
}
case 4:
{
iSkillValue = GetPersistentInt(oPC,"iGlassSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iGlassSkill",oPC);
sSkillName = "Pottery and Glassblowing";
break;
}
case 5:
{
iSkillValue = GetPersistentInt(oPC,"iTinkerSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iTinkerSkill",oPC);
sSkillName = "Tinkering";
break;
}
case 6:
{
iSkillValue = GetPersistentInt(oPC,"iFarmSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iFarmSkill",oPC);
sSkillName = "Farming";
break;
}
case 7:
{
iSkillValue = GetPersistentInt(oPC,"iLumberjackSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iLumberjackSkill",oPC);
sSkillName = "Lumberjacking";
break;
}
case 8:
{
iSkillValue = GetPersistentInt(oPC,"iSkinningSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iSkinningSkill",oPC);
sSkillName = "Skinning Pelts";
break;
}
case 9:
{
iSkillValue = GetPersistentInt(oPC,"iCureSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iCureSkill",oPC);
sSkillName = "Curing Hides";
break;
}
case 10:
{
iSkillValue = GetPersistentInt(oPC,"iTanSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iTanSkill",oPC);
sSkillName = "Tanning Leather";
break;
}
case 11:
{
iSkillValue = GetPersistentInt(oPC,"iLeatherSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iLeatherSkill",oPC);
sSkillName = "Leatherworking";
break;
}
case 12:
{
iSkillValue = GetPersistentInt(oPC,"iAlchemySkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iAlchemySkill",oPC);
sSkillName = "Alchemy";
break;
}
case 13:
{
iSkillValue = GetPersistentInt(oPC,"iFishingSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iFishingSkill",oPC);
sSkillName = "Fishing";
break;
}
case 14:
{
iSkillValue = GetPersistentInt(oPC,"iBeeSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iBeeSkill",oPC);
sSkillName = "Beekeeping";
break;
}
case 15:
{
iSkillValue = GetPersistentInt(oPC,"iFletchingSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iFletchingSkill",oPC);
sSkillName = "Fletching";
break;
}
case 16:
{
iSkillValue = GetPersistentInt(oPC,"iBowSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iBowSkill",oPC);
sSkillName = "Bowcraft";
break;
}
case 17:
{
iSkillValue = GetPersistentInt(oPC,"iSmithSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iSmithSkill",oPC);
sSkillName = "Weaponcrafting";
break;
}
case 18:
{
iSkillValue = GetPersistentInt(oPC,"iArmorSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iArmorSkill",oPC);
sSkillName = "Armorcrafting";
break;
}
case 19:
{
iSkillValue = GetPersistentInt(oPC,"iPolishSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iPolishSkill",oPC);
sSkillName = "Gem Polishing";
break;
}
case 20:
{
iSkillValue = GetPersistentInt(oPC,"iGemSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iGemSkill",oPC);
sSkillName = "Gemcutting";
break;
}
case 21:
{
iSkillValue = GetPersistentInt(oPC,"iGemQuarrySkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iGemQuarrySkill",oPC);
sSkillName = "Gem Quarrying";
break;
}
case 22:
{
iSkillValue = GetPersistentInt(oPC,"iTailorSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iTailorSkill",oPC);
sSkillName = "Tailoring";
break;
}
case 23:
{
iSkillValue = GetPersistentInt(oPC,"iSpindleSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iSpindleSkill",oPC);
sSkillName = "Spindling";
break;
}
case 24:
{
iSkillValue = GetPersistentInt(oPC,"iClothSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iClothSkill",oPC);
sSkillName = "Clothmaking";
break;
}
case 25:
{
iSkillValue = GetPersistentInt(oPC,"iDyeSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iDyeSkill",oPC);
sSkillName = "Cloth Dyeing";
break;
}
case 26:
{
iSkillValue = GetPersistentInt(oPC,"iPaperSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iPaperSkill",oPC);
sSkillName = "Papermaking";
break;
}
case 27:
{
iSkillValue = GetPersistentInt(oPC,"iShroomSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iShroomSkill",oPC);
sSkillName = "Mycology";
break;
}
case 28:
{
iSkillValue = GetPersistentInt(oPC,"iScribeSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iScribeSkill",oPC);
sSkillName = "Inscription";
break;
}
case 29:
{
iSkillValue = GetPersistentInt(oPC,"iCookSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iCookSkill",oPC);
sSkillName = "Cooking";
break;
}
case 30:
{
iSkillValue = GetPersistentInt(oPC,"iJewelSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iJewelSkill",oPC);
sSkillName = "Jewelcraft";
break;
}
case 31:
{
iSkillValue = GetPersistentInt(oPC,"iMapSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iMapSkill",oPC);
sSkillName = "Cartography";
break;
}
case 32:
{
iSkillValue = GetPersistentInt(oPC,"iCarpentrySkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iCarpentrySkill",oPC);
sSkillName = "Carpentry";
break;
}
case 33:
{
iSkillValue = GetPersistentInt(oPC,"iBrewSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iBrewSkill",oPC);
sSkillName = "Brewing";
break;
}
case 34:
{
iSkillValue = GetPersistentInt(oPC,"iEnchantSkill","UOACraft");
sSkillName = "Enchanting";
break;
}
default:{return;}
}

View File

@@ -16,7 +16,7 @@
//by UOAbigail on Aug. 19, 2003
//
//------End comment------
#include "aps_include"
void DelayText(object oPC, int iSkillNumber);
@@ -25,7 +25,7 @@ void main()
object oPC = OBJECT_SELF;
object oTarget = GetLocalObject(oPC,"oTarget");
//DeleteLocalObject(oPC,"oTarget");
int iSkillNumber =34;
int iSkillNumber =33;
for (iSkillNumber; iSkillNumber>0; iSkillNumber--)
{
DelayText(oTarget,iSkillNumber);
@@ -52,208 +52,202 @@ void DelayText(object oPC, int iSkillNumber)
{
case 1:
{
iSkillValue = GetPersistentInt(oPC,"iMiningSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iMiningSkill",oPC);
sSkillName = "Miner";
break;
}
case 2:
{
iSkillValue = GetPersistentInt(oPC,"iSmeltSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iSmeltSkill",oPC);
sSkillName = "Smelter";
break;
}
case 3:
{
iSkillValue = GetPersistentInt(oPC,"iDigSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iDigSkill",oPC);
sSkillName = "Digger";
break;
}
case 4:
{
iSkillValue = GetPersistentInt(oPC,"iGlassSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iGlassSkill",oPC);
sSkillName = "Potter/Glassblower";
break;
}
case 5:
{
iSkillValue = GetPersistentInt(oPC,"iTinkerSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iTinkerSkill",oPC);
sSkillName = "Tinkerer";
break;
}
case 6:
{
iSkillValue = GetPersistentInt(oPC,"iFarmSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iFarmSkill",oPC);
sSkillName = "Farmer";
break;
}
case 7:
{
iSkillValue = GetPersistentInt(oPC,"iLumberjackSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iLumberjackSkill",oPC);
sSkillName = "Lumberjack";
break;
}
case 8:
{
iSkillValue = GetPersistentInt(oPC,"iSkinningSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iSkinningSkill",oPC);
sSkillName = "Skinning Pelts";
break;
}
case 9:
{
iSkillValue = GetPersistentInt(oPC,"iCureSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iCureSkill",oPC);
sSkillName = "Hide Curer";
break;
}
case 10:
{
iSkillValue = GetPersistentInt(oPC,"iTanSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iTanSkill",oPC);
sSkillName = "Leather Tanner";
break;
}
case 11:
{
iSkillValue = GetPersistentInt(oPC,"iLeatherSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iLeatherSkill",oPC);
sSkillName = "Leatherworker";
break;
}
case 12:
{
iSkillValue = GetPersistentInt(oPC,"iAlchemySkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iAlchemySkill",oPC);
sSkillName = "Alchemist";
break;
}
case 13:
{
iSkillValue = GetPersistentInt(oPC,"iFishingSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iFishingSkill",oPC);
sSkillName = "Fisher";
break;
}
case 14:
{
iSkillValue = GetPersistentInt(oPC,"iBeeSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iBeeSkill",oPC);
sSkillName = "Beekeeper";
break;
}
case 15:
{
iSkillValue = GetPersistentInt(oPC,"iFletchingSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iFletchingSkill",oPC);
sSkillName = "Fletcher";
break;
}
case 16:
{
iSkillValue = GetPersistentInt(oPC,"iBowSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iBowSkill",oPC);
sSkillName = "Bowcrafter";
break;
}
case 17:
{
iSkillValue = GetPersistentInt(oPC,"iSmithSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iSmithSkill",oPC);
sSkillName = "Weaponcrafter";
break;
}
case 18:
{
iSkillValue = GetPersistentInt(oPC,"iArmorSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iArmorSkill",oPC);
sSkillName = "Armorcrafter";
break;
}
case 19:
{
iSkillValue = GetPersistentInt(oPC,"iPolishSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iPolishSkill",oPC);
sSkillName = "Gem Polisher";
break;
}
case 20:
{
iSkillValue = GetPersistentInt(oPC,"iGemSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iGemSkill",oPC);
sSkillName = "Gemcutter";
break;
}
case 21:
{
iSkillValue = GetPersistentInt(oPC,"iGemQuarrySkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iGemQuarrySkill",oPC);
sSkillName = "Gem Quarrier";
break;
}
case 22:
{
iSkillValue = GetPersistentInt(oPC,"iTailorSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iTailorSkill",oPC);
sSkillName = "Tailor";
break;
}
case 23:
{
iSkillValue = GetPersistentInt(oPC,"iSpindleSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iSpindleSkill",oPC);
sSkillName = "Spindler";
break;
}
case 24:
{
iSkillValue = GetPersistentInt(oPC,"iClothSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iClothSkill",oPC);
sSkillName = "Clothmaker";
break;
}
case 25:
{
iSkillValue = GetPersistentInt(oPC,"iDyeSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iDyeSkill",oPC);
sSkillName = "Cloth Dyer";
break;
}
case 26:
{
iSkillValue = GetPersistentInt(oPC,"iPaperSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iPaperSkill",oPC);
sSkillName = "Papermaker";
break;
}
case 27:
{
iSkillValue = GetPersistentInt(oPC,"iShroomSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iShroomSkill",oPC);
sSkillName = "Mycologist";
break;
}
case 28:
{
iSkillValue = GetPersistentInt(oPC,"iScribeSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iScribeSkill",oPC);
sSkillName = "Inscriptionist";
break;
}
case 29:
{
iSkillValue = GetPersistentInt(oPC,"iCookSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iCookSkill",oPC);
sSkillName = "Cook";
break;
}
case 30:
{
iSkillValue = GetPersistentInt(oPC,"iJewelSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iJewelSkill",oPC);
sSkillName = "Jewelcrafter";
break;
}
case 31:
{
iSkillValue = GetPersistentInt(oPC,"iMapSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iMapSkill",oPC);
sSkillName = "Cartographer";
break;
}
case 32:
{
iSkillValue = GetPersistentInt(oPC,"iCarpentrySkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iCarpentrySkill",oPC);
sSkillName = "Carpenter";
break;
}
case 33:
{
iSkillValue = GetPersistentInt(oPC,"iBrewSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iBrewSkill",oPC);
sSkillName = "Brewmeister";
break;
}
case 34:
{
iSkillValue = GetPersistentInt(oPC,"iEnchantSkill","UOACraft");
sSkillName = "Enchanting";
break;
}
default:{return;}
}

View File

@@ -16,7 +16,7 @@
//by UOAbigail on Aug. 19, 2003
//
//------End comment------
#include "aps_include"
void DelayText(object oPC, int iSkillNumber);
void DelayText2(object oPC, int iSkillNumber);
@@ -25,7 +25,7 @@ void main()
{
object oPC = OBJECT_SELF;
object oTarget = GetLocalObject(oPC,"oTarget");
int iSkillNumber =34;
int iSkillNumber =33;
for (iSkillNumber; iSkillNumber>0; iSkillNumber--)
{
if (oTarget==OBJECT_INVALID)DelayText(oPC,iSkillNumber);
@@ -49,224 +49,202 @@ void DelayText(object oPC, int iSkillNumber)
{
case 1:
{
iSkillValue = GetPersistentInt(oPC,"iMiningSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iMiningSkill",oPC);
sSkillName = "Mining";
break;
}
case 2:
{
iSkillValue = GetPersistentInt(oPC,"iSmeltSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iSmeltSkill",oPC);
sSkillName = "Smelting";
break;
}
case 3:
{
iSkillValue = GetPersistentInt(oPC,"iDigSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iDigSkill",oPC);
sSkillName = "Digging";
break;
}
case 4:
{
iSkillValue = GetPersistentInt(oPC,"iGlassSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iGlassSkill",oPC);
sSkillName = "Pottery and Glassblowing";
break;
}
case 5:
{
iSkillValue = GetPersistentInt(oPC,"iTinkerSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iTinkerSkill",oPC);
sSkillName = "Tinkering";
break;
}
case 6:
{
iSkillValue = GetPersistentInt(oPC,"iFarmSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iFarmSkill",oPC);
sSkillName = "Farming";
break;
}
case 7:
{
iSkillValue = GetPersistentInt(oPC,"iLumberjackSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iLumberjackSkill",oPC);
sSkillName = "Lumberjacking";
break;
}
case 8:
{
iSkillValue = GetPersistentInt(oPC,"iSkinningSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iSkinningSkill",oPC);
sSkillName = "Skinning Pelts";
break;
}
case 9:
{
iSkillValue = GetPersistentInt(oPC,"iCureSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iCureSkill",oPC);
sSkillName = "Curing Hides";
break;
}
case 10:
{
iSkillValue = GetPersistentInt(oPC,"iTanSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iTanSkill",oPC);
sSkillName = "Tanning Leather";
break;
}
case 11:
{
iSkillValue = GetPersistentInt(oPC,"iLeatherSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iLeatherSkill",oPC);
sSkillName = "Leatherworking";
break;
}
case 12:
{
iSkillValue = GetPersistentInt(oPC,"iAlchemySkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iAlchemySkill",oPC);
sSkillName = "Alchemy";
break;
}
case 13:
{
iSkillValue = GetPersistentInt(oPC,"iFishingSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iFishingSkill",oPC);
sSkillName = "Fishing";
break;
}
case 14:
{
iSkillValue = GetPersistentInt(oPC,"iBeeSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iBeeSkill",oPC);
sSkillName = "Beekeeping";
break;
}
case 15:
{
iSkillValue = GetPersistentInt(oPC,"iFletchingSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iFletchingSkill",oPC);
sSkillName = "Fletching";
break;
}
case 16:
{
iSkillValue = GetPersistentInt(oPC,"iBowSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iBowSkill",oPC);
sSkillName = "Bowcraft";
break;
}
case 17:
{
iSkillValue = GetPersistentInt(oPC,"iSmithSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iSmithSkill",oPC);
sSkillName = "Weaponcrafting";
break;
}
case 18:
{
iSkillValue = GetPersistentInt(oPC,"iArmorSkill","UOACraft");
iSkillValue = GetCampaignInt("UOACraft","iArmorSkill",oPC);
sSkillName = "Armorcrafting";
break;
}
case 19:
{
iSkillValue = GetPersistentInt(oPC,"iPolishSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iPolishSkill",oPC);
sSkillName = "Gem Polishing";
break;
}
case 20:
{
iSkillValue = GetPersistentInt(oPC,"iGemSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iGemSkill",oPC);
sSkillName = "Gemcutting";
break;
}
case 21:
{
iSkillValue = GetPersistentInt(oPC,"iGemQuarrySkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iGemQuarrySkill",oPC);
sSkillName = "Gem Quarrying";
break;
}
case 22:
{
iSkillValue = GetPersistentInt(oPC,"iTailorSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iTailorSkill",oPC);
sSkillName = "Tailoring";
break;
}
case 23:
{
iSkillValue = GetPersistentInt(oPC,"iSpindleSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iSpindleSkill",oPC);
sSkillName = "Spindling";
break;
}
case 24:
{
iSkillValue = GetPersistentInt(oPC,"iClothSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iClothSkill",oPC);
sSkillName = "Clothmaking";
break;
}
case 25:
{
iSkillValue = GetPersistentInt(oPC,"iDyeSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iDyeSkill",oPC);
sSkillName = "Cloth Dyeing";
break;
}
case 26:
{
iSkillValue = GetPersistentInt(oPC,"iPaperSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iPaperSkill",oPC);
sSkillName = "Papermaking";
break;
}
case 27:
{
iSkillValue = GetPersistentInt(oPC,"iShroomSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iShroomSkill",oPC);
sSkillName = "Mycology";
break;
}
case 28:
{
iSkillValue = GetPersistentInt(oPC,"iScribeSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iScribeSkill",oPC);
sSkillName = "Inscription";
break;
}
case 29:
{
iSkillValue = GetPersistentInt(oPC,"iCookSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iCookSkill",oPC);
sSkillName = "Cooking";
break;
}
case 30:
{
iSkillValue = GetPersistentInt(oPC,"iJewelSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iJewelSkill",oPC);
sSkillName = "Jewelcraft";
break;
}
case 31:
{
iSkillValue = GetPersistentInt(oPC,"iMapSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iMapSkill",oPC);
sSkillName = "Cartography";
break;
}
case 32:
{
iSkillValue = GetPersistentInt(oPC,"iCarpentrySkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iCarpentrySkill",oPC);
sSkillName = "Carpentry";
break;
}
case 33:
{
iSkillValue = GetPersistentInt(oPC,"iBrewSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iBrewSkill",oPC);
sSkillName = "Brewing";
break;
}
case 34:
{
iSkillValue = GetPersistentInt(oPC,"iEnchantSkill","UOACraft"
);
sSkillName = "Enchanting";
break;
}
default:{return;}
}
@@ -311,242 +289,202 @@ void DelayText2(object oPC, int iSkillNumber)
{
case 1:
{
iSkillValue = GetPersistentInt(oPC,"iMiningSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iMiningSkill",oPC);
sSkillName = "Mining";
break;
}
case 2:
{
iSkillValue = GetPersistentInt(oPC,"iSmeltSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iSmeltSkill",oPC);
sSkillName = "Smelting";
break;
}
case 3:
{
iSkillValue = GetPersistentInt(oPC,"iDigSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iDigSkill",oPC);
sSkillName = "Digging";
break;
}
case 4:
{
iSkillValue = GetPersistentInt(oPC,"iGlassSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iGlassSkill",oPC);
sSkillName = "Pottery and Glassblowing";
break;
}
case 5:
{
iSkillValue = GetPersistentInt(oPC,"iTinkerSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iTinkerSkill",oPC);
sSkillName = "Tinkering";
break;
}
case 6:
{
iSkillValue = GetPersistentInt(oPC,"iFarmSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iFarmSkill",oPC);
sSkillName = "Farming";
break;
}
case 7:
{
iSkillValue = GetPersistentInt(oPC,"iLumberjackSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iLumberjackSkill",oPC);
sSkillName = "Lumberjacking";
break;
}
case 8:
{
iSkillValue = GetPersistentInt(oPC,"iSkinningSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iSkinningSkill",oPC);
sSkillName = "Skinning Pelts";
break;
}
case 9:
{
iSkillValue = GetPersistentInt(oPC,"iCureSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iCureSkill",oPC);
sSkillName = "Curing Hides";
break;
}
case 10:
{
iSkillValue = GetPersistentInt(oPC,"iTanSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iTanSkill",oPC);
sSkillName = "Tanning Leather";
break;
}
case 11:
{
iSkillValue = GetPersistentInt(oPC,"iLeatherSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iLeatherSkill",oPC);
sSkillName = "Leatherworking";
break;
}
case 12:
{
iSkillValue = GetPersistentInt(oPC,"iAlchemySkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iAlchemySkill",oPC);
sSkillName = "Alchemy";
break;
}
case 13:
{
iSkillValue = GetPersistentInt(oPC,"iFishingSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iFishingSkill",oPC);
sSkillName = "Fishing";
break;
}
case 14:
{
iSkillValue = GetPersistentInt(oPC,"iBeeSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iBeeSkill",oPC);
sSkillName = "Beekeeping";
break;
}
case 15:
{
iSkillValue = GetPersistentInt(oPC,"iFletchingSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iFletchingSkill",oPC);
sSkillName = "Fletching";
break;
}
case 16:
{
iSkillValue = GetPersistentInt(oPC,"iBowSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iBowSkill",oPC);
sSkillName = "Bowcraft";
break;
}
case 17:
{
iSkillValue = GetPersistentInt(oPC,"iSmithSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iSmithSkill",oPC);
sSkillName = "Weaponcrafting";
break;
}
case 18:
{
iSkillValue = GetPersistentInt(oPC,"iArmorSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iArmorSkill",oPC);
sSkillName = "Armorcrafting";
break;
}
case 19:
{
iSkillValue = GetPersistentInt(oPC,"iPolishSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iPolishSkill",oPC);
sSkillName = "Gem Polishing";
break;
}
case 20:
{
iSkillValue = GetPersistentInt(oPC,"iGemSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iGemSkill",oPC);
sSkillName = "Gemcutting";
break;
}
case 21:
{
iSkillValue = GetPersistentInt(oPC,"iGemQuarrySkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iGemQuarrySkill",oPC);
sSkillName = "Gem Quarrying";
break;
}
case 22:
{
iSkillValue = GetPersistentInt(oPC,"iTailorSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iTailorSkill",oPC);
sSkillName = "Tailoring";
break;
}
case 23:
{
iSkillValue = GetPersistentInt(oPC,"iSpindleSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iSpindleSkill",oPC);
sSkillName = "Spindling";
break;
}
case 24:
{
iSkillValue = GetPersistentInt(oPC,"iClothSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iClothSkill",oPC);
sSkillName = "Clothmaking";
break;
}
case 25:
{
iSkillValue = GetPersistentInt(oPC,"iDyeSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iDyeSkill",oPC);
sSkillName = "Cloth Dyeing";
break;
}
case 26:
{
iSkillValue = GetPersistentInt(oPC,"iPaperSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iPaperSkill",oPC);
sSkillName = "Papermaking";
break;
}
case 27:
{
iSkillValue = GetPersistentInt(oPC,"iShroomSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iShroomSkill",oPC);
sSkillName = "Mycology";
break;
}
case 28:
{
iSkillValue = GetPersistentInt(oPC,"iScribeSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iScribeSkill",oPC);
sSkillName = "Inscription";
break;
}
case 29:
{
iSkillValue = GetPersistentInt(oPC,"iCookSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iCookSkill",oPC);
sSkillName = "Cooking";
break;
}
case 30:
{
iSkillValue = GetPersistentInt(oPC,"iJewelSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iJewelSkill",oPC);
sSkillName = "Jewelcraft";
break;
}
case 31:
{
iSkillValue = GetPersistentInt(oPC,"iMapSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iMapSkill",oPC);
sSkillName = "Cartography";
break;
}
case 32:
{
iSkillValue = GetPersistentInt(oPC,"iCarpentrySkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iCarpentrySkill",oPC);
sSkillName = "Carpentry";
break;
}
case 33:
{
iSkillValue = GetPersistentInt(oPC,"iBrewSkill","UOACraft"
);
iSkillValue = GetCampaignInt("UOACraft","iBrewSkill",oPC);
sSkillName = "Brewmeister";
break;
}
case 34:
{
iSkillValue = GetPersistentInt(oPC,"iEnchantSkill","UOACraft"
);
sSkillName = "Enchanter";
break;
}
default:{return;}
}

View File

@@ -31,6 +31,6 @@ void main()
void ItemCreate(object oPC)
{
object oWater = CreateItemOnObject("item002",oPC,1);
SetLocalInt(oPC,"iWaterFull",100);
SetLocalInt(oPC,"iWaterFull",5);
return;
}

View File

@@ -1,7 +1,7 @@
// Name : Avlis Persistence System include
// Purpose : Various APS/NWNX2 related functions
// Authors : Ingmar Stieger, Adam Colon, Josh Simon
// Modified : December 21, 2003
// Modified : January 1st, 2005
// This file is licensed under the terms of the
// GNU GENERAL PUBLIC LICENSE (GPL) Version 2
@@ -10,13 +10,12 @@
/* Return codes */
/************************************/
int SQL_ERROR = 0;
int SQL_SUCCESS = 1;
const int SQL_ERROR = 0;
const int SQL_SUCCESS = 1;
/************************************/
/* Function prototypes */
/************************************/
sqlquery last_sql_query;
// Setup placeholders for ODBC requests and responses
void SQLInit();
@@ -62,33 +61,45 @@ vector APSStringToVector(string sVector);
// Optional parameters:
// iExpiration: Number of days the persistent variable should be kept in database (default: 0=forever)
// sTable: Name of the table where variable should be stored (default: pwdata)
void SetPersistentString(object oObject, string sVarName, string sValue, int iExpiration = 0, string sTable = "pwdata");
void SetPersistentString(object oObject, string sVarName, string sValue, int iExpiration =
0, string sTable = "pwdata");
// Set oObject's persistent integer variable sVarName to iValue
// Optional parameters:
// iExpiration: Number of days the persistent variable should be kept in database (default: 0=forever)
// sTable: Name of the table where variable should be stored (default: pwdata)
void SetPersistentInt(object oObject, string sVarName, int iValue, int iExpiration = 0, string sTable = "pwdata");
void SetPersistentInt(object oObject, string sVarName, int iValue, int iExpiration =
0, string sTable = "pwdata");
// Set oObject's persistent float variable sVarName to fValue
// Optional parameters:
// iExpiration: Number of days the persistent variable should be kept in database (default: 0=forever)
// sTable: Name of the table where variable should be stored (default: pwdata)
void SetPersistentFloat(object oObject, string sVarName, float fValue, int iExpiration = 0, string sTable = "pwdata");
void SetPersistentFloat(object oObject, string sVarName, float fValue, int iExpiration =
0, string sTable = "pwdata");
// Set oObject's persistent location variable sVarName to lLocation
// Optional parameters:
// iExpiration: Number of days the persistent variable should be kept in database (default: 0=forever)
// sTable: Name of the table where variable should be stored (default: pwdata)
// This function converts location to a string for storage in the database.
void SetPersistentLocation(object oObject, string sVarName, location lLocation, int iExpiration = 0, string sTable = "pwdata");
void SetPersistentLocation(object oObject, string sVarName, location lLocation, int iExpiration =
0, string sTable = "pwdata");
// Set oObject's persistent vector variable sVarName to vVector
// Optional parameters:
// iExpiration: Number of days the persistent variable should be kept in database (default: 0=forever)
// sTable: Name of the table where variable should be stored (default: pwdata)
// This function converts vector to a string for storage in the database.
void SetPersistentVector(object oObject, string sVarName, vector vVector, int iExpiration = 0, string sTable = "pwdata");
void SetPersistentVector(object oObject, string sVarName, vector vVector, int iExpiration =
0, string sTable = "pwdata");
// Set oObject's persistent object with sVarName to sValue
// Optional parameters:
// iExpiration: Number of days the persistent variable should be kept in database (default: 0=forever)
// sTable: Name of the table where variable should be stored (default: pwobjdata)
void SetPersistentObject(object oObject, string sVarName, object oObject2, int iExpiration =
0, string sTable = "pwobjdata");
// Get oObject's persistent string variable sVarName
// Optional parameters:
@@ -120,6 +131,12 @@ location GetPersistentLocation(object oObject, string sVarname, string sTable =
// * Return value on error: 0
vector GetPersistentVector(object oObject, string sVarName, string sTable = "pwdata");
// Get oObject's persistent object sVarName
// Optional parameters:
// sTable: Name of the table where object is stored (default: pwobjdata)
// * Return value on error: 0
object GetPersistentObject(object oObject, string sVarName, object oOwner = OBJECT_INVALID, string sTable = "pwobjdata");
// Delete persistent variable sVarName stored on oObject
// Optional parameters:
// sTable: Name of the table where variable is stored (default: pwdata)
@@ -139,22 +156,40 @@ string SQLDecodeSpecialChars(string sString);
void SQLInit()
{
SQLExecDirect("CREATE TABLE IF NOT EXISTS pwdata(player varchar(64), tag varchar(64), name varchar(64), val text, expire int(11), last timestamp NOT NULL DEFAULT DEFAULT_TIMESTAMP, PRIMARY KEY (player,tag,name))");
int i;
// Placeholder for ODBC persistence
string sMemory;
for (i = 0; i < 8; i++) // reserve 8*128 bytes
sMemory +=
"................................................................................................................................";
SetLocalString(GetModule(), "NWNX!ODBC!SPACER", sMemory);
}
void SQLExecDirect(string sSQL)
{
sqlquery sql = SqlPrepareQueryCampaign("db",sSQL);
last_sql_query = sql;
if(GetStringLowerCase(GetStringLeft(sSQL,6)) != "select")
{
SqlStep(sql);
}
SetLocalString(GetModule(), "NWNX!ODBC!EXEC", sSQL);
}
int SQLFetch()
{
return SqlStep(last_sql_query);
string sRow;
object oModule = GetModule();
SetLocalString(oModule, "NWNX!ODBC!FETCH", GetLocalString(oModule, "NWNX!ODBC!SPACER"));
sRow = GetLocalString(oModule, "NWNX!ODBC!FETCH");
if (GetStringLength(sRow) > 0)
{
SetLocalString(oModule, "NWNX_ODBC_CurrentRow", sRow);
return SQL_SUCCESS;
}
else
{
SetLocalString(oModule, "NWNX_ODBC_CurrentRow", "");
return SQL_ERROR;
}
}
// deprecated. use SQLFetch().
@@ -171,7 +206,45 @@ int SQLNextRow()
string SQLGetData(int iCol)
{
return SqlGetString(last_sql_query,iCol-1);
int iPos;
string sResultSet = GetLocalString(GetModule(), "NWNX_ODBC_CurrentRow");
// find column in current row
int iCount = 0;
string sColValue = "";
iPos = FindSubString(sResultSet, "<22>");
if ((iPos == -1) && (iCol == 1))
{
// only one column, return value immediately
sColValue = sResultSet;
}
else if (iPos == -1)
{
// only one column but requested column > 1
sColValue = "";
}
else
{
// loop through columns until found
while (iCount != iCol)
{
iCount++;
if (iCount == iCol)
sColValue = GetStringLeft(sResultSet, iPos);
else
{
sResultSet = GetStringRight(sResultSet, GetStringLength(sResultSet) - iPos - 1);
iPos = FindSubString(sResultSet, "<22>");
}
// special case: last column in row
if (iPos == -1)
iPos = GetStringLength(sResultSet);
}
}
return sColValue;
}
// These functions deal with various data types. Ultimately, all information
@@ -291,7 +364,7 @@ void SetPersistentString(object oObject, string sVarName, string sValue, int iEx
"' AND tag='" + sTag + "' AND name='" + sVarName + "'";
SQLExecDirect(sSQL);
if (SQLFirstRow() == SQL_SUCCESS)
if (SQLFetch() == SQL_SUCCESS)
{
// row exists
sSQL = "UPDATE " + sTable + " SET val='" + sValue +
@@ -331,7 +404,7 @@ string GetPersistentString(object oObject, string sVarName, string sTable = "pwd
"' AND tag='" + sTag + "' AND name='" + sVarName + "'";
SQLExecDirect(sSQL);
if (SQLFirstRow() == SQL_SUCCESS)
if (SQLFetch() == SQL_SUCCESS)
return SQLDecodeSpecialChars(SQLGetData(1));
else
{
@@ -353,7 +426,30 @@ void SetPersistentInt(object oObject, string sVarName, int iValue, int iExpirati
int GetPersistentInt(object oObject, string sVarName, string sTable = "pwdata")
{
return StringToInt(GetPersistentString(oObject, sVarName, sTable));
string sPlayer;
string sTag;
object oModule;
if (GetIsPC(oObject))
{
sPlayer = SQLEncodeSpecialChars(GetPCPlayerName(oObject));
sTag = SQLEncodeSpecialChars(GetName(oObject));
}
else
{
sPlayer = "~";
sTag = GetTag(oObject);
}
sVarName = SQLEncodeSpecialChars(sVarName);
string sSQL = "SELECT val FROM " + sTable + " WHERE player='" + sPlayer +
"' AND tag='" + sTag + "' AND name='" + sVarName + "'";
SQLExecDirect(sSQL);
oModule = GetModule();
SetLocalString(oModule, "NWNX!ODBC!FETCH", "-2147483647");
return StringToInt(GetLocalString(oModule, "NWNX!ODBC!FETCH"));
}
void SetPersistentFloat(object oObject, string sVarName, float fValue, int iExpiration =
@@ -364,7 +460,30 @@ void SetPersistentFloat(object oObject, string sVarName, float fValue, int iExpi
float GetPersistentFloat(object oObject, string sVarName, string sTable = "pwdata")
{
return StringToFloat(GetPersistentString(oObject, sVarName, sTable));
string sPlayer;
string sTag;
object oModule;
if (GetIsPC(oObject))
{
sPlayer = SQLEncodeSpecialChars(GetPCPlayerName(oObject));
sTag = SQLEncodeSpecialChars(GetName(oObject));
}
else
{
sPlayer = "~";
sTag = GetTag(oObject);
}
sVarName = SQLEncodeSpecialChars(sVarName);
string sSQL = "SELECT val FROM " + sTable + " WHERE player='" + sPlayer +
"' AND tag='" + sTag + "' AND name='" + sVarName + "'";
SQLExecDirect(sSQL);
oModule = GetModule();
SetLocalString(oModule, "NWNX!ODBC!FETCH", "-340282306073709650000000000000000000000.000000000");
return StringToFloat(GetLocalString(oModule, "NWNX!ODBC!FETCH"));
}
void SetPersistentLocation(object oObject, string sVarName, location lLocation, int iExpiration =
@@ -389,6 +508,73 @@ vector GetPersistentVector(object oObject, string sVarName, string sTable = "pwd
return APSStringToVector(GetPersistentString(oObject, sVarName, sTable));
}
void SetPersistentObject(object oOwner, string sVarName, object oObject, int iExpiration =
0, string sTable = "pwobjdata")
{
string sPlayer;
string sTag;
if (GetIsPC(oOwner))
{
sPlayer = SQLEncodeSpecialChars(GetPCPlayerName(oOwner));
sTag = SQLEncodeSpecialChars(GetName(oOwner));
}
else
{
sPlayer = "~";
sTag = GetTag(oOwner);
}
sVarName = SQLEncodeSpecialChars(sVarName);
string sSQL = "SELECT player FROM " + sTable + " WHERE player='" + sPlayer +
"' AND tag='" + sTag + "' AND name='" + sVarName + "'";
SQLExecDirect(sSQL);
if (SQLFetch() == SQL_SUCCESS)
{
// row exists
sSQL = "UPDATE " + sTable + " SET val=%s,expire=" + IntToString(iExpiration) +
" WHERE player='" + sPlayer + "' AND tag='" + sTag + "' AND name='" + sVarName + "'";
SetLocalString(GetModule(), "NWNX!ODBC!SETSCORCOSQL", sSQL);
StoreCampaignObject ("NWNX", "-", oObject);
}
else
{
// row doesn't exist
sSQL = "INSERT INTO " + sTable + " (player,tag,name,val,expire) VALUES" +
"('" + sPlayer + "','" + sTag + "','" + sVarName + "',%s," + IntToString(iExpiration) + ")";
SetLocalString(GetModule(), "NWNX!ODBC!SETSCORCOSQL", sSQL);
StoreCampaignObject ("NWNX", "-", oObject);
}
}
object GetPersistentObject(object oObject, string sVarName, object oOwner = OBJECT_INVALID, string sTable = "pwobjdata")
{
string sPlayer;
string sTag;
object oModule;
if (GetIsPC(oObject))
{
sPlayer = SQLEncodeSpecialChars(GetPCPlayerName(oObject));
sTag = SQLEncodeSpecialChars(GetName(oObject));
}
else
{
sPlayer = "~";
sTag = GetTag(oObject);
}
sVarName = SQLEncodeSpecialChars(sVarName);
string sSQL = "SELECT val FROM " + sTable + " WHERE player='" + sPlayer +
"' AND tag='" + sTag + "' AND name='" + sVarName + "'";
SetLocalString(GetModule(), "NWNX!ODBC!SETSCORCOSQL", sSQL);
if (!GetIsObjectValid(oOwner))
oOwner = oObject;
return RetrieveCampaignObject ("NWNX", "-", GetLocation(oOwner), oOwner);
}
void DeletePersistentVariable(object oObject, string sVarName, string sTable = "pwdata")
{
string sPlayer;
@@ -456,3 +642,52 @@ string SQLDecodeSpecialChars(string sString)
return sReturn;
}
// Gets the current REAL WORLD time, uses NWNX2
// Year-Month-Day Time
// 1997-12-15 23:50:26
string GetSQLTime();
string GetSQLTime()
{
string sSQL = "SELECT CURRENT_TIME";
SQLExecDirect(sSQL);
if(SQLFetch() == SQL_SUCCESS)
{
return SQLGetData(1);
}
else
{
return "Database error";
}
}
// Gets the current REAL WORLD date, uses NWNX2
string GetSQLDate();
string GetSQLDate()
{
string sSQL = "SELECT CURRENT_DATE";
SQLExecDirect(sSQL);
if(SQLFetch() == SQL_SUCCESS)
{
return SQLGetData(1);
}
else
{
return "Database error";
}
}
// Gets the current REAL WORLD time stamp, uses NWNX2
string GetSQLTimeStamp();
string GetSQLTimeStamp()
{
string sSQL = "SELECT CURRENT_TIMESTAMP";
SQLExecDirect(sSQL);
if(SQLFetch() == SQL_SUCCESS)
{
return SQLGetData(1);
}
else
{
return "Database error";
}
}

13
_module/nss/fuddmerch.nss Normal file
View File

@@ -0,0 +1,13 @@
#include "nw_i0_plot"
void main()
{
object oStore = GetNearestObjectByTag("FuddMerchant");
if (GetObjectType(oStore) == OBJECT_TYPE_STORE)
{
gplotAppraiseOpenStore(oStore, GetPCSpeaker());
}
else
{
ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK);
}
}

View File

@@ -12,7 +12,6 @@
//:: Created On: Nov 23, 2001
//:://////////////////////////////////////////////
#include "NW_I0_GENERIC"
#include "prc_inc_spells"
object GetNearestTougherFriend(object oSelf, object oPC) {
@@ -47,11 +46,6 @@ object GetNearestTougherFriend(object oSelf, object oPC) {
void main()
{
// * if not runnning normal or better Ai then exit for performance reasons
if (GetAILevel() == AI_LEVEL_VERY_LOW) return;
ExecuteScript("prc_npc_hb", OBJECT_SELF);
// Pausanias: monsters try to find you.
@@ -146,7 +140,7 @@ void main()
}
}
if(!PRCGetHasEffect(EFFECT_TYPE_SLEEP))
if(!GetHasEffect(EFFECT_TYPE_SLEEP))
{
if(!GetIsPostOrWalking())
{

View File

@@ -7,7 +7,7 @@
first time.
*/
//:://////////////////////////////////////////////////
#include "prc_inc_spells"
#include "nw_i0_generic"
void main()
@@ -15,8 +15,6 @@ void main()
// * if not runnning normal or better Ai then exit for performance reasons
// * if not runnning normal or better Ai then exit for performance reasons
if (GetAILevel() == AI_LEVEL_VERY_LOW) return;
ExecuteScript("prc_npc_percep", OBJECT_SELF);
object oPercep = GetLastPerceived();
int bSeen = GetLastPerceptionSeen();
@@ -74,7 +72,7 @@ void main()
{ // SpawnScriptDebugger();
//MyPrintString("GetIsEnemy: TRUE");
// We spotted an enemy and we're not already fighting
if(!PRCGetHasEffect(EFFECT_TYPE_SLEEP)) {
if(!GetHasEffect(EFFECT_TYPE_SLEEP)) {
if(GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL))
{
//MyPrintString("DetermineSpecialBehavior");
@@ -163,7 +161,6 @@ void main()
////////////////////////
// Werewolf Addon
location lTransform = GetLocation(OBJECT_SELF);
object oSelf = OBJECT_SELF;
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE,10.0,lTransform,FALSE,OBJECT_TYPE_CREATURE);
string sNPCTag = GetTag(oTarget);
string sMyTag = GetTag(OBJECT_SELF);
@@ -207,4 +204,3 @@ void main()
//Get next object.
oTarget = GetNextObjectInShape(SHAPE_SPHERE,10.0,lTransform,FALSE,OBJECT_TYPE_CREATURE);
}
}

View File

@@ -14,26 +14,7 @@
#include "NW_I0_GENERIC"
void main()
{
ExecuteScript("prc_npc_combat", OBJECT_SELF);
if (!GetLocalInt(GetModule(),"X3_NO_MOUNTED_COMBAT_FEAT"))
{ // set variables on target for mounted combat
DeleteLocalInt(OBJECT_SELF,"bX3_LAST_ATTACK_PHYSICAL");
DeleteLocalInt(OBJECT_SELF,"nX3_HP_BEFORE");
DeleteLocalInt(OBJECT_SELF,"bX3_ALREADY_MOUNTED_COMBAT");
if (GetHasFeat(FEAT_MOUNTED_COMBAT,OBJECT_SELF))
{ // check for AC increase
int nRoll=d20()+GetSkillRank(SKILL_RIDE);
nRoll=nRoll-10;
if (nRoll>4)
{ // ac increase
nRoll=nRoll/5;
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectACIncrease(nRoll),OBJECT_SELF,8.5);
} // ac increase
} // check for AC increase
} // set variables on target for mounted combat
GSC_CheckDisarcionare(OBJECT_SELF);
GSC_CheckDisarcionare(OBJECT_SELF);
if (GetIsDead(GetAttackTarget())) //see below
{ //..
ClearAllActions(); //..

View File

@@ -1,109 +1,64 @@
//:://////////////////////////////////////////////////
//::///////////////////////////////////////////////
//:: Default On Damaged
//:: NW_C2_DEFAULT6
//:: Default OnDamaged handler
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
If already fighting then ignore, else determine
combat round
*/
//:://////////////////////////////////////////////////
//:: Copyright (c) 2002 Floodgate Entertainment
//:: Created By: Naomi Novik
//:: Created On: 12/22/2002
//:://////////////////////////////////////////////////
//:://////////////////////////////////////////////////
//:: Modified By: Deva Winblood
//:: Modified On: Jan 17th, 2008
//:: Added Support for Mounted Combat Feat Support
//:://////////////////////////////////////////////////
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Oct 16, 2001
//:://////////////////////////////////////////////
#include "nw_i0_generic"
#include "x3_inc_horse"
#include "NW_I0_GENERIC"
void main()
{
ExecuteScript("prc_npc_damaged", OBJECT_SELF);
object oDamager = GetLastDamager();
object oMe=OBJECT_SELF;
int nHPBefore;
if (!GetLocalInt(GetModule(),"X3_NO_MOUNTED_COMBAT_FEAT"))
if (GetHasFeat(FEAT_MOUNTED_COMBAT)&&HorseGetIsMounted(OBJECT_SELF))
{ // see if can negate some damage
if (GetLocalInt(OBJECT_SELF,"bX3_LAST_ATTACK_PHYSICAL"))
{ // last attack was physical
nHPBefore=GetLocalInt(OBJECT_SELF,"nX3_HP_BEFORE");
if (!GetLocalInt(OBJECT_SELF,"bX3_ALREADY_MOUNTED_COMBAT"))
{ // haven't already had a chance to use this for the round
SetLocalInt(OBJECT_SELF,"bX3_ALREADY_MOUNTED_COMBAT",TRUE);
int nAttackRoll=GetBaseAttackBonus(oDamager)+d20();
int nRideCheck=GetSkillRank(SKILL_RIDE,OBJECT_SELF)+d20();
if (nRideCheck>=nAttackRoll&&!GetIsDead(OBJECT_SELF))
{ // averted attack
if (GetIsPC(oDamager)) SendMessageToPC(oDamager,GetName(OBJECT_SELF)+GetStringByStrRef(111991));
//if (GetIsPC(OBJECT_SELF)) SendMessageToPCByStrRef(OBJECT_SELF,111992");
if (GetCurrentHitPoints(OBJECT_SELF)<nHPBefore)
{ // heal
effect eHeal=EffectHeal(nHPBefore-GetCurrentHitPoints(OBJECT_SELF));
AssignCommand(GetModule(),ApplyEffectToObject(DURATION_TYPE_INSTANT,eHeal,oMe));
} // heal
} // averted attack
} // haven't already had a chance to use this for the round
} // last attack was physical
} // see if can negate some damage
if(GetFleeToExit()) {
// We're supposed to run away, do nothing
} else if (GetSpawnInCondition(NW_FLAG_SET_WARNINGS)) {
// don't do anything?
} else {
if (!GetIsObjectValid(oDamager)) {
// don't do anything, we don't have a valid damager
} else if (!GetIsFighting(OBJECT_SELF)) {
// If we're not fighting, determine combat round
if(GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL)) {
DetermineSpecialBehavior(oDamager);
} else {
if(!GetObjectSeen(oDamager)
&& GetArea(OBJECT_SELF) == GetArea(oDamager)) {
// We don't see our attacker, go find them
ActionMoveToLocation(GetLocation(oDamager), TRUE);
ActionDoCommand(DetermineCombatRound());
} else {
if(!GetFleeToExit())
{
if(!GetSpawnInCondition(NW_FLAG_SET_WARNINGS))
{
if(!GetIsObjectValid(GetAttemptedAttackTarget()) && !GetIsObjectValid(GetAttemptedSpellTarget()))
{
if(GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL))
{
DetermineSpecialBehavior(GetLastDamager());
}
else if(GetIsObjectValid(GetLastDamager()))
{
DetermineCombatRound();
if(!GetIsFighting(OBJECT_SELF))
{
object oTarget = GetLastDamager();
if(!GetObjectSeen(oTarget) && GetArea(OBJECT_SELF) == GetArea(oTarget))
{
ActionMoveToLocation(GetLocation(oTarget), TRUE);
ActionDoCommand(DetermineCombatRound());
}
}
}
}
} else {
// We are fighting already -- consider switching if we've been
// attacked by a more powerful enemy
object oTarget = GetAttackTarget();
if (!GetIsObjectValid(oTarget))
oTarget = GetAttemptedAttackTarget();
if (!GetIsObjectValid(oTarget))
oTarget = GetAttemptedSpellTarget();
// If our target isn't valid
// or our damager has just dealt us 25% or more
// of our hp in damager
// or our damager is more than 2HD more powerful than our target
// switch to attack the damager.
if (!GetIsObjectValid(oTarget)
|| (
oTarget != oDamager
&& (
GetTotalDamageDealt() > (GetMaxHitPoints(OBJECT_SELF) / 4)
|| (GetHitDice(oDamager) - 2) > GetHitDice(oTarget)
)
)
)
else if (!GetIsObjectValid(GetAttemptedSpellTarget()))
{
// Switch targets
DetermineCombatRound(oDamager);
object oTarget = GetAttackTarget();
if(!GetIsObjectValid(oTarget))
{
oTarget = GetAttemptedAttackTarget();
}
object oAttacker = GetLastHostileActor();
if (GetIsObjectValid(oAttacker) && oTarget != oAttacker && GetIsEnemy(oAttacker) &&
(GetTotalDamageDealt() > (GetMaxHitPoints(OBJECT_SELF) / 4) ||
(GetHitDice(oAttacker) - 2) > GetHitDice(oTarget) ) )
{
DetermineCombatRound(oAttacker);
}
}
}
}
// Send the user-defined event signal
if(GetSpawnInCondition(NW_FLAG_DAMAGED_EVENT))
{
SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_DAMAGED));
SignalEvent(OBJECT_SELF, EventUserDefined(1006));
}
}
}

View File

@@ -0,0 +1,32 @@
//::///////////////////////////////////////////////
//:: Default:On Death
//:: NW_C2_DEFAULT7
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Shouts to allies that they have been killed
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Oct 25, 2001
//:://////////////////////////////////////////////
#include "NW_I0_GENERIC"
void main()
{
int nClass = GetLevelByClass(CLASS_TYPE_COMMONER);
int nAlign = GetAlignmentGoodEvil(OBJECT_SELF);
if(nClass > 0 && (nAlign == ALIGNMENT_GOOD || nAlign == ALIGNMENT_NEUTRAL))
{
object oKiller = GetLastKiller();
AdjustAlignment(oKiller, ALIGNMENT_EVIL, 5);
}
SpeakString("NW_I_AM_DEAD", TALKVOLUME_SILENT_TALK);
//Shout Attack my target, only works with the On Spawn In setup
SpeakString("NW_ATTACK_MY_TARGET", TALKVOLUME_SILENT_TALK);
if(GetSpawnInCondition(NW_FLAG_DEATH_EVENT))
{
SignalEvent(GetAreaFromLocation(GetLocation(OBJECT_SELF)), EventUserDefined(1007));
}
}

View File

@@ -1,30 +1,35 @@
//:://////////////////////////////////////////////////
//::///////////////////////////////////////////////
//:: Default: On Disturbed
//:: NW_C2_DEFAULT8
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Default OnDisturbed event handler for NPCs.
*/
//:://////////////////////////////////////////////////
//:: Copyright (c) 2002 Floodgate Entertainment
//:: Created By: Naomi Novik
//:: Created On: 12/22/2002
//:://////////////////////////////////////////////////
Calls the end of combat script every round
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Oct 16, 2001
//::///////////////////////////////////////////
#include "nw_i0_generic"
// * Make me hostile the faction of my last attacker (TEMP)
// AdjustReputation(OBJECT_SELF,GetFaction(GetLastAttacker()),-100);
// * Determined Combat Round
#include "NW_I0_GENERIC"
void main()
{
ExecuteScript("prc_npc_disturb", OBJECT_SELF);
object oTarget = GetLastDisturbed();
// If we've been disturbed and are not already fighting,
// attack our disturber.
if (GetIsObjectValid(oTarget) && !GetIsFighting(OBJECT_SELF)) {
DetermineCombatRound(oTarget);
if(!GetIsObjectValid(GetAttemptedAttackTarget()) && !GetIsObjectValid(GetAttemptedSpellTarget()))
{
if(GetIsObjectValid(oTarget))
{
DetermineCombatRound(oTarget);
}
}
// Send the disturbed flag if appropriate.
if(GetSpawnInCondition(NW_FLAG_DISTURBED_EVENT)) {
SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_DISTURBED));
if(GetSpawnInCondition(NW_FLAG_DISTURBED_EVENT))
{
SignalEvent(OBJECT_SELF, EventUserDefined(1008));
}
}
}

View File

@@ -0,0 +1,337 @@
//:://////////////////////////////////////////////////
//:: NW_C2_DEFAULT9
/*
* Default OnSpawn handler with XP1 revisions.
* This corresponds to and produces the same results
* as the default OnSpawn handler in the OC.
*
* This can be used to customize creature behavior in three main ways:
*
* - Uncomment the existing lines of code to activate certain
* common desired behaviors from the moment when the creature
* spawns in.
*
* - Uncomment the user-defined event signals to cause the
* creature to fire events that you can then handle with
* a custom OnUserDefined event handler script.
*
* - Add new code _at the end_ to alter the initial
* behavior in a more customized way.
*/
//:://////////////////////////////////////////////////
//:: Copyright (c) 2002 Floodgate Entertainment
//:: Created By: Naomi Novik
//:: Created On: 12/11/2002
//:: Modified By: Sir Elric
//:: Modified On: July 20th, 2008
//:: Added Support for Sir Elric's Simple Creature Respawns
//:://////////////////////////////////////////////////
//:: Updated 2003-08-20 Georg Zoeller: Added check for variables to active spawn in conditions without changing the spawnscript
#include "x0_i0_anims"
// #include "x0_i0_walkway" - in x0_i0_anims
#include "x0_i0_treasure"
#include "x2_inc_switches"
void main()
{
// ***** Spawn-In Conditions ***** //
ExecuteScript("spawn_rand_stats", OBJECT_SELF);
//ExecuteScript("wotr_npc_onspawn", OBJECT_SELF);
// * REMOVE COMMENTS (// ) before the "Set..." functions to activate
// * them. Do NOT touch lines commented out with // *, those are
// * real comments for information.
// * This causes the creature to say a one-line greeting in their
// * conversation file upon perceiving the player. Put [NW_D2_GenCheck]
// * in the "Text Seen When" field of the greeting in the conversation
// * file. Don't attach any player responses.
// *
// SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION);
// * Same as above, but for hostile creatures to make them say
// * a line before attacking.
// *
// SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION);
// * This NPC will attack when its allies call for help
// *
// SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET);
// * If the NPC has the Hide skill they will go into stealth mode
// * while doing WalkWayPoints().
// *
// SetSpawnInCondition(NW_FLAG_STEALTH);
//--------------------------------------------------------------------------
// Enable stealth mode by setting a variable on the creature
// Great for ambushes
// See x2_inc_switches for more information about this
//--------------------------------------------------------------------------
if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_USE_SPAWN_STEALTH) == TRUE)
{
SetSpawnInCondition(NW_FLAG_STEALTH);
}
// * Same, but for Search mode
// *
// SetSpawnInCondition(NW_FLAG_SEARCH);
//--------------------------------------------------------------------------
// Make creature enter search mode after spawning by setting a variable
// Great for guards, etc
// See x2_inc_switches for more information about this
//--------------------------------------------------------------------------
if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_USE_SPAWN_SEARCH) == TRUE)
{
SetSpawnInCondition(NW_FLAG_SEARCH);
}
// * This will set the NPC to give a warning to non-enemies
// * before attacking.
// * NN -- no clue what this really does yet
// *
// SetSpawnInCondition(NW_FLAG_SET_WARNINGS);
// * Separate the NPC's waypoints into day & night.
// * See comment on WalkWayPoints() for use.
// *
// SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING);
// * If this is set, the NPC will appear using the "EffectAppear"
// * animation instead of fading in, *IF* SetListeningPatterns()
// * is called below.
// *
//SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION);
// * This will cause an NPC to use common animations it possesses,
// * and use social ones to any other nearby friendly NPCs.
// *
// SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
//--------------------------------------------------------------------------
// Enable immobile ambient animations by setting a variable
// See x2_inc_switches for more information about this
//--------------------------------------------------------------------------
if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_USE_SPAWN_AMBIENT_IMMOBILE) == TRUE)
{
SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
}
// * Same as above, except NPC will wander randomly around the
// * area.
// *
SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
//--------------------------------------------------------------------------
// Enable mobile ambient animations by setting a variable
// See x2_inc_switches for more information about this
//--------------------------------------------------------------------------
if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_USE_SPAWN_AMBIENT) == TRUE)
{
SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
}
// **** Animation Conditions **** //
// * These are extra conditions you can put on creatures with ambient
// * animations.
// * Civilized creatures interact with placeables in
// * their area that have the tag "NW_INTERACTIVE"
// * and "talk" to each other.
// *
// * Humanoid races are civilized by default, so only
// * set this flag for monster races that you want to
// * behave the same way.
// SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
// * If this flag is set, this creature will constantly
// * be acting. Otherwise, creatures will only start
// * performing their ambient animations when they
// * first perceive a player, and they will stop when
// * the player moves away.
SetAnimationCondition(NW_ANIM_FLAG_CONSTANT);
// * Civilized creatures with this flag set will
// * randomly use a few voicechats. It's a good
// * idea to avoid putting this on multiple
// * creatures using the same voiceset.
// SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
// * Creatures with _immobile_ ambient animations
// * can have this flag set to make them mobile in a
// * close range. They will never leave their immediate
// * area, but will move around in it, frequently
// * returning to their starting point.
// *
// * Note that creatures spawned inside interior areas
// * that contain a waypoint with one of the tags
// * "NW_HOME", "NW_TAVERN", "NW_SHOP" will automatically
// * have this condition set.
// SetAnimationCondition(NW_ANIM_FLAG_IS_MOBILE_CLOSE_RANGE);
// **** Special Combat Tactics *****//
// * These are special flags that can be set on creatures to
// * make them follow certain specialized combat tactics.
// * NOTE: ONLY ONE OF THESE SHOULD BE SET ON A SINGLE CREATURE.
// * Ranged attacker
// * Will attempt to stay at ranged distance from their
// * target.
// SetCombatCondition(X0_COMBAT_FLAG_RANGED);
// * Defensive attacker
// * Will use defensive combat feats and parry
// SetCombatCondition(X0_COMBAT_FLAG_DEFENSIVE);
// * Ambusher
// * Will go stealthy/invisible and attack, then
// * run away and try to go stealthy again before
// * attacking anew.
// SetCombatCondition(X0_COMBAT_FLAG_AMBUSHER);
// * Cowardly
// * Cowardly creatures will attempt to flee
// * attackers.
// SetCombatCondition(X0_COMBAT_FLAG_COWARDLY);
// **** Escape Commands ***** //
// * NOTE: ONLY ONE OF THE FOLLOWING SHOULD EVER BE SET AT ONE TIME.
// * NOTE2: Not clear that these actually work. -- NN
// * Flee to a way point and return a short time later.
// *
// SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN);
// * Flee to a way point and do not return.
// *
// SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE);
// * Teleport to safety and do not return.
// *
// SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE);
// * Teleport to safety and return a short time later.
// *
// SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN);
// ***** CUSTOM USER DEFINED EVENTS ***** /
/*
If you uncomment any of these conditions, the creature will fire
a specific user-defined event number on each event. That will then
allow you to write custom code in the "OnUserDefinedEvent" handler
script to go on top of the default NPC behaviors for that event.
Example: I want to add some custom behavior to my NPC when they
are damaged. I uncomment the "NW_FLAG_DAMAGED_EVENT", then create
a new user-defined script that has something like this in it:
if (GetUserDefinedEventNumber() == 1006) {
// Custom code for my NPC to execute when it's damaged
}
These user-defined events are in the range 1001-1007.
*/
// * Fire User Defined Event 1001 in the OnHeartbeat
// *
// SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT);
// * Fire User Defined Event 1002
// *
// SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT);
// * Fire User Defined Event 1005
// *
// SetSpawnInCondition(NW_FLAG_ATTACK_EVENT);
// * Fire User Defined Event 1006
// *
// SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT);
// * Fire User Defined Event 1008
// *
// SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT);
// * Fire User Defined Event 1003
// *
// SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT);
// * Fire User Defined Event 1004
// *
// SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT);
// ***** DEFAULT GENERIC BEHAVIOR (DO NOT TOUCH) ***** //
// * Goes through and sets up which shouts the NPC will listen to.
// *
SetListeningPatterns();
// * Walk among a set of waypoints.
// * 1. Find waypoints with the tag "WP_" + NPC TAG + "_##" and walk
// * among them in order.
// * 2. If the tag of the Way Point is "POST_" + NPC TAG, stay there
// * and return to it after combat.
//
// * Optional Parameters:
// * void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
//
// * If "NW_FLAG_DAY_NIGHT_POSTING" is set above, you can also
// * create waypoints with the tags "WN_" + NPC Tag + "_##"
// * and those will be walked at night. (The standard waypoints
// * will be walked during the day.)
// * The night "posting" waypoint tag is simply "NIGHT_" + NPC tag.
WalkWayPoints();
//* Create a small amount of treasure on the creature
//if ((GetLocalInt(GetModule(), "X2_L_NOTREASURE") == FALSE) &&
// (GetLocalInt(OBJECT_SELF, "X2_L_NOTREASURE") == FALSE) )
//{
// CTG_GenerateNPCTreasure(TREASURE_TYPE_MONSTER, OBJECT_SELF);
//}
// ***** ADD ANY SPECIAL ON-SPAWN CODE HERE ***** //
// -----------------------------------------------------------------------------
// Sir Elric's Simple Creature Respawns additions - SE v1.9
// -----------------------------------------------------------------------------
SetLocalLocation(OBJECT_SELF, "spawn", GetLocation(OBJECT_SELF));
// Set as original placed mobs...
if(!GetLocalInt(GetModule(), "ORIGINAL_PLACED_MOBS"))
{
SetLocalInt(OBJECT_SELF, "PLACED", 1);
}
// * If Incorporeal, apply changes
if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_IS_INCORPOREAL) == TRUE)
{
effect eConceal = EffectConcealment(50, MISS_CHANCE_TYPE_NORMAL);
eConceal = ExtraordinaryEffect(eConceal);
effect eGhost = EffectCutsceneGhost();
eGhost = ExtraordinaryEffect(eGhost);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eConceal, OBJECT_SELF);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eGhost, OBJECT_SELF);
}
// * Give the create a random name.
// * If you create a script named x3_name_gen in your module, you can
// * set the value of the variable X3_S_RANDOM_NAME on OBJECT_SELF inside
// * the script to override the creature's default name.
if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_RANDOMIZE_NAME) == TRUE)
{
ExecuteScript("x3_name_gen",OBJECT_SELF);
string sName = GetLocalString(OBJECT_SELF,"X3_S_RANDOM_NAME");
if ( sName == "" )
{
sName = RandomName();
}
SetName(OBJECT_SELF,sName);
}
}

View File

@@ -0,0 +1,420 @@
#include "g_common"
////////////////////////////////////////////////////////////////////////////////
// Functions List //////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
void EventHandler_Animal_Predator_UD(int iEventID);
void EventHandler_Animal_Prey_UD(int iEventID);
void EventHandler_Beast_SoulRender_UD(int iEventID);
void EventHandler_Default_UD(int iEventID);
void EventHandler_Giant_Troll_UD(int iEventID);
void EventHandler_Undead_Zombie_UD(int iEventID);
void DoZombieSpeak();
////////////////////////////////////////////////////////////////////////////////
// Function Definitions ////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
void main() {
int iEventID = GetUserDefinedEventNumber();
////////////////////////////////////////////////////////////////////////////
// Switch to the 'OnUserDefined' code for the correct creature /////////////
////////////////////////////////////////////////////////////////////////////
// Animals
if (Object_IsClassAndRace(CLASS_TYPE_ANIMAL, OBJECT_SELF, TRUE)) {
if (Object_IsPrey()) EventHandler_Animal_Prey_UD(iEventID); // Prey Items
else EventHandler_Animal_Predator_UD(iEventID); // Predators
}
// Soul Renders
if (Object_IsClassAndRace(CLASS_TYPE_BEAST, OBJECT_SELF, FALSE, "soul render")) {
EventHandler_Beast_SoulRender_UD(iEventID);
}
// Trolls
if (Object_IsClassAndRace(CLASS_TYPE_GIANT, OBJECT_SELF, FALSE, "troll")) {
EventHandler_Giant_Troll_UD(iEventID);
}
// Zombies
if (Object_IsClassAndRace(CLASS_TYPE_UNDEAD, OBJECT_SELF, FALSE, "zombie")) {
EventHandler_Undead_Zombie_UD(iEventID);
}
// Default Handler
EventHandler_Default_UD(iEventID);
}
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Animal - Predator Event Handler function
////////////////////////////////////////////////////////////////////////////////
void EventHandler_Animal_Predator_UD(int iEventID) {
int iCurrentHP = GetCurrentHitPoints();
int iMaximumHP = GetMaxHitPoints();
int iThreshold = FloatToInt(0.45 * IntToFloat(iMaximumHP));
int iFlockRoll = d8(3);
if(iEventID == 1001) { //HEARTBEAT
// React to PC's
object oNoticed = GetLocalObject(OBJECT_SELF, "oNoticed");
if (GetIsObjectValid(oNoticed)) {
float fDist = GetDistanceToObject(oNoticed);
// Flee from PC if not strong enough to fight
if ((fDist <= 30.0) && (iCurrentHP < iThreshold) && GetObjectSeen(oNoticed)) {
ClearAllActions();
AssignCommand(OBJECT_SELF, ActionMoveAwayFromObject(oNoticed, TRUE));
return;
}
// Walk randomly if PC is far enough away not to be a bother
if (fDist >= 27.0) {
SetLocalObject(OBJECT_SELF, "oNoticed", OBJECT_INVALID);
AssignCommand(OBJECT_SELF, ClearAllActions());
AssignCommand(OBJECT_SELF, ActionRandomWalk());
return;
}
// Attack if PC gets too close and we're healthy enough!
if ((fDist <= 12.0) && (iCurrentHP > iThreshold)) {
if (!GetIsInCombat()) {
AssignCommand(OBJECT_SELF, ClearAllActions());
AssignCommand(OBJECT_SELF, ActionAttack(oNoticed));
return;
}
}
}
}
else if(iEventID == 1002) { // PERCEIVE
object oNoticed = GetLastPerceived();
if(GetIsObjectValid(oNoticed)) {
// Did animal notice a PC?
if ((GetLastPerceptionSeen() || GetLastPerceptionHeard()) && GetIsPC(oNoticed)) {
// Do not take aggression against Rangers, Druids, or Elves
if ( !(GetLevelByClass(CLASS_TYPE_RANGER, oNoticed) > 1) &&
!(GetLevelByClass(CLASS_TYPE_DRUID, oNoticed) > 1) &&
(GetRacialType(oNoticed) != RACIAL_TYPE_ELF)) {
SetLocalObject(OBJECT_SELF, "oNoticed", oNoticed);
}
}
}
}
else if(iEventID == 1003) { // END OF COMBAT
}
else if(iEventID == 1004) { // ON DIALOGUE
}
else if(iEventID == 1005) { // ATTACKED
if (!GetIsInCombat()) {
ClearAllActions();
AssignCommand(OBJECT_SELF, ActionAttack(GetLastAttacker()));
}
}
else if(iEventID == 1006) { // DAMAGED
if (iCurrentHP <= iThreshold) { // Run away if too much damage was done
object oDamager = GetLastDamager();
SetLocalObject(OBJECT_SELF, "oNoticed", oDamager);
ClearAllActions();
SurrenderToEnemies();
ClearPersonalReputation(oDamager);
AssignCommand(OBJECT_SELF, ActionMoveAwayFromObject(oDamager, TRUE));
DelayCommand(8.0, SetLocalObject(OBJECT_SELF, "oNoticed", OBJECT_INVALID));
}
}
else if(iEventID == 1007) { // DEATH
Treasure_Death_PlaceBodyParts();
// Respawn_ByResrefWithDelay(OBJECT_SELF, 1200.0 + IntToFloat(Random(450)));
}
else if(iEventID == 1008) { // DISTURBED
}
}
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Animal - Prey Event Handler function
////////////////////////////////////////////////////////////////////////////////
void EventHandler_Animal_Prey_UD(int iEventID) {
int iCurrentHP = GetCurrentHitPoints();
int iMaximumHP = GetMaxHitPoints();
int iThreshold = FloatToInt(0.45 * IntToFloat(iMaximumHP));
if(iEventID == 1001) { //HEARTBEAT
object oNoticed = GetLocalObject(OBJECT_SELF, "oNoticed");
if (GetIsObjectValid(oNoticed)) {
float fDist = GetDistanceToObject(oNoticed);
if (fDist < 20.0 && GetObjectSeen(oNoticed)) { ActionMoveAwayFromObject(oNoticed, TRUE, 30.0); return; }
if (fDist >= 20.0 && fDist <= 40.0) { if (Random(100) >= 15) ActionMoveAwayFromObject(oNoticed, FALSE, 30.0); return; }
if (fDist > 40.0) { SetLocalObject(OBJECT_SELF, "oNoticed", OBJECT_INVALID); return; }
}
else {
SetLocalObject(OBJECT_SELF, "oNoticed", OBJECT_INVALID);
// Do some flocking behaviour
int iHowMany = Object_CountSameAtLocation(OBJECT_SELF, GetLocation(OBJECT_SELF), 2.0);
int iTooMany;
int iSize = GetCreatureSize(OBJECT_SELF);
if (iSize == CREATURE_SIZE_HUGE) iTooMany = 2;
if (iSize == CREATURE_SIZE_LARGE) iTooMany = 3;
if (iSize == CREATURE_SIZE_MEDIUM) iTooMany = 4;
if (iSize == CREATURE_SIZE_SMALL) iTooMany = 6;
if (iSize == CREATURE_SIZE_TINY) iTooMany = 9;
if (iHowMany >= iTooMany) {
ActionForceMoveToRandomLocation(OBJECT_SELF, 20.0, 20.0, Random(3));
}
else AI_Movement_FlockTypeB();
}
}
else if(iEventID == 1002) { // PERCEIVE
object oNoticed = GetLastPerceived();
if(GetIsObjectValid(oNoticed)) {
// Did animal notice another animal?
string strNoticed = GetTag(oNoticed);
if (GetTag(OBJECT_SELF) != strNoticed) {
SetLocalObject(OBJECT_SELF, "oNoticed", oNoticed);
ActionMoveAwayFromObject(oNoticed, FALSE); // Move away from it
}
}
}
else if(iEventID == 1003) { // END OF COMBAT
}
else if(iEventID == 1004) { // ON DIALOGUE
}
else if(iEventID == 1005) { // ATTACKED
if (!GetIsInCombat()) {
ClearAllActions();
if (Random(100) >=60) AssignCommand(OBJECT_SELF, ActionAttack(GetLastAttacker()));
else ActionMoveAwayFromObject(GetLastAttacker(), TRUE);
}
}
else if(iEventID == 1006) { // DAMAGED
if (iCurrentHP <= iThreshold) { // Run away if too much damage was done
object oDamager = GetLastDamager();
SetLocalObject(OBJECT_SELF, "oNoticed", oDamager);
ClearAllActions();
SurrenderToEnemies();
ClearPersonalReputation(oDamager);
AssignCommand(OBJECT_SELF, ActionMoveAwayFromObject(oDamager, TRUE));
DelayCommand(8.0, SetLocalObject(OBJECT_SELF, "oNoticed", OBJECT_INVALID));
}
}
else if(iEventID == 1007) { // DEATH
Treasure_Death_PlaceBodyParts();
// Respawn_ByResrefWithDelay(OBJECT_SELF, 1200.0 + IntToFloat(Random(450)));
}
else if(iEventID == 1008) { // DISTURBED
}
}
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Default event handler for those creatures who did not get one previously
////////////////////////////////////////////////////////////////////////////////
void EventHandler_Default_UD(int iEventID) {
if(iEventID == 1001) { //HEARTBEAT
}
else if(iEventID == 1002) {// PERCEIVE
}
else if(iEventID == 1003) { // END OF COMBAT
}
else if(iEventID == 1004) { // ON DIALOGUE
}
else if(iEventID == 1005) { // ATTACKED
}
else if(iEventID == 1006) { // DAMAGED
}
else if(iEventID == 1007) { // DEATH
Treasure_Death_PlaceBodyParts();
}
else if(iEventID == 1008) { // DISTURBED
}
}
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Soul Render Event Handler function /////////////////////////////////////////
// v1.00 ///////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// The Event Handler for the Soul Render is fairly intensive as it utilizes an object search
// inside the heartbeat - keep this creature by itself!
void EventHandler_Beast_SoulRender_UD(int iEventID) {
// If in combat, examine nearby enemies for Negative Level Effects.
// If found, then remove the drain, and select a Skill or Ability
// Drain and apply it to the PC while applying the opposite effect
// to the beast.
if(iEventID == 1001) { //HEARTBEAT
// Play horrifying sounds, just cause a soul-sucker isn't creepy enough without them...
if (d100() < 20) {
int iRand = d4();
if (iRand == 1) { AssignCommand(OBJECT_SELF, PlaySound("c_beastbrth")); }
if (iRand == 2) { AssignCommand(OBJECT_SELF, PlaySound("c_beastmoan")); }
if (iRand == 3) { AssignCommand(OBJECT_SELF, PlaySound("c_beastroar")); }
if (iRand == 4) { AssignCommand(OBJECT_SELF, PlaySound("c_beastsigh")); }
}
// SUCK SOULS!
if (GetIsInCombat()) {
// Search for nearby PC's with level drains
string strResult;
object oPC = GetFirstObjectInShape(SHAPE_SPHERE, 5.0, GetLocation(OBJECT_SELF), FALSE, OBJECT_TYPE_CREATURE);
// Determine if the Render has sucked spell memories... chuck them back!
string strAbsorbedSpells = GetLocalString(OBJECT_SELF, "strAbsorbedSpells");
if (Array_GetTotalElements(strAbsorbedSpells) && (d20() < GetAbilityScore(OBJECT_SELF, ABILITY_INTELLIGENCE) )) {
Effect_DischargeAbsorbedSpell(OBJECT_SELF);
}
// Suck some souls!!!
while (GetIsObjectValid(oPC)) {
if (GetHasEffect(EFFECT_TYPE_NEGATIVELEVEL, oPC)) {
effect eFX = GetFirstEffect(oPC);
while (GetIsEffectValid(eFX)) {
if (GetEffectType(eFX) == EFFECT_TYPE_NEGATIVELEVEL) {
if (GetEffectCreator(eFX) == OBJECT_SELF) {
RemoveEffect(oPC, eFX);
strResult = "";
int iRoll = d20(2);
// If the PC is a spell caster, then allow the Render to absorb spells as well
if (GetLevelByClass(CLASS_TYPE_CLERIC, oPC) ||
GetLevelByClass(CLASS_TYPE_DRUID, oPC) ||
GetLevelByClass(CLASS_TYPE_WIZARD, oPC) ||
GetLevelByClass(CLASS_TYPE_SORCERER, oPC)) iRoll += d10();
// Should I suck hitpoints?!
if (GetCurrentHitPoints() < 200) {
Effect_AbsorbHitPoints(OBJECT_SELF, oPC);
}
// If there was some indecision, randomly decide what to SUCK!
if (iRoll < 10) { strResult = Effect_AbsorbRandomAbility(OBJECT_SELF, oPC); } // Absorb an Ability
else if (iRoll < 18) { strResult = Effect_AbsorbRandomSavingThrow(OBJECT_SELF, oPC); } // Absorb a saving throw
else if (iRoll < 24) { strResult = Effect_AbsorbHitPoints(OBJECT_SELF, oPC); } // Absorb some of the PC's HP's
else if (iRoll < 30) { strResult = Effect_AbsorbAbility(OBJECT_SELF, oPC, ABILITY_STRENGTH); }
else if (iRoll < 33) { strResult = Effect_AbsorbAbility(OBJECT_SELF, oPC, ABILITY_DEXTERITY); }
else if (iRoll < 40) { strResult = Effect_AbsorbAbility(OBJECT_SELF, oPC, ABILITY_CONSTITUTION); }
else if (iRoll < 50) { strResult = Effect_AbsorbSpellMemory(OBJECT_SELF, oPC); }
if (GetStringLength(strResult) > 0) SendMessageToPC(oPC, "Soul Render " + strResult);
}
}
eFX = GetNextEffect(oPC);
} // end while (GetIsEffectValid(eFX))
}
oPC = GetNextObjectInShape(SHAPE_SPHERE, 5.0, GetLocation(OBJECT_SELF), FALSE, OBJECT_TYPE_CREATURE);
} // end while (GetIsObjectValid(oPC))
}
} // END of HEARTBEAT
}
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Troll Event Handler function ///////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
void EventHandler_Giant_Troll_UD(int iEventID) {
object oAttacker = GetLastHostileActor();
object oSeen;
if(iEventID == 1001) { //HEARTBEAT
}
else if(iEventID == 1002) {// PERCEIVE
}
else if(iEventID == 1003) { // END OF COMBAT
}
else if(iEventID == 1004) { // ON DIALOGUE
}
else if(iEventID == 1005) { // ATTACKED
}
else if(iEventID == 1006) { // DAMAGED
Object_CheckDamageVsResistances(20, 10, 25, (4.0 + IntToFloat(d6())), 33);
}
else if(iEventID == 1007) { // DEATH
Treasure_Death_PlaceBodyParts();
}
else if(iEventID == 1008) { // DISTURBED
}
}
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Zombie Event Handler function ////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
void EventHandler_Undead_Zombie_UD(int iEventID) {
object oAttacker = GetLastHostileActor();
object oSeen;
if(iEventID == 1001) { //HEARTBEAT
}
else if(iEventID == 1002) {// PERCEIVE
// If a player is perceived with sight say something freaky
oSeen = GetLastPerceived();
if (GetIsPC(oSeen)) DoZombieSpeak();
}
else if(iEventID == 1003) { // END OF COMBAT
}
else if(iEventID == 1004) { // ON DIALOGUE
}
else if(iEventID == 1005) { // ATTACKED
}
else if(iEventID == 1006) { // DAMAGED
Object_CheckDamageVsResistances(20, 10, 25, (4.0 + IntToFloat(d6())), 41);
}
else if(iEventID == 1007) { // DEATH
Treasure_Death_PlaceBodyParts();
}
else if(iEventID == 1008) { // DISTURBED
}
}
void DoZombieSpeak() {
int nRandom = Random(6);
ClearAllActions();
string strSpeach;
if (nRandom == 0) strSpeach = "dead by dawn... dead by dawn...";
if (nRandom == 1) strSpeach = "I'll swallow your soul!";
if (nRandom == 2) strSpeach = "brrraaains...";
if (nRandom == 3) strSpeach = "dead by dawn... dead by dawn...";
if (nRandom == 4) strSpeach = "Dead by dawn!!";
if (nRandom == 5) strSpeach = "We want what you have... life...";
AssignCommand(OBJECT_SELF, ActionSpeakString(strSpeach));
AssignCommand(OBJECT_SELF, ActionAttack(GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC)));
}
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////////////////////////

View File

@@ -0,0 +1,857 @@
//::///////////////////////////////////////////////
//:: Spells Include
//:: NW_I0_SPELLS
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 2, 2002
//:: Updated By: 2003/20/10 Georg Zoeller
//:://////////////////////////////////////////////
// GZ: Number of spells in GetSpellBreachProtections
const int NW_I0_SPELLS_MAX_BREACH = 33;
// * Function for doing electrical traps
void TrapDoElectricalDamage(int ngDamageMaster, int nSaveDC, int nSecondary);
// * Used to route the resist magic checks into this function to check for spell countering by SR, Globes or Mantles.
// Return value if oCaster or oTarget is an invalid object: FALSE
// Return value if spell cast is not a player spell: - 1
// Return value if spell resisted: 1
// Return value if spell resisted via magic immunity: 2
// Return value if spell resisted via spell absorption: 3
int MyResistSpell(object oCaster, object oTarget, float fDelay = 0.0);
// * Used to route the saving throws through this function to check for spell countering by a saving throw.
// Returns: 0 if the saving throw roll failed
// Returns: 1 if the saving throw roll succeeded
// Returns: 2 if the target was immune to the save type specified
// Note: If used within an Area of Effect Object Script (On Enter, OnExit, OnHeartbeat), you MUST pass
// GetAreaOfEffectCreator() into oSaveVersus!! \
int MySavingThrow(int nSavingThrow, object oTarget, int nDC, int nSaveType=SAVING_THROW_TYPE_NONE, object oSaveVersus = OBJECT_SELF, float fDelay = 0.0);
// * Will pass back a linked effect for all the protection from alignment spells. The power represents the multiplier of strength.
// * That is instead of +3 AC and +2 Saves a power of 2 will yield +6 AC and +4 Saves.
effect CreateProtectionFromAlignmentLink(int nAlignment, int nPower = 1);
// * Will pass back a linked effect for all of the doom effects.
effect CreateDoomEffectsLink();
// * Searchs through a persons effects and removes those from a particular spell by a particular caster.
void RemoveSpellEffects(int nSpell_ID, object oCaster, object oTarget);
// * Searchs through a persons effects and removes all those of a specific type.
void RemoveSpecificEffect(int nEffectTypeID, object oTarget);
// * Returns the time in seconds that the effect should be delayed before application.
float GetSpellEffectDelay(location SpellTargetLocation, object oTarget);
// * This allows the application of a random delay to effects based on time parameters passed in. Min default = 0.4, Max default = 1.1
float GetRandomDelay(float fMinimumTime = 0.4, float MaximumTime = 1.1);
// * Get Difficulty Duration
int GetScaledDuration(int nActualDuration, object oTarget);
// * Get Scaled Effect
effect GetScaledEffect(effect eStandard, object oTarget);
// * Remove all spell protections of a specific type
int RemoveProtections(int nSpell_ID, object oTarget, int nCount);
// * Performs a spell breach up to nTotal spells are removed and nSR spell
// * resistance is lowered.
int GetSpellBreachProtection(int nLastChecked);
//* Assigns a debug string to the Area of Effect Creator
void AssignAOEDebugString(string sString);
// * Plays a random dragon battlecry based on age.
void PlayDragonBattleCry();
// * Returns true if Target is a humanoid
int AmIAHumanoid(object oTarget);
// * Performs a spell breach up to nTotal spell are removed and
// * nSR spell resistance is lowered. nSpellId can be used to override
// * the originating spell ID. If not specified, SPELL_GREATER_SPELL_BREACH
// * is used
void DoSpellBreach(object oTarget, int nTotal, int nSR, int nSpellId = -1);
// * Returns true if Target is a humanoid
int AmIAHumanoid(object oTarget)
{
int nRacial = GetRacialType(oTarget);
if((nRacial == RACIAL_TYPE_DWARF) ||
(nRacial == RACIAL_TYPE_HALFELF) ||
(nRacial == RACIAL_TYPE_HALFORC) ||
(nRacial == RACIAL_TYPE_ELF) ||
(nRacial == RACIAL_TYPE_GNOME) ||
(nRacial == RACIAL_TYPE_HUMANOID_GOBLINOID) ||
(nRacial == RACIAL_TYPE_HALFLING) ||
(nRacial == RACIAL_TYPE_HUMAN) ||
(nRacial == RACIAL_TYPE_HUMANOID_MONSTROUS) ||
(nRacial == RACIAL_TYPE_HUMANOID_ORC) ||
(nRacial == RACIAL_TYPE_HUMANOID_REPTILIAN))
{
return TRUE;
}
return FALSE;
}
//::///////////////////////////////////////////////
//:: spellsCure
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Used by the 'cure' series of spells.
Will do max heal/damage if at normal or low
difficulty.
Random rolls occur at higher difficulties.
*/
//:://////////////////////////////////////////////
//:: Created By:
//:: Created On:
//:://////////////////////////////////////////////
void spellsCure(int nDamage, int nMaxExtraDamage, int nMaximized, int vfx_impactHurt, int vfx_impactHeal, int nSpellID)
{
//Declare major variables
object oTarget = GetSpellTargetObject();
int nHeal;
int nMetaMagic = GetMetaMagicFeat();
effect eVis = EffectVisualEffect(vfx_impactHurt);
effect eVis2 = EffectVisualEffect(vfx_impactHeal);
effect eHeal, eDam;
PrintString("nw_i0_spells: spellsCure() called");
int nExtraDamage = GetCasterLevel(OBJECT_SELF); // * figure out the bonus damage
if (nExtraDamage > nMaxExtraDamage)
{
nExtraDamage = nMaxExtraDamage;
}
// * if low or normal difficulty is treated as MAXIMIZED
if(GetIsPC(oTarget) && GetGameDifficulty() < GAME_DIFFICULTY_CORE_RULES)
{
nDamage = nMaximized + nExtraDamage;
}
else
{
nDamage = nDamage + nExtraDamage;
}
//Make metamagic checks
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDamage = 8 + nExtraDamage;
// * if low or normal difficulty then MAXMIZED is doubled.
if(GetIsPC(OBJECT_SELF) && GetGameDifficulty() < GAME_DIFFICULTY_CORE_RULES)
{
nDamage = nDamage + nExtraDamage;
}
}
if (nMetaMagic == METAMAGIC_EMPOWER || GetHasFeat(FEAT_HEALING_DOMAIN_POWER))
{
nDamage = nDamage + (nDamage/2);
}
PrintString("nw_i0_spells: RACE["+IntToString(GetRacialType(oTarget))+"] SUBRACE["+GetSubRace(oTarget)+"] NAME["+GetName(oTarget)+"]");
if ((GetRacialType(oTarget) == RACIAL_TYPE_UNDEAD)||(GetSubRace(oTarget)=="Vampire"))
{
PrintString("nw_i0_spells: NAME["+GetName(oTarget)+"] was undead or Vampire.");
int nTouch = TouchAttackMelee(oTarget);
if (nTouch > 0)
{
PrintString("nw_i0_spells: NAME["+GetName(oTarget)+"] was HIT.");
if(!GetIsReactionTypeFriendly(oTarget))
{
PrintString("nw_i0_spells: NAME["+GetName(oTarget)+"] is not friendly with the attacker.");
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, nSpellID));
if (!MyResistSpell(OBJECT_SELF, oTarget))
{
PrintString("nw_i0_spells: NAME["+GetName(oTarget)+"] did not resist the spell attack.");
eDam = EffectDamage(nDamage,DAMAGE_TYPE_NEGATIVE);
//Apply the VFX impact and effects
DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
}
}
//Check that the target is undead
else
{
PrintString("nw_i0_spells: NAME["+GetName(oTarget)+"] was NOT undead or Vampire.");
//Figure out the amount of damage to heal
nHeal = nDamage;
//Set the heal effect
eHeal = EffectHeal(nHeal);
//Apply heal effect and VFX impact
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, nSpellID, FALSE));
}
}
//::///////////////////////////////////////////////
//:: DoSpelLBreach
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Performs a spell breach up to nTotal spells
are removed and nSR spell resistance is
lowered.
*/
//:://////////////////////////////////////////////
//:: Created By: Brent
//:: Created On: September 2002
//:: Modified : Georg, Oct 31, 2003
//:://////////////////////////////////////////////
void DoSpellBreach(object oTarget, int nTotal, int nSR, int nSpellId = -1)
{
if (nSpellId == -1)
{
nSpellId = SPELL_GREATER_SPELL_BREACH;
}
effect eSR = EffectSpellResistanceDecrease(nSR);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eVis = EffectVisualEffect(VFX_IMP_BREACH);
int nCnt, nIdx;
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, nSpellId ));
//Search through and remove protections.
while(nCnt <= NW_I0_SPELLS_MAX_BREACH && nIdx < nTotal)
{
nIdx = nIdx + RemoveProtections(GetSpellBreachProtection(nCnt), oTarget, nCnt);
nCnt++;
}
effect eLink = EffectLinkEffects(eDur, eSR);
//--------------------------------------------------------------------------
// This can not be dispelled
//--------------------------------------------------------------------------
eLink = ExtraordinaryEffect(eLink);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(10));
}
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
//::///////////////////////////////////////////////
//:: GetDragonFearDC
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Adding a function, we were using two different
sets of numbers before. Standardizing it to be
closer to 3e.
nAge - hit dice
*/
//:://////////////////////////////////////////////
//:: Created By: Brent
//:: Created On: Sep 13, 2002
//:://////////////////////////////////////////////
int GetDragonFearDC(int nAge)
{
//hmm... not sure what's up with all these nCount variables, they're not
//actually used... so I'm gonna comment them out
int nDC = 13;
// int nCount = 1;
//Determine the duration and save DC
//wyrmling meant no change from default, so we don't need it
/*
if (nAge <= 6) //Wyrmling
{
nDC = 13;
nCount = 1;
}
else
*/
if (nAge >= 7 && nAge <= 9) //Very Young
{
nDC = 15;
// nCount = 2;
}
else if (/*nAge >= 10 &&*/ nAge <= 12) //Young
{
nDC = 17;
// nCount = 3;
}
else if (/*nAge >= 13 &&*/ nAge <= 15) //Juvenile
{
nDC = 19;
// nCount = 4;
}
else if (/*nAge >= 16 &&*/ nAge <= 18) //Young Adult
{
nDC = 21;
// nCount = 5;
}
else if (/*nAge >= 19 &&*/ nAge <= 21) //Adult
{
nDC = 24;
// nCount = 6;
}
else if (/*nAge >= 22 &&*/ nAge <= 24) //Mature Adult
{
nDC = 27;
// nCount = 7;
}
else if (/*nAge >= 25 &&*/ nAge <= 27) //Old
{
nDC = 28;
// nCount = 8;
}
else if (/*nAge >= 28 &&*/ nAge <= 30) //Very Old
{
nDC = 30;
// nCount = 9;
}
else if (/*nAge >= 31 &&*/ nAge <= 33) //Ancient
{
nDC = 32;
// nCount = 10;
}
else if (/*nAge >= 34 &&*/ nAge <= 37) //Wyrm
{
nDC = 34;
// nCount = 11;
}
else if (nAge > 37) //Great Wyrm
{
nDC = 37;
// nCount = 12;
}
return nDC;
}
//------------------------------------------------------------------------------
// Kovi function: calculates the appropriate base number of attacks
// for spells that increase this (tensers, divine power)
//------------------------------------------------------------------------------
int CalcNumberOfAttacks()
{
int n = GetCasterLevel(OBJECT_SELF);
int nBAB1 = GetLevelByClass(CLASS_TYPE_RANGER)
+ GetLevelByClass(CLASS_TYPE_FIGHTER)
+ GetLevelByClass(CLASS_TYPE_PALADIN)
+ GetLevelByClass(CLASS_TYPE_BARBARIAN);
int nBAB2 = GetLevelByClass(CLASS_TYPE_DRUID)
+ GetLevelByClass(CLASS_TYPE_MONK)
+ GetLevelByClass(CLASS_TYPE_ROGUE)
+ GetLevelByClass(CLASS_TYPE_BARD);
int nBAB3 = GetLevelByClass(CLASS_TYPE_WIZARD)
+ GetLevelByClass(CLASS_TYPE_SORCERER);
int nOldBAB = nBAB1 + (nBAB2 + n) * 3 / 4 + nBAB3 / 2;
int nNewBAB = nBAB1 + n + nBAB2 * 3 / 4 + nBAB3 / 2;
if (nNewBAB / 5 > nOldBAB / 5)
return 2; // additional attack
else
return 1; // everything is normal
}
//------------------------------------------------------------------------------
// GZ: gets rids of temporary hit points so that they will not stack
//------------------------------------------------------------------------------
void RemoveTempHitPoints()
{
effect eProtection;
int nCnt = 0;
eProtection = GetFirstEffect(OBJECT_SELF);
while (GetIsEffectValid(eProtection))
{
if(GetEffectType(eProtection) == EFFECT_TYPE_TEMPORARY_HITPOINTS)
RemoveEffect(OBJECT_SELF, eProtection);
eProtection = GetNextEffect(OBJECT_SELF);
}
}
// * Kovi. removes any effects from this type of spell
// * i.e., used in Mage Armor to remove any previous
// * mage armors
void RemoveEffectsFromSpell(object oTarget, int SpellID)
{
effect eLook = GetFirstEffect(oTarget);
while (GetIsEffectValid(eLook)) {
if (GetEffectSpellId(eLook) == SpellID)
RemoveEffect(oTarget, eLook);
eLook = GetNextEffect(oTarget);
}
}
int MyResistSpell(object oCaster, object oTarget, float fDelay = 0.0)
{
if (fDelay > 0.5)
{
fDelay = fDelay - 0.1;
}
int nResist = ResistSpell(oCaster, oTarget);
effect eSR = EffectVisualEffect(VFX_IMP_MAGIC_RESISTANCE_USE);
effect eGlobe = EffectVisualEffect(VFX_IMP_GLOBE_USE);
effect eMantle = EffectVisualEffect(VFX_IMP_SPELL_MANTLE_USE);
if(nResist == 1) //Spell Resistance
{
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eSR, oTarget));
}
else if(nResist == 2) //Globe
{
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eGlobe, oTarget));
}
else if(nResist == 3) //Spell Mantle
{
if (fDelay > 0.5)
{
fDelay = fDelay - 0.1;
}
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eMantle, oTarget));
}
return nResist;
}
int MySavingThrow(int nSavingThrow, object oTarget, int nDC, int nSaveType=SAVING_THROW_TYPE_NONE, object oSaveVersus = OBJECT_SELF, float fDelay = 0.0)
{
// -------------------------------------------------------------------------
// GZ: sanity checks to prevent wrapping around
// -------------------------------------------------------------------------
if (nDC<1)
{
nDC = 1;
}
else if (nDC > 255)
{
nDC = 255;
}
effect eVis;
int bValid = FALSE;
int nSpellID;
if(nSavingThrow == SAVING_THROW_FORT)
{
bValid = FortitudeSave(oTarget, nDC, nSaveType, oSaveVersus);
if(bValid == 1)
{
eVis = EffectVisualEffect(VFX_IMP_FORTITUDE_SAVING_THROW_USE);
}
}
else if(nSavingThrow == SAVING_THROW_REFLEX)
{
bValid = ReflexSave(oTarget, nDC, nSaveType, oSaveVersus);
if(bValid == 1)
{
eVis = EffectVisualEffect(VFX_IMP_REFLEX_SAVE_THROW_USE);
}
}
else if(nSavingThrow == SAVING_THROW_WILL)
{
bValid = WillSave(oTarget, nDC, nSaveType, oSaveVersus);
if(bValid == 1)
{
eVis = EffectVisualEffect(VFX_IMP_WILL_SAVING_THROW_USE);
}
}
nSpellID = GetSpellId();
/*
return 0 = FAILED SAVE
return 1 = SAVE SUCCESSFUL
return 2 = IMMUNE TO WHAT WAS BEING SAVED AGAINST
*/
if(bValid == 0)
{
if((nSaveType == SAVING_THROW_TYPE_DEATH
|| nSpellID == SPELL_WEIRD
|| nSpellID == SPELL_FINGER_OF_DEATH) &&
nSpellID != SPELL_HORRID_WILTING)
{
eVis = EffectVisualEffect(VFX_IMP_DEATH);
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
//redundant comparison on bValid, let's move the eVis line down below
/* if(bValid == 2)
{
eVis = EffectVisualEffect(VFX_IMP_MAGIC_RESISTANCE_USE);
}*/
if(bValid == 1 || bValid == 2)
{
if(bValid == 2)
{
eVis = EffectVisualEffect(VFX_IMP_MAGIC_RESISTANCE_USE);
/*
If the spell is save immune then the link must be applied in order to get the true immunity
to be resisted. That is the reason for returing false and not true. True blocks the
application of effects.
*/
bValid = FALSE;
}
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
return bValid;
}
effect CreateProtectionFromAlignmentLink(int nAlignment, int nPower = 1)
{
int nFinal = nPower * 2;
effect eAC = EffectACIncrease(nFinal, AC_DEFLECTION_BONUS);
eAC = VersusAlignmentEffect(eAC, ALIGNMENT_ALL, nAlignment);
effect eSave = EffectSavingThrowIncrease(SAVING_THROW_ALL, nFinal);
eSave = VersusAlignmentEffect(eSave,ALIGNMENT_ALL, nAlignment);
effect eImmune = EffectImmunity(IMMUNITY_TYPE_MIND_SPELLS);
eImmune = VersusAlignmentEffect(eImmune,ALIGNMENT_ALL, nAlignment);
effect eDur;
if(nAlignment == ALIGNMENT_EVIL)
{
eDur = EffectVisualEffect(VFX_DUR_PROTECTION_GOOD_MINOR);
}
else if(nAlignment == ALIGNMENT_GOOD)
{
eDur = EffectVisualEffect(VFX_DUR_PROTECTION_EVIL_MINOR);
}
effect eDur2 = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
effect eLink = EffectLinkEffects(eImmune, eSave);
eLink = EffectLinkEffects(eLink, eAC);
eLink = EffectLinkEffects(eLink, eDur);
eLink = EffectLinkEffects(eLink, eDur2);
return eLink;
}
effect CreateDoomEffectsLink()
{
//Declare major variables
effect eSaves = EffectSavingThrowDecrease(SAVING_THROW_ALL, 2);
effect eAttack = EffectAttackDecrease(2);
effect eDamage = EffectDamageDecrease(2);
effect eSkill = EffectSkillDecrease(SKILL_ALL_SKILLS, 2);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eAttack, eDamage);
eLink = EffectLinkEffects(eLink, eSaves);
eLink = EffectLinkEffects(eLink, eSkill);
eLink = EffectLinkEffects(eLink, eDur);
return eLink;
}
void RemoveSpellEffects(int nSpell_ID, object oCaster, object oTarget)
{
//Declare major variables
int bValid = FALSE;
effect eAOE;
if(GetHasSpellEffect(nSpell_ID, oTarget))
{
//Search through the valid effects on the target.
eAOE = GetFirstEffect(oTarget);
while (GetIsEffectValid(eAOE) && bValid == FALSE)
{
if (GetEffectCreator(eAOE) == oCaster)
{
//If the effect was created by the spell then remove it
if(GetEffectSpellId(eAOE) == nSpell_ID)
{
RemoveEffect(oTarget, eAOE);
bValid = TRUE;
}
}
//Get next effect on the target
eAOE = GetNextEffect(oTarget);
}
}
}
void RemoveSpecificEffect(int nEffectTypeID, object oTarget)
{
//Declare major variables
//Get the object that is exiting the AOE
int bValid = FALSE;
effect eAOE;
//Search through the valid effects on the target.
eAOE = GetFirstEffect(oTarget);
while (GetIsEffectValid(eAOE))
{
if (GetEffectType(eAOE) == nEffectTypeID)
{
//If the effect was created by the spell then remove it
bValid = TRUE;
RemoveEffect(oTarget, eAOE);
}
//Get next effect on the target
eAOE = GetNextEffect(oTarget);
}
}
float GetSpellEffectDelay(location SpellTargetLocation, object oTarget)
{
float fDelay;
return fDelay = GetDistanceBetweenLocations(SpellTargetLocation, GetLocation(oTarget))/20;
}
float GetRandomDelay(float fMinimumTime = 0.4, float MaximumTime = 1.1)
{
float fRandom = MaximumTime - fMinimumTime;
if(fRandom < 0.0)
{
return 0.0;
}
else
{
int nRandom;
nRandom = FloatToInt(fRandom * 10.0);
nRandom = Random(nRandom) + 1;
fRandom = IntToFloat(nRandom);
fRandom /= 10.0;
return fRandom + fMinimumTime;
}
}
int GetScaledDuration(int nActualDuration, object oTarget)
{
int nDiff = GetGameDifficulty();
int nNew = nActualDuration;
if(GetIsPC(oTarget) && nActualDuration > 3)
{
if(nDiff == GAME_DIFFICULTY_VERY_EASY || nDiff == GAME_DIFFICULTY_EASY)
{
nNew = nActualDuration / 4;
}
else if(nDiff == GAME_DIFFICULTY_NORMAL)
{
nNew = nActualDuration / 2;
}
if(nNew == 0)
{
nNew = 1;
}
}
return nNew;
}
effect GetScaledEffect(effect eStandard, object oTarget)
{
int nDiff = GetGameDifficulty();
effect eNew = eStandard;
object oMaster = GetMaster(oTarget);
if(GetIsPC(oTarget) || (GetIsObjectValid(oMaster) && GetIsPC(oMaster)))
{
if(GetEffectType(eStandard) == EFFECT_TYPE_FRIGHTENED && nDiff == GAME_DIFFICULTY_VERY_EASY)
{
eNew = EffectAttackDecrease(-2);
return eNew;
}
if(GetEffectType(eStandard) == EFFECT_TYPE_FRIGHTENED && nDiff == GAME_DIFFICULTY_EASY)
{
eNew = EffectAttackDecrease(-4);
return eNew;
}
if(nDiff == GAME_DIFFICULTY_VERY_EASY &&
(GetEffectType(eStandard) == EFFECT_TYPE_PARALYZE ||
GetEffectType(eStandard) == EFFECT_TYPE_STUNNED ||
GetEffectType(eStandard) == EFFECT_TYPE_CONFUSED))
{
eNew = EffectDazed();
return eNew;
}
else if(GetEffectType(eStandard) == EFFECT_TYPE_CHARMED || GetEffectType(eStandard) == EFFECT_TYPE_DOMINATED)
{
eNew = EffectDazed();
return eNew;
}
}
return eNew;
}
int RemoveProtections(int nSpell_ID, object oTarget, int nCount)
{
//Declare major variables
effect eProtection;
int nCnt = 0;
if(GetHasSpellEffect(nSpell_ID, oTarget))
{
//Search through the valid effects on the target.
eProtection = GetFirstEffect(oTarget);
while (GetIsEffectValid(eProtection))
{
//If the effect was created by the spell then remove it
if(GetEffectSpellId(eProtection) == nSpell_ID)
{
RemoveEffect(oTarget, eProtection);
//return 1;
nCnt++;
}
//Get next effect on the target
eProtection = GetNextEffect(oTarget);
}
}
if(nCnt > 0)
{
return 1;
}
else
{
return 0;
}
}
//------------------------------------------------------------------------------
// Returns the nLastChecked-nth highest spell on the creature for use in
// the spell breach routines
// Please modify the constatn NW_I0_SPELLS_MAX_BREACH at the top of this file
// if you change the number of spells.
//------------------------------------------------------------------------------
int GetSpellBreachProtection(int nLastChecked)
{
//--------------------------------------------------------------------------
// GZ: Protections are stripped in the order they appear here
//--------------------------------------------------------------------------
if(nLastChecked == 1) {return SPELL_GREATER_SPELL_MANTLE;}
else if (nLastChecked == 2){return SPELL_PREMONITION;}
else if(nLastChecked == 3) {return SPELL_SPELL_MANTLE;}
else if(nLastChecked == 4) {return SPELL_SHADOW_SHIELD;}
else if(nLastChecked == 5) {return SPELL_GREATER_STONESKIN;}
else if(nLastChecked == 6) {return SPELL_ETHEREAL_VISAGE;}
else if(nLastChecked == 7) {return SPELL_GLOBE_OF_INVULNERABILITY;}
else if(nLastChecked == 8) {return SPELL_ENERGY_BUFFER;}
else if(nLastChecked == 9) {return 443;} // greater sanctuary
else if(nLastChecked == 10) {return SPELL_MINOR_GLOBE_OF_INVULNERABILITY;}
else if(nLastChecked == 11) {return SPELL_SPELL_RESISTANCE;}
else if(nLastChecked == 12) {return SPELL_STONESKIN;}
else if(nLastChecked == 13) {return SPELL_LESSER_SPELL_MANTLE;}
else if(nLastChecked == 14) {return SPELL_MESTILS_ACID_SHEATH;}
else if(nLastChecked == 15) {return SPELL_MIND_BLANK;}
else if(nLastChecked == 16) {return SPELL_ELEMENTAL_SHIELD;}
else if(nLastChecked == 17) {return SPELL_PROTECTION_FROM_SPELLS;}
else if(nLastChecked == 18) {return SPELL_PROTECTION_FROM_ELEMENTS;}
else if(nLastChecked == 19) {return SPELL_RESIST_ELEMENTS;}
else if(nLastChecked == 20) {return SPELL_DEATH_ARMOR;}
else if(nLastChecked == 21) {return SPELL_GHOSTLY_VISAGE;}
else if(nLastChecked == 22) {return SPELL_ENDURE_ELEMENTS;}
else if(nLastChecked == 23) {return SPELL_SHADOW_SHIELD;}
else if(nLastChecked == 24) {return SPELL_SHADOW_CONJURATION_MAGE_ARMOR;}
else if(nLastChecked == 25) {return SPELL_NEGATIVE_ENERGY_PROTECTION;}
else if(nLastChecked == 26) {return SPELL_SANCTUARY;}
else if(nLastChecked == 27) {return SPELL_MAGE_ARMOR;}
else if(nLastChecked == 28) {return SPELL_STONE_BONES;}
else if(nLastChecked == 29) {return SPELL_SHIELD;}
else if(nLastChecked == 30) {return SPELL_SHIELD_OF_FAITH;}
else if(nLastChecked == 31) {return SPELL_LESSER_MIND_BLANK;}
else if(nLastChecked == 32) {return SPELL_IRONGUTS;}
else if(nLastChecked == 33) {return SPELL_RESISTANCE;}
return nLastChecked;
}
void AssignAOEDebugString(string sString)
{
object oTarget = GetAreaOfEffectCreator();
AssignCommand(oTarget, SpeakString(sString));
}
void PlayDragonBattleCry()
{
if(d100() > 50)
{
PlayVoiceChat(VOICE_CHAT_BATTLECRY1);
}
else
{
PlayVoiceChat(VOICE_CHAT_BATTLECRY2);
}
}
void TrapDoElectricalDamage(int ngDamageMaster, int nSaveDC, int nSecondary)
{
//Declare major variables
object oTarget = GetEnteringObject();
object o2ndTarget;
effect eLightning = EffectBeam(VFX_BEAM_LIGHTNING, oTarget, BODY_NODE_CHEST);
int nDamageMaster = ngDamageMaster;
int nDamage = nDamageMaster;
effect eDam;
effect eVis = EffectVisualEffect(VFX_IMP_LIGHTNING_S);
location lTarget = GetLocation(oTarget);
int nCount = 0;
//Adjust the trap damage based on the feats of the target
if(!MySavingThrow(SAVING_THROW_REFLEX, oTarget, nSaveDC, SAVING_THROW_TYPE_TRAP))
{
if (GetHasFeat(FEAT_IMPROVED_EVASION, oTarget))
{
nDamage /= 2;
}
}
else if (GetHasFeat(FEAT_EVASION, oTarget) || GetHasFeat(FEAT_IMPROVED_EVASION, oTarget))
{
nDamage = 0;
}
else
{
nDamage /= 2;
}
if (nDamage > 0)
{
eDam = EffectDamage(nDamage, DAMAGE_TYPE_ELECTRICAL);
DelayCommand(0.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
//Reset the damage;
nDamage = nDamageMaster;
o2ndTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, lTarget);
while (GetIsObjectValid(o2ndTarget) && nCount <= nSecondary)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//check to see that the original target is not hit again.
if(o2ndTarget != oTarget)
{
//Adjust the trap damage based on the feats of the target
if(!MySavingThrow(SAVING_THROW_REFLEX, o2ndTarget, nSaveDC, SAVING_THROW_TYPE_ELECTRICITY))
{
if (GetHasFeat(FEAT_IMPROVED_EVASION, o2ndTarget))
{
nDamage /= 2;
}
}
else if (GetHasFeat(FEAT_EVASION, o2ndTarget) || GetHasFeat(FEAT_IMPROVED_EVASION, o2ndTarget))
{
nDamage = 0;
}
else
{
nDamage /= 2;
}
if (nDamage > 0)
{
//Set the damage effect
eDam = EffectDamage(nDamage, DAMAGE_TYPE_ELECTRICAL);
//Apply the VFX impact and damage effect
DelayCommand(0.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, o2ndTarget));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, o2ndTarget);
//Connect the lightning stream from one target to another.
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLightning, o2ndTarget, 0.75);
//Set the last target as the new start for the lightning stream
eLightning = EffectBeam(VFX_BEAM_LIGHTNING, o2ndTarget, BODY_NODE_CHEST);
}
}
//Reset the damage
nDamage = nDamageMaster;
//Increment the count
nCount++;
}
//Get next target in the shape.
o2ndTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, lTarget);
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -11,17 +11,12 @@
//:: Created On: Oct 25, 2001
//:://////////////////////////////////////////////
#include "NW_I0_GENERIC"
object CreatePlaceable(string sObject, location lPlace, float fDuration);
void RewardCombatXP(object oKiller, object oVictim = OBJECT_SELF);
void main()
{
object oKiller = GetLastKiller();
SetIsDestroyable(FALSE,FALSE,FALSE);
ExecuteScript("sf_xp", OBJECT_SELF);
SetIsDestroyable(FALSE,FALSE,FALSE);
DelayCommand(120.0,SetIsDestroyable(TRUE,FALSE,FALSE));
DelayCommand(121.0,DestroyObject(OBJECT_SELF));
object oTemp = CreatePlaceable("corpse",GetLocation(OBJECT_SELF),120.0);
@@ -53,6 +48,13 @@ void main()
SetLocalObject(oTemp,"oCorpse",OBJECT_SELF);
SetLocalInt(oTemp,"iPenalty",200);
}
if (sResSelf == "bearblck002")
{
SetLocalString(oTemp,"sPelt","pelt002");
SetLocalString(oTemp,"sMeat","meat002");
SetLocalObject(oTemp,"oCorpse",OBJECT_SELF);
SetLocalInt(oTemp,"iPenalty",200);
}
if (sResSelf == "bearbrwn001")
{
SetLocalString(oTemp,"sPelt","pelt001");
@@ -109,6 +111,21 @@ void main()
SetLocalObject(oTemp,"oCorpse",OBJECT_SELF);
SetLocalInt(oTemp,"iPenalty",50);
}
if (sResSelf == "wolf002")
{
SetLocalString(oTemp,"sPelt","pelt008");
SetLocalString(oTemp,"sMeat","meat008");
SetLocalObject(oTemp,"oCorpse",OBJECT_SELF);
SetLocalInt(oTemp,"iPenalty",50);
}
if (sResSelf == "direwolf002")
{
SetLocalString(oTemp,"sPelt","pelt010");
SetLocalString(oTemp,"sMeat","meat010");
SetLocalObject(oTemp,"oCorpse",OBJECT_SELF);
SetLocalInt(oTemp,"iPenalty",500);
}
if (sResSelf == "worg001")
{
SetLocalString(oTemp,"sPelt","pelt009");
@@ -234,120 +251,12 @@ void main()
{
SignalEvent(GetAreaFromLocation(GetLocation(OBJECT_SELF)), EventUserDefined(1007));
}
RewardCombatXP(oKiller);
ExecuteScript("prc_npc_death", OBJECT_SELF);
}
object CreatePlaceable(string sObject, location lPlace, float fDuration)
{
object oPlaceable = CreateObject(OBJECT_TYPE_PLACEABLE,sObject,lPlace,FALSE);
if (fDuration != 0.0)
DestroyObject(oPlaceable,fDuration);
return oPlaceable;
}
void RewardCombatXP(object oKiller, object oVictim = OBJECT_SELF)
{
int noleech = 0;
float BaseEXP = ((GetChallengeRating(oVictim)*5.0)+2);
float BonusEXP = ((GetChallengeRating(oVictim)*2.0)+5);
float BaseMonEXP = BaseEXP;
int NumOfParty = 0;
float PartyLevelSum = 0.0;
object oPartyMember = GetFirstFactionMember(oKiller, TRUE);
while(GetIsObjectValid(oPartyMember)) {
if (GetArea(oVictim) == GetArea(oPartyMember))
{
int leech = GetHitDice(oPartyMember);
if (leech >= noleech){
noleech = leech;
}
NumOfParty++;
PartyLevelSum += GetCharacterLevel(oPartyMember);
}
oPartyMember = GetNextFactionMember(oKiller, TRUE);
}
if (PartyLevelSum <= 1.0)
{
PartyLevelSum = 1.0;
}
if (NumOfParty <= 1)
{
NumOfParty = 1;
}
float PartyAvgLvl = PartyLevelSum / NumOfParty;
//Calculate Adjustment Value
if (PartyAvgLvl <= 1.0)
{
PartyAvgLvl = 1.0;
}
float x = GetChallengeRating(oVictim);
if (x <= 1.0)
{
x = 1.0;
}
float z = (x / PartyAvgLvl);
float AdjustValue = ((z+2)/3);
float FinalMonValue;
//Determine Final Experience Value
if (AdjustValue == 0.0) {
FinalMonValue = BaseMonEXP;
} else {
if (AdjustValue < 1.0) {
FinalMonValue = BaseMonEXP * AdjustValue;
} else {
FinalMonValue = BaseMonEXP + (BonusEXP * (AdjustValue * (1.10)));
}
}
//Determine the value of the Split EXP
if (NumOfParty >= 8)
{
NumOfParty = 8;
}
if (NumOfParty <= 1)
{
NumOfParty = 1;
}
if (FinalMonValue <= 1.0)
{
FinalMonValue = 1.0;
}
float SplitFinalEXP = FinalMonValue / NumOfParty;
if (SplitFinalEXP <= 1.0)
{
SplitFinalEXP = 1.0;
}
float y = (FinalMonValue - SplitFinalEXP);
if (y <= 1.0)
{
y = 1.0;
}
if (PartyAvgLvl >= 15.0)
{
FinalMonValue = FinalMonValue - ( PartyAvgLvl);
}
float PartyBonus = ((y +1)/ 1.75) + (FinalMonValue + ((21-PartyAvgLvl)/3));
int SFEint = FloatToInt(PartyBonus);
//Distribute EXP to all PCs in the Party
oPartyMember = GetFirstFactionMember(oKiller, TRUE);
while (GetIsObjectValid(oPartyMember))
{
if (GetArea(OBJECT_SELF) == GetArea(oPartyMember)) {
int nHD = GetHitDice(oPartyMember) + 1;
int nMax = (((nHD * (nHD - 1)) / 2) * 1000)+1;
if (nMax <= GetXP(oPartyMember) && nHD <= 40) {
SendMessageToPC(oPartyMember, "You cannot gain experience until you have leveled.");
} else if (GetIsDead(oPartyMember)) {
SendMessageToPC(oPartyMember, "You cannot gain experience while dead. Your XP has been reset.");
} else if ((GetHitDice(oPartyMember)) <= (noleech - 7) || (GetHitDice(oPartyMember)) >= FloatToInt(PartyAvgLvl) + 7) {
SendMessageToPC(oPartyMember, "All party members must be within 6 levels of each other.");
} else {
GiveXPToCreature(oPartyMember, SFEint);
}
}
oPartyMember = GetNextFactionMember(oKiller, TRUE);
}
}

1920
_module/nss/x0_i0_spells.nss Normal file

File diff suppressed because it is too large Load Diff