Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…s.281787/

Now it's going to show skulls based on creature levels.
  • Loading branch information
ralke23 committed Dec 28, 2022
1 parent 7175b79 commit fdcdabd
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
18 changes: 18 additions & 0 deletions src/monster.cpp
Expand Up @@ -53,6 +53,24 @@ Monster::Monster(MonsterType* mType) :
currentOutfit = mType->info.outfit;
skull = mType->info.skull;
level = uniform_random(mType->info.minLevel, mType->info.maxLevel);

// Elite Monsters skull by LEVEL:
if (level >= 1 && level <= 20) {
skull = SKULL_GREEN;
}
else if (level >= 21 && level <= 45) {
skull = SKULL_YELLOW;
}
else if (level >= 45 && level <= 65) {
skull = SKULL_WHITE;
}
else if (level >= 65 && level <= 85) {
skull = SKULL_RED;
}
else if (level >= 86) {
skull = SKULL_BLACK;
}

health = mType->info.health;
healthMax = mType->info.healthMax;
baseSpeed = mType->info.baseSpeed;
Expand Down
2 changes: 1 addition & 1 deletion src/player.cpp
Expand Up @@ -3772,7 +3772,7 @@ Skulls_t Player::getSkullClient(const Creature* creature) const
}

const Player* player = creature->getPlayer();
if (!player || player->getSkull() != SKULL_NONE) {
if (!player || creature->getSkull() != SKULL_NONE) {
return Creature::getSkullClient(creature);
}

Expand Down
2 changes: 1 addition & 1 deletion src/protocolgame.cpp
Expand Up @@ -2196,7 +2196,7 @@ void ProtocolGame::AddCreature(NetworkMessage& msg, const Creature* creature, bo

msg.add<uint16_t>(creature->getStepSpeed());

msg.addByte(player->getSkullClient(otherPlayer));
msg.addByte(creature->getSkullClient(creature));
msg.addByte(player->getPartyShield(otherPlayer));

if (!known) {
Expand Down

0 comments on commit fdcdabd

Please sign in to comment.