Adds and Changes

Added missing crafting maps, removed unnecessary maps, changed a few miscellaneous things.
This commit is contained in:
2024-09-14 13:52:39 -04:00
parent 339f0f8b96
commit 7f75e229f9
2041 changed files with 184144 additions and 506679 deletions

View File

@@ -26,7 +26,7 @@ int hitdicebonus(object cbObject)
int cbOld1 = GetLocalInt(cbObject, "CB_OLD1");
int cbOld2 = GetLocalInt(cbObject, "CB_OLD2");
int cbOld3 = GetLocalInt(cbObject, "CB_OLD3");
int cbNew1 = d2(GetLevelByPosition(1, cbObject)); //:: I'm not going to encourage this stupidity.
int cbNew1 = d2(GetLevelByPosition(1, cbObject));
int cbNew2 = d2(GetLevelByPosition(2, cbObject));
int cbNew3 = d2(GetLevelByPosition(3, cbObject));
int cbClass1 = GetClassByPosition(1, cbObject);
@@ -34,7 +34,7 @@ int hitdicebonus(object cbObject)
int cbClass3 = GetClassByPosition(3, cbObject);
//Due to the random nature of the randomizer and dice roll i'm going to setup
//a while that won't quit untill the new hitdice bonus is higher than the old
//a while that won't quit untill the new hitdice bonus is higher than the old
//by at minum 1 hp. Also check to make sure there's atleast one level in that
//class slot, if its zero then don't do it cos well it would just get stuck
//in a infine loop, not good!

View File

