#include "mk_inc_generic" #include "mk_inc_states" #include "mk_inc_2da_disp" #include "mk_inc_ccoh_db" #include "mk_inc_editor" int MK_DEITY_SearchDeityName(string s2DA, string sDeity, int nMaxRangeOfEmptyRows) { string sColumnLabel = "LABEL"; string sColumnName = "Name"; string sColumnStrRef = "StrRef"; int nLength = MK_Get2DALength(s2DA, sColumnLabel, nMaxRangeOfEmptyRows); int iRow; int nStrRef; string sName; for (iRow=0; iRow racialtype: "+ sRacialTypeColumn); int nAlignmentGoodEvil = GetAlignmentGoodEvil(oPC); int nAlignmentLawChaos = GetAlignmentLawChaos(oPC); string sAlignmentColumn = ""; switch (nAlignmentLawChaos) { case ALIGNMENT_CHAOTIC: sAlignmentColumn = "C"; break; case ALIGNMENT_NEUTRAL: sAlignmentColumn = "N"; break; case ALIGNMENT_LAWFUL: sAlignmentColumn = "L"; break; } switch (nAlignmentGoodEvil) { case ALIGNMENT_GOOD: sAlignmentColumn += "G"; break; case ALIGNMENT_NEUTRAL: if (sAlignmentColumn=="N") { sAlignmentColumn = "TN"; } else { sAlignmentColumn += "N"; } break; case ALIGNMENT_EVIL: sAlignmentColumn += "E"; break; } SetLocalString(oPC, "MK_BODY_DEITY_ALIGNMENT_COLUMN", sAlignmentColumn); MK_DEBUG_TRACE(" > alignment: "+ sAlignmentColumn); int iClass; int nNoAlignmentGenderAdjustment=TRUE; for (iClass=1; iClass<=3; iClass++) { int nClassType = GetClassByPosition(iClass, oPC); switch (nClassType) { case CLASS_TYPE_CLERIC: case CLASS_TYPE_DRUID: case CLASS_TYPE_PALADIN: case CLASS_TYPE_RANGER: SetLocalString(oPC, "MK_BODY_DEITY_CLASS"+IntToString(iClass)+"_COLUMN", Get2DAString("classes", "Label", nClassType)); MK_DEBUG_TRACE(" > class"+IntToString(iClass)+": "+ Get2DAString("classes", "Label", nClassType)); nNoAlignmentGenderAdjustment=FALSE; break; } } SetLocalInt(oPC, "MK_BODY_DEITY_ALIGNMENTGENDER_ADJUST", (nNoAlignmentGenderAdjustment ? 0 : 1)); MK_DEBUG_TRACE(" > adjust: "+IntToString(GetLocalInt(oPC, "MK_BODY_DEITY_ALIGNMENTGENDER_ADJUST"))); string sGenderColumn=""; switch (GetGender(oPC)) { case GENDER_FEMALE: sGenderColumn = "Female"; break; case GENDER_MALE: sGenderColumn = "Male"; break; } SetLocalString(oPC, "MK_BODY_DEITY_GENDER_COLUMN", sGenderColumn); MK_DEBUG_TRACE(" > alignment: "+ sGenderColumn); } int StartingConditional() { object oPC = GetPCSpeaker(); MK_CCOH_DB_Init(oPC); int nState = MK_GenericDialog_GetState(); int nAction = MK_GenericDialog_GetAction(); int nCurrentPage; string s2DA = GetLocalString(oPC, "MK_DEITY_2DAFILE"); if (s2DA == "") s2DA = "mk_deities"; switch (nState) { case MK_STATE_DEITY: nCurrentPage = MK_2DA_DISPLAY_GetCurrentPage(); switch (nAction) { case 250: case 251: case 252: case 253: nCurrentPage = MK_2DA_DISPLAY_UpdatePage(nAction); break; case 100: // pressed OK in the 'edit box' -> get the description { string sText = MK_TrimString(GetLocalString(oPC, g_varEditorBuffer)); int bDisableColors = GetLocalInt(oPC, g_varEditorDisableColors); if (bDisableColors) { // We don't want colors, so lets remove them. // Just in case the user has used the chat line // to enter color tokens. sText = MK_RemoveColorTagsFromString(sText); } else { // We close all color tags in case the user has forgotten // to do so. sText = MK_CloseColorTags(sText); } SetDeity(oPC, sText); // SetLocalString(oPC, "MK_NEWNAME", sText); MK_Editor_CleanUp(oPC); break; } case 101: // pressed Cancel in the 'edit box' MK_Editor_CleanUp(oPC); break; default: if ((nAction>=0) && (nAction