HorseChangeToDefault

From NWN Lexicon
Revision as of 01:34, 26 August 2012 by Dood (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


HorseChangeToDefault(object)

Change a creature to its standard race appearance.

Parameters

oCreature

The creature to be reset.


Description

This function will set oCreature to its default racial appearance.

This is useful for reversing any situations where a creature or PC is stuck in some variation of a mounted appearance.

This will also clear ANY information stored on the creature relating to mounting.

If the target had a tail when not mounted, this function will not restore it.



Remarks

This can be used to remove a mounted appearance from a PC imported from the server vault.

It may also be useful after cutscenes, and in conjunction with custom mounting and dismounting systems.


Known Bugs

The creature is reset from large to normal phenotype.


Requirements

#include " x3_inc_horse "

Version

1.69

Example

// Example which fixes the phenotype bug
#include "x3_inc_horse"
 
 
void main()
{
  object oPC    = GetPCSpeaker();
  int    nPheno = GetPhenoType(oPC);
  string sPheno = Get2DAString("phenotype", "Label", nPheno);
 
  if(GetStringLeft(sPheno, 1) == "L")
  {
     nPheno = 2; // Large
  }
  else
  {
     nPheno = PHENOTYPE_NORMAL;
  }     
 
  HorseChangeToDefault(oPC);
  SetPhenoType(nPheno, oPC);
}

See Also

functions: 

HorseIfNotDefaultAppearanceChange



author: Proleric, editor: Mistress