@@ -1,5 +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);
@@ -27,7 +28,13 @@ void main()
string sOldTag = sItemTag;
//int iAlchemyChance = GetTokenPair(oPC,14,12);
//int iAlchemySkill = iAlchemyChance;
int iAlchemySkill = GetCampaignInt("UOACraft","iAlchemySkill",oPC);
//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 iAlchemyChance = iAlchemySkill;
int iSuccess = 0;
int iSkillGain = 0;
@@ -107,176 +114,182 @@ void main()
{
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_BLUEIRIRS")
{
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_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 dark-blue pigment.";
sSuccess = "You boil the tulip, and extract the 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 a greyish pigment.";
sSuccess = "You boil the nasturtium, and extract an orange 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 greyish pigment.";
sSuccess = "You boil the mayapple, and extract a smokey 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")
@@ -290,28 +303,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
@@ -553,7 +566,7 @@ void main()
}
//End code for fixing stackables issue
if (GetStringRight(sDItemResRef,3)=="013") // Tanning Oil
if (sDItemResRef == "pattern013") // 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));
@@ -567,7 +580,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;
@@ -688,8 +701,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";
@@ -710,7 +723,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";
@@ -728,7 +741,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";
@@ -747,7 +760,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";
@@ -767,7 +780,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";
@@ -786,8 +799,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";
@@ -809,7 +822,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 sulpher improperly, rending this batch useless.";
sFail = "The tar hardens as you mix the coal and sulphur improperly, rendering this batch useless.";
sItemResRef = "_uoa_alch_fire";
sFailResRef = "glassbottle";
sComponent1Name = "bottles of tar";
@@ -887,7 +900,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";
@@ -903,7 +916,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";
@@ -919,7 +932,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";
@@ -932,7 +945,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)))
@@ -1164,7 +1177,7 @@ void main()
case 17:
{
sSuccess=sSuccess+"Essence of Cold";
sComponent1 = "GEM_POWDER_JADE";
sComponent1 = "GEM_POWDERED_JADE";
iComponent1 = 3;
sComponent2 = "SEED_SPEARMINT";
iComponent2 = 5;
@@ -1521,7 +1534,13 @@ void main()
if (iAlchemySkill <= 1000)
{
//DelayCommand(6.0,SetTokenPair(oPC,14,12,iAlchemySkill));
DelayCommand(6.0,SetCampaignInt("UOACraft","iAlchemySkill",iAlchemySkill,oPC));
// 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,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,5 +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);
@@ -104,21 +105,33 @@ void main()
if (GetLocalInt(OBJECT_SELF,"iAmInUse") != 0)
{
SendMessageToPC(oPC,"You must wait till the current weapon or armor is completed before starting another.");
SendMessageToPC(oPC,"You must wait until the current weapon or armor is completed before starting another.");
return;
}
if (GetTag(oTool) != "ITEM_SMITHHAMMER_NORMAL")
{
FloatingTextStringOnCreature("You must have a smithy hammer equipped in order to attempt this craft...",oPC,FALSE);
FloatingTextStringOnCreature("You must have a blacksmith hammer equipped in order to attempt this craft.",oPC,FALSE);
return;
}
//int iSmithSkill = GetTokenPair(oPC,13,4); // Weaponsmith
int iSmithSkill = GetCampaignInt("UOACraft","iSmithSkill",oPC);
// uses NWN Database
//int iSmithSkill = GetCampaignInt("UOACraft","iSmithSkill",oPC);
// uses external database
int iSmithSkill = GetPersistentInt(oPC,"iSmithSkill","UOACraft");
int iSmithChance = iSmithSkill;
//int iArmorSkill = GetTokenPair(oPC,13,5); // ArmorCraft
int iArmorSkill = GetCampaignInt("UOACraft","iArmorSkill",oPC);
// uses NWN database
//int iArmorSkill = GetCampaignInt("UOACraft","iArmorSkill",oPC);
// external database
int iArmorSkill = GetPersistentInt(oPC,"iArmorSkill","UOACraft");
int iArmorChance = iArmorSkill;
if (iSmithChance < 350)
@@ -150,7 +163,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, rending the dagger useless.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rendering the dagger useless.";
sItemResRefPoor = CraftLookup("wswdg002",iIngotType);
sItemResRef = CraftLookup("nw_wswdg001",iIngotType);
sItemResRefExceptional = CraftLookup("wswdg003",iIngotType);
@@ -163,7 +176,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, rending the shortsword useless.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rendering the shortsword useless.";
sItemResRefPoor = CraftLookup("wswss002",iIngotType);
sItemResRef = CraftLookup("nw_wswss001",iIngotType);
sItemResRefExceptional = CraftLookup("wswss003",iIngotType);
@@ -177,7 +190,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);
@@ -225,7 +238,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 properly, and the scale mail armor is ruined.";
sFail = "The scales do not hook together properly, and the scale mail armor is ruined.";
sItemResRefPoor = CraftLookup("aarcl006",iIngotType);
sItemResRef = CraftLookup("nw_aarcl003",iIngotType);
sItemResRefExceptional = CraftLookup("aarcl007",iIngotType);
@@ -256,7 +269,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 properly, and the banded mail armor is ruined.";
sFail = "The bands do not fix together properly, and the banded mail armor is ruined.";
sItemResRefPoor = CraftLookup("aarcl014",iIngotType);
sItemResRef = CraftLookup("nw_aarcl011",iIngotType);
sItemResRefExceptional = CraftLookup("aarcl015",iIngotType);
@@ -273,7 +286,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 properly, and the splint mail armor is ruined.";
sFail = "The small metal plates are too brittle to fix together properly, and the splint mail armor is ruined.";
sItemResRefPoor = CraftLookup("aarcl018",iIngotType);
sItemResRef = CraftLookup("nw_aarcl005",iIngotType);
sItemResRefExceptional = CraftLookup("aarcl019",iIngotType);
@@ -323,7 +336,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, rending the longsword useless.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rendering the longsword useless.";
sItemResRefPoor = CraftLookup("wswls002",iIngotType);
sItemResRef = CraftLookup("nw_wswls001",iIngotType);
sItemResRefExceptional = CraftLookup("wswls003",iIngotType);
@@ -336,7 +349,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, rending the bastard sword useless.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rendering the bastard sword useless.";
sItemResRefPoor = CraftLookup("wswbs002",iIngotType);
sItemResRef = CraftLookup("nw_wswbs001",iIngotType);
sItemResRefExceptional = CraftLookup("wswbs003",iIngotType);
@@ -349,7 +362,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, rending the greatsword useless.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rendering the greatsword useless.";
sItemResRefPoor = CraftLookup("wswgs002",iIngotType);
sItemResRef = CraftLookup("nw_wswgs001",iIngotType);
sItemResRefExceptional = CraftLookup("wswgs003",iIngotType);
@@ -481,7 +494,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, rending the mace useless.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rendering the mace useless.";
sItemResRefPoor = CraftLookup("wblml002",iIngotType);
sItemResRef = CraftLookup("nw_wblml001",iIngotType);
sItemResRefExceptional = CraftLookup("wblml003",iIngotType);
@@ -494,7 +507,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, rending the morning star useless.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rendering the morning star useless.";
sItemResRefPoor = CraftLookup("wblms002",iIngotType);
sItemResRef = CraftLookup("nw_wblms001",iIngotType);
sItemResRefExceptional = CraftLookup("wblms003",iIngotType);
@@ -510,7 +523,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, rending the light flail useless.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rendering the light flail useless.";
sItemResRefPoor = CraftLookup("wblfl002",iIngotType);
sItemResRef = CraftLookup("nw_wblfl001",iIngotType);
sItemResRefExceptional = CraftLookup("wblfl003",iIngotType);
@@ -523,7 +536,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, rending the heavy flail useless.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rendering the heavy flail useless.";
sItemResRefPoor = CraftLookup("wblfh002",iIngotType);
sItemResRef = CraftLookup("nw_wblfh001",iIngotType);
sItemResRefExceptional = CraftLookup("wblfh003",iIngotType);
@@ -536,7 +549,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, rending the light hammer useless.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rendering the light hammer useless.";
sItemResRefPoor = CraftLookup("wblhl002",iIngotType);
sItemResRef = CraftLookup("nw_wblhl001",iIngotType);
sItemResRefExceptional = CraftLookup("wblhl003",iIngotType);
@@ -549,7 +562,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, rending the warhammer useless.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rendering the warhammer useless.";
sItemResRefPoor = CraftLookup("wblhw002",iIngotType);
sItemResRef = CraftLookup("nw_wblhw001",iIngotType);
sItemResRefExceptional = CraftLookup("wblhw003",iIngotType);
@@ -562,7 +575,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, rending the handaxe useless.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rendering the handaxe useless.";
sItemResRefPoor = CraftLookup("waxhn002",iIngotType);
sItemResRef = CraftLookup("nw_waxhn001",iIngotType);
sItemResRefExceptional = CraftLookup("waxhn003",iIngotType);
@@ -575,7 +588,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, rending the battleaxe useless.";
sFail = "The metal turns brittle as you heat, fold, and pound it, rendering the battleaxe useless.";
sItemResRefPoor = CraftLookup("waxbt002",iIngotType);
sItemResRef = CraftLookup("nw_waxbt001",iIngotType);
sItemResRefExceptional = CraftLookup("waxbt003",iIngotType);
@@ -589,7 +602,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);
@@ -603,7 +616,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);
@@ -617,7 +630,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);
@@ -629,8 +642,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 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 it, and the halberd is ruined.";
sItemResRefPoor = CraftLookup("wplhb002",iIngotType);
sItemResRef = CraftLookup("nw_wplhb001",iIngotType);
sItemResRefExceptional = CraftLookup("wplhb003",iIngotType);
@@ -645,8 +658,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 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 it, and the scythe is ruined.";
sItemResRefPoor = CraftLookup("wplsc002",iIngotType);
sItemResRef = CraftLookup("nw_wplsc001",iIngotType);
sItemResRefExceptional = CraftLookup("wplsc003",iIngotType);
@@ -661,8 +674,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 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 it, and the spear is ruined.";
sItemResRefPoor = CraftLookup("wplss002",iIngotType);
sItemResRef = CraftLookup("nw_wplss001",iIngotType);
sItemResRefExceptional = CraftLookup("wplss003",iIngotType);
@@ -691,7 +704,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 and the kukri is ruined.";
sFail = "The metal turns brittle as you attempt to forge it, and the kukri is ruined.";
sItemResRefPoor = CraftLookup("wspku002",iIngotType);
sItemResRef = CraftLookup("nw_wspku001",iIngotType);
sItemResRefExceptional = CraftLookup("wspku003",iIngotType);
@@ -704,7 +717,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 and the sickle is ruined.";
sFail = "The metal turns brittle as you attempt to forge it, and the sickle is ruined.";
sItemResRefPoor = CraftLookup("wspsc002",iIngotType);
sItemResRef = CraftLookup("nw_wspsc001",iIngotType);
sItemResRefExceptional = CraftLookup("wspsc003",iIngotType);
@@ -717,7 +730,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 and the dire mace is ruined.";
sFail = "The metal turns brittle as you attempt to forge it, and the dire mace is ruined.";
sItemResRefPoor = CraftLookup("wdbma002",iIngotType);
sItemResRef = CraftLookup("nw_wdbma001",iIngotType);
sItemResRefExceptional = CraftLookup("wdbma003",iIngotType);
@@ -730,7 +743,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 and the double axe is ruined.";
sFail = "The metal turns brittle as you attempt to forge it, and the double axe is ruined.";
sItemResRefPoor = CraftLookup("wdbax002",iIngotType);
sItemResRef = CraftLookup("nw_wdbax001",iIngotType);
sItemResRefExceptional = CraftLookup("wdbax003",iIngotType);
@@ -743,7 +756,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 and the two-bladed sword is ruined.";
sFail = "The metal turns brittle as you attempt to forge it, and the two-bladed sword is ruined.";
sItemResRefPoor = CraftLookup("wdbsw002",iIngotType);
sItemResRef = CraftLookup("nw_wdbsw001",iIngotType);
sItemResRefExceptional = CraftLookup("wdbsw003",iIngotType);
@@ -757,7 +770,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);
@@ -771,7 +784,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);
@@ -785,7 +798,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);
@@ -800,7 +813,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);
@@ -813,7 +826,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 and the katana is ruined.";
sFail = "The metal turns brittle as you attempt to forge it, and the katana is ruined.";
sItemResRefPoor = CraftLookup("wswka002",iIngotType);
sItemResRef = CraftLookup("nw_wswka001",iIngotType);
sItemResRefExceptional = CraftLookup("wswka003",iIngotType);
@@ -826,7 +839,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 and the rapier is ruined.";
sFail = "The metal turns brittle as you attempt to forge it, and the rapier is ruined.";
sItemResRefPoor = CraftLookup("wswrp002",iIngotType);
sItemResRef = CraftLookup("nw_wswrp001",iIngotType);
sItemResRefExceptional = CraftLookup("wswrp003",iIngotType);
@@ -839,7 +852,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 and the scimitar is ruined.";
sFail = "The metal turns brittle as you attempt to forge it, and the scimitar is ruined.";
sItemResRefPoor = CraftLookup("wswsc002",iIngotType);
sItemResRef = CraftLookup("nw_wswsc001",iIngotType);
sItemResRefExceptional = CraftLookup("wswsc003",iIngotType);
@@ -852,7 +865,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 and the great axe is ruined.";
sFail = "The metal turns brittle as you attempt to forge it, and the great axe is ruined.";
sItemResRefPoor = CraftLookup("waxgr002",iIngotType);
sItemResRef = CraftLookup("nw_waxgr001",iIngotType);
sItemResRefExceptional = CraftLookup("waxgr003",iIngotType);
@@ -865,12 +878,12 @@ void main()
{
if (GetRacialType(oPC)!=RACIAL_TYPE_DWARF)
{
FloatingTextStringOnCreature("You are not a dwarf! You cannot craft a Dwarven Waraxe!",oPC,FALSE);
FloatingTextStringOnCreature("You are not a dwarf! You will be unable to 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 and the dwarven waraxe is ruined.";
sFail = "The metal turns brittle as you attempt to forge it, and the dwarven waraxe is ruined.";
sItemResRefPoor = CraftLookup("wdwraxe002",iIngotType);
sItemResRef = CraftLookup("x2_wdwraxe001",iIngotType);
sItemResRefExceptional = CraftLookup("wdwraxe003",iIngotType);
@@ -1246,7 +1259,13 @@ 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+"%"));
@@ -1270,7 +1289,13 @@ 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,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);
@@ -102,7 +103,13 @@ void main()
}
//int iBowSkill = GetTokenPair(oPC,13,3);
int iBowSkill = GetCampaignInt("UOACraft","iBowSkill",oPC);
// uses NWN database
//int iBowSkill = GetCampaignInt("UOACraft","iBowSkill",oPC);
//external database
int iBowSkill = GetPersistentInt(oPC,"iBowSkill","UOACraft");
int iBowChance = iBowSkill;
if (iBowChance < 350)
{
@@ -361,7 +368,13 @@ void main()
if (iBowSkill <= 1000)
{
//DelayCommand(13.0,SetTokenPair(oPC,13,3,iBowSkill));
DelayCommand(13.0,SetCampaignInt("UOACraft","iBowSkill",iBowSkill,oPC));
//NWN database
//DelayCommand(13.0,SetCampaignInt("UOACraft","iBowSkill",iBowSkill,oPC));
//external database
DelayCommand(13.0,SetPersistentInt(oPC,"iBowSkill",iBowSkill,0,"UOACraft"));
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,4 +1,5 @@
#include "nw_i0_plot"
#include "aps_include"
int CheckComponent(object oPC, string sTag, int iMinimum);
void RemoveComponent(object oPC, string sTag, int iMinimum);
@@ -92,8 +93,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. The cider is ruined.";
sSuccess="You carefully combine the ingredients, and seal the jug.";
sFail = "The yeast fails to ferment the ingredients and the cider is ruined.";
sProduct = "item_fullkeg_001";
sByproduct1 = "glassbottle";
iByproduct1 = 1;
@@ -111,8 +112,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. The cider is ruined.";
sSuccess="You carefully combine the ingredients, and seal the jug.";
sFail = "The yeast fails to ferment the ingredients, and the cider is ruined.";
sProduct = "item_fullkeg_002";
sByproduct1 = "glassbottle";
iByproduct1 = 1;
@@ -131,7 +132,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";
@@ -151,7 +152,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";
@@ -215,8 +216,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 topyeast with the cider.";
sFail = "The mixture is contaminated as you attempt to add the topyeast.";
sSuccess="You carefully combine the top yeast with the cider.";
sFail = "The mixture is contaminated as you attempt to add the top yeast.";
sProduct = "item_fullkeg_008";
sFailKeg = "item_cask_006";
}
@@ -233,8 +234,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. The wine is ruined.";
sSuccess="You carefully combine the ingredients, and seal the cask.";
sFail = "The yeast fails to ferment the ingredients, and the wine is ruined.";
sProduct = "item_fullkeg_009";
sByproduct1 = "glassbottle";
iByproduct1 = 3;
@@ -252,7 +253,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";
@@ -270,7 +271,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 bottomyeast, sugar, and red wine and seal the cask.";
sSuccess="You carefully combine the bottom yeast, 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";
@@ -287,7 +288,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";
@@ -309,7 +310,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 bottomyeast and seal the barrel.";
sSuccess="You combine the water, hops, barley wort, and bottom yeast and seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The lager is ruined.";
sProduct = "item_fullkeg_013";
sByproduct1 = "item001";
@@ -330,7 +331,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 bottomyeast and seal the barrel.";
sSuccess="You combine the water, hops, barley wort, and bottom yeast and seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The lager is ruined.";
sProduct = "item_fullkeg_014";
sByproduct1 = "item001";
@@ -352,7 +353,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 bottomyeast and seal the barrel.";
sSuccess="You combine the water, hops, barley wort, and bottom yeast and seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The lager is ruined.";
sProduct = "item_fullkeg_015";
sByproduct1 = "item001";
@@ -376,7 +377,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 bottomyeast and seal the barrel.";
sSuccess="You combine the water, hops, barley wort, caramel, and bottom yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The draught is ruined.";
sProduct = "item_fullkeg_016";
sByproduct1 = "item001";
@@ -398,7 +399,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 bottomyeast and seal the barrel.";
sSuccess="You combine the water, hops, barley wort, and bottom yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The red malt lager is ruined.";
sProduct = "item_fullkeg_017";
sByproduct1 = "item001";
@@ -422,7 +423,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 bottomyeast and seal the barrel.";
sSuccess="You combine the water, hops, barley wort, caramel, and bottom yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The gold malt lager is ruined.";
sProduct = "item_fullkeg_018";
sByproduct1 = "item001";
@@ -446,7 +447,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 bottomyeast and seal the barrel.";
sSuccess="You combine the water, hops, barley wort, molasses, and bottom yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The ice lager is ruined.";
sProduct = "item_fullkeg_019";
sByproduct1 = "item001";
@@ -470,7 +471,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 bottomyeast and seal the barrel.";
sSuccess="You combine the water, hops, barley wort, caramel, and bottom yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The stout lager is ruined.";
sProduct = "item_fullkeg_020";
sByproduct1 = "item001";
@@ -493,7 +494,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 topyeast and seal the barrel.";
sSuccess="You combine the water, hops, barley wort, and top yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The ale is ruined.";
sProduct = "item_fullkeg_021";
sByproduct1 = "item001";
@@ -517,7 +518,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 topyeast and seal the barrel.";
sSuccess="You combine the water, hops, barley wort, caramel, and top yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The stout ale is ruined.";
sProduct = "item_fullkeg_022";
sByproduct1 = "item001";
@@ -543,7 +544,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 topyeast and seal the barrel.";
sSuccess="You combine the water, hops, barley wort, caramel, molasses, and top yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The porter ale is ruined.";
sProduct = "item_fullkeg_023";
sByproduct1 = "item001";
@@ -569,7 +570,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 topyeast and seal the barrel.";
sSuccess="You combine the water, hops, barley wort, caramel, grape juice, and top yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The barleywine ale is ruined.";
sProduct = "item_fullkeg_024";
sByproduct1 = "item001";
@@ -595,7 +596,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 topyeast and seal the barrel.";
sSuccess="You combine the water, hops, barley wort, caramel, and top yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The kolsch ale is ruined.";
sProduct = "item_fullkeg_025";
sByproduct1 = "item001";
@@ -619,7 +620,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 topyeast and seal the barrel.";
sSuccess="You combine the water, honey, caramel, and top yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The honeymead is ruined.";
sProduct = "item_fullkeg_026";
sByproduct1 = "item001";
@@ -640,7 +641,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 topyeast and seal the barrel.";
sSuccess="You combine the water, honey, caramel, and top yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The sackmead is ruined.";
sProduct = "item_fullkeg_027";
sByproduct1 = "item001";
@@ -664,7 +665,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 topyeast and seal the barrel.";
sSuccess="You combine the water, honey, caramel, apples, and top yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The apple muslin mead is ruined.";
sProduct = "item_fullkeg_028";
sByproduct1 = "item001";
@@ -690,7 +691,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 topyeast and seal the barrel.";
sSuccess="You combine the water, honey, caramel, mint leaves, and top yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The metheglin is ruined.";
sProduct = "item_fullkeg_029";
sByproduct1 = "item001";
@@ -714,7 +715,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 topyeast and seal the barrel.";
sSuccess="You combine the water, honey, caramel, blueberries, and top yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The morat is ruined.";
sProduct = "item_fullkeg_030";
sByproduct1 = "item001";
@@ -740,7 +741,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 topyeast and seal the barrel.";
sSuccess="You combine the water, honey, caramel, grapes, ginger, and top yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The hippocras is ruined.";
sProduct = "item_fullkeg_031";
sByproduct1 = "item001";
@@ -764,7 +765,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 topyeast and seal the barrel.";
sSuccess="You combine the water, honey, caramel, grapes, and top yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The pyment is ruined.";
sProduct = "item_fullkeg_032";
sByproduct1 = "item001";
@@ -788,7 +789,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 topyeast and seal the barrel.";
sSuccess="You combine the water, honey, caramel, corn wort, and top yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The braggot is ruined.";
sProduct = "item_fullkeg_033";
sByproduct1 = "item001";
@@ -812,7 +813,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 topyeast and seal the barrel.";
sSuccess="You combine the water, honey, caramel, vinegar, and top yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The oxymel is ruined.";
sProduct = "item_fullkeg_034";
sByproduct1 = "item001";
@@ -838,7 +839,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 topyeast and seal the barrel.";
sSuccess="You combine the water, honey, caramel, poppies, and top yeast then seal the barrel.";
sFail = "The yeast fails to ferment the ingredients. The rhodomel is ruined.";
sProduct = "item_fullkeg_035";
sByproduct1 = "item001";
@@ -857,7 +858,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 and seal the barrel.";
sSuccess="You combine the distilled corn wort and caramel then seal the barrel.";
sFail = "The whiskey fails to age properly and is ruined.";
sProduct = "item_fullkeg_036";
sFailKeg = "item_cask_004";
@@ -873,7 +874,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 and seal the barrel.";
sSuccess="You combine the distilled acorn wort and caramel then seal the barrel.";
sFail = "The whiskey fails to age properly and is ruined.";
sProduct = "item_fullkeg_037";
sFailKeg = "item_cask_004";
@@ -889,7 +890,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 and seal the barrel.";
sSuccess="You combine the distilled rice wort and molasses then seal the barrel.";
sFail = "The sake fails to age properly and is ruined.";
sProduct = "item_fullkeg_038";
sFailKeg = "item_cask_004";
@@ -908,7 +909,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 and seal the barrel.";
sSuccess="You combine the sugarcane, molasses, and yeast then seal the barrel.";
sFail = "The rum fails to age properly and is ruined.";
sProduct = "item_fullkeg_039";
sByproduct1 = "glassbottle";
@@ -930,7 +931,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 and seal the barrel.";
sSuccess="You combine the sugarcane, molasses, wine, and yeast then seal the barrel.";
sFail = "The rum fails to age properly and is ruined.";
sProduct = "item_fullkeg_040";
sByproduct1 = "glassbottle";
@@ -952,7 +953,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 and seal the barrel.";
sSuccess="You combine the sugarcane, molasses, caramel, and yeast then seal the barrel.";
sFail = "The rum fails to age properly and is ruined.";
sProduct = "item_fullkeg_041";
sByproduct1 = "glassbottle";
@@ -976,7 +977,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 and seal the barrel.";
sSuccess="You combine the sugarcane, molasses, honey, syrup, and yeast then seal the barrel.";
sFail = "The rum fails to age properly and is ruined.";
sProduct = "item_fullkeg_042";
sByproduct1 = "glassbottle";
@@ -998,7 +999,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 and seal the barrel.";
sSuccess="You combine the sugar, molasses, water, molasses, and yeast then seal the barrel.";
sFail = "The rum fails to age properly and is ruined.";
sProduct = "item_fullkeg_043";
sByproduct1 = "glassbottle";
@@ -1009,7 +1010,7 @@ void main()
}
//Other
if (iBrew==73) // Vodka
if (iBrew==74) // Vodka
{
iDifficulty = 100;
if (CheckComponent(oPC,"item_wort_019",2)==FALSE) iMissing=1;
@@ -1021,7 +1022,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 snd sugar and seal the jug.";
sSuccess="You combine the distilled vodka base and sugar then seal the jug.";
sFail = "The vodka fails to mature properly and is ruined.";
sProduct = "item_fullkeg_045";
sByproduct1= "item001";
@@ -1029,7 +1030,7 @@ void main()
sFailKeg = "item_cask_006";
}
if (iBrew==74) // Gin
if (iBrew==75) // Gin
{
iDifficulty = 100;
if (CheckComponent(oPC,"item_fullkeg_045",1)==FALSE) iMissing=1;
@@ -1039,7 +1040,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, snd sugarcane extract and seal the jug.";
sSuccess="You combine the vodka, juniper berry juice, and sugarcane extract then seal the jug.";
sFail = "The gin fails to mature properly and is ruined.";
sProduct = "item_fullkeg_046";
sFailKeg = "item_cask_006";
@@ -1053,7 +1054,12 @@ void main()
return;
}
int iBrewSkill = GetCampaignInt("UOACraft","iBrewSkill",oPC);
//nwn database
//int iBrewSkill = GetCampaignInt("UOACraft","iBrewSkill",oPC);
//external database
int iBrewSkill = GetPersistentInt(oPC,"iBrewSkill","UOACraft");
int iBrewChance = iBrewSkill;
if (iBrewChance<350)
@@ -1137,9 +1143,15 @@ void main()
if (iBrewSkill <= 1000)
{
//DelayCommand(13.0,SetTokenPair(oPC,13,3,iBrewSkill));
DelayCommand(12.5,SetCampaignInt("UOACraft","iBrewSkill",iBrewSkill,oPC));
//nwn database
//DelayCommand(12.5,SetCampaignInt("UOACraft","iBrewSkill",iBrewSkill,oPC));
//external database
DelayCommand(12.5,SetPersistentInt(oPC,"iBrewSkill",iBrewSkill,0,"UOACraft"));
DelayCommand(12.5,SendMessageToPC(oPC,"=================================="));
DelayCommand(12.5,SendMessageToPC(oPC,"Your skill in nrewing has gone up!"));
DelayCommand(12.5,SendMessageToPC(oPC,"Your skill in brewing 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,5 @@
#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);
@@ -106,7 +107,12 @@ void main()
return;
}
int iCarpentrySkill = GetCampaignInt("UOACraft","iCarpentrySkill",oPC);
// nwn database
//int iCarpentrySkill = GetCampaignInt("UOACraft","iCarpentrySkill",oPC);
//external database
int iCarpentrySkill = GetPersistentInt(oPC,"iCarpentrySkill","UOACraft");
int iCarpentryChance = iCarpentrySkill;
@@ -179,7 +185,7 @@ void main()
sItemResRefPoor = sItemResRef;
sItemResRefExceptional = sItemResRef;
sComponent1 = "WOOD_NORMAL"; //Normal Wood
iComponent1 = 8;
iComponent1 = 6;
sComponent1Name="normal wood";
}
if (sTag == "pattern118") //Beer barrel
@@ -433,7 +439,13 @@ void main()
}
if (iCarpentrySkill <= 1000)
{
DelayCommand(13.0,SetCampaignInt("UOACraft","iCarpentrySkill",iCarpentrySkill,oPC));
//nwn database
//DelayCommand(13.0,SetCampaignInt("UOACraft","iCarpentrySkill",iCarpentrySkill,oPC));
//external database
DelayCommand(13.0,SetPersistentInt(oPC,"iCarpentrySkill",iCarpentrySkill,0,"UOACraft"));
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,4 +1,6 @@
#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);
@@ -12,7 +14,13 @@ void main()
string sItemTag = GetTag(oItem);
string sTagSelf = GetTag(oSelf);
string sItemResRef;
int iCookSkill = GetCampaignInt("UOACraft","iCookSkill",oPC);
//nwn database
//int iCookSkill = GetCampaignInt("UOACraft","iCookSkill",oPC);
//external database
int iCookSkill = GetPersistentInt(oPC,"iCookSkill","UOACraft");
int iCookChance = iCookSkill;
int iDifficulty;
string sComponent1;
@@ -63,7 +71,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;
}
@@ -283,7 +291,7 @@ void main()
}
case 30:
{
sComponent1 = "MEAT_WOLLYRAZORBACK";
sComponent1 = "MEAT_WOOLYRAZORBACK";
sComponent1Name = "wooly razorback meat";
break;
}
@@ -540,7 +548,13 @@ void main()
if (iCookSkill <= 1000)
{
//DelayCommand(13.0,SetTokenPair(oPC,13,3,iCookSkill));
DelayCommand(14.5,SetCampaignInt("UOACraft","iCookSkill",iCookSkill,oPC));
//nwn database
//DelayCommand(14.5,SetCampaignInt("UOACraft","iCookSkill",iCookSkill,oPC));
//external database
DelayCommand(14.5,SetPersistentInt(oPC,"iCookSkill",iCookSkill,0,"UOACraft"));
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,4 +1,5 @@
//#include "_persist_01a"
#include "aps_include"
void CreateAnObject(string sResource, object oPC, int iStackSize);
@@ -59,7 +60,13 @@ void main()
}
//int iPaperSkill = GetTokenPair(oPC,13,13);
int iPaperSkill = GetCampaignInt("UOACraft","iPaperSkill",oPC);
//nwn database
//int iPaperSkill = GetCampaignInt("UOACraft","iPaperSkill",oPC);
//external database
int iPaperSkill = GetPersistentInt(oPC,"iPaperSkill","UOACraft");
int iPaperChance = iPaperSkill;
if (iPaperSkill <350)
{
@@ -339,7 +346,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)
{
@@ -394,7 +401,13 @@ void main()
if (iPaperSkill <= 1000)
{
//DelayCommand(30.0,SetTokenPair(oPC,13,13,iPaperSkill));
DelayCommand(30.0,SetCampaignInt("UOACraft","iPaperSkill",iPaperSkill,oPC));
//nwn database
//DelayCommand(30.0,SetCampaignInt("UOACraft","iPaperSkill",iPaperSkill,oPC));
//external database
DelayCommand(30.0,SetPersistentInt(oPC,"iPaperSkill",iPaperSkill,0,"UOACraft"));
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,4 +1,5 @@
//#include "_persist_01a"
#include "aps_include"
void CreateAnObject(string sResource, object oPC, int iStackSize);
@@ -131,7 +132,13 @@ void main()
if (iDye>9) sDyeResRef = sDyeResRef+IntToString(iDye);
//int iDyeSkill = GetTokenPair(oPC,13,12); //Cloth Dyeing Skill
int iDyeSkill = GetCampaignInt("UOACraft","iDyeSkill",oPC);
//nwn database
//int iDyeSkill = GetCampaignInt("UOACraft","iDyeSkill",oPC);
//external database
int iDyeSkill = GetPersistentInt(oPC,"iDyeSkill","UOACraft");
int iDyeChance = iDyeSkill;
if (iDyeChance < 350)
{
@@ -229,7 +236,13 @@ void main()
if (iDyeSkill <= 1000)
{
//DelayCommand(13.0,SetTokenPair(oPC,13,12,iDyeSkill));
DelayCommand(13.0,SetCampaignInt("UOACraft","iDyeSkill",iDyeSkill,oPC));
//nwn database
//DelayCommand(13.0,SetCampaignInt("UOACraft","iDyeSkill",iDyeSkill,oPC));
//external database
DelayCommand(13.0,SetPersistentInt(oPC,"iDyeSkill",iDyeSkill,0,"UOACraft"));
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,6 @@
//#include "_persist_01a"
#include "nw_i0_plot"
#include "aps_include"
void CreateAnObject(string sResource, object oPC, int iStackSize);
string CraftLookup(string sResRef, int iIngotType);
@@ -79,7 +80,7 @@ void main()
int iItemStack2;
object oItem2;
int iFletchingSkill = GetCampaignInt("UOACraft","iFletchingSkill",oPC);
int iFletchingSkill = GetPersistentInt(oPC,"iFletchingSkill","UOACraft");
int iFletchingChance = iFletchingSkill;
if (iFletchingChance <350)
@@ -338,8 +339,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 careate "+IntToString(iItemStack)+" arrows.",oPC,FALSE)));
if (iShaftType==2) AssignCommand(oPC,DelayCommand(9.5,FloatingTextStringOnCreature("You careate "+IntToString(iItemStack)+" bolts.",oPC,FALSE)));
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)));
//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));
@@ -492,7 +493,7 @@ void main()
if (iFletchingSkill <= 1000)
{
//DelayCommand(12.0,SetTokenPair(oPC,13,2,iFletchingSkill));
DelayCommand(12.0,SetCampaignInt("UOACraft","iFletchingSkill",iFletchingSkill,oPC));
DelayCommand(12.0,SetPersistentInt(oPC,"iFletchingSkill",iFletchingSkill,0,"UOACraft"));
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,4 +1,5 @@
//#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);
@@ -152,7 +153,7 @@ void main()
}
//int iSmeltChance = GetTokenPair(oPC,14,2);
int iSmeltSkill = GetCampaignInt("UOACraft","iSmeltSkill",oPC);
int iSmeltSkill = GetPersistentInt(oPC,"iSmeltSkill","UOACraft");
int iSmeltChance = iSmeltSkill;
//int iSmeltSkill = iSmeltChance;
string sOre;
@@ -509,7 +510,7 @@ void main()
if (iSmeltSkill <= 1000)
{
//DelayCommand(6.0,SetTokenPair(oPC,14,2,iSmeltSkill));
DelayCommand(6.0,SetCampaignInt("UOACraft","iSmeltSkill",iSmeltSkill,oPC));
DelayCommand(6.0,SetPersistentInt(oPC,"iSmeltSkill",iSmeltSkill,0,"UOACraft"));
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+"%"));
@@ -551,6 +552,7 @@ 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";
@@ -658,7 +660,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=1;
if (iBaseItem==BASE_ITEM_GREATAXE) iMaxIngot=9;
if (iBaseItem==BASE_ITEM_GREATSWORD) iMaxIngot=10;
if (iBaseItem==BASE_ITEM_HALBERD) iMaxIngot=20;
if (iBaseItem==BASE_ITEM_HANDAXE) iMaxIngot=3;
@@ -762,9 +764,18 @@ 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 revelas the gemstone to be "+sSuccess+".";
sSuccess = "The mineral bath reveals 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,4 +1,5 @@
//#include "_persist_01a"
#include "aps_include"
void CreateAnObject(string sResource, object oPC, int iStackSize);
@@ -56,7 +57,7 @@ void main()
}
//int iGemSkill = GetTokenPair(oPC,13,7);
int iGemSkill = GetCampaignInt("UOACraft","iGemSkill",oPC);
int iGemSkill = GetPersistentInt(oPC,"iGemSkill","UOACraft");
int iGemChance = iGemSkill;
if (iGemSkill <350)
{
@@ -209,12 +210,12 @@ void main()
if (sItemResRef =="")
{
oItem = GetItemPossessedBy(OBJECT_SELF,sItemTag);
sItemResRef = GetStringRight(sItemTag,GetStringLength(sItemTag)-13)+"002";
sItemResRef = GetStringLeft(GetStringRight(sItemTag,GetStringLength(sItemTag)-13), 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++;
@@ -233,7 +234,7 @@ void main()
}
case 1:
{
DelayCommand(16.0,FloatingTextStringOnCreature("You barely manage to cut the gem, produing a poor quality cut gem.",oPC,FALSE));
DelayCommand(16.0,FloatingTextStringOnCreature("You barely manage to cut the gem, producing a poor quality cut gem.",oPC,FALSE));
sGemResRef = sGemResRef+"4";
break;
}
@@ -241,11 +242,17 @@ 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, produing an average quality cut gem.",oPC,FALSE));
DelayCommand(16.0,FloatingTextStringOnCreature("You successfully cut the gem, producing an average quality cut gem.",oPC,FALSE));
sGemResRef = sGemResRef+"3";
break;
}
@@ -300,7 +307,7 @@ void main()
if (iGemSkill <= 1000)
{
//DelayCommand(17.0,SetTokenPair(oPC,13,7,iGemSkill));
DelayCommand(17.0,SetCampaignInt("UOACraft","iGemSkill",iGemSkill,oPC));
DelayCommand(17.0,SetPersistentInt(oPC,"iGemSkill",iGemSkill,0,"UOACraft"));
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,4 +1,5 @@
//#include "_persist_01a"
#include "aps_include"
void CreateAnObject(string sResource, object oPC, int iStackSize);
@@ -203,7 +204,7 @@ void main()
int iItem = GetNumStackedItems(oItem);
//int iPolishSkill = GetTokenPair(oPC,13,6);
int iPolishSkill = GetCampaignInt("UOACraft","iPolishSkill",oPC);
int iPolishSkill = GetPersistentInt(oPC,"iPolishSkill","UOACraft");
int iPolishChance = iPolishSkill;
if (iPolishChance <350)
{
@@ -292,7 +293,7 @@ void main()
if (iPolishSkill <= 1000)
{
//DelayCommand(31.0,SetTokenPair(oPC,13,6,iPolishSkill));
DelayCommand(31.0,SetCampaignInt("UOACraft","iPolishSkill",iPolishSkill,oPC));
DelayCommand(31.0,SetPersistentInt(oPC,"iPolishSkill",iPolishSkill,0,"UOACraft"));
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,3 +1,5 @@
#include "aps_include"
void CreateAnObject(string sResource, object oPC);
void main()
@@ -310,7 +312,7 @@ void main()
oGlass = GetItemPossessedBy(oPC,"ITEM_GLASSVIAL");
if (oGlass==OBJECT_INVALID)
{
FloatingTextStringOnCreature("You must have an empty glass bottle to extract oils.",oPC,FALSE);
FloatingTextStringOnCreature("You must have an empty glass vial to extract oils.",oPC,FALSE);
CopyItem(oItem,oPC,TRUE);
DestroyObject(oItem,0.1);
return;
@@ -318,7 +320,7 @@ void main()
}
//DestroyObject(oGlass,0.1);
int iCookSkill = GetCampaignInt("UOACraft","iCookSkill",oPC);
int iCookSkill = GetPersistentInt(oPC,"iCookSkill","UOACraft");
int iCookChance = iCookSkill;
if (iCookChance<350)
@@ -399,7 +401,7 @@ void main()
if (iCookSkill <= 1000)
{
//DelayCommand(13.0,SetTokenPair(oPC,13,3,iCookSkill));
DelayCommand(6.5,SetCampaignInt("UOACraft","iCookSkill",iCookSkill,oPC));
DelayCommand(6.5,SetPersistentInt(oPC,"iCookSkill",iCookSkill,0,"UOACraft"));
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,5 +1,6 @@
//#include "_persist_01a"
#include "nw_i0_plot"
#include "aps_include"
void CreateAnObject(string sResource, object oPC);
object CreatePlaceable(string sObject, location lPlace, float fDuration);
@@ -37,7 +38,7 @@ void main()
if (GetLocalInt(OBJECT_SELF,"iAmInUse")!=0)
{
FloatingTextStringOnCreature("You must wait until the kiln is cooled off before starting any other craft.",oPC,FALSE);
FloatingTextStringOnCreature("You must wait until the kiln is at the right temprature before starting any other item.",oPC,FALSE);
if (iAdded != 99)CopyItem(oItem,oPC,TRUE);
DestroyObject(oItem);
return;
@@ -193,7 +194,7 @@ void main()
//int iGlassSkill = GetTokenPair(oPC,14,4);
int iGlassSkill = GetCampaignInt("UOACraft","iGlassSkill",oPC);
int iGlassSkill = GetPersistentInt(oPC,"iGlassSkill","UOACraft");
int iGlassChance = iGlassSkill;
object oFire = CreatePlaceable("plc_flamemedium", lFire, 6.0);
@@ -226,7 +227,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);
@@ -242,7 +243,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);
@@ -256,7 +257,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);
@@ -269,7 +270,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);
@@ -282,7 +283,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);
@@ -295,7 +296,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);
@@ -308,7 +309,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);
@@ -322,7 +323,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);
@@ -336,7 +337,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);
@@ -351,7 +352,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);
@@ -365,7 +366,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);
@@ -456,7 +457,7 @@ void main()
if (iGlassSkill <= 1000)
{
//DelayCommand(5.0,SetTokenPair(oPC,14,4,iGlassSkill));
DelayCommand(6.0,SetCampaignInt("UOACraft","iGlassSkill",iGlassSkill,oPC));
DelayCommand(6.0,SetPersistentInt(oPC,"iGlassSkill",iGlassSkill,0,"UOACraft"));
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,3 +1,5 @@
#include "aps_include"
void CreateAnObject(string sResource, object oPC, int iProduct);
void main()
@@ -114,7 +116,7 @@ void main()
}
DestroyObject(oSugar,0.2);
int iBrewSkill = GetCampaignInt("UOACraft","iBrewSkill",oPC);
int iBrewSkill = GetPersistentInt(oPC,"iBrewSkill","UOACraft");
int iBrewChance = iBrewSkill;
if (iBrewChance<350)
@@ -207,7 +209,7 @@ void main()
if (iBrewSkill <= 1000)
{
//DelayCommand(13.0,SetTokenPair(oPC,13,3,iBrewSkill));
DelayCommand(12.5,SetCampaignInt("UOACraft","iBrewSkill",iBrewSkill,oPC));
DelayCommand(12.5,SetPersistentInt(oPC,"iBrewSkill",iBrewSkill,0,"UOACraft"));
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,5 +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);
@@ -41,7 +42,7 @@ void main()
if (GetLocalInt(OBJECT_SELF,"iAmInUse") != 0)
{
CopyItem(oItem,oPC,TRUE);
SendMessageToPC(oPC,"You must wait till the hide in the tanning bath is done before starting another.");
SendMessageToPC(oPC,"You must wait till the hide currently being worked is done before starting another.");
DestroyObject(oItem);
return;
}
@@ -61,7 +62,7 @@ void main()
int iTanMode = GetLocalInt(oPC,"iTanningMode");
//int iTanChance = GetTokenPair(oPC,14,11);
//int iTanSkill = iTanChance;
int iTanSkill = GetCampaignInt("UOACraft","iLeatherSkill",oPC);
int iTanSkill = GetPersistentInt(oPC,"iLeatherSkill","UOACraft");
int iTanChance = iTanSkill;
int iTanOil = 1;
int iBeeswax = 1;
@@ -413,7 +414,7 @@ void main()
if (iTanSkill <= 1000)
{
//DelayCommand(6.0,SetTokenPair(oPC,14,11,iTanSkill));
DelayCommand(6.0,SetCampaignInt("UOACraft","iLeatherSkill",iTanSkill,oPC));
DelayCommand(6.0,SetPersistentInt(oPC,"iLeatherSkill",iTanSkill,0,"UOACraft"));
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,5 +1,6 @@
//#include "_persist_01a"
#include "nw_i0_plot"
#include "aps_include"
void CreateAnObject(string sResource, object oPC, int iStackSize);
void GetNextItemPossessedBy(object oPC, string sItemTag);
@@ -40,7 +41,7 @@ void main()
CopyObject(oItem,GetLocation(oSelf),oSelf,GetTag(oItem));
//int iClothSkill = GetTokenPair(oPC,13,4); // Clothmaking
int iClothSkill = GetCampaignInt("UOACraft","iClothSkill",oPC);
int iClothSkill = GetPersistentInt(oPC,"iClothSkill","UOACraft");
int iClothChance = iClothSkill;
if (iClothChance < 350)
{
@@ -194,7 +195,7 @@ void main()
if (iClothSkill <= 1000)
{
//DelayCommand(13.0,SetTokenPair(oPC,13,4,iClothSkill));
DelayCommand(13.0,SetCampaignInt("UOACraft","iClothSkill",iClothSkill,oPC));
DelayCommand(13.0,SetPersistentInt(oPC,"iClothSkill",iClothSkill,0,"UOACraft"));
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,3 +1,4 @@
#include "aps_include"
void CreateAnObject(string sResource, object oPC, int iProduct);
void main()
@@ -101,7 +102,7 @@ void main()
}
int iBrewSkill = GetCampaignInt("UOACraft","iBrewSkill",oPC);
int iBrewSkill = GetPersistentInt(oPC,"iBrewSkill","UOACraft");
int iBrewChance = iBrewSkill;
if (iBrewChance<350)
@@ -197,9 +198,9 @@ void main()
if (iBrewSkill <= 1000)
{
//DelayCommand(13.0,SetTokenPair(oPC,13,3,iBrewSkill));
DelayCommand(12.5,SetCampaignInt("UOACraft","iBrewSkill",iBrewSkill,oPC));
DelayCommand(12.5,SetPersistentInt(oPC,"iBrewSkill",iBrewSkill,0,"UOACraft"));
DelayCommand(12.5,SendMessageToPC(oPC,"=================================="));
DelayCommand(12.5,SendMessageToPC(oPC,"Your skill in nrewing has gone up!"));
DelayCommand(12.5,SendMessageToPC(oPC,"Your skill in brewing 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,3 +1,4 @@
#include "aps_include"
void CreateAnObject(string sResource, object oPC);
void main()
@@ -130,7 +131,7 @@ void main()
return;
}
int iCookSkill = GetCampaignInt("UOACraft","iCookSkill",oPC);
int iCookSkill = GetPersistentInt(oPC,"iCookSkill","UOACraft");
int iCookChance = iCookSkill;
DestroyObject(oItem,0.1);
@@ -213,7 +214,7 @@ void main()
if (iCookSkill <= 1000)
{
//DelayCommand(13.0,SetTokenPair(oPC,13,3,iCookSkill));
DelayCommand(14.5,SetCampaignInt("UOACraft","iCookSkill",iCookSkill,oPC));
DelayCommand(14.5,SetPersistentInt(oPC,"iCookSkill",iCookSkill,0,"UOACraft"));
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,4 +1,5 @@
//#include "_persist_01a"
#include "aps_include"
void CreateAnObject(string sResource, object oPC, int iStackSize);
@@ -33,7 +34,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;
}
@@ -41,7 +42,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 baking it into paper.",oPC,FALSE);
FloatingTextStringOnCreature("You must first bleach this pulp before pressing and making it into paper.",oPC,FALSE);
DestroyObject(oItem);
return;
}
@@ -49,7 +50,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;
}
@@ -82,7 +83,7 @@ void main()
}
//int iPaperSkill = GetTokenPair(oPC,13,13);
int iPaperSkill = GetCampaignInt("UOACraft","iPaperSkill",oPC);
int iPaperSkill = GetPersistentInt(oPC,"iPaperSkill","UOACraft");
int iPaperChance = iPaperSkill;
if (iPaperSkill <350)
{
@@ -225,7 +226,7 @@ void main()
if (iPaperSkill <= 1000)
{
//DelayCommand(30.0,SetTokenPair(oPC,13,13,iPaperSkill));
DelayCommand(30.0,SetCampaignInt("UOACraft","iPaperSkill",iPaperSkill,oPC));
DelayCommand(30.0,SetPersistentInt(oPC,"iPaperSkill",iPaperSkill,0,"UOACraft"));
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+"%"));
@@ -241,7 +242,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,5 +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);
@@ -33,7 +34,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;
}
@@ -49,7 +50,7 @@ void main()
if (sItemTag=="P_PULP_BLEACHED_SILK")
{
SetLocalInt(oPC,"iPulpType",1);
FloatingTextStringOnCreature("Setting up to bleach wood pulp with silk addative.",oPC,FALSE);
FloatingTextStringOnCreature("Setting up to bleach wood pulp with silk additive.",oPC,FALSE);
}
string sTagSelf = GetTag(oSelf);
AssignCommand(oPC,DoPlaceableObjectAction(oSelf,PLACEABLE_ACTION_USE));
@@ -96,7 +97,7 @@ void main()
//int iPaperSkill = GetTokenPair(oPC,13,7);
int iPaperSkill = GetCampaignInt("UOACraft","iPaperSkill",oPC);
int iPaperSkill = GetPersistentInt(oPC,"iPaperSkill","UOACraft");
int iPaperChance = iPaperSkill;
if (iPaperSkill <350)
{
@@ -154,7 +155,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,4 +1,5 @@
#include "nw_i0_plot"
#include "aps_include"
string GetInk(object oItem);
string GetComponent(object oItem);
@@ -57,7 +58,7 @@ void main()
int iDifficulty;
int iRandom;
int iSkillGain;
int iScribeSkill = GetCampaignInt("UOACraft","iScribeSkill",oPC);
int iScribeSkill = GetPersistentInt(oPC,"iScribeSkill","UOACraft");
int iScribeChance = iScribeSkill;
if (iScribeChance < 350)
{
@@ -183,7 +184,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;
@@ -211,7 +212,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);
@@ -269,7 +270,7 @@ void main()
if (iScribeSkill <= 1000)
{
//DelayCommand(13.0,SetTokenPair(oPC,13,12,iDyeSkill));
DelayCommand(13.0,SetCampaignInt("UOACraft","iScribeSkill",iScribeSkill,oPC));
DelayCommand(13.0,SetPersistentInt(oPC,"iScribeSkill",iScribeSkill,0,"UOACraft"));
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+"%"));
@@ -360,7 +361,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,4 +1,5 @@
//#include "_persist_01a"
#include "aps_include"
void CreateAnObject(string sResource, object oPC, int iStackSize);
void SpinNextItemPossessedBy(object oSelf, object oPC, string sItemTag);
@@ -91,7 +92,7 @@ void main()
//int iSpindleSkill = GetTokenPair(oPC,13,10);
int iSpindleSkill = GetCampaignInt("UOACraft","iSpindleSkill",oPC);
int iSpindleSkill = GetPersistentInt(oPC,"iSpindleSkill","UOACraft");
int iSpindleChance = iSpindleSkill;
int iSuccess = 0;
int iSuccess2 = 0;
@@ -214,7 +215,7 @@ void main()
if (iSpindleSkill <= 1000)
{
//DelayCommand(10.0,SetTokenPair(oPC,13,10,iSpindleSkill));
DelayCommand(10.0,SetCampaignInt("UOACraft","iSpindleSkill",iSpindleSkill,oPC));
DelayCommand(10.0,SetPersistentInt(oPC,"iSpindleSkill",iSpindleSkill,0,"UOACraft"));
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+"%"));
@@ -269,7 +270,7 @@ void SpinNextItemPossessedBy(object oSelf, object oPC, string sItemTag)
//int iSpindleSkill = GetTokenPair(oPC,13,10);
int iSpindleSkill = GetCampaignInt("UOACraft","iSpindleSkill",oPC);
int iSpindleSkill = GetPersistentInt(oPC,"iSpindleSkill","UOACraft");
int iSpindleChance = iSpindleSkill;
int iSuccess = 0;
int iSuccess2 = 0;
@@ -392,7 +393,7 @@ void SpinNextItemPossessedBy(object oSelf, object oPC, string sItemTag)
if (iSpindleSkill <= 1000)
{
//DelayCommand(10.0,SetTokenPair(oPC,13,10,iSpindleSkill));
DelayCommand(10.0,SetCampaignInt("UOACraft","iSpindleSkill",iSpindleSkill,oPC));
DelayCommand(10.0,SetPersistentInt(oPC,"iSpindleSkill",iSpindleSkill,0,"UOACraft"));
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,3 +1,5 @@
#include "aps_include"
void CreateAnObject(string sResource, object oPC, int iProduct);
void main()
@@ -156,13 +158,12 @@ void main()
if (sProduct1=="INVALID")
{
SendMessageToPC(oPC,"You may not distill this item!");
CopyItem(oItem,oPC,TRUE);
DestroyObject(oItem,0.1);
return;
}
int iBrewSkill = GetCampaignInt("UOACraft","iBrewSkill",oPC);
int iBrewSkill = GetPersistentInt(oPC,"iBrewSkill","UOACraft");
int iBrewChance = iBrewSkill;
if (iBrewChance<350)
@@ -251,9 +252,9 @@ void main()
if (iBrewSkill <= 1000)
{
//DelayCommand(13.0,SetTokenPair(oPC,13,3,iBrewSkill));
DelayCommand(12.5,SetCampaignInt("UOACraft","iBrewSkill",iBrewSkill,oPC));
DelayCommand(12.5,SetPersistentInt(oPC,"iBrewSkill",iBrewSkill,0,"UOACraft"));
DelayCommand(12.5,SendMessageToPC(oPC,"=================================="));
DelayCommand(12.5,SendMessageToPC(oPC,"Your skill in nrewing has gone up!"));
DelayCommand(12.5,SendMessageToPC(oPC,"Your skill in brewing 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 = GetCampaignInt("UOACraft","iTailorSkill",oPC);
int iTailorSkill = GetPersistentInt(oPC,"iTailorSkill","UOACraft");
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,SetCampaignInt("UOACraft","iTailorSkill",iTailorSkill,oPC));
DelayCommand(13.0,SetPersistentInt(oPC,"iTailorSkill",iTailorSkill,0,"UOACraft"));
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 = GetCampaignInt("UOACraft","iTailorSkill",oPC);
int iTailorSkill = GetPersistentInt(oPC,"iTailorSkill","UOACraft");
int iTailorChance = iTailorSkill;
if (iTailorChance < 350)
{
@@ -375,8 +375,8 @@ void main()
{
//iTailorChance = iTailorChance - 200;
sItemResRefPoor = CraftLookup("cloth002",iClothType);
sItemResRef = CraftLookup("cloth237",iClothType);
sItemResRefExceptional = CraftLookup("cloth238",iClothType);
sItemResRef = CraftLookup("cloth246",iClothType);
sItemResRefExceptional = CraftLookup("cloth247",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,SetCampaignInt("UOACraft","iTailorSkill",iTailorSkill,oPC));
DelayCommand(13.0,SetPersistentInt(oPC,"iTailorSkill",iTailorSkill,0,"UOACraft"));
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 = GetCampaignInt("UOACraft","iTanSkill",oPC);
int iTanSkill = GetPersistentInt(oPC,"iTanSkill","UOACraft");
//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,SetCampaignInt("UOACraft","iTanSkill",iTanSkill,oPC));
DelayCommand(6.0,SetPersistentInt(oPC,"iTanSkill",iTanSkill,0,"UOACraft"));
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 = GetCampaignInt("UOACraft","iCureSkill",oPC);
int iTanSkill = GetPersistentInt(oPC,"iCureSkill","UOACraft");
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,SetCampaignInt("UOACraft","iCureSkill",iTanSkill,oPC));
DelayCommand(6.0,SetPersistentInt(oPC,"iCureSkill",iTanSkill,0,"UOACraft"));
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 tools to work with..",oPC,FALSE);
FloatingTextStringOnCreature("You do not have any tinker's toolset 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 = GetCampaignInt("UOACraft","iTinkerSkill",oPC);
int iGlassSkill = GetPersistentInt(oPC,"iTinkerSkill","UOACraft");
int iGlassChance = iGlassSkill;
if (iGlassChance <350)
{
@@ -174,14 +174,14 @@ void main()
if (iAdded==0)
{
if (GetStringRight(sItemResRef,3)=="001") // Tinkers toolkit
if (GetStringRight(sItemResRef,3)=="001") // Tinkers toolset
{
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") // Excavation Tools
if (GetStringRight(sItemResRef,3)=="089") // Smith Hammer
{
//iComponent1Stackable=0;
//iStackable=1;
iComponent1 =6;
sComponent1 = "INGOT_IRON";
sComponent1Name = "iron ingots";
iGlassChance = iGlassChance - 400;
sCraft = "item_excavation";
sFailString = "The measurements are off and as a result the excavation tools are useless.";
}
iGlassChance = iGlassChance - 10;
sCraft = "blacksmithhammer";
sFailString = "The measurements are off, and as a result the smith hammer is 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 carpenters tools are useless.";
sFailString = "The measurements are off, and as a result the carpenter's tools are useless.";
}
}
@@ -794,7 +794,7 @@ void main()
if (iGlassSkill <= 1000)
{
//DelayCommand(5.0,SetTokenPair(oPC,14,5,iGlassSkill));
DelayCommand(6.0,SetCampaignInt("UOACraft","iTinkerSkill",iGlassSkill,oPC));
DelayCommand(6.0,SetPersistentInt(oPC,"iTinkerSkill",iGlassSkill,0,"UOACraft"));
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+"%"));

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,904 @@
////////////////////////////////////////////////////////////////////////////////
// // //
// _kb_loot_corpse (include file) // VERSION 3.3 //
// // //
// by Scrotok on 9 Feb 03 ////////////////////////////
// Thanks to Keron Blackfeld for 99% of the work! //
// email Questions and Comments to: jnbplatte@intellisys.net //
// //
////////////////////////////////////////////////////////////////////////////////
// //
// CAUTION: You MUST re-save/compile (F7 key) "nw_c2_default7" whenever //
// "_kb_loot_corpse" is modified! //
// //
// CAUTION: You MUST re-save (not the F7 key!) "_kb_loot_corpse" if you make //
// any changes to "_kb_inc_invmgmt" (for programmers only: because it is an //
// #include file). To re-save it, make a change to the script, then UNDO //
// the change, then re-save. //
// //
// NEWBIES: You don't need to place this script anywhere -- it's included as //
// part of "nw_c2_default7" using the #include command. All you need to do //
// is configure the script (see below) as desired. //
// //
////////////////////////////////////////////////////////////////////////////////
// //
// //
// CONFIGURING THE SCRIPT //
// //
// This script supports some configuration by the user. Following the //
// void LeaveCorpse() of the _kb_loot_corpse, you'll find a section where //
// you can set a few things. These include: (with default values displayed) //
// //
// //
// int nUseLootable = TRUE This enables the script. Setting is to FALSE //
// disables it. //
// //
// int nMoveEquipped = TRUE Setting this to FALSE will stop the script //
// from moving equipped items (other than //
// Armour/Helmet and Weapons/Shield/Torch) to //
// the lootable corpse placeable. (To prevent //
// the move/copy of Armour/Helmet and Weapons/ //
// Shield/Torch, use the next four toggles.) //
// Remember that CREATURE SLOTTED items are //
// NEVER moved. //
// //
// int nCopyArmour = TRUE This will use the ResRef to create a copy of //
// the Armour/Helmet the creature is wearing. //
// If you do not want to use this function, you //
// may want to consider the next one (called //
// nMoveArmour). nCopyArmour takes precedence //
// over nMoveArmour if both are TRUE. //
// //
// int nMoveArmour = FALSE Setting this TRUE will just move the armour //
// from the Chest slot to the lootable corpse //
// placeable on death; it will also move the //
// helmet from the Head slot to the lootable //
// corpse placeable. This can be a visual issue //
// when used with NPCs - since when the armour //
// is moved, the NPC will become 'naked'. //
// //
// *** If you do not wish to use either of the armour functions, just set //
// both values to FALSE. Then just add an additional suit of armour //
// and/or helmet to the inventory of creatures you want to have drop //
// their armour/helmet. //
// //
// int nDropWeapons = TRUE This will use the ResRef for dropping the //
// weapons on the ground - which is accomplished //
// by creating new ones on the ground and //
// destroying the ones in the creature's //
// inventory. NOTE: Even though the parameter //
// is called nDropWeapons, anything held in the //
// left or right hand (shield, torch, etc.) is //
// affected by this parameter. nDropWeapons //
// takes precedence over nMoveWeapons if both //
// are TRUE. //
// //
// int nMoveWeapons = FALSE Setting this TRUE will just move the weapons //
// to the Lootable Object just as the rest of //
// inventory is handled. NOTE: Even though the //
// parameter is called nMoveWeapons, anything //
// held in the left or right hand (shield, //
// torch, etc.) is affected by this parameter. //
// //
// *** If you do not wish to use either of the weapon functions, just set //
// both values to FALSE. Then just add additional weapons/shields/ //
// torches to the inventory of creatures you want to have drop those //
// items. //
// //
// int nUseBlood = TRUE Set this to TRUE if you want a Bloodspot to //
// appear under the corpse for a little extra //
// gory appeal. In addition, it will allow for //
// a grisly display if the corpse is destroyed. //
// Undead/constructs/elementals will not leave a //
// Bloodspot or "gib" when bashed. //
// //
// int nTinyBlood = FALSE Set this to FALSE if you don't want Tiny- //
// sized creatures (rats, bats, etc.) to leave a //
// Bloodspot, scorch mark, or small flame. They //
// will still "gib" normally. Only applies if //
// nUseBlood = TRUE. //
// //
// int nUseFlame = TRUE Set this to TRUE if you want a scorch mark or //
// a small flame (which burns out after 10-120 //
// seconds, and is replaced by a scorch mark) to //
// appear if 1/3 or more of the damage which //
// killed the creature was fire or electrical. //
// Scorch mark or flame will appear instead of //
// Bloodspot. If the total fire or electrical //
// damage exceeds the creature's max HP, a small //
// flame appears instead of a scorch mark. The //
// corpse will still gib normally. Undead, //
// constructs, and elementals will leave a //
// scorch mark, small flame, or nothing. Only //
// applies if nUseBlood = TRUE. //
// //
// int nCorpseFade = 0 This is the delay in actual seconds that the //
// corpse will remain before it fades. If you //
// set this to 0 (zero) it will turn off the //
// corpse fade - allowing all bodies and loot //
// to remain indefinitely. //
// //
// int nUseBonesBash = TRUE Set this to TRUE if you want bones to appear //
// when the corpse is bashed. The bones cannot //
// be bashed; they will only disappear if //
// nBonesFade > 0. //
// //
// int nUseBonesFade = TRUE Set this to TRUE if you want bones to appear //
// when the corpse fades. The bones cannot //
// be bashed; they will only disappear if //
// nBonesFade > 0. //
// //
// int nBonesFade = 60 This is the delay in actual seconds that the //
// bones will remain before they fade. If you //
// set this to 0 (zero) it will turn off the //
// bones fade - allowing all bones (and loot, //
// if the bones contain any) to remain forever. //
// //
// int nTinyBones = FALSE Set this to FALSE if you don't want Tiny- //
// sized creatures (rats, bats, etc.) to turn //
// into bones when their corpse is bashed or //
// fades. Only applies if nUseBonesBash and/or //
// nUseBonesFade = TRUE. //
// //
// int nKeepInventoryBash = FALSE Set this to TRUE if you want all items //
// in a creature's inventory to remain when //
// its corpse is bashed. If installed, //
// DOA's "Bashed Loot Breakage" plugin //
// ("doa_bashbreak") takes precedence over //
// nKeepInventoryBash. //
// //
// int nKeepInventoryFade = FALSE Set this to TRUE if you want all items //
// in a creature's inventory to remain when //
// its corpse fades. //
// //
// int nKeepEmpties = TRUE Set this to FALSE if you want EMPTY corpses //
// to fade immediately after their inventory is //
// emptied (and dropped weapons are claimed, //
// unless nKeepWeaponsEmpty is TRUE). //
// //
// int nKeepWeaponsBonesFade = FALSE Set this to FALSE if you want //
// dropped, unclaimed, non-plot weapons //
// to be destroyed when bones fade. //
// Only valid if nBonesFade > 0. //
// //
// int nKeepWeaponsCorpseFade = TRUE Set this to FALSE if you want //
// dropped, unclaimed, non-plot weapons //
// to be destroyed when corpses fade. //
// Only valid if nCorpseFade > 0. //
// //
// int nKeepWeaponsBash = TRUE Set this to FALSE if you want //
// dropped, unclaimed, non-plot weapons //
// to be destroyed when corpses are //
// bashed. //
// //
// int nKeepWeaponsEmpty = TRUE Set this to TRUE if you want empty //
// corpses to be destroyed even if //
// dropped weapons are unclaimed. //
// //
// *** Even though the 4 parameters listed above start with "nKeepWeapons", //
// anything held in the left or right hand (shield, torch, etc.) is //
// affected by these parameters, not just weapons. //
// //
// int nOverrideForPlacedCorpses = TRUE Set this to TRUE if you want the //
// 'Spawned Corpses' you place to be //
// permament. Setting it to FALSE //
// will cause your Placed Dead //
// creatures to act as the settings //
// above dictate. (i.e. Fading Out //
// after the delay or being emptied) //
// To use this functionality, you //
// should place the _kb_plc_corpse //
// script in the OnSpawn of the //
// critter you want to spawn dead. //
// //
////////////////////////////////////////////////////////////////////////////////
/* Version 3.3 Change Log:
- added SetPlotFlag to ensure oLootCorpse can't be destroyed before oHostBody is emptied (and weapons are dropped)
- fixed comments to clarify that "doa_bashbreak" script refers to DOA's "Bashed Loot Breakage" plugin
/* Version 3.2 Change Log:
- consolidated inventory management functions to _kb_inc_invmgmt
- DestroyInventory function calls changed to DestroyInventory + DestroyDroppedWeapons in _kb_inc_invmgmt (identical)
- added nTinyBlood and nUseFlame (added Flameout function and rewrote Bloodspot routine)
- added GetIsObjectValid check before destroying Bloodspot
- removed ActionWait (wasn't needed)
- combined several DelayCommand's into a single function (FadeCorpse) to improve performance
- improved FadeCorpse to take advantage of new functionality (nKeepInventoryFade, nUseBonesFade, etc.)
- fixed bug in DropLeftWeapon/DropRightWeapon that caused dropped weapons to have incorrect GetIdentified value
- fixed bug where 2 copies of droppable, equipped, Plot armor were created instead of 1 when corpse was bashed
- fixed bug that caused copied armor to have incorrect GetPlotFlag and GetIdentified values
- added nUseBonesBash to create bones when corpse is bashed
- added nUseBonesFade to create bones when corpse fades
- added nBonesFade to determine when bones fade (if ever)
- added nTinyBones to prevent bones from appearing for tiny-sized creatures
- added nKeepInventoryBash to keep all items in a creature's inventory when its corpse is bashed
- added nKeepInventoryFade to keep all items in a creature's inventory when its corpse fades
- replaced nKeepWeapons with: nKeepWeaponsBonesFade, nKeepWeaponsCorpseFade, nKeepWeaponsBash, and nKeepWeaponsEmpty
- changed comments to clarify weapons/shields/torches are affected by "weapons" parameters/functions
- changed comments to reflect that undead/constructs/elementals will not leave Bloodspot or "gib" when bashed
- fixed bug so that nCopyArmour takes precedence over nMoveArmour if both are TRUE
- added comments to clarify that nCopyArmour takes precedence over nMoveArmour if both are TRUE
- added comments to clarify that nDropWeapons takes precedence over nMoveWeapons if both are TRUE
- renamed oDeadNPC to oHostBody, and vDeadNPCLoc to vHostBodyLoc for consistency
- fixed bug so that nCopyArmour/nMoveArmour affect helmets equipped in the creature's Head slot, as well
- added support for "Destroy Target" command of DM's Helper wand (used to destroy the corpse or bones)
- added code to pass oLeftWpn/oRightWpn from oHostBody to oLootCorpse for use with Scrotok's Raise Dead/Ressurection Plugin
*/
#include "_kb_inc_invmgmt"
#include "sd_lootsystem"
/*******************************************************************************
** This script was borrowed from the Hard Core Ruleset, where they use it to **
** move a Dead PC's inventory to a lootable corpse object. Credit where **
** credit is due, I always say. :) **
*******************************************************************************/
object strip_equipped(object oHostBody, object oLootCorpse, object oEquip)
{
if(GetIsObjectValid(oEquip) && GetDroppableFlag(oEquip))
{
AssignCommand(oLootCorpse, ActionTakeItem(oEquip, oHostBody));
}
return oEquip;
}
/*******************************************************************************
** These scripts drop weapons/shields/torches held in the corpse's hands. **
** **
** SPECIAL THANKS TO DREZDAR and MOJO for their help in getting these two **
** drop weapon scripts written. I never would have gotten the vectors right, **
** but THEY sure did! **
** **
** (East = 0, North = 90, West = 180, South = 270) **
** **
*******************************************************************************/
void DropLeftWeapon(object oLeftWpn, object oLootCorpse)
{
if(GetIsObjectValid(oLeftWpn) && GetDroppableFlag(oLeftWpn))
{
vector vCorpseLoc = GetPositionFromLocation(GetLocation(oLootCorpse));
float fDifferential = 45.0f + IntToFloat(d20());//Randomize the Drop Angle
float fDistance = 0.5f + (IntToFloat(d10())/10);//Randomize the Drop Distance
float fVarWpnFace = -20.0f - IntToFloat(d20(2));//Randomize the Drop Facing
float fFacing = GetFacing(oLootCorpse);
fFacing = fFacing + fDifferential;
if (fFacing > 360.0f)
{ fFacing = 720.0f - fFacing; }
if (fFacing < 0.0f)
{ fFacing = 360.0f + fFacing; }
float fWpnFacing = GetFacing(oLootCorpse) + fVarWpnFace;
if (fWpnFacing > 360.0f)
{ fWpnFacing = 720.0f - fWpnFacing; }
if (fWpnFacing < 0.0f)
{ fWpnFacing = 360.0f + fWpnFacing; }
object oArea = GetArea(oLootCorpse);
//Generate New Location
float fNewX;
float fNewY;
float fNewZ;
if ((fFacing > 0.0f) && (fFacing < 90.0f))
{ fNewX = vCorpseLoc.x + ((cos(fFacing))*fDistance); fNewY = vCorpseLoc.y + ((sin(fFacing))*fDistance); fNewZ = vCorpseLoc.z; }
else if ((fFacing > 90.0f) && (fFacing < 180.0f))
{ fNewX = vCorpseLoc.x - ((cos(180.0f - fFacing))*fDistance); fNewY = vCorpseLoc.y + ((sin(180.0f - fFacing))*fDistance); fNewZ = vCorpseLoc.z; }
else if ((fFacing > 180.0f) && (fFacing < 270.0f))
{ fNewX = vCorpseLoc.x - ((cos(fFacing - 180.0f))*fDistance); fNewY = vCorpseLoc.y - ((sin(fFacing - 180.0f))*fDistance); fNewZ = vCorpseLoc.z; }
else if ((fFacing > 270.0f) && (fFacing < 360.0f))
{ fNewX = vCorpseLoc.x + ((cos(360.0f - fFacing))*fDistance); fNewY = vCorpseLoc.y - ((sin(360.0f - fFacing))*fDistance); fNewZ = vCorpseLoc.z; }
else if (fFacing == 0.0f)
{ fNewX = vCorpseLoc.x + fDistance; fNewY = vCorpseLoc.y; fNewZ = vCorpseLoc.z; }
else if (fFacing == 90.0f)
{ fNewX = vCorpseLoc.x; fNewY = vCorpseLoc.y + fDistance; fNewZ = vCorpseLoc.z; }
else if (fFacing == 180.0f)
{ fNewX = vCorpseLoc.x - fDistance; fNewY = vCorpseLoc.y; fNewZ = vCorpseLoc.z; }
else if (fFacing == 270.0f)
{ fNewX = vCorpseLoc.x; fNewY = vCorpseLoc.y - fDistance; fNewZ = vCorpseLoc.z; }
vector vNewFinal = Vector(fNewX, fNewY, fNewZ);
location lDropLeft = Location(oArea, vNewFinal, fWpnFacing);
//Drop Weapon
string sLeftWpnRef = GetResRef(oLeftWpn);
int nID = GetIdentified(oLeftWpn);
if (GetPlotFlag(oLeftWpn))
{
SetPlotFlag(oLeftWpn, FALSE);
DestroyObject(oLeftWpn);
oLeftWpn = CreateObject(OBJECT_TYPE_ITEM, sLeftWpnRef, lDropLeft, FALSE);
SetPlotFlag(oLeftWpn, TRUE);
}
else
{
DestroyObject(oLeftWpn);
oLeftWpn = CreateObject(OBJECT_TYPE_ITEM, sLeftWpnRef, lDropLeft, FALSE);
}
SetIdentified(oLeftWpn, nID);
SetLocalObject(oLootCorpse, "oLeftWpn", oLeftWpn);
}
// We're done with oHostBody, so allow oLootCorpse to be destroyable
AssignCommand(oLootCorpse, ActionDoCommand(SetPlotFlag(oLootCorpse, FALSE)));
}
void DropRightWeapon(object oRightWpn, object oLootCorpse)
{
if(GetIsObjectValid(oRightWpn) && GetDroppableFlag(oRightWpn))
{
vector vCorpseLoc = GetPositionFromLocation(GetLocation(oLootCorpse));
float fDifferential = -45.0f + IntToFloat(d20());//Randomize the Drop Angle
float fDistance = 0.5f + (IntToFloat(d10())/10);//Randomize the Drop Distance
float fVarWpnFace = 20.0f - IntToFloat(d20(2));//Randomize the Drop Facing
float fFacing = GetFacing(oLootCorpse);
fFacing = fFacing + fDifferential;
if (fFacing > 360.0f)
{ fFacing = 720.0f - fFacing; }
if (fFacing < 0.0f)
{ fFacing = 360.0f + fFacing; }
float fWpnFacing = GetFacing(oLootCorpse) + fVarWpnFace;
if (fWpnFacing > 360.0f)
{ fWpnFacing = 720.0f - fWpnFacing; }
if (fWpnFacing < 0.0f)
{ fWpnFacing = 360.0f + fWpnFacing; }
object oArea = GetArea(oLootCorpse);
//Generate New Location
float fNewX;
float fNewY;
float fNewZ;
if ((fFacing > 0.0f) && (fFacing < 90.0f))
{ fNewX = vCorpseLoc.x + ((cos(fFacing))*fDistance); fNewY = vCorpseLoc.y + ((sin(fFacing))*fDistance); fNewZ = vCorpseLoc.z; }
else if ((fFacing > 90.0f) && (fFacing < 180.0f))
{ fNewX = vCorpseLoc.x - ((cos(180.0f - fFacing))*fDistance); fNewY = vCorpseLoc.y + ((sin(180.0f - fFacing))*fDistance); fNewZ = vCorpseLoc.z; }
else if ((fFacing > 180.0f) && (fFacing < 270.0f))
{ fNewX = vCorpseLoc.x - ((cos(fFacing - 180.0f))*fDistance); fNewY = vCorpseLoc.y - ((sin(fFacing - 180.0f))*fDistance); fNewZ = vCorpseLoc.z; }
else if ((fFacing > 270.0f) && (fFacing < 360.0f))
{ fNewX = vCorpseLoc.x + ((cos(360.0f - fFacing))*fDistance); fNewY = vCorpseLoc.y - ((sin(360.0f - fFacing))*fDistance); fNewZ = vCorpseLoc.z; }
else if (fFacing == 0.0f)
{ fNewX = vCorpseLoc.x + fDistance; fNewY = vCorpseLoc.y; fNewZ = vCorpseLoc.z; }
else if (fFacing == 90.0f)
{ fNewX = vCorpseLoc.x; fNewY = vCorpseLoc.y + fDistance; fNewZ = vCorpseLoc.z; }
else if (fFacing == 180.0f)
{ fNewX = vCorpseLoc.x - fDistance; fNewY = vCorpseLoc.y; fNewZ = vCorpseLoc.z; }
else if (fFacing == 270.0f)
{ fNewX = vCorpseLoc.x; fNewY = vCorpseLoc.y - fDistance; fNewZ = vCorpseLoc.z; }
vector vNewFinal = Vector(fNewX, fNewY, fNewZ);
location lDropRight = Location(oArea, vNewFinal, fWpnFacing);
//Drop Weapon
string sRightWpnRef = GetResRef(oRightWpn);
int nID = GetIdentified(oRightWpn);
if (GetPlotFlag(oRightWpn))
{
SetPlotFlag(oRightWpn, FALSE);
DestroyObject(oRightWpn);
oRightWpn = CreateObject(OBJECT_TYPE_ITEM, sRightWpnRef, lDropRight, FALSE);
SetPlotFlag(oRightWpn, TRUE);
}
else
{
DestroyObject(oRightWpn);
oRightWpn = CreateObject(OBJECT_TYPE_ITEM, sRightWpnRef, lDropRight, FALSE);
}
SetIdentified(oRightWpn, nID);
SetLocalObject(oLootCorpse, "oRightWpn", oRightWpn);
}
}
/*******************************************************************************
** This script gets rid of the bloodspot, lootable corpse, and creature body **
*******************************************************************************/
void FadeCorpse(object oCorpseBlood, object oLootCorpse, object oHostBody)
{
//Delete the BloodSpot (if created)
if (GetIsObjectValid(oCorpseBlood))
{
DestroyObject(oCorpseBlood);
}
// Empty (or don't empty) the lootable corpse placeable
if (GetLocalInt(oLootCorpse, "nKeepInventoryFade") == FALSE)
// Delete all items (except Plot) from lootable corpse placeable
DestroyInventory(oLootCorpse);
else
{
// Do nothing (delete nothing from lootable corpse placeable)
}
// If user wants bones to be created when corpse fades...
if (GetLocalInt(oLootCorpse, "nUseBonesFade"))
{
if ((GetLocalInt(oLootCorpse, "nTinyBones") == FALSE) && (GetCreatureSize(oHostBody) == CREATURE_SIZE_TINY))
{
// Do nothing -- no bones for tiny creatures if nTinyBones is FALSE
}
else
{
// Create the bones
object oBones = CreateObject(OBJECT_TYPE_PLACEABLE, "loot_bones_obj", GetLocation(oLootCorpse), FALSE);
// Move inventory to bones
TransferToBones(oLootCorpse, oBones);
// Fade bones after nBoneFade seconds
if (GetLocalInt(oLootCorpse, "nBonesFade") > 0)
{
// Remember racial type and Blueprint ResRef for use with Scrotok's Raise Dead/Resurrection plugin
SetLocalInt(oBones, "nRacialType", GetLocalInt(oLootCorpse, "nRacialType"));
SetLocalString(oBones, "sHostBodyResRef", GetLocalString(oLootCorpse, "sHostBodyResRef"));
// Pass dropped weapon/shield/torch info to bones
SetLocalObject(oBones, "oLeftWpn", GetLocalObject(oLootCorpse, "oLeftWpn"));
SetLocalObject(oBones, "oRightWpn", GetLocalObject(oLootCorpse, "oRightWpn"));
int nKeepWeaponsBonesFade = GetLocalInt(oLootCorpse, "nKeepWeaponsBonesFade");
// Remember nKeepWeaponsBonesFade for use with DM's Helper wand
SetLocalInt(oBones, "nKeepWeaponsBonesFade", nKeepWeaponsBonesFade);
float fBonesFade = IntToFloat(GetLocalInt(oLootCorpse, "nBonesFade"));
AssignCommand(oBones, DelayCommand(fBonesFade, BonesCleanup(oBones, nKeepWeaponsBonesFade)));
}
}
}
// Delete unclaimed, dropped, non-Plot weapons unless nKeepWeaponsCorpseFade = 1
if (!GetLocalInt(oLootCorpse, "nKeepWeaponsCorpseFade"))
DestroyDroppedWeapons(oLootCorpse);
// Delete the lootable corpse placeable
DestroyObject(oLootCorpse);
// Empty and delete actual creature corpse (body)
DestroyInventory(oHostBody);
/* There is no call to DestroyDroppedWeapons since if the weapons are
dropped, they are already deleted from oHostBody. If the weapons are
not dropped, then the function would still not delete the weapons
since GetItemPossessor would be a valid object */
SetIsDestroyable(TRUE,FALSE,FALSE);
// NOTE: The following line MUST be last in this script, since oHostBody
// is the same as OBJECT_SELF
DestroyObject(oHostBody);
}
/*******************************************************************************
** This script replaces the small flame with a scorch mark **
*******************************************************************************/
void Flameout(object oCorpseBlood, object oLootCorpse)
{
location lBloodLoc = GetLocation(oCorpseBlood);
/*
// Used for debugging
SendMessageToPC(GetFirstPC(), "Flame script started...");
if (!GetIsObjectValid(oCorpseBlood))
{
// This should never happen (if you bash/fade corpse, oHostBody is
// destroyed, so Flameout won't run (can't add to action queue of invalid
// object)
SendMessageToPC(GetFirstPC(), "Flame already destroyed... location for new scorch unknown?");
}
*/
// Get rid of small flame
DestroyObject(oCorpseBlood);
// ... and turn it into a scorch mark
oCorpseBlood = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_weathmark", lBloodLoc, FALSE);
ExecuteScript("sl_destroyself2", oCorpseBlood);
//Set Local for deletion later if needed
SetLocalObject(oLootCorpse, "oBloodSpot", oCorpseBlood);
}
void BodyFade(object oHostBody, object oBlood)
{
object oBones;
location lLoc = GetLocation(oHostBody);
SetPlotFlag(oHostBody, FALSE);
AssignCommand(oHostBody, SetIsDestroyable(TRUE,FALSE,FALSE));
if ((GetRacialType(oHostBody) != RACIAL_TYPE_CONSTRUCT) &&
(GetRacialType(oHostBody) != RACIAL_TYPE_ELEMENTAL)&&
(GetRacialType(oHostBody) != RACIAL_TYPE_DRAGON)&&
(GetRacialType(oHostBody) != RACIAL_TYPE_ANIMAL)&&
GetTag(oHostBody)!="sd_coff_mummy")
{
oBones = CreateObject(OBJECT_TYPE_PLACEABLE, "sd_remains", lLoc, FALSE);
ExecuteScript("sl_destroyself", oBones);
}
DestroyObject(oBlood);
if (GetIsDead(oHostBody))DestroyObject(oHostBody, 0.2f);
}
void LeaveCorpse()
{
//SET YOUR LOOTABLE CORPSES PREFERENCES HERE ///////////////
//
int nUseLootable = TRUE; // Set this to FALSE if you want disable the lootable corpse functionality //
int nMoveEquipped = FALSE; // Set this to FALSE if you don't want to move Equipped items to the corpse //
int nCopyArmour = FALSE; // This will use the ResRef to create a copy of the armour/helmet //
int nMoveArmour = FALSE; // Setting this TRUE will just move the armour/helmet (Naked NPCs) //
int nDropWeapons = TRUE; // This will use the ResRef for dropping the weapons on the ground //
int nMoveWeapons = FALSE; // Setting this TRUE will just move the weapons to the Lootable Object //
int nUseBlood = FALSE; // Set this to TRUE if you want a Bloodspot to appear under the corpse and have //
// "gibs" when a corpse is destroyed. Undead/constructs/elementals won't leave a //
// Bloodspot or gib. //
int nTinyBlood = FALSE; // Set this to FALSE if you don't want Tiny-sized creatures (rats, bats, etc.) to //
// leave a Bloodspot, scorch mark, or small flame. They will still "gib" //
// normally. Only applies if nUseBlood = TRUE. //
int nUseFlame = FALSE; // Set this to TRUE if you want a scorch mark or a small flame (which burns out //
// after 10-120 seconds, and is replaced by a scorch mark) to appear if 1/3 or //
// more of the damage which killed the creature was fire or electrical. Scorch //
// mark or flame will appear instead of Bloodspot. If the total fire or //
// electrical damage exceeds the creature's max HP, a small flame appears instead //
// of a scorch mark. The corpse will still gib normally. Undead, constructs, //
// and elementals will leave a scorch mark, small flame, or nothing. Only //
// applies if nUseBlood = TRUE. //
int nCorpseFade = 0; // Set this to 0 (ZERO) if you DO NOT want the corpses to fade //
int nUseBonesBash = FALSE; // Set this to TRUE if you want bones to appear when the corpse is bashed. The //
// bones cannot be bashed; they will only disappear if nBonesFade > 0. //
int nUseBonesFade = TRUE; // Set this to TRUE if you want bones to appear when the corpse fades. The bones //
// cannot be bashed; they will only disappear if nBonesFade > 0. //
int nBonesFade = 120; // This is the delay in actual seconds that the bones will remain before they fade. //
// If you set this to 0 (zero) it will turn off the bones fade - allowing all //
// bones (and loot, if the bones contain any) to remain forever. //
int nTinyBones = FALSE; // Set this to FALSE if you don't want Tiny-sized creatures (rats, bats, etc.) to //
// turn into bones when their corpse is bashed or fades. Only applies if //
// nUseBonesBash and/or nUseBonesFade = TRUE. //
int nKeepInventoryBash = FALSE; // Set this to TRUE if you want all items in a creature's inventory to remain when //
// its corpse is bashed. If installed, DOA's "Bashed Loot Breakage" plugin //
// ("doa_bashbreak") takes precedence over nKeepInventoryBash. //
int nKeepInventoryFade = FALSE; // Set this to TRUE if you want all items in a creature's inventory to remain when //
// its corpse fades. //
int nKeepEmpties = TRUE; // Set this to FALSE if you want EMPTY corpses to fade immediately. //
int nKeepWeaponsBonesFade = FALSE; // Set this to FALSE if you want dropped, unclaimed, non-plot weapons to be //
// destroyed when bones fade. Only valid if nBonesFade > 0. //
int nKeepWeaponsCorpseFade = FALSE; // Set this to FALSE if you want dropped, unclaimed, non-plot weapons to be //
// destroyed when corpses fade. Only valid if nCorpseFade > 0. //
int nKeepWeaponsBash = TRUE; // Set this to FALSE if you want dropped, unclaimed, non-plot weapons to be //
// destroyed when corpses are bashed. //
int nKeepWeaponsEmpty = TRUE; // Set this to TRUE if you want empty corpses to be destroyed even if dropped //
// weapons are unclaimed. //
int nOverrideForPlacedCorpses = FALSE;// Set this to TRUE if you want the 'Spawned Corpses' you //
// place to be permament. Setting it to FALSE will cause //
// your Placed Dead creatures to act as the settings above dictate. //
float lsDelay = 240.0; // Corpse & loot fade delay
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//ALTER THE FOLLOWING AT YOUR OWN RISK :)
object oHostBody = OBJECT_SELF; //Get the Dead Creature Object
object oBlood;
object oSaveBlood;
string sBaseTag = GetTag(oHostBody); //Get that TAG of the dead creature
string sPrefix = GetStringLeft(sBaseTag, 4); //Look for Dead Prefix
location lLoc = GetLocation(oHostBody);
if ((GetRacialType(oHostBody) != RACIAL_TYPE_UNDEAD) &&
(GetRacialType(oHostBody) != RACIAL_TYPE_CONSTRUCT) &&
(GetRacialType(oHostBody) != RACIAL_TYPE_ELEMENTAL)&&
(GetRacialType(oHostBody) != RACIAL_TYPE_DRAGON))
{
oBlood = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_bloodstain", lLoc, FALSE);
}
DelayCommand(lsDelay, BodyFade(oHostBody, oBlood));
if(nUseLootable) //If False, do nothing
{
//Do 'spawned corpse' settings if desired
if (sPrefix == "Dead")
{
if (nOverrideForPlacedCorpses)
{
nKeepEmpties = TRUE; //Set 'Spawned Dead' corpses to Keep Empties
nCorpseFade = 0; //Disable Corpse Fade for 'Spawned Dead' corpses
}
}
SetIsDestroyable(FALSE,TRUE,FALSE); //Protect our corpse from decaying
/*
UNDER CONSTRUCTION :)
// Create lootable corpse object only if oHostBody has something to loot
if (GetIsObjectValid(GetFirstItemInInventory(oHostBody)))
{
}
else
{
// Don't create lootable corpse object(nothing to loot)
if (nKeepEmpties == FALSE)
{
// Get rid of corpse immediately, since it's already empty
nCorpseFade = 1;
}
else
{
// Ensure oHostBody is destroyed/fades properly
// Ensure blood spot is created and destroyed/fades properly
}
}
*/
//Set the spawnpoint for our lootable object and sink it
float fSinkCorpseObj = 0.1f; //set depth to sink lootable object
vector vHostBodyLoc = GetPosition(oHostBody); //get original vector so we can change it
float fCorpseFacing = GetFacing(oHostBody); //get original facing
vector vCorpseLoc = Vector(vHostBodyLoc.x, vHostBodyLoc.y, vHostBodyLoc.z - fSinkCorpseObj); //adjust z-axis to sink lootable object
location lCorpseLoc = Location(GetArea(oHostBody), vCorpseLoc, fCorpseFacing); //create new location
object oLootCorpse = CreateObject(OBJECT_TYPE_PLACEABLE, "rr_sack", lCorpseLoc, FALSE); //Spawn our lootable object
SetLocalObject(oLootCorpse, "oHostBody", oHostBody); //Set Local for deletion later if needed
SetLocalObject(oLootCorpse, "oBlood", oBlood);
NameSack(oLootCorpse);
DelayCommand(0.1,sd_droploot(oHostBody, oLootCorpse));
DelayCommand(lsDelay, LootClear(oLootCorpse));
// Ensure oLootCorpse can't be destroyed until oHostBody is emptied (and weapons are dropped)
//SetPlotFlag(oLootCorpse, TRUE);
SetLocalInt(oLootCorpse, "nKeepEmpty", nKeepEmpties); //Set Local for deletion later if needed
SetLocalInt(oLootCorpse, "nUseBonesBash", nUseBonesBash); //Set Local for later use
SetLocalInt(oLootCorpse, "nUseBonesFade", nUseBonesFade); //Set Local for later use
SetLocalInt(oLootCorpse, "nBonesFade", nBonesFade); //Set Local for later use
SetLocalInt(oLootCorpse, "nTinyBones", nTinyBones); //Set Local for later use
SetLocalInt(oLootCorpse, "nKeepInventoryBash", nKeepInventoryBash); //Set Local for later use
SetLocalInt(oLootCorpse, "nKeepInventoryFade", nKeepInventoryFade); //Set Local for later use
// Remember racial type and Blueprint ResRef for use with Scrotok's Raise Dead/Resurrection plugin
SetLocalInt(oLootCorpse, "nRacialType", GetRacialType(oHostBody));
SetLocalString(oLootCorpse, "sHostBodyResRef", GetResRef(oHostBody));
object oCorpseBlood;
// If nUseBlood is TRUE and oHostBody isn't Undead/Construct/Elemental, set Local for later "gibbing" if bashed
if ((nUseBlood) && (GetRacialType(oHostBody) != RACIAL_TYPE_UNDEAD) && (GetRacialType(oHostBody) != RACIAL_TYPE_CONSTRUCT) && (GetRacialType(oHostBody) != RACIAL_TYPE_ELEMENTAL))
{
SetLocalInt(oLootCorpse, "nUseBlood", TRUE);
}
// If nUseBlood = TRUE, continue Bloodspot routine
if (nUseBlood)
{
location lBloodLoc = GetLocation(oHostBody); //get original location for placing blood spot
if ((nTinyBlood == FALSE) && (GetCreatureSize(oHostBody) == CREATURE_SIZE_TINY))
{
// Do nothing -- no bloodspot for tiny creatures if nTinyBlood is FALSE
}
else
{
if (nUseFlame)
{
// If nUseFlame = TRUE, determine if scorch, flame, or bloodspot should appear
int nFireDam = GetDamageDealtByType(DAMAGE_TYPE_FIRE);
int nElecDam = GetDamageDealtByType(DAMAGE_TYPE_ELECTRICAL);
int nTotDam = GetTotalDamageDealt();
int nMaxHP = GetMaxHitPoints();
int nFlameout;
/*
// Used for debugging
SendMessageToPC(GetFirstPC(), "nFireDam: "+IntToString(nFireDam)+" nElecDam: "+IntToString(nElecDam)+" nTotDam: "+IntToString(nTotDam)+" nMaxHP: "+IntToString(nMaxHP)+" nTotDam/3: "+IntToString(nTotDam/3));
*/
// If 1/3 or more of the damage is due to fire or electricity...
// (only the final damage that actually killed the creature is
// considered; tracking the cumulative damage taken would require
// altering the default OnDamaged script for every creature,
// which is not desirable)
if ((nFireDam >= (nTotDam/3)) || (nElecDam >= (nTotDam/3)))
{
// If massive fire or electricity damage, spawn a small flame
// which turns into a scorch mark after 10-120 seconds
// ("massive" means >= max HP)
if ((nFireDam >= nMaxHP) || (nElecDam >= nMaxHP))
{
oCorpseBlood = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_flamesmall", lBloodLoc, FALSE);
ExecuteScript("sl_destroyself", oCorpseBlood);
/*
// Used for debugging
nFlameout = 30;
*/
nFlameout = d12(10);
DelayCommand(IntToFloat(nFlameout), Flameout(oCorpseBlood, oLootCorpse));
}
else
{
// Otherwise, spawn a scorch mark
oCorpseBlood = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_weathmark", lBloodLoc, FALSE);
ExecuteScript("sl_destroyself", oCorpseBlood);
}
}
else
{
// Not enough (or zero) fire/electrical damage, so just spawn bloodspot (or do nothing for Undead/Constructs/Elementals)
if ((GetRacialType(oHostBody) != RACIAL_TYPE_UNDEAD) && (GetRacialType(oHostBody) != RACIAL_TYPE_CONSTRUCT) && (GetRacialType(oHostBody) != RACIAL_TYPE_ELEMENTAL))
{
oCorpseBlood = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_bloodstain", lBloodLoc, FALSE);
ExecuteScript("sl_destroyself", oCorpseBlood);
}
}
}
else
{
// If nUseFlame = FALSE, just spawn the bloodspot (or do nothing for Undead/Constructs/Elementals)
if ((GetRacialType(oHostBody) != RACIAL_TYPE_UNDEAD) && (GetRacialType(oHostBody) != RACIAL_TYPE_CONSTRUCT) && (GetRacialType(oHostBody) != RACIAL_TYPE_ELEMENTAL))
{
oCorpseBlood = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_bloodstain", lBloodLoc, FALSE);
ExecuteScript("sl_destroyself", oCorpseBlood);
}
}
// oBloodSpot will either be a bloodstain, scorch mark, small flame, or OBJECT_INVALID (for Undead/Constructs/Elementals)
SetLocalObject(oLootCorpse, "oBloodSpot", oCorpseBlood); //Set Local for deletion later if needed
}
}
// Get DEAD CREATURE'S INVENTORY - Move to oLootCorpse
int nAmtGold = GetGold(oHostBody); //Get any gold from the dead creature
if(nAmtGold)
{
AssignCommand(oLootCorpse, TakeGoldFromCreature(nAmtGold, oHostBody, FALSE));
}
if (nMoveEquipped)
{
//Get any DROPPABLE loot the dead creature has equipped
object oEquip1 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_ARMS, oHostBody));
object oEquip2 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_ARROWS, oHostBody));
object oEquip3 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_BELT, oHostBody));
object oEquip4 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_BOLTS, oHostBody));
object oEquip5 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_BOOTS, oHostBody));
object oEquip6 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_BULLETS, oHostBody));
object oEquip7 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_CLOAK, oHostBody));
// Version 3.2: Moved oEquip8 (helmets) to the armour section (see below)
object oEquip9 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_LEFTRING, oHostBody));
object oEquip10 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_NECK, oHostBody));
object oEquip11 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_RIGHTRING, oHostBody));
SetLocalObject(oLootCorpse, "oEquip1", oEquip1);
SetLocalObject(oLootCorpse, "oEquip2", oEquip2);
SetLocalObject(oLootCorpse, "oEquip3", oEquip3);
SetLocalObject(oLootCorpse, "oEquip4", oEquip4);
SetLocalObject(oLootCorpse, "oEquip5", oEquip5);
SetLocalObject(oLootCorpse, "oEquip6", oEquip6);
SetLocalObject(oLootCorpse, "oEquip7", oEquip7);
// Version 3.2: Moved oEquip8 (helmets) to the armour section (see below)
SetLocalObject(oLootCorpse, "oEquip9", oEquip9);
SetLocalObject(oLootCorpse, "oEquip10", oEquip10);
SetLocalObject(oLootCorpse, "oEquip11", oEquip11);
}
// Handle Weapons/Shields/Torches equipped (held) in left/right hands
// NOTE: nDropWeapons takes precedence over nMoveWeapons if both are TRUE
/*
If oHostBody has nothing in left/right hand, and has oLeftWpn/
oRightWpn set (due to Scrotok's Raise Dead/Resurrection plugin),
set oLeftWpn/oRightWpn (dropped weapon info) on oLootCorpse for
later use
*/
if (nDropWeapons)
{
if (GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oHostBody) == OBJECT_INVALID)
{
if (GetIsObjectValid(GetLocalObject(oHostBody, "oRightWpn")))
{
SetLocalObject(oLootCorpse, "oRightWpn", GetLocalObject(oHostBody, "oRightWpn"));
}
}
if (GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oHostBody) == OBJECT_INVALID)
{
if (GetIsObjectValid(GetLocalObject(oHostBody, "oLeftWpn")))
{
SetLocalObject(oLootCorpse, "oLeftWpn", GetLocalObject(oHostBody, "oLeftWpn"));
}
}
}
if (nMoveWeapons || nDropWeapons)
{
//Move equipped Weapons/Shields/Torches from oHostBody to oLootCorpse
object oEquip12 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oHostBody));
object oEquip13 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oHostBody));
// oEquip12/13 == OBJECT_INVALID if oHostBody has nothing in right/left hand slots
SetLocalObject(oLootCorpse, "oEquip12", oEquip12);
SetLocalObject(oLootCorpse, "oEquip13", oEquip13);
}
if (nDropWeapons)
{
// oEquip12/13 == OBJECT_INVALID if oHostBody has nothing in right/left hand slots
object oEquip12 = GetLocalObject(oLootCorpse, "oEquip12");
object oEquip13 = GetLocalObject(oLootCorpse, "oEquip13");
// Drop the weapons/shields/torches
/*
The following commands destroy oEquip12 and oEquip13, and store
the dropped weapons on oLootCorpse as "oLeftWpn" and "oRightWpn".
Nothing gets stored in oLeftWpn/oRightWpn if oEquip12/13 ==
OBJECT_INVALID.
*/
// Make sure DropLeftWeapon comes after DropRightWeapon in the lines
// below, in order for the SetPlotFlag fix (version 3.3) to work
AssignCommand(oLootCorpse, ActionDoCommand(DropRightWeapon(oEquip12, oLootCorpse)));
AssignCommand(oLootCorpse, ActionDoCommand(DropLeftWeapon(oEquip13, oLootCorpse)));
SetLocalInt(oLootCorpse, "nKeepWeaponsBonesFade", nKeepWeaponsBonesFade); //Set Local to prevent deletion later if needed
SetLocalInt(oLootCorpse, "nKeepWeaponsCorpseFade", nKeepWeaponsCorpseFade); //Set Local to prevent deletion later if needed
SetLocalInt(oLootCorpse, "nKeepWeaponsBash", nKeepWeaponsBash); //Set Local to prevent deletion later if needed
SetLocalInt(oLootCorpse, "nKeepWeaponsEmpty", nKeepWeaponsEmpty); //Set Local for later use
}
// Handle Armour/Helmets
// NOTE: nCopyArmour takes precedence over nMoveArmour if both are TRUE
if(nCopyArmour)
{
nMoveArmour = FALSE;
// Handle armour
object oArmour = GetItemInSlot(INVENTORY_SLOT_CHEST, oHostBody);
SetLocalObject(oLootCorpse, "oOrigArmour", oArmour);
if (GetDroppableFlag(oArmour))
{
string sArmourRef = GetResRef(oArmour);
object oLootArmour = CreateItemOnObject(sArmourRef, oLootCorpse);
SetPlotFlag(oLootArmour, GetPlotFlag(oArmour));
SetIdentified(oLootArmour, GetIdentified(oArmour));
// Set Plot flag to FALSE for original armor so it can be
// destroyed later if corpse is bashed
SetPlotFlag(oArmour, FALSE);
SetLocalObject(oLootCorpse, "oLootArmour", oLootArmour);
SetLocalObject(oLootCorpse, "oEquip14", oLootArmour);
}
// Handle helmet
object oHelmet = GetItemInSlot(INVENTORY_SLOT_HEAD, oHostBody);
SetLocalObject(oLootCorpse, "oOrigHelmet", oHelmet);
if (GetDroppableFlag(oHelmet))
{
string sHelmetRef = GetResRef(oHelmet);
object oLootHelmet = CreateItemOnObject(sHelmetRef, oLootCorpse);
SetPlotFlag(oLootHelmet, GetPlotFlag(oHelmet));
SetIdentified(oLootHelmet, GetIdentified(oHelmet));
// Set Plot flag to FALSE for original helmet so it can be
// destroyed later if corpse is bashed
SetPlotFlag(oHelmet, FALSE);
SetLocalObject(oLootCorpse, "oLootHelmet", oLootHelmet);
SetLocalObject(oLootCorpse, "oEquip8", oLootHelmet);
}
}
if(nMoveArmour)
{
nCopyArmour = FALSE;
// Handle armour
object oEquip14 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_CHEST, oHostBody));
SetLocalObject(oLootCorpse, "oEquip14", oEquip14);
// Handle helmet
object oEquip8 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_HEAD, oHostBody));
SetLocalObject(oLootCorpse, "oEquip8", oEquip8);
}
//Get the remaining loot from the dead creature and move it to oLootCorpse
int nEquipCount = 14;
object oLootEQ = GetFirstItemInInventory(oHostBody);
while(GetIsObjectValid(oLootEQ))
{
nEquipCount++;
// AssignCommand(oLootCorpse, ActionDoCommand(SendMessageToPC(GetFirstPC(), "oEquip"+IntToString(nEquipCount)+": "+GetTag(oLootEQ))));
object oEquipTemp = strip_equipped(oHostBody, oLootCorpse, oLootEQ);
string sEquipCount = "oEquip" + IntToString(nEquipCount);
SetLocalObject(oLootCorpse, sEquipCount, oEquipTemp);
oLootEQ = GetNextItemInInventory(oHostBody);
}
// We're done with oHostBody, so allow oLootCorpse to be destroyable
if (!nDropWeapons)
{
AssignCommand(oLootCorpse, ActionDoCommand(SetPlotFlag(oLootCorpse, FALSE)));
}
// Fade corpse out of existence after specified delay (unless set to 0)
if (nCorpseFade > 0)
{
float fCorpseFade = IntToFloat(nCorpseFade);
// ActionWait(fCorpseFade); // Removed for version 3.2
DelayCommand(fCorpseFade, FadeCorpse(oCorpseBlood, oLootCorpse, oHostBody));
}
}
}
//void main(){}

