53 lines
1.6 KiB
Plaintext
53 lines
1.6 KiB
Plaintext
#include "prc_class_const"
|
|
|
|
void main()
|
|
{
|
|
object oPC = GetItemActivator();
|
|
object oTarget = GetItemActivatedTarget();
|
|
int iRogue = GetLevelByClass(CLASS_TYPE_ROGUE, oPC)
|
|
+ GetLevelByClass(CLASS_TYPE_SCOUT, oPC)
|
|
+ GetLevelByClass(CLASS_TYPE_NINJA, oPC)
|
|
+ GetLevelByClass(CLASS_TYPE_FACTOTUM, oPC)
|
|
+ GetLevelByClass(CLASS_TYPE_PSYCHIC_ROGUE, oPC);
|
|
location lLocation = GetLocation(oPC);
|
|
int nDiceRoll = d100(1);
|
|
int iMult = iRogue / 4 - 1;
|
|
int nDamage = d100(1)* iMult;
|
|
|
|
|
|
string sRandom = IntToString(nDamage);
|
|
string sTag2 = GetName(oPC);
|
|
string sTag1 = (GetStringRight(sTag2, 1)+ sRandom);
|
|
SetLocalString(oPC, "sPearlBomb", sTag1);
|
|
|
|
if (iRogue >= 5)
|
|
{
|
|
if (GetTag(oTarget) == "Pearl")
|
|
{
|
|
DestroyObject(GetObjectByTag(sTag1));
|
|
CreateObject(OBJECT_TYPE_PLACEABLE, "PearlBomb", lLocation, FALSE, sTag1);
|
|
CreateObject(OBJECT_TYPE_PLACEABLE, "pb_smoke", lLocation, FALSE);
|
|
object oItemToTake1;
|
|
oItemToTake1 = GetItemPossessedBy(oPC, GetTag(oTarget));
|
|
if (GetItemStackSize(oItemToTake1) > 1)
|
|
{
|
|
SetItemStackSize(oItemToTake1, GetItemStackSize(oItemToTake1)-1);
|
|
}
|
|
else
|
|
{
|
|
DestroyObject(oItemToTake1);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
SendMessageToPC(oPC, "You must target a Cut Pearl in your inventory.");
|
|
}
|
|
|
|
}
|
|
else
|
|
{
|
|
SendMessageToPC(oPC, "Only a Rogue of 5 or more seasons may use this device.");
|
|
}
|
|
}
|
|
|