Amon_PRC8/_module/nss/rangerquiver.nss
Jaysyn904 c5cffc37af Initial Commit
Initial Commit [v1.01]
2025-04-03 19:00:46 -04:00

99 lines
3.8 KiB
Plaintext

void main()
{
object oPC = GetItemActivator();
object oTarget = GetItemActivatedTarget();
location lLocation = GetLocation(oPC);
effect eEffect1 = EffectVisualEffect(VFX_DUR_GLOW_RED);
effect eEffect2 = EffectVisualEffect(VFX_IMP_HARM);
if (GetLevelByClass(CLASS_TYPE_RANGER, oPC) >= 1)
{
if (GetTag(oTarget) == "Citrine" || GetTag(oTarget) == "Iolite" || GetTag(oTarget) == "Taulite" || GetTag(oTarget) == "Peridot")
{
if (GetTag(oTarget) == "Citrine")
{
ExecuteScript("lootarrows", oPC);
ExecuteScript("lootarrows", oPC);
ExecuteScript("lootarrows", oPC);
ExecuteScript("lootarrows", oPC);
ExecuteScript("lootarrows", oPC);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eEffect1, lLocation);
DelayCommand(1.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eEffect2, lLocation));
object oItemToTake1;
oItemToTake1 = GetItemPossessedBy(oPC, GetTag(oTarget));
if (GetItemStackSize(oItemToTake1) > 1) {
SetItemStackSize(oItemToTake1, GetItemStackSize(oItemToTake1)-1);
}
else
{
DestroyObject(oItemToTake1);
}
}
if (GetTag(oTarget) == "Iolite")
{
ExecuteScript("lootarrows", oPC);
ExecuteScript("lootarrows", oPC);
ExecuteScript("lootarrows", oPC);
ExecuteScript("lootarrows", oPC);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eEffect1, lLocation);
DelayCommand(1.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eEffect2, lLocation));
object oItemToTake1;
oItemToTake1 = GetItemPossessedBy(oPC, GetTag(oTarget));
if (GetItemStackSize(oItemToTake1) > 1) {
SetItemStackSize(oItemToTake1, GetItemStackSize(oItemToTake1)-1);
}
else
{
DestroyObject(oItemToTake1);
}
}
if (GetTag(oTarget) == "Taulite")
{
ExecuteScript("lootarrows", oPC);
ExecuteScript("lootarrows", oPC);
ExecuteScript("lootarrows", oPC);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eEffect1, lLocation);
DelayCommand(1.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eEffect2, lLocation));
object oItemToTake1;
oItemToTake1 = GetItemPossessedBy(oPC, GetTag(oTarget));
if (GetItemStackSize(oItemToTake1) > 1) {
SetItemStackSize(oItemToTake1, GetItemStackSize(oItemToTake1)-1);
}
else
{
DestroyObject(oItemToTake1);
}
}
if (GetTag(oTarget) == "Peridot")
{
ExecuteScript("lootarrows", oPC);
ExecuteScript("lootarrows", oPC);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eEffect1, lLocation);
DelayCommand(1.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eEffect2, lLocation));
object oItemToTake1;
oItemToTake1 = GetItemPossessedBy(oPC, GetTag(oTarget));
if (GetItemStackSize(oItemToTake1) > 1) {
SetItemStackSize(oItemToTake1, GetItemStackSize(oItemToTake1)-1);
}
else
{
DestroyObject(oItemToTake1);
}
}
}
else
{
SendMessageToPC(oPC, "Only Peridot, Taulite, Iolite, and Citrine work with the quiver.");
}
}
else
{
SendMessageToPC(oPC, "Only a Ranger may use this object.");
}
}