View File

@@ -1,39 +1,47 @@
///////////////////////////////////////
// Door Script - Allows only Mages to enter
// Door Script - Allows on Mages to enter
//
////////////////////////////////////////
#include "prc_class_const"
void main()
{
// Close the door after 30 seconds
DelayCommand(30.0, ActionCloseDoor(OBJECT_SELF));
DelayCommand(30.0, ActionCloseDoor(OBJECT_SELF));
object oClicker = GetClickingObject();
object oTarget = GetTransitionTarget(OBJECT_SELF);
location lLoc = GetLocation(oTarget);
location lLoc2 = GetLocation(GetObjectByTag("WP_Throw_out"));
object oClicker = GetClickingObject();
object oTarget = GetTransitionTarget(OBJECT_SELF);
location lLoc = GetLocation(oTarget);
location lLoc2 = GetLocation(GetObjectByTag("WP_Throw_out"));
int oClass_1 = GetClassByPosition(1, oClicker);
int oClass_2 = GetClassByPosition(2, oClicker);
int oClass_3 = GetClassByPosition(3, oClicker);
int iPassed = 0;
if ((oClass_1==CLASS_TYPE_BARD)||(oClass_1==CLASS_TYPE_SORCERER))
iPassed = 1 ;
if((iPassed == 0) && (oClass_1==CLASS_TYPE_WIZARD))
iPassed = 1 ;
if ((oClass_2==CLASS_TYPE_BARD)||(oClass_2==CLASS_TYPE_SORCERER))
iPassed = 1 ;
if((iPassed == 0) && (oClass_2==CLASS_TYPE_WIZARD))
iPassed = 1 ;
if ((oClass_3==CLASS_TYPE_BARD)||(oClass_3==CLASS_TYPE_SORCERER))
iPassed = 1 ;
if((iPassed == 0) && (oClass_3==CLASS_TYPE_WIZARD))
iPassed = 1 ;
switch (iPassed)
{
case 0:
AssignCommand(oClicker,JumpToLocation(lLoc2));
break;
case 1:
AssignCommand(oClicker,JumpToLocation(lLoc));
break;
}
// Sum of arcane class levels
int iArcane = GetLevelByClass(CLASS_TYPE_BARD, oClicker) +
GetLevelByClass(CLASS_TYPE_BEGUILER, oClicker) +
GetLevelByClass(CLASS_TYPE_DREAD_NECROMANCER, oClicker) +
GetLevelByClass(CLASS_TYPE_KNIGHT_WEAVE, oClicker) +
GetLevelByClass(CLASS_TYPE_SORCERER, oClicker) +
GetLevelByClass(CLASS_TYPE_SUBLIME_CHORD, oClicker) +
GetLevelByClass(CLASS_TYPE_WARMAGE, oClicker) +
GetLevelByClass(CLASS_TYPE_WARLOCK, oClicker) +
GetLevelByClass(CLASS_TYPE_WIZARD, oClicker);
// Determine action based on arcane class level sum
if (iArcane > 0)
{
AssignCommand(oClicker, JumpToLocation(lLoc));
}
else
{
AssignCommand(oClicker, JumpToLocation(lLoc2));
}
}

