HiddenTradition_PRC8/_module/nss/bela_teletopart.nss
2024-06-20 15:47:42 -04:00

34 lines
1.0 KiB
Plaintext

#include "mw_teleport_inc"
void main()
{
object oPC,
oLeader;
int iTime;
oPC = GetPCSpeaker();
oLeader = GetFactionLeader(oPC);
if (oLeader == oPC)
{
/*
if the requester is the party leader, cycle through everyone in the
party, teleporting to the first one found
*/
/* if you want to allow only teleport to party leader cut until ...*/
oLeader = GetFirstFactionMember(oPC, TRUE);
while (GetIsObjectValid(oLeader) && oLeader == oPC)
{
oLeader = GetNextFactionMember(oPC, TRUE);
}
if (oLeader == OBJECT_INVALID)
{
/* cut until here for party leader only */
AssignCommand(OBJECT_SELF, ActionSpeakString("You are the only member in your party!"));
return;
} /*this would be removed too */
}
iTime = GetHitDice(oPC);
TakeGoldFromCreature(iTime*50, oPC, TRUE);
if (oLeader != oPC)
mw_TeleportWithEffects(oPC, oLeader, IntToFloat(iTime));
}