PRC8/trunk/smp/0_testinfowand.nss
Jaysyn904 1662218bb4 Initial upload.
Adding base PRC 4.19a files to repository.
2022-10-07 13:51:24 -04:00

39 lines
1.4 KiB
Plaintext

void main()
{
// Display info about the target
object oUser = GetItemActivator();
object oTarget = GetItemActivatedTarget();
string sInfo = "[INFO] [Of: " + GetName(oTarget);
// Get effects
if(GetIsObjectValid(oTarget))
{
sInfo += "] [Tag: " + GetTag(oTarget);
sInfo += "] [CurHP: " + IntToString(GetCurrentHitPoints(oTarget));
sInfo += "] [MaxHP: " + IntToString(GetMaxHitPoints(oTarget));
sInfo += "] [Reputation: " + IntToString(GetReputation(oTarget, oUser));
sInfo += "] [Effects: ";
// Effects
int nAmount = 0;
effect eCheck = GetFirstEffect(oTarget);
while(GetIsEffectValid(eCheck))
{
nAmount++;
// Name creator, spell name and id, duration type, subtype and effect type.
sInfo += "[" + IntToString(nAmount) + ". [Type:" + IntToString(GetEffectType(eCheck)) +
"] [Id:" + IntToString(GetEffectSpellId(eCheck)) +
"] [Name:" + GetStringByStrRef(StringToInt(Get2DAString("Spells", "Name", GetEffectSpellId(eCheck)))) +
"] [Subtype:" + IntToString(GetEffectSubType(eCheck)) +
"] [Duration:" + IntToString(GetEffectDurationType(eCheck)) + "]";
eCheck = GetNextEffect(oTarget);
}
sInfo += "]";
}
// Say it
AssignCommand(oUser, SpeakString(sInfo));
}