View File

@@ -1,6 +1,9 @@
#include "udk_include"
#include "ww_inc_on_act"
void main()
{
EnableDyeKitMenu();
ExecuteScript(GetTag(GetItemActivated()),OBJECT_SELF);
object oItem = GetItemActivated();
object oActivator = GetItemActivator();
location lTarget = GetItemActivatedTargetLocation();
@@ -8,6 +11,66 @@ void main()
string oCreatureTag = "";
int oMaxGoldValue = 0;
string oNewItemTag = "";
object oUser=GetItemActivator();
location lLoc=GetItemActivatedTargetLocation();
string sTag=GetTag(oItem);
object oMod=GetModule();
string sPre=GetLocalString(oMod,"OnAct_Pre");
string sPreScript=GetLocalString(oMod,"OnAct_PreScript");
int nN=GetStringLength(sPre);
//SendMessageToPC(GetItemActivator(),"uni_onactivateit:'"+GetResRef(oItem)+"'.");
if (nN<1)
{ // check for prefix waypoint
oMod=GetWaypointByTag("UNI_ACTIVATEPRE");
if (oMod!=OBJECT_INVALID) sPre=GetName(oMod);
oMod=GetWaypointByTag("UNI_ACTIVATEPRES");
if (oMod!=OBJECT_INVALID) sPreScript=GetName(oMod);
nN=GetStringLength(sPre);
//SendMessageToPC(GetItemActivator()," prefix waypoint check: nN="+IntToString(nN)+".");
} // check for prefix waypoint
if (GetStringLeft(GetTag(oItem),4)=="DH2_") ExecuteScript("desertheat2",OBJECT_SELF);
else
{ // not a special
//SendMessageToPC(GetItemActivator()," not special.");
if (nN>0&&sPre!="")
{ // check for special prefix
if (GetStringLeft(GetTag(oItem),nN)==sPre) ExecuteScript(sPreScript,OBJECT_SELF);
else {nN=-1;}
//SendMessageToPC(GetItemActivator()," Check for special prefix:"+IntToString(nN)+".");
} // check for special prefix
if (nN<1)
{ // special prefix was not used
sPre=GetResRef(oItem);
//SendMessageToPC(GetItemActivator()," Special prefix not used.");
if (GetStringLength(sPre)>0)
{ // has res ref
//SendMessageToPC(GetItemActivator()," resref:'"+sPre+"'.");
ExecuteScript(sPre,OBJECT_SELF);
} // has res ref
else
{ // use tag
sPre=GetTag(oItem);
if (GetStringLength(sPre)>16) sPre=GetStringLeft(sPre,16);
//SendMessageToPC(GetItemActivator()," tag:'"+sPre+"'.");
ExecuteScript(sPre,OBJECT_SELF);
} // use tag
oMod=GetWaypointByTag("UNI_ACTIVATE");
if (oMod!=OBJECT_INVALID) ExecuteScript(GetName(oMod),OBJECT_SELF);
} // special prefix was not used
} // not a special
if(sTag=="kpbwand")
{
if (GetIsDM(oUser) == TRUE)
{
AssignCommand(oUser, ActionStartConversation(oUser, "kpb_wand", TRUE));
}
else
{
DestroyObject(oItem);
SendMessageToPC(oUser, "I am not an immortal, and I cannot use that item!");
}
}
if(GetStringLeft(GetTag(oItem),4)=="SEED")
{
@@ -88,13 +151,6 @@ void main()
if (GetTag(oItem) == "SEED_HOPS")ExecuteScript("_plant_seed",oActivator);
if (GetTag(oItem) == "SEED_SUGARCANE")ExecuteScript("_plant_seed2",oActivator);
}
if (GetTag(oItem)=="FOOD_EAROFCORN")

View File

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

View File

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

View File

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

View File

@@ -1,8 +1,11 @@
#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 = GetCampaignInt("UOACraft","iBrewSkill",oPC);
int iBrewSkill = GetPersistentInt(oPC,"iBrewSkill","UOACraft"
);
int iBrewChance = iBrewSkill;
if (GetItemPossessedBy(oPC,"NoDrop_SkillLogBook")==OBJECT_INVALID)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,10 +1,12 @@
//#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 = GetCampaignInt("UOACraft","iTailorSkill",oPC);
int iTailorSkill = GetPersistentInt(oPC,"iTailorSkill","UOACraft"
);
int iTailorChance = iTailorSkill;
if (GetItemPossessedBy(oPC,"NoDrop_SkillLogBook")==OBJECT_INVALID)

View File

@@ -1,10 +1,12 @@
//#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 = GetCampaignInt("UOACraft","iTailorSkill",oPC);
int iTailorSkill = GetPersistentInt(oPC,"iTailorSkill","UOACraft"
);
int iTailorChance = iTailorSkill;
if (GetItemPossessedBy(oPC,"NoDrop_SkillLogBook")==OBJECT_INVALID)

View File

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

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;
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."));
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."));
}

