Lankhmar_PRC8/_module/nss/conv_spawn_gryyp.nss
Jaysyn904 ebc0c6a9b2 Initial commit
Initial commit [v9.7]
2025-04-03 12:54:47 -04:00

64 lines
2.1 KiB
Plaintext

#include "nw_i0_generic"
void main()
{
object oTarget;
object oSpawn;
location lTarget;
int nInt;
object oPC = GetPCSpeaker();
oTarget = GetWaypointByTag("WP_Spn_gryyph");
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "gryylph", lTarget);
oTarget = oSpawn;
SetIsTemporaryEnemy(oPC, oTarget);
AssignCommand(oTarget, ActionAttack(oPC));
AssignCommand(oTarget, DetermineCombatRound(oPC));
oTarget = GetObjectByTag("Gryylph");
oTarget = GetWaypointByTag("WP_Spn_gryyph");
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "deathtiger", lTarget);
oTarget = oSpawn;
SetIsTemporaryEnemy(oPC, oTarget);
AssignCommand(oTarget, ActionAttack(oPC));
AssignCommand(oTarget, DetermineCombatRound(oPC));
oTarget = GetObjectByTag("Gryylph");
//Visual effects can't be applied to waypoints, so if it is a WP
//the VFX will be applied to the WP's location instead
nInt = GetObjectType(oTarget);
if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), oTarget);
else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oTarget));
// Remove items from the player's inventory
object oItemToTake;
oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "fingrylp1");
if(GetIsObjectValid(oItemToTake) != 0)
ActionTakeItem(oItemToTake, GetPCSpeaker());
oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "fingrylp2");
if(GetIsObjectValid(oItemToTake) != 0)
ActionTakeItem(oItemToTake, GetPCSpeaker());
oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "fingrylp3");
if(GetIsObjectValid(oItemToTake) != 0)
ActionTakeItem(oItemToTake, GetPCSpeaker());
oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "fingrylp4");
if(GetIsObjectValid(oItemToTake) != 0)
ActionTakeItem(oItemToTake, GetPCSpeaker());
oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "fingrylp5");
if(GetIsObjectValid(oItemToTake) != 0)
ActionTakeItem(oItemToTake, GetPCSpeaker());
DestroyObject(oTarget, 3.0);
}