Browse Source

Use CMD_SPAWNITEM to spawn Ghardbards first item

pull/6142/head
obligaron 3 years ago committed by Anders Jenbo
parent
commit
3f195ae29b
  1. 4
      Source/items.cpp
  2. 2
      Source/items.h
  3. 2
      Source/monster.cpp

4
Source/items.cpp

@ -3228,7 +3228,7 @@ Item *SpawnUnique(_unique_items uid, Point position, bool sendmsg /*= true*/)
return &item;
}
void SpawnItem(Monster &monster, Point position, bool sendmsg)
void SpawnItem(Monster &monster, Point position, bool sendmsg, bool spawn /*= false*/)
{
_item_indexes idx;
bool onlygood = true;
@ -3285,6 +3285,8 @@ void SpawnItem(Monster &monster, Point position, bool sendmsg)
if (sendmsg)
NetSendCmdPItem(false, CMD_DROPITEM, item.position, item);
if (spawn)
NetSendCmdPItem(false, CMD_SPAWNITEM, item.position, item);
}
void CreateRndItem(Point position, bool onlygood, bool sendmsg, bool delta)

2
Source/items.h

@ -510,7 +510,7 @@ Point GetSuperItemLoc(Point position);
void GetItemAttrs(Item &item, _item_indexes itemData, int lvl);
void SetupItem(Item &item);
Item *SpawnUnique(_unique_items uid, Point position, bool sendmsg = true);
void SpawnItem(Monster &monster, Point position, bool sendmsg);
void SpawnItem(Monster &monster, Point position, bool sendmsg, bool spawn = false);
void CreateRndItem(Point position, bool onlygood, bool sendmsg, bool delta);
void CreateRndUseful(Point position, bool sendmsg);
void CreateTypeItem(Point position, bool onlygood, ItemType itemType, int imisc, bool sendmsg, bool delta, bool spawn = false);

2
Source/monster.cpp

@ -1415,7 +1415,7 @@ void MonsterTalk(Monster &monster)
NetSendCmdQuest(true, Quests[Q_GARBUD]);
}
if (monster.talkMsg == TEXT_GARBUD2 && (monster.flags & MFLAG_QUEST_COMPLETE) == 0) {
SpawnItem(monster, monster.position.tile + Displacement { 1, 1 }, true);
SpawnItem(monster, monster.position.tile + Displacement { 1, 1 }, false, true);
monster.flags |= MFLAG_QUEST_COMPLETE;
Quests[Q_GARBUD]._qvar1 = QS_GHARBAD_FIRST_ITEM_SPAWNED;
NetSendCmdQuest(true, Quests[Q_GARBUD]);

Loading…
Cancel
Save