View File

@@ -1,9 +1,5 @@
#include "nw_i0_plot"
void DelayCreateDeed(object oPC, string sItemTag, string sItemResRef, string sItemName, int iCounter, int iStack);
void main()
{
object oPC = OBJECT_SELF;
@@ -22,7 +18,6 @@ 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;
@@ -86,6 +81,12 @@ 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;
@@ -108,18 +109,7 @@ 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);
return;
}
DelayCommand(fDelay+0.5,SendMessageToPC(oPC,"Successfully added "+IntToString(iCounter)+" "+sItemName+" to the bundle."));
}

View File

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

View File

@@ -1,19 +0,0 @@
#include "nw_i0_tool"
/* Script generated by
Lilac Soul's NWN Script Generator, v. 1.6
For download info, please visit:
http://www.lilacsoul.revility.com */
//Put this on action taken in the conversation editor
void main()
{
object oPC = GetPCSpeaker();
if (GetHitDice(oPC) <= 2)
{
RewardPartyXP(3000, oPC, FALSE);
}
}

View File

@@ -1,50 +1,26 @@
// Place in the OnFailToOpen event for the door
#include "prc_class_const"
// Place in the OnFailToOpen event for the <span class="highlight">door</span>
void main()
{
object oPC = GetClickingObject();
int nPCClass1 = GetClassByPosition(1, oPC);
int nPCClass2 = GetClassByPosition(2, oPC);
int nPCClass3 = GetClassByPosition(3, oPC);
int nPCClass4 = GetClassByPosition(4, oPC);
int nPCClass5 = GetClassByPosition(5, oPC);
int nPCClass6 = GetClassByPosition(6, oPC);
int nPCClass7 = GetClassByPosition(7, oPC);
int nPCClass8 = GetClassByPosition(8, oPC);
int iRogue = GetLevelByClass(CLASS_TYPE_ROGUE, oPC)
+ GetLevelByClass(CLASS_TYPE_SCOUT, oPC)
+ GetLevelByClass(CLASS_TYPE_BEGUILER, oPC)
+ GetLevelByClass(CLASS_TYPE_NINJA, oPC)
+ GetLevelByClass(CLASS_TYPE_FACTOTUM, oPC)
+ GetLevelByClass(CLASS_TYPE_ASSASSIN, oPC)
+ GetLevelByClass(CLASS_TYPE_ARCTRICK, oPC)
+ GetLevelByClass(CLASS_TYPE_HANDOTWM, oPC)
+ GetLevelByClass(CLASS_TYPE_NIGHTSHADE, oPC)
+ GetLevelByClass(CLASS_TYPE_NINJA_SPY, oPC)
+ GetLevelByClass(CLASS_TYPE_SHADOWLORD, oPC)
+ GetLevelByClass(CLASS_TYPE_SHADOW_SUN_NINJA, oPC)
+ GetLevelByClass(CLASS_TYPE_SHADOW_THIEF_AMN, oPC)
+ GetLevelByClass(CLASS_TYPE_UNSEEN_SEER, oPC)
+ GetLevelByClass(CLASS_TYPE_PSYCHIC_ROGUE, oPC);
if (!GetIsPC(oPC))
object oPC = GetClickingObject();
int nPCClass1 = GetClassByPosition(1, oPC);
int nPCClass2 = GetClassByPosition(2, oPC);
int nPCClass3 = GetClassByPosition(3, oPC);
int nCheck1 = CLASS_TYPE_ROGUE;
int nCheck2 = CLASS_TYPE_ASSASSIN;
if (!GetIsPC(oPC))
{
return;
return;
}
else if (iRogue > 0)
else if ((nPCClass1 == nCheck1) || (nPCClass2 == nCheck1) || (nPCClass3 == nCheck1) || (nPCClass1 == nCheck2) || (nPCClass2 == nCheck2) || (nPCClass3 == nCheck2))
{
FloatingTextStringOnCreature("The door unlocks itself and opens.", oPC);
SetLocked(OBJECT_SELF, FALSE);
ActionOpenDoor(OBJECT_SELF);
DelayCommand(6.0f, ActionCloseDoor(OBJECT_SELF));
DelayCommand(6.2f, SetLocked(OBJECT_SELF, TRUE));
//FloatingTextStringOnCreature("The <span class="highlight">door</span> unlocks itself and opens.", oPC);
SetLocked(OBJECT_SELF, FALSE);
ActionOpenDoor(OBJECT_SELF);
DelayCommand(6.0f, ActionCloseDoor(OBJECT_SELF));
DelayCommand(6.2f, SetLocked(OBJECT_SELF, TRUE));
}
else
else
{
FloatingTextStringOnCreature("The door is locked. You must be a rogue to use this door.", oPC);
//FloatingTextStringOnCreature("The <span class="highlight">door</span> is locked. You must be a Rogue or Assassin to use this <span class="highlight">door</span>.", oPC);
}
}
}

View File

@@ -1,47 +1,23 @@
// Place in the OnAreaTransitionClick event for the <span class="highlight">door</span>
#include "prc_class_const"
void main()
{
object oPC = GetClickingObject();
object oJump = GetTransitionTarget(OBJECT_SELF);
int nPCClass1 = GetClassByPosition(1, oPC);
int nPCClass2 = GetClassByPosition(2, oPC);
int nPCClass3 = GetClassByPosition(3, oPC);
int nPCClass4 = GetClassByPosition(4, oPC);
int nPCClass5 = GetClassByPosition(5, oPC);
int nPCClass6 = GetClassByPosition(6, oPC);
int nPCClass7 = GetClassByPosition(7, oPC);
int nPCClass8 = GetClassByPosition(8, oPC);
int iRogue = GetLevelByClass(CLASS_TYPE_ROGUE, oPC)
+ GetLevelByClass(CLASS_TYPE_SCOUT, oPC)
+ GetLevelByClass(CLASS_TYPE_BEGUILER, oPC)
+ GetLevelByClass(CLASS_TYPE_NINJA, oPC)
+ GetLevelByClass(CLASS_TYPE_FACTOTUM, oPC)
+ GetLevelByClass(CLASS_TYPE_ASSASSIN, oPC)
+ GetLevelByClass(CLASS_TYPE_ARCTRICK, oPC)
+ GetLevelByClass(CLASS_TYPE_HANDOTWM, oPC)
+ GetLevelByClass(CLASS_TYPE_NIGHTSHADE, oPC)
+ GetLevelByClass(CLASS_TYPE_NINJA_SPY, oPC)
+ GetLevelByClass(CLASS_TYPE_SHADOWLORD, oPC)
+ GetLevelByClass(CLASS_TYPE_SHADOW_SUN_NINJA, oPC)
+ GetLevelByClass(CLASS_TYPE_SHADOW_THIEF_AMN, oPC)
+ GetLevelByClass(CLASS_TYPE_UNSEEN_SEER, oPC)
+ GetLevelByClass(CLASS_TYPE_PSYCHIC_ROGUE, oPC);
if (!GetIsPC(oPC))
object oPC = GetClickingObject();
object oJump = GetTransitionTarget(OBJECT_SELF);
int nPCClass1 = GetClassByPosition(1, oPC);
int nPCClass2 = GetClassByPosition(2, oPC);
int nPCClass3 = GetClassByPosition(3, oPC);
int nCheck1 = CLASS_TYPE_ROGUE;
int nCheck2 = CLASS_TYPE_ASSASSIN;
if (!GetIsPC(oPC))
{
return;
return;
}
else if (iRogue > 0)
else if ((nPCClass1 == nCheck1) || (nPCClass2 == nCheck1) || (nPCClass3 == nCheck1) || (nPCClass1 == nCheck2) || (nPCClass2 == nCheck2) ||(nPCClass3 == nCheck2))
{
AssignCommand(oPC, JumpToObject(oJump));
AssignCommand(oPC, JumpToObject(oJump));
}
else
else
{
FloatingTextStringOnCreature("Only rogues may pass this way.", oPC);
FloatingTextStringOnCreature("Only Rogues or Assassins may pass this way.", oPC);
}
}

View File

@@ -1,11 +1,7 @@
#include "NW_I0_GENERIC"
void main()
{
ExecuteScript("prc_npc_death", OBJECT_SELF);
object oKiller = GetLastKiller();
object oVictim = OBJECT_SELF;
int noleech = 0;
int nClass = GetLevelByClass(CLASS_TYPE_COMMONER);
int nAlign = GetAlignmentGoodEvil(OBJECT_SELF);
@@ -20,9 +16,9 @@ void main()
{
SignalEvent(OBJECT_SELF, EventUserDefined(1007));
}
float BaseEXP = ((GetChallengeRating(oVictim)*5.0)+2);
float BonusEXP = ((GetChallengeRating(oVictim)*2.0)+5);
float BaseMonEXP = BaseEXP;
float BaseEXP = ((GetChallengeRating(OBJECT_SELF)*3.0)+5);
float BonusEXP = GetChallengeRating(OBJECT_SELF)+5;
float BaseMonEXP = BaseEXP;
int NumOfParty = 0;
float PartyLevelSum = 0.0;
object oPartyMember = GetFirstFactionMember(oKiller, TRUE);

View File

@@ -17,9 +17,6 @@ void main()
location ourSpawnPoint = GetLocation(GetNearestObjectByTag(GetTag(OBJECT_SELF) + "Respawn"));
CreateObject(OBJECT_TYPE_CREATURE, us, ourSpawnPoint);
}
ExecuteScript("prc_npc_death", OBJECT_SELF);
object oKiller = GetLastKiller();
int noleech = 0;
int nClass = GetLevelByClass(CLASS_TYPE_COMMONER);

View File

@@ -1,16 +1,7 @@
#include "prc_class_const"
int StartingConditional()
{
object oPC = GetPCSpeaker();
int iDivine = GetLevelByClass(CLASS_TYPE_CLERIC, oPC)
+ GetLevelByClass(CLASS_TYPE_ARCHIVIST, oPC)
+ GetLevelByClass(CLASS_TYPE_FAVOURED_SOUL, oPC)
+ GetLevelByClass(CLASS_TYPE_HEALER, oPC);
if(iDivine > 0)
return TRUE;
return FALSE;
int iResult;
iResult = GetLevelByClass(CLASS_TYPE_CLERIC, GetPCSpeaker());
return iResult;
}

View File

@@ -1,11 +1,4 @@
#include "prc_class_const"
void main()
{
object oPC = GetPCSpeaker();
int iTribal = GetLevelByClass(CLASS_TYPE_BARBARIAN, oPC)
+ GetLevelByClass(CLASS_TYPE_TOTEMIST, oPC);
SetLocalInt(oPC, "BarbarianLevel", iTribal);
}
SetLocalInt(GetPCSpeaker(), "BarbarianLevel", GetLevelByClass(CLASS_TYPE_BARBARIAN,GetPCSpeaker()));
}

View File

@@ -1,14 +1,5 @@
#include "prc_class_const"
int StartingConditional()
{
object oPC = GetPCSpeaker();
int iTribal = GetLevelByClass(CLASS_TYPE_BARBARIAN, oPC)
+ GetLevelByClass(CLASS_TYPE_TOTEMIST, oPC);
if(iTribal > 0)
return TRUE;
return FALSE;
}
int iResult = GetLevelByClass(CLASS_TYPE_BARBARIAN, GetPCSpeaker());
return iResult;
}

View File

@@ -1,15 +1,5 @@
#include "prc_class_const"
int StartingConditional()
{
object oPC = GetPCSpeaker();
int iBardic = GetLevelByClass(CLASS_TYPE_BARD, oPC)
+ GetLevelByClass(CLASS_TYPE_SUBLIME_CHORD, oPC)
+ GetLevelByClass(CLASS_TYPE_VIRTUOSO, oPC);
if(iBardic > 0)
return TRUE;
return FALSE;
}
int iResult = GetLevelByClass(CLASS_TYPE_BARD, GetPCSpeaker());
return iResult;
}

View File

@@ -1,16 +1,4 @@
#include "prc_class_const"
void main()
{
object oPC = GetPCSpeaker();
int iBardic = GetLevelByClass(CLASS_TYPE_BARD, oPC)
+ GetLevelByClass(CLASS_TYPE_HARPER, oPC)
+ GetLevelByClass(CLASS_TYPE_DIRGESINGER, oPC)
+ GetLevelByClass(CLASS_TYPE_DRAGONSONG_LYRIST, oPC)
+ GetLevelByClass(CLASS_TYPE_FOCHLUCAN_LYRIST, oPC)
+ GetLevelByClass(CLASS_TYPE_SUBLIME_CHORD, oPC)
+ GetLevelByClass(CLASS_TYPE_VIRTUOSO, oPC);
SetLocalInt(oPC, "BardLevel", iBardic);
}
SetLocalInt(GetPCSpeaker(), "BardLevel", GetLevelByClass(CLASS_TYPE_BARD,GetPCSpeaker()));
}

View File

@@ -1,16 +1,8 @@
//::
//:: deity_drow.nss
//::
//:: Returns true if you're a Drow
#include "prc_inc_racial"
int StartingConditional()
{
object oPC = GetPCSpeaker();
object oPC = GetPCSpeaker();
if (!((GetRacialType(oPC)==RACIAL_TYPE_DROW_MALE) || (GetRacialType(oPC)==RACIAL_TYPE_DROW_FEMALE)))
return FALSE;
if (!((GetRacialType(oPC)==RACIAL_TYPE_ELF)&& ((GetSubRace(oPC)=="Drow")||(GetSubRace(oPC)=="drow")))) return FALSE;
return TRUE;
}
}

View File

@@ -1,17 +1,5 @@
#include "prc_class_const"
int StartingConditional()
{
object oPC = GetPCSpeaker();
int iDruidic = GetLevelByClass(CLASS_TYPE_DRUID, oPC)
+ GetLevelByClass(CLASS_TYPE_SHAMAN, oPC)
+ GetLevelByClass(CLASS_TYPE_HATHRAN, oPC)
+ GetLevelByClass(CLASS_TYPE_FOCHLUCAN_LYRIST, oPC)
+ GetLevelByClass(CLASS_TYPE_FORESTMASTER, oPC);
if(iDruidic > 0)
return TRUE;
return FALSE;
}
int iResult = GetLevelByClass(CLASS_TYPE_DRUID, GetPCSpeaker());
return iResult;
}

View File

@@ -1,14 +1,4 @@
#include "prc_class_const"
void main()
{
object oPC = GetPCSpeaker();
int iDruidic = GetLevelByClass(CLASS_TYPE_DRUID, oPC)
+ GetLevelByClass(CLASS_TYPE_SHAMAN, oPC)
+ GetLevelByClass(CLASS_TYPE_HATHRAN, oPC)
+ GetLevelByClass(CLASS_TYPE_FOCHLUCAN_LYRIST, oPC)
+ GetLevelByClass(CLASS_TYPE_FORESTMASTER, oPC);
SetLocalInt(oPC, "DruidLevel", iDruidic);
}
SetLocalInt(GetPCSpeaker(), "DruidLevel", GetLevelByClass(CLASS_TYPE_DRUID,GetPCSpeaker()));
}

View File

@@ -1,21 +1,8 @@
//::
//:: deity_elf.nss
//::
//:: Returns true if you're an Elf but not a Drow
#include "prc_inc_racial"
int StartingConditional()
{
object oPC = GetPCSpeaker();
int iRace = MyPRCGetRacialType(oPC);
int iSubrace = GetRacialType(oPC);
if (iSubrace == RACIAL_TYPE_DROW_MALE || iSubrace == RACIAL_TYPE_DROW_FEMALE) return FALSE;
int iResult = iRace == RACIAL_TYPE_ELF;
if (GetSubRace(GetPCSpeaker()) == "drow") return FALSE;
int iResult = GetRacialType(GetPCSpeaker())==RACIAL_TYPE_ELF;
return iResult;
}
}

View File

@@ -1,25 +1,5 @@
#include "prc_class_const"
int StartingConditional()
{
object oPC = GetPCSpeaker();
int iWarrior = GetLevelByClass(CLASS_TYPE_FIGHTER, oPC)
+ GetLevelByClass(CLASS_TYPE_CW_SAMURAI, oPC)
+ GetLevelByClass(CLASS_TYPE_KNIGHT, oPC)
+ GetLevelByClass(CLASS_TYPE_MARSHAL, oPC)
+ GetLevelByClass(CLASS_TYPE_SAMURAI, oPC)
+ GetLevelByClass(CLASS_TYPE_SOULKNIFE, oPC)
+ GetLevelByClass(CLASS_TYPE_SCOUT, oPC)
+ GetLevelByClass(CLASS_TYPE_INCARNATE, oPC)
+ GetLevelByClass(CLASS_TYPE_SOULBORN, oPC)
+ GetLevelByClass(CLASS_TYPE_PSYWAR, oPC)
+ GetLevelByClass(CLASS_TYPE_SWASHBUCKLER, oPC)
+ GetLevelByClass(CLASS_TYPE_WARBLADE, oPC)
+ GetLevelByClass(CLASS_TYPE_CRUSADER, oPC);
if(iWarrior > 0)
return TRUE;
return FALSE;
}
int iResult = GetLevelByClass(CLASS_TYPE_FIGHTER, GetPCSpeaker());
return iResult;
}

View File

@@ -1,5 +1,3 @@
#include "prc_inc_racial"
//////////////////////////////////////////////////////////////////////////////////////////////////
// This block of code delevels a PC and sets them back to the same xp they had before deleveling
//////////////////////////////////////////////////////////////////////////////////////////////////
@@ -22,7 +20,7 @@ void Reset_Level(object oPC)
void Race_Check(object oPC)
{
string sDeity = GetLocalString(oPC,"Deity");
int iRace = MyPRCGetRacialType(oPC);
int iRace = GetRacialType(oPC);
if (sDeity == "Bahamut")
{
@@ -118,10 +116,11 @@ if (sDeity == "Kord")
}
if (sDeity == "Lolth")
{
if ((iRace==RACIAL_TYPE_DROW_MALE) || (iRace==RACIAL_TYPE_DROW_FEMALE) || (iRace==RACIAL_TYPE_HALFDROW))
{
SetLocalInt(oPC,"Race",1);
}
if (((iRace==RACIAL_TYPE_ELF)||(iRace==RACIAL_TYPE_HALFELF))
&&((GetSubRace(oPC)=="Drow")||(GetSubRace(oPC)=="drow")))
{
SetLocalInt(oPC,"Race",1);
}
}
if (sDeity == "Moradin")
{

View File

@@ -1,17 +1,5 @@
#include "prc_class_const"
int StartingConditional()
{
object oPC = GetPCSpeaker();
int iMonk = GetLevelByClass(CLASS_TYPE_MONK, oPC)
+ GetLevelByClass(CLASS_TYPE_SOHEI, oPC)
+ GetLevelByClass(CLASS_TYPE_SWORDSAGE, oPC)
+ GetLevelByClass(CLASS_TYPE_PSION, oPC);
if(iMonk > 0)
return TRUE;
return FALSE;
int iResult = GetLevelByClass(CLASS_TYPE_MONK, GetPCSpeaker());
return iResult;
}

View File

@@ -1,13 +1,4 @@
#include "prc_class_const"
void main()
{
object oPC = GetPCSpeaker();
int iMonk = GetLevelByClass(CLASS_TYPE_MONK, oPC)
+ GetLevelByClass(CLASS_TYPE_SOHEI, oPC)
+ GetLevelByClass(CLASS_TYPE_SWORDSAGE, oPC)
+ GetLevelByClass(CLASS_TYPE_PSION, oPC);
SetLocalInt(oPC, "MonkLevel", iMonk);
}
SetLocalInt(GetPCSpeaker(), "MonkLevel", GetLevelByClass(CLASS_TYPE_MONK,GetPCSpeaker()));
}

View File

@@ -1,53 +1,21 @@
#include "prc_inc_racial"
void main()
{
object oPC = GetPCSpeaker();
object oSpawn = GetObjectByTag("Default_Start"); //set default respawn point
int iRace = MyPRCGetRacialType(oPC);
int iSubrace = GetRacialType(oPC);
if (iRace == RACIAL_TYPE_DWARF)
{
oSpawn = GetObjectByTag("Dwarf_Start");
}
if ((iRace == RACIAL_TYPE_ELF) && (!(iSubrace == RACIAL_TYPE_DROW_MALE || iSubrace == RACIAL_TYPE_DROW_FEMALE)))
{
oSpawn=GetObjectByTag("Elf_Start");
}
if (iRace == RACIAL_TYPE_GNOME)
{
oSpawn=GetObjectByTag("Gnome_Start");
}
if (iRace == RACIAL_TYPE_HALFELF && iSubrace != RACIAL_TYPE_HALFDROW)
{
oSpawn=GetObjectByTag("HalfElf_Start");
}
if (iRace == RACIAL_TYPE_HALFDROW && GetAlignmentGoodEvil(oPC) != ALIGNMENT_EVIL)
{
oSpawn=GetObjectByTag("HalfElf_Start");
}
else
{
oSpawn=GetObjectByTag("Drow_Start");
}
if (iRace == RACIAL_TYPE_HALFLING)
{
oSpawn=GetObjectByTag("Halfling_Start");
}
if (iRace==RACIAL_TYPE_HALFORC)
{
oSpawn=GetObjectByTag("HalfOrc_Start");
}
if (iRace == RACIAL_TYPE_HUMAN)
{
oSpawn=GetObjectByTag("Human_Start");
}
if ((iRace == RACIAL_TYPE_ELF) && (iSubrace == RACIAL_TYPE_DROW_MALE || iSubrace == RACIAL_TYPE_DROW_FEMALE))
{
oSpawn=GetObjectByTag("Drow_Start");
}
AssignCommand(oPC, DelayCommand(1.0, JumpToObject(oSpawn)));
object oPlayer=GetPCSpeaker();
object oSpawn=GetObjectByTag("Default_Start"); //set default respawn point
int iRace = GetRacialType(oPlayer);
if (iRace==RACIAL_TYPE_DWARF) { oSpawn=GetObjectByTag("Dwarf_Start"); }
if ((iRace==RACIAL_TYPE_ELF)&&
((GetSubRace(oPlayer) != "drow")||
(GetSubRace(oPlayer) != "Drow"))) { oSpawn=GetObjectByTag("Elf_Start"); }
if (iRace==RACIAL_TYPE_GNOME) { oSpawn=GetObjectByTag("Gnome_Start"); }
if (iRace==RACIAL_TYPE_HALFELF) { oSpawn=GetObjectByTag("HalfElf_Start"); }
if (iRace==RACIAL_TYPE_HALFLING) { oSpawn=GetObjectByTag("Halfling_Start"); }
if (iRace==RACIAL_TYPE_HALFORC) { oSpawn=GetObjectByTag("HalfOrc_Start"); }
if (iRace==RACIAL_TYPE_HUMAN) { oSpawn=GetObjectByTag("Human_Start"); }
if ((iRace==RACIAL_TYPE_ELF)&&
((GetSubRace(oPlayer) == "drow")||
(GetSubRace(oPlayer) == "Drow"))) { oSpawn=GetObjectByTag("Drow_Start"); }
AssignCommand(oPlayer, DelayCommand(1.0, JumpToObject(oSpawn)));
}

View File

@@ -1,18 +1,5 @@
#include "prc_class_const"
int StartingConditional()
{
object oPC = GetPCSpeaker();
int iRogue = GetLevelByClass(CLASS_TYPE_ROGUE, oPC)
+ GetLevelByClass(CLASS_TYPE_SCOUT, oPC)
+ GetLevelByClass(CLASS_TYPE_BEGUILER, oPC)
+ GetLevelByClass(CLASS_TYPE_NINJA, oPC)
+ GetLevelByClass(CLASS_TYPE_FACTOTUM, oPC)
+ GetLevelByClass(CLASS_TYPE_PSYCHIC_ROGUE, oPC);
if(iRogue > 0)
return TRUE;
return FALSE;
}
int iResult = GetLevelByClass(CLASS_TYPE_ROGUE, GetPCSpeaker());
return iResult;
}

View File

@@ -1,19 +1,5 @@
#include "prc_class_const"
int StartingConditional()
{
object oPC = GetPCSpeaker();
int iArcane = GetLevelByClass(CLASS_TYPE_BEGUILER, oPC)
+ GetLevelByClass(CLASS_TYPE_DREAD_NECROMANCER, oPC)
+ GetLevelByClass(CLASS_TYPE_SHADOWCASTER, oPC)
+ GetLevelByClass(CLASS_TYPE_SORCERER, oPC)
+ GetLevelByClass(CLASS_TYPE_WARLOCK, oPC)
+ GetLevelByClass(CLASS_TYPE_WARMAGE, oPC)
+ GetLevelByClass(CLASS_TYPE_SUBLIME_CHORD, oPC);
if(iArcane > 0)
return TRUE;
return FALSE;
}
int iResult = GetLevelByClass(CLASS_TYPE_SORCERER, GetPCSpeaker());
return iResult;
}

View File

@@ -1,11 +0,0 @@
int StartingConditional()
{
object oSpeaker = GetPCSpeaker();
//Show this line in the conversation ONLY if it's a DM!
if(GetIsDM(oSpeaker))
return TRUE;
//Otherwise Don't show the line to anyone else!
return FALSE;
}

View File

@@ -1,177 +0,0 @@
//::///////////////////////////////////////////////
//:: DMFI - array functions include
//:: dmfi_arrays_inc
//:://////////////////////////////////////////////
/*
Functions to use object-attached local variables as arrays.
*/
//:://////////////////////////////////////////////
//:: Created By: Noel
//:: Created On: November 17, 2001
//:://////////////////////////////////////////////
//:: 2007.12.24 tsunami282 - yanked most of these routines from Bioware's
//:: nw_o0_itemmaker, then expanded for bounds management.
int GetLocalArrayLowerBound(object oidObject, string sVarName);
int GetLocalArrayUpperBound(object oidObject, string sVarName);
void SetLocalArrayLowerBound(object oidObject, string sVarName, int nMin);
void SetLocalArrayUpperBound(object oidObject, string sVarName, int nMax);
////////////////////////////////////////////////////////////////////////
int GetLocalArrayInitialized(object oidObject, string sVarName)
{
string sFullVarName = sVarName + "_INIT";
return GetLocalInt(oidObject, sFullVarName);
}
////////////////////////////////////////////////////////////////////////
void InitializeLocalArray(object oidObject, string sVarName)
{
int i, iBegin, iEnd;
string sFullVarName;
if (GetLocalArrayInitialized(oidObject, sVarName))
{
// wipe current contents
iBegin = GetLocalArrayLowerBound(oidObject, sVarName);
iEnd = GetLocalArrayUpperBound(oidObject, sVarName);
for (i = iEnd; i >= iBegin; i--)
{
sFullVarName = sVarName + IntToString(i);
DeleteLocalInt(oidObject, sFullVarName);
DeleteLocalFloat(oidObject, sFullVarName);
DeleteLocalString(oidObject, sFullVarName);
DeleteLocalObject(oidObject, sFullVarName);
DeleteLocalLocation(oidObject, sFullVarName);
}
}
SetLocalArrayLowerBound(oidObject, sVarName, 0);
SetLocalArrayUpperBound(oidObject, sVarName, -1);
sFullVarName = sVarName + "_INIT";
SetLocalInt(oidObject, sFullVarName, TRUE);
}
////////////////////////////////////////////////////////////////////////
int GetLocalArrayLowerBound(object oidObject, string sVarName)
{
string sFullVarName = sVarName + "_MIN";
return GetLocalInt(oidObject, sFullVarName);
}
////////////////////////////////////////////////////////////////////////
int GetLocalArrayUpperBound(object oidObject, string sVarName)
{
string sFullVarName = sVarName + "_MAX";
return GetLocalInt(oidObject, sFullVarName);
}
////////////////////////////////////////////////////////////////////////
void SetLocalArrayLowerBound(object oidObject, string sVarName, int nMin)
{
string sFullVarName = sVarName + "_MIN";
SetLocalInt(oidObject, sFullVarName, nMin);
}
////////////////////////////////////////////////////////////////////////
void SetLocalArrayUpperBound(object oidObject, string sVarName, int nMax)
{
string sFullVarName = sVarName + "_MAX";
SetLocalInt(oidObject, sFullVarName, nMax);
}
////////////////////////////////////////////////////////////////////////
int GetLocalArrayInt(object oidObject, string sVarName, int nVarNum)
{
string sFullVarName = sVarName + IntToString(nVarNum) ;
return GetLocalInt(oidObject, sFullVarName);
}
////////////////////////////////////////////////////////////////////////
void SetLocalArrayInt(object oidObject, string sVarName, int nVarNum, int nValue)
{
string sFullVarName = sVarName + IntToString(nVarNum) ;
SetLocalInt(oidObject, sFullVarName, nValue);
// update bounds
if (nVarNum < GetLocalArrayLowerBound(oidObject, sVarName))
SetLocalArrayLowerBound(oidObject, sVarName, nVarNum);
if (nVarNum > GetLocalArrayUpperBound(oidObject, sVarName))
SetLocalArrayUpperBound(oidObject, sVarName, nVarNum);
}
////////////////////////////////////////////////////////////////////////
float GetLocalArrayFloat(object oidObject, string sVarName, int nVarNum)
{
string sFullVarName = sVarName + IntToString(nVarNum) ;
return GetLocalFloat(oidObject, sFullVarName);
}
////////////////////////////////////////////////////////////////////////
void SetLocalArrayFloat(object oidObject, string sVarName, int nVarNum, float fValue)
{
string sFullVarName = sVarName + IntToString(nVarNum) ;
SetLocalFloat(oidObject, sFullVarName, fValue);
// update bounds
if (nVarNum < GetLocalArrayLowerBound(oidObject, sVarName))
SetLocalArrayLowerBound(oidObject, sVarName, nVarNum);
if (nVarNum > GetLocalArrayUpperBound(oidObject, sVarName))
SetLocalArrayUpperBound(oidObject, sVarName, nVarNum);
}
////////////////////////////////////////////////////////////////////////
string GetLocalArrayString(object oidObject, string sVarName, int nVarNum)
{
string sFullVarName = sVarName + IntToString(nVarNum) ;
return GetLocalString(oidObject, sFullVarName);
}
////////////////////////////////////////////////////////////////////////
void SetLocalArrayString(object oidObject, string sVarName, int nVarNum, string nValue)
{
string sFullVarName = sVarName + IntToString(nVarNum) ;
SetLocalString(oidObject, sFullVarName, nValue);
// update bounds
if (nVarNum < GetLocalArrayLowerBound(oidObject, sVarName))
SetLocalArrayLowerBound(oidObject, sVarName, nVarNum);
if (nVarNum > GetLocalArrayUpperBound(oidObject, sVarName))
SetLocalArrayUpperBound(oidObject, sVarName, nVarNum);
}
////////////////////////////////////////////////////////////////////////
object GetLocalArrayObject(object oidObject, string sVarName, int nVarNum)
{
string sFullVarName = sVarName + IntToString(nVarNum) ;
return GetLocalObject(oidObject, sFullVarName);
}
////////////////////////////////////////////////////////////////////////
void SetLocalArrayObject(object oidObject, string sVarName, int nVarNum, object oidValue)
{
string sFullVarName = sVarName + IntToString(nVarNum) ;
SetLocalObject(oidObject, sFullVarName, oidValue);
// update bounds
if (nVarNum < GetLocalArrayLowerBound(oidObject, sVarName))
SetLocalArrayLowerBound(oidObject, sVarName, nVarNum);
if (nVarNum > GetLocalArrayUpperBound(oidObject, sVarName))
SetLocalArrayUpperBound(oidObject, sVarName, nVarNum);
}
////////////////////////////////////////////////////////////////////////
location GetLocalArrayLocation(object oidObject, string sVarName, int nVarNum)
{
string sFullVarName = sVarName + IntToString(nVarNum) ;
return GetLocalLocation(oidObject, sFullVarName);
}
////////////////////////////////////////////////////////////////////////
void SetLocalArrayLocation(object oidObject, string sVarName, int nVarNum, location locValue)
{
string sFullVarName = sVarName + IntToString(nVarNum) ;
SetLocalLocation(oidObject, sFullVarName, locValue);
// update bounds
if (nVarNum < GetLocalArrayLowerBound(oidObject, sVarName))
SetLocalArrayLowerBound(oidObject, sVarName, nVarNum);
if (nVarNum > GetLocalArrayUpperBound(oidObject, sVarName))
SetLocalArrayUpperBound(oidObject, sVarName, nVarNum);
}

View File

@@ -1,64 +0,0 @@
//DMFI Persistence wrapper functions
//This include file contains the wrapper functions for the
//persistent settings of the DMFI Wand and Widget package
//Advanced users can adapt this to the database system that
//they want to use for NWN.
//
//These functions use the Bioware database by default and use a primitive form
//of "caching" to avoid lots of database R/W
//:://////////////////////////////////////////////
//:: Created By: The DMFI Team
//:: Created On:
//:://////////////////////////////////////////////
//:: 2008.07.10 tsunami282 - implemented alternate database support, initially
//:: for Knat's NBDE
const int DMFI_DB_TYPE =DMFI_DB_TYPE_BIOWARE;
void FlushDMFIPersistentData(string sDBName)
{
// no flushing required for Bioware database
}
int IsDMFIPersistentDataDirty(string sDBName)
{
return FALSE; // bioware database system has no cache, so is never dirty
}
//Int functions
int GetDMFIPersistentInt(string sDBName, string sDBSetting, object oPlayer = OBJECT_INVALID)
{
int iReturn = GetCampaignInt(sDBName, sDBSetting, oPlayer);
return iReturn;
}
void SetDMFIPersistentInt(string sDBName, string sDBSetting, int iDBValue, object oPlayer = OBJECT_INVALID)
{
SetCampaignInt(sDBName, sDBSetting, iDBValue, oPlayer);
}
//Float functions
float GetDMFIPersistentFloat(string sDBName, string sDBSetting, object oPlayer = OBJECT_INVALID)
{
float fReturn = GetCampaignFloat(sDBName, sDBSetting, oPlayer);
return fReturn;
}
void SetDMFIPersistentFloat(string sDBName, string sDBSetting, float fDBValue, object oPlayer = OBJECT_INVALID)
{
SetCampaignFloat(sDBName, sDBSetting, fDBValue, oPlayer);
}
//String functions
string GetDMFIPersistentString(string sDBName, string sDBSetting, object oPlayer = OBJECT_INVALID)
{
string sReturn = GetCampaignString(sDBName, sDBSetting, oPlayer);
return sReturn;
}
void SetDMFIPersistentString(string sDBName, string sDBSetting, string sDBValue, object oPlayer = OBJECT_INVALID)
{
SetCampaignString(sDBName, sDBSetting, sDBValue, oPlayer);
}

View File

@@ -1,39 +0,0 @@
//DMFI Persistence wrapper functions
//This include file contains the wrapper functions for the
//persistent settings of the DMFI Wand and Widget package
//Advanced users can adapt this to the database system that
//they want to use for NWN.
//:://////////////////////////////////////////////
//:: Created By: The DMFI Team
//:: Created On:
//:://////////////////////////////////////////////
//:: 2008.07.10 tsunami282 - implemented alternate database support, initially
//:: for Knat's NBDE
//Listen Pattern ** variable
//Change this to 0 to make the DMFI W&W more compatible with Jasperre's AI
const int LISTEN_PATTERN = 20600;
const int DMFI_DB_TYPE_BIOWARE = 1;
const int DMFI_DB_TYPE_NBDE = 2;
const int DMFI_DB_TYPE_RESERVED_3 = 3;
const int DMFI_DB_TYPE_RESERVED_4 = 4;
const int DMFI_DB_TYPE_RESERVED_5 = 5;
const int DMFI_DB_TYPE_RESERVED_6 = 6;
const int DMFI_DB_TYPE_RESERVED_7 = 7;
const int DMFI_DB_TYPE_RESERVED_8 = 8;
const int DMFI_DB_TYPE_RESERVED_9 = 9;
const int DMFI_DB_TYPE_RESERVED_10 = 10;
// *** DATABASE SELECTION ***
// Only choose one of the following #include lines. Comment out all the others!
// Standard version uses the default Bioware database
#include "dmfi_db_biow_inc"
// Alternate version: using Knat's NBDE
// This provides greatly increased speed, but necessitates occasional flushing to disk.
// Flushing requires you to add code to Your module OnHeartbeat event.
// #include "dmfi_db_nbde_inc"

View File

@@ -1,65 +0,0 @@
//DMFI Persistence wrapper functions
// modified version for Knat's NBDE support
//:://////////////////////////////////////////////
//:: Created By: The DMFI Team
//:: Created On:
//:://////////////////////////////////////////////
//:: 2008.07.10 tsunami282 - implemented alternate database support, initially
//:: for Knat's NBDE
const int DMFI_DB_TYPE = DMFI_DB_TYPE_NBDE;
#include "nbde_inc"
void FlushDMFIPersistentData(string sDBName)
{
NBDE_SetCampaignInt(sDBName, "DMFI_DB_DIRTY", FALSE);
NBDE_FlushCampaignDatabase(sDBName);
}
int IsDMFIPersistentDataDirty(string sDBName)
{
return NBDE_GetCampaignInt(sDBName, "DMFI_DB_DIRTY");
}
//Int functions
int GetDMFIPersistentInt(string sDBName, string sDBSetting, object oPlayer = OBJECT_INVALID)
{
int iReturn = NBDE_GetCampaignInt(sDBName, sDBSetting, oPlayer);
return iReturn;
}
void SetDMFIPersistentInt(string sDBName, string sDBSetting, int iDBValue, object oPlayer = OBJECT_INVALID)
{
NBDE_SetCampaignInt(sDBName, sDBSetting, iDBValue, oPlayer);
NBDE_SetCampaignInt(sDBName, "DMFI_DB_DIRTY", TRUE);
}
//Float functions
float GetDMFIPersistentFloat(string sDBName, string sDBSetting, object oPlayer = OBJECT_INVALID)
{
float fReturn = NBDE_GetCampaignFloat(sDBName, sDBSetting, oPlayer);
return fReturn;
}
void SetDMFIPersistentFloat(string sDBName, string sDBSetting, float fDBValue, object oPlayer = OBJECT_INVALID)
{
NBDE_SetCampaignFloat(sDBName, sDBSetting, fDBValue, oPlayer);
NBDE_SetCampaignInt(sDBName, "DMFI_DB_DIRTY", TRUE);
}
//String functions
string GetDMFIPersistentString(string sDBName, string sDBSetting, object oPlayer = OBJECT_INVALID)
{
string sReturn = NBDE_GetCampaignString(sDBName, sDBSetting, oPlayer);
return sReturn;
}
void SetDMFIPersistentString(string sDBName, string sDBSetting, string sDBValue, object oPlayer = OBJECT_INVALID)
{
NBDE_SetCampaignString(sDBName, sDBSetting, sDBValue, oPlayer);
NBDE_SetCampaignInt(sDBName, "DMFI_DB_DIRTY", TRUE);
}

View File

@@ -1,35 +0,0 @@
//::///////////////////////////////////////////////
//:: DMFI - DMFI_get_line callback template
//:: dmfi_getln_cbtpl
//:://////////////////////////////////////////////
/*
A template (skeleton) function for DMFI_get_line callback processing.
Use this template to create your script to be invoked when your scripted call
to DMFI_get_line receives input.
*/
//:://////////////////////////////////////////////
//:: Created By: tsunami282
//:: Created On: 2008.05.21
//:://////////////////////////////////////////////
void main()
{
int nVolume = GetPCChatVolume();
object oShouter = GetPCChatSpeaker();
string sSaid = GetPCChatMessage();
// you may wish to define an "abort" input message, such as a line
// containing a single period:
if (sSaid != ".")
{
// put your code here to process the input line (in sSaid)
}
// after processing, you will likely want to "eat" the text line, so it is
// not spoken or available for further processing. If you want the line to
// appear, either comment out the following line, or set it to:
// SetPCChatMessage(sSaid);
SetPCChatMessage("");
}

View File

@@ -1,61 +0,0 @@
// DMFI_get_line: generic input line processing
//
// You can use this when you want to retrieve a spoken line of text.
//
// Specify the PC you want to listen to, the channel you want to listen on
// (often the TALK channel), and the name of the script to run when a line
// of text is heard.
//
// See the file dmfi_getln_cbtbl for a sample template script for processing
// the heard line.
#include "dmfi_plychat_inc"
const string DMFI_GETLINE_HOOK_HANDLE_VARNAME = "dmfi_getline_hookhandle";
/**
*
* @author tsunami282
* @since 1.09
*
* @param oSpeaker PC we want to listen to.
* @param iChannel voice channel to listen on (use TALKVOLUME_ constants).
* @param sEventScriptName sEventScriptName = name of script to call upon completion
* of input (cannot be blank).
* @param oRequester object requesting the result: the sEventScriptName script
* will be invoked with this as the caller, and therefore it
* must be valid at time of player chat event.
* @return handle (positive int) of the chat event hook
*/
int DMFI_get_line(object oSpeaker, int iChannel, string sEventScriptName,
object oRequester = OBJECT_SELF)
{
int hdlHook = 0;
if (GetIsObjectValid(oSpeaker) && GetIsObjectValid(oRequester) && sEventScriptName != "")
{
// SendMessageToPC(GetFirstPC(), "getline - apply hook");
hdlHook = DMFI_ChatHookAdd(sEventScriptName, oRequester, (1 << iChannel),
FALSE, oSpeaker, TRUE);
// SendMessageToPC(GetFirstPC(), "getline - hook handle returned is " + IntToString(hdlHook));
SetLocalInt(oRequester, DMFI_GETLINE_HOOK_HANDLE_VARNAME, hdlHook);
}
return hdlHook;
}
/**
*
*
*
* @param hdlHookIn handle of hook handler that we want to un-hook.
* @param oRequester object requesting the result of DMFI_get_line
*/
void DMFI_cancel_get_line(int hdlHookIn = 0, object oRequester = OBJECT_SELF)
{
int hdlHook = hdlHookIn;
if (hdlHook == 0) hdlHook = GetLocalInt(oRequester, DMFI_GETLINE_HOOK_HANDLE_VARNAME);
DMFI_ChatHookRemove(hdlHook);
}

View File

@@ -1,217 +0,0 @@
#include "dmfi_db_inc"
const int DMFI_DEFAULT_EMOTES_MUTED = FALSE;
int dmfiInitialize(object oUser)
{
//*************************************INITIALIZATION CODE***************************************
//***************************************RUNS ONE TIME ***************************************
//voice stuff is module wide
if (GetLocalInt(GetModule(), "dmfi_initialized") != 1)
{
SendMessageToPC(oUser,":: DMFI Wands & Widgets System ::");
int iLoop = 20610;
string sText;
while (iLoop < 20680)
{
sText = GetDMFIPersistentString("dmfi", "hls" + IntToString(iLoop));
SetCustomToken(iLoop, sText);
iLoop++;
}
SendMessageToAllDMs("DMFI voice custom tokens initialized.");
SetLocalInt(GetModule(), "dmfi_initialized", 1);
}
//remainder of settings are user based
if ((GetLocalInt(oUser, "dmfi_initialized")!=1) && (GetIsDM(oUser) || GetIsDMPossessed(oUser)))
{
//if you have campaign variables set - use those settings
if (GetDMFIPersistentInt("dmfi", "Settings", oUser)==1)
{
FloatingTextStringOnCreature("DMFI Settings Restored", oUser, FALSE);
// SendMessageToPC(oUser, "DMFI Settings Restored");
int n = GetDMFIPersistentInt("dmfi", "dmfi_alignshift", oUser);
SetCustomToken(20781, IntToString(n));
SetLocalInt(oUser, "dmfi_alignshift", n);
SendMessageToPC(oUser, "Settings: Alignment shift: "+IntToString(n));
n = GetDMFIPersistentInt("dmfi", "dmfi_safe_factions", oUser);
SetLocalInt(oUser, "dmfi_safe_factions", n);
SendMessageToPC(oUser, "Settings: Factions (1 is DMFI Safe Faction): "+IntToString(n));
n = GetDMFIPersistentInt("dmfi", "dmfi_damagemodifier", oUser);
SetLocalInt(oUser, "dmfi_damagemodifier",n);
SendMessageToPC(oUser, "Settings: Damage Modifier: "+IntToString(n));
n = GetDMFIPersistentInt("dmfi","dmfi_buff_party",oUser);
SetLocalInt(oUser, "dmfi_buff_party", n);
if (n==1)
SetCustomToken(20783, "Party");
else
SetCustomToken(20783, "Single Target");
SendMessageToPC(oUser, "Settings: Buff Party (1 is Party): "+IntToString(n));
string sLevel = GetDMFIPersistentString("dmfi", "dmfi_buff_level", oUser);
SetCustomToken(20782, sLevel);
SetLocalString(oUser, "dmfi_buff_level", sLevel);
SendMessageToPC(oUser, "Settings: Buff Level: "+ sLevel);
n = GetDMFIPersistentInt("dmfi", "dmfi_dicebag", oUser);
SetLocalInt(oUser, "dmfi_dicebag", n);
string sText;
if (n==0)
{
SetCustomToken(20681, "Private");
sText = "Private";
}
else if (n==1)
{
SetCustomToken(20681, "Global");
sText = "Global";
}
else if (n==2)
{
SetCustomToken(20681, "Local");
sText = "Local";
}
else if (n==3)
{
SetCustomToken(20681, "DM Only");
sText = "DM Only";
}
SendMessageToPC(oUser, "Settings: Dicebag Reporting: "+sText);
n = GetDMFIPersistentInt("dmfi", "dmfi_dice_no_animate", oUser);
SetLocalInt(oUser, "dmfi_dice_no_animate", n);
SendMessageToPC(oUser, "Settings: Roll Animations (1 is OFF): "+IntToString(n));
float f = GetDMFIPersistentFloat("dmfi", "dmfi_reputation", oUser);
SetLocalFloat(oUser, "dmfi_reputation", f);
SendMessageToPC(oUser, "Settings: Reputation Adjustment: "+FloatToString(f));
f = GetDMFIPersistentFloat("dmfi", "dmfi_effectduration", oUser);
SetLocalFloat(oUser, "dmfi_effectduration", f);
SendMessageToPC(oUser, "Settings: Effect Duration: "+FloatToString(f));
f = GetDMFIPersistentFloat("dmfi", "dmfi_sound_delay", oUser);
SetLocalFloat(oUser, "dmfi_sound_delay", f);
SendMessageToPC(oUser, "Settings: Sound Delay: "+FloatToString(f));
f = GetDMFIPersistentFloat("dmfi", "dmfi_beamduration", oUser);
SetLocalFloat(oUser, "dmfi_beamduration", f);
SendMessageToPC(oUser, "Settings: Beam Duration: "+FloatToString(f));
f = GetDMFIPersistentFloat("dmfi", "dmfi_stunduration", oUser);
SetLocalFloat(oUser, "dmfi_stunduration", f);
SendMessageToPC(oUser, "Settings: Stun Duration: "+FloatToString(f));
f = GetDMFIPersistentFloat("dmfi", "dmfi_saveamount", oUser);
SetLocalFloat(oUser, "dmfi_saveamount", f);
SendMessageToPC(oUser, "Settings: Save Adjustment: "+FloatToString(f));
f = GetDMFIPersistentFloat("dmfi", "dmfi_effectdelay", oUser);
SetLocalFloat(oUser, "dmfi_effectdelay", f);
SendMessageToPC(oUser, "Settings: Effect Delay: "+FloatToString(f));
}
else
{
FloatingTextStringOnCreature("DMFI Default Settings Initialized", oUser, FALSE);
// SendMessageToPC(oUser, "DMFI Default Settings Initialized");
//Setting FOUR campaign variables so 1st use will be slow.
//Recommend initializing your preferences with no players or
//while there is NO fighting.
// SetLocalInt(oUser, "dmfi_initialized", 1);
SetDMFIPersistentInt("dmfi", "Settings", 1, oUser);
SetCustomToken(20781, "5");
SetLocalInt(oUser, "dmfi_alignshift", 5);
SetDMFIPersistentInt("dmfi", "dmfi_alignshift", 5, oUser);
SendMessageToPC(oUser, "Settings: Alignment shift: 5");
SetCustomToken(20783, "Single Target");
SetLocalInt(oUser, "dmfi_buff_party", 0);
SetDMFIPersistentInt("dmfi", "dmfi_buff_party", 0, oUser);
SendMessageToPC(oUser, "Settings: Buff set to Single Target: ");
SetCustomToken(20782, "Low");
SetLocalString(oUser, "dmfi_buff_level", "LOW");
SetDMFIPersistentString("dmfi", "dmfi_buff_level", "LOW", oUser);
SendMessageToPC(oUser, "Settings: Buff Level set to LOW: ");
SetLocalInt(oUser, "dmfi_dicebag", 0);
SetCustomToken(20681, "Private");
SetDMFIPersistentInt("dmfi", "dmfi_dicebag", 0, oUser);
SendMessageToPC(oUser, "Settings: Dicebag Rolls set to PRIVATE");
SetLocalInt(oUser, "", 0);
SetDMFIPersistentInt("dmfi", "dmfi_safe_factions", 0, oUser);
SendMessageToPC(oUser, "Settings: Factions set to BW base behavior");
SetLocalFloat(oUser, "dmfi_reputation", 5.0);
SetCustomToken(20784, "5");
SetDMFIPersistentFloat("dmfi", "dmfi_reputation", 5.0, oUser);
SendMessageToPC(oUser, "Settings: Reputation adjustment: 5");
SetDMFIPersistentFloat("dmfi", "dmfi_effectduration", 60.0, oUser);
SetLocalFloat(oUser, "dmfi_effectduration", 60.0);
SetDMFIPersistentFloat("dmfi", "dmfi_sound_delay", 0.2, oUser);
SetLocalFloat(oUser, "dmfi_sound_delay", 0.2);
SetDMFIPersistentFloat("dmfi", "dmfi_beamduration", 5.0, oUser);
SetLocalFloat(oUser, "dmfi_beamduration", 5.0);
SetDMFIPersistentFloat("dmfi", "dmfi_stunduration", 1000.0, oUser);
SetLocalFloat(oUser, "dmfi_stunduration", 1000.0);
SetDMFIPersistentFloat("dmfi", "dmfi_saveamount", 5.0, oUser);
SetLocalFloat(oUser, "dmfi_saveamount", 5.0);
SetDMFIPersistentFloat("dmfi", "dmfi_effectdelay", 1.0, oUser);
SetLocalFloat(oUser, "dmfi_effectdelay", 1.0);
SendMessageToPC(oUser, "Settings: Effect Duration: 60.0");
SendMessageToPC(oUser, "Settings: Effect Delay: 1.0");
SendMessageToPC(oUser, "Settings: Beam Duration: 5.0");
SendMessageToPC(oUser, "Settings: Stun Duration: 1000.0");
SendMessageToPC(oUser, "Settings: Sound Delay: 0.2");
SendMessageToPC(oUser, "Settings: Save Adjustment: 5.0");
}
}
//********************************END INITIALIZATION***************************
// inits for all users (DM & player)
if (GetLocalInt(oUser, "dmfi_initialized")!=1)
{
int bEmotesMuted;
if (GetDMFIPersistentInt("dmfi", "Settings", oUser)==1)
{
bEmotesMuted = GetDMFIPersistentInt("dmfi", "dmfi_emotemute", oUser);
}
else
{
bEmotesMuted = DMFI_DEFAULT_EMOTES_MUTED;
SetDMFIPersistentInt("dmfi", "dmfi_emotemute", bEmotesMuted, oUser);
}
SetLocalInt(oUser, "hls_emotemute", bEmotesMuted);
SendMessageToPC(oUser, "Settings: Emotes "+(bEmotesMuted ? "muted" : "unmuted"));
SetLocalObject(oUser, "dmfi_VoiceTarget", OBJECT_INVALID);
SendMessageToPC(oUser, "Settings: Voice throw target cleared");
SetLocalObject(oUser, "dmfi_univ_target", oUser);
SendMessageToPC(oUser, "Settings: Command target set to self");
SetLocalInt(oUser, "dmfi_initialized", 1);
}
return TRUE; // no errors detected
}

