Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add varying monster spawn #3605

Merged
merged 1 commit into from
Aug 29, 2021

Conversation

marmichalski
Copy link
Contributor

@marmichalski marmichalski commented Aug 27, 2021

Pull Request Prelude

Changes Proposed

Add ability to declare more than one type of monster that will be respawned after death:

	<spawn centerx="103" centery="120" centerz="7" radius="5">
		<monsters x="-1" y="1" z="7" spawntime="180">
			<monster name="Rabbit" chance="70" />
			<monster name="Skunk" chance="30" />
		</monsters>
	</spawn>

This can be of course mixed with single monster node:

	<spawn centerx="103" centery="120" centerz="7" radius="5">
		<monster name="Troll" x="4" y="-1" z="7" spawntime="60" />
		<monsters x="-1" y="1" z="7" spawntime="180">
			<monster name="Rabbit" chance="70" />
			<monster name="Skunk" chance="30" />
		</monsters>
	</spawn>

Total chance calculation could be done a bit better and less error prone, but as it's just an extra feature, I'll leave that to be improved by someone who likes math. 😎

Or chance could be mandatory, then the problem of auto-calculating what's left will be gone.

Issues addressed: #3600

If nobody is interested in adding it to RME, I can do that too.

src/spawn.cpp Outdated Show resolved Hide resolved
}

if (sb.mTypes.empty()) {
std::cout << "[Warning - Spawns::loadFromXml] " << pos << " empty monsters set." << std::endl;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a little bit of a lie, since the set is not empty, but contains non existent monster(s) only 🤔

@marmichalski marmichalski force-pushed the monster-varying-spawn branch from fe94a26 to 851f3ca Compare August 27, 2021 23:29
@DSpeichert
Copy link
Member

Similar: #3280

@ghost ghost added the feature New feature or functionality label Aug 27, 2021
@MillhioreBT
Copy link
Contributor

I guess RME should be updated to allow multiple monsters to be stacked in a single spawn point and give each one a chance.
otherwise who would want to edit the spawn.xml file by hand? XD

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2021-08-28 10_33_05-Tibia - Perflex
2021-08-28 10_40_58-Tibia - Perflex

@ghost ghost requested a review from DSpeichert August 28, 2021 13:41
@ranisalt
Copy link
Member

If nobody is interested in adding it to RME, I can do that too.

It would be interesting to check if their contributors agree on the format, though is good for us

@DSpeichert DSpeichert merged commit 6a8a663 into otland:master Aug 29, 2021
@ghost
Copy link

ghost commented Aug 29, 2021

@marmichalski I think you will be the one responsible for the RME part 😛

@marmichalski marmichalski deleted the monster-varying-spawn branch September 3, 2021 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants