mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 01:11:29 +00:00
Merge branch 'master' of https://github.com/EQEmu/Server
This commit is contained in:
commit
bbb3e1a1bd
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@ -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, ...);
|
||||
|
||||
@ -1101,8 +1101,14 @@ void Mob::ProjectileAttack()
|
||||
|
||||
if (target){
|
||||
|
||||
if (IsNPC())
|
||||
CastToNPC()->DoRangedAttackDmg(target, false, ProjectileAtk[i].wpn_dmg,0, static_cast<SkillUseTypes>(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<SkillUseTypes>(ProjectileAtk[i].skill));
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
|
||||
@ -662,15 +662,7 @@ void Zone::Shutdown(bool quite)
|
||||
if (!ZoneLoaded)
|
||||
return;
|
||||
|
||||
std::list<Mob*> mob_list;
|
||||
entity_list.GetMobList(mob_list);
|
||||
std::list<Mob*>::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<uint32,NPCType *>::iterator itr;
|
||||
while(zone->npctable.size()) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user