View File

@@ -1,23 +0,0 @@
//::///////////////////////////////////////////////
//:: DMFI - OnClientEnter event handler
//:: dmfi_onclienter
//:://////////////////////////////////////////////
/*
Event handler for the module-level OnClientEnter event. Initializes DMFI system.
*/
//:://////////////////////////////////////////////
//:: 2008.08.02 tsunami282 - created.
#include "dmfi_init_inc"
////////////////////////////////////////////////////////////////////////
void main()
{
object oUser = GetEnteringObject();
// do any other module OnClientEnter work here
ExecuteScript("x3_mod_def_enter", OBJECT_SELF);
// initialize DMFI
dmfiInitialize(oUser);
}

View File

@@ -1,29 +0,0 @@
#include "dmfi_db_inc"
const int FLUSH_INTERVAL = 30; // seconds between database flushes to disk
void main()
{
// see if database is "dirty" (changed since last flush)
if (IsDMFIPersistentDataDirty("dmfi"))
{
// it is, so check if time to flush database
object oMod = GetModule();
int iTick = GetLocalInt(oMod, "DMFI_MODULE_HEARTBEAT_TICK");
int iSecsSinceFlush = iTick * 6;
if (iSecsSinceFlush >= FLUSH_INTERVAL)
{
FlushDMFIPersistentData("dmfi");
iTick = 0;
}
else
{
iTick++;
}
SetLocalInt(oMod, "DMFI_MODULE_HEARTBEAT_TICK", iTick);
}
// do any other module OnHeartbeat work here
ExecuteScript("x3_mod_def_hb", OBJECT_SELF);
}

View File

@@ -1,79 +0,0 @@
//::///////////////////////////////////////////////
//:: DMFI - OnPlayerChat event handler
//:: dmfi_onplychat
//:://////////////////////////////////////////////
/*
Event handler for the module-level OnPlayerChat event. Manages scripter-added
event scripts.
*/
//:://////////////////////////////////////////////
//:: Created By: Merle, with help from mykael22000 and tsunami282
//:: Created On: 2007.12.12
//:://////////////////////////////////////////////
//:: 2007.12.27 tsunami282 - implemented hooking tree
#include "dmfi_plychat_inc"
const string DMFI_PLAYERCHAT_SCRIPTNAME = "dmfi_plychat_exe";
////////////////////////////////////////////////////////////////////////
void main()
{
int nVolume = GetPCChatVolume();
object oShouter = GetPCChatSpeaker();
int bInvoke;
string sChatHandlerScript;
int maskChannels;
// int bListenAll;
object oRunner;
int bAutoRemove;
int bDirtyList = FALSE;
int iHook;
object oMod = GetModule();
// SendMessageToPC(GetFirstPC(), "OnPlayerChat - process hooks");
int nHooks = GetLocalArrayUpperBound(oMod, DMFI_CHATHOOK_HANDLE_ARRAYNAME);
for (iHook = nHooks; iHook > 0; iHook--) // reverse-order execution, last hook gets first dibs
{
// SendMessageToPC(GetFirstPC(), "OnPlayerChat -- process hook #" + IntToString(iHook));
maskChannels = GetLocalArrayInt(oMod, DMFI_CHATHOOK_CHANNELS_ARRAYNAME, iHook);
// SendMessageToPC(GetFirstPC(), "OnPlayerChat -- channel heard=" + IntToString(nVolume) + ", soughtmask=" + IntToString(maskChannels));
if (((1 << nVolume) & maskChannels) != 0) // right channel
{
// SendMessageToPC(GetFirstPC(), "OnPlayerChat --- channel matched");
bInvoke = FALSE;
if (GetLocalArrayInt(oMod, DMFI_CHATHOOK_LISTENALL_ARRAYNAME, iHook) != FALSE)
{
bInvoke = TRUE;
}
else
{
object oDesiredSpeaker = GetLocalArrayObject(oMod, DMFI_CHATHOOK_SPEAKER_ARRAYNAME, iHook);
if (oShouter == oDesiredSpeaker) bInvoke = TRUE;
}
if (bInvoke) // right speaker
{
// SendMessageToPC(GetFirstPC(), "OnPlayerChat --- speaker matched");
sChatHandlerScript = GetLocalArrayString(oMod, DMFI_CHATHOOK_SCRIPT_ARRAYNAME, iHook);
oRunner = GetLocalArrayObject(oMod, DMFI_CHATHOOK_RUNNER_ARRAYNAME, iHook);
// SendMessageToPC(GetFirstPC(), "OnPlayerChat --- executing script '" + sChatHandlerScript + "' on object '" + GetName(oRunner) +"'");
ExecuteScript(sChatHandlerScript, oRunner);
bAutoRemove = GetLocalArrayInt(oMod, DMFI_CHATHOOK_AUTOREMOVE_ARRAYNAME, iHook);
if (bAutoRemove)
{
// SendMessageToPC(GetFirstPC(), "OnPlayerChat --- scheduling autoremove");
bDirtyList = TRUE;
SetLocalArrayInt(oMod, DMFI_CHATHOOK_HANDLE_ARRAYNAME, iHook, 0);
}
}
}
}
if (bDirtyList) DMFI_ChatHookRemove(0);
// always execute the DMFI parser
ExecuteScript(DMFI_PLAYERCHAT_SCRIPTNAME, OBJECT_SELF);
}

View File

@@ -1,464 +0,0 @@
/*DMFI Rest System Alpha by hahnsoo
CONTENTS
--------
Placeables>>Special>>Custom 5 - DMFI Bed Roll, DMFI Campfire, DMFI Invisible
Rest Object, DMFI Tent
Items>>Special>>Custom5 - DMFI Bed Roll (100 gp), DMFI Firewood (1 gp), DMFI
Portable Tent (500 gp) (different gp values for different situations)
Scripts - dmfi_onrest
(Yup, that's it)
Description
-----------
This is a robust and versatile rest system that incorporates a LOT of options.
Perhaps too many, I don't know. I tried to find everything that folks would
possibly want in a resting system. The most important "feature" is the rest
conversation menu, which governs for both DM and Player the kind of resting that
is allowed.
The ways you can control rest in this system are:
1) Global vs. Local - Restrict or release restrictions on resting based on world
settings or on a per-area basis
2) Unlimited vs. Limited vs. No Rest - Have the Players rest at any time they'd
like. Or Limit them according to certain parameters and toggles. Or don't
allow them to rest at all. You can set these both globally and locally
(Unlimited and No Rest areas).
3) Time restriction - The staple of most simple rest restrictions. You can limit
resting per 1, 2, 4, 8, 12, or 24 in-game hours, and the amount of real-time
minutes are calculated for the DM. Again, you can set these both globally
and locally.
4) Placeables - Popularized by Demetrious's Supply-Based Rest, this allows you
to restrict resting according to proximity to objects. It allows you to use
DMFI rest objects (tag = dmfi_restobject), campfires, bedrolls, beds, tents
(a "Name-based" rest placeable), and toggles to include/exclude certain
classes that typically don't care about such niceties.
5) Armor Restrictions - I'm not quite fond of this particular one, but it is a
standard feature of many rest systems and thus included in the package.
Allows you to set what weight of armor allows a PC to rest.
6) Set Hit Point Restrictions - Unlike the other restrictions, this does NOT
prevent resting. What it does is determine how many hitpoints are regained
upon resting, from a gradient of no hitpoints to all hitpoint, and some
interesting options in between (1 HP per level, per 3rd edition, which
skews against fighter classes and CON based HP gain, which skews in favor of
lower level characters).
7) Toggle Spell Memorization - This converts the "rest" into a "pseudorest"
which only heals HP. Useful for a "no spell memorization" zone locally, not
much use globally.
8) Various other "fluff" settings (Snoring, the rest conversation menu,
immobilized resting, floating text feedback).
There is also a "big red button" option that simply full rests all PCs in the
area. Useful to quickly work around rest restrictions that you have previously
set up.
Installation
------------
Change your OnRest event script to the dmfi_onrest script. Or you can do an
external execute script call by using ExecuteScript("dmfi_onrest", OBJECT_SELF);
in your current script.
The areas in your module should NOT have the "No Rest" box checked, in the areas
which you wish to use this system.
Configuration
-------------
All configuration of the system is done in-game as a DM. To bring up the Rest
Configuration Menu, press R or the rest button.
The conversation will detail the settings you have in the area (whether you are
using the default Global settings or using the Local area settings to override)
and the particular restrictions that you have set.
Settings are stored Persistently using the Bioware Database, per the DMFI W&W
default persistence options. If you want to use another database system, simply
edit the the dmfi_db_inc wrapper functions to your liking.
Unlimited Rest means just that: No restrictions. You may have global
restrictions set up, but as long as Unlimited rest is set globally or locally,
they are ignored.
No Rest means just that: No resting allowed, regardless of restrictions.
Limited Rest means that the restrictions you have set globally or locally are in
effect. You can restrict resting as stated above in the Description.
When you set any [LOCAL] Area variables, you automatically set the area to
"override" the global rest restrictions. This means that this area follows its
own rules, and isn't governed by the global rules. Setting the [LOCAL] Area
restrictions will copy the current global restriction variables, but after that,
the only way to go back to "global" is to select "Use default [GLOBAL] Module
settings"
Tip: The most useful way to use this is to simply set areas as Unlimited Rest or
No Rest, say an Inn Room or a combat zone, respectively.
Player Notes
------------
If you are using the DMFI Rest Menu (on by default), the rest restrictions (if
any) are displayed on your Rest Conversation Menu, telling you why you can't
rest (if you are restricted). You also have the option to access both the DMFI
Dicebag and the DMFI Emote wand directly from the Rest Menu. This allows you to
use emotes or dice checks WITHOUT having that silly "Use Unique Power"
animation.
Included in this package is a way to do "Alternate Resting Animations". These
animations simply change the way you appear when you rest. Since they use the
ForceRest() function, it isn't a "true" rest... rather it sets you for a certain
amount of time (equal to a normal rest) as un-moveable, and applies the rest at
the end of that time. This just means you don't get the little egg timer.
This is an ALPHA release, and I'm pretty sure I don't know everything about
Resting systems in the universe. I've tried to incorporate nearly all of the
elements I've seen in other available resting systems and encorporate them into
a small (single script), DMFI-integrated package.
I would greatly appreciate feedback, suggestions, additions, omissions, bug
reports, whatever. Send them to me at hahns_shin@hotmail.com.*/
#include "prc_inc_util"
#include "dmfi_db_inc"
//This function calculates the resting duration based on PC Hit Dice
//Based off of restduration.2da
void FloatyText(string sText, object oPC, int iSettings)
{
if (!(iSettings & 0x40000000))
FloatingTextStringOnCreature(sText, oPC, FALSE);
}
float GetRestDuration(object oPC)
{
return 10.0f + 0.5f * IntToFloat(GetHitDice(oPC));
}
// This function is used as a wrapper for the Rest VFX Object
void DoRestVFX(object oPC, float fDuration, int nEffect) {
effect eEffect;
if (nEffect == -1) {
eEffect = EffectCutsceneImmobilize();
} else {
eEffect = EffectVisualEffect(nEffect);
}
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, ExtraordinaryEffect(eEffect), oPC, fDuration);
}
//This function adds the Blindness/Snore effects
//Also adds cutscene immobilize to prevent movement
//Snoring should only occur at start, then follows on the module's hb
void ApplyRestVFX(object oPC, int iSettings)
{
object oRestVFX = GetObjectByTag("dmfi_restvfxobject");
effect eSnore = EffectVisualEffect(VFX_IMP_SLEEP); //Sleepy "ZZZ"s
float fDuration = GetRestDuration(oPC);
float fSeconds = 6.0f;
if (!(iSettings & 0x80000000)) //Immobile Resting flag
{
// Pass a -1 for EffectCutsceneImmobilize.
// For a visual effect, simply pass the VFX constant.
AssignCommand(oRestVFX, DoRestVFX(oPC, fDuration, -1));
}
if (!(iSettings & 0x20000000)) //VFX flag
{
// AssignCommand(oRestVFX, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, ExtraordinaryEffect(eBlind), oPC, fDuration));
AssignCommand(oRestVFX, DoRestVFX(oPC, fDuration, VFX_DUR_BLACKOUT));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eSnore, oPC);
}
}
// Removes blindness & immobilize -- Merle
void RemoveRestVFX(object oPC) {
object oRestVFX = GetObjectByTag("dmfi_restvfxobject");
effect eEffect = GetFirstEffect(oPC);
while (GetIsEffectValid(eEffect)) {
if (GetEffectCreator(eEffect) == oRestVFX) {
RemoveEffect(oPC, eEffect);
}
eEffect = GetNextEffect(oPC);
}
}
//This function gets the "Final HP" available to the PC after resting
int CalculateFinalHitPoints(object oPC, int iSettings)
{
int iHP = (iSettings & 0x0f000000);
switch(iHP)
{
case 0x01000000: return 0; break;
case 0x02000000: return GetHitDice(oPC); break;
case 0x03000000: return GetAbilityScore(oPC, ABILITY_CONSTITUTION); break;
case 0x04000000: return GetMaxHitPoints(oPC)/10; break;
case 0x05000000: return GetMaxHitPoints(oPC)/4; break;
case 0x06000000: return GetMaxHitPoints(oPC)/2; break;
case 0x07000000: return GetMaxHitPoints(oPC); break;
default: return GetMaxHitPoints(oPC); break;
}
return GetMaxHitPoints(oPC);
}
void RemoveMagicalEffects(object oPC)
{
effect eEffect = GetFirstEffect(oPC);
while (GetIsEffectValid(eEffect))
{
if (GetEffectSubType(eEffect) == SUBTYPE_MAGICAL)
RemoveEffect(oPC, eEffect);
eEffect = GetNextEffect(oPC);
}
}
//This function simulates a rest without restoring spells
void DoPseudoRest(object oPC, int iSettings, int iSpells = FALSE)
{
effect eSnore = EffectVisualEffect(VFX_IMP_SLEEP);
effect eBlind = EffectVisualEffect(VFX_DUR_BLACKOUT);
effect eStop = EffectCutsceneImmobilize();
float fDuration = GetRestDuration(oPC);
float fSeconds = 6.0f;
int iAnimation = GetLocalInt(oPC, "dmfi_r_alternate");
if (!iAnimation)
iAnimation = ANIMATION_LOOPING_SIT_CROSS;
AssignCommand(oPC, PlayAnimation(iAnimation, 1.0f, fDuration));
DelayCommand(0.1, SetCommandable(FALSE, oPC));
DelayCommand(fDuration, SetCommandable(TRUE, oPC));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, ExtraordinaryEffect(eStop), oPC, fDuration);
if (!(iSettings & 0x20000000) && iAnimation != ANIMATION_LOOPING_MEDITATE && iAnimation != ANIMATION_LOOPING_WORSHIP) //If the No VFX flag is not set, do VFX
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, ExtraordinaryEffect(eBlind), oPC, fDuration);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eSnore, oPC);
while (fSeconds < fDuration)
{
DelayCommand(fSeconds, ApplyEffectToObject(DURATION_TYPE_INSTANT, eSnore, oPC));
fSeconds += 6.0f;
}
}
if (!iSpells)
{
effect eHeal = EffectHeal(CalculateFinalHitPoints(oPC, iSettings)); //Heal the PC
DelayCommand(fDuration + 0.1f, ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oPC));
DelayCommand(fDuration + 0.1f, RemoveMagicalEffects(oPC)); //Remove all magical effects from PC
}
else
{
DelayCommand(fDuration + 0.1f, PRCForceRest(oPC));
}
DeleteLocalInt(oPC, "dmfi_r_alternate");
}
//This function determines if the PC is wearing heavy armor
int GetIsWearingHeavyArmor(object oPC, int iSettings)
{
int iArmor = (iSettings & 0x00f00000);
object oArmor = GetItemInSlot(INVENTORY_SLOT_CHEST, oPC);
int iWeight = GetWeight(oArmor);
switch(iArmor)
{
default:
case 0x00100000: if (iWeight > 20) return TRUE; break;
case 0x00200000: if (iWeight > 60) return TRUE; break;
case 0x00300000: if (iWeight > 110) return TRUE; break;
case 0x00400000: if (iWeight > 160) return TRUE; break;
case 0x00500000: if (iWeight > 310) return TRUE; break;
case 0x00600000: if (iWeight > 410) return TRUE; break;
case 0x00700000: if (iWeight > 460) return TRUE; break;
}
return FALSE;
}
//This function determines if the PC is near a resting placeable
int GetIsNearRestingObject(object oPC, int iSettings)
{
if (iSettings & 0x00020000) //Ignore Druid
{
if (GetLevelByClass(CLASS_TYPE_DRUID, oPC))
return TRUE;
}
if (iSettings & 0x00040000) //Ignore Ranger
{
if (GetLevelByClass(CLASS_TYPE_RANGER, oPC))
return TRUE;
}
if (iSettings & 0x00080000) //Ignore Barb
{
if (GetLevelByClass(CLASS_TYPE_BARBARIAN, oPC))
return TRUE;
}
object oPlaceable = GetFirstObjectInShape(SHAPE_SPHERE, 6.0f, GetLocation(oPC), TRUE, OBJECT_TYPE_PLACEABLE);
while (GetIsObjectValid(oPlaceable))
{
if (!(iSettings & 0x00001000) && GetTag(oPlaceable) == "dmfi_rest") //DMFI Placeables: by default, ON
return TRUE;
if ((iSettings & 0x00002000) && GetStringLowerCase(GetName(oPlaceable)) == "campfire") //Campfires
return TRUE;
if ((iSettings & 0x00004000) && (GetStringLowerCase(GetName(oPlaceable)) == "bed roll" || GetStringLowerCase(GetName(oPlaceable)) == "bedroll")) //Bed rolls
return TRUE;
if ((iSettings & 0x00008000) && GetStringLowerCase(GetName(oPlaceable)) == "bed") //beds
return TRUE;
if ((iSettings & 0x00010000) && GetStringLowerCase(GetName(oPlaceable)) == "tent") //tents
return TRUE;
oPlaceable = GetNextObjectInShape(SHAPE_SPHERE, 6.0f, GetLocation(oPC), TRUE, OBJECT_TYPE_PLACEABLE);
}
return FALSE;
}
// Updated to allow 6 hour breaks and to pass in a percentage if rest is interrupted
void SetNextRestTime(object oPC, int iSettings, float fPercentage = 1.0)
{
if (fPercentage > 1.0 || fPercentage <= 0.0) {
fPercentage = 1.0;
}
int iHours = (iSettings & 0x00000f00);
int iTime = GetTimeHour() + GetCalendarDay() * 24 + GetCalendarMonth() * 24 * 28 + GetCalendarYear() * 24 * 28 * 12;
switch(iHours)
{
default:
case 0x00000100: SetLocalInt(oPC, "dmfi_r_nextrest", iTime + FloatToInt(IntToFloat(1) * fPercentage)); break;
case 0x00000200: SetLocalInt(oPC, "dmfi_r_nextrest", iTime + FloatToInt(IntToFloat(2) * fPercentage)); break;
case 0x00000300: SetLocalInt(oPC, "dmfi_r_nextrest", iTime + FloatToInt(IntToFloat(4) * fPercentage)); break;
case 0x00000400: SetLocalInt(oPC, "dmfi_r_nextrest", iTime + FloatToInt(IntToFloat(6) * fPercentage)); break;
case 0x00000500: SetLocalInt(oPC, "dmfi_r_nextrest", iTime + FloatToInt(IntToFloat(8) * fPercentage)); break;
case 0x00000600: SetLocalInt(oPC, "dmfi_r_nextrest", iTime + FloatToInt(IntToFloat(12) * fPercentage)); break;
case 0x00000700: SetLocalInt(oPC, "dmfi_r_nextrest", iTime + FloatToInt(IntToFloat(24) * fPercentage)); break;
}
}
//This function determines whether or not you can rest.
int DMFI_CanIRest(object oPC, int iSettings)
{
if (GetIsDM(oPC)) return TRUE;
if (iSettings & 0x00000002) //No Rest Override
{
if (iSettings & 0x00000080)
FloatyText("This is a No Rest area", oPC, iSettings);
return FALSE;
}
if (!(iSettings & 0x00000001)) //Unlimited Rest Override
{
if (iSettings & 0x00000080)
FloatyText("This is an Unlimited Rest area", oPC, iSettings);
return TRUE;
}
if ((iSettings & 0x00000004) && (iSettings & 0x00000001)) //Time restriction
{
int iTime = GetTimeHour() + GetCalendarDay() * 24 + GetCalendarMonth() * 24 * 28 + GetCalendarYear() * 24 * 28 * 12;
if (iTime < GetLocalInt(oPC, "dmfi_r_nextrest"))
{
FloatyText("You cannot rest at this time. You may rest again in " + IntToString(GetLocalInt(oPC, "dmfi_r_nextrest") - iTime) + " hours.", oPC, iSettings);
return FALSE;
}
}
if ((iSettings & 0x00000008) && (iSettings & 0x00000001)) //Placeable restriction
{
if (!GetIsNearRestingObject(oPC, iSettings))
{
FloatyText("You are not near a rest placeable", oPC, iSettings);
return FALSE;
}
}
if ((iSettings & 0x00000010) && (iSettings & 0x00000001)) //Armor restriction
{
if (GetIsWearingHeavyArmor(oPC, iSettings))
{
FloatyText("Your current armor is too heavy to rest", oPC, iSettings);
return FALSE;
}
}
return TRUE;
}
void main()
{
object oPC = GetLastPCRested();
object oArea = GetArea(oPC);
int iSettings;
int iModSettings = GetDMFIPersistentInt("dmfi", "dmfi_r_");
int iAreaSettings = GetDMFIPersistentInt("dmfi", "dmfi_r_" + GetTag(oArea));
if (iAreaSettings & 0x00000080)
{
iSettings = iAreaSettings;
}
else
{
iSettings = iModSettings;
}
SetLocalInt(oPC, "dmfi_r_settings", iSettings);
if (GetLastRestEventType()==REST_EVENTTYPE_REST_STARTED)
{
SetLocalInt(oPC, "dmfi_norest", !(DMFI_CanIRest(oPC, iSettings)));
SetLocalInt(oPC, "dmfi_r_hitpoints", GetCurrentHitPoints(oPC));
if (GetIsDM(oPC) || (!(iSettings & 0x10000000) && !GetLocalInt(oPC, "dmfi_r_bypass")))
{ //If the Rest Conversation variable is set, then activate the rest conversation here.
AssignCommand(oPC, ClearAllActions());
SetLocalString(oPC, "dmfi_univ_conv", "rest");
AssignCommand(oPC, ActionStartConversation(oPC, "dmfi_universal", TRUE));
return;
}
if (GetLocalInt(oPC, "dmfi_norest")) //PC cannot rest
{
AssignCommand(oPC, ClearAllActions());
DeleteLocalInt(oPC, "dmfi_r_bypass");
return;
}
if ((iSettings & 0x00000004) && (iSettings & 0x00000001)) //Time restriction
SetNextRestTime(oPC, iSettings);
if (GetLocalInt(oPC, "dmfi_r_alternate") || ((iSettings & 0x00000040) && (iSettings & 0x00000001)))
{
AssignCommand(oPC, ClearAllActions());
if ((iSettings & 0x00000040) && (iSettings & 0x00000001))
FloatyText("You cannot regain your spells in this area",oPC, iSettings);
DoPseudoRest(oPC, iSettings, ((iSettings & 0x00000040) && (iSettings & 0x00000001)));
DeleteLocalInt(oPC, "dmfi_r_bypass");
return;
}
else if (!(iSettings & 0x20000000))
{ //Rest VFX
ApplyRestVFX(oPC, iSettings);
}
if ((iSettings & 0x00000020) && (iSettings & 0x00000001))
{ //Auto Party Drop
FloatyText("You have been removed from the party to prevent rest canceling",oPC, iSettings);
RemoveFromParty(oPC);
}
}
else if (GetLastRestEventType()==REST_EVENTTYPE_REST_CANCELLED)
{
// Make sure that resting has been initialized and the start time has been set. Otherwise, the Cancelled Rest Event was fired by
// the Resting conversation.
if (GetLocalInt(oPC, "dmfi_r_init"))
{
int iTime = GetTimeSecond() + GetTimeMinute() * 60 + GetTimeHour() * 3600 + GetCalendarDay() * 24 * 3600 + GetCalendarMonth() *3600 * 24 * 28 + GetCalendarYear() * 24 * 28 * 12 * 3600;
int nTimeRested = iTime - GetLocalInt(oPC, "dmfi_r_startseconds");
int nFullTime = FloatToInt(GetRestDuration(oPC));
float fPercentage = IntToFloat(nTimeRested) / IntToFloat(nFullTime);
SetNextRestTime(oPC, iSettings, fPercentage);
// SendMessageToPC(oPC, "Rest interrupted; resting for " + IntToString(nTimeRested) + " out of " + IntToString(nFullTime) + " seconds (" + FloatToString(fPercentage) + "%).");
SetLocalInt(oPC, "dmfi_r_init", FALSE);
if ((iSettings & 0x00000020) && GetCurrentHitPoints(oPC) > GetLocalInt(oPC, "dmfi_r_hitpoints") && iSettings & 0x00000001) //HP restriction
{
effect eDam = EffectDamage(GetMaxHitPoints(oPC) - GetLocalInt(oPC, "dmfi_r_hitpoints"));
FloatyText("Your hitpoints have been reset",oPC, iSettings);
AssignCommand(oPC, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oPC));
}
}
RemoveRestVFX(oPC);
}
else if (GetLastRestEventType()==REST_EVENTTYPE_REST_FINISHED)
{
if ((iSettings & 0x00000020) && (iSettings & 0x00000001)) //HP restriction
{
int iDam = GetMaxHitPoints(oPC) - GetLocalInt(oPC, "dmfi_r_hitpoints") - CalculateFinalHitPoints(oPC, iSettings);
if (iDam > 0)
{
effect eDam = EffectDamage(iDam);
FloatyText("You gain back limited HP from this rest",oPC, iSettings);
AssignCommand(oPC, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oPC));
}
}
}
DeleteLocalInt(oPC, "dmfi_r_bypass");
}

