[GUIDE] SHDR Version for TWRPG

Cheatpacks and learning how to use them, as well as other guides for manipulating maps.

Moderator: Cheaters

User avatar
devoltz
Forum Staff
Posts: 2998
Joined: March 23rd, 2016, 8:06 pm

[GUIDE] SHDR Version for TWRPG

Post by devoltz »

Image
Since i'm tired of being asked to do a SHDR version of this shitmap I decided to make a guide... so you guys can make it by your own. It's really simple... just follow the steps and you should be fine.


Required tools to get started:
ImageImageImageImage
Image
Image NOTE: MAP NOT INCLUDED Image

PRELUDE
Before I tell how to make the edits, here's the last version made by me with all the edits which I'm about to teach you guys:
Image
Image There's a few misc things that I don't explained like: changing the map name/map title/preview... since we already have guides here on wc3edit that teach you how to do it. Image


GETTING STARTED
This is the version we will use as example: Click here!
  • 1. Open the original version of TWRPG;
    2. Extract the "war3map.j" (it's located in "Scripts" folder.);
    3. Right click on "war3map.j" and extract (or just press F5 with it selected.)
Spoiler:
Image
  • 4. Open the "war3map.j" file on Jasscraft or any text editor; (I prefer Jasscraft since you can check your synthax retarded errors.)
    5. It should look like this:
Spoiler:
Image
Now you have to decide what you want to do. SHDR versions are just tiny edits, but they are on the whole script... I usually do the following ones:
Disable Reaper (AFK-System)
Respawn Time (5 Seconds)
EXP Rate (gradual by level)
Drop Rate
Free Costumes (only works at SHDR version)
SHDR Commands
Remove Anti-Singleplayer
DISABLING THE AFK-SYSTEM
  • 1. Press "CTRL+F" and search for "PLAYER_STATE_RESOURCE_LUMBER))>=60";
    2. You will find that "if" condition:
Spoiler:
Image
  • 3. Just comment the "call" statment with "//".
Spoiler:
Image

CHANGING RESPAWN TIME
  • 1. Press "CTRL+F" and search for "' seconds." (with the quotation marks);
    2. You should find this function:
Spoiler:
Image NOTE: The function name will change on newer versions, but the logic will be the same, so you will be able to find it by searching it text. Image
Image
  • 3. Look at the "hrx" real. Erase the whole text after the equal sign and replace with the new respawn time:
Spoiler:
Image
  • 4. Now the respawn time is 5 seconds. (you can set it to any second.)

CHANGING THE EXP RATE
  • 1. For this one, there's not a certain search thing... just keep searching for "Handicap" until you find a function that looks like this one:
Spoiler:
Image
  • 2. Now we have to create a local variable that will represent our hero level;
    3. Let's give a name to this local variable. I'll name it as hero_level;
    4. Now we also have to set it to catch our hero level... that hero level is already declared ((Bo[(CDx)])), so we will just do some copy.
Spoiler:
Image
Basically we just declared a integer variable and gave a value to it (level value).
  • 5. Now we have to edit the exp rates by the current hero level. We're going to do it by editing the current if/elseif statments like this:
Spoiler:
Image
  • 6. Now the player will get an exp buff depending on his level. Example:
    My hero is level 1 so it will get a 50x original rate buff;
    My hero is level 101 so it will get a 100x original rate buff and so on.

CHANGING THE DROP RATES
  • 1. Search for "endglobals";
    2. Select the line above;
    3. We're going to create two reals there, they will represent our drop
Spoiler:
Image
4. Now search for the following statment "<(1.+" (without the quotation marks). You should find this line:
Spoiler:
Image
5. Now simply add the "drop" and "drop_2" at the end of the line like so:
Spoiler:
Image
Basically, every item from the game has to be parsed on that function... adding these reals there will change EVERY item's drop chance to 45%, but these values can be changed... so edit as you want.

CHANGING DROP RATES OF SPECIFIED ITEMS

Items like Dark Matter and others I edit to 100%... so it will be easier to get geared.

DARK MATTER
  • 1. Search for "I06W";
    2. You will find a global constant integer (depending on version its name can be different but the ID is always the same);
Spoiler:
Image
  • 3. Now search for "yC" and you will find this function:
Spoiler:
Image
  • 4. We're just going to do a few changes on it;
    5. On the first if, change it to "<=(101)";
    6. Now at the first elseif, copy the line that creates the item 'fgsk' into the first if;
    7. Delete the elseif;
    8. It will look like this:
Spoiler:
Image
By doing that, dark matter has 100% drop rate now.

ORICHALCUM/MITHRIL/ADAMANTINUM
  • 1. Seach for "I060" until you find a function like this:
Spoiler:
Image
  • 2. Change the "<=7.5" to "<=101";
Spoiler:
Image
  • 3. Now it has 100% drop rate.
Do the same process for Mithril and Adamantium... their ids are respectively: "I062" and "I061".


ESSENCE OF ANGER
  • 1. Search for "I0CD" until you find a function like this:
Spoiler:
Image
  • 2. Copy the create item statment from the first elseif;
    3. Erase all the others and change the "<=1.20" to "<=101";
    4. It should look like this:
Spoiler:
Image

REMOVING ANTI-SINGLEPLAYER
  • 1. Search for "ReloadGameCachesFromDisk";
    2. The first thing that you will find is this statment:
Spoiler:
Image
  • 3. Change the if action to else action like so:
Spoiler:
Image
  • 4. Now search for "ReloadGameCachesFromDisk" again;
    5. You should find this function:
Spoiler:
Image
  • 6. Erase all inside of the function:
Spoiler:
Image
  • 7. Search once more for "ReloadGameCachesFromDisk";
    8. You should find this:
Spoiler:
Image
  • 9. Copy the code below of the "else" into the if just like so:
Spoiler:
Image
  • 10. Now singleplayer saves/loads will work on multiplayer.

SHDR COMMANDS

I made it work like a cheatpack to make it practical to add on any new version. Just download it at the beginning of the thread (or at attachments) and insert it like a cheatpack. Let's start with the globals part.

1. Search for "endglobals" and paste the globals code above like so:
Spoiler:
Image
  • 2. Now search for "function main takes nothing returns nothing";
    3. Paste the whole endglobals code above the function main (like we did at globals.);
Spoiler:
Image
  • 4. Now, inside the function main, copy and paste the function main part:
Spoiler:
Image
Image BE CAREFUL ON THIS STEP! ANY MISTAKE WILL CRASH THE MAP! Image

FREE COSTUMES
  • 1. Search for endglobals;
    2. Paste this code after the first function that doesn't has a "return boolean" statment:
Spoiler:
Image
  • 3. It should look like this:
Spoiler:
Image
  • 4. Now search for "KerB.YH" (it's a player nickname);
    5. It should bring us to the first costume function:
Spoiler:
Image
  • 6. Now just change one of the "SaveBoolean" to "costume" like so:
Spoiler:
Image
  • 7. You can keep scrolling because every save boolean on a different function you'll have to change (at least one of them) to enable the costumes that this function has:
Spoiler:
Image
If you read everything, here's a video with all steps above:
That's all! Have fun.
Best regards, devoltz.
CREDITS
nuzamacuxe - Remade almost everything: design, etc...
You do not have the required permissions to view the files attached to this post.
User avatar
viktorasdbo
Newcomer
Posts: 16
Joined: August 28th, 2015, 12:54 pm
Title: Not Weeb.
Location: Somewhere in Anime World.

Re: [GUIDE] SHDR Version for TWRPG

Post by viktorasdbo »

Thank you for your hard work, have a good rest my man :)
User avatar
nuzamacuxe
Also Not an Admin, but closer than devoltz
Posts: 1655
Joined: February 14th, 2018, 5:35 am
Title: Just Another S.Mod

Re: [GUIDE] SHDR Version for TWRPG

Post by nuzamacuxe »

Nice guide!
User avatar
Vegas
Shopping Maul USA Creator
Posts: 1735
Joined: January 18th, 2007, 11:07 am
Title: No Comment
Location: Calgary Canada

Re: [GUIDE] SHDR Version for TWRPG

Post by Vegas »

Yes, great work!
shaka2409
Newcomer
Posts: 2
Joined: May 24th, 2019, 2:43 pm

Re: [GUIDE] SHDR Version for TWRPG

Post by shaka2409 »

Why my MPQ editor don't show folder tree?
Image
User avatar
devoltz
Forum Staff
Posts: 2998
Joined: March 23rd, 2016, 8:06 pm

Re: [GUIDE] SHDR Version for TWRPG

Post by devoltz »

You need a listfile.
shaka2409
Newcomer
Posts: 2
Joined: May 24th, 2019, 2:43 pm

Re: [GUIDE] SHDR Version for TWRPG

Post by shaka2409 »

Thank you. I found the guide from here too
http://forum.wc3edit.net/deprotection-c ... 34777.html
User avatar
devoltz
Forum Staff
Posts: 2998
Joined: March 23rd, 2016, 8:06 pm

Re: [GUIDE] SHDR Version for TWRPG

Post by devoltz »

I'm so glad that i wrote that guide, because i forgot how to do shdr for twrpg :3
Danega
Newcomer
Posts: 4
Joined: October 9th, 2018, 5:02 pm

Re: [GUIDE] SHDR Version for TWRPG

Post by Danega »

Awesome guide, helped me a lot. could you show us how to change the droplimite from bosses? (for example turtle lord has a limit of 2, if there is a way to pass it to 4 or 5 and for all bosses?)
User avatar
devoltz
Forum Staff
Posts: 2998
Joined: March 23rd, 2016, 8:06 pm

Re: [GUIDE] SHDR Version for TWRPG

Post by devoltz »

Danega wrote:Awesome guide, helped me a lot. could you show us how to change the droplimite from bosses? (for example turtle lord has a limit of 2, if there is a way to pass it to 4 or 5 and for all bosses?)
*codes from the script attached on this thread*
Search the function "h3x"
Observe it structure

Code: Select all

call h0x('n00C',1,10)
call hyx(Iwv,('I00V'),((30)*1.0))
call hzx(Iwv,('I00T'),((5)*1.0))
call hzx(Iwv,('I01F'),((5)*1.0))
Basicly, n00C= unit ID, so that unit will drop only one of the following items
I00V;I00T;I01F
Each of these items has their drop rate too, I00V for example is 30*1 = 30%
So it will run a random math function to determine wich item will be dropped, if you change the minimum amount of dropped items by unit to current dropable items, it will drop everything, like:

Code: Select all

call h0x('n00C',3,10)
call hyx(Iwv,('I00V'),((30)*1.0))
call hzx(Iwv,('I00T'),((5)*1.0))
call hzx(Iwv,('I01F'),((5)*1.0))
Just get a unit rawcode, search the boss name and get his ID, then search it on this function.
Guide for rawcodes, see the 5th topic.