AOC_PRC8/_module/nss/copy_item2.nss
Jaysyn904 5e558169a0 Initial Commit
Initial Commit
2025-04-03 11:24:16 -04:00

191 lines
6.1 KiB
Plaintext

#include "spawner"
void Dupe(object oItem, location lSelf, object oSelf)
{
CopyObject(oItem, lSelf, oSelf);
}
void main()
{
object oPC = GetLastClosedBy();
int o0 = BASE_ITEM_DWARVENWARAXE;
int o1 = BASE_ITEM_RAPIER;
int o2 = BASE_ITEM_LONGSWORD;
int o3 = BASE_ITEM_BASTARDSWORD;
int o4 = BASE_ITEM_BATTLEAXE;
int o5 = BASE_ITEM_KUKRI;
int o6 = BASE_ITEM_WARHAMMER;
int o7 = BASE_ITEM_SHORTSWORD;
int o8 = BASE_ITEM_KAMA;
int o9 = BASE_ITEM_GREATSWORD;
int o10 = BASE_ITEM_HELMET;
int o11 = BASE_ITEM_BOOTS;
int o12 = BASE_ITEM_BELT;
int o13 = BASE_ITEM_AMULET;
int o14 = BASE_ITEM_RING;
int o15 = BASE_ITEM_CLOAK;
int o16 = BASE_ITEM_ARMOR;
int o17 = BASE_ITEM_BRACER;
int o18 = BASE_ITEM_TOWERSHIELD;
int o19 = BASE_ITEM_GLOVES;
int o20 = BASE_ITEM_LONGBOW;
int o21 = BASE_ITEM_HEAVYCROSSBOW;
int o22 = BASE_ITEM_SHORTBOW;
int o23 = BASE_ITEM_LIGHTCROSSBOW;
int o24 = BASE_ITEM_DOUBLEAXE;
int o25 = BASE_ITEM_TWOBLADEDSWORD;
int o26 = BASE_ITEM_WHIP;
int o27 = BASE_ITEM_SICKLE;
int o28 = BASE_ITEM_SCYTHE;
int o29 = BASE_ITEM_MORNINGSTAR;
int o30 = BASE_ITEM_QUARTERSTAFF;
int o31 = BASE_ITEM_SCIMITAR;
int o32 = BASE_ITEM_SHORTSPEAR;
int o33 = BASE_ITEM_LIGHTFLAIL;
int o34 = BASE_ITEM_HEAVYFLAIL;
int o35 = BASE_ITEM_HALBERD;
int o36 = BASE_ITEM_GREATAXE;
int o37 = BASE_ITEM_KATANA;
int o38 = BASE_ITEM_LIGHTMACE;
int o39 = BASE_ITEM_DIREMACE;
int o40 = BASE_ITEM_DAGGER;
int o41 = BASE_ITEM_BOLT;
int o42 = BASE_ITEM_ARROW;
int iCount = 0;
int oCount = 0;
int oPearl = 0;
int oPcount = 0;
int oNcount = 0;
object oSelf = OBJECT_SELF;
location lSelf = GetLocation(oSelf);
object oItem = GetFirstItemInInventory(oSelf);
while (GetIsObjectValid(oItem))
{
++iCount;
if ((GetBaseItemType(oItem)==o1)||(GetBaseItemType(oItem)==o1)||
(GetBaseItemType(oItem)==o1)||(GetBaseItemType(oItem)==o2)||
(GetBaseItemType(oItem)==o3)||(GetBaseItemType(oItem)==o4)||
(GetBaseItemType(oItem)==o5)||(GetBaseItemType(oItem)==o6)||
(GetBaseItemType(oItem)==o7)||(GetBaseItemType(oItem)==o8)||
(GetBaseItemType(oItem)==o9)||(GetBaseItemType(oItem)==o10)||
(GetBaseItemType(oItem)==o11)||(GetBaseItemType(oItem)==o12)||
(GetBaseItemType(oItem)==o13)||(GetBaseItemType(oItem)==o0)||
(GetBaseItemType(oItem)==o15)||(GetBaseItemType(oItem)==o16)||
(GetBaseItemType(oItem)==o17)||(GetBaseItemType(oItem)==o18)||
(GetBaseItemType(oItem)==o19)||(GetBaseItemType(oItem)==o20)||
(GetBaseItemType(oItem)==o21)||(GetBaseItemType(oItem)==o22)||
(GetBaseItemType(oItem)==o23)||(GetBaseItemType(oItem)==o24)||
(GetBaseItemType(oItem)==o25)||(GetBaseItemType(oItem)==o26)||
(GetBaseItemType(oItem)==o27)||(GetBaseItemType(oItem)==o28)||
(GetBaseItemType(oItem)==o29)||(GetBaseItemType(oItem)==o30)||
(GetBaseItemType(oItem)==o31)||(GetBaseItemType(oItem)==o32)||
(GetBaseItemType(oItem)==o33)||(GetBaseItemType(oItem)==o34)||
(GetBaseItemType(oItem)==o35)||(GetBaseItemType(oItem)==o36)||
(GetBaseItemType(oItem)==o37)||(GetBaseItemType(oItem)==o38)||
(GetBaseItemType(oItem)==o39)||(GetBaseItemType(oItem)==o40)||
(GetBaseItemType(oItem)==o41)||(GetBaseItemType(oItem)==o42))
{
++oCount;
}
oItem = GetNextItemInInventory(oSelf);
}
if (iCount==1)
{
oItem = GetFirstItemInInventory(OBJECT_SELF);
if ((GetBaseItemType(oItem)==o41)||(GetBaseItemType(oItem)==o42))
{
SetLocked(oSelf, TRUE);
DelayCommand(0.5, Dupe(GetFirstItemInInventory(oSelf), lSelf, oSelf));
PCEffect(0.7, VFX_FNF_DISPEL_GREATER, oSelf);
PCEffect(1.0, VFX_DUR_PIXIEDUST, oSelf);
DelayCommand(3.0, SetLocked(oSelf, FALSE));
return;
}
if (GetTag(oItem)=="coin1")
{
FloatingTextStringOnCreature("You need an item as well.", oPC);
PlaySound("sim_cntresist");
return;
}
else
{
FloatingTextStringOnCreature("You need a Gold Arena Token as well.", oPC);
PlaySound("sim_cntresist");
return;
}
}
if (iCount==0)
{
return;
}
if ((iCount>1)&&(iCount<3))
{
oItem = GetFirstItemInInventory(OBJECT_SELF);
while (GetIsObjectValid(oItem))
{
if (GetTag(oItem)=="coin1")
{
oPearl = 1;
++oPcount;
}
else
{
++oNcount;
}
oItem = GetNextItemInInventory(OBJECT_SELF);
}
if (oNcount==2)
{
FloatingTextStringOnCreature("You can't put two items in the duplicator", oPC);
PlaySound("sim_cntresist");
return;
}
if (oPcount>1)
{
FloatingTextStringOnCreature("You can not use more than one Arena Token", oPC);
PlaySound("sim_cntresist");
return;
}
if (oPearl==1)
{
if (oCount!=0)
{
SetLocked(oSelf, TRUE);
oItem = GetFirstItemInInventory(oSelf);
while (GetIsObjectValid(oItem))
{
if (GetTag(oItem)=="coin1")
{
DestroyObject(oItem);
}
oItem = GetNextItemInInventory(oSelf);
}
DelayCommand(0.5, Dupe(GetFirstItemInInventory(oSelf), lSelf, oSelf));
PCEffect(0.7, VFX_FNF_DISPEL_GREATER, oSelf);
PCEffect(1.0, VFX_DUR_PIXIEDUST, oSelf);
DelayCommand(3.0, SetLocked(oSelf, FALSE));
return;
}
else
{
FloatingTextStringOnCreature("Nice try!", oPC);
PlaySound("sim_cntresist");
return;
}
}
}
else
{
FloatingTextStringOnCreature("This will only work with one item and a gold coin", oPC);
PlaySound("sim_cntresist");
return;
}
}