Added rules for what int mobs need to not attack red cons and how much food and drink is taken per stamina update.

Added mod hooks for food/drink values and mob aggro.
Added quest functions for getting/setting hunger and thirst.
This commit is contained in:
Tabasco
2013-08-01 19:24:15 -05:00
parent 936c8cce4b
commit fc03ee94e2
11 changed files with 296 additions and 37 deletions
+4 -31
View File
@@ -1934,26 +1934,10 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app)
const Item_Struct* eat_item = myitem->GetItem();
if (pcs->type == 0x01) {
#if EQDEBUG >= 1
LogFile->write(EQEMuLog::Debug, "Eating from slot:%i", (int)pcs->slot);
#endif
m_pp.hunger_level += eat_item->CastTime*cons_mod; //roughly 1 item per 10 minutes
DeleteItemInInventory(pcs->slot, 1, false);
if(pcs->auto_consumed != 0xffffffff) //no message if the client consumed for us
entity_list.MessageClose_StringID(this, true, 50, 0, EATING_MESSAGE, GetName(), eat_item->Name);
Consume(eat_item, ItemTypeFood, pcs->slot, (pcs->auto_consumed == 0xffffffff));
}
else if (pcs->type == 0x02) {
#if EQDEBUG >= 1
LogFile->write(EQEMuLog::Debug, "Drinking from slot:%i", (int)pcs->slot);
#endif
// 6000 is the max. value
//m_pp.thirst_level += 1000;
m_pp.thirst_level += eat_item->CastTime*cons_mod; //roughly 1 item per 10 minutes
DeleteItemInInventory(pcs->slot, 1, false);
if(pcs->auto_consumed != 0xffffffff) //no message if the client consumed for us
entity_list.MessageClose_StringID(this, true, 50, 0, DRINKING_MESSAGE, GetName(), eat_item->Name);
Consume(eat_item, ItemTypeDrink, pcs->slot, (pcs->auto_consumed == 0xffffffff));
}
else {
LogFile->write(EQEMuLog::Error, "OP_Consume: unknown type, type:%i", (int)pcs->type);
@@ -2183,22 +2167,11 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app)
if (item->ItemType == ItemTypeFood && m_pp.hunger_level < 5000)
{
#if EQDEBUG >= 1
LogFile->write(EQEMuLog::Debug, "Eating from slot:%i", slot_id);
#endif
m_pp.hunger_level += item->CastTime*cons_mod; //roughly 1 item per 10 minutes
DeleteItemInInventory(slot_id, 1, false);
entity_list.MessageClose_StringID(this, true, 50, 0, EATING_MESSAGE, GetName(), item->Name);
Consume(item, item->ItemType, slot_id, false);
}
else if (item->ItemType == ItemTypeDrink && m_pp.thirst_level < 5000)
{
#if EQDEBUG >= 1
LogFile->write(EQEMuLog::Debug, "Drinking from slot:%i", slot_id);
#endif
// 6000 is the max. value
m_pp.thirst_level += item->CastTime*cons_mod; //roughly 1 item per 10 minutes
DeleteItemInInventory(slot_id, 1, false);
entity_list.MessageClose_StringID(this, true, 50, 0, DRINKING_MESSAGE, GetName(), item->Name);
Consume(item, item->ItemType, slot_id, false);
}
else if (item->ItemType == ItemTypeAlcohol)
{