Clan NoHW
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Clan NoHW

Clan NoHW Forum
 
HomePortalLatest imagesSearchRegisterLog in

 

 Unprotect a map and add cheats!!

Go down 
2 posters
AuthorMessage
chibby
Active Member
Active Member
chibby


Number of posts : 111
Location : germany
Battle.net Name : chibby
Registration date : 2008-08-10

Unprotect a map and add cheats!! Empty
PostSubject: Unprotect a map and add cheats!!   Unprotect a map and add cheats!! EmptyTue Aug 19, 2008 9:45 pm

1. Requirements

You’ll need several tools to start off with deprotecting:

MPQ Recover

This nice little Russian tool let’s you create listfiles for maps. All maps need a listfile, so you can open them with MPQMaster, to extract the war3map.j or the whole file(later more).

MPQMaster

A Just another tool, that let’s you open MPQs to look and edit them. I recommend this one because it has a good layout and the control is really easy.

xdep

Another Russian tool, which makes all the work of deprotecting for you, like moving the war3map.j from Scripts/war3map.j to the map itself(a protection method: you can put the war3map.j from a map with a MPQ-Editor into a folder called Scripts; Warcraft 3 can still read the map, but the editor can’t).

Jasscraft

A nice tool, which let’s you view files, which are written in JASS(programming language for Warcraft 3 maps).

Download:
http://rapidshare.com/files/33860568/MapUnprotection_by_tschoerk.rar

WorldEditor

If you want to open the deprotected maps you need it(o rly?).

Warcraft 3

O rly?

2. Two choices
You’ll ask yourself, why two choices? Just deprotect add cheats, etc. and then play. Well that’s one option. The other one is to add cheats without even deprotecting the map. Sure you can’t look at the map, but it doesn’t really matter imho, because you can look at the triggers without deprotecting and you’ll see the layout of the map if you simply play it. Also some maps have custom models in them. You can make them unreadable, so you can’t even create a listfile for them, since MPQ Recover will crash if you try to create one(DOTA for example). Without (proper)listfile, no fully deprotected map(you can still open them in WE, but if you play the map, some models will be missing and missing icons will simply be a green square), without fully deprotected map, no cheats, without cheats, no sense in deprotecting anyway .

3. Adding cheats without deprotection
OK let’s with the easier way to add cheats into a map. You’ll need MPQ Recover, MPQMaster and Jasscraft for this part.

3.1. Creating a listfile
Start MPQRecover. Let’s have a look how to create a listfile for a map:

1. You can open your desired map with this button.
2. Tick Deep MPQ Scanning. Now it scans every file reeeeaallly deep, so you get a complete listfile.
3. Click Brute Force. It creates the basic of the listfile.
4. Click Scan. Now it’ll scan every single file it created, when you clicked Brute Force. When it’s finished you should get a full listfile.
5. Click Save List and save it into the MPQMaster/Listfiles folder.

If MPQ Recover crashes, open MPQ Recover again, but now don’t tick Deep MPQ Scanning. If it crashes again(never happened to me), tick Deep MPQ Scanning again, but this time don’t click on Brute Force.
Now you got your listfile. Let’s go to the fun part

3.2. Extracting the war3map.j
Open up MPQMaster, open your map and choose the listfile you just created, when it asks you what listfile to use.

