Initial module commit
Initial module commit.
This commit is contained in:
51
_module/nss/69_hench_heall.nss
Normal file
51
_module/nss/69_hench_heall.nss
Normal file
@@ -0,0 +1,51 @@
|
||||
//69_hench_heall
|
||||
//Henchman will attempt to heal the most injured in party
|
||||
//Created by: 69MEH69
|
||||
|
||||
#include "nw_i0_generic"
|
||||
|
||||
void main()
|
||||
{
|
||||
ResetHenchmenState();
|
||||
SetCommandable(TRUE, OBJECT_SELF);
|
||||
|
||||
object oTarget = GetFactionMostDamagedMember(OBJECT_SELF);
|
||||
talent tUse;
|
||||
if(GetIsObjectValid(oTarget))
|
||||
{
|
||||
int nCurrent = GetCurrentHitPoints(oTarget);
|
||||
int nBase = GetMaxHitPoints(oTarget);
|
||||
|
||||
if(GetRacialType(oTarget) == RACIAL_TYPE_UNDEAD)
|
||||
{
|
||||
if(nCurrent < nBase && !GetIsDead(oTarget))
|
||||
{
|
||||
tUse = GetCreatureTalentBest(TALENT_CATEGORY_HARMFUL_TOUCH, TALENT_ANY);
|
||||
if(GetIsTalentValid(tUse))
|
||||
{
|
||||
ClearAllActions();
|
||||
ActionUseTalentOnObject(tUse, oTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(GetRacialType(oTarget) != RACIAL_TYPE_UNDEAD)
|
||||
{
|
||||
if(nCurrent < nBase && !GetIsDead(oTarget))
|
||||
{
|
||||
tUse = GetCreatureTalentBest(TALENT_CATEGORY_BENEFICIAL_HEALING_TOUCH, TALENT_ANY);
|
||||
if(GetIsTalentValid(tUse))
|
||||
{
|
||||
ClearAllActions();
|
||||
ActionUseTalentOnObject(tUse, oTarget);
|
||||
}
|
||||
else
|
||||
{
|
||||
ActionSpeakString("I'm out of healing spells.", TALKVOLUME_TALK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
ActionSpeakString("Everyone seems to be in good health.", TALKVOLUME_TALK);
|
||||
}
|
Reference in New Issue
Block a user