Author Topic: Can an NPC detect what form the PC has taken...  (Read 476 times)

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Can an NPC detect what form the PC has taken...
« Reply #15 on: July 15, 2011, 11:56:46 pm »


               I just tested the script.  to make sure That it does what I thought it does.  It worked correctly for me.  

It returned true if the PC had any of the goblin appearance types.   It will work for polymoph also.  It does not matter how the appearance was set.
               
               

               
            

Legacy_NullthraB

  • Jr. Member
  • **
  • Posts: 66
  • Karma: +0/-0
Can an NPC detect what form the PC has taken...
« Reply #16 on: July 16, 2011, 06:38:05 pm »


               One other note: and question
the player can set his appearance many times as he can also take on many new forms. If the set appearance changes many times will only the most current set appearance be the starting condition?
Or will an older set appearance prevent the starting condition from seeing the newest set appearance?

I also need a simple script that checks for a single set appearance type. All are starting conditions for conversations.

thanks everyone,
really need some help with this one.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Can an NPC detect what form the PC has taken...
« Reply #17 on: July 16, 2011, 11:28:50 pm »


               

NullthraB wrote...

One other note: and question
the player can set his appearance many times as he can also take on many new forms. If the set appearance changes many times will only the most current set appearance be the starting condition?
Or will an older set appearance prevent the starting condition from seeing the newest set appearance?

The PC object only has one entree in its structure for the appearance type.  So it does not matter how many times you set the appearance, the GetAppearanceType function will retrive the appearance that the PC is currently using.



I also need a simple script that checks for a single set appearance type. All are starting conditions for conversations.


 int StartingConditional()
{
    int nAppearance = GetAppearanceType(GetPCSpeaker());
    return nAppearance == APPEARANCE_TYPE_GOBLIN_A;
}




for your request to see if a PC is polymorphed you can use this from the statring condition.

#include "nw_i0_generic"
int StartingConditional()
{
    object oPC=GetPCSpeaker();
    return GetHasEffect(EFFECT_TYPE_POLYMORPH,oPC);
}
               
               

               
            

Legacy_NullthraB

  • Jr. Member
  • **
  • Posts: 66
  • Karma: +0/-0
Can an NPC detect what form the PC has taken...
« Reply #18 on: July 18, 2011, 11:53:44 am »


               hello,
okay I'm getting very close to getting the scripts I need thanks to the help from Lightfoo8

This one works the way I need to check for a single appearance. Thank you.

Now could you please add two more Appearance Types to this script so it returns true if the player has any three of these appearances types currently set.
//Add two more App Types
int StartingConditional()
{
   int nAppearance = GetAppearanceType(GetPCSpeaker());
   return nAppearance == APPEARANCE_TYPE_GOBLIN_A;
}




I need this one to check for a specific polymorph type. Say giant spider for the single starting condition.  Then I need another script to check for a group (three) polymorph types.

#include "nw_i0_generic"
int StartingConditional()
{
   object oPC=GetPCSpeaker();
   return GetHasEffect(EFFECT_TYPE_POLYMORPH,oPC);
}

After that I'll have what I need.

Thank you again for all the work.
NB
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Can an NPC detect what form the PC has taken...
« Reply #19 on: July 18, 2011, 05:16:19 pm »


               For the first part:

int StartingConditional()
{
    int nAppearance = GetAppearanceType(GetPCSpeaker());
    if (nAppearance == APPEARANCE_TYPE_GOBLIN_A ||
        nAppearance == APPEARANCE_TYPE_GOBLIN_B ||
        nAppearance == APPEARANCE_TYPE_GOBLIN_CHIEF_A) return TRUE;
    else return FALSE;
}

You can put whatever appearances you want to check for in the above.

As far as your second question gos, I'm not sure if you are understanding that when anyone is polymorphed thier "appearance" gets changed as well, so all you have to do is check for appearance like you did above (Unless of course you want it to check to make sure that the player got its current appearance only because they polymorphed):

int StartingConditional()
{
    int nAppearance = GetAppearanceType(GetPCSpeaker());
    if (nAppearance == APPEARANCE_TYPE_SPIDER_GIANT) return TRUE;
    else return FALSE;
}

Hope it helps.
               
               

               
            

Legacy_NullthraB

  • Jr. Member
  • **
  • Posts: 66
  • Karma: +0/-0
Can an NPC detect what form the PC has taken...
« Reply #20 on: July 19, 2011, 07:29:10 pm »


               hello,
okay, I was confused on polymorph appearances being used in the same way as set appearance.
Thank you.
The Scripts are working fine now.
Thanks everyone,
nb