That’s kinda like the map should look like(except for the dozens of files named FileXXXXX, that’s only if the map is protected very well.
Most of the times there’s a folder called Scripts(circle). In there is a file called wc3map.j. Right click on it and extract it to any folder. In this file, there are all triggers in JASS, the
language of wc3maps.

3.3. Editing the war3map.j
Now we will add cheats to the map. Start Jasscraft and open up the wc3map.j.

Depending on the map, there are a bunch of triggers. If you know JASS it should be no problem at all to add cheats. Anyway most of you won’t and so I’ll list here the most popular cheats(just copy it):

Code:
trigger ICHEAT=CreateTrigger()
trigger CHEATS=CreateTrigger()

Put this code right under globals like here:


Code:
function WaitForDisable takes player p, string s returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterPlayerChatEvent(t,p,s,true)
loop
call TriggerSleepAction(1.00)
exitwhen GetTriggerExecCount(t)>0
endloop
call DestroyTrigger(t)
set t=null
endfunction
function ResetCD takes nothing returns nothing
call UnitResetCooldown(GetTriggerUnit())
endfunction
function ResetMP takes nothing returns nothing
local unit u=GetTriggerUnit()
call SetUnitState(u,UNIT_STATE_MANA,GetUnitState(u,UNIT _STATE_MAX_MANA))
set u=null
endfunction
function NoCooldown takes player p returns nothing
local trigger t=CreateTrigger()
local triggeraction ta=TriggerAddAction(t,function ResetCD)
call TriggerRegisterPlayerUnitEvent(t,p,EVENT_PLAYER_UN IT_SPELL_CAST,null)
call TriggerRegisterPlayerUnitEvent(t,p,EVENT_PLAYER_UN IT_SPELL_FINISH,null)
call TriggerRegisterPlayerUnitEvent(t,p,EVENT_PLAYER_UN IT_SPELL_CHANNEL,null)
call TriggerRegisterPlayerUnitEvent(t,p,EVENT_PLAYER_UN IT_SPELL_ENDCAST,null)
call TriggerRegisterPlayerUnitEvent(t,p,EVENT_PLAYER_UN IT_SPELL_EFFECT,null)
call WaitForDisable(p,"-cdon")
call DisableTrigger(t)
call TriggerRemoveAction(t,ta)
call DestroyTrigger(t)
set t=null
set ta=null
endfunction
function InfMana takes player p returns nothing
local trigger t=CreateTrigger()
local triggeraction ta=TriggerAddAction(t,function ResetMP)
call TriggerRegisterPlayerUnitEvent(t,p,EVENT_PLAYER_UN IT_SPELL_CAST,null)
call TriggerRegisterPlayerUnitEvent(t,p,EVENT_PLAYER_UN IT_SPELL_FINISH,null)
call TriggerRegisterPlayerUnitEvent(t,p,EVENT_PLAYER_UN IT_SPELL_CHANNEL,null)
call TriggerRegisterPlayerUnitEvent(t,p,EVENT_PLAYER_UN IT_SPELL_ENDCAST,null)
call TriggerRegisterPlayerUnitEvent(t,p,EVENT_PLAYER_UN IT_SPELL_EFFECT,null)
call WaitForDisable(p,"-nomana")
call DisableTrigger(t)
call TriggerRemoveAction(t,ta)
call DestroyTrigger(t)
set t=null
set ta=null
endfunction
function Cheatz takes nothing returns nothing
local player p=GetTriggerPlayer()
local string s=GetEventPlayerChatString()
local integer i=S2I(SubString(s,5,20))
local integer z=S2I(SubString(s,4,19))
local integer c=S2I(SubString(s,9,11))
local integer temp=0
local group g=CreateGroup()
local unit u
if SubString(s,0,5)=="-gold" then
call SetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD,GetPla yerState(p,PLAYER_STATE_RESOURCE_GOLD )+S2I(SubString(s,6,13)))
elseif SubString(s,0,7)=="-lumber" then
call SetPlayerState(p,PLAYER_STATE_RESOURCE_LUMBER,GetP layerState(p,PLAYER_STATE_RESOURCE_LUMBER )+S2I(SubString(s,8,15)))
elseif SubString(s,0,5)=="-mana" then
call InfMana(p)
elseif SubString(s,0,5)=="-nocd" then
call NoCooldown(p)
endif
call GroupEnumUnitsSelected(g,p,null)
loop
set u=FirstOfGroup(g)
exitwhen u==null
if i>=1 then
if SubString(s,0,4)=="-int" then
call SetHeroInt(u,i,true)
elseif SubString(s,0,4)=="-agi" then
call SetHeroAgi(u,i,true)
elseif SubString(s,0,4)=="-str" then
call SetHeroStr(u,i,true)
endif
endif
if SubString(s,0,4)=="-lvl" then
call SetHeroLevelBJ(u,i,false)
elseif SubString(s,0,3)=="-xp" then
call SetHeroXP(u,z,false)
elseif SubString(s,0,3)=="-hp" then
call SetUnitState(u,UNIT_STATE_LIFE,z)
elseif SubString(s,0,3)=="-mp" then
call SetUnitState(u,UNIT_STATE_MANA,z)
elseif SubString(s,0,6)=="-invul" then
call SetUnitInvulnerable(u,true)
elseif SubString(s,0,4)=="-vul" then
call SetUnitInvulnerable(u,false)
elseif SubString(s,0,5)=="-kill" then
call KillUnit(u)
elseif SubString(s,0,3)=="-ms" then
call SetUnitMoveSpeed(u,z)
elseif SubString(s,0,7)=="-pathon" then
call SetUnitPathing(u,true)
elseif SubString(s,0,Cool=="-pathoff" then
call SetUnitPathing(u,false)
elseif SubString(s,0,Cool=="-additem" then
set temp=0
loop
set temp=temp+1
exitwhen temp>c
call CreateItemLoc( ChooseRandomItemExBJ(-1, ITEM_TYPE_ANY), GetUnitLoc(u) )
endloop
endif
call GroupRemoveUnit(g,u)
endloop
call DestroyGroup(g)
if SubString(s,0,3)=="-mh" then
call FogModifierStart(CreateFogModifierRect(p,FOG_OF_WA R_VISIBLE,bj_mapInitialPlayableArea,false,false))
endif
set s=""
set p=null
set g=null
endfunction
function CheatUse takes nothing returns nothing
local player p=GetTriggerPlayer()
if SubString(GetEventPlayerChatString(),0,23)=="-cheats on" then
call TriggerRegisterPlayerChatEvent(CHEATS,p,"-",false)
call DisplayTimedTextToPlayer(p,0,0,60,"|cffff0000Cheat s Enabled!|r")
endif
set p=null
endfunction

Next scroll down to where it says endglobals. Put this code right under it, like this:



Now scroll to the very end of the map where it says function main takes nothing returns nothing. Put this code under the locals.

Code:
local integer qaz=0
loop
exitwhen qaz>11
call TriggerRegisterPlayerChatEvent(ICHEAT,Player(qaz), "-cheat",false)
set qaz=qaz+1
endloop
call TriggerAddAction(ICHEAT,function CheatUse)
call TriggerAddAction(CHEATS,function Cheatz)

Should look like this:



Save the file and close Jasscraft
Credits to Aero for this cheatpack

3.4. Importing the war3map.j into the map again

Open up MPQMaster again and open the map, choose listfile, and open the Scripts folder again. Now right click on the war3map.j and click on Add File. Choose your new war3map.j, click ok and click yes to overwrite. Close MPQMaster, copy the map into your maps folder, start Warcraft 3 and test the cheats out.
You have the following cheats:
"-cheats on" Turns cheats on
-additem Adds random item
-mp x Sets your mana points to x
-hp x Sets your health points to x
-gold x Sets your gold to x
-lumber x Sets your lumber to x
-lvl x Sets your lvl to x
-xp x Sets your xp to x
-str x Sets your strenght to x
-agi x Sets your agility to x
-int x Sets your intelligence to x
-ms x Sets your movementspeed to x
-kill Kills the target unit
-invul Makes you invulnerable
-vul Makes you vunerable
-nocd Turns no cooldown on
-cdon Turns cooldown on
-mana Infinte mana
-nomana Turns infite mana off


4. Deprotection

If you want to deprotect the map to have a look at it you’ll need xdep, MPQMaster, MPQ Recover.

4.1. Using xdep

Let’s start by setting up the xdep.ini.


Only the two lines inmapfile…and outmapfile are imported for us. Inmapfile is the name of the file you want to deprotect. Wether it’s an expansion or a classic file it has the ending *.w3x or *.w3m. You can leave the name has it is, since you can simply rename the map before the deprotection. Outmapfile is the name of map which will be de deprotected. Wether it’s an expansion or a classic file it has the ending *.w3x or *.w3m. You can leave the name, since you can rename it after it has been deprotected.
Xdep is a very nifty little tool. It automatically deprotects your maps. Start by copying you map into the same folder as xdep.exe. Rename it to YourMap.w3x/w3m and start xdep.exe.

If it looks like this it’s unprotected:


If it has some unknown files like this,

go to the next step.

4.2. Creating a listfile

Create a listfile with MPQ Recover. I already described this(scroll up!). If the problem occurs, that the tool crashes you got bad luck and some models will be missing if you unprotect the map. Anyway make a listfile and move on to the next step.

4.3. Extracting the map

Open the map with MPQMaster, open the map, but now instead of only extracting the war3map.j, click on operation and click on extract all. Locate the folder xdep/ YourMap.w3x.temp/files and extract the files into this folder.

4.4. Using xdep(again)

Run xdep again. Now it doesn’t extract the files, since you already did that and unprotects the map.
Now open the map with WE, look at the map, triggers, add cheats(easier since you can use the gui) w/e and save it under the original name.

5. FAQ


Credits to d3 for this amazing tutorial!


dann sieht man alle triggers ^^
Back to top Go down
Sir_PostsALoT
Admin
Admin
Sir_PostsALoT


Number of posts : 321
Age : 34
Location : Pleinfeld aka Hero Wars City, Germany
Battle.net Name : UnExiledBrandy
Registration date : 2008-05-19

Unprotect a map and add cheats!! Empty
PostSubject: Re: Unprotect a map and add cheats!!   Unprotect a map and add cheats!! EmptyFri Aug 22, 2008 7:46 pm

ima try this MUHAHAHA!

looks like you are some kind of hacker =P
Back to top Go down
https://clan-nohw.forumotion.com
 
Unprotect a map and add cheats!!
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Clan NoHW :: General Talk :: Technical Section-
Jump to: