Initial Commit
Initial Commit [v1.01]
This commit is contained in:
37
_module/nss/amonsblessing.nss
Normal file
37
_module/nss/amonsblessing.nss
Normal file
@@ -0,0 +1,37 @@
|
||||
void ApplyAdditionalHP(object oPC, int iAmount, float fDuration)
|
||||
{
|
||||
effect eHP;
|
||||
eHP=GetFirstEffect(oPC);
|
||||
while(GetIsEffectValid(eHP))
|
||||
{
|
||||
if(GetEffectType(eHP)==EFFECT_TYPE_TEMPORARY_HITPOINTS)
|
||||
{
|
||||
RemoveEffect(oPC, eHP);
|
||||
SendMessageToPC(oPC, "Removing Existing HP Buff");
|
||||
}
|
||||
eHP=GetNextEffect(oPC);
|
||||
}
|
||||
|
||||
eHP=EffectTemporaryHitpoints(iAmount);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eHP, oPC, fDuration);
|
||||
eHP=EffectVisualEffect(VFX_IMP_HOLY_AID);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eHP, oPC, fDuration);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC = GetItemActivator();
|
||||
object oItemToTake1 = GetItemPossessedBy(oPC, "Diamond");
|
||||
if(GetIsObjectValid(GetItemPossessedBy(oPC, "Diamond")))
|
||||
{
|
||||
if (GetItemStackSize(oItemToTake1) > 1)
|
||||
{
|
||||
SetItemStackSize(oItemToTake1, GetItemStackSize(oItemToTake1)-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
DestroyObject(oItemToTake1);
|
||||
}
|
||||
ApplyAdditionalHP(oPC, 1000, 3600.0);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user