view NPC.h @ 291:0ea5fbd16edb

NPC mostly done
author Gloval
date Tue, 19 Feb 2013 00:34:15 +0400
parents f1218b9d67f1
children 95be2dcecadf
line wrap: on
line source

#pragma once


struct NPCTopic
{
  const char *pTopic;
  const char *pText;
};

extern NPCTopic pNPCTopics[789];


/*  136 */
#pragma pack(push, 1)
struct NPCData  //4Ch
{
  inline bool Hired() {return uFlags & 0x80;}

  char *pName;  //0
  unsigned int uPortraitID;  //4
  unsigned int uFlags;     //8    // & 0x80    no greeting on dialogue start; looks like hired
  int fame;  //c
  int rep;  //10
  unsigned int Location2D;  //14
  unsigned int uProfession; //18
  int greet;  //1c
  int joins;  //20
  int field_24;
  unsigned int evt_A; //28
  unsigned int evt_B; //2c evtb
  unsigned int evt_C; //  30 evtc
  unsigned int evt_D;  //34
  unsigned int evt_E;  //38
  unsigned int evt_F;  //3c
  unsigned int uSex;  //40
  int bHasUsedTheAbility; //44
  int news_topic;  //48
};
#pragma pack(pop)


/*  138 */
#pragma pack(push, 1)
struct NPCProfession
{
  unsigned int uHirePrice;
  char *pBenefits;
  char *pActionText;
  char *pJoinText;
  char *pDismissText;
};
#pragma pack(pop)


/*  139 */
#pragma pack(push, 1)
struct NPCProfessionChance
{
  unsigned int uTotalprofChance;  //summ 
  char professionChancePerArea[60]; //prof position
};
#pragma pack(pop)

/*  140 */
#pragma pack(push, 1)
struct NPCGreeting
{
  char *pGreeting1;
  char *pGreeting2;
};
#pragma pack(pop)


/*  137 */
#pragma pack(push, 1)
struct NPCStats
{
  inline NPCStats():
    pNPCTextTXT_Raw(nullptr), pNPCTopicTXT_Raw(nullptr), pNPCDistTXT_Raw(nullptr)
  {
    uNumNPCNames[0] = uNumNPCNames[1] = 0;
  }

  void InitializeNPCText();
  void InitializeNPCData();
  void Initialize();
  void Release();
  void InitializeAdditionalNPCs(NPCData *pNPCDataBuff, int npc_uid, int uLocation2D, int uMapId);
  void _476C60();

  
  NPCData pNPCData[501]; //0 - 94BCh count from 1 
  NPCData pNewNPCData[501]; //94BCh- 12978h count from 1
  char *pNPCNames[540][2];
  NPCProfession pProfessions[59];  //count from 1
  NPCData pAdditionalNPC[100];
  char *pCatchPhrases[52];  //15CA4h
  char *pNPCUnicNames[500];  //from first batch
  NPCProfessionChance pProfessionChance[77]; //16544h profession chance in each area
  int field_17884;
  int field_17888;
  NPCGreeting pNPCGreetings[205];
  unsigned __int16 pGroups[51];
  unsigned __int16 pGroups_copy[51];
  unsigned int uNewlNPCBufPos;
  unsigned int uNumNewNPCs;
  int field_17FC8;
  unsigned int uNumNPCProfessions;
  unsigned int uNumNPCNames[2]; //0 male 1 female
  char *pNPCDataTXT_Raw;
  char *pNPCNamesTXT_Raw;
  char *pNPCProfTXT_Raw;
  char *pNPCNewsTXT_Raw;
  char *pNPCTopicTXT_Raw;
  char *pNPCTextTXT_Raw;
  char *pNPCDistTXT_Raw;
  char *pNPCGreetTXT_Raw;
  char *pNCPGroupTXT_Raw;
};
#pragma pack(pop)

bool PartyHasDragon();
bool CheckHiredNPCSpeciality(unsigned int uProfession);