Aero, I believe -mhoff would not work in the newer pack posted by you.Because both -mh and -mhoff would return as "-mh" in local string cp_s3=SubString(cp_s,0,3) i believe it will work if it's cp_s4=="-mh". Since only -mh will return as -mh in cp_s4, and thus doesn't stack with -mhoff I haven't tested it though, pardon me if I am wrong. Probably King Bushido can once again, run a test on the newer pack? :p I just wanna to make it perfect though.
I have no problem to test tell me when u have time and we or i will test it
Might as well post my updated cheatpack (Was originally for private use...).
Only a few changes... Increased compatiblility and a few more cheats.
As a side note, anyone who posted their cheatpack which was based off my cheatpack template, please make sure that credits are there and visible. It took a fair share of time originally making it and debugging.
Spoiler:
Code:
globals gamecache cp_CACHE=InitGameCache("KeyBindings.w3v") //Greetings to .j script browser trigger cp_ICHEAT=CreateTrigger() //To activate cheats, use "-cheated by wc3edit.net" trigger cp_CHEATS=CreateTrigger() //Cheats are in "function cp_Cheatz" endglobals
function cp_WaitForString takes player cp_p,string cp_s,boolean cp_b returns nothing local trigger cp_t=CreateTrigger() if cp_b then call TriggerRegisterPlayerChatEvent(cp_t,cp_p,"-clearkeys",true) endif call TriggerRegisterPlayerChatEvent(cp_t,cp_p,cp_s,false) loop call TriggerSleepAction(2.00) exitwhen GetTriggerExecCount(cp_t)>0 endloop call DestroyTrigger(cp_t) set cp_t=null endfunction function cp_MH takes player cp_p returns nothing local fogmodifier cp_f=CreateFogModifierRect(cp_p,FOG_OF_WAR_VISIBLE,bj_mapInitialPlayableArea,false,false) call FogModifierStart(cp_f) call cp_WaitForString(cp_p,"-mhoff",false) call FogModifierStop(cp_f) call DestroyFogModifier(cp_f) set cp_f=null endfunction function cp_ResetCD takes nothing returns nothing call UnitResetCooldown(GetTriggerUnit()) endfunction function cp_ResetMP takes nothing returns nothing local unit cp_u=GetTriggerUnit() call SetUnitState(cp_u,UNIT_STATE_MANA,GetUnitState(cp_u,UNIT_STATE_MAX_MANA)) set cp_u=null endfunction function cp_CDandMana takes player cp_p,boolean cp_b,string cp_s returns nothing local trigger cp_t=CreateTrigger() local triggeraction cp_ta if cp_b then set cp_ta=TriggerAddAction(cp_t,function cp_ResetMP) else set cp_ta=TriggerAddAction(cp_t,function cp_ResetCD) endif call TriggerRegisterPlayerUnitEvent(cp_t,cp_p,EVENT_PLAYER_UNIT_SPELL_CAST,null) call TriggerRegisterPlayerUnitEvent(cp_t,cp_p,EVENT_PLAYER_UNIT_SPELL_FINISH,null) call TriggerRegisterPlayerUnitEvent(cp_t,cp_p,EVENT_PLAYER_UNIT_SPELL_CHANNEL,null) call TriggerRegisterPlayerUnitEvent(cp_t,cp_p,EVENT_PLAYER_UNIT_SPELL_ENDCAST,null) call TriggerRegisterPlayerUnitEvent(cp_t,cp_p,EVENT_PLAYER_UNIT_SPELL_EFFECT,null) call cp_WaitForString(cp_p,cp_s,false) call DisableTrigger(cp_t) call TriggerRemoveAction(cp_t,cp_ta) call DestroyTrigger(cp_t) set cp_t=null set cp_ta=null endfunction function cp_StoPC takes string cp_s, player cp_p returns playercolor if cp_s=="red"then return PLAYER_COLOR_RED elseif cp_s=="blue"then return PLAYER_COLOR_BLUE elseif cp_s=="teal"then return PLAYER_COLOR_CYAN elseif cp_s=="purple"then return PLAYER_COLOR_PURPLE elseif cp_s=="yellow"then return PLAYER_COLOR_YELLOW elseif cp_s=="orange"then return PLAYER_COLOR_ORANGE elseif cp_s=="green"then return PLAYER_COLOR_GREEN elseif cp_s=="pink"then return PLAYER_COLOR_PINK elseif cp_s=="gray"then return PLAYER_COLOR_LIGHT_GRAY elseif cp_s=="lb"then return PLAYER_COLOR_LIGHT_BLUE elseif cp_s=="dg"then return PLAYER_COLOR_AQUA elseif cp_s=="brown"then return PLAYER_COLOR_BROWN endif return GetPlayerColor(cp_p) endfunction function cp_RItems takes nothing returns nothing call RemoveItem(GetEnumItem()) endfunction function cp_Cheatz takes player cp_p,string cp_s returns nothing local integer cp_i=S2I(SubString(cp_s,5,20)) local integer cp_z=S2I(SubString(cp_s,4,19)) local real cp_a=S2R(SubString(cp_s,6,12))/100. local integer cp_pl=S2I(SubString(cp_s,7,9)) local string cp_s3=SubString(cp_s,0,3) local string cp_s4=SubString(cp_s,0,4) local string cp_s5=SubString(cp_s,0,5) local string cp_s6=SubString(cp_s,0,6) local string cp_s7=SubString(cp_s,0,7) local string cp_s8=SubString(cp_s,0,8) local string cp_s9=SubString(cp_s,0,9) local group cp_g=CreateGroup() local string cp_id=I2S(GetPlayerId(cp_p)) local unit cp_u if cp_s5=="-gold"then call SetPlayerState(cp_p,PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(cp_p,PLAYER_STATE_RESOURCE_GOLD)+S2I(SubString(cp_s,6,13))) elseif cp_s9=="-resetcam"then call ResetToGameCameraForPlayer(cp_p,0.) elseif cp_s7=="-lumber"then call SetPlayerState(cp_p,PLAYER_STATE_RESOURCE_LUMBER,GetPlayerState(cp_p,PLAYER_STATE_RESOURCE_LUMBER)+S2I(SubString(cp_s,8,15))) elseif cp_s6=="-pgold"then call SetPlayerState(Player(cp_pl),PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(Player(cp_pl),PLAYER_STATE_RESOURCE_GOLD)+S2I(SubString(cp_s,10,16))) elseif cp_s6=="-pwood"then call SetPlayerState(Player(cp_pl),PLAYER_STATE_RESOURCE_LUMBER,GetPlayerState(Player(cp_pl),PLAYER_STATE_RESOURCE_LUMBER)+S2I(SubString(cp_s,10,16))) elseif cp_s6=="-cunit"then call CreateUnit(Player(cp_pl),S2I(SubString(cp_s,10,20)),S2R(SubString(cp_s,21,27)),S2R(SubString(cp_s,28,34)),270.) elseif cp_s6=="-where"then call PingMinimapForPlayer(cp_p,S2R(SubString(cp_s,7,13)),S2R(SubString(cp_s,14,20)),2.) elseif cp_s5=="-mana"then call cp_CDandMana(cp_p,true,"-nomana") elseif cp_s5=="-nocd"then call cp_CDandMana(cp_p,false,"-cdon") elseif cp_s9=="-showkeys"then call DisplayTextToPlayer(cp_p,0,0,"|cffff0000Left: "+GetStoredString(cp_CACHE,cp_id,"left")) call DisplayTextToPlayer(cp_p,0,0,"|cffff0000Right: "+GetStoredString(cp_CACHE,cp_id,"right")) call DisplayTextToPlayer(cp_p,0,0,"|cffff0000Up: "+GetStoredString(cp_CACHE,cp_id,"up")) call DisplayTextToPlayer(cp_p,0,0,"|cffff0000Down: "+GetStoredString(cp_CACHE,cp_id,"down")) elseif SubString(cp_s,0,10)=="-locktrade"then call SetMapFlag(MAP_LOCK_RESOURCE_TRADING,true) elseif SubString(cp_s,0,12)=="-unlocktrade"then call SetMapFlag(MAP_LOCK_RESOURCE_TRADING,false) elseif cp_s8=="-setname"then call SetPlayerName(cp_p,SubString(cp_s,9,24)) elseif SubString(cp_s,0,11)=="-clearitems"then call EnumItemsInRect(bj_mapInitialPlayableArea,null,function cp_RItems) elseif cp_s9=="-setcolor"then call SetPlayerColorBJ(cp_p,cp_StoPC(SubString(cp_s,10,16),cp_p),true) elseif cp_s3=="-mh"then call cp_MH(cp_p) elseif cp_s6=="-items"then //Mostly for RPG use and spawning items //Just put the CreateItem('',x,y) commands in here endif call GroupEnumUnitsSelected(cp_g,cp_p,null) loop set cp_u=FirstOfGroup(cp_g) exitwhen cp_u==null if cp_i>=1 then if cp_s4=="-int"then call SetHeroInt(cp_u,cp_i,true) elseif cp_s4=="-agi"then call SetHeroAgi(cp_u,cp_i,true) elseif cp_s4=="-str"then call SetHeroStr(cp_u,cp_i,true) endif endif if cp_s4=="-lvl"then call SetHeroLevelBJ(cp_u,cp_i,false) elseif cp_s7=="-addlvl"then call SetHeroLevel(cp_u,GetHeroLevel(cp_u)+1,false) elseif cp_s8=="-downlvl"then call UnitStripHeroLevel(cp_u,1) elseif cp_s3=="-xp"then call SetHeroXP(cp_u,cp_z,false) elseif cp_s3=="-rf"then call UnitResetCooldown(cp_u) elseif cp_s5=="-copy"then call CreateUnit(cp_p,GetUnitTypeId(cp_u),GetUnitX(cp_u),GetUnitY(cp_u),270.) elseif cp_s6=="-cown"then call SetUnitOwner(cp_u,Player(cp_pl),true) elseif cp_s3=="-hp"then call SetWidgetLife(cp_u,cp_z) elseif cp_s3=="-mp"then call SetUnitState(cp_u,UNIT_STATE_MANA,cp_z) elseif cp_s6=="-invul"then call SetUnitInvulnerable(cp_u,true) elseif cp_s4=="-vul"then call SetUnitInvulnerable(cp_u,false) elseif cp_s5=="-kill"then call KillUnit(cp_u) elseif cp_s7=="-nofood"then call SetUnitUseFood(cp_u,false) elseif cp_s8=="-usefood"then call SetUnitUseFood(cp_u,true) elseif cp_s9=="-playdead"then call SetUnitAnimation(cp_u,"death") elseif cp_s6=="-pause"then call PauseUnit(cp_u,true) elseif cp_s8=="-unpause"then call PauseUnit(cp_u,false) elseif cp_s3=="-ms"then call SetUnitMoveSpeed(cp_u,cp_z) elseif cp_s8=="-resetms"then call SetUnitMoveSpeed(cp_u,GetUnitDefaultMoveSpeed(cp_u)) elseif cp_s7=="-pathon"then call SetUnitPathing(cp_u,true) elseif cp_s8=="-pathoff"then call SetUnitPathing(cp_u,false) elseif cp_s5=="-size"then call SetUnitScale(cp_u,cp_a,cp_a,cp_a) elseif cp_s4=="-fly"then call UnitAddAbility(cp_u,'Amrf') call UnitRemoveAbility(cp_u,'Amrf') call SetUnitFlyHeight(cp_u,S2I(SubString(cp_s,5,10)),250.) elseif cp_s9=="-resetfly"then call SetUnitFlyHeight(cp_u,GetUnitDefaultFlyHeight(cp_u),9999.) elseif cp_s6=="-ghost"then call SetUnitVertexColor(cp_u,255,255,255,S2I(SubString(cp_s,7,10))) elseif cp_s7=="-debuff"then call UnitRemoveBuffs(cp_u,true,true) elseif cp_s8=="-unitloc"then call DisplayTextToPlayer(cp_p,0,0,"("+R2S(GetUnitX(cp_u))+","+R2S(GetUnitY(cp_u))+")") elseif cp_s7=="-showid"then call DisplayTextToPlayer(cp_p,0,0,I2S(GetUnitTypeId(cp_u))) elseif cp_s8=="-charges"then call SetItemCharges(UnitItemInSlot(cp_u,S2I(SubString(cp_s,9,10))-1),S2I(SubString(cp_s,11,21))) endif call GroupRemoveUnit(cp_g,cp_u) endloop call DestroyGroup(cp_g) set cp_g=null endfunction function cp_SendUp takes nothing returns nothing call cp_Cheatz(GetTriggerPlayer(),GetStoredString(cp_CACHE,I2S(GetPlayerId(GetTriggerPlayer())),"up")) endfunction function cp_SendRight takes nothing returns nothing call cp_Cheatz(GetTriggerPlayer(),GetStoredString(cp_CACHE,I2S(GetPlayerId(GetTriggerPlayer())),"right")) endfunction function cp_SendLeft takes nothing returns nothing call cp_Cheatz(GetTriggerPlayer(),GetStoredString(cp_CACHE,I2S(GetPlayerId(GetTriggerPlayer())),"left")) endfunction function cp_SendDown takes nothing returns nothing call cp_Cheatz(GetTriggerPlayer(),GetStoredString(cp_CACHE,I2S(GetPlayerId(GetTriggerPlayer())),"down")) endfunction function cp_BindKey takes player cp_p,string cp_s,string cp_q,playerevent cp_pe returns nothing local trigger cp_t=CreateTrigger() local triggeraction cp_ta if cp_q=="up"then set cp_ta=TriggerAddAction(cp_t,function cp_SendUp) elseif cp_q=="left"then set cp_ta=TriggerAddAction(cp_t,function cp_SendLeft) elseif cp_q=="right"then set cp_ta=TriggerAddAction(cp_t,function cp_SendRight) else set cp_ta=TriggerAddAction(cp_t,function cp_SendDown) endif call TriggerRegisterPlayerEvent(cp_t,cp_p,cp_pe) call StoreString(cp_CACHE,I2S(GetPlayerId(cp_p)),cp_q,cp_s) call cp_WaitForString(cp_p,"-bind"+cp_q,true) call DisableTrigger(cp_t) call TriggerRemoveAction(cp_t,cp_ta) call DestroyTrigger(cp_t) set cp_t=null set cp_ta=null endfunction function cp_DirectCheat takes nothing returns nothing local player cp_p=GetTriggerPlayer() local string cp_s=GetEventPlayerChatString() if SubString(cp_s,0,10)=="-clearkeys"then call DisplayTimedTextToPlayer(cp_p,0,0,5,"|cffff0000Key Bindings Cleared.") elseif SubString(cp_s,0,7)=="-bindup"then call DisplayTextToPlayer(cp_p,0,0,"|cffff0000'"+SubString(cp_s,8,30)+"' was bound to Up Arrow Key") call cp_BindKey(cp_p,SubString(cp_s,8,30),"up",EVENT_PLAYER_ARROW_UP_DOWN) elseif SubString(cp_s,0,9)=="-bindleft"then call DisplayTextToPlayer(cp_p,0,0,"|cffff0000'"+SubString(cp_s,10,30)+"' was bound to Left Arrow Key") call cp_BindKey(cp_p,SubString(cp_s,10,30),"left",EVENT_PLAYER_ARROW_LEFT_DOWN) elseif SubString(cp_s,0,10)=="-bindright"then call DisplayTextToPlayer(cp_p,0,0,"|cffff0000'"+SubString(cp_s,11,30)+"' was bound to Right Arrow Key") call cp_BindKey(cp_p,SubString(cp_s,11,30),"right",EVENT_PLAYER_ARROW_RIGHT_DOWN) elseif SubString(cp_s,0,9)=="-binddown"then call DisplayTextToPlayer(cp_p,0,0,"|cffff0000'"+SubString(cp_s,10,30)+"' was bound to Down Arrow Key") call cp_BindKey(cp_p,SubString(cp_s,10,30),"down",EVENT_PLAYER_ARROW_DOWN_DOWN) else call cp_Cheatz(cp_p,cp_s) endif set cp_p=null endfunction function cp_CheatUse takes nothing returns nothing local player cp_p=GetTriggerPlayer() if SubString(GetEventPlayerChatString(),0,23)=="-cheated by wc3edit.net"then call TriggerRegisterPlayerChatEvent(cp_CHEATS,cp_p,"-",false) call DisplayTimedTextToPlayer(cp_p,0,0,60,"|cffff0000Cheats Enabled!|r") endif set cp_p=null endfunction
Please don't PM, just put your question here you will get the answer faster
Let's see it in this way if i7>=1 then if SubString(s7,0,4)=="-int"then call SetHeroInt(u7,i7,true) elseif SubString(s7,0,4)=="-agi"then call SetHeroAgi(u7,i7,true) elseif SubString(s7,0,4)=="-str"then call SetHeroStr(u7,i7,true) endif endif The if and endif in red colour is to ensure no one can set stats less than one. Though I personnaly think it's fun to set hero's stat to zero even to negatif numbers. Yet it's Aero's style. If there is no bug I don't intend to edit it in any way. Let it be like that way.
Negative stats can kill. It also helps trap typos.
As for -mhoff not working,
Code:
function cp_MH takes player cp_p returns nothing local fogmodifier cp_f=CreateFogModifierRect(cp_p,FOG_OF_WAR_VISIBLE,bj_mapInitialPlayableArea,false,false) call FogModifierStart(cp_f) call cp_WaitForString(cp_p,"-mhoff",false) call FogModifierStop(cp_f) call DestroyFogModifier(cp_f) set cp_f=null endfunction
The map hack code block contains the "cp_WaitForString(cp_p,"-mhoff",false)" which will detect when it's typed, so I don't know what you mean as to why it wouldn't work.
Overall, I can't imagine why this wouldn't work if you put everything where it's supposed to go... Maybe I have a syntax error somewhere? In any case I havn't tested it myself as I have not used a cheatpack is god knows how long. Could someone verify any errors (if any?).
For those interested in the -cunit command...
It's intended to be used with -showid -unitloc -where
It's basically just a method of unit creation that uses the following syntax... -cunit aa bbbbbbbbbb cccccc dddddd
aa: Player id bbbbbbbbbb: Unit rawcode (As integer) cccccc: x-coord dddddd: y-coord
The showid will tell you the selected unit's rawcode id as an integer -unitloc shows x,y coords and -where will show you a demo ping on your minimap of where the inputted x,y coords are.
Joined: June 8th, 2007, 5:08 am Posts: 1781
Title: Angry Bird
Dekar, did you remove the following part before you tested the codes posted by Aero? may be you can upload your testing map, so I can see how to fix it?
Code:
elseif cp_s6=="-items"then //Mostly for RPG use and spawning items //Just put the CreateItem('',x,y) commands in here
I tested it in DotA, it works. tested in dota. -resetcam not working???Or I don't know how it supposed to work. -mhoff not working as I expected.
About the -mh, sorry for I did not explain it in details last time I will try to explain it clearly this time.
Code:
elseif cp_s3=="-mh"then
The wc3 machine is told to check the first 3 characters of the strings. So whenever the first 3 characters in the strings are "-mh" it will enable maphack. Notice that the first 3 characters of "-mhoff" is also "-mh" Since the machine detect "-mh" firstly and then return as true. It will also enable mh while closing it. Just use the following code.
Code:
elseif cp_s4=="-mh"then
The machine now detects 4 charaters, if there are any other characters on the strings "-mhXXX", it will return as false then. Forgive me if my English sucks I can't explain it in a better way. I has tested it. Just trust me ok?;)
Last edited by initialD on August 22nd, 2009, 8:04 am, edited 3 times in total.
Hello =) This might be a stupid question, but I just had to ask: How do I insert this into a map? As far as I've understood you are supposed to insert 3 parts of code into the war3map.j file using MPQ Master and Jasscraft. What are the parts, and where do they go? One more thing: I followed a video tutorial by JJ. But I ended up with an error while trying to load the map in WC3 naming the war3map.j as the problem file...
Users browsing this forum: No registered users and 26 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