mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-14 19:51:29 +00:00
Prefer prefix ++/-- on non-primitive types
Postfix ++/-- might cause the creation of a tmp instance that might be optimized out. Mights are bad. Prefix doesn't have this problem.
This commit is contained in:
parent
47c33f3b31
commit
4216627604
@ -229,25 +229,18 @@ void EQStreamServer::Process() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::map <std::string, EQStream*>::iterator connection;
|
std::map <std::string, EQStream*>::iterator connection;
|
||||||
for (connection = connection_list.begin( ); connection != connection_list.end( );)
|
for (connection = connection_list.begin(); connection != connection_list.end();) {
|
||||||
{
|
if (!connection->second) {
|
||||||
if(!connection->second)
|
connection = connection_list.erase(connection);
|
||||||
{
|
|
||||||
std::map <std::string, EQStream*>::iterator tmp=connection;
|
|
||||||
connection++;
|
|
||||||
connection_list.erase(tmp);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
EQStream* eqs_data = connection->second;
|
EQStream* eqs_data = connection->second;
|
||||||
if (eqs_data->IsFree() && (!eqs_data->CheckNetActive())) {
|
if (eqs_data->IsFree() && (!eqs_data->CheckNetActive())) {
|
||||||
std::map <std::string, EQStream*>::iterator tmp=connection;
|
|
||||||
connection++;
|
|
||||||
safe_delete(eqs_data);
|
safe_delete(eqs_data);
|
||||||
connection_list.erase(tmp);
|
connection = connection_list.erase(connection);
|
||||||
}
|
} else if (!eqs_data->RunLoop) {
|
||||||
else if(!eqs_data->RunLoop) {
|
|
||||||
eqs_data->Process(sock);
|
eqs_data->Process(sock);
|
||||||
connection++;
|
++connection;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -747,7 +747,7 @@ void EQStream::Write(int eq_fd)
|
|||||||
// Copy it first as it will still live until it is acked
|
// Copy it first as it will still live until it is acked
|
||||||
p=(*sitr)->Copy();
|
p=(*sitr)->Copy();
|
||||||
_log(NET__NET_COMBINE, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size);
|
_log(NET__NET_COMBINE, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size);
|
||||||
sitr++;
|
++sitr;
|
||||||
NextSequencedSend++;
|
NextSequencedSend++;
|
||||||
} else if (!p->combine(*sitr)) {
|
} else if (!p->combine(*sitr)) {
|
||||||
// Trying to combine this packet with the base didn't work (too big maybe)
|
// Trying to combine this packet with the base didn't work (too big maybe)
|
||||||
@ -765,7 +765,7 @@ void EQStream::Write(int eq_fd)
|
|||||||
} else {
|
} else {
|
||||||
// Combine worked
|
// Combine worked
|
||||||
_log(NET__NET_COMBINE, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size);
|
_log(NET__NET_COMBINE, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size);
|
||||||
sitr++;
|
++sitr;
|
||||||
NextSequencedSend++;
|
NextSequencedSend++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -774,7 +774,7 @@ void EQStream::Write(int eq_fd)
|
|||||||
// Copy it first as it will still live until it is acked
|
// Copy it first as it will still live until it is acked
|
||||||
p=(*sitr)->Copy();
|
p=(*sitr)->Copy();
|
||||||
_log(NET__NET_COMBINE, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size);
|
_log(NET__NET_COMBINE, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size);
|
||||||
sitr++;
|
++sitr;
|
||||||
NextSequencedSend++;
|
NextSequencedSend++;
|
||||||
} else if (!p->combine(*sitr)) {
|
} else if (!p->combine(*sitr)) {
|
||||||
// Trying to combine this packet with the base didn't work (too big maybe)
|
// Trying to combine this packet with the base didn't work (too big maybe)
|
||||||
@ -792,7 +792,7 @@ void EQStream::Write(int eq_fd)
|
|||||||
} else {
|
} else {
|
||||||
// Combine worked
|
// Combine worked
|
||||||
_log(NET__NET_COMBINE, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size);
|
_log(NET__NET_COMBINE, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size);
|
||||||
sitr++;
|
++sitr;
|
||||||
NextSequencedSend++;
|
NextSequencedSend++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1047,7 +1047,7 @@ EQApplicationPacket *p=nullptr;
|
|||||||
MInboundQueue.lock();
|
MInboundQueue.lock();
|
||||||
if (!InboundQueue.empty()) {
|
if (!InboundQueue.empty()) {
|
||||||
std::vector<EQRawApplicationPacket *>::iterator itr;
|
std::vector<EQRawApplicationPacket *>::iterator itr;
|
||||||
for(itr=InboundQueue.begin();itr!=InboundQueue.end();itr++) {
|
for(itr=InboundQueue.begin();itr!=InboundQueue.end();++itr) {
|
||||||
p=*itr;
|
p=*itr;
|
||||||
delete p;
|
delete p;
|
||||||
}
|
}
|
||||||
@ -1094,7 +1094,7 @@ EQProtocolPacket *p=nullptr;
|
|||||||
}
|
}
|
||||||
if(!SequencedQueue.empty()) {
|
if(!SequencedQueue.empty()) {
|
||||||
std::deque<EQProtocolPacket *>::iterator itr;
|
std::deque<EQProtocolPacket *>::iterator itr;
|
||||||
for(itr=SequencedQueue.begin();itr!=SequencedQueue.end();itr++) {
|
for(itr=SequencedQueue.begin();itr!=SequencedQueue.end();++itr) {
|
||||||
p=*itr;
|
p=*itr;
|
||||||
delete p;
|
delete p;
|
||||||
}
|
}
|
||||||
@ -1119,7 +1119,7 @@ EQProtocolPacket *p=nullptr;
|
|||||||
|
|
||||||
if(!PacketQueue.empty()) {
|
if(!PacketQueue.empty()) {
|
||||||
std::map<unsigned short,EQProtocolPacket *>::iterator itr;
|
std::map<unsigned short,EQProtocolPacket *>::iterator itr;
|
||||||
for(itr=PacketQueue.begin();itr!=PacketQueue.end();itr++) {
|
for(itr=PacketQueue.begin();itr!=PacketQueue.end();++itr) {
|
||||||
p=itr->second;
|
p=itr->second;
|
||||||
delete p;
|
delete p;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -101,7 +101,7 @@ ItemInstQueue::~ItemInstQueue() {
|
|||||||
iter_queue cur,end;
|
iter_queue cur,end;
|
||||||
cur = m_list.begin();
|
cur = m_list.begin();
|
||||||
end = m_list.end();
|
end = m_list.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
ItemInst *tmp = * cur;
|
ItemInst *tmp = * cur;
|
||||||
safe_delete(tmp);
|
safe_delete(tmp);
|
||||||
}
|
}
|
||||||
@ -113,7 +113,7 @@ Inventory::~Inventory() {
|
|||||||
|
|
||||||
cur = m_worn.begin();
|
cur = m_worn.begin();
|
||||||
end = m_worn.end();
|
end = m_worn.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
ItemInst *tmp = cur->second;
|
ItemInst *tmp = cur->second;
|
||||||
safe_delete(tmp);
|
safe_delete(tmp);
|
||||||
}
|
}
|
||||||
@ -121,7 +121,7 @@ Inventory::~Inventory() {
|
|||||||
|
|
||||||
cur = m_inv.begin();
|
cur = m_inv.begin();
|
||||||
end = m_inv.end();
|
end = m_inv.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
ItemInst *tmp = cur->second;
|
ItemInst *tmp = cur->second;
|
||||||
safe_delete(tmp);
|
safe_delete(tmp);
|
||||||
}
|
}
|
||||||
@ -129,7 +129,7 @@ Inventory::~Inventory() {
|
|||||||
|
|
||||||
cur = m_bank.begin();
|
cur = m_bank.begin();
|
||||||
end = m_bank.end();
|
end = m_bank.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
ItemInst *tmp = cur->second;
|
ItemInst *tmp = cur->second;
|
||||||
safe_delete(tmp);
|
safe_delete(tmp);
|
||||||
}
|
}
|
||||||
@ -137,7 +137,7 @@ Inventory::~Inventory() {
|
|||||||
|
|
||||||
cur = m_shbank.begin();
|
cur = m_shbank.begin();
|
||||||
end = m_shbank.end();
|
end = m_shbank.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
ItemInst *tmp = cur->second;
|
ItemInst *tmp = cur->second;
|
||||||
safe_delete(tmp);
|
safe_delete(tmp);
|
||||||
}
|
}
|
||||||
@ -145,7 +145,7 @@ Inventory::~Inventory() {
|
|||||||
|
|
||||||
cur = m_trade.begin();
|
cur = m_trade.begin();
|
||||||
end = m_trade.end();
|
end = m_trade.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
ItemInst *tmp = cur->second;
|
ItemInst *tmp = cur->second;
|
||||||
safe_delete(tmp);
|
safe_delete(tmp);
|
||||||
}
|
}
|
||||||
@ -166,7 +166,7 @@ ItemInst::ItemInst(const ItemInst& copy)
|
|||||||
m_merchantcount=copy.m_merchantcount;
|
m_merchantcount=copy.m_merchantcount;
|
||||||
// Copy container contents
|
// Copy container contents
|
||||||
iter_contents it;
|
iter_contents it;
|
||||||
for (it=copy.m_contents.begin(); it!=copy.m_contents.end(); it++) {
|
for (it=copy.m_contents.begin(); it!=copy.m_contents.end(); ++it) {
|
||||||
ItemInst* inst_old = it->second;
|
ItemInst* inst_old = it->second;
|
||||||
ItemInst* inst_new = nullptr;
|
ItemInst* inst_new = nullptr;
|
||||||
|
|
||||||
@ -179,7 +179,7 @@ ItemInst::ItemInst(const ItemInst& copy)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
std::map<std::string, std::string>::const_iterator iter;
|
std::map<std::string, std::string>::const_iterator iter;
|
||||||
for (iter = copy.m_custom_data.begin(); iter != copy.m_custom_data.end(); iter++) {
|
for (iter = copy.m_custom_data.begin(); iter != copy.m_custom_data.end(); ++iter) {
|
||||||
m_custom_data[iter->first] = iter->second;
|
m_custom_data[iter->first] = iter->second;
|
||||||
}
|
}
|
||||||
m_SerialNumber = copy.m_SerialNumber;
|
m_SerialNumber = copy.m_SerialNumber;
|
||||||
@ -428,7 +428,7 @@ void ItemInst::Clear()
|
|||||||
iter_contents cur, end;
|
iter_contents cur, end;
|
||||||
cur = m_contents.begin();
|
cur = m_contents.begin();
|
||||||
end = m_contents.end();
|
end = m_contents.end();
|
||||||
for (; cur != end; cur++) {
|
for (; cur != end; ++cur) {
|
||||||
ItemInst* inst = cur->second;
|
ItemInst* inst = cur->second;
|
||||||
safe_delete(inst);
|
safe_delete(inst);
|
||||||
}
|
}
|
||||||
@ -446,7 +446,7 @@ void ItemInst::ClearByFlags(byFlagSetting is_nodrop, byFlagSetting is_norent)
|
|||||||
ItemInst* inst = cur->second;
|
ItemInst* inst = cur->second;
|
||||||
const Item_Struct* item = inst->GetItem();
|
const Item_Struct* item = inst->GetItem();
|
||||||
del = cur;
|
del = cur;
|
||||||
cur++;
|
++cur;
|
||||||
|
|
||||||
switch(is_nodrop) {
|
switch(is_nodrop) {
|
||||||
case byFlagSet:
|
case byFlagSet:
|
||||||
@ -611,7 +611,7 @@ std::string ItemInst::GetCustomDataString() const {
|
|||||||
ret_val += iter->first;
|
ret_val += iter->first;
|
||||||
ret_val += "^";
|
ret_val += "^";
|
||||||
ret_val += iter->second;
|
ret_val += iter->second;
|
||||||
iter++;
|
++iter;
|
||||||
|
|
||||||
if(ret_val.length() > 0) {
|
if(ret_val.length() > 0) {
|
||||||
ret_val += "^";
|
ret_val += "^";
|
||||||
@ -1231,11 +1231,11 @@ int16 Inventory::FindFreeSlot(bool for_bag, bool try_cursor, uint8 min_size, boo
|
|||||||
void Inventory::dumpBagContents(ItemInst *inst, iter_inst *it) {
|
void Inventory::dumpBagContents(ItemInst *inst, iter_inst *it) {
|
||||||
iter_contents itb;
|
iter_contents itb;
|
||||||
|
|
||||||
if (!inst || !inst->IsType(ItemClassContainer))
|
if (!inst || !inst->IsType(ItemClassContainer))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Go through bag, if bag
|
// Go through bag, if bag
|
||||||
for (itb=inst->_begin(); itb!=inst->_end(); itb++) {
|
for (itb=inst->_begin(); itb!=inst->_end(); ++itb) {
|
||||||
ItemInst* baginst = itb->second;
|
ItemInst* baginst = itb->second;
|
||||||
if(!baginst || !baginst->GetItem())
|
if(!baginst || !baginst->GetItem())
|
||||||
continue;
|
continue;
|
||||||
@ -1308,7 +1308,7 @@ void Inventory::dumpItemCollection(const std::map<int16, ItemInst*> &collection)
|
|||||||
iter_contents itb;
|
iter_contents itb;
|
||||||
ItemInst* inst = nullptr;
|
ItemInst* inst = nullptr;
|
||||||
|
|
||||||
for (it=collection.begin(); it!=collection.end(); it++) {
|
for (it=collection.begin(); it!=collection.end(); ++it) {
|
||||||
inst = it->second;
|
inst = it->second;
|
||||||
if(!inst || !inst->GetItem())
|
if(!inst || !inst->GetItem())
|
||||||
continue;
|
continue;
|
||||||
@ -1430,7 +1430,7 @@ int16 Inventory::_HasItem(std::map<int16, ItemInst*>& bucket, uint32 item_id, ui
|
|||||||
uint8 quantity_found = 0;
|
uint8 quantity_found = 0;
|
||||||
|
|
||||||
// Check item: After failed checks, check bag contents (if bag)
|
// Check item: After failed checks, check bag contents (if bag)
|
||||||
for (it=bucket.begin(); it!=bucket.end(); it++) {
|
for (it=bucket.begin(); it!=bucket.end(); ++it) {
|
||||||
inst = it->second;
|
inst = it->second;
|
||||||
if (inst) {
|
if (inst) {
|
||||||
if (inst->GetID() == item_id) {
|
if (inst->GetID() == item_id) {
|
||||||
@ -1447,7 +1447,7 @@ int16 Inventory::_HasItem(std::map<int16, ItemInst*>& bucket, uint32 item_id, ui
|
|||||||
// Go through bag, if bag
|
// Go through bag, if bag
|
||||||
if (inst && inst->IsType(ItemClassContainer)) {
|
if (inst && inst->IsType(ItemClassContainer)) {
|
||||||
|
|
||||||
for (itb=inst->_begin(); itb!=inst->_end(); itb++) {
|
for (itb=inst->_begin(); itb!=inst->_end(); ++itb) {
|
||||||
ItemInst* baginst = itb->second;
|
ItemInst* baginst = itb->second;
|
||||||
if (baginst->GetID() == item_id) {
|
if (baginst->GetID() == item_id) {
|
||||||
quantity_found += (baginst->GetCharges()<=0) ? 1 : baginst->GetCharges();
|
quantity_found += (baginst->GetCharges()<=0) ? 1 : baginst->GetCharges();
|
||||||
@ -1474,7 +1474,7 @@ int16 Inventory::_HasItem(ItemInstQueue& iqueue, uint32 item_id, uint8 quantity)
|
|||||||
uint8 quantity_found = 0;
|
uint8 quantity_found = 0;
|
||||||
|
|
||||||
// Read-only iteration of queue
|
// Read-only iteration of queue
|
||||||
for (it=iqueue.begin(); it!=iqueue.end(); it++) {
|
for (it=iqueue.begin(); it!=iqueue.end(); ++it) {
|
||||||
ItemInst* inst = *it;
|
ItemInst* inst = *it;
|
||||||
if (inst)
|
if (inst)
|
||||||
{
|
{
|
||||||
@ -1491,7 +1491,7 @@ int16 Inventory::_HasItem(ItemInstQueue& iqueue, uint32 item_id, uint8 quantity)
|
|||||||
// Go through bag, if bag
|
// Go through bag, if bag
|
||||||
if (inst && inst->IsType(ItemClassContainer)) {
|
if (inst && inst->IsType(ItemClassContainer)) {
|
||||||
|
|
||||||
for (itb=inst->_begin(); itb!=inst->_end(); itb++) {
|
for (itb=inst->_begin(); itb!=inst->_end(); ++itb) {
|
||||||
ItemInst* baginst = itb->second;
|
ItemInst* baginst = itb->second;
|
||||||
if (baginst->GetID() == item_id) {
|
if (baginst->GetID() == item_id) {
|
||||||
quantity_found += (baginst->GetCharges()<=0) ? 1 : baginst->GetCharges();
|
quantity_found += (baginst->GetCharges()<=0) ? 1 : baginst->GetCharges();
|
||||||
@ -1520,7 +1520,7 @@ int16 Inventory::_HasItemByUse(std::map<int16, ItemInst*>& bucket, uint8 use, ui
|
|||||||
uint8 quantity_found = 0;
|
uint8 quantity_found = 0;
|
||||||
|
|
||||||
// Check item: After failed checks, check bag contents (if bag)
|
// Check item: After failed checks, check bag contents (if bag)
|
||||||
for (it=bucket.begin(); it!=bucket.end(); it++) {
|
for (it=bucket.begin(); it!=bucket.end(); ++it) {
|
||||||
inst = it->second;
|
inst = it->second;
|
||||||
if (inst && inst->IsType(ItemClassCommon) && inst->GetItem()->ItemType == use) {
|
if (inst && inst->IsType(ItemClassCommon) && inst->GetItem()->ItemType == use) {
|
||||||
quantity_found += (inst->GetCharges()<=0) ? 1 : inst->GetCharges();
|
quantity_found += (inst->GetCharges()<=0) ? 1 : inst->GetCharges();
|
||||||
@ -1554,7 +1554,7 @@ int16 Inventory::_HasItemByUse(ItemInstQueue& iqueue, uint8 use, uint8 quantity)
|
|||||||
uint8 quantity_found = 0;
|
uint8 quantity_found = 0;
|
||||||
|
|
||||||
// Read-only iteration of queue
|
// Read-only iteration of queue
|
||||||
for (it=iqueue.begin(); it!=iqueue.end(); it++) {
|
for (it=iqueue.begin(); it!=iqueue.end(); ++it) {
|
||||||
ItemInst* inst = *it;
|
ItemInst* inst = *it;
|
||||||
if (inst && inst->IsType(ItemClassCommon) && inst->GetItem()->ItemType == use) {
|
if (inst && inst->IsType(ItemClassCommon) && inst->GetItem()->ItemType == use) {
|
||||||
quantity_found += (inst->GetCharges()<=0) ? 1 : inst->GetCharges();
|
quantity_found += (inst->GetCharges()<=0) ? 1 : inst->GetCharges();
|
||||||
@ -1565,7 +1565,7 @@ int16 Inventory::_HasItemByUse(ItemInstQueue& iqueue, uint8 use, uint8 quantity)
|
|||||||
// Go through bag, if bag
|
// Go through bag, if bag
|
||||||
if (inst && inst->IsType(ItemClassContainer)) {
|
if (inst && inst->IsType(ItemClassContainer)) {
|
||||||
|
|
||||||
for (itb=inst->_begin(); itb!=inst->_end(); itb++) {
|
for (itb=inst->_begin(); itb!=inst->_end(); ++itb) {
|
||||||
ItemInst* baginst = itb->second;
|
ItemInst* baginst = itb->second;
|
||||||
if (baginst && baginst->IsType(ItemClassCommon) && baginst->GetItem()->ItemType == use) {
|
if (baginst && baginst->IsType(ItemClassCommon) && baginst->GetItem()->ItemType == use) {
|
||||||
quantity_found += (baginst->GetCharges()<=0) ? 1 : baginst->GetCharges();
|
quantity_found += (baginst->GetCharges()<=0) ? 1 : baginst->GetCharges();
|
||||||
@ -1587,7 +1587,7 @@ int16 Inventory::_HasItemByLoreGroup(std::map<int16, ItemInst*>& bucket, uint32
|
|||||||
ItemInst* inst = nullptr;
|
ItemInst* inst = nullptr;
|
||||||
|
|
||||||
// Check item: After failed checks, check bag contents (if bag)
|
// Check item: After failed checks, check bag contents (if bag)
|
||||||
for (it=bucket.begin(); it!=bucket.end(); it++) {
|
for (it=bucket.begin(); it!=bucket.end(); ++it) {
|
||||||
inst = it->second;
|
inst = it->second;
|
||||||
if (inst) {
|
if (inst) {
|
||||||
if (inst->GetItem()->LoreGroup == loregroup)
|
if (inst->GetItem()->LoreGroup == loregroup)
|
||||||
@ -1603,7 +1603,7 @@ int16 Inventory::_HasItemByLoreGroup(std::map<int16, ItemInst*>& bucket, uint32
|
|||||||
// Go through bag, if bag
|
// Go through bag, if bag
|
||||||
if (inst && inst->IsType(ItemClassContainer)) {
|
if (inst && inst->IsType(ItemClassContainer)) {
|
||||||
|
|
||||||
for (itb=inst->_begin(); itb!=inst->_end(); itb++) {
|
for (itb=inst->_begin(); itb!=inst->_end(); ++itb) {
|
||||||
ItemInst* baginst = itb->second;
|
ItemInst* baginst = itb->second;
|
||||||
if (baginst && baginst->IsType(ItemClassCommon)&& baginst->GetItem()->LoreGroup == loregroup)
|
if (baginst && baginst->IsType(ItemClassCommon)&& baginst->GetItem()->LoreGroup == loregroup)
|
||||||
return Inventory::CalcSlotId(it->first, itb->first);
|
return Inventory::CalcSlotId(it->first, itb->first);
|
||||||
@ -1629,7 +1629,7 @@ int16 Inventory::_HasItemByLoreGroup(ItemInstQueue& iqueue, uint32 loregroup)
|
|||||||
iter_contents itb;
|
iter_contents itb;
|
||||||
|
|
||||||
// Read-only iteration of queue
|
// Read-only iteration of queue
|
||||||
for (it=iqueue.begin(); it!=iqueue.end(); it++) {
|
for (it=iqueue.begin(); it!=iqueue.end(); ++it) {
|
||||||
ItemInst* inst = *it;
|
ItemInst* inst = *it;
|
||||||
if (inst)
|
if (inst)
|
||||||
{
|
{
|
||||||
@ -1646,7 +1646,7 @@ int16 Inventory::_HasItemByLoreGroup(ItemInstQueue& iqueue, uint32 loregroup)
|
|||||||
// Go through bag, if bag
|
// Go through bag, if bag
|
||||||
if (inst && inst->IsType(ItemClassContainer)) {
|
if (inst && inst->IsType(ItemClassContainer)) {
|
||||||
|
|
||||||
for (itb=inst->_begin(); itb!=inst->_end(); itb++) {
|
for (itb=inst->_begin(); itb!=inst->_end(); ++itb) {
|
||||||
ItemInst* baginst = itb->second;
|
ItemInst* baginst = itb->second;
|
||||||
if (baginst && baginst->IsType(ItemClassCommon)&& baginst->GetItem()->LoreGroup == loregroup)
|
if (baginst && baginst->IsType(ItemClassCommon)&& baginst->GetItem()->LoreGroup == loregroup)
|
||||||
return Inventory::CalcSlotId(SLOT_CURSOR, itb->first);
|
return Inventory::CalcSlotId(SLOT_CURSOR, itb->first);
|
||||||
|
|||||||
@ -65,7 +65,7 @@ public:
|
|||||||
vitr cur, end;
|
vitr cur, end;
|
||||||
cur = m_list.begin();
|
cur = m_list.begin();
|
||||||
end = m_list.end();
|
end = m_list.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
delete *cur;
|
delete *cur;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -98,7 +98,7 @@ protected:
|
|||||||
} else {
|
} else {
|
||||||
if (!data->Process())
|
if (!data->Process())
|
||||||
data->Disconnect();
|
data->Disconnect();
|
||||||
cur++;
|
++cur;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1113,7 +1113,7 @@ uint8 *BaseGuildManager::MakeGuildList(const char *head_name, uint32 &length) co
|
|||||||
std::map<uint32, GuildInfo *>::const_iterator cur, end;
|
std::map<uint32, GuildInfo *>::const_iterator cur, end;
|
||||||
cur = m_guilds.begin();
|
cur = m_guilds.begin();
|
||||||
end = m_guilds.end();
|
end = m_guilds.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
pos = 64 + (64 * cur->first);
|
pos = 64 + (64 * cur->first);
|
||||||
strn0cpy((char *) buffer + pos, cur->second->name.c_str(), 64);
|
strn0cpy((char *) buffer + pos, cur->second->name.c_str(), 64);
|
||||||
}
|
}
|
||||||
@ -1218,7 +1218,7 @@ uint32 BaseGuildManager::FindGuildByLeader(uint32 leader) const {
|
|||||||
std::map<uint32, GuildInfo *>::const_iterator cur, end;
|
std::map<uint32, GuildInfo *>::const_iterator cur, end;
|
||||||
cur = m_guilds.begin();
|
cur = m_guilds.begin();
|
||||||
end = m_guilds.end();
|
end = m_guilds.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
if(cur->second->leader_char_id == leader)
|
if(cur->second->leader_char_id == leader)
|
||||||
return(cur->first);
|
return(cur->first);
|
||||||
}
|
}
|
||||||
@ -1297,7 +1297,7 @@ void BaseGuildManager::ClearGuilds() {
|
|||||||
std::map<uint32, GuildInfo *>::iterator cur, end;
|
std::map<uint32, GuildInfo *>::iterator cur, end;
|
||||||
cur = m_guilds.begin();
|
cur = m_guilds.begin();
|
||||||
end = m_guilds.end();
|
end = m_guilds.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
delete cur->second;
|
delete cur->second;
|
||||||
}
|
}
|
||||||
m_guilds.clear();
|
m_guilds.clear();
|
||||||
|
|||||||
@ -294,7 +294,7 @@ PTimerList::~PTimerList() {
|
|||||||
while(s != _list.end()) {
|
while(s != _list.end()) {
|
||||||
if(s->second != nullptr)
|
if(s->second != nullptr)
|
||||||
delete s->second;
|
delete s->second;
|
||||||
s++;
|
++s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -305,7 +305,7 @@ bool PTimerList::Load(Database *db) {
|
|||||||
while(s != _list.end()) {
|
while(s != _list.end()) {
|
||||||
if(s->second != nullptr)
|
if(s->second != nullptr)
|
||||||
delete s->second;
|
delete s->second;
|
||||||
s++;
|
++s;
|
||||||
}
|
}
|
||||||
_list.clear();
|
_list.clear();
|
||||||
|
|
||||||
@ -373,7 +373,7 @@ bool PTimerList::Store(Database *db) {
|
|||||||
if(!s->second->Store(db))
|
if(!s->second->Store(db))
|
||||||
res = false;
|
res = false;
|
||||||
}
|
}
|
||||||
s++;
|
++s;
|
||||||
}
|
}
|
||||||
return(res);
|
return(res);
|
||||||
}
|
}
|
||||||
@ -474,7 +474,7 @@ void PTimerList::ToVector(std::vector< std::pair<pTimerType, PersistentTimer *>
|
|||||||
p.second = s->second;
|
p.second = s->second;
|
||||||
out.push_back(p);
|
out.push_back(p);
|
||||||
}
|
}
|
||||||
s++;
|
++s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -150,7 +150,7 @@ bool ret=true;
|
|||||||
char* query = 0;
|
char* query = 0;
|
||||||
// Delete cursor items
|
// Delete cursor items
|
||||||
if ((ret = RunQuery(query, MakeAnyLenString(&query, "DELETE FROM inventory WHERE charid=%i AND ( (slotid >=8000 and slotid<=8999) or slotid=30 or (slotid>=331 and slotid<=340))", char_id), errbuf))) {
|
if ((ret = RunQuery(query, MakeAnyLenString(&query, "DELETE FROM inventory WHERE charid=%i AND ( (slotid >=8000 and slotid<=8999) or slotid=30 or (slotid>=331 and slotid<=340))", char_id), errbuf))) {
|
||||||
for(it=start,i=8000;it!=end;it++,i++) {
|
for(it=start,i=8000;it!=end;++it,i++) {
|
||||||
ItemInst *inst=*it;
|
ItemInst *inst=*it;
|
||||||
if (!(ret=SaveInventory(char_id,inst,(i==8000) ? 30 : i)))
|
if (!(ret=SaveInventory(char_id,inst,(i==8000) ? 30 : i)))
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -39,7 +39,7 @@ void TimeoutManager::CheckTimeouts() {
|
|||||||
std::vector<Timeoutable *>::iterator cur,end;
|
std::vector<Timeoutable *>::iterator cur,end;
|
||||||
cur = members.begin();
|
cur = members.begin();
|
||||||
end = members.end();
|
end = members.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
Timeoutable *it = *cur;
|
Timeoutable *it = *cur;
|
||||||
if(it->next_check.Check()) {
|
if(it->next_check.Check()) {
|
||||||
#ifdef TIMEOUT_DEBUG
|
#ifdef TIMEOUT_DEBUG
|
||||||
@ -69,7 +69,7 @@ void TimeoutManager::DeleteMember(Timeoutable *who) {
|
|||||||
std::vector<Timeoutable *>::iterator cur,end;
|
std::vector<Timeoutable *>::iterator cur,end;
|
||||||
cur = members.begin();
|
cur = members.begin();
|
||||||
end = members.end();
|
end = members.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
if(*cur == who) {
|
if(*cur == who) {
|
||||||
members.erase(cur);
|
members.erase(cur);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -121,7 +121,7 @@ int main(int argc, char *argv[]) {
|
|||||||
*/
|
*/
|
||||||
zone = zones.begin();
|
zone = zones.begin();
|
||||||
zend = zones.end();
|
zend = zones.end();
|
||||||
for(; zone != zend; zone++) {
|
for(; zone != zend; ++zone) {
|
||||||
if(!zone->second->Process())
|
if(!zone->second->Process())
|
||||||
to_remove.insert(zone->first);
|
to_remove.insert(zone->first);
|
||||||
}
|
}
|
||||||
@ -159,7 +159,7 @@ int main(int argc, char *argv[]) {
|
|||||||
//try to be semi-nice about this... without waiting too long
|
//try to be semi-nice about this... without waiting too long
|
||||||
zone = zones.begin();
|
zone = zones.begin();
|
||||||
zend = zones.end();
|
zend = zones.end();
|
||||||
for(; zone != zend; zone++) {
|
for(; zone != zend; ++zone) {
|
||||||
zone->second->Stop();
|
zone->second->Stop();
|
||||||
}
|
}
|
||||||
Sleep(1);
|
Sleep(1);
|
||||||
@ -169,7 +169,7 @@ int main(int argc, char *argv[]) {
|
|||||||
launch->Process();
|
launch->Process();
|
||||||
//kill anybody left
|
//kill anybody left
|
||||||
launch->TerminateAll(true);
|
launch->TerminateAll(true);
|
||||||
for(; zone != zend; zone++) {
|
for(; zone != zend; ++zone) {
|
||||||
delete zone->second;
|
delete zone->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -49,7 +49,7 @@ void WorldServer::OnConnected() {
|
|||||||
std::map<std::string, ZoneLaunch *>::iterator cur, end;
|
std::map<std::string, ZoneLaunch *>::iterator cur, end;
|
||||||
cur = m_zones.begin();
|
cur = m_zones.begin();
|
||||||
end = m_zones.end();
|
end = m_zones.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
cur->second->SendStatus();
|
cur->second->SendStatus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -131,7 +131,7 @@ void ClientManager::Process()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -150,7 +150,7 @@ void ClientManager::ProcessDisconnect()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -161,7 +161,7 @@ void ClientManager::UpdateServerList()
|
|||||||
while(iter != clients.end())
|
while(iter != clients.end())
|
||||||
{
|
{
|
||||||
(*iter)->SendServerListPacket();
|
(*iter)->SendServerListPacket();
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,7 +178,7 @@ void ClientManager::RemoveExistingClient(unsigned int account_id)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -195,7 +195,7 @@ Client *ClientManager::GetClient(unsigned int account_id)
|
|||||||
cur = (*iter);
|
cur = (*iter);
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(count > 1)
|
if(count > 1)
|
||||||
|
|||||||
@ -68,7 +68,7 @@ void Config::Parse(const char *file_name)
|
|||||||
{
|
{
|
||||||
title.clear();
|
title.clear();
|
||||||
bool first = true;
|
bool first = true;
|
||||||
iter++;
|
++iter;
|
||||||
if(iter == tokens.end())
|
if(iter == tokens.end())
|
||||||
{
|
{
|
||||||
server_log->Log(log_error, "Config::Parse(), EOF before title done parsing.");
|
server_log->Log(log_error, "Config::Parse(), EOF before title done parsing.");
|
||||||
@ -89,9 +89,9 @@ void Config::Parse(const char *file_name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
title += (*iter);
|
title += (*iter);
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mode == 0)
|
if(mode == 0)
|
||||||
@ -127,7 +127,7 @@ void Config::Parse(const char *file_name)
|
|||||||
vars[title] = var_map;
|
vars[title] = var_map;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
fclose(input);
|
fclose(input);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -87,7 +87,7 @@ void ServerManager::Process()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -109,7 +109,7 @@ void ServerManager::ProcessDisconnect()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -123,7 +123,7 @@ WorldServer* ServerManager::GetServerByAddress(unsigned int address)
|
|||||||
{
|
{
|
||||||
return (*iter);
|
return (*iter);
|
||||||
}
|
}
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@ -142,7 +142,7 @@ EQApplicationPacket *ServerManager::CreateServerListPacket(Client *c)
|
|||||||
{
|
{
|
||||||
if((*iter)->IsAuthorized() == false)
|
if((*iter)->IsAuthorized() == false)
|
||||||
{
|
{
|
||||||
iter++;
|
++iter;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,7 +163,7 @@ EQApplicationPacket *ServerManager::CreateServerListPacket(Client *c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
server_count++;
|
server_count++;
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_ServerListResponse, packet_size);
|
EQApplicationPacket *outapp = new EQApplicationPacket(OP_ServerListResponse, packet_size);
|
||||||
@ -186,7 +186,7 @@ EQApplicationPacket *ServerManager::CreateServerListPacket(Client *c)
|
|||||||
{
|
{
|
||||||
if((*iter)->IsAuthorized() == false)
|
if((*iter)->IsAuthorized() == false)
|
||||||
{
|
{
|
||||||
iter++;
|
++iter;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -260,7 +260,7 @@ EQApplicationPacket *ServerManager::CreateServerListPacket(Client *c)
|
|||||||
*(uint32*)data_ptr = (*iter)->GetPlayersOnline();
|
*(uint32*)data_ptr = (*iter)->GetPlayersOnline();
|
||||||
data_ptr += 4;
|
data_ptr += 4;
|
||||||
|
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
return outapp;
|
return outapp;
|
||||||
@ -287,7 +287,7 @@ void ServerManager::SendUserToWorldRequest(unsigned int server_id, unsigned int
|
|||||||
}
|
}
|
||||||
delete outapp;
|
delete outapp;
|
||||||
}
|
}
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!found && server.options.IsTraceOn())
|
if(!found && server.options.IsTraceOn())
|
||||||
@ -303,7 +303,7 @@ bool ServerManager::ServerExists(string l_name, string s_name, WorldServer *igno
|
|||||||
{
|
{
|
||||||
if((*iter) == ignore)
|
if((*iter) == ignore)
|
||||||
{
|
{
|
||||||
iter++;
|
++iter;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -312,7 +312,7 @@ bool ServerManager::ServerExists(string l_name, string s_name, WorldServer *igno
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -324,7 +324,7 @@ void ServerManager::DestroyServerByName(string l_name, string s_name, WorldServe
|
|||||||
{
|
{
|
||||||
if((*iter) == ignore)
|
if((*iter) == ignore)
|
||||||
{
|
{
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((*iter)->GetLongName().compare(l_name) == 0 && (*iter)->GetShortName().compare(s_name) == 0)
|
if((*iter)->GetLongName().compare(l_name) == 0 && (*iter)->GetShortName().compare(s_name) == 0)
|
||||||
@ -339,7 +339,7 @@ void ServerManager::DestroyServerByName(string l_name, string s_name, WorldServe
|
|||||||
iter = world_servers.erase(iter);
|
iter = world_servers.erase(iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -314,7 +314,7 @@ void ChatChannel::SendOPList(Client *c) {
|
|||||||
|
|
||||||
std::list<std::string>::iterator Iterator;
|
std::list<std::string>::iterator Iterator;
|
||||||
|
|
||||||
for(Iterator = Moderators.begin(); Iterator != Moderators.end(); Iterator++)
|
for(Iterator = Moderators.begin(); Iterator != Moderators.end(); ++Iterator)
|
||||||
c->GeneralChannelMessage((*Iterator));
|
c->GeneralChannelMessage((*Iterator));
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -580,7 +580,7 @@ void ChatChannel::RemoveInvitee(std::string Invitee) {
|
|||||||
|
|
||||||
std::list<std::string>::iterator Iterator;
|
std::list<std::string>::iterator Iterator;
|
||||||
|
|
||||||
for(Iterator = Invitees.begin(); Iterator != Invitees.end(); Iterator++) {
|
for(Iterator = Invitees.begin(); Iterator != Invitees.end(); ++Iterator) {
|
||||||
|
|
||||||
if((*Iterator) == Invitee) {
|
if((*Iterator) == Invitee) {
|
||||||
|
|
||||||
@ -597,7 +597,7 @@ bool ChatChannel::IsInvitee(std::string Invitee) {
|
|||||||
|
|
||||||
std::list<std::string>::iterator Iterator;
|
std::list<std::string>::iterator Iterator;
|
||||||
|
|
||||||
for(Iterator = Invitees.begin(); Iterator != Invitees.end(); Iterator++) {
|
for(Iterator = Invitees.begin(); Iterator != Invitees.end(); ++Iterator) {
|
||||||
|
|
||||||
if((*Iterator) == Invitee)
|
if((*Iterator) == Invitee)
|
||||||
return true;
|
return true;
|
||||||
@ -621,7 +621,7 @@ void ChatChannel::RemoveModerator(std::string Moderator) {
|
|||||||
|
|
||||||
std::list<std::string>::iterator Iterator;
|
std::list<std::string>::iterator Iterator;
|
||||||
|
|
||||||
for(Iterator = Moderators.begin(); Iterator != Moderators.end(); Iterator++) {
|
for(Iterator = Moderators.begin(); Iterator != Moderators.end(); ++Iterator) {
|
||||||
|
|
||||||
if((*Iterator) == Moderator) {
|
if((*Iterator) == Moderator) {
|
||||||
|
|
||||||
@ -638,7 +638,7 @@ bool ChatChannel::IsModerator(std::string Moderator) {
|
|||||||
|
|
||||||
std::list<std::string>::iterator Iterator;
|
std::list<std::string>::iterator Iterator;
|
||||||
|
|
||||||
for(Iterator = Moderators.begin(); Iterator != Moderators.end(); Iterator++) {
|
for(Iterator = Moderators.begin(); Iterator != Moderators.end(); ++Iterator) {
|
||||||
|
|
||||||
if((*Iterator) == Moderator)
|
if((*Iterator) == Moderator)
|
||||||
return true;
|
return true;
|
||||||
@ -662,7 +662,7 @@ void ChatChannel::RemoveVoice(std::string inVoiced) {
|
|||||||
|
|
||||||
std::list<std::string>::iterator Iterator;
|
std::list<std::string>::iterator Iterator;
|
||||||
|
|
||||||
for(Iterator = Voiced.begin(); Iterator != Voiced.end(); Iterator++) {
|
for(Iterator = Voiced.begin(); Iterator != Voiced.end(); ++Iterator) {
|
||||||
|
|
||||||
if((*Iterator) == inVoiced) {
|
if((*Iterator) == inVoiced) {
|
||||||
|
|
||||||
@ -679,7 +679,7 @@ bool ChatChannel::HasVoice(std::string inVoiced) {
|
|||||||
|
|
||||||
std::list<std::string>::iterator Iterator;
|
std::list<std::string>::iterator Iterator;
|
||||||
|
|
||||||
for(Iterator = Voiced.begin(); Iterator != Voiced.end(); Iterator++) {
|
for(Iterator = Voiced.begin(); Iterator != Voiced.end(); ++Iterator) {
|
||||||
|
|
||||||
if((*Iterator) == inVoiced)
|
if((*Iterator) == inVoiced)
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -190,11 +190,11 @@ std::vector<std::string> ParseRecipients(std::string RecipientString) {
|
|||||||
|
|
||||||
(*Iterator) = Secret + (*Iterator);
|
(*Iterator) = Secret + (*Iterator);
|
||||||
|
|
||||||
Iterator++;
|
++Iterator;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for(Iterator = RecipientList.begin(); Iterator != RecipientList.end(); Iterator++) {
|
for(Iterator = RecipientList.begin(); Iterator != RecipientList.end(); ++Iterator) {
|
||||||
|
|
||||||
if((*Iterator).length() > 0) {
|
if((*Iterator).length() > 0) {
|
||||||
|
|
||||||
@ -554,7 +554,7 @@ void Clientlist::CheckForStaleConnections(Client *c) {
|
|||||||
|
|
||||||
std::list<Client*>::iterator Iterator;
|
std::list<Client*>::iterator Iterator;
|
||||||
|
|
||||||
for(Iterator = ClientChatConnections.begin(); Iterator != ClientChatConnections.end(); Iterator++) {
|
for(Iterator = ClientChatConnections.begin(); Iterator != ClientChatConnections.end(); ++Iterator) {
|
||||||
|
|
||||||
if(((*Iterator) != c) && ((c->GetName() == (*Iterator)->GetName())
|
if(((*Iterator) != c) && ((c->GetName() == (*Iterator)->GetName())
|
||||||
&& (c->GetConnectionType() == (*Iterator)->GetConnectionType()))) {
|
&& (c->GetConnectionType() == (*Iterator)->GetConnectionType()))) {
|
||||||
@ -596,7 +596,7 @@ void Clientlist::Process() {
|
|||||||
|
|
||||||
std::list<Client*>::iterator Iterator;
|
std::list<Client*>::iterator Iterator;
|
||||||
|
|
||||||
for(Iterator = ClientChatConnections.begin(); Iterator != ClientChatConnections.end(); Iterator++) {
|
for(Iterator = ClientChatConnections.begin(); Iterator != ClientChatConnections.end(); ++Iterator) {
|
||||||
|
|
||||||
(*Iterator)->AccountUpdate();
|
(*Iterator)->AccountUpdate();
|
||||||
if((*Iterator)->ClientStream->CheckClosed()) {
|
if((*Iterator)->ClientStream->CheckClosed()) {
|
||||||
@ -893,7 +893,7 @@ void Clientlist::CloseAllConnections() {
|
|||||||
|
|
||||||
std::list<Client*>::iterator Iterator;
|
std::list<Client*>::iterator Iterator;
|
||||||
|
|
||||||
for(Iterator = ClientChatConnections.begin(); Iterator != ClientChatConnections.end(); Iterator++) {
|
for(Iterator = ClientChatConnections.begin(); Iterator != ClientChatConnections.end(); ++Iterator) {
|
||||||
|
|
||||||
_log(UCS__TRACE, "Removing client %s", (*Iterator)->GetName().c_str());
|
_log(UCS__TRACE, "Removing client %s", (*Iterator)->GetName().c_str());
|
||||||
|
|
||||||
@ -953,7 +953,7 @@ Client *Clientlist::FindCharacter(std::string CharacterName) {
|
|||||||
|
|
||||||
std::list<Client*>::iterator Iterator;
|
std::list<Client*>::iterator Iterator;
|
||||||
|
|
||||||
for(Iterator = ClientChatConnections.begin(); Iterator != ClientChatConnections.end(); Iterator++) {
|
for(Iterator = ClientChatConnections.begin(); Iterator != ClientChatConnections.end(); ++Iterator) {
|
||||||
|
|
||||||
if((*Iterator)->GetName() == CharacterName)
|
if((*Iterator)->GetName() == CharacterName)
|
||||||
return ((*Iterator));
|
return ((*Iterator));
|
||||||
@ -2243,7 +2243,7 @@ Client *Clientlist::IsCharacterOnline(std::string CharacterName) {
|
|||||||
//
|
//
|
||||||
std::list<Client*>::iterator Iterator;
|
std::list<Client*>::iterator Iterator;
|
||||||
|
|
||||||
for(Iterator = ClientChatConnections.begin(); Iterator != ClientChatConnections.end(); Iterator++) {
|
for(Iterator = ClientChatConnections.begin(); Iterator != ClientChatConnections.end(); ++Iterator) {
|
||||||
|
|
||||||
if(!(*Iterator)->IsMailConnection())
|
if(!(*Iterator)->IsMailConnection())
|
||||||
continue;
|
continue;
|
||||||
@ -2352,7 +2352,7 @@ void Client::SendFriends() {
|
|||||||
|
|
||||||
safe_delete(outapp);
|
safe_delete(outapp);
|
||||||
|
|
||||||
Iterator++;
|
++Iterator;
|
||||||
}
|
}
|
||||||
|
|
||||||
Iterator = Ignorees.begin();
|
Iterator = Ignorees.begin();
|
||||||
@ -2375,7 +2375,7 @@ void Client::SendFriends() {
|
|||||||
|
|
||||||
safe_delete(outapp);
|
safe_delete(outapp);
|
||||||
|
|
||||||
Iterator++;
|
++Iterator;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -74,7 +74,7 @@ void Adventure::RemovePlayer(std::string character_name)
|
|||||||
players.erase(iter);
|
players.erase(iter);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ bool Adventure::PlayerExists(std::string character_name)
|
|||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -214,7 +214,7 @@ void Adventure::SetStatus(AdventureStatus new_status)
|
|||||||
while(iter != players.end())
|
while(iter != players.end())
|
||||||
{
|
{
|
||||||
adventure_manager.GetAdventureData((*iter).c_str());
|
adventure_manager.GetAdventureData((*iter).c_str());
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -233,7 +233,7 @@ void Adventure::SendAdventureMessage(uint32 type, const char *msg)
|
|||||||
strcpy(sms->to, (*iter).c_str());
|
strcpy(sms->to, (*iter).c_str());
|
||||||
zoneserver_list.SendPacket(current->zone(), current->instance(), pack);
|
zoneserver_list.SendPacket(current->zone(), current->instance(), pack);
|
||||||
}
|
}
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
delete pack;
|
delete pack;
|
||||||
}
|
}
|
||||||
@ -360,7 +360,7 @@ void Adventure::Finished(AdventureWinStatus ws)
|
|||||||
adventure_manager.AddFinishedEvent(afe);
|
adventure_manager.AddFinishedEvent(afe);
|
||||||
database.UpdateAdventureStatsEntry(database.GetCharacterID((*iter).c_str()), GetTemplate()->theme, (ws != AWS_Lose) ? true : false);
|
database.UpdateAdventureStatsEntry(database.GetCharacterID((*iter).c_str()), GetTemplate()->theme, (ws != AWS_Lose) ? true : false);
|
||||||
}
|
}
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
adventure_manager.GetAdventureData(this);
|
adventure_manager.GetAdventureData(this);
|
||||||
}
|
}
|
||||||
@ -411,7 +411,7 @@ void Adventure::MoveCorpsesToGraveyard()
|
|||||||
LogFile->write(EQEMuLog::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query, errbuf);
|
LogFile->write(EQEMuLog::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query, errbuf);
|
||||||
safe_delete_array(query);
|
safe_delete_array(query);
|
||||||
}
|
}
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
iter = dbid_list.begin();
|
iter = dbid_list.begin();
|
||||||
@ -433,8 +433,8 @@ void Adventure::MoveCorpsesToGraveyard()
|
|||||||
|
|
||||||
zoneserver_list.SendPacket(spc->zone_id, 0, pack);
|
zoneserver_list.SendPacket(spc->zone_id, 0, pack);
|
||||||
delete pack;
|
delete pack;
|
||||||
iter++;
|
++iter;
|
||||||
c_iter++;
|
++c_iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -48,7 +48,7 @@ void AdventureManager::Process()
|
|||||||
delete adv;
|
delete adv;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ void AdventureManager::CalculateAdventureRequestReply(const char *data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -171,7 +171,7 @@ void AdventureManager::CalculateAdventureRequestReply(const char *data)
|
|||||||
ea_iter = eligible_adventures.erase(ea_iter);
|
ea_iter = eligible_adventures.erase(ea_iter);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ea_iter++;
|
++ea_iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -281,9 +281,9 @@ void AdventureManager::CalculateAdventureRequestReply(const char *data)
|
|||||||
ea_iter = eligible_adventures.erase(ea_iter);
|
ea_iter = eligible_adventures.erase(ea_iter);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ea_iter++;
|
++ea_iter;
|
||||||
}
|
}
|
||||||
ez_iter++;
|
++ez_iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::list<AdventureZoneIn>::iterator ezi_iter = excluded_zone_ins.begin();
|
std::list<AdventureZoneIn>::iterator ezi_iter = excluded_zone_ins.begin();
|
||||||
@ -297,9 +297,9 @@ void AdventureManager::CalculateAdventureRequestReply(const char *data)
|
|||||||
ea_iter = eligible_adventures.erase(ea_iter);
|
ea_iter = eligible_adventures.erase(ea_iter);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ea_iter++;
|
++ea_iter;
|
||||||
}
|
}
|
||||||
ezi_iter++;
|
++ezi_iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -319,7 +319,7 @@ void AdventureManager::CalculateAdventureRequestReply(const char *data)
|
|||||||
ea_iter = eligible_adventures.erase(ea_iter);
|
ea_iter = eligible_adventures.erase(ea_iter);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ea_iter++;
|
++ea_iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(eligible_adventures.size() > 0)
|
if(eligible_adventures.size() > 0)
|
||||||
@ -328,7 +328,7 @@ void AdventureManager::CalculateAdventureRequestReply(const char *data)
|
|||||||
int c_index = MakeRandomInt(0, (eligible_adventures.size()-1));
|
int c_index = MakeRandomInt(0, (eligible_adventures.size()-1));
|
||||||
for(int i = 0; i < c_index; ++i)
|
for(int i = 0; i < c_index; ++i)
|
||||||
{
|
{
|
||||||
ea_iter++;
|
++ea_iter;
|
||||||
}
|
}
|
||||||
ServerPacket *pack = new ServerPacket(ServerOP_AdventureRequestAccept, sizeof(ServerAdventureRequestAccept_Struct) + (sar->member_count * 64));
|
ServerPacket *pack = new ServerPacket(ServerOP_AdventureRequestAccept, sizeof(ServerAdventureRequestAccept_Struct) + (sar->member_count * 64));
|
||||||
ServerAdventureRequestAccept_Struct *sra = (ServerAdventureRequestAccept_Struct*)pack->pBuffer;
|
ServerAdventureRequestAccept_Struct *sra = (ServerAdventureRequestAccept_Struct*)pack->pBuffer;
|
||||||
@ -457,7 +457,7 @@ void AdventureManager::GetAdventureData(Adventure *adv)
|
|||||||
while(iter != player_list.end())
|
while(iter != player_list.end())
|
||||||
{
|
{
|
||||||
GetAdventureData((*iter).c_str());
|
GetAdventureData((*iter).c_str());
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -537,7 +537,7 @@ bool AdventureManager::IsInExcludedZoneList(std::list<AdventureZones> excluded_z
|
|||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -551,7 +551,7 @@ bool AdventureManager::IsInExcludedZoneInList(std::list<AdventureZoneIn> exclude
|
|||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -587,7 +587,7 @@ Adventure **AdventureManager::GetFinishedAdventures(const char *player, int &cou
|
|||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -601,7 +601,7 @@ Adventure *AdventureManager::GetActiveAdventure(const char *player)
|
|||||||
{
|
{
|
||||||
return (*iter);
|
return (*iter);
|
||||||
}
|
}
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@ -621,7 +621,7 @@ AdventureTemplate *AdventureManager::GetAdventureTemplate(int theme, int id)
|
|||||||
{
|
{
|
||||||
return (*l_iter);
|
return (*l_iter);
|
||||||
}
|
}
|
||||||
l_iter++;
|
++l_iter;
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@ -788,7 +788,7 @@ void AdventureManager::PlayerClickedDoor(const char *player, int zone_id, int do
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
ClientListEntry *pc = client_list.FindCharacter(player);
|
ClientListEntry *pc = client_list.FindCharacter(player);
|
||||||
@ -855,7 +855,7 @@ void AdventureManager::IncrementCount(uint16 instance_id)
|
|||||||
current = (*iter);
|
current = (*iter);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(current)
|
if(current)
|
||||||
@ -877,7 +877,7 @@ void AdventureManager::IncrementCount(uint16 instance_id)
|
|||||||
strcpy(ac->player, (*siter).c_str());
|
strcpy(ac->player, (*siter).c_str());
|
||||||
zoneserver_list.SendPacket(pc->zone(), pc->instance(), pack);
|
zoneserver_list.SendPacket(pc->zone(), pc->instance(), pack);
|
||||||
}
|
}
|
||||||
siter++;
|
++siter;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete pack;
|
delete pack;
|
||||||
@ -895,7 +895,7 @@ void AdventureManager::IncrementAssassinationCount(uint16 instance_id)
|
|||||||
current = (*iter);
|
current = (*iter);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(current)
|
if(current)
|
||||||
@ -916,7 +916,7 @@ void AdventureManager::GetZoneData(uint16 instance_id)
|
|||||||
current = (*iter);
|
current = (*iter);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(current)
|
if(current)
|
||||||
@ -1302,7 +1302,7 @@ void AdventureManager::DoLeaderboardRequestWins(const char* player)
|
|||||||
al->entries[i].failure = li.losses;
|
al->entries[i].failure = li.losses;
|
||||||
strcpy(al->entries[i].name, li.name.c_str());
|
strcpy(al->entries[i].name, li.name.c_str());
|
||||||
i++;
|
i++;
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(place == -1 && iter != leaderboard_info_wins.end())
|
if(place == -1 && iter != leaderboard_info_wins.end())
|
||||||
@ -1318,7 +1318,7 @@ void AdventureManager::DoLeaderboardRequestWins(const char* player)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1369,7 +1369,7 @@ void AdventureManager::DoLeaderboardRequestPercentage(const char* player)
|
|||||||
al->entries[i].failure = li.losses;
|
al->entries[i].failure = li.losses;
|
||||||
strcpy(al->entries[i].name, li.name.c_str());
|
strcpy(al->entries[i].name, li.name.c_str());
|
||||||
i++;
|
i++;
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(place == -1 && iter != leaderboard_info_percentage.end())
|
if(place == -1 && iter != leaderboard_info_percentage.end())
|
||||||
@ -1385,7 +1385,7 @@ void AdventureManager::DoLeaderboardRequestPercentage(const char* player)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1436,7 +1436,7 @@ void AdventureManager::DoLeaderboardRequestWinsGuk(const char* player)
|
|||||||
al->entries[i].failure = li.guk_losses;
|
al->entries[i].failure = li.guk_losses;
|
||||||
strcpy(al->entries[i].name, li.name.c_str());
|
strcpy(al->entries[i].name, li.name.c_str());
|
||||||
i++;
|
i++;
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(place == -1 && iter != leaderboard_info_wins_guk.end())
|
if(place == -1 && iter != leaderboard_info_wins_guk.end())
|
||||||
@ -1452,7 +1452,7 @@ void AdventureManager::DoLeaderboardRequestWinsGuk(const char* player)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1503,7 +1503,7 @@ void AdventureManager::DoLeaderboardRequestPercentageGuk(const char* player)
|
|||||||
al->entries[i].failure = li.guk_losses;
|
al->entries[i].failure = li.guk_losses;
|
||||||
strcpy(al->entries[i].name, li.name.c_str());
|
strcpy(al->entries[i].name, li.name.c_str());
|
||||||
i++;
|
i++;
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(place == -1 && iter != leaderboard_info_percentage_guk.end())
|
if(place == -1 && iter != leaderboard_info_percentage_guk.end())
|
||||||
@ -1519,7 +1519,7 @@ void AdventureManager::DoLeaderboardRequestPercentageGuk(const char* player)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1570,7 +1570,7 @@ void AdventureManager::DoLeaderboardRequestWinsMir(const char* player)
|
|||||||
al->entries[i].failure = li.mir_losses;
|
al->entries[i].failure = li.mir_losses;
|
||||||
strcpy(al->entries[i].name, li.name.c_str());
|
strcpy(al->entries[i].name, li.name.c_str());
|
||||||
i++;
|
i++;
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(place == -1 && iter != leaderboard_info_wins_mir.end())
|
if(place == -1 && iter != leaderboard_info_wins_mir.end())
|
||||||
@ -1586,7 +1586,7 @@ void AdventureManager::DoLeaderboardRequestWinsMir(const char* player)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1637,7 +1637,7 @@ void AdventureManager::DoLeaderboardRequestPercentageMir(const char* player)
|
|||||||
al->entries[i].failure = li.mir_losses;
|
al->entries[i].failure = li.mir_losses;
|
||||||
strcpy(al->entries[i].name, li.name.c_str());
|
strcpy(al->entries[i].name, li.name.c_str());
|
||||||
i++;
|
i++;
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(place == -1 && iter != leaderboard_info_percentage_mir.end())
|
if(place == -1 && iter != leaderboard_info_percentage_mir.end())
|
||||||
@ -1653,7 +1653,7 @@ void AdventureManager::DoLeaderboardRequestPercentageMir(const char* player)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1704,7 +1704,7 @@ void AdventureManager::DoLeaderboardRequestWinsMmc(const char* player)
|
|||||||
al->entries[i].failure = li.mmc_losses;
|
al->entries[i].failure = li.mmc_losses;
|
||||||
strcpy(al->entries[i].name, li.name.c_str());
|
strcpy(al->entries[i].name, li.name.c_str());
|
||||||
i++;
|
i++;
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(place == -1 && iter != leaderboard_info_wins_mmc.end())
|
if(place == -1 && iter != leaderboard_info_wins_mmc.end())
|
||||||
@ -1720,7 +1720,7 @@ void AdventureManager::DoLeaderboardRequestWinsMmc(const char* player)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1771,7 +1771,7 @@ void AdventureManager::DoLeaderboardRequestPercentageMmc(const char* player)
|
|||||||
al->entries[i].failure = li.mmc_losses;
|
al->entries[i].failure = li.mmc_losses;
|
||||||
strcpy(al->entries[i].name, li.name.c_str());
|
strcpy(al->entries[i].name, li.name.c_str());
|
||||||
i++;
|
i++;
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(place == -1 && iter != leaderboard_info_percentage_mmc.end())
|
if(place == -1 && iter != leaderboard_info_percentage_mmc.end())
|
||||||
@ -1787,7 +1787,7 @@ void AdventureManager::DoLeaderboardRequestPercentageMmc(const char* player)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1838,7 +1838,7 @@ void AdventureManager::DoLeaderboardRequestWinsRuj(const char* player)
|
|||||||
al->entries[i].failure = li.ruj_losses;
|
al->entries[i].failure = li.ruj_losses;
|
||||||
strcpy(al->entries[i].name, li.name.c_str());
|
strcpy(al->entries[i].name, li.name.c_str());
|
||||||
i++;
|
i++;
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(place == -1 && iter != leaderboard_info_wins_ruj.end())
|
if(place == -1 && iter != leaderboard_info_wins_ruj.end())
|
||||||
@ -1854,7 +1854,7 @@ void AdventureManager::DoLeaderboardRequestWinsRuj(const char* player)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1905,7 +1905,7 @@ void AdventureManager::DoLeaderboardRequestPercentageRuj(const char* player)
|
|||||||
al->entries[i].failure = li.ruj_losses;
|
al->entries[i].failure = li.ruj_losses;
|
||||||
strcpy(al->entries[i].name, li.name.c_str());
|
strcpy(al->entries[i].name, li.name.c_str());
|
||||||
i++;
|
i++;
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(place == -1 && iter != leaderboard_info_percentage_ruj.end())
|
if(place == -1 && iter != leaderboard_info_percentage_ruj.end())
|
||||||
@ -1921,7 +1921,7 @@ void AdventureManager::DoLeaderboardRequestPercentageRuj(const char* player)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1972,7 +1972,7 @@ void AdventureManager::DoLeaderboardRequestWinsTak(const char* player)
|
|||||||
al->entries[i].failure = li.tak_losses;
|
al->entries[i].failure = li.tak_losses;
|
||||||
strcpy(al->entries[i].name, li.name.c_str());
|
strcpy(al->entries[i].name, li.name.c_str());
|
||||||
i++;
|
i++;
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(place == -1 && iter != leaderboard_info_wins_ruj.end())
|
if(place == -1 && iter != leaderboard_info_wins_ruj.end())
|
||||||
@ -1988,7 +1988,7 @@ void AdventureManager::DoLeaderboardRequestWinsTak(const char* player)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2039,7 +2039,7 @@ void AdventureManager::DoLeaderboardRequestPercentageTak(const char* player)
|
|||||||
al->entries[i].failure = li.tak_losses;
|
al->entries[i].failure = li.tak_losses;
|
||||||
strcpy(al->entries[i].name, li.name.c_str());
|
strcpy(al->entries[i].name, li.name.c_str());
|
||||||
i++;
|
i++;
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(place == -1 && iter != leaderboard_info_percentage_tak.end())
|
if(place == -1 && iter != leaderboard_info_percentage_tak.end())
|
||||||
@ -2055,7 +2055,7 @@ void AdventureManager::DoLeaderboardRequestPercentageTak(const char* player)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2093,7 +2093,7 @@ bool AdventureManager::PopFinishedEvent(const char *name, AdventureFinishEvent &
|
|||||||
Save();
|
Save();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -99,7 +99,7 @@ void EQLConfig::GetZones(std::vector<LauncherZone> &result) {
|
|||||||
std::map<std::string, LauncherZone>::iterator cur, end;
|
std::map<std::string, LauncherZone>::iterator cur, end;
|
||||||
cur = m_zones.begin();
|
cur = m_zones.begin();
|
||||||
end = m_zones.end();
|
end = m_zones.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
result.push_back(cur->second);
|
result.push_back(cur->second);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -112,7 +112,7 @@ std::vector<std::string> EQLConfig::ListZones() {
|
|||||||
std::map<std::string, LauncherZone>::iterator cur, end;
|
std::map<std::string, LauncherZone>::iterator cur, end;
|
||||||
cur = m_zones.begin();
|
cur = m_zones.begin();
|
||||||
end = m_zones.end();
|
end = m_zones.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
res.push_back(cur->first);
|
res.push_back(cur->first);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -120,7 +120,7 @@ std::vector<std::string> EQW::ListBootedZones() {
|
|||||||
std::vector<uint32>::iterator cur, end;
|
std::vector<uint32>::iterator cur, end;
|
||||||
cur = zones.begin();
|
cur = zones.begin();
|
||||||
end = zones.end();
|
end = zones.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
res.push_back(itoa(*cur));
|
res.push_back(itoa(*cur));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -170,7 +170,7 @@ std::vector<std::string> EQW::ListPlayers(Const_char *zone_name) {
|
|||||||
std::vector<ClientListEntry *>::iterator cur, end;
|
std::vector<ClientListEntry *>::iterator cur, end;
|
||||||
cur = list.begin();
|
cur = list.begin();
|
||||||
end = list.end();
|
end = list.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
res.push_back((*cur)->name());
|
res.push_back((*cur)->name());
|
||||||
}
|
}
|
||||||
return(res);
|
return(res);
|
||||||
|
|||||||
@ -58,7 +58,7 @@ bool LauncherLink::Process() {
|
|||||||
std::map<std::string, ZoneState>::iterator cur, end;
|
std::map<std::string, ZoneState>::iterator cur, end;
|
||||||
cur = m_states.begin();
|
cur = m_states.begin();
|
||||||
end = m_states.end();
|
end = m_states.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
if(!cur->second.up) {
|
if(!cur->second.up) {
|
||||||
StartZone(cur->first.c_str());
|
StartZone(cur->first.c_str());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,28 +32,28 @@ LauncherList::~LauncherList() {
|
|||||||
std::vector<LauncherLink *>::iterator cur, end;
|
std::vector<LauncherLink *>::iterator cur, end;
|
||||||
cur = m_pendingLaunchers.begin();
|
cur = m_pendingLaunchers.begin();
|
||||||
end = m_pendingLaunchers.end();
|
end = m_pendingLaunchers.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
delete *cur;
|
delete *cur;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::map<std::string, EQLConfig *>::iterator curc, endc;
|
std::map<std::string, EQLConfig *>::iterator curc, endc;
|
||||||
curc = m_configs.begin();
|
curc = m_configs.begin();
|
||||||
endc = m_configs.end();
|
endc = m_configs.end();
|
||||||
for(; curc != endc; curc++) {
|
for(; curc != endc; ++curc) {
|
||||||
delete curc->second;
|
delete curc->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::map<std::string, LauncherLink *>::iterator curl, endl;
|
std::map<std::string, LauncherLink *>::iterator curl, endl;
|
||||||
curl = m_launchers.begin();
|
curl = m_launchers.begin();
|
||||||
endl = m_launchers.end();
|
endl = m_launchers.end();
|
||||||
for(; curl != endl; curl++) {
|
for(; curl != endl; ++curl) {
|
||||||
delete curl->second;
|
delete curl->second;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LauncherList::Process() {
|
void LauncherList::Process() {
|
||||||
//process pending launchers..
|
//process pending launchers..
|
||||||
std::vector<LauncherLink *>::iterator cur, end;
|
std::vector<LauncherLink *>::iterator cur;
|
||||||
cur = m_pendingLaunchers.begin();
|
cur = m_pendingLaunchers.begin();
|
||||||
while(cur != m_pendingLaunchers.end()) {
|
while(cur != m_pendingLaunchers.end()) {
|
||||||
LauncherLink *l = *cur;
|
LauncherLink *l = *cur;
|
||||||
@ -79,12 +79,12 @@ void LauncherList::Process() {
|
|||||||
//put the launcher in the list.
|
//put the launcher in the list.
|
||||||
m_launchers[name] = l;
|
m_launchers[name] = l;
|
||||||
} else {
|
} else {
|
||||||
cur++;
|
++cur;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//process active launchers.
|
//process active launchers.
|
||||||
std::map<std::string, LauncherLink *>::iterator curl, tmp;
|
std::map<std::string, LauncherLink *>::iterator curl;
|
||||||
curl = m_launchers.begin();
|
curl = m_launchers.begin();
|
||||||
while(curl != m_launchers.end()) {
|
while(curl != m_launchers.end()) {
|
||||||
LauncherLink *l = curl->second;
|
LauncherLink *l = curl->second;
|
||||||
@ -92,12 +92,10 @@ void LauncherList::Process() {
|
|||||||
if(!l->Process()) {
|
if(!l->Process()) {
|
||||||
//launcher has died before it identified itself.
|
//launcher has died before it identified itself.
|
||||||
_log(WORLD__LAUNCH, "Removing launcher %s (%d)", l->GetName(), l->GetID());
|
_log(WORLD__LAUNCH, "Removing launcher %s (%d)", l->GetName(), l->GetID());
|
||||||
tmp = curl;
|
curl = m_launchers.erase(curl);
|
||||||
curl++;
|
|
||||||
m_launchers.erase(tmp);
|
|
||||||
delete l;
|
delete l;
|
||||||
} else {
|
} else {
|
||||||
curl++;
|
++curl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -124,7 +122,7 @@ LauncherLink *LauncherList::FindByZone(const char *short_name) {
|
|||||||
std::map<std::string, LauncherLink *>::iterator cur, end;
|
std::map<std::string, LauncherLink *>::iterator cur, end;
|
||||||
cur = m_launchers.begin();
|
cur = m_launchers.begin();
|
||||||
end = m_launchers.end();
|
end = m_launchers.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
if(cur->second->ContainsZone(short_name))
|
if(cur->second->ContainsZone(short_name))
|
||||||
return(cur->second);
|
return(cur->second);
|
||||||
}
|
}
|
||||||
@ -146,7 +144,7 @@ void LauncherList::GetLauncherNameList(std::vector<std::string> &res) {
|
|||||||
std::map<std::string, EQLConfig *>::iterator cur, end;
|
std::map<std::string, EQLConfig *>::iterator cur, end;
|
||||||
cur = m_configs.begin();
|
cur = m_configs.begin();
|
||||||
end = m_configs.end();
|
end = m_configs.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
res.push_back(cur->first);
|
res.push_back(cur->first);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -159,7 +157,7 @@ void LauncherList::LoadList() {
|
|||||||
std::vector<std::string>::iterator cur, end;
|
std::vector<std::string>::iterator cur, end;
|
||||||
cur = launchers.begin();
|
cur = launchers.begin();
|
||||||
end = launchers.end();
|
end = launchers.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
m_configs[*cur] = new EQLConfig(cur->c_str());
|
m_configs[*cur] = new EQLConfig(cur->c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1103,7 +1103,7 @@ void Client::SendAATimers() {
|
|||||||
PTimerList::iterator c,e;
|
PTimerList::iterator c,e;
|
||||||
c = p_timers.begin();
|
c = p_timers.begin();
|
||||||
e = p_timers.end();
|
e = p_timers.end();
|
||||||
for(; c != e; c++) {
|
for(; c != e; ++c) {
|
||||||
PersistentTimer *cur = c->second;
|
PersistentTimer *cur = c->second;
|
||||||
if(cur->GetType() < pTimerAAStart || cur->GetType() > pTimerAAEnd)
|
if(cur->GetType() < pTimerAAStart || cur->GetType() > pTimerAAEnd)
|
||||||
continue; //not an AA timer
|
continue; //not an AA timer
|
||||||
@ -1510,7 +1510,7 @@ void Client::ResetAA(){
|
|||||||
aa[i]->value = 0;
|
aa[i]->value = 0;
|
||||||
}
|
}
|
||||||
std::map<uint32,uint8>::iterator itr;
|
std::map<uint32,uint8>::iterator itr;
|
||||||
for(itr=aa_points.begin();itr!=aa_points.end();itr++)
|
for(itr=aa_points.begin();itr!=aa_points.end();++itr)
|
||||||
aa_points[itr->first] = 0;
|
aa_points[itr->first] = 0;
|
||||||
|
|
||||||
for(int i = 0; i < _maxLeaderAA; ++i)
|
for(int i = 0; i < _maxLeaderAA; ++i)
|
||||||
|
|||||||
@ -935,25 +935,25 @@ void Client::AI_Process()
|
|||||||
{
|
{
|
||||||
if(AIfeignremember_timer->Check()) {
|
if(AIfeignremember_timer->Check()) {
|
||||||
std::set<uint32>::iterator RememberedCharID, tmp;
|
std::set<uint32>::iterator RememberedCharID, tmp;
|
||||||
RememberedCharID=feign_memory_list.begin();
|
RememberedCharID = feign_memory_list.begin();
|
||||||
bool got_one = false;
|
bool got_one = false;
|
||||||
while(RememberedCharID != feign_memory_list.end()) {
|
while (RememberedCharID != feign_memory_list.end()) {
|
||||||
Client* remember_client = entity_list.GetClientByCharID(*RememberedCharID);
|
Client* remember_client = entity_list.GetClientByCharID(*RememberedCharID);
|
||||||
if(remember_client == nullptr) {
|
if (remember_client == nullptr) {
|
||||||
//they are gone now...
|
//they are gone now...
|
||||||
tmp = RememberedCharID;
|
tmp = RememberedCharID;
|
||||||
RememberedCharID++;
|
++RememberedCharID;
|
||||||
feign_memory_list.erase(tmp);
|
feign_memory_list.erase(tmp);
|
||||||
} else if (!remember_client->GetFeigned()) {
|
} else if (!remember_client->GetFeigned()) {
|
||||||
AddToHateList(remember_client->CastToMob(),1);
|
AddToHateList(remember_client->CastToMob(),1);
|
||||||
tmp = RememberedCharID;
|
tmp = RememberedCharID;
|
||||||
RememberedCharID++;
|
++RememberedCharID;
|
||||||
feign_memory_list.erase(tmp);
|
feign_memory_list.erase(tmp);
|
||||||
got_one = true;
|
got_one = true;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
//they are still feigned, carry on...
|
//they are still feigned, carry on...
|
||||||
RememberedCharID++;
|
++RememberedCharID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1406,25 +1406,25 @@ void Mob::AI_Process() {
|
|||||||
// Improved Feign Death Memory
|
// Improved Feign Death Memory
|
||||||
// check to see if any of our previous feigned targets have gotten up.
|
// check to see if any of our previous feigned targets have gotten up.
|
||||||
std::set<uint32>::iterator RememberedCharID, tmp;
|
std::set<uint32>::iterator RememberedCharID, tmp;
|
||||||
RememberedCharID=feign_memory_list.begin();
|
RememberedCharID = feign_memory_list.begin();
|
||||||
bool got_one = false;
|
bool got_one = false;
|
||||||
while(RememberedCharID != feign_memory_list.end()) {
|
while (RememberedCharID != feign_memory_list.end()) {
|
||||||
Client* remember_client = entity_list.GetClientByCharID(*RememberedCharID);
|
Client* remember_client = entity_list.GetClientByCharID(*RememberedCharID);
|
||||||
if(remember_client == nullptr) {
|
if (remember_client == nullptr) {
|
||||||
//they are gone now...
|
//they are gone now...
|
||||||
tmp = RememberedCharID;
|
tmp = RememberedCharID;
|
||||||
RememberedCharID++;
|
++RememberedCharID;
|
||||||
feign_memory_list.erase(tmp);
|
feign_memory_list.erase(tmp);
|
||||||
} else if (!remember_client->GetFeigned()) {
|
} else if (!remember_client->GetFeigned()) {
|
||||||
AddToHateList(remember_client->CastToMob(),1);
|
AddToHateList(remember_client->CastToMob(),1);
|
||||||
tmp = RememberedCharID;
|
tmp = RememberedCharID;
|
||||||
RememberedCharID++;
|
++RememberedCharID;
|
||||||
feign_memory_list.erase(tmp);
|
feign_memory_list.erase(tmp);
|
||||||
got_one = true;
|
got_one = true;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
//they are still feigned, carry on...
|
//they are still feigned, carry on...
|
||||||
RememberedCharID++;
|
++RememberedCharID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2406,7 +2406,7 @@ void NPC::RemoveSpellFromNPCList(int16 spell_id)
|
|||||||
iter = AIspells.erase(iter);
|
iter = AIspells.erase(iter);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -50,7 +50,7 @@ void QuestParserCollection::AddVar(std::string name, std::string val) {
|
|||||||
std::list<QuestInterface*>::iterator iter = _load_precedence.begin();
|
std::list<QuestInterface*>::iterator iter = _load_precedence.begin();
|
||||||
while(iter != _load_precedence.end()) {
|
while(iter != _load_precedence.end()) {
|
||||||
(*iter)->AddVar(name, val);
|
(*iter)->AddVar(name, val);
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ void QuestParserCollection::Init() {
|
|||||||
std::list<QuestInterface*>::iterator iter = _load_precedence.begin();
|
std::list<QuestInterface*>::iterator iter = _load_precedence.begin();
|
||||||
while(iter != _load_precedence.end()) {
|
while(iter != _load_precedence.end()) {
|
||||||
(*iter)->Init();
|
(*iter)->Init();
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ void QuestParserCollection::ReloadQuests(bool reset_timers) {
|
|||||||
std::list<QuestInterface*>::iterator iter = _load_precedence.begin();
|
std::list<QuestInterface*>::iterator iter = _load_precedence.begin();
|
||||||
while(iter != _load_precedence.end()) {
|
while(iter != _load_precedence.end()) {
|
||||||
(*iter)->ReloadQuests();
|
(*iter)->ReloadQuests();
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -469,7 +469,7 @@ QuestInterface *QuestParserCollection::GetQIByNPCQuest(uint32 npcid, std::string
|
|||||||
return (*iter);
|
return (*iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
//second look for /quests/zone/npcname.ext (precedence)
|
//second look for /quests/zone/npcname.ext (precedence)
|
||||||
@ -503,7 +503,7 @@ QuestInterface *QuestParserCollection::GetQIByNPCQuest(uint32 npcid, std::string
|
|||||||
return (*iter);
|
return (*iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
//third look for /quests/global/npcid.ext (precedence)
|
//third look for /quests/global/npcid.ext (precedence)
|
||||||
@ -524,7 +524,7 @@ QuestInterface *QuestParserCollection::GetQIByNPCQuest(uint32 npcid, std::string
|
|||||||
return (*iter);
|
return (*iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
//fourth look for /quests/global/npcname.ext (precedence)
|
//fourth look for /quests/global/npcname.ext (precedence)
|
||||||
@ -545,7 +545,7 @@ QuestInterface *QuestParserCollection::GetQIByNPCQuest(uint32 npcid, std::string
|
|||||||
return (*iter);
|
return (*iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
//fifth look for /quests/zone/default.ext (precedence)
|
//fifth look for /quests/zone/default.ext (precedence)
|
||||||
@ -566,7 +566,7 @@ QuestInterface *QuestParserCollection::GetQIByNPCQuest(uint32 npcid, std::string
|
|||||||
return (*iter);
|
return (*iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
//last look for /quests/global/default.ext (precedence)
|
//last look for /quests/global/default.ext (precedence)
|
||||||
@ -587,7 +587,7 @@ QuestInterface *QuestParserCollection::GetQIByNPCQuest(uint32 npcid, std::string
|
|||||||
return (*iter);
|
return (*iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@ -620,8 +620,8 @@ QuestInterface *QuestParserCollection::GetQIByPlayerQuest(std::string &filename)
|
|||||||
return (*iter);
|
return (*iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
//second look for /quests/zone/player.ext (precedence)
|
//second look for /quests/zone/player.ext (precedence)
|
||||||
filename = "quests/";
|
filename = "quests/";
|
||||||
@ -642,7 +642,7 @@ QuestInterface *QuestParserCollection::GetQIByPlayerQuest(std::string &filename)
|
|||||||
return (*iter);
|
return (*iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
//third look for /quests/global/player.ext (precedence)
|
//third look for /quests/global/player.ext (precedence)
|
||||||
@ -663,7 +663,7 @@ QuestInterface *QuestParserCollection::GetQIByPlayerQuest(std::string &filename)
|
|||||||
return (*iter);
|
return (*iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@ -691,7 +691,7 @@ QuestInterface *QuestParserCollection::GetQIByGlobalNPCQuest(std::string &filena
|
|||||||
return (*iter);
|
return (*iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@ -719,7 +719,7 @@ QuestInterface *QuestParserCollection::GetQIByGlobalPlayerQuest(std::string &fil
|
|||||||
return (*iter);
|
return (*iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@ -747,7 +747,7 @@ QuestInterface *QuestParserCollection::GetQIBySpellQuest(uint32 spell_id, std::s
|
|||||||
return (*iter);
|
return (*iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
//second look for /quests/global/spells/spell_id.ext (precedence)
|
//second look for /quests/global/spells/spell_id.ext (precedence)
|
||||||
@ -769,7 +769,7 @@ QuestInterface *QuestParserCollection::GetQIBySpellQuest(uint32 spell_id, std::s
|
|||||||
return (*iter);
|
return (*iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
//third look for /quests/zone/spells/default.ext (precedence)
|
//third look for /quests/zone/spells/default.ext (precedence)
|
||||||
@ -790,7 +790,7 @@ QuestInterface *QuestParserCollection::GetQIBySpellQuest(uint32 spell_id, std::s
|
|||||||
return (*iter);
|
return (*iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
//last look for /quests/global/spells/default.ext (precedence)
|
//last look for /quests/global/spells/default.ext (precedence)
|
||||||
@ -811,7 +811,7 @@ QuestInterface *QuestParserCollection::GetQIBySpellQuest(uint32 spell_id, std::s
|
|||||||
return (*iter);
|
return (*iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@ -839,7 +839,7 @@ QuestInterface *QuestParserCollection::GetQIByItemQuest(std::string item_script,
|
|||||||
return (*iter);
|
return (*iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
//second look for /quests/global/items/item_script.ext (precedence)
|
//second look for /quests/global/items/item_script.ext (precedence)
|
||||||
@ -861,7 +861,7 @@ QuestInterface *QuestParserCollection::GetQIByItemQuest(std::string item_script,
|
|||||||
return (*iter);
|
return (*iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
//third look for /quests/zone/items/default.ext (precedence)
|
//third look for /quests/zone/items/default.ext (precedence)
|
||||||
@ -882,7 +882,7 @@ QuestInterface *QuestParserCollection::GetQIByItemQuest(std::string item_script,
|
|||||||
return (*iter);
|
return (*iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
//last look for /quests/global/items/default.ext (precedence)
|
//last look for /quests/global/items/default.ext (precedence)
|
||||||
@ -903,7 +903,7 @@ QuestInterface *QuestParserCollection::GetQIByItemQuest(std::string item_script,
|
|||||||
return (*iter);
|
return (*iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|||||||
@ -189,7 +189,7 @@ void NPC::DescribeAggro(Client *towho, Mob *mob, bool verbose) {
|
|||||||
cur = faction_list.begin();
|
cur = faction_list.begin();
|
||||||
end = faction_list.end();
|
end = faction_list.end();
|
||||||
bool res = false;
|
bool res = false;
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
struct NPCFaction* fac = *cur;
|
struct NPCFaction* fac = *cur;
|
||||||
if ((int32)fac->factionID == mob_primary) {
|
if ((int32)fac->factionID == mob_primary) {
|
||||||
if (fac->npc_value > 0) {
|
if (fac->npc_value > 0) {
|
||||||
|
|||||||
58
zone/bot.cpp
58
zone/bot.cpp
@ -4774,7 +4774,7 @@ void Bot::LoadAndSpawnAllZonedBots(Client* botOwner) {
|
|||||||
std::list<uint32> ActiveBots = Bot::GetGroupedBotsByGroupId(botOwner->GetGroup()->GetID(), &errorMessage);
|
std::list<uint32> ActiveBots = Bot::GetGroupedBotsByGroupId(botOwner->GetGroup()->GetID(), &errorMessage);
|
||||||
|
|
||||||
if(errorMessage.empty() && !ActiveBots.empty()) {
|
if(errorMessage.empty() && !ActiveBots.empty()) {
|
||||||
for(std::list<uint32>::iterator itr = ActiveBots.begin(); itr != ActiveBots.end(); itr++) {
|
for(std::list<uint32>::iterator itr = ActiveBots.begin(); itr != ActiveBots.end(); ++itr) {
|
||||||
Bot* activeBot = Bot::LoadBot(*itr, &errorMessage);
|
Bot* activeBot = Bot::LoadBot(*itr, &errorMessage);
|
||||||
|
|
||||||
if(!errorMessage.empty()) {
|
if(!errorMessage.empty()) {
|
||||||
@ -8812,7 +8812,7 @@ void Bot::BotOrderCampAll(Client* c) {
|
|||||||
if(c) {
|
if(c) {
|
||||||
std::list<Bot*> BotList = entity_list.GetBotsByBotOwnerCharacterID(c->CharacterID());
|
std::list<Bot*> BotList = entity_list.GetBotsByBotOwnerCharacterID(c->CharacterID());
|
||||||
|
|
||||||
for(std::list<Bot*>::iterator botListItr = BotList.begin(); botListItr != BotList.end(); botListItr++) {
|
for(std::list<Bot*>::iterator botListItr = BotList.begin(); botListItr != BotList.end(); ++botListItr) {
|
||||||
(*botListItr)->Camp();
|
(*botListItr)->Camp();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -11196,7 +11196,7 @@ Bot* Bot::GetBotByBotClientOwnerAndBotName(Client* c, std::string botName) {
|
|||||||
std::list<Bot*> BotList = entity_list.GetBotsByBotOwnerCharacterID(c->CharacterID());
|
std::list<Bot*> BotList = entity_list.GetBotsByBotOwnerCharacterID(c->CharacterID());
|
||||||
|
|
||||||
if(!BotList.empty()) {
|
if(!BotList.empty()) {
|
||||||
for(std::list<Bot*>::iterator botListItr = BotList.begin(); botListItr != BotList.end(); botListItr++) {
|
for(std::list<Bot*>::iterator botListItr = BotList.begin(); botListItr != BotList.end(); ++botListItr) {
|
||||||
if(std::string((*botListItr)->GetCleanName()) == botName) {
|
if(std::string((*botListItr)->GetCleanName()) == botName) {
|
||||||
Result = (*botListItr);
|
Result = (*botListItr);
|
||||||
break;
|
break;
|
||||||
@ -11255,7 +11255,7 @@ void Bot::ProcessClientZoneChange(Client* botOwner) {
|
|||||||
if(botOwner) {
|
if(botOwner) {
|
||||||
std::list<Bot*> BotList = entity_list.GetBotsByBotOwnerCharacterID(botOwner->CharacterID());
|
std::list<Bot*> BotList = entity_list.GetBotsByBotOwnerCharacterID(botOwner->CharacterID());
|
||||||
|
|
||||||
for(std::list<Bot*>::iterator itr = BotList.begin(); itr != BotList.end(); itr++) {
|
for(std::list<Bot*>::iterator itr = BotList.begin(); itr != BotList.end(); ++itr) {
|
||||||
Bot* tempBot = *itr;
|
Bot* tempBot = *itr;
|
||||||
|
|
||||||
if(tempBot) {
|
if(tempBot) {
|
||||||
@ -11960,7 +11960,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!AvailableBots.empty()) {
|
if(!AvailableBots.empty()) {
|
||||||
for(std::list<BotsAvailableList>::iterator TempAvailableBotsList = AvailableBots.begin(); TempAvailableBotsList != AvailableBots.end(); TempAvailableBotsList++) {
|
for(std::list<BotsAvailableList>::iterator TempAvailableBotsList = AvailableBots.begin(); TempAvailableBotsList != AvailableBots.end(); ++TempAvailableBotsList) {
|
||||||
if(!listAll && TempAvailableBotsList->BotClass != iClass)
|
if(!listAll && TempAvailableBotsList->BotClass != iClass)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -12004,7 +12004,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
|||||||
std::list<Bot*> spawnedBots = entity_list.GetBotsByBotOwnerCharacterID(c->CharacterID());
|
std::list<Bot*> spawnedBots = entity_list.GetBotsByBotOwnerCharacterID(c->CharacterID());
|
||||||
|
|
||||||
if(!spawnedBots.empty()) {
|
if(!spawnedBots.empty()) {
|
||||||
for(std::list<Bot*>::iterator botsListItr = spawnedBots.begin(); botsListItr != spawnedBots.end(); botsListItr++) {
|
for(std::list<Bot*>::iterator botsListItr = spawnedBots.begin(); botsListItr != spawnedBots.end(); ++botsListItr) {
|
||||||
Bot* tempBot = *botsListItr;
|
Bot* tempBot = *botsListItr;
|
||||||
if(tempBot) {
|
if(tempBot) {
|
||||||
if(tempBot->GetClass() != WARRIOR && tempBot->GetClass() != MONK && tempBot->GetClass() != BARD && tempBot->GetClass() != BERSERKER && tempBot->GetClass() != ROGUE)
|
if(tempBot->GetClass() != WARRIOR && tempBot->GetClass() != MONK && tempBot->GetClass() != BARD && tempBot->GetClass() != BERSERKER && tempBot->GetClass() != ROGUE)
|
||||||
@ -14719,7 +14719,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!botGroupList.empty()) {
|
if(!botGroupList.empty()) {
|
||||||
for(std::list<BotGroupList>::iterator botGroupListItr = botGroupList.begin(); botGroupListItr != botGroupList.end(); botGroupListItr++) {
|
for(std::list<BotGroupList>::iterator botGroupListItr = botGroupList.begin(); botGroupListItr != botGroupList.end(); ++botGroupListItr) {
|
||||||
c->Message(0, "Bot Group Name: %s -- Bot Group Leader: %s", botGroupListItr->BotGroupName.c_str(), botGroupListItr->BotGroupLeaderName.c_str());
|
c->Message(0, "Bot Group Name: %s -- Bot Group Leader: %s", botGroupListItr->BotGroupName.c_str(), botGroupListItr->BotGroupLeaderName.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -14859,7 +14859,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::list<BotGroup>::iterator botGroupItr = botGroup.begin();
|
std::list<BotGroup>::iterator botGroupItr = botGroup.begin();
|
||||||
for(botGroupItr; botGroupItr != botGroup.end(); botGroupItr++) {
|
for(botGroupItr; botGroupItr != botGroup.end(); ++botGroupItr) {
|
||||||
// Don't try to re-spawn the botgroup's leader.
|
// Don't try to re-spawn the botgroup's leader.
|
||||||
if(botGroupItr->BotID == botGroupLeader->GetBotID()) { continue; }
|
if(botGroupItr->BotID == botGroupLeader->GetBotID()) { continue; }
|
||||||
|
|
||||||
@ -15195,7 +15195,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
|||||||
std::list<Bot*> spawnedBots = entity_list.GetBotsByBotOwnerCharacterID(c->CharacterID());
|
std::list<Bot*> spawnedBots = entity_list.GetBotsByBotOwnerCharacterID(c->CharacterID());
|
||||||
|
|
||||||
if(!spawnedBots.empty()) {
|
if(!spawnedBots.empty()) {
|
||||||
for(std::list<Bot*>::iterator botsListItr = spawnedBots.begin(); botsListItr != spawnedBots.end(); botsListItr++) {
|
for(std::list<Bot*>::iterator botsListItr = spawnedBots.begin(); botsListItr != spawnedBots.end(); ++botsListItr) {
|
||||||
Bot* tempBot = *botsListItr;
|
Bot* tempBot = *botsListItr;
|
||||||
if(tempBot) {
|
if(tempBot) {
|
||||||
tempBot->SetGroupMessagesOn(groupMessages);
|
tempBot->SetGroupMessagesOn(groupMessages);
|
||||||
@ -15545,7 +15545,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Mob* target;
|
Mob* target = nullptr;
|
||||||
std::string targetName = std::string(sep->arg[4]);
|
std::string targetName = std::string(sep->arg[4]);
|
||||||
|
|
||||||
if(!targetName.empty())
|
if(!targetName.empty())
|
||||||
@ -15635,7 +15635,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
|||||||
if(!strcasecmp(sep->arg[3], "all")) {
|
if(!strcasecmp(sep->arg[3], "all")) {
|
||||||
std::list<Bot*> BotList = entity_list.GetBotsByBotOwnerCharacterID(c->CharacterID());
|
std::list<Bot*> BotList = entity_list.GetBotsByBotOwnerCharacterID(c->CharacterID());
|
||||||
|
|
||||||
for(std::list<Bot*>::iterator botListItr = BotList.begin(); botListItr != BotList.end(); botListItr++) {
|
for(std::list<Bot*>::iterator botListItr = BotList.begin(); botListItr != BotList.end(); ++botListItr) {
|
||||||
Bot* leaderBot = *botListItr;
|
Bot* leaderBot = *botListItr;
|
||||||
if(leaderBot->GetInHealRotation() && leaderBot->GetHealRotationLeader() == leaderBot) {
|
if(leaderBot->GetInHealRotation() && leaderBot->GetHealRotationLeader() == leaderBot) {
|
||||||
//start all heal rotations
|
//start all heal rotations
|
||||||
@ -15644,7 +15644,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
|||||||
|
|
||||||
rotationMemberList = GetBotsInHealRotation(leaderBot);
|
rotationMemberList = GetBotsInHealRotation(leaderBot);
|
||||||
|
|
||||||
for(std::list<Bot*>::iterator rotationMemberItr = rotationMemberList.begin(); rotationMemberItr != rotationMemberList.end(); rotationMemberItr++) {
|
for(std::list<Bot*>::iterator rotationMemberItr = rotationMemberList.begin(); rotationMemberItr != rotationMemberList.end(); ++rotationMemberItr) {
|
||||||
Bot* tempBot = *rotationMemberItr;
|
Bot* tempBot = *rotationMemberItr;
|
||||||
|
|
||||||
if(tempBot) {
|
if(tempBot) {
|
||||||
@ -15681,7 +15681,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
|||||||
|
|
||||||
botList = GetBotsInHealRotation(leaderBot);
|
botList = GetBotsInHealRotation(leaderBot);
|
||||||
|
|
||||||
for(std::list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) {
|
for(std::list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); ++botListItr) {
|
||||||
Bot* tempBot = *botListItr;
|
Bot* tempBot = *botListItr;
|
||||||
|
|
||||||
if(tempBot) {
|
if(tempBot) {
|
||||||
@ -15712,7 +15712,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
|||||||
if(!strcasecmp(sep->arg[3], "all")) {
|
if(!strcasecmp(sep->arg[3], "all")) {
|
||||||
std::list<Bot*> BotList = entity_list.GetBotsByBotOwnerCharacterID(c->CharacterID());
|
std::list<Bot*> BotList = entity_list.GetBotsByBotOwnerCharacterID(c->CharacterID());
|
||||||
|
|
||||||
for(std::list<Bot*>::iterator botListItr = BotList.begin(); botListItr != BotList.end(); botListItr++) {
|
for(std::list<Bot*>::iterator botListItr = BotList.begin(); botListItr != BotList.end(); ++botListItr) {
|
||||||
Bot* leaderBot = *botListItr;
|
Bot* leaderBot = *botListItr;
|
||||||
if(leaderBot->GetInHealRotation() && leaderBot->GetHealRotationLeader() == leaderBot) {
|
if(leaderBot->GetInHealRotation() && leaderBot->GetHealRotationLeader() == leaderBot) {
|
||||||
//start all heal rotations
|
//start all heal rotations
|
||||||
@ -15720,7 +15720,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
|||||||
|
|
||||||
rotationMemberList = GetBotsInHealRotation(leaderBot);
|
rotationMemberList = GetBotsInHealRotation(leaderBot);
|
||||||
|
|
||||||
for(std::list<Bot*>::iterator rotationMemberItr = rotationMemberList.begin(); rotationMemberItr != rotationMemberList.end(); rotationMemberItr++) {
|
for(std::list<Bot*>::iterator rotationMemberItr = rotationMemberList.begin(); rotationMemberItr != rotationMemberList.end(); ++rotationMemberItr) {
|
||||||
Bot* tempBot = *rotationMemberItr;
|
Bot* tempBot = *rotationMemberItr;
|
||||||
|
|
||||||
if(tempBot) {
|
if(tempBot) {
|
||||||
@ -15753,7 +15753,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
|||||||
|
|
||||||
botList = GetBotsInHealRotation(leaderBot);
|
botList = GetBotsInHealRotation(leaderBot);
|
||||||
|
|
||||||
for(std::list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) {
|
for(std::list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); ++botListItr) {
|
||||||
Bot* tempBot = *botListItr;
|
Bot* tempBot = *botListItr;
|
||||||
|
|
||||||
if(tempBot && tempBot->GetBotOwnerCharacterID() == c->CharacterID()) {
|
if(tempBot && tempBot->GetBotOwnerCharacterID() == c->CharacterID()) {
|
||||||
@ -15785,7 +15785,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
|||||||
if(!strcasecmp(sep->arg[3], "all")) {
|
if(!strcasecmp(sep->arg[3], "all")) {
|
||||||
std::list<Bot*> BotList = entity_list.GetBotsByBotOwnerCharacterID(c->CharacterID());
|
std::list<Bot*> BotList = entity_list.GetBotsByBotOwnerCharacterID(c->CharacterID());
|
||||||
|
|
||||||
for(std::list<Bot*>::iterator botListItr = BotList.begin(); botListItr != BotList.end(); botListItr++) {
|
for(std::list<Bot*>::iterator botListItr = BotList.begin(); botListItr != BotList.end(); ++botListItr) {
|
||||||
Bot* tempBot = *botListItr;
|
Bot* tempBot = *botListItr;
|
||||||
if(tempBot->GetInHealRotation() && tempBot->GetHealRotationLeader() == tempBot) {
|
if(tempBot->GetInHealRotation() && tempBot->GetHealRotationLeader() == tempBot) {
|
||||||
//list leaders and number of bots per rotation
|
//list leaders and number of bots per rotation
|
||||||
@ -15816,7 +15816,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
|||||||
c->Message(0, "Bot Heal Rotation- Leader: %s", leaderBot->GetCleanName());
|
c->Message(0, "Bot Heal Rotation- Leader: %s", leaderBot->GetCleanName());
|
||||||
c->Message(0, "Bot Heal Rotation- Timer: %1.1f", ((float)leaderBot->GetHealRotationTimer()/1000.0f));
|
c->Message(0, "Bot Heal Rotation- Timer: %1.1f", ((float)leaderBot->GetHealRotationTimer()/1000.0f));
|
||||||
|
|
||||||
for(std::list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) {
|
for(std::list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); ++botListItr) {
|
||||||
Bot* tempBot = *botListItr;
|
Bot* tempBot = *botListItr;
|
||||||
|
|
||||||
if(tempBot && tempBot->GetBotOwnerCharacterID() == c->CharacterID()) {
|
if(tempBot && tempBot->GetBotOwnerCharacterID() == c->CharacterID()) {
|
||||||
@ -15874,7 +15874,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
|||||||
|
|
||||||
botList = GetBotsInHealRotation(leaderBot);
|
botList = GetBotsInHealRotation(leaderBot);
|
||||||
|
|
||||||
for(std::list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) {
|
for(std::list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); ++botListItr) {
|
||||||
Bot* tempBot = *botListItr;
|
Bot* tempBot = *botListItr;
|
||||||
|
|
||||||
if(tempBot && tempBot->GetBotOwnerCharacterID() == c->CharacterID())
|
if(tempBot && tempBot->GetBotOwnerCharacterID() == c->CharacterID())
|
||||||
@ -15922,7 +15922,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
|||||||
|
|
||||||
botList = GetBotsInHealRotation(leaderBot);
|
botList = GetBotsInHealRotation(leaderBot);
|
||||||
|
|
||||||
for(std::list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) {
|
for(std::list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); ++botListItr) {
|
||||||
Bot* tempBot = *botListItr;
|
Bot* tempBot = *botListItr;
|
||||||
|
|
||||||
if(tempBot && tempBot->GetBotOwnerCharacterID() == c->CharacterID())
|
if(tempBot && tempBot->GetBotOwnerCharacterID() == c->CharacterID())
|
||||||
@ -16238,7 +16238,7 @@ Bot* EntityList::GetBotByBotID(uint32 botID) {
|
|||||||
Bot* Result = 0;
|
Bot* Result = 0;
|
||||||
|
|
||||||
if(botID > 0) {
|
if(botID > 0) {
|
||||||
for(std::list<Bot*>::iterator botListItr = bot_list.begin(); botListItr != bot_list.end(); botListItr++) {
|
for(std::list<Bot*>::iterator botListItr = bot_list.begin(); botListItr != bot_list.end(); ++botListItr) {
|
||||||
Bot* tempBot = *botListItr;
|
Bot* tempBot = *botListItr;
|
||||||
|
|
||||||
if(tempBot && tempBot->GetBotID() == botID) {
|
if(tempBot && tempBot->GetBotID() == botID) {
|
||||||
@ -16255,7 +16255,7 @@ Bot* EntityList::GetBotByBotName(std::string botName) {
|
|||||||
Bot* Result = 0;
|
Bot* Result = 0;
|
||||||
|
|
||||||
if(!botName.empty()) {
|
if(!botName.empty()) {
|
||||||
for(std::list<Bot*>::iterator botListItr = bot_list.begin(); botListItr != bot_list.end(); botListItr++) {
|
for(std::list<Bot*>::iterator botListItr = bot_list.begin(); botListItr != bot_list.end(); ++botListItr) {
|
||||||
Bot* tempBot = *botListItr;
|
Bot* tempBot = *botListItr;
|
||||||
|
|
||||||
if(tempBot && std::string(tempBot->GetName()) == botName) {
|
if(tempBot && std::string(tempBot->GetName()) == botName) {
|
||||||
@ -16303,7 +16303,7 @@ std::list<Bot*> EntityList::GetBotsByBotOwnerCharacterID(uint32 botOwnerCharacte
|
|||||||
std::list<Bot*> Result;
|
std::list<Bot*> Result;
|
||||||
|
|
||||||
if(botOwnerCharacterID > 0) {
|
if(botOwnerCharacterID > 0) {
|
||||||
for(std::list<Bot*>::iterator botListItr = bot_list.begin(); botListItr != bot_list.end(); botListItr++) {
|
for(std::list<Bot*>::iterator botListItr = bot_list.begin(); botListItr != bot_list.end(); ++botListItr) {
|
||||||
Bot* tempBot = *botListItr;
|
Bot* tempBot = *botListItr;
|
||||||
|
|
||||||
if(tempBot && tempBot->GetBotOwnerCharacterID() == botOwnerCharacterID)
|
if(tempBot && tempBot->GetBotOwnerCharacterID() == botOwnerCharacterID)
|
||||||
@ -16366,7 +16366,7 @@ bool EntityList::RemoveBot(uint16 entityID) {
|
|||||||
bool Result = false;
|
bool Result = false;
|
||||||
|
|
||||||
if(entityID > 0) {
|
if(entityID > 0) {
|
||||||
for(std::list<Bot*>::iterator botListItr = bot_list.begin(); botListItr != bot_list.end(); botListItr++)
|
for(std::list<Bot*>::iterator botListItr = bot_list.begin(); botListItr != bot_list.end(); ++botListItr)
|
||||||
{
|
{
|
||||||
Bot* tempBot = *botListItr;
|
Bot* tempBot = *botListItr;
|
||||||
|
|
||||||
@ -16920,7 +16920,7 @@ bool Bot::AddHealRotationMember( Bot* healer ) {
|
|||||||
|
|
||||||
std::list<Bot*> botList = GetBotsInHealRotation(this);
|
std::list<Bot*> botList = GetBotsInHealRotation(this);
|
||||||
|
|
||||||
for(std::list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) {
|
for(std::list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); ++botListItr) {
|
||||||
Bot* tempBot = *botListItr;
|
Bot* tempBot = *botListItr;
|
||||||
|
|
||||||
if(tempBot)
|
if(tempBot)
|
||||||
@ -16968,7 +16968,7 @@ bool Bot::RemoveHealRotationMember( Bot* healer ) {
|
|||||||
//update rotation data
|
//update rotation data
|
||||||
std::list<Bot*> botList = GetBotsInHealRotation(leader);
|
std::list<Bot*> botList = GetBotsInHealRotation(leader);
|
||||||
|
|
||||||
for(std::list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) {
|
for(std::list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); ++botListItr) {
|
||||||
Bot* tempBot = *botListItr;
|
Bot* tempBot = *botListItr;
|
||||||
|
|
||||||
if(tempBot) {
|
if(tempBot) {
|
||||||
@ -17043,7 +17043,7 @@ bool Bot::AddHealRotationTarget( Mob* target ) {
|
|||||||
|
|
||||||
_healRotationTargets[i] = target->GetID();
|
_healRotationTargets[i] = target->GetID();
|
||||||
|
|
||||||
for(std::list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) {
|
for(std::list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); ++botListItr) {
|
||||||
Bot* tempBot = *botListItr;
|
Bot* tempBot = *botListItr;
|
||||||
|
|
||||||
if(tempBot && tempBot != this) {
|
if(tempBot && tempBot != this) {
|
||||||
@ -17081,7 +17081,7 @@ bool Bot::RemoveHealRotationTarget( Mob* target ) {
|
|||||||
index = i;
|
index = i;
|
||||||
removed = true;
|
removed = true;
|
||||||
|
|
||||||
for(std::list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) {
|
for(std::list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); ++botListItr) {
|
||||||
Bot* tempBot = *botListItr;
|
Bot* tempBot = *botListItr;
|
||||||
|
|
||||||
if(tempBot)
|
if(tempBot)
|
||||||
@ -17220,7 +17220,7 @@ void Bot::BotHealRotationsClear(Client* c) {
|
|||||||
if(c) {
|
if(c) {
|
||||||
std::list<Bot*> BotList = entity_list.GetBotsByBotOwnerCharacterID(c->CharacterID());
|
std::list<Bot*> BotList = entity_list.GetBotsByBotOwnerCharacterID(c->CharacterID());
|
||||||
|
|
||||||
for(std::list<Bot*>::iterator botListItr = BotList.begin(); botListItr != BotList.end(); botListItr++) {
|
for(std::list<Bot*>::iterator botListItr = BotList.begin(); botListItr != BotList.end(); ++botListItr) {
|
||||||
Bot* tempBot = *botListItr;
|
Bot* tempBot = *botListItr;
|
||||||
if(tempBot->GetInHealRotation()) {
|
if(tempBot->GetInHealRotation()) {
|
||||||
//clear all heal rotation data for bots in a heal rotation
|
//clear all heal rotation data for bots in a heal rotation
|
||||||
|
|||||||
@ -301,7 +301,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
|||||||
if (tar->DontBuffMeBefore() < Timer::GetCurrentTime()) {
|
if (tar->DontBuffMeBefore() < Timer::GetCurrentTime()) {
|
||||||
std::list<BotSpell> buffSpellList = GetBotSpellsBySpellType(this, SpellType_Buff);
|
std::list<BotSpell> buffSpellList = GetBotSpellsBySpellType(this, SpellType_Buff);
|
||||||
|
|
||||||
for(std::list<BotSpell>::iterator itr = buffSpellList.begin(); itr != buffSpellList.end(); itr++) {
|
for(std::list<BotSpell>::iterator itr = buffSpellList.begin(); itr != buffSpellList.end(); ++itr) {
|
||||||
BotSpell selectedBotSpell = *itr;
|
BotSpell selectedBotSpell = *itr;
|
||||||
|
|
||||||
if(selectedBotSpell.SpellId == 0)
|
if(selectedBotSpell.SpellId == 0)
|
||||||
@ -560,7 +560,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
|||||||
|
|
||||||
std::list<BotSpell> inCombatBuffList = GetBotSpellsBySpellType(this, SpellType_InCombatBuff);
|
std::list<BotSpell> inCombatBuffList = GetBotSpellsBySpellType(this, SpellType_InCombatBuff);
|
||||||
|
|
||||||
for(std::list<BotSpell>::iterator itr = inCombatBuffList.begin(); itr != inCombatBuffList.end(); itr++) {
|
for(std::list<BotSpell>::iterator itr = inCombatBuffList.begin(); itr != inCombatBuffList.end(); ++itr) {
|
||||||
BotSpell selectedBotSpell = *itr;
|
BotSpell selectedBotSpell = *itr;
|
||||||
|
|
||||||
if(selectedBotSpell.SpellId == 0)
|
if(selectedBotSpell.SpellId == 0)
|
||||||
@ -588,7 +588,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
|||||||
if (tar->DontBuffMeBefore() < Timer::GetCurrentTime()) {
|
if (tar->DontBuffMeBefore() < Timer::GetCurrentTime()) {
|
||||||
std::list<BotSpell> inCombatBuffList = GetBotSpellsBySpellType(this, SpellType_InCombatBuff);
|
std::list<BotSpell> inCombatBuffList = GetBotSpellsBySpellType(this, SpellType_InCombatBuff);
|
||||||
|
|
||||||
for(std::list<BotSpell>::iterator itr = inCombatBuffList.begin(); itr != inCombatBuffList.end(); itr++) {
|
for(std::list<BotSpell>::iterator itr = inCombatBuffList.begin(); itr != inCombatBuffList.end(); ++itr) {
|
||||||
BotSpell selectedBotSpell = *itr;
|
BotSpell selectedBotSpell = *itr;
|
||||||
|
|
||||||
if(selectedBotSpell.SpellId == 0)
|
if(selectedBotSpell.SpellId == 0)
|
||||||
@ -727,7 +727,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
|||||||
const int maxDotSelect = 5;
|
const int maxDotSelect = 5;
|
||||||
int dotSelectCounter = 0;
|
int dotSelectCounter = 0;
|
||||||
|
|
||||||
for(std::list<BotSpell>::iterator itr = dotList.begin(); itr != dotList.end(); itr++) {
|
for(std::list<BotSpell>::iterator itr = dotList.begin(); itr != dotList.end(); ++itr) {
|
||||||
BotSpell selectedBotSpell = *itr;
|
BotSpell selectedBotSpell = *itr;
|
||||||
|
|
||||||
if(selectedBotSpell.SpellId == 0)
|
if(selectedBotSpell.SpellId == 0)
|
||||||
@ -1450,7 +1450,7 @@ BotSpell Bot::GetBestBotSpellForFastHeal(Bot *botCaster) {
|
|||||||
if(botCaster) {
|
if(botCaster) {
|
||||||
std::list<BotSpell> botSpellList = GetBotSpellsForSpellEffect(botCaster, SE_CurrentHP);
|
std::list<BotSpell> botSpellList = GetBotSpellsForSpellEffect(botCaster, SE_CurrentHP);
|
||||||
|
|
||||||
for(std::list<BotSpell>::iterator botSpellListItr = botSpellList.begin(); botSpellListItr != botSpellList.end(); botSpellListItr++) {
|
for(std::list<BotSpell>::iterator botSpellListItr = botSpellList.begin(); botSpellListItr != botSpellList.end(); ++botSpellListItr) {
|
||||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||||
if(IsFastHealSpell(botSpellListItr->SpellId) && CheckSpellRecastTimers(botCaster, botSpellListItr->SpellIndex)) {
|
if(IsFastHealSpell(botSpellListItr->SpellId) && CheckSpellRecastTimers(botCaster, botSpellListItr->SpellIndex)) {
|
||||||
result.SpellId = botSpellListItr->SpellId;
|
result.SpellId = botSpellListItr->SpellId;
|
||||||
@ -1476,7 +1476,7 @@ BotSpell Bot::GetBestBotSpellForHealOverTime(Bot* botCaster) {
|
|||||||
std::list<BotSpell> botHoTSpellList = GetBotSpellsForSpellEffect(botCaster, SE_HealOverTime);
|
std::list<BotSpell> botHoTSpellList = GetBotSpellsForSpellEffect(botCaster, SE_HealOverTime);
|
||||||
std::vector<AISpells_Struct> botSpellList = botCaster->GetBotSpells();
|
std::vector<AISpells_Struct> botSpellList = botCaster->GetBotSpells();
|
||||||
|
|
||||||
for(std::list<BotSpell>::iterator botSpellListItr = botHoTSpellList.begin(); botSpellListItr != botHoTSpellList.end(); botSpellListItr++) {
|
for(std::list<BotSpell>::iterator botSpellListItr = botHoTSpellList.begin(); botSpellListItr != botHoTSpellList.end(); ++botSpellListItr) {
|
||||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||||
if(IsHealOverTimeSpell(botSpellListItr->SpellId)) {
|
if(IsHealOverTimeSpell(botSpellListItr->SpellId)) {
|
||||||
|
|
||||||
@ -1542,7 +1542,7 @@ BotSpell Bot::GetBestBotSpellForRegularSingleTargetHeal(Bot* botCaster) {
|
|||||||
if(botCaster) {
|
if(botCaster) {
|
||||||
std::list<BotSpell> botSpellList = GetBotSpellsForSpellEffect(botCaster, SE_CurrentHP);
|
std::list<BotSpell> botSpellList = GetBotSpellsForSpellEffect(botCaster, SE_CurrentHP);
|
||||||
|
|
||||||
for(std::list<BotSpell>::iterator botSpellListItr = botSpellList.begin(); botSpellListItr != botSpellList.end(); botSpellListItr++) {
|
for(std::list<BotSpell>::iterator botSpellListItr = botSpellList.begin(); botSpellListItr != botSpellList.end(); ++botSpellListItr) {
|
||||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||||
if(IsRegularSingleTargetHealSpell(botSpellListItr->SpellId) && CheckSpellRecastTimers(botCaster, botSpellListItr->SpellIndex)) {
|
if(IsRegularSingleTargetHealSpell(botSpellListItr->SpellId) && CheckSpellRecastTimers(botCaster, botSpellListItr->SpellIndex)) {
|
||||||
result.SpellId = botSpellListItr->SpellId;
|
result.SpellId = botSpellListItr->SpellId;
|
||||||
@ -1567,7 +1567,7 @@ BotSpell Bot::GetFirstBotSpellForSingleTargetHeal(Bot* botCaster) {
|
|||||||
if(botCaster) {
|
if(botCaster) {
|
||||||
std::list<BotSpell> botSpellList = GetBotSpellsForSpellEffect(botCaster, SE_CurrentHP);
|
std::list<BotSpell> botSpellList = GetBotSpellsForSpellEffect(botCaster, SE_CurrentHP);
|
||||||
|
|
||||||
for(std::list<BotSpell>::iterator botSpellListItr = botSpellList.begin(); botSpellListItr != botSpellList.end(); botSpellListItr++) {
|
for(std::list<BotSpell>::iterator botSpellListItr = botSpellList.begin(); botSpellListItr != botSpellList.end(); ++botSpellListItr) {
|
||||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||||
if((IsRegularSingleTargetHealSpell(botSpellListItr->SpellId) || IsFastHealSpell(botSpellListItr->SpellId)) && CheckSpellRecastTimers(botCaster, botSpellListItr->SpellIndex)) {
|
if((IsRegularSingleTargetHealSpell(botSpellListItr->SpellId) || IsFastHealSpell(botSpellListItr->SpellId)) && CheckSpellRecastTimers(botCaster, botSpellListItr->SpellIndex)) {
|
||||||
result.SpellId = botSpellListItr->SpellId;
|
result.SpellId = botSpellListItr->SpellId;
|
||||||
@ -1592,7 +1592,7 @@ BotSpell Bot::GetBestBotSpellForGroupHeal(Bot* botCaster) {
|
|||||||
if(botCaster) {
|
if(botCaster) {
|
||||||
std::list<BotSpell> botSpellList = GetBotSpellsForSpellEffect(botCaster, SE_CurrentHP);
|
std::list<BotSpell> botSpellList = GetBotSpellsForSpellEffect(botCaster, SE_CurrentHP);
|
||||||
|
|
||||||
for(std::list<BotSpell>::iterator botSpellListItr = botSpellList.begin(); botSpellListItr != botSpellList.end(); botSpellListItr++) {
|
for(std::list<BotSpell>::iterator botSpellListItr = botSpellList.begin(); botSpellListItr != botSpellList.end(); ++botSpellListItr) {
|
||||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||||
if(IsRegularGroupHealSpell(botSpellListItr->SpellId) && CheckSpellRecastTimers(botCaster, botSpellListItr->SpellIndex)) {
|
if(IsRegularGroupHealSpell(botSpellListItr->SpellId) && CheckSpellRecastTimers(botCaster, botSpellListItr->SpellIndex)) {
|
||||||
result.SpellId = botSpellListItr->SpellId;
|
result.SpellId = botSpellListItr->SpellId;
|
||||||
@ -1618,7 +1618,7 @@ BotSpell Bot::GetBestBotSpellForGroupHealOverTime(Bot* botCaster) {
|
|||||||
std::list<BotSpell> botHoTSpellList = GetBotSpellsForSpellEffect(botCaster, SE_HealOverTime);
|
std::list<BotSpell> botHoTSpellList = GetBotSpellsForSpellEffect(botCaster, SE_HealOverTime);
|
||||||
std::vector<AISpells_Struct> botSpellList = botCaster->GetBotSpells();
|
std::vector<AISpells_Struct> botSpellList = botCaster->GetBotSpells();
|
||||||
|
|
||||||
for(std::list<BotSpell>::iterator botSpellListItr = botHoTSpellList.begin(); botSpellListItr != botHoTSpellList.end(); botSpellListItr++) {
|
for(std::list<BotSpell>::iterator botSpellListItr = botHoTSpellList.begin(); botSpellListItr != botHoTSpellList.end(); ++botSpellListItr) {
|
||||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||||
if(IsGroupHealOverTimeSpell(botSpellListItr->SpellId)) {
|
if(IsGroupHealOverTimeSpell(botSpellListItr->SpellId)) {
|
||||||
|
|
||||||
@ -1654,7 +1654,7 @@ BotSpell Bot::GetBestBotSpellForGroupCompleteHeal(Bot* botCaster) {
|
|||||||
if(botCaster) {
|
if(botCaster) {
|
||||||
std::list<BotSpell> botSpellList = GetBotSpellsForSpellEffect(botCaster, SE_CompleteHeal);
|
std::list<BotSpell> botSpellList = GetBotSpellsForSpellEffect(botCaster, SE_CompleteHeal);
|
||||||
|
|
||||||
for(std::list<BotSpell>::iterator botSpellListItr = botSpellList.begin(); botSpellListItr != botSpellList.end(); botSpellListItr++) {
|
for(std::list<BotSpell>::iterator botSpellListItr = botSpellList.begin(); botSpellListItr != botSpellList.end(); ++botSpellListItr) {
|
||||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||||
if(IsGroupCompleteHealSpell(botSpellListItr->SpellId) && CheckSpellRecastTimers(botCaster, botSpellListItr->SpellIndex)) {
|
if(IsGroupCompleteHealSpell(botSpellListItr->SpellId) && CheckSpellRecastTimers(botCaster, botSpellListItr->SpellIndex)) {
|
||||||
result.SpellId = botSpellListItr->SpellId;
|
result.SpellId = botSpellListItr->SpellId;
|
||||||
@ -1679,7 +1679,7 @@ BotSpell Bot::GetBestBotSpellForMez(Bot* botCaster) {
|
|||||||
if(botCaster) {
|
if(botCaster) {
|
||||||
std::list<BotSpell> botSpellList = GetBotSpellsForSpellEffect(botCaster, SE_Mez);
|
std::list<BotSpell> botSpellList = GetBotSpellsForSpellEffect(botCaster, SE_Mez);
|
||||||
|
|
||||||
for(std::list<BotSpell>::iterator botSpellListItr = botSpellList.begin(); botSpellListItr != botSpellList.end(); botSpellListItr++) {
|
for(std::list<BotSpell>::iterator botSpellListItr = botSpellList.begin(); botSpellListItr != botSpellList.end(); ++botSpellListItr) {
|
||||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||||
if(IsMezSpell(botSpellListItr->SpellId) && CheckSpellRecastTimers(botCaster, botSpellListItr->SpellIndex)) {
|
if(IsMezSpell(botSpellListItr->SpellId) && CheckSpellRecastTimers(botCaster, botSpellListItr->SpellIndex)) {
|
||||||
result.SpellId = botSpellListItr->SpellId;
|
result.SpellId = botSpellListItr->SpellId;
|
||||||
@ -1704,7 +1704,7 @@ BotSpell Bot::GetBestBotSpellForMagicBasedSlow(Bot* botCaster) {
|
|||||||
if(botCaster) {
|
if(botCaster) {
|
||||||
std::list<BotSpell> botSpellList = GetBotSpellsForSpellEffect(botCaster, SE_AttackSpeed);
|
std::list<BotSpell> botSpellList = GetBotSpellsForSpellEffect(botCaster, SE_AttackSpeed);
|
||||||
|
|
||||||
for(std::list<BotSpell>::iterator botSpellListItr = botSpellList.begin(); botSpellListItr != botSpellList.end(); botSpellListItr++) {
|
for(std::list<BotSpell>::iterator botSpellListItr = botSpellList.begin(); botSpellListItr != botSpellList.end(); ++botSpellListItr) {
|
||||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||||
if(IsSlowSpell(botSpellListItr->SpellId) && spells[botSpellListItr->SpellId].resisttype == RESIST_MAGIC && CheckSpellRecastTimers(botCaster, botSpellListItr->SpellIndex)) {
|
if(IsSlowSpell(botSpellListItr->SpellId) && spells[botSpellListItr->SpellId].resisttype == RESIST_MAGIC && CheckSpellRecastTimers(botCaster, botSpellListItr->SpellIndex)) {
|
||||||
result.SpellId = botSpellListItr->SpellId;
|
result.SpellId = botSpellListItr->SpellId;
|
||||||
@ -1729,7 +1729,7 @@ BotSpell Bot::GetBestBotSpellForDiseaseBasedSlow(Bot* botCaster) {
|
|||||||
if(botCaster) {
|
if(botCaster) {
|
||||||
std::list<BotSpell> botSpellList = GetBotSpellsForSpellEffect(botCaster, SE_AttackSpeed);
|
std::list<BotSpell> botSpellList = GetBotSpellsForSpellEffect(botCaster, SE_AttackSpeed);
|
||||||
|
|
||||||
for(std::list<BotSpell>::iterator botSpellListItr = botSpellList.begin(); botSpellListItr != botSpellList.end(); botSpellListItr++) {
|
for(std::list<BotSpell>::iterator botSpellListItr = botSpellList.begin(); botSpellListItr != botSpellList.end(); ++botSpellListItr) {
|
||||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||||
if(IsSlowSpell(botSpellListItr->SpellId) && spells[botSpellListItr->SpellId].resisttype == RESIST_DISEASE && CheckSpellRecastTimers(botCaster, botSpellListItr->SpellIndex)) {
|
if(IsSlowSpell(botSpellListItr->SpellId) && spells[botSpellListItr->SpellId].resisttype == RESIST_DISEASE && CheckSpellRecastTimers(botCaster, botSpellListItr->SpellIndex)) {
|
||||||
result.SpellId = botSpellListItr->SpellId;
|
result.SpellId = botSpellListItr->SpellId;
|
||||||
@ -1752,7 +1752,7 @@ Mob* Bot::GetFirstIncomingMobToMez(Bot* botCaster, BotSpell botSpell) {
|
|||||||
std::list<NPC*> npc_list;
|
std::list<NPC*> npc_list;
|
||||||
entity_list.GetNPCList(npc_list);
|
entity_list.GetNPCList(npc_list);
|
||||||
|
|
||||||
for(std::list<NPC*>::iterator itr = npc_list.begin(); itr != npc_list.end(); itr++) {
|
for(std::list<NPC*>::iterator itr = npc_list.begin(); itr != npc_list.end(); ++itr) {
|
||||||
NPC* npc = *itr;
|
NPC* npc = *itr;
|
||||||
|
|
||||||
if(npc->DistNoRootNoZ(*botCaster) <= botCaster->GetActSpellRange(botSpell.SpellId, spells[botSpell.SpellId].range)) {
|
if(npc->DistNoRootNoZ(*botCaster) <= botCaster->GetActSpellRange(botSpell.SpellId, spells[botSpell.SpellId].range)) {
|
||||||
@ -1792,7 +1792,7 @@ BotSpell Bot::GetBestBotMagicianPetSpell(Bot *botCaster) {
|
|||||||
|
|
||||||
std::string petType = GetBotMagicianPetType(botCaster);
|
std::string petType = GetBotMagicianPetType(botCaster);
|
||||||
|
|
||||||
for(std::list<BotSpell>::iterator botSpellListItr = botSpellList.begin(); botSpellListItr != botSpellList.end(); botSpellListItr++) {
|
for(std::list<BotSpell>::iterator botSpellListItr = botSpellList.begin(); botSpellListItr != botSpellList.end(); ++botSpellListItr) {
|
||||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||||
if(IsSummonPetSpell(botSpellListItr->SpellId) && CheckSpellRecastTimers(botCaster, botSpellListItr->SpellIndex)) {
|
if(IsSummonPetSpell(botSpellListItr->SpellId) && CheckSpellRecastTimers(botCaster, botSpellListItr->SpellIndex)) {
|
||||||
if(!strncmp(spells[botSpellListItr->SpellId].teleport_zone, petType.c_str(), petType.length())) {
|
if(!strncmp(spells[botSpellListItr->SpellId].teleport_zone, petType.c_str(), petType.length())) {
|
||||||
@ -1901,7 +1901,7 @@ BotSpell Bot::GetBestBotSpellForNukeByTargetType(Bot* botCaster, SpellTargetType
|
|||||||
if(botCaster) {
|
if(botCaster) {
|
||||||
std::list<BotSpell> botSpellList = GetBotSpellsForSpellEffectAndTargetType(botCaster, SE_CurrentHP, targetType);
|
std::list<BotSpell> botSpellList = GetBotSpellsForSpellEffectAndTargetType(botCaster, SE_CurrentHP, targetType);
|
||||||
|
|
||||||
for(std::list<BotSpell>::iterator botSpellListItr = botSpellList.begin(); botSpellListItr != botSpellList.end(); botSpellListItr++) {
|
for(std::list<BotSpell>::iterator botSpellListItr = botSpellList.begin(); botSpellListItr != botSpellList.end(); ++botSpellListItr) {
|
||||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||||
if(IsPureNukeSpell(botSpellListItr->SpellId) && IsDamageSpell(botSpellListItr->SpellId) && CheckSpellRecastTimers(botCaster, botSpellListItr->SpellIndex)) {
|
if(IsPureNukeSpell(botSpellListItr->SpellId) && IsDamageSpell(botSpellListItr->SpellId) && CheckSpellRecastTimers(botCaster, botSpellListItr->SpellIndex)) {
|
||||||
result.SpellId = botSpellListItr->SpellId;
|
result.SpellId = botSpellListItr->SpellId;
|
||||||
@ -1928,7 +1928,7 @@ BotSpell Bot::GetBestBotSpellForStunByTargetType(Bot* botCaster, SpellTargetType
|
|||||||
{
|
{
|
||||||
std::list<BotSpell> botSpellList = GetBotSpellsForSpellEffectAndTargetType(botCaster, SE_Stun, targetType);
|
std::list<BotSpell> botSpellList = GetBotSpellsForSpellEffectAndTargetType(botCaster, SE_Stun, targetType);
|
||||||
|
|
||||||
for(std::list<BotSpell>::iterator botSpellListItr = botSpellList.begin(); botSpellListItr != botSpellList.end(); botSpellListItr++)
|
for(std::list<BotSpell>::iterator botSpellListItr = botSpellList.begin(); botSpellListItr != botSpellList.end(); ++botSpellListItr)
|
||||||
{
|
{
|
||||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||||
if(IsStunSpell(botSpellListItr->SpellId) && CheckSpellRecastTimers(botCaster, botSpellListItr->SpellIndex))
|
if(IsStunSpell(botSpellListItr->SpellId) && CheckSpellRecastTimers(botCaster, botSpellListItr->SpellIndex))
|
||||||
@ -1967,7 +1967,7 @@ BotSpell Bot::GetBestBotWizardNukeSpellByTargetResists(Bot* botCaster, Mob* targ
|
|||||||
firstWizardMagicNukeSpellFound.SpellIndex = 0;
|
firstWizardMagicNukeSpellFound.SpellIndex = 0;
|
||||||
firstWizardMagicNukeSpellFound.ManaCost = 0;
|
firstWizardMagicNukeSpellFound.ManaCost = 0;
|
||||||
|
|
||||||
for(std::list<BotSpell>::iterator botSpellListItr = botSpellList.begin(); botSpellListItr != botSpellList.end(); botSpellListItr++) {
|
for(std::list<BotSpell>::iterator botSpellListItr = botSpellList.begin(); botSpellListItr != botSpellList.end(); ++botSpellListItr) {
|
||||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||||
bool spellSelected = false;
|
bool spellSelected = false;
|
||||||
|
|
||||||
@ -2139,7 +2139,7 @@ BotSpell Bot::GetBestBotSpellForCure(Bot* botCaster, Mob *tar) {
|
|||||||
|
|
||||||
//Check for group cure first
|
//Check for group cure first
|
||||||
if(countNeedsCured > 2) {
|
if(countNeedsCured > 2) {
|
||||||
for(std::list<BotSpell>::iterator itr = cureList.begin(); itr != cureList.end(); itr++) {
|
for(std::list<BotSpell>::iterator itr = cureList.begin(); itr != cureList.end(); ++itr) {
|
||||||
BotSpell selectedBotSpell = *itr;
|
BotSpell selectedBotSpell = *itr;
|
||||||
|
|
||||||
if(IsGroupSpell(itr->SpellId) && CheckSpellRecastTimers(botCaster, itr->SpellIndex)) {
|
if(IsGroupSpell(itr->SpellId) && CheckSpellRecastTimers(botCaster, itr->SpellIndex)) {
|
||||||
@ -2176,7 +2176,7 @@ BotSpell Bot::GetBestBotSpellForCure(Bot* botCaster, Mob *tar) {
|
|||||||
|
|
||||||
//no group cure for target- try to find single target spell
|
//no group cure for target- try to find single target spell
|
||||||
if(!spellSelected) {
|
if(!spellSelected) {
|
||||||
for(std::list<BotSpell>::iterator itr = cureList.begin(); itr != cureList.end(); itr++) {
|
for(std::list<BotSpell>::iterator itr = cureList.begin(); itr != cureList.end(); ++itr) {
|
||||||
BotSpell selectedBotSpell = *itr;
|
BotSpell selectedBotSpell = *itr;
|
||||||
|
|
||||||
if(CheckSpellRecastTimers(botCaster, itr->SpellIndex)) {
|
if(CheckSpellRecastTimers(botCaster, itr->SpellIndex)) {
|
||||||
|
|||||||
@ -4748,7 +4748,7 @@ void Client::ShowSkillsWindow()
|
|||||||
Skills[SkillName[i]] = (SkillUseTypes)i;
|
Skills[SkillName[i]] = (SkillUseTypes)i;
|
||||||
|
|
||||||
// print out all available skills
|
// print out all available skills
|
||||||
for(it = Skills.begin(); it != Skills.end(); it++) {
|
for(it = Skills.begin(); it != Skills.end(); ++it) {
|
||||||
if(GetSkill(it->second) > 0 || MaxSkill(it->second) > 0) {
|
if(GetSkill(it->second) > 0 || MaxSkill(it->second) > 0) {
|
||||||
WindowText += it->first;
|
WindowText += it->first;
|
||||||
// line up the values
|
// line up the values
|
||||||
@ -5142,7 +5142,7 @@ void Client::SendRewards()
|
|||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(iter != zone->VeteranRewards.end())
|
if(iter != zone->VeteranRewards.end())
|
||||||
@ -5232,7 +5232,7 @@ bool Client::TryReward(uint32 claim_id)
|
|||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(iter == zone->VeteranRewards.end())
|
if(iter == zone->VeteranRewards.end())
|
||||||
@ -6606,7 +6606,7 @@ void Client::SendStatsWindow(Client* client, bool use_window)
|
|||||||
|
|
||||||
for(std::map <uint32, int32>::iterator iter = item_faction_bonuses.begin();
|
for(std::map <uint32, int32>::iterator iter = item_faction_bonuses.begin();
|
||||||
iter != item_faction_bonuses.end();
|
iter != item_faction_bonuses.end();
|
||||||
iter++)
|
++iter)
|
||||||
{
|
{
|
||||||
memset(&faction_buf, 0, sizeof(faction_buf));
|
memset(&faction_buf, 0, sizeof(faction_buf));
|
||||||
|
|
||||||
@ -6728,7 +6728,7 @@ void Client::SendAltCurrencies() {
|
|||||||
altc->entries[i].stack_size = 1000;
|
altc->entries[i].stack_size = 1000;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
FastQueuePacket(&outapp);
|
FastQueuePacket(&outapp);
|
||||||
@ -6776,7 +6776,7 @@ void Client::SendAlternateCurrencyValues()
|
|||||||
std::list<AltCurrencyDefinition_Struct>::iterator iter = zone->AlternateCurrencies.begin();
|
std::list<AltCurrencyDefinition_Struct>::iterator iter = zone->AlternateCurrencies.begin();
|
||||||
while(iter != zone->AlternateCurrencies.end()) {
|
while(iter != zone->AlternateCurrencies.end()) {
|
||||||
SendAlternateCurrencyValue((*iter).id, false);
|
SendAlternateCurrencyValue((*iter).id, false);
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7215,7 +7215,7 @@ void Client::SendMercPersonalInfo()
|
|||||||
mdus->MercData[i].Stances[stanceindex].StanceIndex = stanceindex;
|
mdus->MercData[i].Stances[stanceindex].StanceIndex = stanceindex;
|
||||||
mdus->MercData[i].Stances[stanceindex].Stance = (iter->StanceID);
|
mdus->MercData[i].Stances[stanceindex].Stance = (iter->StanceID);
|
||||||
stanceindex++;
|
stanceindex++;
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7281,7 +7281,7 @@ void Client::SendMercPersonalInfo()
|
|||||||
mml->Mercs[i].Stances[stanceindex].StanceIndex = stanceindex;
|
mml->Mercs[i].Stances[stanceindex].StanceIndex = stanceindex;
|
||||||
mml->Mercs[i].Stances[stanceindex].Stance = (iter->StanceID);
|
mml->Mercs[i].Stances[stanceindex].Stance = (iter->StanceID);
|
||||||
stanceindex++;
|
stanceindex++;
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FastQueuePacket(&outapp);
|
FastQueuePacket(&outapp);
|
||||||
@ -7898,7 +7898,7 @@ bool Client::RemoveRespawnOption(std::string option_name)
|
|||||||
opt = &(*itr);
|
opt = &(*itr);
|
||||||
if (opt->name.compare(option_name) == 0)
|
if (opt->name.compare(option_name) == 0)
|
||||||
{
|
{
|
||||||
respawn_options.erase(itr);
|
itr = respawn_options.erase(itr);
|
||||||
had = true;
|
had = true;
|
||||||
//could be more with the same name, so keep going...
|
//could be more with the same name, so keep going...
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,7 +38,7 @@ void ClientLogs::subscribe(EQEMuLog::LogIDs id, Client *c) {
|
|||||||
std::vector<Client *>::iterator cur,end;
|
std::vector<Client *>::iterator cur,end;
|
||||||
cur = entries[id].begin();
|
cur = entries[id].begin();
|
||||||
end = entries[id].end();
|
end = entries[id].end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
if(*cur == c) {
|
if(*cur == c) {
|
||||||
printf("%s was allready subscribed to %d\n", c->GetName(), id);
|
printf("%s was allready subscribed to %d\n", c->GetName(), id);
|
||||||
return;
|
return;
|
||||||
@ -58,7 +58,7 @@ void ClientLogs::unsubscribe(EQEMuLog::LogIDs id, Client *c) {
|
|||||||
std::vector<Client *>::iterator cur,end;
|
std::vector<Client *>::iterator cur,end;
|
||||||
cur = entries[id].begin();
|
cur = entries[id].begin();
|
||||||
end = entries[id].end();
|
end = entries[id].end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
if(*cur == c) {
|
if(*cur == c) {
|
||||||
entries[id].erase(cur);
|
entries[id].erase(cur);
|
||||||
return;
|
return;
|
||||||
@ -97,7 +97,7 @@ void ClientLogs::msg(EQEMuLog::LogIDs id, const char *buf) {
|
|||||||
std::vector<Client *>::iterator cur,end;
|
std::vector<Client *>::iterator cur,end;
|
||||||
cur = entries[id].begin();
|
cur = entries[id].begin();
|
||||||
end = entries[id].end();
|
end = entries[id].end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
if(!(*cur)->InZone())
|
if(!(*cur)->InZone())
|
||||||
continue;
|
continue;
|
||||||
(*cur)->Message(CLIENT_LOG_CHANNEL, buf);
|
(*cur)->Message(CLIENT_LOG_CHANNEL, buf);
|
||||||
|
|||||||
@ -2215,7 +2215,7 @@ void Client::Handle_OP_AdventureMerchantRequest(const EQApplicationPacket *app)
|
|||||||
const Item_Struct *item = 0;
|
const Item_Struct *item = 0;
|
||||||
std::list<MerchantList> merlist = zone->merchanttable[merchantid];
|
std::list<MerchantList> merlist = zone->merchanttable[merchantid];
|
||||||
std::list<MerchantList>::const_iterator itr;
|
std::list<MerchantList>::const_iterator itr;
|
||||||
for(itr = merlist.begin();itr != merlist.end() && count<255;itr++){
|
for(itr = merlist.begin();itr != merlist.end() && count<255;++itr){
|
||||||
const MerchantList &ml = *itr;
|
const MerchantList &ml = *itr;
|
||||||
if(GetLevel() < ml.level_required) {
|
if(GetLevel() < ml.level_required) {
|
||||||
continue;
|
continue;
|
||||||
@ -2311,7 +2311,7 @@ void Client::Handle_OP_AdventureMerchantPurchase(const EQApplicationPacket *app)
|
|||||||
std::list<MerchantList> merlist = zone->merchanttable[merchantid];
|
std::list<MerchantList> merlist = zone->merchanttable[merchantid];
|
||||||
std::list<MerchantList>::const_iterator itr;
|
std::list<MerchantList>::const_iterator itr;
|
||||||
|
|
||||||
for(itr = merlist.begin();itr != merlist.end();itr++){
|
for(itr = merlist.begin();itr != merlist.end();++itr){
|
||||||
MerchantList ml = *itr;
|
MerchantList ml = *itr;
|
||||||
if(GetLevel() < ml.level_required) {
|
if(GetLevel() < ml.level_required) {
|
||||||
continue;
|
continue;
|
||||||
@ -5505,7 +5505,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app)
|
|||||||
uint32 item_id = 0;
|
uint32 item_id = 0;
|
||||||
std::list<MerchantList> merlist = zone->merchanttable[merchantid];
|
std::list<MerchantList> merlist = zone->merchanttable[merchantid];
|
||||||
std::list<MerchantList>::const_iterator itr;
|
std::list<MerchantList>::const_iterator itr;
|
||||||
for(itr = merlist.begin();itr != merlist.end();itr++){
|
for(itr = merlist.begin();itr != merlist.end();++itr){
|
||||||
MerchantList ml = *itr;
|
MerchantList ml = *itr;
|
||||||
if(GetLevel() < ml.level_required) {
|
if(GetLevel() < ml.level_required) {
|
||||||
continue;
|
continue;
|
||||||
@ -5527,7 +5527,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app)
|
|||||||
std::list<TempMerchantList> tmp_merlist = zone->tmpmerchanttable[tmp->GetNPCTypeID()];
|
std::list<TempMerchantList> tmp_merlist = zone->tmpmerchanttable[tmp->GetNPCTypeID()];
|
||||||
std::list<TempMerchantList>::const_iterator tmp_itr;
|
std::list<TempMerchantList>::const_iterator tmp_itr;
|
||||||
TempMerchantList ml;
|
TempMerchantList ml;
|
||||||
for(tmp_itr = tmp_merlist.begin();tmp_itr != tmp_merlist.end();tmp_itr++){
|
for(tmp_itr = tmp_merlist.begin();tmp_itr != tmp_merlist.end();++tmp_itr){
|
||||||
ml = *tmp_itr;
|
ml = *tmp_itr;
|
||||||
if(mp->itemslot == ml.slot){
|
if(mp->itemslot == ml.slot){
|
||||||
item_id = ml.item;
|
item_id = ml.item;
|
||||||
@ -9220,7 +9220,7 @@ bool Client::FinishConnState2(DBAsyncWork* dbaw) {
|
|||||||
|
|
||||||
// Send stuff on the cursor which isnt sent in bulk
|
// Send stuff on the cursor which isnt sent in bulk
|
||||||
iter_queue it;
|
iter_queue it;
|
||||||
for (it=m_inv.cursor_begin();it!=m_inv.cursor_end();it++) {
|
for (it=m_inv.cursor_begin();it!=m_inv.cursor_end();++it) {
|
||||||
// First item cursor is sent in bulk inventory packet
|
// First item cursor is sent in bulk inventory packet
|
||||||
if (it==m_inv.cursor_begin())
|
if (it==m_inv.cursor_begin())
|
||||||
continue;
|
continue;
|
||||||
@ -12544,7 +12544,7 @@ void Client::Handle_OP_AltCurrencyMerchantRequest(const EQApplicationPacket *app
|
|||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
altc_iter++;
|
++altc_iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!found) {
|
if(!found) {
|
||||||
@ -12560,7 +12560,7 @@ void Client::Handle_OP_AltCurrencyMerchantRequest(const EQApplicationPacket *app
|
|||||||
|
|
||||||
std::list<MerchantList> merlist = zone->merchanttable[merchant_id];
|
std::list<MerchantList> merlist = zone->merchanttable[merchant_id];
|
||||||
std::list<MerchantList>::const_iterator itr;
|
std::list<MerchantList>::const_iterator itr;
|
||||||
for(itr = merlist.begin(); itr != merlist.end() && count < 255; itr++){
|
for(itr = merlist.begin(); itr != merlist.end() && count < 255; ++itr){
|
||||||
const MerchantList &ml = *itr;
|
const MerchantList &ml = *itr;
|
||||||
if(GetLevel() < ml.level_required) {
|
if(GetLevel() < ml.level_required) {
|
||||||
continue;
|
continue;
|
||||||
@ -12627,7 +12627,7 @@ void Client::Handle_OP_AltCurrencySellSelection(const EQApplicationPacket *app)
|
|||||||
bool found = false;
|
bool found = false;
|
||||||
std::list<MerchantList> merlist = zone->merchanttable[merchant_id];
|
std::list<MerchantList> merlist = zone->merchanttable[merchant_id];
|
||||||
std::list<MerchantList>::const_iterator itr;
|
std::list<MerchantList>::const_iterator itr;
|
||||||
for(itr = merlist.begin(); itr != merlist.end(); itr++) {
|
for(itr = merlist.begin(); itr != merlist.end(); ++itr) {
|
||||||
MerchantList ml = *itr;
|
MerchantList ml = *itr;
|
||||||
if(GetLevel() < ml.level_required) {
|
if(GetLevel() < ml.level_required) {
|
||||||
continue;
|
continue;
|
||||||
@ -12689,7 +12689,7 @@ void Client::Handle_OP_AltCurrencyPurchase(const EQApplicationPacket *app) {
|
|||||||
bool found = false;
|
bool found = false;
|
||||||
std::list<MerchantList> merlist = zone->merchanttable[merchant_id];
|
std::list<MerchantList> merlist = zone->merchanttable[merchant_id];
|
||||||
std::list<MerchantList>::const_iterator itr;
|
std::list<MerchantList>::const_iterator itr;
|
||||||
for(itr = merlist.begin(); itr != merlist.end(); itr++) {
|
for(itr = merlist.begin(); itr != merlist.end(); ++itr) {
|
||||||
MerchantList ml = *itr;
|
MerchantList ml = *itr;
|
||||||
if(GetLevel() < ml.level_required) {
|
if(GetLevel() < ml.level_required) {
|
||||||
continue;
|
continue;
|
||||||
@ -12751,7 +12751,7 @@ void Client::Handle_OP_AltCurrencyReclaim(const EQApplicationPacket *app) {
|
|||||||
if((*iter).id == reclaim->currency_id) {
|
if((*iter).id == reclaim->currency_id) {
|
||||||
item_id = (*iter).item_id;
|
item_id = (*iter).item_id;
|
||||||
}
|
}
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(item_id == 0) {
|
if(item_id == 0) {
|
||||||
@ -12806,7 +12806,7 @@ void Client::Handle_OP_AltCurrencySell(const EQApplicationPacket *app) {
|
|||||||
bool found = false;
|
bool found = false;
|
||||||
std::list<MerchantList> merlist = zone->merchanttable[merchant_id];
|
std::list<MerchantList> merlist = zone->merchanttable[merchant_id];
|
||||||
std::list<MerchantList>::const_iterator itr;
|
std::list<MerchantList>::const_iterator itr;
|
||||||
for(itr = merlist.begin(); itr != merlist.end(); itr++) {
|
for(itr = merlist.begin(); itr != merlist.end(); ++itr) {
|
||||||
MerchantList ml = *itr;
|
MerchantList ml = *itr;
|
||||||
if(GetLevel() < ml.level_required) {
|
if(GetLevel() < ml.level_required) {
|
||||||
continue;
|
continue;
|
||||||
@ -13498,10 +13498,10 @@ void Client::Handle_OP_MercenaryDataRequest(const EQApplicationPacket *app)
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
int StanceCount = 0;
|
int StanceCount = 0;
|
||||||
|
|
||||||
for(std::list<MercData>::iterator mercListItr = mercDataList.begin(); mercListItr != mercDataList.end(); mercListItr++)
|
for(std::list<MercData>::iterator mercListItr = mercDataList.begin(); mercListItr != mercDataList.end(); ++mercListItr)
|
||||||
{
|
{
|
||||||
std::list<MercStanceInfo>::iterator siter = zone->merc_stance_list[mercListItr->MercTemplateID].begin();
|
std::list<MercStanceInfo>::iterator siter = zone->merc_stance_list[mercListItr->MercTemplateID].begin();
|
||||||
for(siter = zone->merc_stance_list[mercListItr->MercTemplateID].begin(); siter != zone->merc_stance_list[mercListItr->MercTemplateID].end(); siter++)
|
for(siter = zone->merc_stance_list[mercListItr->MercTemplateID].begin(); siter != zone->merc_stance_list[mercListItr->MercTemplateID].end(); ++siter)
|
||||||
{
|
{
|
||||||
StanceCount++;
|
StanceCount++;
|
||||||
}
|
}
|
||||||
@ -13513,7 +13513,7 @@ void Client::Handle_OP_MercenaryDataRequest(const EQApplicationPacket *app)
|
|||||||
mml->MercTypeCount = mercTypeCount;
|
mml->MercTypeCount = mercTypeCount;
|
||||||
if(mercTypeCount > 0)
|
if(mercTypeCount > 0)
|
||||||
{
|
{
|
||||||
for(std::list<MercType>::iterator mercTypeListItr = mercTypeList.begin(); mercTypeListItr != mercTypeList.end(); mercTypeListItr++) {
|
for(std::list<MercType>::iterator mercTypeListItr = mercTypeList.begin(); mercTypeListItr != mercTypeList.end(); ++mercTypeListItr) {
|
||||||
mml->MercGrades[i] = mercTypeListItr->Type; // DBStringID for Type
|
mml->MercGrades[i] = mercTypeListItr->Type; // DBStringID for Type
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
@ -13523,7 +13523,7 @@ void Client::Handle_OP_MercenaryDataRequest(const EQApplicationPacket *app)
|
|||||||
if(mercCount > 0)
|
if(mercCount > 0)
|
||||||
{
|
{
|
||||||
i = 0;
|
i = 0;
|
||||||
for(std::list<MercData>::iterator mercListIter = mercDataList.begin(); mercListIter != mercDataList.end(); mercListIter++)
|
for(std::list<MercData>::iterator mercListIter = mercDataList.begin(); mercListIter != mercDataList.end(); ++mercListIter)
|
||||||
{
|
{
|
||||||
mml->Mercs[i].MercID = mercListIter->MercTemplateID;
|
mml->Mercs[i].MercID = mercListIter->MercTemplateID;
|
||||||
mml->Mercs[i].MercType = mercListIter->MercType;
|
mml->Mercs[i].MercType = mercListIter->MercType;
|
||||||
@ -13540,7 +13540,7 @@ void Client::Handle_OP_MercenaryDataRequest(const EQApplicationPacket *app)
|
|||||||
mml->Mercs[i].MercUnk02 = 1;
|
mml->Mercs[i].MercUnk02 = 1;
|
||||||
int mercStanceCount = 0;
|
int mercStanceCount = 0;
|
||||||
std::list<MercStanceInfo>::iterator iter = zone->merc_stance_list[mercListIter->MercTemplateID].begin();
|
std::list<MercStanceInfo>::iterator iter = zone->merc_stance_list[mercListIter->MercTemplateID].begin();
|
||||||
for(iter = zone->merc_stance_list[mercListIter->MercTemplateID].begin(); iter != zone->merc_stance_list[mercListIter->MercTemplateID].end(); iter++)
|
for(iter = zone->merc_stance_list[mercListIter->MercTemplateID].begin(); iter != zone->merc_stance_list[mercListIter->MercTemplateID].end(); ++iter)
|
||||||
{
|
{
|
||||||
mercStanceCount++;
|
mercStanceCount++;
|
||||||
}
|
}
|
||||||
@ -13557,7 +13557,7 @@ void Client::Handle_OP_MercenaryDataRequest(const EQApplicationPacket *app)
|
|||||||
mml->Mercs[i].Stances[stanceindex].StanceIndex = stanceindex;
|
mml->Mercs[i].Stances[stanceindex].StanceIndex = stanceindex;
|
||||||
mml->Mercs[i].Stances[stanceindex].Stance = (iter2->StanceID);
|
mml->Mercs[i].Stances[stanceindex].Stance = (iter2->StanceID);
|
||||||
stanceindex++;
|
stanceindex++;
|
||||||
iter2++;
|
++iter2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
@ -13692,7 +13692,7 @@ void Client::Handle_OP_MercenaryCommand(const EQApplicationPacket *app)
|
|||||||
std::list<MercStanceInfo>::iterator iter = mercStanceList.begin();
|
std::list<MercStanceInfo>::iterator iter = mercStanceList.begin();
|
||||||
while(iter != mercStanceList.end()) {
|
while(iter != mercStanceList.end()) {
|
||||||
numStances++;
|
numStances++;
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
MercTemplate* mercTemplate = zone->GetMercTemplate(GetMerc()->GetMercTemplateID());
|
MercTemplate* mercTemplate = zone->GetMercTemplate(GetMerc()->GetMercTemplateID());
|
||||||
|
|||||||
@ -904,7 +904,7 @@ void Client::BulkSendInventoryItems() {
|
|||||||
|
|
||||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_CharInventory, size);
|
EQApplicationPacket* outapp = new EQApplicationPacket(OP_CharInventory, size);
|
||||||
uchar* ptr = outapp->pBuffer;
|
uchar* ptr = outapp->pBuffer;
|
||||||
for(itr = ser_items.begin(); itr != ser_items.end(); itr++){
|
for(itr = ser_items.begin(); itr != ser_items.end(); ++itr){
|
||||||
int length = itr->second.length();
|
int length = itr->second.length();
|
||||||
if(length > 5) {
|
if(length > 5) {
|
||||||
memcpy(ptr, itr->second.c_str(), length);
|
memcpy(ptr, itr->second.c_str(), length);
|
||||||
@ -978,7 +978,7 @@ void Client::BulkSendMerchantInventory(int merchant_id, int npcid) {
|
|||||||
|
|
||||||
uint32 i=1;
|
uint32 i=1;
|
||||||
uint8 handychance = 0;
|
uint8 handychance = 0;
|
||||||
for(itr = merlist.begin();itr != merlist.end() && i<numItemSlots;itr++){
|
for (itr = merlist.begin(); itr != merlist.end() && i < numItemSlots; ++itr) {
|
||||||
MerchantList ml = *itr;
|
MerchantList ml = *itr;
|
||||||
if(GetLevel() < ml.level_required) {
|
if(GetLevel() < ml.level_required) {
|
||||||
continue;
|
continue;
|
||||||
@ -1027,7 +1027,7 @@ void Client::BulkSendMerchantInventory(int merchant_id, int npcid) {
|
|||||||
}
|
}
|
||||||
std::list<TempMerchantList> origtmp_merlist = zone->tmpmerchanttable[npcid];
|
std::list<TempMerchantList> origtmp_merlist = zone->tmpmerchanttable[npcid];
|
||||||
tmp_merlist.clear();
|
tmp_merlist.clear();
|
||||||
for(tmp_itr = origtmp_merlist.begin();tmp_itr != origtmp_merlist.end() && i<numItemSlots;tmp_itr++){
|
for(tmp_itr = origtmp_merlist.begin();tmp_itr != origtmp_merlist.end() && i<numItemSlots;++tmp_itr){
|
||||||
TempMerchantList ml = *tmp_itr;
|
TempMerchantList ml = *tmp_itr;
|
||||||
item=database.GetItem(ml.item);
|
item=database.GetItem(ml.item);
|
||||||
ml.slot=i;
|
ml.slot=i;
|
||||||
|
|||||||
@ -461,7 +461,7 @@ int command_init(void) {
|
|||||||
std::map<std::string,uint8> command_settings;
|
std::map<std::string,uint8> command_settings;
|
||||||
std::map<std::string,uint8>::iterator itr;
|
std::map<std::string,uint8>::iterator itr;
|
||||||
database.GetCommandSettings(command_settings);
|
database.GetCommandSettings(command_settings);
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
if ((itr=command_settings.find(cur->first))!=command_settings.end())
|
if ((itr=command_settings.find(cur->first))!=command_settings.end())
|
||||||
{
|
{
|
||||||
cur->second->access = itr->second;
|
cur->second->access = itr->second;
|
||||||
@ -526,7 +526,7 @@ int command_add(const char *command_string, const char *desc, int access, CmdFun
|
|||||||
std::map<std::string, CommandRecord *>::iterator cur,end,del;
|
std::map<std::string, CommandRecord *>::iterator cur,end,del;
|
||||||
cur = commandlist.begin();
|
cur = commandlist.begin();
|
||||||
end = commandlist.end();
|
end = commandlist.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
if(cur->second->function == function) {
|
if(cur->second->function == function) {
|
||||||
int r;
|
int r;
|
||||||
for(r = 1; r < CMDALIASES; r++) {
|
for(r = 1; r < CMDALIASES; r++) {
|
||||||
@ -782,7 +782,7 @@ void command_help(Client *c, const Seperator *sep)
|
|||||||
cur = commandlist.begin();
|
cur = commandlist.begin();
|
||||||
end = commandlist.end();
|
end = commandlist.end();
|
||||||
|
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
if(sep->arg[1][0]) {
|
if(sep->arg[1][0]) {
|
||||||
if(cur->first.find(sep->arg[1]) == std::string::npos) {
|
if(cur->first.find(sep->arg[1]) == std::string::npos) {
|
||||||
continue;
|
continue;
|
||||||
@ -2961,7 +2961,7 @@ void command_peekinv(Client *c, const Seperator *sep)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for(it=client->GetInv().cursor_begin();it!=client->GetInv().cursor_end();it++,i++) {
|
for(it=client->GetInv().cursor_begin();it!=client->GetInv().cursor_end();++it,i++) {
|
||||||
const ItemInst* inst = *it;
|
const ItemInst* inst = *it;
|
||||||
item = (inst) ? inst->GetItem() : nullptr;
|
item = (inst) ? inst->GetItem() : nullptr;
|
||||||
if (c->GetClientVersion() >= EQClientSoF)
|
if (c->GetClientVersion() >= EQClientSoF)
|
||||||
@ -8299,7 +8299,7 @@ void command_rules(Client *c, const Seperator *sep) {
|
|||||||
std::map<int, std::string>::iterator cur, end;
|
std::map<int, std::string>::iterator cur, end;
|
||||||
cur = sets.begin();
|
cur = sets.begin();
|
||||||
end = sets.end();
|
end = sets.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
c->Message(0, "(%d) %s", cur->first, cur->second.c_str());
|
c->Message(0, "(%d) %s", cur->first, cur->second.c_str());
|
||||||
}
|
}
|
||||||
} else if(!strcasecmp(sep->arg[1], "reload")) {
|
} else if(!strcasecmp(sep->arg[1], "reload")) {
|
||||||
@ -8398,7 +8398,7 @@ void command_rules(Client *c, const Seperator *sep) {
|
|||||||
std::vector<const char *>::iterator cur, end;
|
std::vector<const char *>::iterator cur, end;
|
||||||
cur = rule_list.begin();
|
cur = rule_list.begin();
|
||||||
end = rule_list.end();
|
end = rule_list.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
c->Message(0, " %s", *cur);
|
c->Message(0, " %s", *cur);
|
||||||
}
|
}
|
||||||
} else if(sep->argnum == 2) {
|
} else if(sep->argnum == 2) {
|
||||||
@ -8414,7 +8414,7 @@ void command_rules(Client *c, const Seperator *sep) {
|
|||||||
std::vector<const char *>::iterator cur, end;
|
std::vector<const char *>::iterator cur, end;
|
||||||
cur = rule_list.begin();
|
cur = rule_list.begin();
|
||||||
end = rule_list.end();
|
end = rule_list.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
c->Message(0, " %s", *cur);
|
c->Message(0, " %s", *cur);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -8437,7 +8437,7 @@ void command_rules(Client *c, const Seperator *sep) {
|
|||||||
std::vector<const char *>::iterator cur, end;
|
std::vector<const char *>::iterator cur, end;
|
||||||
cur = rule_list.begin();
|
cur = rule_list.begin();
|
||||||
end = rule_list.end();
|
end = rule_list.end();
|
||||||
for(std::string tmp_value; cur != end; cur++) {
|
for(std::string tmp_value; cur != end; ++cur) {
|
||||||
if (RuleManager::Instance()->GetRule(*cur, tmp_value))
|
if (RuleManager::Instance()->GetRule(*cur, tmp_value))
|
||||||
c->Message(0, " %s - %s", *cur, tmp_value.c_str());
|
c->Message(0, " %s - %s", *cur, tmp_value.c_str());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -389,7 +389,7 @@ Corpse::Corpse(Client* client, int32 in_rezexp)
|
|||||||
// this was mainly for client profile state reflection..should match db player inventory entries now.
|
// this was mainly for client profile state reflection..should match db player inventory entries now.
|
||||||
|
|
||||||
iter_queue it;
|
iter_queue it;
|
||||||
for(it=client->GetInv().cursor_begin(),i=8001; it!=client->GetInv().cursor_end(); it++,i++) {
|
for(it=client->GetInv().cursor_begin(),i=8001; it!=client->GetInv().cursor_end(); ++it,i++) {
|
||||||
item = *it;
|
item = *it;
|
||||||
if((item && (!client->IsBecomeNPC())) || (item && client->IsBecomeNPC() && !item->GetItem()->NoRent))
|
if((item && (!client->IsBecomeNPC())) || (item && client->IsBecomeNPC() && !item->GetItem()->NoRent))
|
||||||
{
|
{
|
||||||
@ -413,7 +413,7 @@ Corpse::Corpse(Client* client, int32 in_rezexp)
|
|||||||
ss << " OR ";
|
ss << " OR ";
|
||||||
}
|
}
|
||||||
ss << "slotid=" << (*iter);
|
ss << "slotid=" << (*iter);
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
ss << ")";
|
ss << ")";
|
||||||
database.RunQuery(ss.str().c_str(), ss.str().length());
|
database.RunQuery(ss.str().c_str(), ss.str().length());
|
||||||
@ -519,7 +519,7 @@ Corpse::~Corpse() {
|
|||||||
ItemList::iterator cur,end;
|
ItemList::iterator cur,end;
|
||||||
cur = itemlist.begin();
|
cur = itemlist.begin();
|
||||||
end = itemlist.end();
|
end = itemlist.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
ServerLootItem_Struct* item = *cur;
|
ServerLootItem_Struct* item = *cur;
|
||||||
safe_delete(item);
|
safe_delete(item);
|
||||||
}
|
}
|
||||||
@ -598,7 +598,7 @@ bool Corpse::Save() {
|
|||||||
ItemList::iterator cur,end;
|
ItemList::iterator cur,end;
|
||||||
cur = itemlist.begin();
|
cur = itemlist.begin();
|
||||||
end = itemlist.end();
|
end = itemlist.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
ServerLootItem_Struct* item = *cur;
|
ServerLootItem_Struct* item = *cur;
|
||||||
memcpy((char*) &dbpc->items[x++], (char*) item, sizeof(player_lootitem::ServerLootItem_Struct));
|
memcpy((char*) &dbpc->items[x++], (char*) item, sizeof(player_lootitem::ServerLootItem_Struct));
|
||||||
}
|
}
|
||||||
@ -675,7 +675,7 @@ ServerLootItem_Struct* Corpse::GetItem(uint16 lootslot, ServerLootItem_Struct**
|
|||||||
ItemList::iterator cur,end;
|
ItemList::iterator cur,end;
|
||||||
cur = itemlist.begin();
|
cur = itemlist.begin();
|
||||||
end = itemlist.end();
|
end = itemlist.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
if((*cur)->lootslot == lootslot)
|
if((*cur)->lootslot == lootslot)
|
||||||
{
|
{
|
||||||
sitem = *cur;
|
sitem = *cur;
|
||||||
@ -689,7 +689,7 @@ ServerLootItem_Struct* Corpse::GetItem(uint16 lootslot, ServerLootItem_Struct**
|
|||||||
|
|
||||||
cur = itemlist.begin();
|
cur = itemlist.begin();
|
||||||
end = itemlist.end();
|
end = itemlist.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
sitem2 = *cur;
|
sitem2 = *cur;
|
||||||
if(sitem2->equipSlot >= bagstart && sitem2->equipSlot < bagstart + 10)
|
if(sitem2->equipSlot >= bagstart && sitem2->equipSlot < bagstart + 10)
|
||||||
{
|
{
|
||||||
@ -705,7 +705,7 @@ uint32 Corpse::GetWornItem(int16 equipSlot) const {
|
|||||||
ItemList::const_iterator cur,end;
|
ItemList::const_iterator cur,end;
|
||||||
cur = itemlist.begin();
|
cur = itemlist.begin();
|
||||||
end = itemlist.end();
|
end = itemlist.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
ServerLootItem_Struct* item = *cur;
|
ServerLootItem_Struct* item = *cur;
|
||||||
if (item->equipSlot == equipSlot)
|
if (item->equipSlot == equipSlot)
|
||||||
{
|
{
|
||||||
@ -725,7 +725,7 @@ void Corpse::RemoveItem(uint16 lootslot)
|
|||||||
ItemList::iterator cur,end;
|
ItemList::iterator cur,end;
|
||||||
cur = itemlist.begin();
|
cur = itemlist.begin();
|
||||||
end = itemlist.end();
|
end = itemlist.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
ServerLootItem_Struct* sitem = *cur;
|
ServerLootItem_Struct* sitem = *cur;
|
||||||
if (sitem->lootslot == lootslot)
|
if (sitem->lootslot == lootslot)
|
||||||
{
|
{
|
||||||
@ -742,7 +742,7 @@ void Corpse::RemoveItem(ServerLootItem_Struct* item_data)
|
|||||||
ItemList::iterator cur,end;
|
ItemList::iterator cur,end;
|
||||||
cur = itemlist.begin();
|
cur = itemlist.begin();
|
||||||
end = itemlist.end();
|
end = itemlist.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
ServerLootItem_Struct* sitem = *cur;
|
ServerLootItem_Struct* sitem = *cur;
|
||||||
if (sitem == item_data)
|
if (sitem == item_data)
|
||||||
{
|
{
|
||||||
@ -1006,7 +1006,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
|
|||||||
else if(client->GetClientVersion() == EQClientTitanium) { corpselootlimit = 31; }
|
else if(client->GetClientVersion() == EQClientTitanium) { corpselootlimit = 31; }
|
||||||
else { corpselootlimit = 30; }
|
else { corpselootlimit = 30; }
|
||||||
|
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
ServerLootItem_Struct* item_data = *cur;
|
ServerLootItem_Struct* item_data = *cur;
|
||||||
item_data->lootslot = 0xFFFF;
|
item_data->lootslot = 0xFFFF;
|
||||||
|
|
||||||
@ -1046,7 +1046,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
|
|||||||
|
|
||||||
cur = itemlist.begin();
|
cur = itemlist.begin();
|
||||||
end = itemlist.end();
|
end = itemlist.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
ServerLootItem_Struct* item_data = *cur;
|
ServerLootItem_Struct* item_data = *cur;
|
||||||
item = database.GetItem(item_data->item_id);
|
item = database.GetItem(item_data->item_id);
|
||||||
LogFile->write(EQEMuLog::Debug, "Corpse Looting: %s was not sent to client loot window (corpse_dbid: %i, charname: %s(%s))", item->Name, GetDBID(), client->GetName(), client->GetGM() ? "GM" : "Owner");
|
LogFile->write(EQEMuLog::Debug, "Corpse Looting: %s was not sent to client loot window (corpse_dbid: %i, charname: %s(%s))", item->Name, GetDBID(), client->GetName(), client->GetGM() ? "GM" : "Owner");
|
||||||
@ -1337,7 +1337,7 @@ void Corpse::QueryLoot(Client* to) {
|
|||||||
else if (to->GetClientVersion() == EQClientTitanium) { corpselootlimit = 31; }
|
else if (to->GetClientVersion() == EQClientTitanium) { corpselootlimit = 31; }
|
||||||
else { corpselootlimit = 30; }
|
else { corpselootlimit = 30; }
|
||||||
|
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
ServerLootItem_Struct* sitem = *cur;
|
ServerLootItem_Struct* sitem = *cur;
|
||||||
|
|
||||||
if (IsPlayerCorpse()) {
|
if (IsPlayerCorpse()) {
|
||||||
@ -1403,7 +1403,7 @@ bool Corpse::Summon(Client* client, bool spell, bool CheckDistance)
|
|||||||
{
|
{
|
||||||
bool consented = false;
|
bool consented = false;
|
||||||
std::list<std::string>::iterator itr;
|
std::list<std::string>::iterator itr;
|
||||||
for(itr = client->consent_list.begin(); itr != client->consent_list.end(); itr++)
|
for(itr = client->consent_list.begin(); itr != client->consent_list.end(); ++itr)
|
||||||
{
|
{
|
||||||
if(strcmp(this->GetOwnerName(), itr->c_str()) == 0)
|
if(strcmp(this->GetOwnerName(), itr->c_str()) == 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -131,7 +131,7 @@ public:
|
|||||||
hv_clear(hv);
|
hv_clear(hv);
|
||||||
|
|
||||||
// Iterate through key-value pairs, storing them in hash
|
// Iterate through key-value pairs, storing them in hash
|
||||||
for (it = vals.begin(); it != vals.end(); it++)
|
for (it = vals.begin(); it != vals.end(); ++it)
|
||||||
{
|
{
|
||||||
int keylen = static_cast<int>(it->first.length());
|
int keylen = static_cast<int>(it->first.length());
|
||||||
|
|
||||||
|
|||||||
@ -348,7 +348,7 @@ void EntityList::CheckGroupList (const char *fname, const int fline)
|
|||||||
{
|
{
|
||||||
std::list<Group *>::iterator it;
|
std::list<Group *>::iterator it;
|
||||||
|
|
||||||
for (it = group_list.begin(); it != group_list.end(); it++)
|
for (it = group_list.begin(); it != group_list.end(); ++it)
|
||||||
{
|
{
|
||||||
if (*it == nullptr)
|
if (*it == nullptr)
|
||||||
{
|
{
|
||||||
@ -394,7 +394,7 @@ void EntityList::QueueToGroupsForNPCHealthAA(Mob* sender, const EQApplicationPac
|
|||||||
while(iterator != group_list.end())
|
while(iterator != group_list.end())
|
||||||
{
|
{
|
||||||
(*iterator)->QueueHPPacketsForNPCHealthAA(sender, app);
|
(*iterator)->QueueHPPacketsForNPCHealthAA(sender, app);
|
||||||
iterator++;
|
++iterator;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -410,7 +410,7 @@ void EntityList::RaidProcess() {
|
|||||||
{
|
{
|
||||||
count++;
|
count++;
|
||||||
(*iterator)->Process();
|
(*iterator)->Process();
|
||||||
iterator++;
|
++iterator;
|
||||||
}
|
}
|
||||||
if(count == 0)
|
if(count == 0)
|
||||||
net.raid_timer.Disable();//No groups in list, disable until one is added
|
net.raid_timer.Disable();//No groups in list, disable until one is added
|
||||||
@ -1938,7 +1938,7 @@ Group* EntityList::GetGroupByMob(Mob* mob)
|
|||||||
if ((*iterator)->IsGroupMember(mob)) {
|
if ((*iterator)->IsGroupMember(mob)) {
|
||||||
return *iterator;
|
return *iterator;
|
||||||
}
|
}
|
||||||
iterator++;
|
++iterator;
|
||||||
}
|
}
|
||||||
#if EQDEBUG >= 5
|
#if EQDEBUG >= 5
|
||||||
CheckGroupList (__FILE__, __LINE__);
|
CheckGroupList (__FILE__, __LINE__);
|
||||||
@ -1956,7 +1956,7 @@ Group* EntityList::GetGroupByLeaderName(const char* leader){
|
|||||||
if (!strcmp((*iterator)->GetLeaderName(), leader)) {
|
if (!strcmp((*iterator)->GetLeaderName(), leader)) {
|
||||||
return *iterator;
|
return *iterator;
|
||||||
}
|
}
|
||||||
iterator++;
|
++iterator;
|
||||||
}
|
}
|
||||||
#if EQDEBUG >= 5
|
#if EQDEBUG >= 5
|
||||||
CheckGroupList (__FILE__, __LINE__);
|
CheckGroupList (__FILE__, __LINE__);
|
||||||
@ -1973,7 +1973,7 @@ Group* EntityList::GetGroupByID(uint32 group_id){
|
|||||||
if ((*iterator)->GetID() == group_id) {
|
if ((*iterator)->GetID() == group_id) {
|
||||||
return *iterator;
|
return *iterator;
|
||||||
}
|
}
|
||||||
iterator++;
|
++iterator;
|
||||||
}
|
}
|
||||||
#if EQDEBUG >= 5
|
#if EQDEBUG >= 5
|
||||||
CheckGroupList (__FILE__, __LINE__);
|
CheckGroupList (__FILE__, __LINE__);
|
||||||
@ -1991,7 +1991,7 @@ Group* EntityList::GetGroupByClient(Client* client)
|
|||||||
if ((*iterator)->IsGroupMember(client->CastToMob())) {
|
if ((*iterator)->IsGroupMember(client->CastToMob())) {
|
||||||
return *iterator;
|
return *iterator;
|
||||||
}
|
}
|
||||||
iterator++;
|
++iterator;
|
||||||
}
|
}
|
||||||
#if EQDEBUG >= 5
|
#if EQDEBUG >= 5
|
||||||
CheckGroupList (__FILE__, __LINE__);
|
CheckGroupList (__FILE__, __LINE__);
|
||||||
@ -2011,7 +2011,7 @@ Raid* EntityList::GetRaidByLeaderName(const char *leader){
|
|||||||
return *iterator;
|
return *iterator;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
iterator++;
|
++iterator;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -2025,7 +2025,7 @@ Raid* EntityList::GetRaidByID(uint32 id){
|
|||||||
if ((*iterator)->GetID() == id) {
|
if ((*iterator)->GetID() == id) {
|
||||||
return *iterator;
|
return *iterator;
|
||||||
}
|
}
|
||||||
iterator++;
|
++iterator;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -2045,7 +2045,7 @@ Raid* EntityList::GetRaidByClient(Client* client)
|
|||||||
return *iterator;
|
return *iterator;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
iterator++;
|
++iterator;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -2065,7 +2065,7 @@ Raid* EntityList::GetRaidByMob(Mob* mob) {
|
|||||||
return *iterator;
|
return *iterator;
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
iterator++;
|
++iterator;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -2507,7 +2507,7 @@ bool EntityList::RemoveGroup(uint32 delete_id){
|
|||||||
#endif
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
iterator++;
|
++iterator;
|
||||||
}
|
}
|
||||||
#if EQDEBUG >= 5
|
#if EQDEBUG >= 5
|
||||||
CheckGroupList (__FILE__, __LINE__);
|
CheckGroupList (__FILE__, __LINE__);
|
||||||
@ -2526,7 +2526,7 @@ bool EntityList::RemoveRaid(uint32 delete_id){
|
|||||||
raid_list.remove (*iterator);
|
raid_list.remove (*iterator);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
iterator++;
|
++iterator;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -3821,7 +3821,7 @@ bool EntityList::LimitCheckType(uint32 npc_type, int count) {
|
|||||||
cur = npc_limit_list.begin();
|
cur = npc_limit_list.begin();
|
||||||
end = npc_limit_list.end();
|
end = npc_limit_list.end();
|
||||||
|
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
if(cur->second.npc_type == npc_type) {
|
if(cur->second.npc_type == npc_type) {
|
||||||
count--;
|
count--;
|
||||||
if(count == 0) {
|
if(count == 0) {
|
||||||
@ -3842,7 +3842,7 @@ bool EntityList::LimitCheckGroup(uint32 spawngroup_id, int count) {
|
|||||||
cur = npc_limit_list.begin();
|
cur = npc_limit_list.begin();
|
||||||
end = npc_limit_list.end();
|
end = npc_limit_list.end();
|
||||||
|
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
if(cur->second.spawngroup_id == spawngroup_id) {
|
if(cur->second.spawngroup_id == spawngroup_id) {
|
||||||
count--;
|
count--;
|
||||||
if(count == 0) {
|
if(count == 0) {
|
||||||
@ -3864,7 +3864,7 @@ bool EntityList::LimitCheckBoth(uint32 npc_type, uint32 spawngroup_id, int group
|
|||||||
cur = npc_limit_list.begin();
|
cur = npc_limit_list.begin();
|
||||||
end = npc_limit_list.end();
|
end = npc_limit_list.end();
|
||||||
|
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
if(cur->second.npc_type == npc_type) {
|
if(cur->second.npc_type == npc_type) {
|
||||||
type_count--;
|
type_count--;
|
||||||
if(type_count == 0) {
|
if(type_count == 0) {
|
||||||
|
|||||||
@ -177,7 +177,7 @@ uint8 *ZoneGuildManager::MakeGuildMembers(uint32 guild_id, const char *prefix_na
|
|||||||
end = members.end();
|
end = members.end();
|
||||||
uint32 name_len = 0;
|
uint32 name_len = 0;
|
||||||
uint32 note_len = 0;
|
uint32 note_len = 0;
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
ci = *cur;
|
ci = *cur;
|
||||||
name_len += ci->char_name.length();
|
name_len += ci->char_name.length();
|
||||||
note_len += ci->public_note.length();
|
note_len += ci->public_note.length();
|
||||||
@ -205,7 +205,7 @@ uint8 *ZoneGuildManager::MakeGuildMembers(uint32 guild_id, const char *prefix_na
|
|||||||
|
|
||||||
cur = members.begin();
|
cur = members.begin();
|
||||||
end = members.end();
|
end = members.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
ci = *cur;
|
ci = *cur;
|
||||||
|
|
||||||
//the order we set things here must match the struct
|
//the order we set things here must match the struct
|
||||||
@ -247,7 +247,7 @@ void ZoneGuildManager::ListGuilds(Client *c) const {
|
|||||||
cur = m_guilds.begin();
|
cur = m_guilds.begin();
|
||||||
end = m_guilds.end();
|
end = m_guilds.end();
|
||||||
int r = 0;
|
int r = 0;
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
leadername[0] = '\0';
|
leadername[0] = '\0';
|
||||||
database.GetCharName(cur->second->leader_char_id, leadername);
|
database.GetCharName(cur->second->leader_char_id, leadername);
|
||||||
if (leadername[0] == '\0')
|
if (leadername[0] == '\0')
|
||||||
|
|||||||
@ -2236,7 +2236,7 @@ bool Merc::AICastSpell(int8 iChance, int32 iSpellTypes) {
|
|||||||
|
|
||||||
std::list<MercSpell> buffSpellList = GetMercSpellsBySpellType(this, SpellType_Buff);
|
std::list<MercSpell> buffSpellList = GetMercSpellsBySpellType(this, SpellType_Buff);
|
||||||
|
|
||||||
for(std::list<MercSpell>::iterator itr = buffSpellList.begin(); itr != buffSpellList.end(); itr++) {
|
for(std::list<MercSpell>::iterator itr = buffSpellList.begin(); itr != buffSpellList.end(); ++itr) {
|
||||||
MercSpell selectedMercSpell = *itr;
|
MercSpell selectedMercSpell = *itr;
|
||||||
|
|
||||||
if(!((spells[selectedMercSpell.spellid].targettype == ST_Target || spells[selectedMercSpell.spellid].targettype == ST_Pet ||
|
if(!((spells[selectedMercSpell.spellid].targettype == ST_Target || spells[selectedMercSpell.spellid].targettype == ST_Pet ||
|
||||||
@ -2396,7 +2396,7 @@ bool Merc::AICastSpell(int8 iChance, int32 iSpellTypes) {
|
|||||||
std::list<MercSpell> buffSpellList = GetMercSpellsBySpellType(this, SpellType_InCombatBuff);
|
std::list<MercSpell> buffSpellList = GetMercSpellsBySpellType(this, SpellType_InCombatBuff);
|
||||||
Mob* tar = this;
|
Mob* tar = this;
|
||||||
|
|
||||||
for(std::list<MercSpell>::iterator itr = buffSpellList.begin(); itr != buffSpellList.end(); itr++) {
|
for(std::list<MercSpell>::iterator itr = buffSpellList.begin(); itr != buffSpellList.end(); ++itr) {
|
||||||
MercSpell selectedMercSpell = *itr;
|
MercSpell selectedMercSpell = *itr;
|
||||||
|
|
||||||
if(!(spells[selectedMercSpell.spellid].targettype == ST_Self)) {
|
if(!(spells[selectedMercSpell.spellid].targettype == ST_Self)) {
|
||||||
@ -2541,7 +2541,7 @@ void Merc::CheckHateList() {
|
|||||||
std::list<NPC*> npc_list;
|
std::list<NPC*> npc_list;
|
||||||
entity_list.GetNPCList(npc_list);
|
entity_list.GetNPCList(npc_list);
|
||||||
|
|
||||||
for(std::list<NPC*>::iterator itr = npc_list.begin(); itr != npc_list.end(); itr++) {
|
for(std::list<NPC*>::iterator itr = npc_list.begin(); itr != npc_list.end(); ++itr) {
|
||||||
NPC* npc = *itr;
|
NPC* npc = *itr;
|
||||||
float dist = npc->DistNoRootNoZ(*this);
|
float dist = npc->DistNoRootNoZ(*this);
|
||||||
int radius = RuleI(Mercs, AggroRadius);
|
int radius = RuleI(Mercs, AggroRadius);
|
||||||
@ -2594,7 +2594,7 @@ bool Merc::CheckAENuke(Merc* caster, Mob* tar, uint16 spell_id, uint8 &numTarget
|
|||||||
std::list<NPC*> npc_list;
|
std::list<NPC*> npc_list;
|
||||||
entity_list.GetNPCList(npc_list);
|
entity_list.GetNPCList(npc_list);
|
||||||
|
|
||||||
for(std::list<NPC*>::iterator itr = npc_list.begin(); itr != npc_list.end(); itr++) {
|
for(std::list<NPC*>::iterator itr = npc_list.begin(); itr != npc_list.end(); ++itr) {
|
||||||
NPC* npc = *itr;
|
NPC* npc = *itr;
|
||||||
|
|
||||||
if(npc->DistNoRootNoZ(*tar) <= spells[spell_id].aoerange * spells[spell_id].aoerange) {
|
if(npc->DistNoRootNoZ(*tar) <= spells[spell_id].aoerange * spells[spell_id].aoerange) {
|
||||||
@ -3311,7 +3311,7 @@ MercSpell Merc::GetBestMercSpellForVeryFastHeal(Merc* caster) {
|
|||||||
if(caster) {
|
if(caster) {
|
||||||
std::list<MercSpell> mercSpellList = GetMercSpellsForSpellEffect(caster, SE_CurrentHP);
|
std::list<MercSpell> mercSpellList = GetMercSpellsForSpellEffect(caster, SE_CurrentHP);
|
||||||
|
|
||||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); mercSpellListItr++) {
|
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
||||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||||
if(IsVeryFastHealSpell(mercSpellListItr->spellid)
|
if(IsVeryFastHealSpell(mercSpellListItr->spellid)
|
||||||
&& CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
&& CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
||||||
@ -3343,7 +3343,7 @@ MercSpell Merc::GetBestMercSpellForFastHeal(Merc* caster) {
|
|||||||
if(caster) {
|
if(caster) {
|
||||||
std::list<MercSpell> mercSpellList = GetMercSpellsForSpellEffect(caster, SE_CurrentHP);
|
std::list<MercSpell> mercSpellList = GetMercSpellsForSpellEffect(caster, SE_CurrentHP);
|
||||||
|
|
||||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); mercSpellListItr++) {
|
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
||||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||||
if(IsFastHealSpell(mercSpellListItr->spellid)
|
if(IsFastHealSpell(mercSpellListItr->spellid)
|
||||||
&& CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
&& CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
||||||
@ -3375,7 +3375,7 @@ MercSpell Merc::GetBestMercSpellForHealOverTime(Merc* caster) {
|
|||||||
if(caster) {
|
if(caster) {
|
||||||
std::list<MercSpell> mercHoTSpellList = GetMercSpellsForSpellEffect(caster, SE_HealOverTime);
|
std::list<MercSpell> mercHoTSpellList = GetMercSpellsForSpellEffect(caster, SE_HealOverTime);
|
||||||
|
|
||||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercHoTSpellList.begin(); mercSpellListItr != mercHoTSpellList.end(); mercSpellListItr++) {
|
for(std::list<MercSpell>::iterator mercSpellListItr = mercHoTSpellList.begin(); mercSpellListItr != mercHoTSpellList.end(); ++mercSpellListItr) {
|
||||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||||
if(IsHealOverTimeSpell(mercSpellListItr->spellid)) {
|
if(IsHealOverTimeSpell(mercSpellListItr->spellid)) {
|
||||||
|
|
||||||
@ -3415,7 +3415,7 @@ MercSpell Merc::GetBestMercSpellForPercentageHeal(Merc* caster) {
|
|||||||
if(caster && caster->AI_HasSpells()) {
|
if(caster && caster->AI_HasSpells()) {
|
||||||
std::list<MercSpell> mercSpellList = GetMercSpellsForSpellEffect(caster, SE_CurrentHP);
|
std::list<MercSpell> mercSpellList = GetMercSpellsForSpellEffect(caster, SE_CurrentHP);
|
||||||
|
|
||||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); mercSpellListItr++) {
|
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
||||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||||
if(IsCompleteHealSpell(mercSpellListItr->spellid)
|
if(IsCompleteHealSpell(mercSpellListItr->spellid)
|
||||||
&& CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
&& CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
||||||
@ -3447,7 +3447,7 @@ MercSpell Merc::GetBestMercSpellForRegularSingleTargetHeal(Merc* caster) {
|
|||||||
if(caster) {
|
if(caster) {
|
||||||
std::list<MercSpell> mercSpellList = GetMercSpellsForSpellEffect(caster, SE_CurrentHP);
|
std::list<MercSpell> mercSpellList = GetMercSpellsForSpellEffect(caster, SE_CurrentHP);
|
||||||
|
|
||||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); mercSpellListItr++) {
|
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
||||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||||
if(IsRegularSingleTargetHealSpell(mercSpellListItr->spellid)
|
if(IsRegularSingleTargetHealSpell(mercSpellListItr->spellid)
|
||||||
&& CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
&& CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
||||||
@ -3479,7 +3479,7 @@ MercSpell Merc::GetFirstMercSpellForSingleTargetHeal(Merc* caster) {
|
|||||||
if(caster) {
|
if(caster) {
|
||||||
std::list<MercSpell> mercSpellList = GetMercSpellsForSpellEffect(caster, SE_CurrentHP);
|
std::list<MercSpell> mercSpellList = GetMercSpellsForSpellEffect(caster, SE_CurrentHP);
|
||||||
|
|
||||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); mercSpellListItr++) {
|
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
||||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||||
if((IsRegularSingleTargetHealSpell(mercSpellListItr->spellid)
|
if((IsRegularSingleTargetHealSpell(mercSpellListItr->spellid)
|
||||||
|| IsFastHealSpell(mercSpellListItr->spellid))
|
|| IsFastHealSpell(mercSpellListItr->spellid))
|
||||||
@ -3512,7 +3512,7 @@ MercSpell Merc::GetBestMercSpellForGroupHeal(Merc* caster) {
|
|||||||
if(caster) {
|
if(caster) {
|
||||||
std::list<MercSpell> mercSpellList = GetMercSpellsForSpellEffect(caster, SE_CurrentHP);
|
std::list<MercSpell> mercSpellList = GetMercSpellsForSpellEffect(caster, SE_CurrentHP);
|
||||||
|
|
||||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); mercSpellListItr++) {
|
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
||||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||||
if(IsRegularGroupHealSpell(mercSpellListItr->spellid)
|
if(IsRegularGroupHealSpell(mercSpellListItr->spellid)
|
||||||
&& CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
&& CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
||||||
@ -3544,7 +3544,7 @@ MercSpell Merc::GetBestMercSpellForGroupHealOverTime(Merc* caster) {
|
|||||||
if(caster) {
|
if(caster) {
|
||||||
std::list<MercSpell> mercHoTSpellList = GetMercSpellsForSpellEffect(caster, SE_HealOverTime);
|
std::list<MercSpell> mercHoTSpellList = GetMercSpellsForSpellEffect(caster, SE_HealOverTime);
|
||||||
|
|
||||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercHoTSpellList.begin(); mercSpellListItr != mercHoTSpellList.end(); mercSpellListItr++) {
|
for(std::list<MercSpell>::iterator mercSpellListItr = mercHoTSpellList.begin(); mercSpellListItr != mercHoTSpellList.end(); ++mercSpellListItr) {
|
||||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||||
if(IsGroupHealOverTimeSpell(mercSpellListItr->spellid)) {
|
if(IsGroupHealOverTimeSpell(mercSpellListItr->spellid)) {
|
||||||
|
|
||||||
@ -3584,7 +3584,7 @@ MercSpell Merc::GetBestMercSpellForGroupCompleteHeal(Merc* caster) {
|
|||||||
if(caster) {
|
if(caster) {
|
||||||
std::list<MercSpell> mercSpellList = GetMercSpellsForSpellEffect(caster, SE_CompleteHeal);
|
std::list<MercSpell> mercSpellList = GetMercSpellsForSpellEffect(caster, SE_CompleteHeal);
|
||||||
|
|
||||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); mercSpellListItr++) {
|
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
||||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||||
if(IsGroupCompleteHealSpell(mercSpellListItr->spellid)
|
if(IsGroupCompleteHealSpell(mercSpellListItr->spellid)
|
||||||
&& CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
&& CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
||||||
@ -3616,7 +3616,7 @@ MercSpell Merc::GetBestMercSpellForAETaunt(Merc* caster) {
|
|||||||
if(caster) {
|
if(caster) {
|
||||||
std::list<MercSpell> mercSpellList = GetMercSpellsForSpellEffect(caster, SE_Taunt);
|
std::list<MercSpell> mercSpellList = GetMercSpellsForSpellEffect(caster, SE_Taunt);
|
||||||
|
|
||||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); mercSpellListItr++) {
|
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
||||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||||
if((spells[mercSpellListItr->spellid].targettype == ST_AECaster
|
if((spells[mercSpellListItr->spellid].targettype == ST_AECaster
|
||||||
|| spells[mercSpellListItr->spellid].targettype == ST_AETarget
|
|| spells[mercSpellListItr->spellid].targettype == ST_AETarget
|
||||||
@ -3650,7 +3650,7 @@ MercSpell Merc::GetBestMercSpellForTaunt(Merc* caster) {
|
|||||||
if(caster) {
|
if(caster) {
|
||||||
std::list<MercSpell> mercSpellList = GetMercSpellsForSpellEffect(caster, SE_Taunt);
|
std::list<MercSpell> mercSpellList = GetMercSpellsForSpellEffect(caster, SE_Taunt);
|
||||||
|
|
||||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); mercSpellListItr++) {
|
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
||||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||||
if((spells[mercSpellListItr->spellid].targettype == ST_Target)
|
if((spells[mercSpellListItr->spellid].targettype == ST_Target)
|
||||||
&& CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
&& CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
||||||
@ -3682,7 +3682,7 @@ MercSpell Merc::GetBestMercSpellForHate(Merc* caster) {
|
|||||||
if(caster) {
|
if(caster) {
|
||||||
std::list<MercSpell> mercSpellList = GetMercSpellsForSpellEffect(caster, SE_Calm);
|
std::list<MercSpell> mercSpellList = GetMercSpellsForSpellEffect(caster, SE_Calm);
|
||||||
|
|
||||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); mercSpellListItr++) {
|
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
||||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||||
if(CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
if(CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
||||||
result.spellid = mercSpellListItr->spellid;
|
result.spellid = mercSpellListItr->spellid;
|
||||||
@ -3738,7 +3738,7 @@ MercSpell Merc::GetBestMercSpellForCure(Merc* caster, Mob *tar) {
|
|||||||
|
|
||||||
//Check for group cure first
|
//Check for group cure first
|
||||||
if(countNeedsCured > 2) {
|
if(countNeedsCured > 2) {
|
||||||
for(std::list<MercSpell>::iterator itr = cureList.begin(); itr != cureList.end(); itr++) {
|
for(std::list<MercSpell>::iterator itr = cureList.begin(); itr != cureList.end(); ++itr) {
|
||||||
MercSpell selectedMercSpell = *itr;
|
MercSpell selectedMercSpell = *itr;
|
||||||
|
|
||||||
if(IsGroupSpell(itr->spellid) && CheckSpellRecastTimers(caster, itr->spellid)) {
|
if(IsGroupSpell(itr->spellid) && CheckSpellRecastTimers(caster, itr->spellid)) {
|
||||||
@ -3778,7 +3778,7 @@ MercSpell Merc::GetBestMercSpellForCure(Merc* caster, Mob *tar) {
|
|||||||
|
|
||||||
//no group cure for target- try to find single target spell
|
//no group cure for target- try to find single target spell
|
||||||
if(!spellSelected) {
|
if(!spellSelected) {
|
||||||
for(std::list<MercSpell>::iterator itr = cureList.begin(); itr != cureList.end(); itr++) {
|
for(std::list<MercSpell>::iterator itr = cureList.begin(); itr != cureList.end(); ++itr) {
|
||||||
MercSpell selectedMercSpell = *itr;
|
MercSpell selectedMercSpell = *itr;
|
||||||
|
|
||||||
if(CheckSpellRecastTimers(caster, itr->spellid)) {
|
if(CheckSpellRecastTimers(caster, itr->spellid)) {
|
||||||
@ -3834,7 +3834,7 @@ MercSpell Merc::GetBestMercSpellForStun(Merc* caster) {
|
|||||||
if(caster) {
|
if(caster) {
|
||||||
std::list<MercSpell> mercSpellList = GetMercSpellsForSpellEffect(caster, SE_Stun);
|
std::list<MercSpell> mercSpellList = GetMercSpellsForSpellEffect(caster, SE_Stun);
|
||||||
|
|
||||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); mercSpellListItr++) {
|
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
||||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||||
if(CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
if(CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
||||||
result.spellid = mercSpellListItr->spellid;
|
result.spellid = mercSpellListItr->spellid;
|
||||||
@ -3929,7 +3929,7 @@ MercSpell Merc::GetBestMercSpellForTargetedAENuke(Merc* caster, Mob* tar) {
|
|||||||
if(caster) {
|
if(caster) {
|
||||||
std::list<MercSpell> mercSpellList = GetMercSpellsBySpellType(caster, SpellType_Nuke);
|
std::list<MercSpell> mercSpellList = GetMercSpellsBySpellType(caster, SpellType_Nuke);
|
||||||
|
|
||||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); mercSpellListItr++) {
|
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
||||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||||
if(IsAENukeSpell(mercSpellListItr->spellid) && !IsAERainNukeSpell(mercSpellListItr->spellid)
|
if(IsAENukeSpell(mercSpellListItr->spellid) && !IsAERainNukeSpell(mercSpellListItr->spellid)
|
||||||
&& !IsPBAENukeSpell(mercSpellListItr->spellid) && CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
&& !IsPBAENukeSpell(mercSpellListItr->spellid) && CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
||||||
@ -3980,7 +3980,7 @@ MercSpell Merc::GetBestMercSpellForPBAENuke(Merc* caster, Mob* tar) {
|
|||||||
if(caster) {
|
if(caster) {
|
||||||
std::list<MercSpell> mercSpellList = GetMercSpellsBySpellType(caster, SpellType_Nuke);
|
std::list<MercSpell> mercSpellList = GetMercSpellsBySpellType(caster, SpellType_Nuke);
|
||||||
|
|
||||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); mercSpellListItr++) {
|
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
||||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||||
if(IsPBAENukeSpell(mercSpellListItr->spellid) && CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
if(IsPBAENukeSpell(mercSpellListItr->spellid) && CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
||||||
uint8 numTargets = 0;
|
uint8 numTargets = 0;
|
||||||
@ -4030,7 +4030,7 @@ MercSpell Merc::GetBestMercSpellForAERainNuke(Merc* caster, Mob* tar) {
|
|||||||
if(caster) {
|
if(caster) {
|
||||||
std::list<MercSpell> mercSpellList = GetMercSpellsBySpellType(caster, SpellType_Nuke);
|
std::list<MercSpell> mercSpellList = GetMercSpellsBySpellType(caster, SpellType_Nuke);
|
||||||
|
|
||||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); mercSpellListItr++) {
|
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
||||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||||
if(IsAERainNukeSpell(mercSpellListItr->spellid) && MakeRandomInt(1, 100) <= castChance && CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
if(IsAERainNukeSpell(mercSpellListItr->spellid) && MakeRandomInt(1, 100) <= castChance && CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
||||||
uint8 numTargets = 0;
|
uint8 numTargets = 0;
|
||||||
@ -4068,7 +4068,7 @@ MercSpell Merc::GetBestMercSpellForNuke(Merc* caster) {
|
|||||||
if(caster) {
|
if(caster) {
|
||||||
std::list<MercSpell> mercSpellList = GetMercSpellsBySpellType(caster, SpellType_Nuke);
|
std::list<MercSpell> mercSpellList = GetMercSpellsBySpellType(caster, SpellType_Nuke);
|
||||||
|
|
||||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); mercSpellListItr++) {
|
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
||||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||||
if(IsPureNukeSpell(mercSpellListItr->spellid) && !IsAENukeSpell(mercSpellListItr->spellid)
|
if(IsPureNukeSpell(mercSpellListItr->spellid) && !IsAENukeSpell(mercSpellListItr->spellid)
|
||||||
&& MakeRandomInt(1, 100) <= castChance && CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
&& MakeRandomInt(1, 100) <= castChance && CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
||||||
@ -4111,7 +4111,7 @@ MercSpell Merc::GetBestMercSpellForNukeByTargetResists(Merc* caster, Mob* target
|
|||||||
|
|
||||||
std::list<MercSpell> mercSpellList = GetMercSpellsBySpellType(caster, SpellType_Nuke);
|
std::list<MercSpell> mercSpellList = GetMercSpellsBySpellType(caster, SpellType_Nuke);
|
||||||
|
|
||||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); mercSpellListItr++) {
|
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
||||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||||
|
|
||||||
if(IsPureNukeSpell(mercSpellListItr->spellid) && !IsAENukeSpell(mercSpellListItr->spellid) && CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
if(IsPureNukeSpell(mercSpellListItr->spellid) && !IsAENukeSpell(mercSpellListItr->spellid) && CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
||||||
@ -4350,7 +4350,7 @@ bool Merc::CheckAETaunt() {
|
|||||||
std::list<NPC*> npc_list;
|
std::list<NPC*> npc_list;
|
||||||
entity_list.GetNPCList(npc_list);
|
entity_list.GetNPCList(npc_list);
|
||||||
|
|
||||||
for(std::list<NPC*>::iterator itr = npc_list.begin(); itr != npc_list.end(); itr++) {
|
for(std::list<NPC*>::iterator itr = npc_list.begin(); itr != npc_list.end(); ++itr) {
|
||||||
NPC* npc = *itr;
|
NPC* npc = *itr;
|
||||||
float dist = npc->DistNoRootNoZ(*this);
|
float dist = npc->DistNoRootNoZ(*this);
|
||||||
int range = GetActSpellRange(mercSpell.spellid, spells[mercSpell.spellid].range);
|
int range = GetActSpellRange(mercSpell.spellid, spells[mercSpell.spellid].range);
|
||||||
@ -4436,7 +4436,7 @@ bool Merc::CheckConfidence() {
|
|||||||
std::list<NPC*> npc_list;
|
std::list<NPC*> npc_list;
|
||||||
entity_list.GetNPCList(npc_list);
|
entity_list.GetNPCList(npc_list);
|
||||||
|
|
||||||
for(std::list<NPC*>::iterator itr = npc_list.begin(); itr != npc_list.end(); itr++) {
|
for(std::list<NPC*>::iterator itr = npc_list.begin(); itr != npc_list.end(); ++itr) {
|
||||||
NPC* mob = *itr;
|
NPC* mob = *itr;
|
||||||
float ConRating = 1.0;
|
float ConRating = 1.0;
|
||||||
int CurrentCon = 0;
|
int CurrentCon = 0;
|
||||||
@ -4920,7 +4920,7 @@ bool Merc::LoadMercSpells() {
|
|||||||
int16 attack_proc_spell = -1;
|
int16 attack_proc_spell = -1;
|
||||||
int8 proc_chance = 0;
|
int8 proc_chance = 0;
|
||||||
|
|
||||||
for (std::list<MercSpellEntry>::iterator mercSpellEntryItr = spellList.begin(); mercSpellEntryItr != spellList.end(); mercSpellEntryItr++) {
|
for (std::list<MercSpellEntry>::iterator mercSpellEntryItr = spellList.begin(); mercSpellEntryItr != spellList.end(); ++mercSpellEntryItr) {
|
||||||
if (proficiency_id == mercSpellEntryItr->proficiencyid && GetLevel() >= mercSpellEntryItr->minlevel && GetLevel() <= mercSpellEntryItr->maxlevel && mercSpellEntryItr->spellid > 0) {
|
if (proficiency_id == mercSpellEntryItr->proficiencyid && GetLevel() >= mercSpellEntryItr->minlevel && GetLevel() <= mercSpellEntryItr->maxlevel && mercSpellEntryItr->spellid > 0) {
|
||||||
MercSpell mercSpell;
|
MercSpell mercSpell;
|
||||||
|
|
||||||
@ -5932,7 +5932,7 @@ int NPC::GetNumMercTypes(uint32 clientVersion)
|
|||||||
int count = 0;
|
int count = 0;
|
||||||
std::list<MercType> mercTypeList = GetMercTypesList();
|
std::list<MercType> mercTypeList = GetMercTypesList();
|
||||||
|
|
||||||
for(std::list<MercType>::iterator mercTypeListItr = mercTypeList.begin(); mercTypeListItr != mercTypeList.end(); mercTypeListItr++) {
|
for(std::list<MercType>::iterator mercTypeListItr = mercTypeList.begin(); mercTypeListItr != mercTypeList.end(); ++mercTypeListItr) {
|
||||||
if(mercTypeListItr->ClientVersion <= clientVersion)
|
if(mercTypeListItr->ClientVersion <= clientVersion)
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
@ -5945,7 +5945,7 @@ int NPC::GetNumMercs(uint32 clientVersion)
|
|||||||
int count = 0;
|
int count = 0;
|
||||||
std::list<MercData> mercDataList = GetMercsList();
|
std::list<MercData> mercDataList = GetMercsList();
|
||||||
|
|
||||||
for(std::list<MercData>::iterator mercListItr = mercDataList.begin(); mercListItr != mercDataList.end(); mercListItr++) {
|
for(std::list<MercData>::iterator mercListItr = mercDataList.begin(); mercListItr != mercDataList.end(); ++mercListItr) {
|
||||||
if(mercListItr->ClientVersion <= clientVersion)
|
if(mercListItr->ClientVersion <= clientVersion)
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
@ -5957,7 +5957,7 @@ std::list<MercType> NPC::GetMercTypesList(uint32 clientVersion) {
|
|||||||
std::list<MercType> result;
|
std::list<MercType> result;
|
||||||
|
|
||||||
if(GetNumMercTypes() > 0) {
|
if(GetNumMercTypes() > 0) {
|
||||||
for(std::list<MercType>::iterator mercTypeListItr = mercTypeList.begin(); mercTypeListItr != mercTypeList.end(); mercTypeListItr++) {
|
for(std::list<MercType>::iterator mercTypeListItr = mercTypeList.begin(); mercTypeListItr != mercTypeList.end(); ++mercTypeListItr) {
|
||||||
if(mercTypeListItr->ClientVersion <= clientVersion) {
|
if(mercTypeListItr->ClientVersion <= clientVersion) {
|
||||||
MercType mercType;
|
MercType mercType;
|
||||||
mercType.Type = mercTypeListItr->Type;
|
mercType.Type = mercTypeListItr->Type;
|
||||||
@ -5974,7 +5974,7 @@ std::list<MercData> NPC::GetMercsList(uint32 clientVersion) {
|
|||||||
std::list<MercData> result;
|
std::list<MercData> result;
|
||||||
|
|
||||||
if(GetNumMercs() > 0) {
|
if(GetNumMercs() > 0) {
|
||||||
for(std::list<MercData>::iterator mercListItr = mercDataList.begin(); mercListItr != mercDataList.end(); mercListItr++) {
|
for(std::list<MercData>::iterator mercListItr = mercDataList.begin(); mercListItr != mercDataList.end(); ++mercListItr) {
|
||||||
if(mercListItr->ClientVersion <= clientVersion) {
|
if(mercListItr->ClientVersion <= clientVersion) {
|
||||||
MercTemplate *merc_template = zone->GetMercTemplate(mercListItr->MercTemplateID);
|
MercTemplate *merc_template = zone->GetMercTemplate(mercListItr->MercTemplateID);
|
||||||
|
|
||||||
|
|||||||
@ -4767,7 +4767,7 @@ int32 Mob::GetItemFactionBonus(uint32 pFactionID) {
|
|||||||
|
|
||||||
void Mob::ClearItemFactionBonuses() {
|
void Mob::ClearItemFactionBonuses() {
|
||||||
std::map <uint32, int32> :: iterator itr;
|
std::map <uint32, int32> :: iterator itr;
|
||||||
for(itr = item_faction_bonuses.begin(); itr != item_faction_bonuses.end(); itr++)
|
for(itr = item_faction_bonuses.begin(); itr != item_faction_bonuses.end(); ++itr)
|
||||||
{
|
{
|
||||||
item_faction_bonuses.erase(itr->first);
|
item_faction_bonuses.erase(itr->first);
|
||||||
}
|
}
|
||||||
|
|||||||
24
zone/npc.cpp
24
zone/npc.cpp
@ -280,12 +280,8 @@ NPC::NPC(const NPCType* d, Spawn2* in_respawn, float x, float y, float z, float
|
|||||||
trap_list = trap_ent_iter->second;
|
trap_list = trap_ent_iter->second;
|
||||||
if(trap_list.size() > 0)
|
if(trap_list.size() > 0)
|
||||||
{
|
{
|
||||||
uint16 count = MakeRandomInt(0, (trap_list.size()-1));
|
|
||||||
std::list<LDoNTrapTemplate*>::iterator trap_list_iter = trap_list.begin();
|
std::list<LDoNTrapTemplate*>::iterator trap_list_iter = trap_list.begin();
|
||||||
for(int x = 0; x < count; ++x)
|
std::advance(trap_list_iter, MakeRandomInt(0, trap_list.size() - 1));
|
||||||
{
|
|
||||||
trap_list_iter++;
|
|
||||||
}
|
|
||||||
LDoNTrapTemplate* tt = (*trap_list_iter);
|
LDoNTrapTemplate* tt = (*trap_list_iter);
|
||||||
if(tt)
|
if(tt)
|
||||||
{
|
{
|
||||||
@ -374,7 +370,7 @@ NPC::~NPC()
|
|||||||
ItemList::iterator cur,end;
|
ItemList::iterator cur,end;
|
||||||
cur = itemlist.begin();
|
cur = itemlist.begin();
|
||||||
end = itemlist.end();
|
end = itemlist.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
ServerLootItem_Struct* item = *cur;
|
ServerLootItem_Struct* item = *cur;
|
||||||
safe_delete(item);
|
safe_delete(item);
|
||||||
}
|
}
|
||||||
@ -385,7 +381,7 @@ NPC::~NPC()
|
|||||||
std::list<struct NPCFaction*>::iterator cur,end;
|
std::list<struct NPCFaction*>::iterator cur,end;
|
||||||
cur = faction_list.begin();
|
cur = faction_list.begin();
|
||||||
end = faction_list.end();
|
end = faction_list.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
struct NPCFaction* fac = *cur;
|
struct NPCFaction* fac = *cur;
|
||||||
safe_delete(fac);
|
safe_delete(fac);
|
||||||
}
|
}
|
||||||
@ -424,7 +420,7 @@ ServerLootItem_Struct* NPC::GetItem(int slot_id) {
|
|||||||
ItemList::iterator cur,end;
|
ItemList::iterator cur,end;
|
||||||
cur = itemlist.begin();
|
cur = itemlist.begin();
|
||||||
end = itemlist.end();
|
end = itemlist.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
ServerLootItem_Struct* item = *cur;
|
ServerLootItem_Struct* item = *cur;
|
||||||
if (item->equipSlot == slot_id) {
|
if (item->equipSlot == slot_id) {
|
||||||
return item;
|
return item;
|
||||||
@ -437,7 +433,7 @@ void NPC::RemoveItem(uint32 item_id, uint16 quantity, uint16 slot) {
|
|||||||
ItemList::iterator cur,end;
|
ItemList::iterator cur,end;
|
||||||
cur = itemlist.begin();
|
cur = itemlist.begin();
|
||||||
end = itemlist.end();
|
end = itemlist.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
ServerLootItem_Struct* item = *cur;
|
ServerLootItem_Struct* item = *cur;
|
||||||
if (item->item_id == item_id && slot <= 0 && quantity <= 0) {
|
if (item->item_id == item_id && slot <= 0 && quantity <= 0) {
|
||||||
itemlist.erase(cur);
|
itemlist.erase(cur);
|
||||||
@ -477,7 +473,7 @@ void NPC::CheckMinMaxLevel(Mob *them)
|
|||||||
cur = itemlist.erase(cur);
|
cur = itemlist.erase(cur);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
cur++;
|
++cur;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -486,7 +482,7 @@ void NPC::ClearItemList() {
|
|||||||
ItemList::iterator cur,end;
|
ItemList::iterator cur,end;
|
||||||
cur = itemlist.begin();
|
cur = itemlist.begin();
|
||||||
end = itemlist.end();
|
end = itemlist.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
ServerLootItem_Struct* item = *cur;
|
ServerLootItem_Struct* item = *cur;
|
||||||
safe_delete(item);
|
safe_delete(item);
|
||||||
}
|
}
|
||||||
@ -500,7 +496,7 @@ void NPC::QueryLoot(Client* to) {
|
|||||||
ItemList::iterator cur,end;
|
ItemList::iterator cur,end;
|
||||||
cur = itemlist.begin();
|
cur = itemlist.begin();
|
||||||
end = itemlist.end();
|
end = itemlist.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
const Item_Struct* item = database.GetItem((*cur)->item_id);
|
const Item_Struct* item = database.GetItem((*cur)->item_id);
|
||||||
if (item)
|
if (item)
|
||||||
if (to->GetClientVersion() >= EQClientRoF)
|
if (to->GetClientVersion() >= EQClientRoF)
|
||||||
@ -1286,7 +1282,7 @@ void NPC::PickPocket(Client* thief) {
|
|||||||
ItemList::iterator cur,end;
|
ItemList::iterator cur,end;
|
||||||
cur = itemlist.begin();
|
cur = itemlist.begin();
|
||||||
end = itemlist.end();
|
end = itemlist.end();
|
||||||
for(; cur != end && x < 49; cur++) {
|
for(; cur != end && x < 49; ++cur) {
|
||||||
ServerLootItem_Struct* citem = *cur;
|
ServerLootItem_Struct* citem = *cur;
|
||||||
const Item_Struct* item = database.GetItem(citem->item_id);
|
const Item_Struct* item = database.GetItem(citem->item_id);
|
||||||
if (item)
|
if (item)
|
||||||
@ -2351,7 +2347,7 @@ FACTION_VALUE NPC::CheckNPCFactionAlly(int32 other_faction) {
|
|||||||
std::list<struct NPCFaction*>::iterator cur,end;
|
std::list<struct NPCFaction*>::iterator cur,end;
|
||||||
cur = faction_list.begin();
|
cur = faction_list.begin();
|
||||||
end = faction_list.end();
|
end = faction_list.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
struct NPCFaction* fac = *cur;
|
struct NPCFaction* fac = *cur;
|
||||||
if ((int32)fac->factionID == other_faction) {
|
if ((int32)fac->factionID == other_faction) {
|
||||||
if (fac->npc_value > 0)
|
if (fac->npc_value > 0)
|
||||||
|
|||||||
@ -1324,12 +1324,12 @@ void Client::SendPathPacket(std::vector<FindPerson_Point> &points) {
|
|||||||
cur = points.begin();
|
cur = points.begin();
|
||||||
end = points.end();
|
end = points.end();
|
||||||
unsigned int r;
|
unsigned int r;
|
||||||
for(r = 0; cur != end; cur++, r++) {
|
for(r = 0; cur != end; ++cur, r++) {
|
||||||
fpr->path[r] = *cur;
|
fpr->path[r] = *cur;
|
||||||
|
|
||||||
}
|
}
|
||||||
//put the last element into the destination field
|
//put the last element into the destination field
|
||||||
cur--;
|
--cur;
|
||||||
fpr->path[r] = *cur;
|
fpr->path[r] = *cur;
|
||||||
fpr->dest = *cur;
|
fpr->dest = *cur;
|
||||||
|
|
||||||
|
|||||||
@ -566,7 +566,7 @@ void SpawnConditionManager::Process() {
|
|||||||
std::vector<SpawnEvent>::iterator cur,end;
|
std::vector<SpawnEvent>::iterator cur,end;
|
||||||
cur = spawn_events.begin();
|
cur = spawn_events.begin();
|
||||||
end = spawn_events.end();
|
end = spawn_events.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
SpawnEvent &cevent = *cur;
|
SpawnEvent &cevent = *cur;
|
||||||
|
|
||||||
if(!cevent.enabled)
|
if(!cevent.enabled)
|
||||||
@ -827,7 +827,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in
|
|||||||
cur = spawn_events.begin();
|
cur = spawn_events.begin();
|
||||||
end = spawn_events.end();
|
end = spawn_events.end();
|
||||||
bool ran;
|
bool ran;
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
SpawnEvent &cevent = *cur;
|
SpawnEvent &cevent = *cur;
|
||||||
|
|
||||||
if(!cevent.enabled)
|
if(!cevent.enabled)
|
||||||
@ -875,7 +875,7 @@ void SpawnConditionManager::FindNearestEvent() {
|
|||||||
cur = spawn_events.begin();
|
cur = spawn_events.begin();
|
||||||
end = spawn_events.end();
|
end = spawn_events.end();
|
||||||
int next_id = -1;
|
int next_id = -1;
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
SpawnEvent &cevent = *cur;
|
SpawnEvent &cevent = *cur;
|
||||||
|
|
||||||
if(!cevent.enabled)
|
if(!cevent.enabled)
|
||||||
@ -983,7 +983,7 @@ void SpawnConditionManager::ReloadEvent(uint32 event_id) {
|
|||||||
std::vector<SpawnEvent>::iterator cur,end;
|
std::vector<SpawnEvent>::iterator cur,end;
|
||||||
cur = spawn_events.begin();
|
cur = spawn_events.begin();
|
||||||
end = spawn_events.end();
|
end = spawn_events.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
SpawnEvent &cevent = *cur;
|
SpawnEvent &cevent = *cur;
|
||||||
|
|
||||||
if(cevent.id == event_id) {
|
if(cevent.id == event_id) {
|
||||||
@ -1026,7 +1026,7 @@ void SpawnConditionManager::ToggleEvent(uint32 event_id, bool enabled, bool rese
|
|||||||
std::vector<SpawnEvent>::iterator cur,end;
|
std::vector<SpawnEvent>::iterator cur,end;
|
||||||
cur = spawn_events.begin();
|
cur = spawn_events.begin();
|
||||||
end = spawn_events.end();
|
end = spawn_events.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
SpawnEvent &cevent = *cur;
|
SpawnEvent &cevent = *cur;
|
||||||
|
|
||||||
if(cevent.id == event_id) {
|
if(cevent.id == event_id) {
|
||||||
|
|||||||
@ -64,7 +64,7 @@ uint32 SpawnGroup::GetNPCType() {
|
|||||||
std::list<SpawnEntry*> possible;
|
std::list<SpawnEntry*> possible;
|
||||||
cur = list_.begin();
|
cur = list_.begin();
|
||||||
end = list_.end();
|
end = list_.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
SpawnEntry *se = *cur;
|
SpawnEntry *se = *cur;
|
||||||
|
|
||||||
//check limits on this spawn group and npc type
|
//check limits on this spawn group and npc type
|
||||||
@ -83,7 +83,7 @@ uint32 SpawnGroup::GetNPCType() {
|
|||||||
|
|
||||||
cur = possible.begin();
|
cur = possible.begin();
|
||||||
end = possible.end();
|
end = possible.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
SpawnEntry *se = *cur;
|
SpawnEntry *se = *cur;
|
||||||
if (roll < se->chance) {
|
if (roll < se->chance) {
|
||||||
npcType = se->NPCType;
|
npcType = se->NPCType;
|
||||||
@ -104,7 +104,7 @@ SpawnGroup::~SpawnGroup() {
|
|||||||
std::list<SpawnEntry*>::iterator cur,end;
|
std::list<SpawnEntry*>::iterator cur,end;
|
||||||
cur = list_.begin();
|
cur = list_.begin();
|
||||||
end = list_.end();
|
end = list_.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
SpawnEntry* tmp = *cur;
|
SpawnEntry* tmp = *cur;
|
||||||
safe_delete(tmp);
|
safe_delete(tmp);
|
||||||
}
|
}
|
||||||
@ -115,7 +115,7 @@ SpawnGroupList::~SpawnGroupList() {
|
|||||||
std::map<uint32, SpawnGroup*>::iterator cur,end;
|
std::map<uint32, SpawnGroup*>::iterator cur,end;
|
||||||
cur = groups.begin();
|
cur = groups.begin();
|
||||||
end = groups.end();
|
end = groups.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
SpawnGroup* tmp = cur->second;
|
SpawnGroup* tmp = cur->second;
|
||||||
safe_delete(tmp);
|
safe_delete(tmp);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2058,7 +2058,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16
|
|||||||
SpellOnTarget(spell_id, (*iter), false, true, resist_adjust);
|
SpellOnTarget(spell_id, (*iter), false, true, resist_adjust);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2940,7 +2940,7 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid
|
|||||||
std::vector<int>::iterator cur, end;
|
std::vector<int>::iterator cur, end;
|
||||||
cur = overwrite_slots.begin();
|
cur = overwrite_slots.begin();
|
||||||
end = overwrite_slots.end();
|
end = overwrite_slots.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
// strip spell
|
// strip spell
|
||||||
BuffFadeBySlot(*cur, false);
|
BuffFadeBySlot(*cur, false);
|
||||||
|
|
||||||
|
|||||||
@ -829,7 +829,7 @@ void ClientTaskState::EnableTask(int CharID, int TaskCount, int *TaskList) {
|
|||||||
// Our list of enabled tasks is sorted, so we can quit if we find a taskid higher than
|
// Our list of enabled tasks is sorted, so we can quit if we find a taskid higher than
|
||||||
// the one we are looking for.
|
// the one we are looking for.
|
||||||
if((*Iterator) > TaskList[i]) break;
|
if((*Iterator) > TaskList[i]) break;
|
||||||
Iterator++;
|
++Iterator;
|
||||||
}
|
}
|
||||||
if(AddTask) {
|
if(AddTask) {
|
||||||
EnabledTasks.insert(Iterator, TaskList[i]);
|
EnabledTasks.insert(Iterator, TaskList[i]);
|
||||||
@ -890,7 +890,7 @@ void ClientTaskState::DisableTask(int CharID, int TaskCount, int *TaskList) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if((*Iterator) > TaskList[i]) break;
|
if((*Iterator) > TaskList[i]) break;
|
||||||
Iterator++;
|
++Iterator;
|
||||||
}
|
}
|
||||||
if(RemoveTask) {
|
if(RemoveTask) {
|
||||||
EnabledTasks.erase(Iterator);
|
EnabledTasks.erase(Iterator);
|
||||||
@ -947,7 +947,7 @@ bool ClientTaskState::IsTaskEnabled(int TaskID) {
|
|||||||
while(Iterator != EnabledTasks.end()) {
|
while(Iterator != EnabledTasks.end()) {
|
||||||
if((*Iterator) == TaskID) return true;
|
if((*Iterator) == TaskID) return true;
|
||||||
if((*Iterator) > TaskID) break;
|
if((*Iterator) > TaskID) break;
|
||||||
Iterator++;
|
++Iterator;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -1021,7 +1021,7 @@ int TaskManager::FirstTaskInSet(int TaskSetID) {
|
|||||||
while(Iterator != TaskSets[TaskSetID].end()) {
|
while(Iterator != TaskSets[TaskSetID].end()) {
|
||||||
if((*Iterator) > 0)
|
if((*Iterator) > 0)
|
||||||
return (*Iterator);
|
return (*Iterator);
|
||||||
Iterator++;
|
++Iterator;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -1087,7 +1087,7 @@ void TaskManager::TaskSetSelector(Client *c, ClientTaskState *state, Mob *mob, i
|
|||||||
(IsTaskRepeatable((*Iterator)) || !state->IsTaskCompleted((*Iterator))))
|
(IsTaskRepeatable((*Iterator)) || !state->IsTaskCompleted((*Iterator))))
|
||||||
TaskList[TaskListIndex++] = (*Iterator);
|
TaskList[TaskListIndex++] = (*Iterator);
|
||||||
|
|
||||||
Iterator++;
|
++Iterator;
|
||||||
}
|
}
|
||||||
if(TaskListIndex > 0)
|
if(TaskListIndex > 0)
|
||||||
{
|
{
|
||||||
@ -1497,7 +1497,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) {
|
|||||||
ErasedElements++;
|
ErasedElements++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Iterator++;
|
++Iterator;
|
||||||
}
|
}
|
||||||
_log(TASKS__UPDATE, "Erased Element count is %i", ErasedElements);
|
_log(TASKS__UPDATE, "Erased Element count is %i", ErasedElements);
|
||||||
if(ErasedElements) {
|
if(ErasedElements) {
|
||||||
@ -1570,7 +1570,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) {
|
|||||||
ErasedElements++;
|
ErasedElements++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Iterator++;
|
++Iterator;
|
||||||
}
|
}
|
||||||
_log(TASKS__UPDATE, "Erased Element count is %i", ErasedElements);
|
_log(TASKS__UPDATE, "Erased Element count is %i", ErasedElements);
|
||||||
if(ErasedElements) {
|
if(ErasedElements) {
|
||||||
|
|||||||
@ -165,7 +165,7 @@ std::string TitleManager::GetSuffix(int TitleID)
|
|||||||
if((*Iterator).TitleID == TitleID)
|
if((*Iterator).TitleID == TitleID)
|
||||||
return (*Iterator).Suffix;
|
return (*Iterator).Suffix;
|
||||||
|
|
||||||
Iterator++;
|
++Iterator;
|
||||||
}
|
}
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
|
|||||||
@ -1082,7 +1082,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) {
|
|||||||
}
|
}
|
||||||
if(RuleB(TaskSystem, EnableTaskSystem))
|
if(RuleB(TaskSystem, EnableTaskSystem))
|
||||||
UpdateTasksForItem(ActivityTradeSkill, itr->first, itr->second);
|
UpdateTasksForItem(ActivityTradeSkill, itr->first, itr->second);
|
||||||
itr++;
|
++itr;
|
||||||
}
|
}
|
||||||
return(true);
|
return(true);
|
||||||
} else {
|
} else {
|
||||||
@ -1103,7 +1103,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) {
|
|||||||
while(itr != spec->onfail.end()) {
|
while(itr != spec->onfail.end()) {
|
||||||
//should we check these arguments?
|
//should we check these arguments?
|
||||||
SummonItem(itr->first, itr->second);
|
SummonItem(itr->first, itr->second);
|
||||||
itr++;
|
++itr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rolls on each item, is possible to return everything
|
// Rolls on each item, is possible to return everything
|
||||||
@ -1116,7 +1116,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) {
|
|||||||
for(sc = 0; sc < itr->second; sc++)
|
for(sc = 0; sc < itr->second; sc++)
|
||||||
if(MakeRandomInt(0,99) < SalvageChance)
|
if(MakeRandomInt(0,99) < SalvageChance)
|
||||||
SummonItem(itr->first, 1);
|
SummonItem(itr->first, 1);
|
||||||
itr++;
|
++itr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -308,7 +308,7 @@ void Client::SendTributes() {
|
|||||||
cur = tribute_list.begin();
|
cur = tribute_list.begin();
|
||||||
end = tribute_list.end();
|
end = tribute_list.end();
|
||||||
|
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
if(cur->second.is_guild)
|
if(cur->second.is_guild)
|
||||||
continue; //skip guild tributes here
|
continue; //skip guild tributes here
|
||||||
int len = cur->second.name.length();
|
int len = cur->second.name.length();
|
||||||
@ -342,7 +342,7 @@ void Client::SendGuildTributes() {
|
|||||||
cur = tribute_list.begin();
|
cur = tribute_list.begin();
|
||||||
end = tribute_list.end();
|
end = tribute_list.end();
|
||||||
|
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
if(!cur->second.is_guild)
|
if(!cur->second.is_guild)
|
||||||
continue; //skip guild tributes here
|
continue; //skip guild tributes here
|
||||||
int len = cur->second.name.length();
|
int len = cur->second.name.length();
|
||||||
|
|||||||
@ -73,7 +73,7 @@ void NPC::DisplayWaypointInfo(Client *c) {
|
|||||||
std::vector<wplist>::iterator cur, end;
|
std::vector<wplist>::iterator cur, end;
|
||||||
cur = Waypoints.begin();
|
cur = Waypoints.begin();
|
||||||
end = Waypoints.end();
|
end = Waypoints.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
c->Message(0,"Waypoint %d: (%.2f,%.2f,%.2f,%.2f) pause %d",
|
c->Message(0,"Waypoint %d: (%.2f,%.2f,%.2f,%.2f) pause %d",
|
||||||
cur->index,
|
cur->index,
|
||||||
cur->x,
|
cur->x,
|
||||||
@ -272,12 +272,8 @@ void NPC::CalculateNewWaypoint()
|
|||||||
std::list<wplist>::iterator iter = closest.begin();
|
std::list<wplist>::iterator iter = closest.begin();
|
||||||
if(closest.size() != 0)
|
if(closest.size() != 0)
|
||||||
{
|
{
|
||||||
int idx = MakeRandomInt(0, closest.size() - 1);
|
|
||||||
iter = closest.begin();
|
iter = closest.begin();
|
||||||
for(int i = 0; i < idx; ++i)
|
std::advance(iter, MakeRandomInt(0, closest.size() - 1));
|
||||||
{
|
|
||||||
iter++;
|
|
||||||
}
|
|
||||||
cur_wp = (*iter).index;
|
cur_wp = (*iter).index;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -335,7 +331,7 @@ void NPC::CalculateNewWaypoint()
|
|||||||
{
|
{
|
||||||
if(CheckLosFN((*iter).x, (*iter).y, (*iter).z, GetSize()))
|
if(CheckLosFN((*iter).x, (*iter).y, (*iter).z, GetSize()))
|
||||||
{
|
{
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -345,12 +341,8 @@ void NPC::CalculateNewWaypoint()
|
|||||||
|
|
||||||
if(closest.size() != 0)
|
if(closest.size() != 0)
|
||||||
{
|
{
|
||||||
int idx = MakeRandomInt(0, closest.size() - 1);
|
|
||||||
iter = closest.begin();
|
iter = closest.begin();
|
||||||
for(int i = 0; i < idx; ++i)
|
std::advance(iter, MakeRandomInt(0, closest.size() - 1));
|
||||||
{
|
|
||||||
iter++;
|
|
||||||
}
|
|
||||||
cur_wp = (*iter).index;
|
cur_wp = (*iter).index;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -406,7 +398,7 @@ void NPC::GetClosestWaypoint(std::list<wplist> &wp_list, int count, float m_x, f
|
|||||||
for(int i = 0; i < count; ++i)
|
for(int i = 0; i < count; ++i)
|
||||||
{
|
{
|
||||||
wp_list.push_back(Waypoints[(*iter).index]);
|
wp_list.push_back(Waypoints[(*iter).index]);
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -341,7 +341,7 @@ int Zone::SaveTempItem(uint32 merchantid, uint32 npcid, uint32 item, int32 charg
|
|||||||
std::list<MerchantList> merlist = merchanttable[merchantid];
|
std::list<MerchantList> merlist = merchanttable[merchantid];
|
||||||
std::list<MerchantList>::const_iterator itr;
|
std::list<MerchantList>::const_iterator itr;
|
||||||
uint32 i = 1;
|
uint32 i = 1;
|
||||||
for(itr = merlist.begin();itr != merlist.end();itr++){
|
for (itr = merlist.begin(); itr != merlist.end(); ++itr) {
|
||||||
MerchantList ml = *itr;
|
MerchantList ml = *itr;
|
||||||
if(ml.item == item)
|
if(ml.item == item)
|
||||||
return 0;
|
return 0;
|
||||||
@ -357,7 +357,7 @@ int Zone::SaveTempItem(uint32 merchantid, uint32 npcid, uint32 item, int32 charg
|
|||||||
TempMerchantList ml;
|
TempMerchantList ml;
|
||||||
while(freeslot == 0 && !update_charges){
|
while(freeslot == 0 && !update_charges){
|
||||||
freeslot = i;
|
freeslot = i;
|
||||||
for(tmp_itr = tmp_merlist.begin();tmp_itr != tmp_merlist.end();tmp_itr++){
|
for (tmp_itr = tmp_merlist.begin(); tmp_itr != tmp_merlist.end(); ++tmp_itr) {
|
||||||
ml = *tmp_itr;
|
ml = *tmp_itr;
|
||||||
if(ml.item == item){
|
if(ml.item == item){
|
||||||
update_charges = true;
|
update_charges = true;
|
||||||
@ -373,7 +373,7 @@ int Zone::SaveTempItem(uint32 merchantid, uint32 npcid, uint32 item, int32 charg
|
|||||||
if(update_charges){
|
if(update_charges){
|
||||||
tmp_merlist.clear();
|
tmp_merlist.clear();
|
||||||
std::list<TempMerchantList> oldtmp_merlist = tmpmerchanttable[npcid];
|
std::list<TempMerchantList> oldtmp_merlist = tmpmerchanttable[npcid];
|
||||||
for(tmp_itr = oldtmp_merlist.begin();tmp_itr != oldtmp_merlist.end();tmp_itr++){
|
for (tmp_itr = oldtmp_merlist.begin(); tmp_itr != oldtmp_merlist.end(); ++tmp_itr) {
|
||||||
TempMerchantList ml2 = *tmp_itr;
|
TempMerchantList ml2 = *tmp_itr;
|
||||||
if(ml2.item != item)
|
if(ml2.item != item)
|
||||||
tmp_merlist.push_back(ml2);
|
tmp_merlist.push_back(ml2);
|
||||||
@ -419,7 +419,7 @@ uint32 Zone::GetTempMerchantQuantity(uint32 NPCID, uint32 Slot) {
|
|||||||
std::list<TempMerchantList> TmpMerchantList = tmpmerchanttable[NPCID];
|
std::list<TempMerchantList> TmpMerchantList = tmpmerchanttable[NPCID];
|
||||||
std::list<TempMerchantList>::const_iterator Iterator;
|
std::list<TempMerchantList>::const_iterator Iterator;
|
||||||
|
|
||||||
for(Iterator = TmpMerchantList.begin(); Iterator != TmpMerchantList.end(); Iterator++)
|
for (Iterator = TmpMerchantList.begin(); Iterator != TmpMerchantList.end(); ++Iterator)
|
||||||
if((*Iterator).slot == Slot)
|
if((*Iterator).slot == Slot)
|
||||||
return (*Iterator).charges;
|
return (*Iterator).charges;
|
||||||
|
|
||||||
@ -527,7 +527,7 @@ void Zone::LoadMerchantData_result(MYSQL_RES* result) {
|
|||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
iter++;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(found) {
|
if(found) {
|
||||||
@ -617,7 +617,7 @@ void Zone::LoadMercTemplates(){
|
|||||||
tempMercTemplate.Stances[i] = 0;
|
tempMercTemplate.Stances[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(std::list<MercStanceInfo>::iterator mercStanceListItr = merc_stances.begin(); mercStanceListItr != merc_stances.end(); mercStanceListItr++) {
|
for (std::list<MercStanceInfo>::iterator mercStanceListItr = merc_stances.begin(); mercStanceListItr != merc_stances.end(); ++mercStanceListItr) {
|
||||||
if(mercStanceListItr->ClassID == tempMercTemplate.ClassID && mercStanceListItr->ProficiencyID == tempMercTemplate.ProficiencyID) {
|
if(mercStanceListItr->ClassID == tempMercTemplate.ClassID && mercStanceListItr->ProficiencyID == tempMercTemplate.ProficiencyID) {
|
||||||
zone->merc_stance_list[tempMercTemplate.MercTemplateID].push_back((*mercStanceListItr));
|
zone->merc_stance_list[tempMercTemplate.MercTemplateID].push_back((*mercStanceListItr));
|
||||||
tempMercTemplate.Stances[stanceIndex] = mercStanceListItr->StanceID;
|
tempMercTemplate.Stances[stanceIndex] = mercStanceListItr->StanceID;
|
||||||
|
|||||||
@ -3193,7 +3193,7 @@ bool ZoneDatabase::GetFactionIdsForNPC(uint32 nfl_id, std::list<struct NPCFactio
|
|||||||
std::list<struct NPCFaction*>::iterator cur,end;
|
std::list<struct NPCFaction*>::iterator cur,end;
|
||||||
cur = faction_list->begin();
|
cur = faction_list->begin();
|
||||||
end = faction_list->end();
|
end = faction_list->end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
struct NPCFaction* tmp = *cur;
|
struct NPCFaction* tmp = *cur;
|
||||||
safe_delete(tmp);
|
safe_delete(tmp);
|
||||||
}
|
}
|
||||||
@ -3212,7 +3212,7 @@ bool ZoneDatabase::GetFactionIdsForNPC(uint32 nfl_id, std::list<struct NPCFactio
|
|||||||
std::list<struct NPCFaction*>::iterator cur,end;
|
std::list<struct NPCFaction*>::iterator cur,end;
|
||||||
cur = faction_list->begin();
|
cur = faction_list->begin();
|
||||||
end = faction_list->end();
|
end = faction_list->end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
struct NPCFaction* tmp = *cur;
|
struct NPCFaction* tmp = *cur;
|
||||||
safe_delete(tmp);
|
safe_delete(tmp);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -793,7 +793,7 @@ void Client::SendZoneFlagInfo(Client *to) const {
|
|||||||
|
|
||||||
to->Message(0, "Flags for %s:", GetName());
|
to->Message(0, "Flags for %s:", GetName());
|
||||||
|
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
uint32 zoneid = *cur;
|
uint32 zoneid = *cur;
|
||||||
|
|
||||||
const char *short_name = database.GetZoneName(zoneid);
|
const char *short_name = database.GetZoneName(zoneid);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user