Skip to content

Commit

Permalink
Randomize stats of Deathmatch & Adventure Island creatures
Browse files Browse the repository at this point in the history
  • Loading branch information
AntumDeluge committed May 16, 2024
1 parent 4bcc6f1 commit 97efe5e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* $Id$ */
/***************************************************************************
* (C) Copyright 2003-2023 - Stendhal *
* (C) Copyright 2003-2024 - Stendhal *
***************************************************************************
***************************************************************************
* *
Expand Down Expand Up @@ -163,7 +163,7 @@ public Creature calculateNextCreature(final int questLevel) {
*/
DeathMatchCreature spawnNewCreature(final Creature template, final Player player, final DeathmatchInfo deathmatchInfo) {
DeathMatchCreature creature = new DeathMatchCreature(
new ArenaCreature(template.getNewInstance(), deathmatchInfo.getArena().getShape()), deathmatchInfo);
new ArenaCreature(template.getNewInstanceRandomizeStats(), deathmatchInfo.getArena().getShape()), deathmatchInfo);

if (StendhalRPAction.placeat(deathmatchInfo.getZone(), creature, player.getX(), player.getY(), deathmatchInfo.getArena().getShape())) {
creature.clearDropItemList();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* $Id$ */
/***************************************************************************
* (C) Copyright 2003-2023 - Stendhal *
* (C) Copyright 2003-2024 - Stendhal *
***************************************************************************
***************************************************************************
* *
Expand Down Expand Up @@ -89,6 +89,8 @@ private void init(final Player player) {
creature = new Creature(creatureSpawner.calculateNextCreature(level));
}

// randomize stats
creature = creature.getNewInstanceRandomizeStats();
if (StendhalRPAction.placeat(this, creature, Rand.randUniform(MIN_X, MAX_X),
Rand.randUniform(MIN_Y, MAX_Y))) {
numCreatures++;
Expand Down

0 comments on commit 97efe5e

Please sign in to comment.