Initial Commit
Initial Commit
This commit is contained in:
71
_module/nss/craft_plus3.nss
Normal file
71
_module/nss/craft_plus3.nss
Normal file
@@ -0,0 +1,71 @@
|
||||
#include "x2_inc_itemprop"
|
||||
void main()
|
||||
{
|
||||
object oPC = GetPCSpeaker();
|
||||
//Place any items in the main hand or the off-hand in the inventory
|
||||
object oCopied;
|
||||
int nCursed;
|
||||
if (GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oPC) != OBJECT_INVALID)
|
||||
{
|
||||
nCursed = GetItemCursedFlag(GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oPC));
|
||||
oCopied = CopyItem(GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oPC), oPC, TRUE);
|
||||
if (oCopied != OBJECT_INVALID) DestroyObject(GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oPC));
|
||||
if (nCursed == TRUE) SetItemCursedFlag(oCopied, TRUE);
|
||||
nCursed = FALSE;
|
||||
}
|
||||
if (GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC) != OBJECT_INVALID)
|
||||
{
|
||||
nCursed = GetItemCursedFlag(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC));
|
||||
oCopied = CopyItem(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC), oPC, TRUE);
|
||||
if (oCopied != OBJECT_INVALID) DestroyObject(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC));
|
||||
if (nCursed == TRUE) SetItemCursedFlag(oCopied, TRUE);
|
||||
nCursed = FALSE;
|
||||
}
|
||||
//The end of this chunk of code
|
||||
itemproperty ipAdd;
|
||||
|
||||
object oItem = GetFirstItemInInventory(oPC);
|
||||
while (GetIsObjectValid(oItem))
|
||||
{
|
||||
if (GetLocalInt(oItem, "Prototype") == TRUE)
|
||||
{
|
||||
//If the item is a type of ammunition, we can be sure the property in question is extra damage, so apply the correct property
|
||||
//(which is different than a melee weapon's counterpart)
|
||||
if (GetLocalString(oItem, "Type") == "Ammo")
|
||||
{
|
||||
if (GetLocalString(oPC, "Parameter") == "Acid") ipAdd = ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_ACID, 161);
|
||||
if (GetLocalString(oPC, "Parameter") == "Divine") ipAdd = ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_DIVINE, 161);
|
||||
if (GetLocalString(oPC, "Parameter") == "Sonic") ipAdd = ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_SONIC, 161);
|
||||
if (GetLocalString(oPC, "Parameter") == "Fire") ipAdd = ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_FIRE, 161);
|
||||
if (GetLocalString(oPC, "Parameter") == "Cold") ipAdd = ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_COLD, 161);
|
||||
if (GetLocalString(oPC, "Parameter") == "Electrical") ipAdd = ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_ELECTRICAL, 161);
|
||||
if (GetLocalString(oPC, "Parameter") == "Bludgeoning") ipAdd = ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_BLUDGEONING, 161);
|
||||
if (GetLocalString(oPC, "Parameter") == "Piercing") ipAdd = ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_PIERCING, 161);
|
||||
SetLocalInt(oPC, "SubType", GetItemPropertySubType(ipAdd));
|
||||
IPSafeAddItemProperty(oItem, ipAdd);
|
||||
return;
|
||||
}
|
||||
|
||||
//Applying the correct property.
|
||||
if (GetLocalString(oPC, "LastProperty") == "Mighty") ipAdd = ItemPropertyMaxRangeStrengthMod(3);
|
||||
if (GetLocalString(oPC, "LastProperty") == "Critical") ipAdd = ItemPropertyMassiveCritical(IP_CONST_DAMAGEBONUS_3);
|
||||
if (GetLocalString(oPC, "LastProperty") == "Attack") ipAdd = ItemPropertyAttackBonus(3);
|
||||
if (GetLocalString(oPC, "LastProperty") == "Enhancement") ipAdd = ItemPropertyEnhancementBonus(3);
|
||||
if (GetLocalString(oPC, "LastProperty") == "Damage")
|
||||
{
|
||||
if (GetLocalString(oPC, "Parameter") == "Acid") ipAdd = ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_ACID, IP_CONST_DAMAGEBONUS_3);
|
||||
if (GetLocalString(oPC, "Parameter") == "Divine") ipAdd = ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_DIVINE, IP_CONST_DAMAGEBONUS_3);
|
||||
if (GetLocalString(oPC, "Parameter") == "Sonic") ipAdd = ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_SONIC, IP_CONST_DAMAGEBONUS_3);
|
||||
if (GetLocalString(oPC, "Parameter") == "Fire") ipAdd = ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_FIRE, IP_CONST_DAMAGEBONUS_3);
|
||||
if (GetLocalString(oPC, "Parameter") == "Cold") ipAdd = ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_COLD, IP_CONST_DAMAGEBONUS_3);
|
||||
if (GetLocalString(oPC, "Parameter") == "Electrical") ipAdd = ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_ELECTRICAL, IP_CONST_DAMAGEBONUS_3);
|
||||
SetLocalInt(oPC, "SubType", GetItemPropertySubType(ipAdd));
|
||||
}
|
||||
|
||||
IPSafeAddItemProperty(oItem, ipAdd);
|
||||
|
||||
return;
|
||||
}
|
||||
oItem = GetNextItemInInventory(oPC);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user