MCPcopy Create free account
hub / github.com/diasurgical/devilution / TalktoMonster

Function TalktoMonster

Source/monster.cpp:5435–5461  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5433}
5434
5435void TalktoMonster(int i)
5436{
5437 MonsterStruct *Monst;
5438 int pnum, itm;
5439
5440 if ((DWORD)i >= MAXMONSTERS)
5441 app_fatal("TalktoMonster: Invalid monster %d", i);
5442
5443 Monst = &monster[i];
5444 pnum = Monst->_menemy;
5445 Monst->_mmode = MM_TALK;
5446 if (Monst->_mAi == AI_SNOTSPIL || Monst->_mAi == AI_LACHDAN) {
5447 if (QuestStatus(QTYPE_BOL) && quests[QTYPE_BOL]._qvar1 == 2 && PlrHasItem(pnum, IDI_BANNER, &itm) != NULL) {
5448 RemoveInvItem(pnum, itm);
5449 quests[QTYPE_BOL]._qactive = 3;
5450 Monst->mtalkmsg = QUEST_BANNER12;
5451 Monst->_mgoal = MGOAL_INQUIRING;
5452 }
5453 if (QuestStatus(QTYPE_VEIL) && Monst->mtalkmsg >= QUEST_VEIL9) {
5454 if (PlrHasItem(pnum, IDI_GLDNELIX, &itm) != NULL) {
5455 RemoveInvItem(pnum, itm);
5456 Monst->mtalkmsg = QUEST_VEIL11;
5457 Monst->_mgoal = MGOAL_INQUIRING;
5458 }
5459 }
5460 }
5461}
5462
5463void SpawnGolum(int i, int x, int y, int mi)
5464{

Callers 1

CheckNewPathFunction · 0.85

Calls 4

app_fatalFunction · 0.85
QuestStatusFunction · 0.85
PlrHasItemFunction · 0.85
RemoveInvItemFunction · 0.85

Tested by

no test coverage detected