mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-15 20:51:29 +00:00
Hand in stacked items
Added support for handing in stacked items and getting task credit for those items.
This commit is contained in:
parent
87b4640ff0
commit
8f78a3fd35
@ -991,7 +991,7 @@ public:
|
|||||||
inline void UpdateTasksForItem(ActivityType Type, int ItemID, int Count=1) { if(taskstate) taskstate->UpdateTasksForItem(this, Type, ItemID, Count); }
|
inline void UpdateTasksForItem(ActivityType Type, int ItemID, int Count=1) { if(taskstate) taskstate->UpdateTasksForItem(this, Type, ItemID, Count); }
|
||||||
inline void UpdateTasksOnExplore(int ExploreID) { if(taskstate) taskstate->UpdateTasksOnExplore(this, ExploreID); }
|
inline void UpdateTasksOnExplore(int ExploreID) { if(taskstate) taskstate->UpdateTasksOnExplore(this, ExploreID); }
|
||||||
inline bool UpdateTasksOnSpeakWith(int NPCTypeID) { if(taskstate) return taskstate->UpdateTasksOnSpeakWith(this, NPCTypeID); else return false; }
|
inline bool UpdateTasksOnSpeakWith(int NPCTypeID) { if(taskstate) return taskstate->UpdateTasksOnSpeakWith(this, NPCTypeID); else return false; }
|
||||||
inline bool UpdateTasksOnDeliver(uint32 *Items, int Cash, int NPCTypeID) { if(taskstate) return taskstate->UpdateTasksOnDeliver(this, Items, Cash, NPCTypeID); else return false; }
|
inline bool UpdateTasksOnDeliver(std::list<ItemInst*>& Items, int Cash, int NPCTypeID) { if (taskstate) return taskstate->UpdateTasksOnDeliver(this, Items, Cash, NPCTypeID); else return false; }
|
||||||
inline void TaskSetSelector(Mob *mob, int TaskSetID) { if(taskmanager) taskmanager->TaskSetSelector(this, taskstate, mob, TaskSetID); }
|
inline void TaskSetSelector(Mob *mob, int TaskSetID) { if(taskmanager) taskmanager->TaskSetSelector(this, taskstate, mob, TaskSetID); }
|
||||||
inline void EnableTask(int TaskCount, int *TaskList) { if(taskstate) taskstate->EnableTask(CharacterID(), TaskCount, TaskList); }
|
inline void EnableTask(int TaskCount, int *TaskList) { if(taskstate) taskstate->EnableTask(CharacterID(), TaskCount, TaskList); }
|
||||||
inline void DisableTask(int TaskCount, int *TaskList) { if(taskstate) taskstate->DisableTask(CharacterID(), TaskCount, TaskList); }
|
inline void DisableTask(int TaskCount, int *TaskList) { if(taskstate) taskstate->DisableTask(CharacterID(), TaskCount, TaskList); }
|
||||||
|
|||||||
@ -1692,7 +1692,7 @@ void ClientTaskState::UpdateTasksOnExplore(Client *c, int ExploreID) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ClientTaskState::UpdateTasksOnDeliver(Client *c, uint32 *Items, int Cash, int NPCTypeID) {
|
bool ClientTaskState::UpdateTasksOnDeliver(Client *c, std::list<ItemInst*>& Items, int Cash, int NPCTypeID) {
|
||||||
|
|
||||||
bool Ret = false;
|
bool Ret = false;
|
||||||
|
|
||||||
@ -1731,17 +1731,15 @@ bool ClientTaskState::UpdateTasksOnDeliver(Client *c, uint32 *Items, int Cash, i
|
|||||||
Ret = true;
|
Ret = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for(int k=0; k<4; k++) {
|
for(auto& k : Items) {
|
||||||
if(Items[k]==0) continue;
|
|
||||||
switch(Task->Activity[j].GoalMethod) {
|
switch(Task->Activity[j].GoalMethod) {
|
||||||
|
|
||||||
case METHODSINGLEID:
|
case METHODSINGLEID:
|
||||||
if(Task->Activity[j].GoalID != (int)Items[k]) continue;
|
if(Task->Activity[j].GoalID != k->GetID()) continue;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case METHODLIST:
|
case METHODLIST:
|
||||||
if(!taskmanager->GoalListManager.IsInList(Task->Activity[j].GoalID,
|
if (!taskmanager->GoalListManager.IsInList(Task->Activity[j].GoalID, k->GetID()))
|
||||||
Items[k]))
|
|
||||||
continue;
|
continue;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1751,7 +1749,7 @@ bool ClientTaskState::UpdateTasksOnDeliver(Client *c, uint32 *Items, int Cash, i
|
|||||||
}
|
}
|
||||||
// We found an active task related to this item, so increment the done count
|
// We found an active task related to this item, so increment the done count
|
||||||
Log.Out(Logs::General, Logs::Tasks, "[UPDATE] Increment on GiveItem");
|
Log.Out(Logs::General, Logs::Tasks, "[UPDATE] Increment on GiveItem");
|
||||||
IncrementDoneCount(c, Task, i, j, 1);
|
IncrementDoneCount(c, Task, i, j, k->GetCharges());
|
||||||
Ret = true;
|
Ret = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,6 +22,7 @@ Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net)
|
|||||||
|
|
||||||
#include "../common/types.h"
|
#include "../common/types.h"
|
||||||
|
|
||||||
|
#include <list>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#define MAXTASKS 10000
|
#define MAXTASKS 10000
|
||||||
@ -44,6 +45,7 @@ Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net)
|
|||||||
|
|
||||||
class Client;
|
class Client;
|
||||||
class Mob;
|
class Mob;
|
||||||
|
class ItemInst;
|
||||||
|
|
||||||
struct TaskGoalList_Struct {
|
struct TaskGoalList_Struct {
|
||||||
int ListID;
|
int ListID;
|
||||||
@ -185,7 +187,7 @@ public:
|
|||||||
void UpdateTasksForItem(Client *c, ActivityType Type, int ItemID, int Count=1);
|
void UpdateTasksForItem(Client *c, ActivityType Type, int ItemID, int Count=1);
|
||||||
void UpdateTasksOnExplore(Client *c, int ExploreID);
|
void UpdateTasksOnExplore(Client *c, int ExploreID);
|
||||||
bool UpdateTasksOnSpeakWith(Client *c, int NPCTypeID);
|
bool UpdateTasksOnSpeakWith(Client *c, int NPCTypeID);
|
||||||
bool UpdateTasksOnDeliver(Client *c, uint32 *Items, int Cash, int NPCTypeID);
|
bool UpdateTasksOnDeliver(Client *c, std::list<ItemInst*>& Items, int Cash, int NPCTypeID);
|
||||||
void UpdateTasksOnTouch(Client *c, int ZoneID);
|
void UpdateTasksOnTouch(Client *c, int ZoneID);
|
||||||
void ProcessTaskProximities(Client *c, float X, float Y, float Z);
|
void ProcessTaskProximities(Client *c, float X, float Y, float Z);
|
||||||
bool TaskOutOfTime(int Index);
|
bool TaskOutOfTime(int Index);
|
||||||
|
|||||||
@ -874,11 +874,11 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::vector<EQEmu::Any> item_list;
|
std::vector<EQEmu::Any> item_list;
|
||||||
uint32 items[4] = { 0 };
|
std::list<ItemInst*> items;
|
||||||
for(int i = EmuConstants::TRADE_BEGIN; i <= EmuConstants::TRADE_NPC_END; ++i) {
|
for(int i = EmuConstants::TRADE_BEGIN; i <= EmuConstants::TRADE_NPC_END; ++i) {
|
||||||
ItemInst *inst = m_inv.GetItem(i);
|
ItemInst *inst = m_inv.GetItem(i);
|
||||||
if(inst) {
|
if(inst) {
|
||||||
items[i - EmuConstants::TRADE_BEGIN] = inst->GetItem()->ID;
|
items.push_back(inst);
|
||||||
item_list.push_back(inst);
|
item_list.push_back(inst);
|
||||||
} else {
|
} else {
|
||||||
item_list.push_back((ItemInst*)nullptr);
|
item_list.push_back((ItemInst*)nullptr);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user