-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathBook.cpp
40 lines (31 loc) · 976 Bytes
/
Book.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include "StdAfx.h"
#include "WeenieObject.h"
#include "Book.h"
#include "Player.h"
CBookWeenie::CBookWeenie()
{
SetName("Book");
m_Qualities.m_WeenieType = Book_WeenieType;
}
CBookWeenie::~CBookWeenie()
{
}
void CBookWeenie::ApplyQualityOverrides()
{
}
int CBookWeenie::Use(CPlayerWeenie *pOther)
{
BinaryWriter bookDataMessage;
bookDataMessage.Write<DWORD>(0xB4);
bookDataMessage.Write<DWORD>(GetID());
DWORD maxNumPages = m_Qualities._pageDataList ? m_Qualities._pageDataList->maxNumPages : 0;
bookDataMessage.Write<DWORD>(maxNumPages);
if (m_Qualities._pageDataList)
m_Qualities._pageDataList->Pack(&bookDataMessage);
bookDataMessage.WriteString(InqStringQuality(INSCRIPTION_STRING, ""));
bookDataMessage.Write<DWORD>(InqIIDQuality(SCRIBE_IID, 0));
bookDataMessage.WriteString(InqStringQuality(SCRIBE_NAME_STRING, ""));
pOther->SendNetMessage(&bookDataMessage, PRIVATE_MSG, TRUE, FALSE);
pOther->NotifyUseDone(WERROR_NONE);
return WERROR_NONE;
}