View File

@@ -1,117 +0,0 @@
//::///////////////////////////////////////////////
//:: DMFI - internal player chat listener hooking include
//:: dmfi_plchlishk_i
//:://////////////////////////////////////////////
/*
Include file containing routines for managing the internal DMFI chain of
"listeners", which are now implemented as OnPlayerChat event handlers rather
than creatures.
*/
//:://////////////////////////////////////////////
//:: Created By: tsunami282
//:: Created On: 2008.03.24
//:://////////////////////////////////////////////
const int DMFI_LISTEN_ON_CHANNEL_TALK = 1;
const int DMFI_LISTEN_ON_CHANNEL_WHISPER = 1;
const int DMFI_LISTEN_ON_CHANNEL_SHOUT = 1;
const int DMFI_LISTEN_ON_CHANNEL_DM = 1;
const int DMFI_LISTEN_ON_CHANNEL_PARTY = 1;
const string DMFI_EAVESDROP_HOOK_VARNAME = "dmfi_Eavesdrop";
const float WHISPER_DISTANCE = 1.0;
const float TALK_DISTANCE = 30.0;
string sHookTypeVarname = DMFI_EAVESDROP_HOOK_VARNAME + "_Type"; // 1=PC (says), 2=NPC/location (hears)
string sHookCreatureVarname = DMFI_EAVESDROP_HOOK_VARNAME + "_Creature"; // must be valid for type 1, for type 2 object_invalid means location only
string sHookRangeModeVarname = DMFI_EAVESDROP_HOOK_VARNAME + "_RangeMode"; // listening range: for type 1, 0=pc only, 1=pc's party; for type 2, 0=earshot, 1=area, 2=module
string sHookLocationVarname = DMFI_EAVESDROP_HOOK_VARNAME + "_Location"; // for type 2, location of "listening post"
string sHookChannelsVarname = DMFI_EAVESDROP_HOOK_VARNAME + "_Channels"; // bitmask of TALKVOLUME channels to listen to
string sHookOwnerVarname = DMFI_EAVESDROP_HOOK_VARNAME + "_Owner"; // unique ID of owner of this hook (he who will get the captured text)
string sHookBcastDMsVarname = DMFI_EAVESDROP_HOOK_VARNAME + "_BcastDMs"; // 0=relay message to owner only, 1=broadcast to all DMs
////////////////////////////////////////////////////////////////////////
void RemoveListenerHook(int hooknum)
{
int hooktype;
object hookcreature;
location hooklocation;
int hookchannels;
object hookowner;
int hookparty, hookbcast;
int iHook = hooknum;
string siHook = "", siHookN = "";
object oMod = GetModule();
while (1)
{
siHook = IntToString(iHook);
siHookN = IntToString(iHook+1);
hooktype = GetLocalInt(oMod, sHookTypeVarname+siHookN);
if (hooktype != 0)
{
hookcreature = GetLocalObject(oMod, sHookCreatureVarname+siHookN);
hooklocation = GetLocalLocation(oMod, sHookLocationVarname+siHookN);
hookchannels = GetLocalInt(oMod, sHookChannelsVarname+siHookN);
hookowner = GetLocalObject(oMod, sHookOwnerVarname+siHookN);
hookparty = GetLocalInt(oMod, sHookRangeModeVarname+siHookN);
hookbcast = GetLocalInt(oMod, sHookBcastDMsVarname+siHookN);
SetLocalInt(oMod, sHookTypeVarname+siHook, hooktype);
SetLocalObject(oMod, sHookCreatureVarname+siHook, hookcreature);
SetLocalLocation(oMod, sHookLocationVarname+siHook, hooklocation);
SetLocalInt(oMod, sHookChannelsVarname+siHook, hookchannels);
SetLocalObject(oMod, sHookOwnerVarname+siHook, hookowner);
SetLocalInt(oMod, sHookRangeModeVarname+siHook, hookparty);
SetLocalInt(oMod, sHookBcastDMsVarname+siHook, hookbcast);
}
else
{
DeleteLocalInt(oMod, sHookTypeVarname+siHook);
DeleteLocalObject(oMod, sHookCreatureVarname+siHook);
DeleteLocalLocation(oMod, sHookLocationVarname+siHook);
DeleteLocalInt(oMod, sHookChannelsVarname+siHook);
DeleteLocalObject(oMod, sHookOwnerVarname+siHook);
DeleteLocalInt(oMod, sHookRangeModeVarname+siHook);
DeleteLocalInt(oMod, sHookBcastDMsVarname+siHook);
break;
}
iHook++;
}
}
////////////////////////////////////////////////////////////////////////
int AppendListenerHook(int hooktype, object hookcreature, location hooklocation,
int hookchannels, int hookparty, int hookbcast, object hookowner)
{
int iHook = 0;
if (hooktype != 0)
{
int iHookType;
string siHook = "";
object oMod = GetModule();
iHook = 1;
while (1)
{
siHook = IntToString(iHook);
iHookType = GetLocalInt(oMod, sHookTypeVarname+siHook);
if (iHookType == 0) break; // end of list
iHook++;
}
SetLocalInt(oMod, sHookTypeVarname+siHook, hooktype);
SetLocalObject(oMod, sHookCreatureVarname+siHook, hookcreature);
SetLocalLocation(oMod, sHookLocationVarname+siHook, hooklocation);
SetLocalInt(oMod, sHookChannelsVarname+siHook, hookchannels);
SetLocalObject(oMod, sHookOwnerVarname+siHook, hookowner);
SetLocalInt(oMod, sHookRangeModeVarname+siHook, hookparty);
SetLocalInt(oMod, sHookBcastDMsVarname+siHook, hookbcast);
}
return iHook;
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,142 +0,0 @@
// DMFI OnPlayerChat routines :: event hooking functions
//
// history
// 2008.03.23 tsunami282 - created.
//
#include "dmfi_arrays_inc"
const string DMFI_CHATHOOK_HANDLE_ARRAYNAME = "DMFI_CHATHOOK_HANDLE";
const string DMFI_CHATHOOK_SCRIPT_ARRAYNAME = "DMFI_CHATHOOK_SCRIPT";
const string DMFI_CHATHOOK_RUNNER_ARRAYNAME = "DMFI_CHATHOOK_RUNNER";
const string DMFI_CHATHOOK_CHANNELS_ARRAYNAME = "DMFI_CHATHOOK_CHANNELS";
const string DMFI_CHATHOOK_LISTENALL_ARRAYNAME = "DMFI_CHATHOOK_LISTENALL";
const string DMFI_CHATHOOK_SPEAKER_ARRAYNAME = "DMFI_CHATHOOK_SPEAKER";
const string DMFI_CHATHOOK_AUTOREMOVE_ARRAYNAME = "DMFI_CHATHOOK_AUTOREMOVE";
const string DMFI_CHATHOOK_PREVHANDLE_VARNAME = "DMFI_CHATHOOK_PREVHANDLE";
int DMFI_CHANNELMASK_TALK = (1 << TALKVOLUME_TALK);
int DMFI_CHANNELMASK_WHISPER = (1 << TALKVOLUME_WHISPER);
int DMFI_CHANNELMASK_SHOUT = (1 << TALKVOLUME_SHOUT);
// * this channel not hookable ** int DMFI_CHANNELMASK_SILENT_TALK = (1 << TALKVOLUME_SILENT_TALK);
int DMFI_CHANNELMASK_DM = (1 << TALKVOLUME_SILENT_SHOUT);
int DMFI_CHANNELMASK_PARTY = (1 << TALKVOLUME_PARTY);
// * this channel not hookable ** int DMFI_CHANNELMASK_TELL = (1 << TALKVOLUME_TELL);
////////////////////////////////////////////////////////////////////////
void dmfi__init_chathook_data()
{
object oMod = GetModule();
if (!GetLocalArrayInitialized(oMod, DMFI_CHATHOOK_HANDLE_ARRAYNAME))
{
InitializeLocalArray(oMod, DMFI_CHATHOOK_HANDLE_ARRAYNAME);
SetLocalArrayLowerBound(oMod, DMFI_CHATHOOK_HANDLE_ARRAYNAME, 1);
SetLocalArrayUpperBound(oMod, DMFI_CHATHOOK_HANDLE_ARRAYNAME, 0);
InitializeLocalArray(oMod, DMFI_CHATHOOK_SCRIPT_ARRAYNAME);
SetLocalArrayLowerBound(oMod, DMFI_CHATHOOK_SCRIPT_ARRAYNAME, 1);
SetLocalArrayUpperBound(oMod, DMFI_CHATHOOK_SCRIPT_ARRAYNAME, 0);
InitializeLocalArray(oMod, DMFI_CHATHOOK_RUNNER_ARRAYNAME);
SetLocalArrayLowerBound(oMod, DMFI_CHATHOOK_RUNNER_ARRAYNAME, 1);
SetLocalArrayUpperBound(oMod, DMFI_CHATHOOK_RUNNER_ARRAYNAME, 0);
InitializeLocalArray(oMod, DMFI_CHATHOOK_CHANNELS_ARRAYNAME);
SetLocalArrayLowerBound(oMod, DMFI_CHATHOOK_CHANNELS_ARRAYNAME, 1);
SetLocalArrayUpperBound(oMod, DMFI_CHATHOOK_CHANNELS_ARRAYNAME, 0);
InitializeLocalArray(oMod, DMFI_CHATHOOK_LISTENALL_ARRAYNAME);
SetLocalArrayLowerBound(oMod, DMFI_CHATHOOK_LISTENALL_ARRAYNAME, 1);
SetLocalArrayUpperBound(oMod, DMFI_CHATHOOK_LISTENALL_ARRAYNAME, 0);
InitializeLocalArray(oMod, DMFI_CHATHOOK_SPEAKER_ARRAYNAME);
SetLocalArrayLowerBound(oMod, DMFI_CHATHOOK_SPEAKER_ARRAYNAME, 1);
SetLocalArrayUpperBound(oMod, DMFI_CHATHOOK_SPEAKER_ARRAYNAME, 0);
InitializeLocalArray(oMod, DMFI_CHATHOOK_AUTOREMOVE_ARRAYNAME);
SetLocalArrayLowerBound(oMod, DMFI_CHATHOOK_AUTOREMOVE_ARRAYNAME, 1);
SetLocalArrayUpperBound(oMod, DMFI_CHATHOOK_AUTOREMOVE_ARRAYNAME, 0);
}
}
////////////////////////////////////////////////////////////////////////
//! Adds a callback function to the OnPlayerChat list.
//!
//! \param sChatHandlerScript name of script to invoke on receiving input
//! \param oScriptRunner object to execute the sChatHandlerScript on
//! \param maskChannels mask of channels to listen on (defaults to all channels)
//! \param bListenAll TRUE to listen to all PC speakers everywhere
//! \param oSpeaker if bListenAll is FALSE, creature to listen to (others will be ignored)
//! \param bAutoRemove - automatically unhook this chathook after first use
//! \return hook handle (needed to remove the hook later); 0 means failed to add the hook
int DMFI_ChatHookAdd(string sChatHandlerScript, object oScriptRunner = OBJECT_SELF,
int maskChannels = -1, int bListenAll = TRUE, object oSpeaker = OBJECT_INVALID,
int bAutoRemove = FALSE)
{
dmfi__init_chathook_data();
object oMod = GetModule();
int iHook = GetLocalArrayUpperBound(oMod, DMFI_CHATHOOK_HANDLE_ARRAYNAME);
iHook++;
int hdlHook = GetLocalInt(oMod, DMFI_CHATHOOK_PREVHANDLE_VARNAME);
hdlHook++;
if (hdlHook < 1) hdlHook = 1; // reserving 0 and negatives
// SendMessageToPC(GetFirstPC(), "chathookadd - adding hook #" + IntToString(iHook));
SetLocalInt(oMod, DMFI_CHATHOOK_PREVHANDLE_VARNAME, hdlHook);
SetLocalArrayInt(oMod, DMFI_CHATHOOK_HANDLE_ARRAYNAME, iHook, hdlHook);
SetLocalArrayString(oMod, DMFI_CHATHOOK_SCRIPT_ARRAYNAME, iHook, sChatHandlerScript);
SetLocalArrayObject(oMod, DMFI_CHATHOOK_RUNNER_ARRAYNAME, iHook, oScriptRunner);
SetLocalArrayInt(oMod, DMFI_CHATHOOK_CHANNELS_ARRAYNAME, iHook, maskChannels);
SetLocalArrayInt(oMod, DMFI_CHATHOOK_LISTENALL_ARRAYNAME, iHook, bListenAll);
SetLocalArrayObject(oMod, DMFI_CHATHOOK_SPEAKER_ARRAYNAME, iHook, oSpeaker);
SetLocalArrayInt(oMod, DMFI_CHATHOOK_AUTOREMOVE_ARRAYNAME, iHook, bAutoRemove);
return hdlHook;
}
////////////////////////////////////////////////////////////////////////
//! removes a callback function from the OnPlayerChat list.
//! \param hdlHookIn handle of hook to remove (0 for clean up orphans)
//! \return TRUE if requested hook found and removed
int DMFI_ChatHookRemove(int hdlHookIn)
{
int bRemoved = FALSE;
int hdlHook;
int iHook, iHook2;
object oMod = GetModule();
int nHooks = GetLocalArrayUpperBound(oMod, DMFI_CHATHOOK_HANDLE_ARRAYNAME);
for (iHook = 1; iHook <= nHooks; iHook++)
{
while (1)
{
hdlHook = GetLocalArrayInt(oMod, DMFI_CHATHOOK_HANDLE_ARRAYNAME, iHook);
if (hdlHook != 0 && hdlHook != hdlHookIn) break;
// kill this one
for (iHook2 = iHook; iHook2 < nHooks; iHook2++)
{
SetLocalArrayInt(oMod, DMFI_CHATHOOK_HANDLE_ARRAYNAME, iHook2, GetLocalArrayInt(oMod, DMFI_CHATHOOK_HANDLE_ARRAYNAME, iHook2+1));
SetLocalArrayString(oMod, DMFI_CHATHOOK_SCRIPT_ARRAYNAME, iHook2, GetLocalArrayString(oMod, DMFI_CHATHOOK_SCRIPT_ARRAYNAME, iHook2+1));
SetLocalArrayObject(oMod, DMFI_CHATHOOK_RUNNER_ARRAYNAME, iHook2, GetLocalArrayObject(oMod, DMFI_CHATHOOK_RUNNER_ARRAYNAME, iHook2+1));
SetLocalArrayInt(oMod, DMFI_CHATHOOK_CHANNELS_ARRAYNAME, iHook2, GetLocalArrayInt(oMod, DMFI_CHATHOOK_CHANNELS_ARRAYNAME, iHook2+1));
SetLocalArrayInt(oMod, DMFI_CHATHOOK_LISTENALL_ARRAYNAME, iHook2, GetLocalArrayInt(oMod, DMFI_CHATHOOK_LISTENALL_ARRAYNAME, iHook2+1));
SetLocalArrayObject(oMod, DMFI_CHATHOOK_SPEAKER_ARRAYNAME, iHook2, GetLocalArrayObject(oMod, DMFI_CHATHOOK_SPEAKER_ARRAYNAME, iHook2+1));
SetLocalArrayInt(oMod, DMFI_CHATHOOK_AUTOREMOVE_ARRAYNAME, iHook2, GetLocalArrayInt(oMod, DMFI_CHATHOOK_AUTOREMOVE_ARRAYNAME, iHook2+1));
}
bRemoved = TRUE;
nHooks--;
if (nHooks < iHook) break;
}
}
if (bRemoved)
{
SetLocalArrayUpperBound(oMod, DMFI_CHATHOOK_HANDLE_ARRAYNAME, nHooks);
SetLocalArrayUpperBound(oMod, DMFI_CHATHOOK_SCRIPT_ARRAYNAME, nHooks);
SetLocalArrayUpperBound(oMod, DMFI_CHATHOOK_RUNNER_ARRAYNAME, nHooks);
SetLocalArrayUpperBound(oMod, DMFI_CHATHOOK_CHANNELS_ARRAYNAME, nHooks);
SetLocalArrayUpperBound(oMod, DMFI_CHATHOOK_LISTENALL_ARRAYNAME, nHooks);
SetLocalArrayUpperBound(oMod, DMFI_CHATHOOK_SPEAKER_ARRAYNAME, nHooks);
SetLocalArrayUpperBound(oMod, DMFI_CHATHOOK_AUTOREMOVE_ARRAYNAME, nHooks);
}
return bRemoved;
}

View File

@@ -1,71 +0,0 @@
//::///////////////////////////////////////////////
//:: DMFI - string functions and constants
//:: dmfi_string_inc
//:://////////////////////////////////////////////
/*
Library of functions relating to strings for DMFI.
*/
//:://////////////////////////////////////////////
//:: Created By: tsunami282
//:: Created On: 2008.08.11
//:://////////////////////////////////////////////
#include "x3_inc_string"
const string DMFI_MESSAGE_COLOR_ALERT = "733"; // default 733 - brite red
const string DMFI_MESSAGE_COLOR_STATUS = "773"; // default 773 - yellow
const string DMFI_MESSAGE_COLOR_EAVESDROP = "777"; // default 777 - white
const string DMFI_MESSAGE_COLOR_TRANSLATION = "555"; // default 733 - lite gray
const string DMFI_MESSAGE_COLOR_OTHER = ""; // default blank
////////////////////////////////////////////////////////////////////////
string LTrim(string sTrimMe, string sDelim = " ")
{
int l;
if (sDelim != "")
{
l = GetStringLength(sTrimMe);
while (GetStringLeft(sTrimMe, 1) == sDelim)
{
l--;
if (l < 1)
{
sTrimMe = "";
break;
}
sTrimMe = GetStringRight(sTrimMe, l);
}
}
return sTrimMe;
}
////////////////////////////////////////////////////////////////////////
void DMFISendMessageToPC(object oPC, string sMsg, int bAllDMs=FALSE,
string sRGB="")
{
string sColMsg;
object oTarget = oPC;
if (bAllDMs) oTarget = GetFirstPC();
while (GetIsObjectValid(oTarget))
{
if ((!bAllDMs) || (GetIsDM(oTarget) || GetIsDMPossessed(oTarget)))
{
if (sRGB != "")
{
sColMsg = StringToRGBString(sMsg, sRGB);
}
else
{
sColMsg = sMsg;
}
SendMessageToPC(oTarget, sColMsg);
}
if (!bAllDMs) break;
oTarget = GetNextPC();
}
}

View File

@@ -1,12 +0,0 @@
#include "dmfi_getln_inc"
void main()
{
object oListener = OBJECT_SELF;
object oPC = GetPCSpeaker();
// attach our listener event
SetLocalString(oListener, "dmfi_getln_mode", "name");
DMFI_get_line(oPC, TALKVOLUME_TALK, "dmfi_univ_listen", oListener);
}

View File

@@ -1,6 +0,0 @@
void main()
{
object oPC = GetPCSpeaker();
object oTarget = GetLocalObject(oPC, "dmfi_univ_target");
SetName(oTarget, "");
}

View File

@@ -1,8 +0,0 @@
#include "dmfi_getln_inc"
void main()
{
object oListener = OBJECT_SELF;
DMFI_cancel_get_line(0, oListener);
}

View File

@@ -1,12 +0,0 @@
#include "dmfi_getln_inc"
void main()
{
object oListener = OBJECT_SELF;
object oPC = GetPCSpeaker();
// attach our listener event
SetLocalString(oListener, "dmfi_getln_mode", "desc");
DMFI_get_line(oPC, TALKVOLUME_TALK, "dmfi_univ_listen", oListener);
}

View File

@@ -1,6 +0,0 @@
void main()
{
object oPC = GetPCSpeaker();
object oTarget = GetLocalObject(oPC, "dmfi_univ_target");
SetName(oTarget, "");
}

View File

@@ -1,8 +0,0 @@
#include "dmfi_getln_inc"
void main()
{
object oListener = OBJECT_SELF;
DMFI_cancel_get_line(0, oListener);
}

View File

@@ -1,13 +0,0 @@
int StartingConditional()
{
// set the custom tokens
object oPC = GetPCSpeaker();
object oTarget = GetLocalObject(oPC, "dmfi_univ_target");
string sName = GetName(oTarget);
SetCustomToken(20680, sName);
string sOrigName = GetName(oTarget, TRUE);
SetCustomToken(20681, sOrigName);
return TRUE;
}

View File

@@ -1,13 +0,0 @@
int StartingConditional()
{
// set the custom tokens
object oPC = GetPCSpeaker();
object oTarget = GetLocalObject(oPC, "dmfi_univ_target");
string sName = GetDescription(oTarget);
SetCustomToken(20682, sName);
string sOrigName = GetDescription(oTarget, TRUE);
SetCustomToken(20683, sOrigName);
return TRUE;
}

View File

@@ -1,115 +0,0 @@
// dmfi_univ_listen
// template: dmfi_getln_cbtpl
// triggered from OnPlayerChat callback
#include "dmfi_db_inc"
void main()
{
int nVolume = GetPCChatVolume();
object oShouter = GetPCChatSpeaker();
string sSaid = GetPCChatMessage();
// SendMessageToPC(GetFirstPC(), "ENTER dmfi_univ_listen: speaker=" + GetName(oShouter) + ", channel=" + IntToString(nVolume) + ", said=" + sSaid);
// first, lets deal with a getln event
string getln_mode = GetLocalString(OBJECT_SELF, "dmfi_getln_mode");
if (getln_mode == "name")
{
if (sSaid != ".")
{
object oTarget = GetLocalObject(oShouter, "dmfi_univ_target");
SetName(oTarget, sSaid);
}
DeleteLocalString(OBJECT_SELF, "dmfi_getln_mode");
}
else if (getln_mode == "desc")
{
if (sSaid != ".")
{
object oTarget = GetLocalObject(oShouter, "dmfi_univ_target");
SetDescription(oTarget, sSaid);
}
DeleteLocalString(OBJECT_SELF, "dmfi_getln_mode");
}
else
{
// you may wish to define an "abort" input message, such as a line
// containing a single period:
if (sSaid != ".")
{
// put your code here to process the input line (in sSaid)
if (GetIsDM(oShouter)) SetLocalInt(GetModule(), "dmfi_Admin" + GetPCPublicCDKey(oShouter), 1);
if (GetIsDMPossessed(oShouter)) SetLocalObject(GetMaster(oShouter), "dmfi_familiar", oShouter);
object oTarget = GetLocalObject(oShouter, "dmfi_VoiceTarget");
object oMaster = OBJECT_INVALID;
if (GetIsObjectValid(oTarget)) oMaster = oShouter;
int iPhrase = GetLocalInt(oShouter, "hls_EditPhrase");
object oSummon;
if (GetIsObjectValid(oShouter) && GetIsDM(oShouter))
{
if (GetTag(OBJECT_SELF) == "dmfi_setting" && GetLocalString(oShouter, "EffectSetting") != "")
{
string sPhrase = GetLocalString(oShouter, "EffectSetting");
SetLocalFloat(oShouter, sPhrase, StringToFloat(sSaid));
SetDMFIPersistentFloat("dmfi", sPhrase, StringToFloat(sSaid), oShouter);
DeleteLocalString(oShouter, "EffectSetting");
DelayCommand(0.5, ActionSpeakString("The setting " + sPhrase + " has been changed to " + FloatToString(GetLocalFloat(oShouter, sPhrase))));
DelayCommand(1.5, DestroyObject(OBJECT_SELF));
}
}
if (GetIsObjectValid(oShouter) && GetIsPC(oShouter))
{
if (sSaid != GetLocalString(GetModule(), "hls_voicebuffer"))
{
SetLocalString(GetModule(), "hls_voicebuffer", sSaid);
// PrintString("<Conv>"+GetName(GetArea(oShouter))+ " " + GetName(oShouter) + ": " + sSaid + " </Conv>");
// if the phrase begins with .MyName, reparse the string as a voice throw
if (GetStringLeft(sSaid, GetStringLength("." + GetName(OBJECT_SELF))) == "." + GetName(OBJECT_SELF) &&
(GetLocalInt(GetModule(), "dmfi_Admin" + GetPCPublicCDKey(oShouter)) ||
GetIsDM(oShouter) || GetIsDMPossessed(oShouter)))
{
oTarget = OBJECT_SELF;
sSaid = GetStringRight(sSaid, GetStringLength(sSaid) - GetStringLength("." + GetName(OBJECT_SELF)));
if (GetStringLeft(sSaid, 1) == " ") sSaid = GetStringRight(sSaid, GetStringLength(sSaid) - 1);
sSaid = ":" + sSaid;
SetPCChatMessage(sSaid);
// SendMessageToPC(GetFirstPC(), "LEAVE(1) dmfi_univ_listen: speaker=" + GetName(oShouter) + ", channel=" + IntToString(nVolume) + ", said=" + sSaid);
return; // must bail out here to prevent clearing of message at end
}
if (iPhrase)
{
if (iPhrase > 0)
{
SetCustomToken(iPhrase, sSaid);
SetDMFIPersistentString("dmfi", "hls" + IntToString(iPhrase), sSaid);
FloatingTextStringOnCreature("Phrase " + IntToString(iPhrase) + " has been recorded", oShouter, FALSE);
}
else if (iPhrase < 0)
{
}
DeleteLocalInt(oShouter, "hls_EditPhrase");
}
}
}
}
}
// after processing, you will likely want to "eat" the text line, so it is
// not spoken or available for further processing
SetPCChatMessage("");
// SendMessageToPC(GetFirstPC(), "LEAVE(2) dmfi_univ_listen: speaker=" + GetName(oShouter) + ", channel=" + IntToString(nVolume) + ", said=" + sSaid);
}

Some files were not shown because too many files have changed in this diff Show More