| 2377 | } |
| 2378 | |
| 2379 | int M_DoTalk(int i) |
| 2380 | { |
| 2381 | MonsterStruct *Monst; |
| 2382 | int tren; |
| 2383 | |
| 2384 | if ((DWORD)i >= MAXMONSTERS) |
| 2385 | app_fatal("M_DoTalk: Invalid monster %d", i); |
| 2386 | |
| 2387 | Monst = monster + i; |
| 2388 | M_StartStand(i, Monst->_mdir); |
| 2389 | monster[i]._mgoal = MGOAL_TALKING; |
| 2390 | if (effect_is_playing(alltext[Monst->mtalkmsg].sfxnr)) |
| 2391 | return FALSE; |
| 2392 | InitQTextMsg(Monst->mtalkmsg); |
| 2393 | if (Monst->mName == UniqMonst[UMT_GARBUD].mName) { |
| 2394 | if (Monst->mtalkmsg == QUEST_GARBUD1) |
| 2395 | quests[QTYPE_GARB]._qactive = 2; |
| 2396 | quests[QTYPE_GARB]._qlog = TRUE; |
| 2397 | if (Monst->mtalkmsg == QUEST_GARBUD2 && !(Monst->_mFlags & MFLAG_QUEST_COMPLETE)) { |
| 2398 | SpawnItem(i, Monst->_mx + 1, Monst->_my + 1, TRUE); |
| 2399 | Monst->_mFlags |= MFLAG_QUEST_COMPLETE; |
| 2400 | } |
| 2401 | } |
| 2402 | if (Monst->mName == UniqMonst[UMT_ZHAR].mName |
| 2403 | && Monst->mtalkmsg == QUEST_ZHAR1 |
| 2404 | && !(Monst->_mFlags & MFLAG_QUEST_COMPLETE)) { |
| 2405 | quests[QTYPE_ZHAR]._qactive = 2; |
| 2406 | quests[QTYPE_ZHAR]._qlog = TRUE; |
| 2407 | CreateTypeItem(Monst->_mx + 1, Monst->_my + 1, FALSE, ITYPE_MISC, IMISC_BOOK, TRUE, FALSE); |
| 2408 | Monst->_mFlags |= MFLAG_QUEST_COMPLETE; |
| 2409 | } |
| 2410 | if (Monst->mName == UniqMonst[UMT_SNOTSPIL].mName) { |
| 2411 | if (Monst->mtalkmsg == QUEST_BANNER10 && !(Monst->_mFlags & MFLAG_QUEST_COMPLETE)) { |
| 2412 | ObjChangeMap(setpc_x, setpc_y, (setpc_w >> 1) + setpc_x + 2, (setpc_h >> 1) + setpc_y - 2); |
| 2413 | tren = TransVal; |
| 2414 | TransVal = 9; |
| 2415 | DRLG_MRectTrans(setpc_x, setpc_y, (setpc_w >> 1) + setpc_x + 4, setpc_y + (setpc_h >> 1)); |
| 2416 | TransVal = tren; |
| 2417 | quests[QTYPE_BOL]._qvar1 = 2; |
| 2418 | if (quests[QTYPE_BOL]._qactive == 1) |
| 2419 | quests[QTYPE_BOL]._qactive = 2; |
| 2420 | Monst->_mFlags |= MFLAG_QUEST_COMPLETE; |
| 2421 | } |
| 2422 | if (quests[QTYPE_BOL]._qvar1 < 2) { |
| 2423 | sprintf(tempstr, "SS Talk = %i, Flags = %i", Monst->mtalkmsg, Monst->_mFlags); |
| 2424 | app_fatal(tempstr); |
| 2425 | } |
| 2426 | } |
| 2427 | if (Monst->mName == UniqMonst[UMT_LACHDAN].mName) { |
| 2428 | if (Monst->mtalkmsg == QUEST_VEIL9) { |
| 2429 | quests[QTYPE_VEIL]._qactive = 2; |
| 2430 | quests[QTYPE_VEIL]._qlog = TRUE; |
| 2431 | } |
| 2432 | if (Monst->mtalkmsg == QUEST_VEIL11 && !(Monst->_mFlags & MFLAG_QUEST_COMPLETE)) { |
| 2433 | SpawnUnique(UITEM_STEELVEIL, Monst->_mx + 1, Monst->_my + 1); |
| 2434 | Monst->_mFlags |= MFLAG_QUEST_COMPLETE; |
| 2435 | } |
| 2436 | } |
no test coverage detected