User Tools

Site Tools


features:sinfar_supporter_housing:npc_appearance

This is an old revision of the document!


NPC Appearance

Resources :

npc_playerhouse_resources.jpg

To spawn an NPC in your house you'll need :

1: A NPC.

npc_playerhouse_npc.jpg

2: An armor/cloth in the chest slot of that NPC.

npc_playerhouse_cloths1.jpg

3: The On_Spawn script : p_cf2_npc_spawn in the NPC On_Spawn slot or make your own and use the following code in your own script.

npc_playerhouse_npc_script.jpg

#include “inc_appr”

void main() {

  string sBodyAppearance = GetLocalString(OBJECT_SELF, "P_BODY_APPEARANCE");
  string sArmorAppearance = GetLocalString(OBJECT_SELF, "P_ARMOR_APPEARANCE");
  string sHeadAppearance = GetLocalString(OBJECT_SELF,"P_HEAD_APPEARANCE");
  object oArmor = GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF);
  int iOrginalAC = GetItemAC(oArmor);
  
  if (sBodyAppearance != "")
      {
      SetEntireCreatureAppearance(OBJECT_SELF, sBodyAppearance);
      }
  if(sArmorAppearance!=""&&GetIsObjectValid(oArmor))
      {
      RestoreItemAppearance(oArmor, sArmorAppearance);    
      object oNewArmor = UpdateItemAppr(oArmor);
      if(GetItemAC(oNewArmor)!=iOrginalAC)
          {
          SetItemAC(oNewArmor, iOrginalAC);
          }
      } 
  if(sHeadAppearance!="")
      {
      SetHeadItemOverrideString(OBJECT_SELF,sHeadAppearance);
      }   

}


4: The Variables.

authpdo: Statement did not return 'mail' attribute [auth.php:522]
features/sinfar_supporter_housing/npc_appearance.1563633446.txt.gz · Last modified: 2019/07/20 14:37 by spankitty

phpBB Appliance - Powered by TurnKey Linux