Added Skullkeep Mystic Forge / Combine system
Added Skullkeep Mystic Forge / Combine system., modified to use a single forge and combine for all item types. Added new Magesmith shop & NPC in Town of Ascension. Full compile. Updated release archive.
This commit is contained in:
40
_module/nss/arcane_recycler.nss
Normal file
40
_module/nss/arcane_recycler.nss
Normal file
@@ -0,0 +1,40 @@
|
||||
// Trash can script that only destroys items placed in the inventory
|
||||
// for more than HOURS_TO_DESTROY in-game hours.
|
||||
|
||||
const string VAR_ITEM_TIMESTAMP = "TRASH_VINTAGE"; // Variable to store the time an item was placed
|
||||
const int HOURS_TO_DESTROY = 12; // Hours an item must remain in the container
|
||||
|
||||
int GetCurrentGameTimeInSeconds()
|
||||
{
|
||||
// Get the current game time in hours, minutes, and seconds
|
||||
int nHours = GetTimeHour();
|
||||
int nMinutes = GetTimeMinute();
|
||||
int nSeconds = GetTimeSecond();
|
||||
|
||||
// Convert to total seconds for easy comparison
|
||||
return (nHours * 3600) + (nMinutes * 60) + nSeconds;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
object oItem = GetFirstItemInInventory(OBJECT_SELF);
|
||||
int nCurrentTime = GetCurrentGameTimeInSeconds(); // Current in-game time in seconds
|
||||
int nTimeThreshold = FloatToInt(HoursToSeconds(HOURS_TO_DESTROY)); // Convert hours to seconds for comparison
|
||||
|
||||
while (GetIsObjectValid(oItem))
|
||||
{
|
||||
int nItemTime = GetLocalInt(oItem, VAR_ITEM_TIMESTAMP);
|
||||
|
||||
// If the item has no timestamp, assign the current time
|
||||
if (nItemTime == 0)
|
||||
{
|
||||
SetLocalInt(oItem, VAR_ITEM_TIMESTAMP, nCurrentTime);
|
||||
}
|
||||
else if (nCurrentTime - nItemTime >= nTimeThreshold) // Check if item has been in container for required hours
|
||||
{
|
||||
DestroyObject(oItem);
|
||||
}
|
||||
|
||||
oItem = GetNextItemInInventory(OBJECT_SELF);
|
||||
}
|
||||
}
|
19
_module/nss/chk_prop_eight.nss
Normal file
19
_module/nss/chk_prop_eight.nss
Normal file
@@ -0,0 +1,19 @@
|
||||
#include "prc_x2_itemprop"
|
||||
|
||||
int StartingConditional()
|
||||
{
|
||||
object oForge = GetNearestObjectByTag("forge_custom",OBJECT_SELF,1);
|
||||
object oItem = GetFirstItemInInventory(oForge);
|
||||
int nCount = IPGetNumberOfItemProperties(oItem);
|
||||
int nProps;
|
||||
|
||||
if (nCount > 7)
|
||||
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
|
||||
|
||||
}
|
14
_module/nss/forge_chkpockets.nss
Normal file
14
_module/nss/forge_chkpockets.nss
Normal file
@@ -0,0 +1,14 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: FileName forge_chkpockets
|
||||
//:://////////////////////////////////////////////
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Script Wizard
|
||||
//:: Created On: 2/19/2006 1:12:53 AM
|
||||
//:://////////////////////////////////////////////
|
||||
int StartingConditional()
|
||||
{
|
||||
if((GetLocalInt(OBJECT_SELF, "ItemCost")) <= GetGold(GetPCSpeaker()))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
15
_module/nss/forge_combinechk.nss
Normal file
15
_module/nss/forge_combinechk.nss
Normal file
@@ -0,0 +1,15 @@
|
||||
/////::///////////////////////////////////////////////
|
||||
/////:: forge_combinecheck script - check to make sure items in combine are correct
|
||||
/////:: Written by Winterknight on 2/17/06
|
||||
/////:://////////////////////////////////////////////
|
||||
#include "nw_i0_tool"
|
||||
|
||||
int StartingConditional()
|
||||
{
|
||||
object oForge = GetNearestObjectByTag("forge_combine",OBJECT_SELF,1);
|
||||
object oItem = GetFirstItemInInventory(oForge);
|
||||
if (!GetIsObjectValid(oItem))
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
177
_module/nss/forge_custtokens.nss
Normal file
177
_module/nss/forge_custtokens.nss
Normal file
@@ -0,0 +1,177 @@
|
||||
/////::///////////////////////////////////////////////
|
||||
/////:: forge_custtokens script - set custom tokens for forge conversation
|
||||
/////:: Written by Winterknight on 2/17/06
|
||||
/////:: This script also is used to set up the basics for the forge.
|
||||
/////:: this script as necessary to change the basic type of forge.
|
||||
/////::
|
||||
/////:: Updated for Path of Ascension / PRC8 by Jaysyn
|
||||
/////:://////////////////////////////////////////////
|
||||
#include "prc_misc_const"
|
||||
|
||||
void main()
|
||||
{
|
||||
object oForge = GetNearestObjectByTag("forge_custom", OBJECT_SELF, 1);
|
||||
object oItem = GetFirstItemInInventory(oForge);
|
||||
|
||||
// Store the forge name for display
|
||||
SetCustomToken(101, GetName(oForge)); // Name of Forge
|
||||
SetLocalString(OBJECT_SELF, "ForgeName", GetName(oForge));
|
||||
|
||||
string sTypes = "Unsupported Item Type"; // Default message
|
||||
int nType = 0;
|
||||
|
||||
// Check the base item type of oItem and assign corresponding sTypes and nType
|
||||
if (oItem != OBJECT_INVALID)
|
||||
{
|
||||
int nBaseItemType = GetBaseItemType(oItem);
|
||||
|
||||
switch (nBaseItemType)
|
||||
{
|
||||
case BASE_ITEM_BOOTS:
|
||||
case BASE_ITEM_BELT:
|
||||
sTypes = "Belts and Boots";
|
||||
nType = 1;
|
||||
break;
|
||||
|
||||
case BASE_ITEM_ARMOR:
|
||||
case BASE_ITEM_BRACER:
|
||||
case BASE_ITEM_HELMET:
|
||||
case BASE_ITEM_LARGESHIELD:
|
||||
case BASE_ITEM_SMALLSHIELD:
|
||||
case BASE_ITEM_TOWERSHIELD:
|
||||
sTypes = "Armor, Helms and Shields";
|
||||
nType = 2;
|
||||
break;
|
||||
|
||||
case BASE_ITEM_BASTARDSWORD:
|
||||
case BASE_ITEM_BATTLEAXE:
|
||||
case BASE_ITEM_CLUB:
|
||||
case BASE_ITEM_DAGGER:
|
||||
case BASE_ITEM_DIREMACE:
|
||||
case BASE_ITEM_DOUBLEAXE:
|
||||
case BASE_ITEM_DOUBLE_SCIMITAR:
|
||||
case BASE_ITEM_DWARVENWARAXE:
|
||||
case BASE_ITEM_EAGLE_CLAW:
|
||||
case BASE_ITEM_ELVEN_COURTBLADE:
|
||||
case BASE_ITEM_ELVEN_LIGHTBLADE:
|
||||
case BASE_ITEM_ELVEN_THINBLADE:
|
||||
case BASE_ITEM_FALCHION:
|
||||
case BASE_ITEM_GLOVES:
|
||||
case BASE_ITEM_GOAD:
|
||||
case BASE_ITEM_GREATAXE:
|
||||
case BASE_ITEM_GREATSWORD:
|
||||
case BASE_ITEM_HALBERD:
|
||||
case BASE_ITEM_HANDAXE:
|
||||
case BASE_ITEM_HEAVYFLAIL:
|
||||
case BASE_ITEM_HEAVY_MACE:
|
||||
case BASE_ITEM_HEAVY_PICK:
|
||||
case BASE_ITEM_KAMA:
|
||||
case BASE_ITEM_KATANA:
|
||||
case BASE_ITEM_KATAR:
|
||||
case BASE_ITEM_KUKRI:
|
||||
case BASE_ITEM_LIGHTFLAIL:
|
||||
case BASE_ITEM_LIGHTHAMMER:
|
||||
case BASE_ITEM_LIGHTMACE:
|
||||
case BASE_ITEM_LIGHT_PICK:
|
||||
case BASE_ITEM_LONGSWORD:
|
||||
case BASE_ITEM_MAUL:
|
||||
case BASE_ITEM_MORNINGSTAR:
|
||||
case BASE_ITEM_NUNCHAKU:
|
||||
case BASE_ITEM_QUARTERSTAFF:
|
||||
case BASE_ITEM_RAPIER:
|
||||
case BASE_ITEM_SAI:
|
||||
case BASE_ITEM_SAP:
|
||||
case BASE_ITEM_SCIMITAR:
|
||||
case BASE_ITEM_SCYTHE:
|
||||
case BASE_ITEM_SHORTSPEAR:
|
||||
case BASE_ITEM_SHORTSWORD:
|
||||
case BASE_ITEM_SICKLE:
|
||||
case BASE_ITEM_SLING:
|
||||
case BASE_ITEM_TRIDENT:
|
||||
case BASE_ITEM_TWOBLADEDSWORD:
|
||||
case BASE_ITEM_WARHAMMER:
|
||||
case BASE_ITEM_WHIP:
|
||||
sTypes = "Melee Weapons and Gloves";
|
||||
nType = 3;
|
||||
break;
|
||||
|
||||
case BASE_ITEM_CLOAK:
|
||||
sTypes = "Cloaks";
|
||||
nType = 4;
|
||||
break;
|
||||
|
||||
case BASE_ITEM_AMULET:
|
||||
case BASE_ITEM_RING:
|
||||
sTypes = "Rings and Amulets";
|
||||
nType = 5;
|
||||
break;
|
||||
|
||||
case BASE_ITEM_SHORTBOW:
|
||||
case BASE_ITEM_HEAVYCROSSBOW:
|
||||
case BASE_ITEM_LIGHTCROSSBOW:
|
||||
case BASE_ITEM_LONGBOW:
|
||||
sTypes = "Bows and Crossbows";
|
||||
nType = 6;
|
||||
break;
|
||||
|
||||
case BASE_ITEM_ARROW:
|
||||
case BASE_ITEM_BOLT:
|
||||
case BASE_ITEM_BULLET:
|
||||
case BASE_ITEM_GRENADE:
|
||||
case BASE_ITEM_DART:
|
||||
case BASE_ITEM_SHURIKEN:
|
||||
case BASE_ITEM_THROWINGAXE:
|
||||
sTypes = "Thrown Weapons and Ammunition";
|
||||
nType = 7;
|
||||
break;
|
||||
|
||||
case BASE_ITEM_MISCLARGE:
|
||||
case BASE_ITEM_MISCMEDIUM:
|
||||
case BASE_ITEM_MISCSMALL:
|
||||
case BASE_ITEM_MISCTALL:
|
||||
case BASE_ITEM_MISCTHIN:
|
||||
case BASE_ITEM_MISCWIDE:
|
||||
case BASE_ITEM_MAGICWAND:
|
||||
case BASE_ITEM_MAGICSTAFF:
|
||||
case BASE_ITEM_MAGICROD:
|
||||
case BASE_ITEM_BOOK:
|
||||
case BASE_ITEM_LARGEBOX:
|
||||
sTypes = "Miscellaneous Items";
|
||||
nType = 8;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Update tokens and local variables based on selected item type
|
||||
SetCustomToken(102, sTypes); // Type of item that will work here.
|
||||
SetLocalInt(OBJECT_SELF, "ItemType", nType);
|
||||
SetLocalInt(OBJECT_SELF, "ItemCost", 0);
|
||||
}
|
||||
|
||||
|
||||
/* void main()
|
||||
{
|
||||
object oForge = GetNearestObjectByTag("forge_custom",OBJECT_SELF,1);
|
||||
object oItem = GetFirstItemInInventory(oForge);
|
||||
|
||||
SetCustomToken(101,GetName(oForge)); // Name of Forge
|
||||
SetLocalString(OBJECT_SELF, "ForgeName", GetName(oForge));
|
||||
|
||||
string sTypes;
|
||||
int nType;
|
||||
string sForgeLeft = GetStringLeft(GetName(oForge),6);
|
||||
|
||||
if (sForgeLeft == "Cobble") {sTypes = "Belts and Boots"; nType = 1;}
|
||||
if (sForgeLeft == "Armour") {sTypes = "Armor, Helms and Shields"; nType = 2;}
|
||||
if (sForgeLeft == "Weapon") {sTypes = "Melee Weapons and Gloves"; nType = 3;}
|
||||
if (sForgeLeft == "Tailor") {sTypes = "Cloaks"; nType = 4;}
|
||||
if (sForgeLeft == "Jewele") {sTypes = "Rings and Amulets"; nType = 5;}
|
||||
if (sForgeLeft == "Bowyer") {sTypes = "Bows and Crossbows"; nType = 6;}
|
||||
if (sForgeLeft == "Fletch") {sTypes = "Thrown Weapons and Ammunition"; nType = 7;}
|
||||
if (sForgeLeft == "Common") {sTypes = "Common Items (not equipped)"; nType = 8;}
|
||||
if (sForgeLeft == "Mystic") {sTypes = "any Magical Items"; nType = 9;}
|
||||
|
||||
SetCustomToken(102,sTypes); // Type of item that will work here.
|
||||
SetLocalInt(OBJECT_SELF, "ItemType", nType);
|
||||
SetLocalInt(OBJECT_SELF, "ItemCost", 0);
|
||||
} */
|
23
_module/nss/forge_fulmcheck.nss
Normal file
23
_module/nss/forge_fulmcheck.nss
Normal file
@@ -0,0 +1,23 @@
|
||||
/////::///////////////////////////////////////////////
|
||||
/////:: forge_guildcheck script - check to make sure not splitting a guild item
|
||||
/////:: Written by Winterknight on 2/17/06
|
||||
/////:://////////////////////////////////////////////
|
||||
#include "nw_i0_tool"
|
||||
|
||||
int StartingConditional()
|
||||
{
|
||||
object oForge = GetNearestObjectByTag("forge_custom",OBJECT_SELF,1);
|
||||
object oItem = GetFirstItemInInventory(oForge);
|
||||
string sCheck = GetTag(oItem);
|
||||
if (sCheck == "fulminate" ||
|
||||
sCheck == "magestaff" ||
|
||||
sCheck == "innerpath" ||
|
||||
sCheck == "harmonics" ||
|
||||
sCheck == "whitegold" ||
|
||||
sCheck == "vesperbel")
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
23
_module/nss/forge_fulmstrip.nss
Normal file
23
_module/nss/forge_fulmstrip.nss
Normal file
@@ -0,0 +1,23 @@
|
||||
/////::///////////////////////////////////////////////
|
||||
/////:: forge_guildcheck script - check to make sure not splitting a guild item
|
||||
/////:: Written by Winterknight on 2/17/06
|
||||
/////:://////////////////////////////////////////////
|
||||
#include "nw_i0_tool"
|
||||
|
||||
int StartingConditional()
|
||||
{
|
||||
object oForge = GetNearestObjectByTag("forge_combine",OBJECT_SELF,1);
|
||||
object oItem = GetFirstItemInInventory(oForge);
|
||||
string sCheck = GetTag(oItem);
|
||||
if (sCheck == "fulminate" ||
|
||||
sCheck == "magestaff" ||
|
||||
sCheck == "innerpath" ||
|
||||
sCheck == "harmonics" ||
|
||||
sCheck == "whitegold" ||
|
||||
sCheck == "vesperbel")
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
26
_module/nss/forge_guildcheck.nss
Normal file
26
_module/nss/forge_guildcheck.nss
Normal file
@@ -0,0 +1,26 @@
|
||||
/////::///////////////////////////////////////////////
|
||||
/////:: forge_guildcheck script - check to make sure not splitting a guild item
|
||||
/////:: Written by Winterknight on 2/17/06
|
||||
/////:://////////////////////////////////////////////
|
||||
#include "nw_i0_tool"
|
||||
|
||||
int StartingConditional()
|
||||
{
|
||||
object oForge = GetNearestObjectByTag("forge_custom",OBJECT_SELF,1);
|
||||
object oItem = GetFirstItemInInventory(oForge);
|
||||
string sCheck = GetStringLeft(GetTag(oItem), 5);
|
||||
if (sCheck == "HELM_" ||
|
||||
sCheck == "ARMR_" ||
|
||||
sCheck == "SHLD_" ||
|
||||
sCheck == "ammy_" ||
|
||||
sCheck == "ring_" ||
|
||||
sCheck == "WEAP_" ||
|
||||
sCheck == "BOOT_" ||
|
||||
sCheck == "BELT_")
|
||||
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
168
_module/nss/forge_hicostcalc.nss
Normal file
168
_module/nss/forge_hicostcalc.nss
Normal file
@@ -0,0 +1,168 @@
|
||||
/////::///////////////////////////////////////////////
|
||||
/////:: forge_costcheck - determine cost of perfect transferance to new item.
|
||||
/////:: Modified by Winterknight on 2/18/06
|
||||
/////:: Original scripts by Asbury
|
||||
/////:://////////////////////////////////////////////
|
||||
|
||||
|
||||
#include "prc_x2_itemprop"
|
||||
|
||||
void SafeAddItemProperty(int nDurationType, itemproperty ipProperty, object oItem, float fDuration=0.0f)
|
||||
{
|
||||
int nPropType = GetItemPropertyType(ipProperty);
|
||||
if (!GetItemHasItemProperty(oItem,nPropType)) //already exist
|
||||
{
|
||||
AddItemProperty(nDurationType, ipProperty, oItem, fDuration);
|
||||
return;
|
||||
}
|
||||
else if (nPropType==ITEM_PROPERTY_BONUS_SPELL_SLOT_OF_LEVEL_N ||
|
||||
nPropType==ITEM_PROPERTY_CAST_SPELL)
|
||||
{
|
||||
AddItemProperty(nDurationType, ipProperty, oItem, fDuration);
|
||||
return;
|
||||
}
|
||||
else if (nPropType==ITEM_PROPERTY_DAMAGE_BONUS ||
|
||||
nPropType==ITEM_PROPERTY_DAMAGE_RESISTANCE ||
|
||||
nPropType==ITEM_PROPERTY_ABILITY_BONUS ||
|
||||
nPropType==ITEM_PROPERTY_IMMUNITY_DAMAGE_TYPE ||
|
||||
nPropType==ITEM_PROPERTY_IMMUNITY_MISCELLANEOUS ||
|
||||
nPropType==ITEM_PROPERTY_DAMAGE_VULNERABILITY ||
|
||||
nPropType==ITEM_PROPERTY_AC_BONUS_VS_DAMAGE_TYPE ||
|
||||
nPropType==ITEM_PROPERTY_DECREASED_ABILITY_SCORE ||
|
||||
nPropType==ITEM_PROPERTY_EXTRA_MELEE_DAMAGE_TYPE ||
|
||||
nPropType==ITEM_PROPERTY_EXTRA_RANGED_DAMAGE_TYPE)
|
||||
{
|
||||
IPSafeAddItemProperty(oItem, ipProperty, 0.0f, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE);
|
||||
}
|
||||
|
||||
else if (nPropType==ITEM_PROPERTY_AC_BONUS_VS_ALIGNMENT_GROUP ||
|
||||
nPropType==ITEM_PROPERTY_AC_BONUS_VS_DAMAGE_TYPE ||
|
||||
nPropType==ITEM_PROPERTY_AC_BONUS_VS_RACIAL_GROUP ||
|
||||
nPropType==ITEM_PROPERTY_AC_BONUS_VS_RACIAL_GROUP ||
|
||||
nPropType==ITEM_PROPERTY_AC_BONUS_VS_SPECIFIC_ALIGNMENT ||
|
||||
nPropType==ITEM_PROPERTY_ATTACK_BONUS_VS_ALIGNMENT_GROUP ||
|
||||
nPropType==ITEM_PROPERTY_ATTACK_BONUS_VS_RACIAL_GROUP ||
|
||||
nPropType==ITEM_PROPERTY_ATTACK_BONUS_VS_SPECIFIC_ALIGNMENT ||
|
||||
nPropType==ITEM_PROPERTY_BONUS_FEAT ||
|
||||
nPropType==ITEM_PROPERTY_DAMAGE_BONUS_VS_ALIGNMENT_GROUP ||
|
||||
nPropType==ITEM_PROPERTY_DAMAGE_BONUS_VS_RACIAL_GROUP ||
|
||||
nPropType==ITEM_PROPERTY_DAMAGE_BONUS_VS_SPECIFIC_ALIGNMENT ||
|
||||
nPropType==ITEM_PROPERTY_AC_BONUS_VS_RACIAL_GROUP ||
|
||||
nPropType==ITEM_PROPERTY_AC_BONUS_VS_RACIAL_GROUP ||
|
||||
nPropType==ITEM_PROPERTY_AC_BONUS_VS_SPECIFIC_ALIGNMENT ||
|
||||
nPropType==ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_ALIGNMENT_GROUP ||
|
||||
nPropType==ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_RACIAL_GROUP ||
|
||||
nPropType==ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_SPECIFIC_ALIGNEMENT ||
|
||||
nPropType==ITEM_PROPERTY_IMMUNITY_SPELLS_BY_LEVEL ||
|
||||
nPropType==ITEM_PROPERTY_IMMUNITY_SPELL_SCHOOL ||
|
||||
nPropType==ITEM_PROPERTY_ON_HIT_PROPERTIES ||
|
||||
nPropType==ITEM_PROPERTY_ONHITCASTSPELL ||
|
||||
nPropType==ITEM_PROPERTY_SAVING_THROW_BONUS_SPECIFIC ||
|
||||
nPropType==ITEM_PROPERTY_SKILL_BONUS )
|
||||
{
|
||||
int nSub1 = GetItemPropertySubType(ipProperty);
|
||||
if (nSub1 > -1)
|
||||
{
|
||||
itemproperty ipCheck = GetFirstItemProperty(oItem);
|
||||
while (GetIsItemPropertyValid(ipCheck))
|
||||
{
|
||||
int nSub2 = GetItemPropertySubType(ipCheck);
|
||||
if (nSub2 != nSub1)
|
||||
{
|
||||
AddItemProperty(nDurationType, ipProperty, oItem, fDuration);
|
||||
return;
|
||||
}
|
||||
ipCheck = GetNextItemProperty(oItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//******************************************************************************
|
||||
|
||||
void main()
|
||||
{
|
||||
itemproperty ipFItem;
|
||||
object oPC = GetPCSpeaker();
|
||||
|
||||
object oForge = GetNearestObjectByTag("forge_custom",OBJECT_SELF,1);
|
||||
|
||||
object oCombine = GetNearestObjectByTag("forge_combine",OBJECT_SELF,1);
|
||||
|
||||
string sCraft;
|
||||
int nType = GetLocalInt(OBJECT_SELF, "ItemType"); //check for type for crafting
|
||||
if (nType == 1) sCraft = "craftingbelt"; // belts and boots
|
||||
if (nType == 2) sCraft = "craftingshield"; // armor, helm, shield
|
||||
if (nType == 3) sCraft = "craftingdagger"; // melee weapons
|
||||
if (nType == 4) sCraft = "craftingcloak"; // cloaks
|
||||
if (nType == 5) sCraft = "craftingring"; // rings and ammys
|
||||
if (nType == 6) sCraft = "craftingsling"; // bows, x-bows, slings
|
||||
if (nType == 7) sCraft = "craftingdart"; // thrown and ammo
|
||||
if (nType == 8) sCraft = "craftingtoken"; // miscellaneous, common
|
||||
|
||||
if (!GetIsObjectValid(oForge)) return; //must have Forge
|
||||
if (!GetIsObjectValid(oCombine)) return; //must have Combining chamber
|
||||
|
||||
object oItem = GetFirstItemInInventory(oForge); //get the item on Forge
|
||||
if (GetIdentified(oItem)==FALSE) SetIdentified (oItem, TRUE);
|
||||
if (GetPlotFlag(oItem)==TRUE)
|
||||
{
|
||||
SetPlotFlag (oItem, FALSE);
|
||||
SetLocalInt(OBJECT_SELF,"PlotItem",TRUE);
|
||||
}
|
||||
object oCraft = GetFirstItemInInventory(oCombine); //get the first item in the combining chamber
|
||||
object oCopy = CopyItem(oItem, OBJECT_SELF, FALSE);
|
||||
int nCount = IPGetNumberOfItemProperties(oCopy);
|
||||
int nProps;
|
||||
int nTally = nCount;
|
||||
|
||||
|
||||
// First - we add the goodies from the combine to the base item
|
||||
|
||||
while (GetIsObjectValid(oCraft))
|
||||
{
|
||||
ipFItem = GetFirstItemProperty(oCraft);//Loop for as long as the ipLoop variable is valid
|
||||
while (GetIsItemPropertyValid(ipFItem))
|
||||
{
|
||||
nProps++;
|
||||
if (nCount < 8)
|
||||
{
|
||||
SafeAddItemProperty(DURATION_TYPE_PERMANENT,ipFItem,oCopy); //put property on copy
|
||||
nCount++;
|
||||
}
|
||||
ipFItem=GetNextItemProperty(oCraft);
|
||||
}
|
||||
oCraft = GetNextItemInInventory(oCombine);
|
||||
}
|
||||
|
||||
nTally = nTally + nProps;
|
||||
if (nTally > nCount) SendMessageToPC(oPC,"You are attempting to add more than 8 properties to the item. Any additional past the limit will be lost.");
|
||||
|
||||
// Then we find the actual cost of the new item. Then we screw them on price.
|
||||
int nValue2 = GetGoldPieceValue(oItem);
|
||||
int nValue1 = GetGoldPieceValue(oCopy);
|
||||
int nDiff = nValue1 - nValue2;
|
||||
int nIncrease;
|
||||
string sValue = "";
|
||||
if (nDiff > 0)
|
||||
{
|
||||
nIncrease = nDiff * 2;
|
||||
sValue = IntToString(nIncrease);
|
||||
}
|
||||
else
|
||||
{
|
||||
nIncrease = 0;
|
||||
sValue = "nothing in ";
|
||||
}
|
||||
|
||||
SetCustomToken(103,sValue);
|
||||
SetLocalInt (OBJECT_SELF,"ItemCost",nIncrease);
|
||||
|
||||
// Then we remove destroy the copy
|
||||
DestroyObject(oCopy,0.5f);
|
||||
|
||||
if (GetLocalInt(OBJECT_SELF,"PlotItem")==TRUE) // Reset variables and plot
|
||||
{
|
||||
SetPlotFlag (oItem, TRUE);
|
||||
SetLocalInt(OBJECT_SELF,"PlotItem",FALSE);
|
||||
}
|
||||
}
|
199
_module/nss/forge_itemnorisk.nss
Normal file
199
_module/nss/forge_itemnorisk.nss
Normal file
@@ -0,0 +1,199 @@
|
||||
/////::///////////////////////////////////////////////
|
||||
/////:: forge_itemmerge - Forge properties onto item from components.
|
||||
/////:: Modified by Winterknight on 2/18/06
|
||||
/////:: Original script written by Asbury
|
||||
/////:://////////////////////////////////////////////
|
||||
#include "sd_lootsystem"
|
||||
#include "prc_x2_itemprop"
|
||||
|
||||
void SafeAddItemProperty(int nDurationType, itemproperty ipProperty, object oItem, float fDuration=0.0f)
|
||||
{
|
||||
int nPropType = GetItemPropertyType(ipProperty);
|
||||
if (!GetItemHasItemProperty(oItem,nPropType)) //already exist
|
||||
{
|
||||
AddItemProperty(nDurationType, ipProperty, oItem, fDuration);
|
||||
return;
|
||||
}
|
||||
else if (nPropType==ITEM_PROPERTY_BONUS_SPELL_SLOT_OF_LEVEL_N ||
|
||||
nPropType==ITEM_PROPERTY_CAST_SPELL)
|
||||
{
|
||||
AddItemProperty(nDurationType, ipProperty, oItem, fDuration);
|
||||
return;
|
||||
}
|
||||
else if (nPropType==ITEM_PROPERTY_DAMAGE_BONUS ||
|
||||
nPropType==ITEM_PROPERTY_DAMAGE_RESISTANCE ||
|
||||
nPropType==ITEM_PROPERTY_ABILITY_BONUS ||
|
||||
nPropType==ITEM_PROPERTY_IMMUNITY_DAMAGE_TYPE ||
|
||||
nPropType==ITEM_PROPERTY_IMMUNITY_MISCELLANEOUS ||
|
||||
nPropType==ITEM_PROPERTY_DAMAGE_VULNERABILITY ||
|
||||
nPropType==ITEM_PROPERTY_AC_BONUS_VS_DAMAGE_TYPE ||
|
||||
nPropType==ITEM_PROPERTY_DECREASED_ABILITY_SCORE ||
|
||||
nPropType==ITEM_PROPERTY_EXTRA_MELEE_DAMAGE_TYPE ||
|
||||
nPropType==ITEM_PROPERTY_EXTRA_RANGED_DAMAGE_TYPE)
|
||||
{
|
||||
IPSafeAddItemProperty(oItem, ipProperty, 0.0f, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE);
|
||||
}
|
||||
|
||||
else if (nPropType==ITEM_PROPERTY_AC_BONUS_VS_ALIGNMENT_GROUP ||
|
||||
nPropType==ITEM_PROPERTY_AC_BONUS_VS_DAMAGE_TYPE ||
|
||||
nPropType==ITEM_PROPERTY_AC_BONUS_VS_RACIAL_GROUP ||
|
||||
nPropType==ITEM_PROPERTY_AC_BONUS_VS_RACIAL_GROUP ||
|
||||
nPropType==ITEM_PROPERTY_AC_BONUS_VS_SPECIFIC_ALIGNMENT ||
|
||||
nPropType==ITEM_PROPERTY_ATTACK_BONUS_VS_ALIGNMENT_GROUP ||
|
||||
nPropType==ITEM_PROPERTY_ATTACK_BONUS_VS_RACIAL_GROUP ||
|
||||
nPropType==ITEM_PROPERTY_ATTACK_BONUS_VS_SPECIFIC_ALIGNMENT ||
|
||||
nPropType==ITEM_PROPERTY_BONUS_FEAT ||
|
||||
nPropType==ITEM_PROPERTY_DAMAGE_BONUS_VS_ALIGNMENT_GROUP ||
|
||||
nPropType==ITEM_PROPERTY_DAMAGE_BONUS_VS_RACIAL_GROUP ||
|
||||
nPropType==ITEM_PROPERTY_DAMAGE_BONUS_VS_SPECIFIC_ALIGNMENT ||
|
||||
nPropType==ITEM_PROPERTY_AC_BONUS_VS_RACIAL_GROUP ||
|
||||
nPropType==ITEM_PROPERTY_AC_BONUS_VS_RACIAL_GROUP ||
|
||||
nPropType==ITEM_PROPERTY_AC_BONUS_VS_SPECIFIC_ALIGNMENT ||
|
||||
nPropType==ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_ALIGNMENT_GROUP ||
|
||||
nPropType==ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_RACIAL_GROUP ||
|
||||
nPropType==ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_SPECIFIC_ALIGNEMENT ||
|
||||
nPropType==ITEM_PROPERTY_IMMUNITY_SPELLS_BY_LEVEL ||
|
||||
nPropType==ITEM_PROPERTY_IMMUNITY_SPELL_SCHOOL ||
|
||||
nPropType==ITEM_PROPERTY_ON_HIT_PROPERTIES ||
|
||||
nPropType==ITEM_PROPERTY_ONHITCASTSPELL ||
|
||||
nPropType==ITEM_PROPERTY_SAVING_THROW_BONUS_SPECIFIC ||
|
||||
nPropType==ITEM_PROPERTY_SKILL_BONUS )
|
||||
{
|
||||
int nSub1 = GetItemPropertySubType(ipProperty);
|
||||
if (nSub1 > -1)
|
||||
{
|
||||
itemproperty ipCheck = GetFirstItemProperty(oItem);
|
||||
while (GetIsItemPropertyValid(ipCheck))
|
||||
{
|
||||
int nSub2 = GetItemPropertySubType(ipCheck);
|
||||
if (nSub2 != nSub1)
|
||||
{
|
||||
AddItemProperty(nDurationType, ipProperty, oItem, fDuration);
|
||||
return;
|
||||
}
|
||||
ipCheck = GetNextItemProperty(oItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//******************************************************************************
|
||||
|
||||
void main()
|
||||
{
|
||||
itemproperty ipFItem;
|
||||
effect eTel1 = EffectVisualEffect(VFX_IMP_KNOCK,FALSE);
|
||||
effect eTel2 = EffectVisualEffect(VFX_IMP_PDK_INSPIRE_COURAGE,FALSE);
|
||||
effect eUtter = EffectVisualEffect(VFX_FNF_MYSTICAL_EXPLOSION,FALSE);
|
||||
|
||||
object oPC = GetPCSpeaker();
|
||||
|
||||
object oForge = GetNearestObjectByTag("forge_custom",OBJECT_SELF,1);
|
||||
object oCombine = GetNearestObjectByTag("forge_combine",OBJECT_SELF,1);
|
||||
location lTrig1 = GetLocation(oForge);
|
||||
location lTrig2 = GetLocation(oCombine);
|
||||
|
||||
if (!GetIsObjectValid(oForge)) return; //must have Forge
|
||||
if (!GetIsObjectValid(oCombine)) return; //must have Combining chamber
|
||||
|
||||
object oArea = GetArea(oForge);
|
||||
object oItem = GetFirstItemInInventory(oForge); //get the first item on Forge
|
||||
|
||||
if (!GetIsObjectValid(oItem))
|
||||
{
|
||||
SendMessageToPC(oPC,"You must have a valid item in the Forge.");
|
||||
return; //must have something there
|
||||
}
|
||||
|
||||
int nLoop = IPGetNumberOfItemProperties(oItem);
|
||||
object oCraft = GetFirstItemInInventory(oCombine); //get the first item in the combining chamber
|
||||
int nTally = nLoop;
|
||||
|
||||
while (GetIsObjectValid(oCraft))
|
||||
{
|
||||
ipFItem = GetFirstItemProperty(oCraft); //Loop for as long as the ipLoop variable is valid
|
||||
while (GetIsItemPropertyValid(ipFItem))
|
||||
{
|
||||
nTally++;
|
||||
if (nLoop < 8)
|
||||
{
|
||||
SafeAddItemProperty(DURATION_TYPE_PERMANENT,ipFItem,oItem); //put property on
|
||||
nLoop++;
|
||||
}
|
||||
if (nTally > 8)
|
||||
{
|
||||
SendMessageToPC(oPC,"You have attempted to add more than 8 properties to the item. This can cause errors in transfer. Some item properties have been lost.");
|
||||
}
|
||||
RemoveItemProperty(oCraft, ipFItem); //take the magic away from object
|
||||
ipFItem=GetNextItemProperty(oCraft);
|
||||
}
|
||||
DestroyObject(oCraft); //remove the object
|
||||
oCraft = GetNextItemInInventory(oCombine);
|
||||
}
|
||||
|
||||
int iQual = nTally;
|
||||
string sName;
|
||||
string cName;
|
||||
string sCheck = GetStringLeft(GetTag(oItem), 5);
|
||||
string oName = GetName(oItem);
|
||||
|
||||
switch(iQual)
|
||||
{
|
||||
case 1: cName = ColorString("[Enchanted] ", 255, 255, 255); break;
|
||||
case 2: cName = ColorString("[Enchanted] ", 30, 180, 30); break;
|
||||
case 3: cName = ColorString("[Enchanted] ", 30, 180, 30); break;
|
||||
case 4: cName = ColorString("[Bewitched] ", 5, 90, 255); break;
|
||||
case 5: cName = ColorString("[Bewitched] ", 5, 90, 255); break;
|
||||
case 6: cName = ColorString("[Spellbound] ", 185, 1, 200); break;
|
||||
case 7: cName = ColorString("[Archforged] ", 255, 245, 210); break;
|
||||
case 8: cName = ColorString("[Ancient] ", 180, 180, 80); break;
|
||||
}
|
||||
|
||||
switch(iQual)
|
||||
{
|
||||
case 1: sName = ColorString("Reforged Magical "+ RandomName(200),255, 255, 255); break;
|
||||
case 2: sName = ColorString("Reforged Enchanted "+ RandomName(200), 30, 180, 30); break;
|
||||
case 3: sName = ColorString("Reforged Enchanted "+ RandomName(200), 30, 180, 30); break;
|
||||
case 4: sName = ColorString("Reforged Imbued "+ RandomName(200), 5, 90, 255); break;
|
||||
case 5: sName = ColorString("Reforged Imbued "+ RandomName(200), 5, 90, 255); break;
|
||||
case 6: sName = ColorString("Reforged Planar "+ RandomName(200), 185, 1, 200); break;
|
||||
case 7: sName = ColorString("Reforged Divine "+ RandomName(200), 255, 245, 210); break;
|
||||
case 8: sName = ColorString("Reforged Ancient's "+ RandomName(200), 180, 180, 80); break;
|
||||
}
|
||||
|
||||
switch(iQual)
|
||||
{
|
||||
case 1: FloatingTextStringOnCreature("You have reforged a Magical Quality item!", oPC); break;
|
||||
case 2: FloatingTextStringOnCreature("You have reforged a Enchanted Quality item!", oPC); break;
|
||||
case 3: FloatingTextStringOnCreature("You have reforged a Enchanted Quality item!", oPC); break;
|
||||
case 4: FloatingTextStringOnCreature("You have reforged a Imbued Quality item!", oPC); break;
|
||||
case 5: FloatingTextStringOnCreature("You have reforged a Imbued Quality item!", oPC); break;
|
||||
case 6: FloatingTextStringOnCreature("You have reforged a Planar Quality item!", oPC); break;
|
||||
case 7: FloatingTextStringOnCreature("You have reforged a Divine Quality item!", oPC); break;
|
||||
case 8: FloatingTextStringOnCreature("You have reforged a Ancient Quality item!", oPC); break;
|
||||
}
|
||||
|
||||
if (sCheck == "HELM_" ||
|
||||
sCheck == "ARMR_" ||
|
||||
sCheck == "SHLD_" ||
|
||||
sCheck == "ammy_" ||
|
||||
sCheck == "ring_" ||
|
||||
sCheck == "WEAP_" ||
|
||||
sCheck == "BOOT_" ||
|
||||
sCheck == "BELT_")
|
||||
{
|
||||
SetName (oItem, cName + oName);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetName(oItem, sName);
|
||||
}
|
||||
|
||||
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT,eTel2,lTrig2,0.0);
|
||||
DelayCommand(0.3,ApplyEffectAtLocation(DURATION_TYPE_INSTANT,eTel1,lTrig1,0.0));
|
||||
RecomputeStaticLighting(oArea);
|
||||
|
||||
int nGold = GetLocalInt (OBJECT_SELF,"ItemCost");
|
||||
TakeGoldFromCreature(nGold,oPC,TRUE);
|
||||
|
||||
}
|
109
_module/nss/forge_itemsplit.nss
Normal file
109
_module/nss/forge_itemsplit.nss
Normal file
@@ -0,0 +1,109 @@
|
||||
/////::///////////////////////////////////////////////
|
||||
/////:: forge_itemsplit - Separate into component properties
|
||||
/////:: Modified by Winterknight on 2/18/06
|
||||
/////:: Original script written by Asbury
|
||||
/////:://////////////////////////////////////////////
|
||||
#include "sd_lootsystem"
|
||||
|
||||
void main()
|
||||
{
|
||||
//:: Declare major variables.
|
||||
effect eTel1 = EffectVisualEffect(VFX_IMP_FROST_L,FALSE);
|
||||
effect eTel2 = EffectVisualEffect(VFX_IMP_ELEMENTAL_PROTECTION,FALSE);
|
||||
|
||||
object oForge = GetNearestObjectByTag("forge_custom",OBJECT_SELF,1);
|
||||
object oCombine = GetNearestObjectByTag("forge_combine",OBJECT_SELF,1);
|
||||
|
||||
object oArea = GetArea(oForge);
|
||||
|
||||
location lTrig1 = GetLocation(oForge);
|
||||
location lTrig2 = GetLocation(oCombine);
|
||||
|
||||
//:: Get only the first item on forge.
|
||||
object oItem = GetFirstItemInInventory(oForge);
|
||||
|
||||
//:: Must have something in the forge.
|
||||
if (!GetIsObjectValid(oItem)) return;
|
||||
|
||||
//:: Identify item
|
||||
if (GetIdentified(oItem)==FALSE) SetIdentified (oItem, TRUE);
|
||||
|
||||
//:: Check for type for crafting
|
||||
string sCraft;
|
||||
int nType = GetLocalInt(OBJECT_SELF, "ItemType");
|
||||
|
||||
if (nType == 1) sCraft = "craftingbelt"; // belts and boots
|
||||
else if (nType == 2) sCraft = "craftingshield"; // armor, helm, shield
|
||||
else if (nType == 3) sCraft = "craftingdagger"; // melee weapons
|
||||
else if (nType == 4) sCraft = "craftingcloak"; // cloaks
|
||||
else if (nType == 5) sCraft = "craftingring"; // rings and ammys
|
||||
else if (nType == 6) sCraft = "craftingsling"; // bows, x-bows, slings
|
||||
else if (nType == 7) sCraft = "craftingdirk"; // thrown and ammo
|
||||
//else if (nType == 8) sCraft = "craftingtoken"; // miscellaneous, common
|
||||
else sCraft = "craftingtoken"; // anything else
|
||||
|
||||
itemproperty ipForgeItemIP;
|
||||
int nIPDuration, nCheck, nParam1, nIPType;
|
||||
ipForgeItemIP = GetFirstItemProperty(oItem);
|
||||
|
||||
//:: Loop for as long as the ipLoop variable is valid
|
||||
while (GetIsItemPropertyValid(ipForgeItemIP))
|
||||
{
|
||||
nCheck = 0;
|
||||
//:: Check for temporary itemprops
|
||||
nIPDuration = GetItemPropertyDurationType(ipForgeItemIP);
|
||||
|
||||
//:: Check to see if we can prevent the unique mithril powers from being removed.
|
||||
nParam1 = GetItemPropertySubType(ipForgeItemIP);
|
||||
nIPType = GetItemPropertyType(ipForgeItemIP);
|
||||
if (nIPType == ITEM_PROPERTY_ONHITCASTSPELL)
|
||||
{
|
||||
if (nParam1 == 125)
|
||||
nCheck = 1;
|
||||
}
|
||||
if (nIPType == ITEM_PROPERTY_CAST_SPELL)
|
||||
{
|
||||
if (nParam1 == 329 ||
|
||||
nParam1 == 335 ||
|
||||
nParam1 == 359 ||
|
||||
nParam1 == 537 ||
|
||||
nParam1 == 513)
|
||||
nCheck = 1;
|
||||
}
|
||||
if (Random(100) != 1 & nIPDuration == DURATION_TYPE_PERMANENT & nCheck != 1)
|
||||
{
|
||||
//:: Create receptacle item on Combine
|
||||
object oCraft = CreateItemOnObject(sCraft, oCombine);
|
||||
if (GetIsObjectValid(oCraft))
|
||||
{
|
||||
//:: Remove itemprop from item
|
||||
RemoveItemProperty(oItem, ipForgeItemIP);
|
||||
//:: Add property to crafting item
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ipForgeItemIP, oCraft);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (nCheck == 1)
|
||||
{
|
||||
SendMessageToPC(GetPCSpeaker(),"Unique powers not removed.");
|
||||
}
|
||||
else
|
||||
{
|
||||
SendMessageToPC(GetPCSpeaker(),"An item property was lost during the separation.");
|
||||
RemoveItemProperty(oItem, ipForgeItemIP);
|
||||
}
|
||||
}
|
||||
|
||||
//:: Next itemproperty on the item
|
||||
ipForgeItemIP = GetNextItemProperty(oItem);
|
||||
}
|
||||
|
||||
string sName;
|
||||
|
||||
sName = ColorString("Disenchanted Item" ,80, 80, 80);
|
||||
SetName(oItem, sName);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT,eTel1,lTrig1,0.0);
|
||||
DelayCommand(0.3,ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eTel2, lTrig2, 0.0));
|
||||
RecomputeStaticLighting(oArea);
|
||||
}
|
74
_module/nss/forge_mergecheck.nss
Normal file
74
_module/nss/forge_mergecheck.nss
Normal file
@@ -0,0 +1,74 @@
|
||||
/////::///////////////////////////////////////////////
|
||||
/////:: forge_guildcheck script - check to make sure not splitting a guild item
|
||||
/////:: Written by Winterknight on 2/17/06
|
||||
/////:://////////////////////////////////////////////
|
||||
#include "nw_i0_tool"
|
||||
|
||||
int StartingConditional()
|
||||
{
|
||||
object oCombine = GetNearestObjectByTag("forge_combine",OBJECT_SELF,1);
|
||||
object oItem = GetFirstItemInInventory(oCombine);
|
||||
string sMerge = GetTag(oItem);
|
||||
int nType = GetLocalInt(OBJECT_SELF, "ItemType");
|
||||
/*while (GetIsObjectValid(oItem))
|
||||
{
|
||||
if (nType == 1) // Belts and Boots
|
||||
{
|
||||
if (sMerge == "craftingbelt" ||
|
||||
sMerge == "craftingtoken" )
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (nType == 2) // Armor, Helms, Shields
|
||||
{
|
||||
if (sMerge == "craftingshield" ||
|
||||
sMerge == "craftingtoken" )
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (nType == 3) // Melee Weapons
|
||||
{
|
||||
if (sMerge == "craftingdagger" ||
|
||||
sMerge == "craftingtoken" )
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (nType == 4) // Cloaks
|
||||
{
|
||||
if (sMerge == "craftingcloak" ||
|
||||
sMerge == "craftingtoken" )
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (nType == 5) // Rings and Amulets
|
||||
{
|
||||
if (sMerge == "craftingring" ||
|
||||
sMerge == "craftingtoken" )
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (nType == 6) // Bows and Crossbows/slings
|
||||
{
|
||||
if (sMerge == "craftingsling" ||
|
||||
sMerge == "craftingtoken" )
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (nType == 7) // Thrown weapons and ammunition
|
||||
{
|
||||
if (sMerge == "craftingdirk" ||
|
||||
sMerge == "craftingtoken" )
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (nType == 8) // Common items (miscellaneous or not already covered)
|
||||
{
|
||||
if (sMerge == "craftingtoken" )
|
||||
return FALSE;
|
||||
}
|
||||
oItem = GetNextItemInInventory(oCombine);
|
||||
}
|
||||
return TRUE; */
|
||||
|
||||
return FALSE;
|
||||
}
|
19
_module/nss/forge_sdcheck.nss
Normal file
19
_module/nss/forge_sdcheck.nss
Normal file
@@ -0,0 +1,19 @@
|
||||
/////::///////////////////////////////////////////////
|
||||
/////:: forge_guildcheck script - check to make sure not splitting a guild item
|
||||
/////:: Written by Winterknight on 2/17/06
|
||||
/////:://////////////////////////////////////////////
|
||||
#include "nw_i0_tool"
|
||||
|
||||
int StartingConditional()
|
||||
{
|
||||
object oForge = GetNearestObjectByTag("forge_custom",OBJECT_SELF,1);
|
||||
object oItem = GetFirstItemInInventory(oForge);
|
||||
string sCheck = GetStringLowerCase(GetStringLeft(GetResRef(oItem), 2));
|
||||
if (sCheck == "sd" || sCheck == "nw" || sCheck == "x2")
|
||||
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
22
_module/nss/forge_spititout.nss
Normal file
22
_module/nss/forge_spititout.nss
Normal file
@@ -0,0 +1,22 @@
|
||||
/////::///////////////////////////////////////////////
|
||||
/////:: forge_spititout script - check to make sure no more than one item in forge.
|
||||
/////:: Written by Winterknight on 2/20/06
|
||||
/////:://////////////////////////////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
object oFifo2 = GetFirstItemInInventory(OBJECT_SELF);
|
||||
|
||||
if (GetInventoryDisturbType() == INVENTORY_DISTURB_TYPE_ADDED)
|
||||
{
|
||||
oFifo2 = GetNextItemInInventory(OBJECT_SELF);
|
||||
if (GetIsObjectValid(oFifo2))
|
||||
{
|
||||
location lDrop = GetLocation(GetNearestObjectByTag("forge_spitpoint", OBJECT_SELF,1));
|
||||
object oCopy = CopyObject(oFifo2, lDrop, OBJECT_INVALID, "");
|
||||
DestroyObject(oFifo2,0.3);
|
||||
effect eEff1 = EffectVisualEffect(VFX_FNF_SMOKE_PUFF, FALSE);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eEff1, lDrop, 0.0);
|
||||
}
|
||||
}
|
||||
}
|
183
_module/nss/forge_splitcheck.nss
Normal file
183
_module/nss/forge_splitcheck.nss
Normal file
@@ -0,0 +1,183 @@
|
||||
/////::///////////////////////////////////////////////
|
||||
/////:: forge_guildcheck script - check to make sure not splitting a guild item
|
||||
/////:: Written by Winterknight on 2/17/06
|
||||
/////:://////////////////////////////////////////////
|
||||
#include "nw_i0_tool"
|
||||
#include "prc_misc_const"
|
||||
|
||||
int StartingConditional()
|
||||
{
|
||||
object oForge = GetNearestObjectByTag("forge_custom",OBJECT_SELF,1);
|
||||
object oItem = GetFirstItemInInventory(oForge);
|
||||
int nBase = GetBaseItemType (oItem);
|
||||
int nType = GetLocalInt(OBJECT_SELF, "ItemType");
|
||||
|
||||
return FALSE;
|
||||
|
||||
if (nType == 1) // Belts and Boots
|
||||
{
|
||||
if (nBase == BASE_ITEM_BOOTS ||
|
||||
nBase == BASE_ITEM_MISCLARGE ||
|
||||
nBase == BASE_ITEM_MISCMEDIUM||
|
||||
nBase == BASE_ITEM_MISCSMALL ||
|
||||
nBase == BASE_ITEM_MISCTALL ||
|
||||
nBase == BASE_ITEM_MISCTHIN ||
|
||||
nBase == BASE_ITEM_MISCWIDE ||
|
||||
nBase == BASE_ITEM_BELT)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (nType == 2) // Armor, Helms, Shields
|
||||
{
|
||||
if (nBase == BASE_ITEM_TOWERSHIELD ||
|
||||
nBase == BASE_ITEM_MISCLARGE ||
|
||||
nBase == BASE_ITEM_MISCMEDIUM||
|
||||
nBase == BASE_ITEM_MISCSMALL ||
|
||||
nBase == BASE_ITEM_MISCTALL ||
|
||||
nBase == BASE_ITEM_MISCTHIN ||
|
||||
nBase == BASE_ITEM_MISCWIDE ||
|
||||
nBase == BASE_ITEM_SMALLSHIELD ||
|
||||
nBase == BASE_ITEM_HELMET ||
|
||||
nBase == BASE_ITEM_ARMOR ||
|
||||
nBase == BASE_ITEM_BRACER ||
|
||||
nBase == BASE_ITEM_LARGESHIELD)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (nType == 3) // Melee Weapons
|
||||
{
|
||||
if (nBase == BASE_ITEM_BASTARDSWORD ||
|
||||
nBase == BASE_ITEM_BATTLEAXE ||
|
||||
nBase == BASE_ITEM_CLUB ||
|
||||
nBase == BASE_ITEM_DAGGER ||
|
||||
nBase == BASE_ITEM_DIREMACE ||
|
||||
nBase == BASE_ITEM_DOUBLEAXE ||
|
||||
nBase == BASE_ITEM_DOUBLE_SCIMITAR ||
|
||||
nBase == BASE_ITEM_DWARVENWARAXE ||
|
||||
nBase == BASE_ITEM_EAGLE_CLAW ||
|
||||
nBase == BASE_ITEM_ELVEN_COURTBLADE ||
|
||||
nBase == BASE_ITEM_ELVEN_LIGHTBLADE ||
|
||||
nBase == BASE_ITEM_ELVEN_THINBLADE ||
|
||||
nBase == BASE_ITEM_FALCHION ||
|
||||
nBase == BASE_ITEM_GLOVES ||
|
||||
nBase == BASE_ITEM_GOAD ||
|
||||
nBase == BASE_ITEM_GREATAXE ||
|
||||
nBase == BASE_ITEM_GREATSWORD ||
|
||||
nBase == BASE_ITEM_HALBERD ||
|
||||
nBase == BASE_ITEM_HANDAXE ||
|
||||
nBase == BASE_ITEM_HEAVYCROSSBOW ||
|
||||
nBase == BASE_ITEM_HEAVYFLAIL ||
|
||||
nBase == BASE_ITEM_HEAVY_MACE ||
|
||||
nBase == BASE_ITEM_HEAVY_PICK ||
|
||||
nBase == BASE_ITEM_KAMA ||
|
||||
nBase == BASE_ITEM_KATANA ||
|
||||
nBase == BASE_ITEM_KATAR ||
|
||||
nBase == BASE_ITEM_KUKRI ||
|
||||
nBase == BASE_ITEM_LIGHTFLAIL ||
|
||||
nBase == BASE_ITEM_LIGHTHAMMER ||
|
||||
nBase == BASE_ITEM_LIGHTMACE ||
|
||||
nBase == BASE_ITEM_LIGHT_PICK ||
|
||||
nBase == BASE_ITEM_LONGSWORD ||
|
||||
nBase == BASE_ITEM_MAUL ||
|
||||
nBase == BASE_ITEM_MISCLARGE ||
|
||||
nBase == BASE_ITEM_MISCMEDIUM||
|
||||
nBase == BASE_ITEM_MISCSMALL ||
|
||||
nBase == BASE_ITEM_MISCTALL ||
|
||||
nBase == BASE_ITEM_MISCTHIN ||
|
||||
nBase == BASE_ITEM_MISCWIDE ||
|
||||
nBase == BASE_ITEM_MORNINGSTAR ||
|
||||
nBase == BASE_ITEM_NUNCHAKU ||
|
||||
nBase == BASE_ITEM_QUARTERSTAFF ||
|
||||
nBase == BASE_ITEM_RAPIER ||
|
||||
nBase == BASE_ITEM_SAI ||
|
||||
nBase == BASE_ITEM_SAP ||
|
||||
nBase == BASE_ITEM_SCIMITAR ||
|
||||
nBase == BASE_ITEM_SCYTHE ||
|
||||
nBase == BASE_ITEM_SHORTSPEAR ||
|
||||
nBase == BASE_ITEM_SHORTSWORD ||
|
||||
nBase == BASE_ITEM_SICKLE ||
|
||||
nBase == BASE_ITEM_SLING ||
|
||||
nBase == BASE_ITEM_TRIDENT ||
|
||||
nBase == BASE_ITEM_TWOBLADEDSWORD ||
|
||||
nBase == BASE_ITEM_WARHAMMER ||
|
||||
nBase == BASE_ITEM_WHIP)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (nType == 4) // Cloaks
|
||||
{
|
||||
if (nBase == BASE_ITEM_CLOAK ||
|
||||
nBase == BASE_ITEM_MISCLARGE ||
|
||||
nBase == BASE_ITEM_MISCMEDIUM||
|
||||
nBase == BASE_ITEM_MISCSMALL ||
|
||||
nBase == BASE_ITEM_MISCTALL ||
|
||||
nBase == BASE_ITEM_MISCTHIN ||
|
||||
nBase == BASE_ITEM_MISCWIDE )
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (nType == 5) // Rings and Amulets
|
||||
{
|
||||
if (nBase == BASE_ITEM_RING ||
|
||||
nBase == BASE_ITEM_MISCLARGE ||
|
||||
nBase == BASE_ITEM_MISCMEDIUM||
|
||||
nBase == BASE_ITEM_MISCSMALL ||
|
||||
nBase == BASE_ITEM_MISCTALL ||
|
||||
nBase == BASE_ITEM_MISCTHIN ||
|
||||
nBase == BASE_ITEM_MISCWIDE ||
|
||||
nBase == BASE_ITEM_AMULET)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (nType == 6) // Bows and Crossbows/slings
|
||||
{
|
||||
if (nBase == BASE_ITEM_LONGBOW ||
|
||||
nBase == BASE_ITEM_MISCLARGE ||
|
||||
nBase == BASE_ITEM_MISCMEDIUM||
|
||||
nBase == BASE_ITEM_MISCSMALL ||
|
||||
nBase == BASE_ITEM_MISCTALL ||
|
||||
nBase == BASE_ITEM_MISCTHIN ||
|
||||
nBase == BASE_ITEM_MISCWIDE ||
|
||||
nBase == BASE_ITEM_LIGHTCROSSBOW ||
|
||||
nBase == BASE_ITEM_HEAVYCROSSBOW||
|
||||
nBase == BASE_ITEM_SHORTBOW ||
|
||||
nBase == BASE_ITEM_SLING )
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (nType == 7) // Thrown weapons and ammunition
|
||||
{
|
||||
if (nBase == BASE_ITEM_ARROW ||
|
||||
nBase == BASE_ITEM_MISCLARGE ||
|
||||
nBase == BASE_ITEM_MISCMEDIUM||
|
||||
nBase == BASE_ITEM_MISCSMALL ||
|
||||
nBase == BASE_ITEM_MISCTALL ||
|
||||
nBase == BASE_ITEM_MISCTHIN ||
|
||||
nBase == BASE_ITEM_MISCWIDE ||
|
||||
nBase == BASE_ITEM_BOLT ||
|
||||
nBase == BASE_ITEM_BULLET||
|
||||
nBase == BASE_ITEM_DART ||
|
||||
nBase == BASE_ITEM_GRENADE ||
|
||||
nBase == BASE_ITEM_SHURIKEN ||
|
||||
nBase == BASE_ITEM_THROWINGAXE )
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (nType == 8) // Common items (miscellaneous or not already covered)
|
||||
{
|
||||
if (nBase == BASE_ITEM_BOOK ||
|
||||
nBase == BASE_ITEM_MISCLARGE ||
|
||||
nBase == BASE_ITEM_MISCMEDIUM||
|
||||
nBase == BASE_ITEM_MISCSMALL ||
|
||||
nBase == BASE_ITEM_MISCTALL ||
|
||||
nBase == BASE_ITEM_MISCTHIN ||
|
||||
nBase == BASE_ITEM_MISCWIDE ||
|
||||
nBase == BASE_ITEM_MAGICROD||
|
||||
nBase == BASE_ITEM_LARGEBOX ||
|
||||
nBase == BASE_ITEM_MAGICSTAFF ||
|
||||
nBase == BASE_ITEM_MAGICWAND )
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
15
_module/nss/forge_validcheck.nss
Normal file
15
_module/nss/forge_validcheck.nss
Normal file
@@ -0,0 +1,15 @@
|
||||
/////::///////////////////////////////////////////////
|
||||
/////:: forge_guildcheck script - check to make sure not splitting a guild item
|
||||
/////:: Written by Winterknight on 2/17/06
|
||||
/////:://////////////////////////////////////////////
|
||||
#include "nw_i0_tool"
|
||||
|
||||
int StartingConditional()
|
||||
{
|
||||
object oForge = GetNearestObjectByTag("forge_custom",OBJECT_SELF,1);
|
||||
object oItem = GetFirstItemInInventory(oForge);
|
||||
if (!GetIsObjectValid(oItem))
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
@@ -1053,10 +1053,10 @@ void DropGold (object oMob, object oSack, int iBonus)
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//Gold Debugging
|
||||
//object oPC = GetFirstPC();
|
||||
//object oKiller = GetFirstPC();
|
||||
//sGold = IntToString(iGold);
|
||||
//sLvl = IntToString(iHD);
|
||||
//FloatingTextStringOnCreature(sGold+" Gold Spawned by lvl "+sLvl+" mob", oPC);
|
||||
//FloatingTextStringOnCreature(sGold+" Gold Spawned by lvl "+sLvl+" mob", oKiller);
|
||||
//
|
||||
//
|
||||
//
|
||||
@@ -1957,17 +1957,16 @@ void DamageTypeImbue(object oItem, int iRange)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
iRoll = d3();
|
||||
iRoll = d2();
|
||||
if (iRoll==1)iDam = IP_CONST_DAMAGEBONUS_1d4;
|
||||
if (iRoll==2)iDam = IP_CONST_DAMAGEBONUS_1;
|
||||
if (iRoll==3)iDam = IP_CONST_DAMAGEBONUS_1d4;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
iRoll = d4();
|
||||
if (iRoll==1)iDam = IP_CONST_DAMAGEBONUS_1;
|
||||
if (iRoll==2)iDam = IP_CONST_DAMAGEBONUS_1d4;
|
||||
if (iRoll==2)iDam = IP_CONST_DAMAGEBONUS_2;
|
||||
if (iRoll==3)iDam = IP_CONST_DAMAGEBONUS_1d4;
|
||||
if (iRoll==4)iDam = IP_CONST_DAMAGEBONUS_1d4;
|
||||
}
|
||||
@@ -3571,7 +3570,6 @@ void DropMagicItem (object oMob, object oSack, int iRange, int SockChance, int i
|
||||
}
|
||||
|
||||
//:: Chance for socketed item
|
||||
|
||||
oItem = CreateItemOnObject(sType, oSack, 1, "sf_socket_item");
|
||||
|
||||
iRoll = d100();
|
||||
@@ -3608,7 +3606,7 @@ void DropMagicItem (object oMob, object oSack, int iRange, int SockChance, int i
|
||||
|
||||
///////////////////////////////////////////// Hench Reward Code
|
||||
|
||||
object oPC = GetFirstPC();
|
||||
object oKiller = GetFirstPC();
|
||||
|
||||
if (GetMaster(oMob)!=OBJECT_INVALID)
|
||||
{
|
||||
@@ -3617,62 +3615,49 @@ void DropMagicItem (object oMob, object oSack, int iRange, int SockChance, int i
|
||||
}
|
||||
|
||||
//////////////////////////////////////////// Lvls 1-5
|
||||
if (iRange == 1)
|
||||
|
||||
//:: AC bonus for ammy, cloak & boots or ability bonus otherwise
|
||||
if (iID == 1)
|
||||
{
|
||||
//:: AC bonus for ammy, cloak & boots or ability bonus otherwise
|
||||
iRoll = d100();
|
||||
if (iID == 1)
|
||||
{
|
||||
DelayCommand(0.2, ACmisc(oItem, iRange));
|
||||
++iQual;
|
||||
}
|
||||
if (iID == 2) //:: Rings
|
||||
{
|
||||
if (iRoll > 94) //:: 5% Chance for Divinty / Wizardry
|
||||
{
|
||||
iRoll = d2(1);
|
||||
if (iRoll == 1)
|
||||
{
|
||||
DelayCommand(0.2, ImbueWizardry(oItem, iRange));
|
||||
iQual+=3;
|
||||
}
|
||||
else
|
||||
{
|
||||
DelayCommand(0.2, ImbueDivinity(oItem, iRange));
|
||||
iQual+=3;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
iRoll = d100();
|
||||
if (iRoll > 60)
|
||||
{
|
||||
DelayCommand(0.2, AbilityImbue(oItem, iRange));
|
||||
++iQual;
|
||||
}
|
||||
|
||||
DelayCommand(0.2, ACmisc(oItem, iRange));
|
||||
++iQual;
|
||||
}
|
||||
|
||||
////////////////////////////////////////// Lvls 6-10
|
||||
else
|
||||
{
|
||||
iRoll = d100();
|
||||
if (iRoll > 94) //:: 5% Chance for Divinty / Wizardry
|
||||
{
|
||||
iRoll = d2(1);
|
||||
if (iRoll == 1)
|
||||
{
|
||||
DelayCommand(0.2, ImbueWizardry(oItem, iRange));
|
||||
iQual+=3;
|
||||
}
|
||||
else
|
||||
{
|
||||
DelayCommand(0.2, ImbueDivinity(oItem, iRange));
|
||||
iQual+=3;
|
||||
}
|
||||
}
|
||||
|
||||
DelayCommand(0.2, AbilityImbue(oItem, iRange));
|
||||
++iQual;
|
||||
}
|
||||
|
||||
////////////////////////////////////////// Lvls 6-10
|
||||
|
||||
if (iRange == 2)
|
||||
{
|
||||
//:: Ability bonus &/or AC Bonus
|
||||
iRoll = d100();
|
||||
if (iRoll > 60)
|
||||
{
|
||||
DelayCommand(0.2, ACmisc(oItem, iRange));
|
||||
++iQual;
|
||||
}
|
||||
iRoll = d100();
|
||||
if (iRoll > 60)
|
||||
{
|
||||
//:: Ability bonus
|
||||
iRoll = d100();
|
||||
if (iRoll > 60)
|
||||
{
|
||||
DelayCommand(0.2, AbilityImbue(oItem, iRange));
|
||||
++iQual;
|
||||
}
|
||||
//:: Rings ONLY
|
||||
if (iID==2)
|
||||
{
|
||||
|
||||
if (iID == 2)
|
||||
{
|
||||
iRoll = d100();
|
||||
if (iRoll > 94) //:: 5% Chance for Divinty / Wizardry
|
||||
{
|
||||
@@ -3696,15 +3681,17 @@ void DropMagicItem (object oMob, object oSack, int iRange, int SockChance, int i
|
||||
}
|
||||
}
|
||||
else
|
||||
{//:: Else, Saving Throw bonuses
|
||||
{
|
||||
//:: Saving Throw bonus
|
||||
iRoll = d100();
|
||||
if (iRoll > 89)
|
||||
DelayCommand(0.2, SaveImbue(oItem, iRange));
|
||||
++iQual;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (iRoll>90)
|
||||
{
|
||||
DelayCommand(0.2, SaveImbue(oItem, iRange));
|
||||
++iQual;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////// Lvls 11-20
|
||||
|
||||
if (iRange == 3)
|
||||
@@ -3723,7 +3710,7 @@ void DropMagicItem (object oMob, object oSack, int iRange, int SockChance, int i
|
||||
++iQual;
|
||||
}
|
||||
//:: Rings ONLY
|
||||
if (iID==2)
|
||||
if (iID == 2)
|
||||
{
|
||||
iRoll = d100();
|
||||
if (iRoll > 89) //:: 10% Chance for Divinty / Wizardry
|
||||
@@ -3748,7 +3735,7 @@ void DropMagicItem (object oMob, object oSack, int iRange, int SockChance, int i
|
||||
}
|
||||
}
|
||||
else
|
||||
{//:: Misc Immunity
|
||||
{//:: Misc Bonus
|
||||
iRoll = d100();
|
||||
if (iRoll > 80)
|
||||
{
|
||||
@@ -3935,7 +3922,7 @@ void DropMagicItem (object oMob, object oSack, int iRange, int SockChance, int i
|
||||
++iQual;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
switch(iQual)
|
||||
{
|
||||
case 1: sName = ColorString("Magical "+sIName,255, 255, 255); break;
|
||||
@@ -4739,7 +4726,16 @@ void DropWeapon (object oMob, object oSack, int iRange, int SockChance, int iChe
|
||||
if (iRoll==2)sIName = "Twin Sabre";
|
||||
if (iRoll==3)sIName = "Double Shamshir";
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case 55:
|
||||
{ //:: Sling
|
||||
iWType = 1;
|
||||
sType = "sdsling"; iRoll = d3();
|
||||
if (iRoll==1)sIName = "Sling";
|
||||
if (iRoll==2)sIName = "Strap";
|
||||
if (iRoll==3)sIName = "Funda";
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
//:: Chance for socketed item
|
||||
@@ -4787,14 +4783,14 @@ void DropWeapon (object oMob, object oSack, int iRange, int SockChance, int iChe
|
||||
|
||||
SetIdentified(oItem, FALSE);
|
||||
|
||||
//////////////////////////////////////////// Lvls 1-5 ::Ranged::
|
||||
//////////////////////////////////////////// Lvls 1-5 ::Ranged::
|
||||
|
||||
//:: Attack bonus
|
||||
|
||||
DelayCommand(0.2, BowEnhance(oItem, iRange));
|
||||
++iQual;
|
||||
|
||||
////////////////////////////////////////// Lvls 6-10 ::Ranged::
|
||||
////////////////////////////////////////// Lvls 6-10 ::Ranged::
|
||||
|
||||
if (iRange==2)
|
||||
{
|
||||
@@ -4807,28 +4803,28 @@ void DropWeapon (object oMob, object oSack, int iRange, int SockChance, int iChe
|
||||
}
|
||||
//:: Massive Crits
|
||||
iRoll = d100();
|
||||
if (iRoll>70)
|
||||
if (iRoll > 70)
|
||||
{
|
||||
DelayCommand(0.2, MassCritImbue(oItem, iRange));
|
||||
++iQual;
|
||||
}
|
||||
//:: Mighty
|
||||
iRoll = d100();
|
||||
if (iRoll>70)
|
||||
if (iRoll > 70)
|
||||
{
|
||||
DelayCommand(0.2, MightyEnhance(oItem, iRange));
|
||||
++iQual;
|
||||
}
|
||||
//:: Haste
|
||||
iRoll = d100();
|
||||
if (iRoll==95)
|
||||
if (iRoll >= 98)
|
||||
{
|
||||
DelayCommand(0.2, HasteImbue(oItem));
|
||||
iQual+=2;
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////// Lvls 11-20 ::Ranged::
|
||||
////////////////////////////////////////// Lvls 11-20 ::Ranged::
|
||||
|
||||
if (iRange==3)
|
||||
{
|
||||
@@ -4876,7 +4872,7 @@ void DropWeapon (object oMob, object oSack, int iRange, int SockChance, int iChe
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////// Lvls 20-30 ::Ranged::
|
||||
////////////////////////////////////////// Lvls 20-30 ::Ranged::
|
||||
|
||||
if (iRange==4)
|
||||
{
|
||||
@@ -5409,7 +5405,15 @@ void DropWeapon (object oMob, object oSack, int iRange, int SockChance, int iChe
|
||||
|
||||
//:: Enhancement bonus
|
||||
DelayCommand(0.2, WeapEnhance(oItem, iRange));
|
||||
++iQual;
|
||||
|
||||
switch (iRange)
|
||||
{
|
||||
case 1: iQual+=1;
|
||||
case 2: iQual+=1;
|
||||
case 3: iQual+=2;
|
||||
case 4: iQual+=2;
|
||||
case 5: iQual+=3;
|
||||
}
|
||||
|
||||
////////////////////////////////////////// Lvls 6-10 ::Melee::
|
||||
|
||||
@@ -5901,42 +5905,35 @@ void DropAmmo (object oMob, object oSack, int iRange)
|
||||
{
|
||||
object oItem;
|
||||
string sType, sName, sIName;
|
||||
int iRoll = d4();
|
||||
int iRoll = d3();
|
||||
int iQual;
|
||||
int iStack = d10()*9;
|
||||
int iStack = d12()*5;
|
||||
|
||||
switch(iRoll)
|
||||
{
|
||||
//:: Ammo
|
||||
case 1: {sType = "sdarrow"; iRoll = d3();
|
||||
if (iRoll==1)sIName = "Arrow";
|
||||
if (iRoll==2)sIName = "Steel Arrow";
|
||||
if (iRoll==3)sIName = "Wind Cutter";}
|
||||
if (iRoll==2)sIName = "Sagitta";
|
||||
if (iRoll==3)sIName = "War Arrow";}
|
||||
break;
|
||||
case 2: {sType = "sdbolt"; iRoll = d3();
|
||||
if (iRoll==1)sIName = "Bolt";
|
||||
if (iRoll==2)sIName = "Deathpin";
|
||||
if (iRoll==3)sIName = "Air Lance";}
|
||||
if (iRoll==2)sIName = "Shaft";
|
||||
if (iRoll==3)sIName = "Quarrel";}
|
||||
break;
|
||||
case 3: {sType = "sdarrow"; iRoll = d3();
|
||||
if (iRoll==1)sIName = "Air Assassin";
|
||||
if (iRoll==2)sIName = "Pegasus Horn";
|
||||
if (iRoll==3)sIName = "Blood Seeker";}
|
||||
break;
|
||||
case 4: {sType = "sdbolt"; iRoll = d3();
|
||||
if (iRoll==1)sIName = "Steel Bolt";
|
||||
if (iRoll==2)sIName = "Stinger";
|
||||
if (iRoll==3)sIName = "Blood Sparrow";}
|
||||
case 3: {sType = "sdbullet"; iRoll = d3();
|
||||
if (iRoll==1)sIName = "Bullet";
|
||||
if (iRoll==2)sIName = "Slug";
|
||||
if (iRoll==3)sIName = "Stone";}
|
||||
break;
|
||||
}
|
||||
|
||||
oItem = CreateItemOnObject(sType, oSack, iStack);
|
||||
|
||||
|
||||
//:: Ammo
|
||||
|
||||
iRoll = d100();
|
||||
if (iRoll<=10) // 10% chance of worn item ::Ammo::
|
||||
if (iRoll <= 10) // 10% chance of worn item ::Ammo::
|
||||
{
|
||||
sName = ColorString("Worn "+sIName, 192, 192, 192);
|
||||
SetName(oItem, sName);
|
||||
@@ -5947,7 +5944,14 @@ void DropAmmo (object oMob, object oSack, int iRange)
|
||||
|
||||
//////////////////////////////////////////// Lvls 1-5 ::Ammo::
|
||||
|
||||
if (iRange==1)
|
||||
{
|
||||
//:: Damage bonus
|
||||
DelayCommand(0.2, DamageTypeImbue(oItem, iRange));
|
||||
++iQual;
|
||||
|
||||
//++iQual; // Debugging
|
||||
}
|
||||
|
||||
////////////////////////////////////////// Lvls 6-10 ::Ammo::
|
||||
|
||||
@@ -6609,17 +6613,21 @@ void DropEpicSpellBook(object oMob, object oSack)
|
||||
|
||||
void sd_droploot (object oMob, object oSack)
|
||||
{
|
||||
object oPC = GetLastKiller();
|
||||
effect eVFX = EffectVisualEffect(VFX_IMP_REMOVE_CONDITION);
|
||||
effect eDust = EffectVisualEffect(VFX_IMP_DUST_EXPLOSION);
|
||||
effect eLink = EffectLinkEffects(eVFX, eDust);
|
||||
object oKiller = GetLastKiller();
|
||||
//effect eVFX = EffectVisualEffect(VFX_IMP_REMOVE_CONDITION);
|
||||
//effect eDust = EffectVisualEffect(VFX_IMP_DUST_EXPLOSION);
|
||||
effect eLink /* = EffectLinkEffects(eVFX, eDust) */;
|
||||
|
||||
// no loot if killed in stonewatch
|
||||
// no loot if spawned in Ascension
|
||||
// chances are it was an uber guard
|
||||
// and not the PC that did the killing.
|
||||
// This is to prevent easy looting higher mobs
|
||||
|
||||
if (GetTag(GetArea(oMob))=="Stonewatch")return;
|
||||
if (GetTag(GetArea(oMob))=="TownofAscension") return;
|
||||
|
||||
if (GetTag(GetArea(oMob))=="TrespassersTavern") return;
|
||||
|
||||
if (GetClassByPosition(1, oMob) == CLASS_TYPE_COMMONER) return;
|
||||
|
||||
// animals dont usually carry wares - but you can skin em!
|
||||
// This is to prevent tiny rats dropping full plate mail - can't have that!
|
||||
@@ -6639,10 +6647,10 @@ void sd_droploot (object oMob, object oSack)
|
||||
if (iDiff==2)lMod = DROP_RATE;
|
||||
|
||||
// Make monk gloves a rare drop except when the player is a lvl 5+ monk
|
||||
if (GetHasFeat(FEAT_SUPERIOR_UNARMED_STRIKE, oPC)) mMod = 4;
|
||||
if (GetHasFeat(FEAT_SUPERIOR_UNARMED_STRIKE, oKiller)) mMod = 4;
|
||||
|
||||
if (GetLevelByClass(CLASS_TYPE_MONK, oPC)>5||
|
||||
GetLevelByClass(CLASS_TYPE_MONK, GetMaster(oPC))>5)mMod = 8;
|
||||
if (GetLevelByClass(CLASS_TYPE_MONK, oKiller)>5||
|
||||
GetLevelByClass(CLASS_TYPE_MONK, GetMaster(oKiller))>5)mMod = 8;
|
||||
|
||||
else mMod=lMod-1;
|
||||
|
||||
@@ -6656,7 +6664,7 @@ void sd_droploot (object oMob, object oSack)
|
||||
int MItemChance = 1; // % chance to drop a magic item
|
||||
int RodWandChance = 1; // % chance to drop a wand/rod item
|
||||
int AmmoChance = 1; // % chance to drop a bolt or an arrow
|
||||
int GoldChance = 8; // % chance to drop some gold
|
||||
int GoldChance = 0; // % chance to drop some gold
|
||||
int PotChance = 1; // % chance to drop a potion
|
||||
int ScrollChance = 1; // % chance to drop a magic scroll
|
||||
int GemChance = lMod; // % chance to drop a socket gem
|
||||
@@ -6714,7 +6722,7 @@ void sd_droploot (object oMob, object oSack)
|
||||
}
|
||||
if (iDice<GoldChance+1)
|
||||
{
|
||||
FloatingTextStringOnCreature("Your defeated foe has dropped gold!", oPC);
|
||||
FloatingTextStringOnCreature("Your defeated foe has dropped gold!", oKiller);
|
||||
}
|
||||
if (iDice<GoldChance+1)
|
||||
{
|
||||
@@ -6729,7 +6737,7 @@ void sd_droploot (object oMob, object oSack)
|
||||
}
|
||||
if (iDice<RodWandChance+1)
|
||||
{
|
||||
FloatingTextStringOnCreature("Your defeated foe has dropped a wand!", oPC);
|
||||
FloatingTextStringOnCreature("Your defeated foe has dropped a wand!", oKiller);
|
||||
}
|
||||
if (iDice<RodWandChance+1)
|
||||
{
|
||||
@@ -6745,29 +6753,29 @@ void sd_droploot (object oMob, object oSack)
|
||||
if (iDice < WeapChance+1)
|
||||
{
|
||||
DropWeapon(oMob, oSack, iRange, SockChance, DamBroke);
|
||||
FloatingTextStringOnCreature("Your defeated foe has dropped a weapon!", oPC);
|
||||
FloatingTextStringOnCreature("Your defeated foe has dropped a weapon!", oKiller);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eLink, GetLocation(oSack));
|
||||
}
|
||||
|
||||
//:: Monk Gloves Roll
|
||||
iDice = d100();
|
||||
if (iDice<MonkChance+1)
|
||||
if (iDice<MonkChance + 1)
|
||||
{
|
||||
DropMonkGloves(oMob, oSack, iRange, SockChance, DamBroke);
|
||||
FloatingTextStringOnCreature("Your defeated foe has dropped gloves!", oPC);
|
||||
FloatingTextStringOnCreature("Your defeated foe has dropped gloves!", oKiller);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eLink, GetLocation(oSack));
|
||||
}
|
||||
|
||||
//:: Armor or shield Roll
|
||||
iDice = d100();
|
||||
if (iDice < ArmorChance+1)
|
||||
if (iDice < ArmorChance + 1)
|
||||
{
|
||||
iDice = d100();
|
||||
if (iDice>59)DropShield(oMob, oSack, iRange, SockChance, DamBroke);
|
||||
else DropArmor(oMob, oSack, iRange, SockChance, DamBroke);
|
||||
if (iDice<ArmorChance+1) FloatingTextStringOnCreature("Your defeated foe has dropped armor!", oPC);
|
||||
if (iDice<ArmorChance+1) FloatingTextStringOnCreature("Your defeated foe has dropped armor!", oKiller);
|
||||
if (iDice<ArmorChance+1) ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eLink, GetLocation(oSack));
|
||||
if (iDice>59) FloatingTextStringOnCreature("Your defeated foe has dropped armour!", oPC);
|
||||
if (iDice>59) FloatingTextStringOnCreature("Your defeated foe has dropped armour!", oKiller);
|
||||
if (iDice>59) ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eLink, GetLocation(oSack));
|
||||
}
|
||||
|
||||
@@ -6776,7 +6784,7 @@ void sd_droploot (object oMob, object oSack)
|
||||
if (iDice < MItemChance + 1)
|
||||
{
|
||||
DropMagicItem(oMob, oSack, iRange, SockChance, DamBroke);
|
||||
FloatingTextStringOnCreature("Your defeated foe has dropped a magic item!", oPC);
|
||||
FloatingTextStringOnCreature("Your defeated foe has dropped a magic item!", oKiller);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eLink, GetLocation(oSack));
|
||||
}
|
||||
|
||||
@@ -6785,7 +6793,7 @@ void sd_droploot (object oMob, object oSack)
|
||||
if (iDice < MiscChance + 1)
|
||||
{
|
||||
DropMisc(oMob, oSack);
|
||||
FloatingTextStringOnCreature("Your defeated foe has dropped an artifact!", oPC);
|
||||
FloatingTextStringOnCreature("Your defeated foe has dropped an artifact!", oKiller);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eLink, GetLocation(oSack));
|
||||
}
|
||||
|
||||
@@ -6794,7 +6802,7 @@ void sd_droploot (object oMob, object oSack)
|
||||
if (iDice < AmmoChance + 1)
|
||||
{
|
||||
DropAmmo(oMob, oSack, iRange);
|
||||
FloatingTextStringOnCreature("Your defeated foe has dropped ranged ammunition!", oPC);
|
||||
FloatingTextStringOnCreature("Your defeated foe has dropped ranged ammunition!", oKiller);
|
||||
}
|
||||
|
||||
//:: Potion Roll
|
||||
@@ -6802,7 +6810,7 @@ void sd_droploot (object oMob, object oSack)
|
||||
if (iDice < PotChance + 1)
|
||||
{
|
||||
DropPotion(oMob, oSack);
|
||||
FloatingTextStringOnCreature("Your defeated foe has dropped a potion!", oPC);
|
||||
FloatingTextStringOnCreature("Your defeated foe has dropped a potion!", oKiller);
|
||||
}
|
||||
|
||||
//:: Scroll Roll
|
||||
@@ -6810,7 +6818,7 @@ void sd_droploot (object oMob, object oSack)
|
||||
if (iDice < ScrollChance + 1)
|
||||
{
|
||||
DropScroll(oMob, oSack, iRange);
|
||||
FloatingTextStringOnCreature("Your defeated foe has dropped a scroll!", oPC);
|
||||
FloatingTextStringOnCreature("Your defeated foe has dropped a scroll!", oKiller);
|
||||
}
|
||||
|
||||
//:: Alchemical Item Roll
|
||||
@@ -6827,7 +6835,7 @@ void sd_droploot (object oMob, object oSack)
|
||||
if (iDice < EpicSpellSeedChance + 1)
|
||||
{
|
||||
DropEpicSpellSeed(oMob, oSack);
|
||||
FloatingTextStringOnCreature("Your defeated foe has dropped an epic spell seed!", oPC);
|
||||
FloatingTextStringOnCreature("Your defeated foe has dropped an epic spell seed!", oKiller);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6838,14 +6846,14 @@ void sd_droploot (object oMob, object oSack)
|
||||
if (iDice < EpicSpellBookChance + 1)
|
||||
{
|
||||
DropEpicSpellBook(oMob, oSack);
|
||||
FloatingTextStringOnCreature("Your defeated foe has dropped an epic spell book!", oPC);
|
||||
FloatingTextStringOnCreature("Your defeated foe has dropped an epic spell book!", oKiller);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sd_dropboss(object oMob, object oSack)
|
||||
{
|
||||
object oPC = GetLastKiller();
|
||||
object oKiller = GetLastKiller();
|
||||
|
||||
//:: Early exit if mob is killed in Stonewatch to prevent looting high-end mobs easily
|
||||
if (GetTag(GetArea(oMob)) == "Stonewatch") return;
|
||||
@@ -6860,7 +6868,7 @@ void sd_dropboss(object oMob, object oSack)
|
||||
if(iDiff > 0) lMod = DROP_RATE; // No change needed if not default because all set to same
|
||||
|
||||
//:: Make monk gloves a rare drop unless the player/Master is a lvl 5+ monk
|
||||
if (GetLevelByClass(CLASS_TYPE_MONK, oPC) > 5 || GetLevelByClass(CLASS_TYPE_MONK, GetMaster(oPC)) > 5)
|
||||
if (GetLevelByClass(CLASS_TYPE_MONK, oKiller) > 5 || GetLevelByClass(CLASS_TYPE_MONK, GetMaster(oKiller)) > 5)
|
||||
mMod = 8;
|
||||
else
|
||||
mMod = lMod - 1;
|
||||
@@ -6993,7 +7001,7 @@ void sd_dropboss(object oMob, object oSack)
|
||||
|
||||
void wk_chestloot (object oSack)
|
||||
{
|
||||
object oPC = GetLastUsedBy();
|
||||
object oKiller = GetLastUsedBy();
|
||||
object oMob = GetLastUsedBy();
|
||||
/////////////////////////////////////////
|
||||
//::Droprate config::
|
||||
@@ -7102,7 +7110,7 @@ void wk_chestloot (object oSack)
|
||||
|
||||
void hy_barrelloot (object oSack)
|
||||
{
|
||||
object oPC = GetLastUsedBy();
|
||||
object oKiller = GetLastUsedBy();
|
||||
object oMob = GetLastUsedBy();
|
||||
/////////////////////////////////////////
|
||||
//::Droprate config::
|
||||
@@ -7155,7 +7163,7 @@ void hy_barrelloot (object oSack)
|
||||
|
||||
void hy_bookcaseloot (object oSack)
|
||||
{
|
||||
object oPC = GetLastUsedBy();
|
||||
object oKiller = GetLastUsedBy();
|
||||
object oMob = GetLastUsedBy();
|
||||
/////////////////////////////////////////
|
||||
//::Droprate config::
|
||||
@@ -7199,4 +7207,4 @@ void hy_bookcaseloot (object oSack)
|
||||
|
||||
///////////////////////////
|
||||
//: For test compiling only
|
||||
//:: void main(){}
|
||||
//::void main(){}
|
||||
|
9
_module/nss/skullkeep_badchk.nss
Normal file
9
_module/nss/skullkeep_badchk.nss
Normal file
@@ -0,0 +1,9 @@
|
||||
int StartingConditional()
|
||||
{
|
||||
int skullkeep =GetCampaignInt("SK_Factions", "Skullkeep", GetPCSpeaker());
|
||||
if (skullkeep < -5001)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
|
||||
}
|
Reference in New Issue
Block a user