United Warcraft 3 map hacking!
It is currently November 29th, 2022, 6:51 pm

All times are UTC

Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: April 21st, 2021, 6:33 pm 

Joined: January 13th, 2020, 8:49 pm
Posts: 8
These days, I revised a map with useful guides.(drop rate , respawn time , exp rate)
But In this map, there are many raid bosses which don't respawn.
So everytime I kill the boss I should restart the map.
It is so uncomfortable..
So I hope to learn how to add respawn timer and where I should add the code..
Help me !!!

I attached j files and the map that I revised.
Thank you for reading.

+The bosses name
Green/Bronze/Blue/Red/Black_dragon (g b b r dragons respawn after 10 mins but black dragon doesn't)
Nightmare / Naga / Ice_witch / Death_knight / Fire_lord / Four_season / Magic_god / Clovis

You do not have the required permissions to view the files attached to this post.

PostPosted: April 23rd, 2021, 11:12 pm 
Super Moderator

Joined: February 3rd, 2009, 11:28 pm
Posts: 2394
First, find the Unit ID of the boss you want to respawn. To get this, extract the war3map.w3u and search for the unit, and display rawcodes, write down the one you find.

Search the war3map.j and find where the boss drops/actions/etc are handled. There are a couple ways this could be done. The first way it could be done is to assign the boss to a Unit variable when the boss is created, and then hardcode each boss function to use this variable. Or they could use a generic Unit event and check that GetUnitTypeId(GetTriggerUnit()) == 'rawcode'. Which method they use will impact how you code the respawn functionality.

Find the death event for that specific unit or unit type. This will also probably be where it drops the items, so you can search for one of the item rawcode/ID and do a search on it to find this if you want. At the very end of the death function for that unit, call a PolledWait(30) or however long you want to wait, then call CreateUnit for the type of the boss that died. For a very basic one, you can respawn the boss at the same location he died by storing the x and y coordinates in a local variable with GetUnitX(unit) and GetUnitY(unit). You also need to manage whatever triggers were linked to this boss. If it's coded generically and uses Unit IDs, then you won't need to do anything. If it uses a specific trigger created for ONLY that boss, then you need to remake those triggers again.

From here, you can get more advanced by using the original location of the boss, rather than the location where it died. You can also add a Timer and a TimerWindow for a respawn delay, but this will be significantly harder.

PostPosted: April 24th, 2021, 9:51 am 

Joined: March 22nd, 2014, 8:48 am
Posts: 51
Location: Garena
Or just try to add JJCP cheat pack then select that black dragon and write -stop -invul to make him invulerable and paused (if he too big write -size 100 or how much you want)
After that just write -copy and you get another dragon which you can kill and get drop but if map maker did another drop system it can be buggy or not work but it almost always work

I think its much easier than adding other respawn triggers

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 7 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group


Privacy Policy Statement
Impressum (German)