diff --git a/common/database.cpp b/common/database.cpp index d6dcd7405..39f78cfa6 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -3261,7 +3261,8 @@ uint32 Database::GetGroupID(const char* name){ if (results.RowCount() == 0) { - LogFile->write(EQEmuLog::Debug, "Character not in a group: %s", name); + // Commenting this out until logging levels can prevent this from going to console + //LogFile->write(EQEmuLog::Debug, "Character not in a group: %s", name); return 0; } diff --git a/common/item.cpp b/common/item.cpp index 7f6e049d6..c06df3a89 100644 --- a/common/item.cpp +++ b/common/item.cpp @@ -1108,6 +1108,7 @@ int16 Inventory::_PutItem(int16 slot_id, ItemInst* inst) } int16 result = INVALID_INDEX; + int16 parentSlot = INVALID_INDEX; if (slot_id == MainCursor) { // Replace current item on cursor, if exists @@ -1142,16 +1143,17 @@ int16 Inventory::_PutItem(int16 slot_id, ItemInst* inst) else { // Slot must be within a bag - ItemInst* baginst = GetItem(Inventory::CalcSlotId(slot_id)); // Get parent bag + parentSlot = Inventory::CalcSlotId(slot_id); + ItemInst* baginst = GetItem(parentSlot); // Get parent bag if (baginst && baginst->IsType(ItemClassContainer)) { baginst->_PutItem(Inventory::CalcBagIdx(slot_id), inst); result = slot_id; } } - + if (result == INVALID_INDEX) { - LogFile->write(EQEmuLog::Error, "Inventory::_PutItem: Invalid slot_id specified (%i)", slot_id); + LogFile->write(EQEmuLog::Error, "Inventory::_PutItem: Invalid slot_id specified (%i) with parent slot id (%i)", slot_id, parentSlot); Inventory::MarkDirty(inst); // Slot not found, clean up } diff --git a/zone/entity.cpp b/zone/entity.cpp index d5e5774ca..eaed09570 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -4668,3 +4668,10 @@ Mob *EntityList::GetTargetForVirus(Mob *spreader, int range) return TargetsInRange[zone->random.Int(0, TargetsInRange.size() - 1)]; } +void EntityList::StopMobAI() +{ + for (auto &mob : mob_list) { + mob.second->AI_Stop(); + mob.second->AI_ShutDown(); + } +} diff --git a/zone/entity.h b/zone/entity.h index 88f5257f7..2b1678740 100644 --- a/zone/entity.h +++ b/zone/entity.h @@ -268,6 +268,8 @@ public: Entity *GetEntityMob(const char *name); Entity *GetEntityCorpse(const char *name); + void StopMobAI(); + void DescribeAggro(Client *towho, NPC *from_who, float dist, bool verbose); void Message(uint32 to_guilddbid, uint32 type, const char* message, ...); diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index 94da26e45..5255ff1f6 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -1101,8 +1101,14 @@ void Mob::ProjectileAttack() if (target){ - if (IsNPC()) - CastToNPC()->DoRangedAttackDmg(target, false, ProjectileAtk[i].wpn_dmg,0, static_cast(ProjectileAtk[i].skill)); + if (IsNPC()){ + if (ProjectileAtk[i].skill == SkillConjuration){ + if (IsValidSpell(ProjectileAtk[i].wpn_dmg)) + SpellOnTarget(ProjectileAtk[i].wpn_dmg, target, false, true, spells[ProjectileAtk[i].wpn_dmg].ResistDiff, true); + } + else + CastToNPC()->DoRangedAttackDmg(target, false, ProjectileAtk[i].wpn_dmg,0, static_cast(ProjectileAtk[i].skill)); + } else { diff --git a/zone/zone.cpp b/zone/zone.cpp index fc134a735..3ee15be83 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -662,15 +662,7 @@ void Zone::Shutdown(bool quite) if (!ZoneLoaded) return; - std::list mob_list; - entity_list.GetMobList(mob_list); - std::list::iterator mob_itr = mob_list.begin(); - while (mob_itr != mob_list.end()) { - Mob* mob_inst = *mob_itr; - mob_inst->AI_Stop(); - mob_inst->AI_ShutDown(); - ++mob_itr; - } + entity_list.StopMobAI(); std::map::iterator itr; while(zone->npctable.size()) {