Mercurial > mm7
comparison NPC.cpp @ 2380:56f87a5c402b
Merge
author | Grumpy7 |
---|---|
date | Sat, 21 Jun 2014 00:42:34 +0200 |
parents | 802460e60eee |
children | 8cee51ce4382 |
comparison
equal
deleted
inserted
replaced
2379:e07e297f292d | 2380:56f87a5c402b |
---|---|
14 #include "UI\UIHouses.h" | 14 #include "UI\UIHouses.h" |
15 #include "Indoor.h" | 15 #include "Indoor.h" |
16 #include "MapInfo.h" | 16 #include "MapInfo.h" |
17 #include "Level/Decoration.h" | 17 #include "Level/Decoration.h" |
18 #include "Actor.h" | 18 #include "Actor.h" |
19 #include "AudioPlayer.h" | |
20 #include "CastSpellInfo.h" | |
21 #include "Overlays.h" | |
19 | 22 |
20 int pDialogueNPCCount; | 23 int pDialogueNPCCount; |
21 std::array<struct Texture *, 6> pDialogueNPCPortraits; | 24 std::array<struct Texture *, 6> pDialogueNPCPortraits; |
22 int uNumDialogueNPCPortraits; // weak | 25 int uNumDialogueNPCPortraits; // weak |
23 struct NPCStats *pNPCStats = nullptr; | 26 struct NPCStats *pNPCStats = nullptr; |
1888 || a1 == 52 ) | 1891 || a1 == 52 ) |
1889 return pNPCStats->pProfessions[a1 - 1].pActionText; | 1892 return pNPCStats->pProfessions[a1 - 1].pActionText; |
1890 else | 1893 else |
1891 return pNPCTopics[407].pTopic; | 1894 return pNPCTopics[407].pTopic; |
1892 } | 1895 } |
1896 | |
1897 //----- (004BB756) -------------------------------------------------------- | |
1898 int UseNPCSkill(NPCProf profession) | |
1899 { | |
1900 switch (profession) | |
1901 { | |
1902 case Healer: | |
1903 { | |
1904 for (int i = 0; i < 4; ++i) | |
1905 pParty->pPlayers[i].sHealth = pParty->pPlayers[i].GetMaxHealth(); | |
1906 } | |
1907 break; | |
1908 | |
1909 case ExpertHealer: | |
1910 { | |
1911 for (int i = 0; i < 4; ++i) | |
1912 { | |
1913 __debugbreak(); | |
1914 pParty->pPlayers[i].sHealth = pParty->pPlayers[i].GetMaxHealth(); | |
1915 | |
1916 for (int j = 0; j < 14; ++j) | |
1917 pParty->pPlayers[i].pConditions[j] = 0; | |
1918 pParty->pPlayers[i].pConditions[Condition_Good] = 0; | |
1919 } | |
1920 } | |
1921 break; | |
1922 | |
1923 case MasterHealer: | |
1924 { | |
1925 for (int i = 0; i < 4; ++i) | |
1926 { | |
1927 __debugbreak(); //Ritor1:needed cleaned(Необходимо почистить) | |
1928 Player* player = &pParty->pPlayers[i]; | |
1929 pParty->pPlayers[i].sHealth = pParty->pPlayers[i].GetMaxHealth(); | |
1930 | |
1931 int v5 = LODWORD(player->pConditions[19]);//*((int *)v4 - 32); | |
1932 int v6 = HIDWORD(player->pConditions[19]);//*((int *)v4 - 31); | |
1933 memset(&pParty->pPlayers[i].pConditions, 0, sizeof(pParty->pPlayers[i].pConditions)); | |
1934 | |
1935 *(int *)&player->pActiveSkills[PLAYER_SKILL_SHIELD] = v5; | |
1936 *(int *)&player->pActiveSkills[PLAYER_SKILL_CHAIN] = v6; | |
1937 } | |
1938 } | |
1939 break; | |
1940 | |
1941 case Cook://Повар | |
1942 { | |
1943 if (pParty->uNumFoodRations >= 13) | |
1944 return 1; | |
1945 | |
1946 Party::GiveFood(1); | |
1947 } | |
1948 break; | |
1949 | |
1950 case Chef: | |
1951 { | |
1952 if (pParty->uNumFoodRations >= 13) | |
1953 return 1; | |
1954 | |
1955 if (pParty->uNumFoodRations == 13) | |
1956 Party::GiveFood(1); | |
1957 else | |
1958 Party::GiveFood(2); | |
1959 } | |
1960 break; | |
1961 | |
1962 case WindMaster: | |
1963 { | |
1964 if (uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
1965 { | |
1966 ShowStatusBarString(pGlobalTXT_LocalizationStrings[494], 2);//Нельзя применить знание Полет в помещении! | |
1967 pAudioPlayer->PlaySound(SOUND_203, 0, 0, -1, 0, 0, 0, 0); | |
1968 } | |
1969 else | |
1970 { | |
1971 int v19 = pOtherOverlayList->_4418B1(10008, 203, 0, 65536); | |
1972 pParty->pPartyBuffs[PARTY_BUFF_FLY].Apply(pParty->uTimePlayed + 60 * (256 * 2), 3, 1, v19, 0); | |
1973 pParty->pPartyBuffs[PARTY_BUFF_FLY].uFlags |= 1; | |
1974 pAudioPlayer->PlaySound(SOUND_11090, 0, 0, -1, 0, 0, 0, 0); | |
1975 } | |
1976 } | |
1977 break; | |
1978 | |
1979 case WaterMaster: | |
1980 { | |
1981 int v20 = pOtherOverlayList->_4418B1(10005, 201, 0, 65536); | |
1982 pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].Apply(pParty->uTimePlayed + 60 * (256 * (2 + 1)), 3, 0, v20, 0); | |
1983 pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uFlags |= 1; | |
1984 pAudioPlayer->PlaySound(SOUND_12040, 0, 0, -1, 0, 0, 0, 0); | |
1985 } | |
1986 break; | |
1987 | |
1988 case GateMaster: | |
1989 { | |
1990 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
1991 dword_50C9DC = 195; | |
1992 ptr_50C9E0 = GetNPCData(sDialogue_SpeakingActorNPC_ID); | |
1993 } | |
1994 break; | |
1995 | |
1996 case Acolyte: _42777D_CastSpell_UseWand_ShootArrow(46, 0, 133, 0, 0); break; | |
1997 case Piper: _42777D_CastSpell_UseWand_ShootArrow(51, 0, 133, 0, 0); break; | |
1998 case FallenWizard: _42777D_CastSpell_UseWand_ShootArrow(86, 0, 133, 0, 0); break; | |
1999 | |
2000 case Teacher: | |
2001 case Instructor: | |
2002 case Armsmaster: | |
2003 case Weaponsmaster: | |
2004 case Apprentice: | |
2005 case Mystic: | |
2006 case Spellmaster: | |
2007 case Trader: | |
2008 case Merchant: | |
2009 case Scout: | |
2010 case Herbalist: | |
2011 case Apothecary: | |
2012 case Tinker: | |
2013 case Locksmith: | |
2014 case Fool: | |
2015 case ChimneySweep: | |
2016 case Porter: | |
2017 case QuarterMaster: | |
2018 case Factor: | |
2019 case Banker: | |
2020 case Horseman: | |
2021 case Bard: | |
2022 case Enchanter: | |
2023 case Cartographer: | |
2024 case Explorer: | |
2025 case Pirate: | |
2026 case Squire: | |
2027 case Psychic: | |
2028 case Gypsy: | |
2029 case Diplomat: | |
2030 case Duper: | |
2031 case Burglar: | |
2032 case Acolyte2: | |
2033 case Initiate: | |
2034 case Prelate: | |
2035 case Monk: | |
2036 case Sage: | |
2037 case Hunter: | |
2038 break; | |
2039 | |
2040 default: | |
2041 assert(false && "Invalid enum value"); | |
2042 } | |
2043 return 0; | |
2044 } |