diff --git a/AgentSvc/AgentSvc.h b/AgentSvc/AgentSvc.h old mode 100755 new mode 100644 diff --git a/AgentSvc/AgentSvc.vcxproj b/AgentSvc/AgentSvc.vcxproj index bb0e466..39e3e31 100644 --- a/AgentSvc/AgentSvc.vcxproj +++ b/AgentSvc/AgentSvc.vcxproj @@ -17,7 +17,7 @@ {D6AF1D9D-D4B3-4FEC-8EC3-166406A83AE4} MFCProj - 8.1 + 10.0 @@ -37,7 +37,7 @@ Application Static MultiByte - v140_xp + v142 diff --git a/AgentSvr/AgentSvr.vcxproj b/AgentSvr/AgentSvr.vcxproj index c21caed..a6b5f55 100644 --- a/AgentSvr/AgentSvr.vcxproj +++ b/AgentSvr/AgentSvr.vcxproj @@ -20,7 +20,7 @@ {E1FF5388-2AF5-4789-B5C2-DB40C41916CA} - 8.1 + 10.0 @@ -37,7 +37,7 @@ Application false - v140_xp + v142 MultiByte diff --git a/MessageMaker/MessageMaker.vcxproj b/MessageMaker/MessageMaker.vcxproj index 2efb035..84a57ea 100644 --- a/MessageMaker/MessageMaker.vcxproj +++ b/MessageMaker/MessageMaker.vcxproj @@ -20,13 +20,13 @@ {B67BDCBE-DDF6-4BD2-882D-7C0D4BAB1560} - 8.1 + 10.0 StaticLibrary false - v140_xp + v142 StaticLibrary diff --git a/MessageMaker/MessageMaker.vcxproj.filters b/MessageMaker/MessageMaker.vcxproj.filters index cca5100..35338ad 100644 --- a/MessageMaker/MessageMaker.vcxproj.filters +++ b/MessageMaker/MessageMaker.vcxproj.filters @@ -372,9 +372,6 @@ Header Files - - Header Files - Header Files diff --git a/Underlight/Central.h b/Underlight/Central.h index d742e62..1bc7136 100644 --- a/Underlight/Central.h +++ b/Underlight/Central.h @@ -36,6 +36,7 @@ const int DEAD_Z = _I16_MAX -1; extern TCHAR message[DEFAULT_MESSAGE_SIZE]; extern TCHAR disp_message[DEFAULT_MESSAGE_SIZE]; extern TCHAR temp_message[DEFAULT_MESSAGE_SIZE]; +extern TCHAR temp_message2[DEFAULT_MESSAGE_SIZE]; extern TCHAR duration_message[DEFAULT_MESSAGE_SIZE]; extern TCHAR modifier_message[DEFAULT_MESSAGE_SIZE]; extern TCHAR guild_name_message[DEFAULT_MESSAGE_SIZE]; diff --git a/Underlight/Options.cpp b/Underlight/Options.cpp index b260829..07de4f4 100644 --- a/Underlight/Options.cpp +++ b/Underlight/Options.cpp @@ -449,6 +449,13 @@ cJSON** LoadJSONFiles() } numJsonFiles = fcount; + if (hFind != FindFirstFile("globals.json", &data)) + { + cJSON* globals = WriteGlobalJSONOptionValues(); + WriteJSONFile(globals, "globals.json"); + cJSON_Delete(globals); + } + if (numJsonFiles > MAX_STORED_ACCOUNTS) { GAME_ERROR("Too many JSON files - delete some!"); diff --git a/Underlight/Realm.cpp b/Underlight/Realm.cpp index 05d0347..807e443 100644 --- a/Underlight/Realm.cpp +++ b/Underlight/Realm.cpp @@ -143,6 +143,7 @@ TCHAR message[DEFAULT_MESSAGE_SIZE]; // generic string for output messages TCHAR values_select[100][DEFAULT_MESSAGE_SIZE]; TCHAR disp_message[DEFAULT_MESSAGE_SIZE]; // generic string for output messages TCHAR temp_message[DEFAULT_MESSAGE_SIZE]; // generic string for output messages +TCHAR temp_message2[DEFAULT_MESSAGE_SIZE]; // generic string for output messages TCHAR errbuf[DEFAULT_MESSAGE_SIZE];// generic string for error messages TCHAR duration_message[DEFAULT_MESSAGE_SIZE]; TCHAR modifier_message[DEFAULT_MESSAGE_SIZE]; diff --git a/Underlight/Underlight.vcxproj b/Underlight/Underlight.vcxproj index be326d6..8629d26 100644 --- a/Underlight/Underlight.vcxproj +++ b/Underlight/Underlight.vcxproj @@ -52,7 +52,7 @@ {F427253E-F158-4722-B7E1-27761AE6C921} - 8.1 + 10.0 @@ -109,7 +109,7 @@ Application false - v140_xp + v142 Application diff --git a/Underlight/cArts.cpp b/Underlight/cArts.cpp index 3a13efc..1c2bd00 100644 --- a/Underlight/cArts.cpp +++ b/Underlight/cArts.cpp @@ -2536,7 +2536,7 @@ void cArts::CreateLocalWeapon(int color) break; } } - + actors->IterateItems(DONE); // default duration for this level of blade int duration = this->Duration(art_in_use, player->Skill(art_in_use)); @@ -5526,7 +5526,7 @@ void cArts::ApplyAbjure(int skill, lyra_id_t caster_id) { cNeighbor *n = this->LookUpNeighbor(caster_id); - if (caster_id != player->ID () && n == NO_ACTOR) + if (caster_id != player->ID() && n == NO_ACTOR) return; // MDA 3/18/2004 - bail if the neighbor became NULL between evoke and Apply this->DisplayUsedByOther(n, Arts::ABJURE); @@ -5534,13 +5534,13 @@ void cArts::ApplyAbjure(int skill, lyra_id_t caster_id) int num_effects_active = 0; int num_effects_abjured = 0; int curr_skill = skill; - int random,i,j; - + int random = 0; + int i, j; player->EvokedFX().Activate(Arts::ABJURE, false); for (i=0; iflags & timed_effects->actor_flag[i] && timed_effects->abjurable[i]) - num_effects_active++; + num_effects_active++; // pmares can only have 1 effect abjured at a time #ifndef PMARE @@ -5555,52 +5555,62 @@ void cArts::ApplyAbjure(int skill, lyra_id_t caster_id) } #endif - + while (num_effects_active && num_effects_to_abjure) { - random = rand()%num_effects_active; - j=0; // j = count of active effects skipped by loop - for (i=0; iflags & timed_effects->actor_flag[i]) && timed_effects->abjurable[i]) { if (j == random) // abjure this effect { - LoadString (hInstance, IDS_ABJURED_EFFECT, disp_message, sizeof(disp_message)); - if (caster_id == player->ID()) + const TCHAR* playerName = NULL; + LoadString(hInstance, IDS_ABJURED_EFFECT, disp_message, sizeof(disp_message)); // "You have abjured %s from %s!\n" + if (caster_id == player->ID()) //casting on self { - LoadString(hInstance, IDS_YOURSELF, temp_message, sizeof(temp_message)); + LoadString(hInstance, IDS_YOURSELF, temp_message, sizeof(temp_message)); // "yourself" _stprintf(message, disp_message, timed_effects->name[i], temp_message); - display->DisplayMessage (message); + display->DisplayMessage(message); } - else + else // not casting on self or im being casted on { - _stprintf(message, disp_message, timed_effects->name[i], player->Name()); - gs->Talk(message, RMsg_Speech::SYSTEM_WHISPER, caster_id); - if (n != NO_ACTOR) - { - LoadString(hInstance, IDS_ABJURED_EFFECT_OTHER, disp_message, sizeof(disp_message)); - _stprintf(message, disp_message, n->Name(), timed_effects->name[i]); + + LoadString(hInstance, IDS_FEMALE_DREAMER, temp_message2, sizeof(temp_message2)); // female + LoadString(hInstance, IDS_MALE_DREAMER, temp_message, sizeof(temp_message)); // male + playerName = player->IsDreamerAccount() ? (player->IsPMare() ? player->Name() : (player->IsMale()? temp_message : temp_message2)) : player->Name(); + _stprintf(message, disp_message, timed_effects->name[i], playerName); + gs->Talk(message, RMsg_Speech::SYSTEM_WHISPER, caster_id); //send msg to person it's landing on + + if (n->ID() == caster_id && n != NO_ACTOR)// being casted on! by a real not us dreamer! + { + playerName = n->IsPMare() ? (player->IsMale() ? temp_message : temp_message2) : n->Name(); + LoadString(hInstance, IDS_ABJURED_EFFECT_OTHER, disp_message, sizeof(disp_message)); //"%s has abjured %s from you!\n" + _stprintf(message, disp_message, playerName, timed_effects->name[i]); } - else { + else + { _stprintf(message, "%s has been abjured from you!\n", timed_effects->name[i]); } - - display->DisplayMessage (message); + display->DisplayMessage(message); } - player->RemoveTimedEffect(i); - break; + player->RemoveTimedEffect(i); + break; } else j++; } - num_effects_active--; - num_effects_to_abjure--; - num_effects_abjured++; - if (i == NUM_TIMED_EFFECTS) - { - GAME_ERROR(IDS_ABJURE_FAIL); - return; - } + num_effects_active--; + num_effects_to_abjure--; + num_effects_abjured++; + if (i == NUM_TIMED_EFFECTS) + { + GAME_ERROR(IDS_ABJURE_FAIL); + return; + } + + } if (!num_effects_abjured && (caster_id == player->ID())) diff --git a/Underlight/cChat.cpp b/Underlight/cChat.cpp index 48dfc59..d368c52 100644 --- a/Underlight/cChat.cpp +++ b/Underlight/cChat.cpp @@ -64,6 +64,8 @@ const struct window_pos_t chatPos[MAX_RESOLUTIONS] = const struct window_pos_t entryPos[MAX_RESOLUTIONS] = { { 0, 455, 480, 25 }, { 0, 570, 600, 35 }, { 0, 733, 768, 40 } }; #else +const struct window_pos_t classicChatPos[MAX_RESOLUTIONS] = +{ { 0, 300, 480, 180 },{ 0, 375, 600, 225 },{ 0, 480, 768, 288 } }; //added to fix undeclared ident on pmare const struct window_pos_t chatPos[MAX_RESOLUTIONS] = { { 0, 300, 480, 180 },{ 0, 375, 600, 225 },{ 0, 480, 768, 288 } }; #endif @@ -631,6 +633,15 @@ _stprintf(emoteCF.szFaceName, FONT_NAME); nameCF.crTextColor = (RGB(chat_colors[color].red, chat_colors[color].green, chat_colors[color].blue)); _stprintf(nameCF.szFaceName, FONT_NAME); SendMessage(hwnd_richedit, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&nameCF); + + // lets try this for gm raw and graw ~christy + memset(&raw_grawCF, 0, sizeof(raw_grawCF)); + raw_grawCF.cbSize = sizeof(raw_grawCF); + raw_grawCF.dwMask = CFM_FACE | CFM_ITALIC | CFM_BOLD | CFM_COLOR; + raw_grawCF.dwEffects = CFM_ITALIC | CFM_BOLD; + raw_grawCF.crTextColor = (RGB(chat_colors[color].red, chat_colors[color].green, chat_colors[color].blue)); + _stprintf(raw_grawCF.szFaceName, FONT_NAME); + SendMessage(hwnd_richedit, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&raw_grawCF); } void cChat::SetWhisperFormat(int color) @@ -703,6 +714,11 @@ void cChat::SwitchMode(int mode) SendMessage(hwnd_richedit, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&whisperCF); currMode = WHISPER; break; + + case RAW_GRAW: //added by christy for raw_graw + SendMessage(hwnd_richedit, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&raw_grawCF); + currMode = RAW_GRAW; + break; } currMode = mode; @@ -822,8 +838,9 @@ void cChat::DisplaySpeech(const TCHAR *text, TCHAR *name, int speechType, bool i this->PreDisplay(); // set line counts, offset correctly _tcsnccpy(speech, text, sizeof(speech)); - - if (isEmote) + if (speechType == RMsg_Speech::RAW_EMOTE) //added by christy + this->SwitchMode(RAW_GRAW); + else if (isEmote) this->SwitchMode(EMOTE); else if (speechType == RMsg_Speech::WHISPER) this->SwitchMode(WHISPER); @@ -851,6 +868,11 @@ void cChat::DisplaySpeech(const TCHAR *text, TCHAR *name, int speechType, bool i _stprintf(message, _T(">%s "), name); break; case RMsg_Speech::RAW_EMOTE: + if (speech[0] == '\'') + _stprintf(message, _T(">%s")); + else + _stprintf(message, _T(">%s ")); + break; case RMsg_Speech::DISTRESS_CALL: _stprintf(message, _T("")); break; diff --git a/Underlight/cChat.h b/Underlight/cChat.h index 1a15b1f..bd93399 100644 --- a/Underlight/cChat.h +++ b/Underlight/cChat.h @@ -22,7 +22,7 @@ const int NUM_CHAT_BUTTONS = 4; enum // current paragraph format { - PLAYER_SPEECH, PLAYER_NAME, SYSTEM_MESSAGE, EMOTE, WHISPER + PLAYER_SPEECH, PLAYER_NAME, SYSTEM_MESSAGE, EMOTE, WHISPER, RAW_GRAW }; @@ -49,7 +49,7 @@ class cChat WNDPROC lpfn_richedit, lpfn_entry; // pointer to window procedure HBITMAP chat_buttons_bitmaps[NUM_CHAT_BUTTONS][2]; PARAFORMAT chatPF; // paragraph format - CHARFORMAT speechCF, nameCF, systemCF, emoteCF, whisperCF; // character formats for other player's speech, names, and system messages + CHARFORMAT speechCF, nameCF, systemCF, emoteCF, raw_grawCF, whisperCF; // character formats for other player's speech, names, and system messages, edited by christy to include raw_grawCF cOutput *chatlog; // for logging chat int currMode; // current mode - player speech, system, etc. bool first_message; // has a message been displayed yet? diff --git a/Underlight/cNeighbor.cpp b/Underlight/cNeighbor.cpp index 9edf918..8800340 100644 --- a/Underlight/cNeighbor.cpp +++ b/Underlight/cNeighbor.cpp @@ -701,6 +701,14 @@ bool cNeighbor::IsMale(void) return false; } +// returns true if we're a pmare; based on account type +bool cNeighbor::IsPMare(void) +{ + if (avatar.AvatarType() == LmAvatar::ACCT_PMARE) + return true; + return false; +} + // returns avatar type unsigned int cNeighbor::GetAvatarType(void) { diff --git a/Underlight/cNeighbor.h b/Underlight/cNeighbor.h index c98170c..af16794 100644 --- a/Underlight/cNeighbor.h +++ b/Underlight/cNeighbor.h @@ -148,6 +148,7 @@ class cNeighbor : public cActor bool IsFemale (void); bool IsMale (void); + bool IsPMare(void); bool IsMonster (void); bool IsVulnerable (void); bool CanWhisper(void);