Rune_PRC8/_module/nss/opw_inc_jump.nss
Jaysyn904 d1c309ae63 Initial commit
Initial commit
2024-09-13 09:10:39 -04:00

77 lines
2.0 KiB
Plaintext

////////////////////////////////////////////////////////////////////////////////
// Olander's Jumping and Climbing
// opw_inc_jump
// By Don Anderson
// dandersonru@msn.com
//
////////////////////////////////////////////////////////////////////////////////
#include "x0_i0_assoc"
void JumpAssociates(object oPC)
{
location lLoc = GetLocation(oPC);
int nNth = 1;
object oHench = GetHenchman(oPC, nNth);
object oFam = GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oPC);
if(GetIsObjectValid(oFam))
{
if(!GetAssociateState(NW_ASC_MODE_STAND_GROUND, oFam))
{
AssignCommand(oFam, JumpToLocation(lLoc));
}
}
object oAni = GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oPC);
if(GetIsObjectValid(oAni))
{
if(!GetAssociateState(NW_ASC_MODE_STAND_GROUND, oAni))
{
AssignCommand(oAni, JumpToLocation(lLoc));
}
}
object oSum = GetAssociate(ASSOCIATE_TYPE_SUMMONED, oPC);
if(GetIsObjectValid(oSum))
{
if(!GetAssociateState(NW_ASC_MODE_STAND_GROUND, oSum))
{
AssignCommand(oSum, JumpToLocation(lLoc));
}
}
object oDom = GetAssociate(ASSOCIATE_TYPE_DOMINATED, oPC);
if(GetIsObjectValid(oDom))
{
if(!GetAssociateState(NW_ASC_MODE_STAND_GROUND, oDom))
{
AssignCommand(oDom, JumpToLocation(lLoc));
}
}
while(oHench != OBJECT_INVALID)
{
if(!GetAssociateState(NW_ASC_MODE_STAND_GROUND, oHench))
{
AssignCommand(oHench, JumpToLocation(lLoc));
object oFam = GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oHench);
if(GetIsObjectValid(oFam)) AssignCommand(oFam, JumpToLocation(lLoc));
object oAni = GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oHench);
if(GetIsObjectValid(oAni)) AssignCommand(oAni, JumpToLocation(lLoc));
object oSum = GetAssociate(ASSOCIATE_TYPE_SUMMONED, oHench);
if(GetIsObjectValid(oSum)) AssignCommand(oSum, JumpToLocation(lLoc));
object oDom = GetAssociate(ASSOCIATE_TYPE_DOMINATED, oPC);
if(GetIsObjectValid(oDom)) AssignCommand(oDom, JumpToLocation(lLoc));
}
oHench = GetHenchman(oPC, nNth++);
}
}
//void main(){}