diff --git a/src/behaviourdatabase.cpp b/src/behaviourdatabase.cpp index 31c2c26..2d59abe 100644 --- a/src/behaviourdatabase.cpp +++ b/src/behaviourdatabase.cpp @@ -820,10 +820,11 @@ void BehaviourDatabase::checkAction(const NpcBehaviourAction* action, Player* pl } } while (amount); } else { - + /* if (it.charges && (data < static_cast(it.charges))) { data = it.charges; } + */ for (int32_t i = 0; i < std::max(1, amount); i++) { Item* item = Item::CreateItem(itemId, data); diff --git a/src/monster.cpp b/src/monster.cpp index 75de6e1..e0cc345 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -1159,8 +1159,8 @@ bool Monster::getNextStep(Direction& direction, uint32_t& flags) if ((!followCreature || !hasFollowPath) && (!isSummon() || !isMasterInRange)) { if (OTSYS_TIME() >= nextDanceStepRound) { updateLookDirection(); - nextDanceStepRound = OTSYS_TIME() + 200 + getStepDuration(); - + nextDanceStepRound = OTSYS_TIME() + getStepDuration(); + //choose a random direction result = getRandomStep(getPosition(), direction); } @@ -2004,34 +2004,46 @@ void Monster::updateLookDirection() } else { Direction dir = getDirection(); if (offsetx < 0 && offsety < 0) { + if (offsetx == -1 && offsety == -1) { + if (dir == DIRECTION_NORTH) { + newDir = DIRECTION_WEST; + } + } if (dir == DIRECTION_SOUTH) { newDir = DIRECTION_WEST; - } else if (dir == DIRECTION_NORTH) { - newDir = DIRECTION_WEST; } else if (dir == DIRECTION_EAST) { newDir = DIRECTION_NORTH; } } else if (offsetx < 0 && offsety > 0) { + if (offsetx == -1 && offsety == 1) { + if (dir == DIRECTION_SOUTH) { + newDir = DIRECTION_WEST; + } + } if (dir == DIRECTION_NORTH) { newDir = DIRECTION_WEST; - } else if (dir == DIRECTION_SOUTH) { - newDir = DIRECTION_WEST; } else if (dir == DIRECTION_EAST) { newDir = DIRECTION_SOUTH; } } else if (offsetx > 0 && offsety < 0) { + if (offsetx == 1 && offsety == -1) { + if (dir == DIRECTION_NORTH) { + newDir = DIRECTION_EAST; + } + } if (dir == DIRECTION_SOUTH) { newDir = DIRECTION_EAST; - } else if (dir == DIRECTION_NORTH) { - newDir = DIRECTION_EAST; } else if (dir == DIRECTION_WEST) { newDir = DIRECTION_NORTH; } } else { + if (offsetx == 1 && offsety == 1) { + if (dir == DIRECTION_SOUTH) { + newDir = DIRECTION_EAST; + } + } if (dir == DIRECTION_NORTH) { newDir = DIRECTION_EAST; - } else if (dir == DIRECTION_SOUTH) { - newDir = DIRECTION_EAST; } else if (dir == DIRECTION_WEST) { newDir = DIRECTION_SOUTH; }