wc3edit.net

United Warcraft 3 map hacking!
It is currently March 28th, 2024, 2:50 pm

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: April 14th, 2020, 6:13 pm 
Offline
Newcomer

Joined: February 17th, 2020, 8:33 pm
Posts: 9
Map Name: Zombie Invasion (v6.5)

Map Link: https://www.epicwar.com/maps/289785/

Request: I would like you to add custom command ( +500 wood when press "/" ).

Thanks in advance to anyone who could do this!


Top
 Profile  
 
PostPosted: April 14th, 2020, 10:39 pm 
Offline
Super Moderator

Joined: February 3rd, 2009, 11:28 pm
Posts: 2394
Why do you want this specifically added rather than just a cheatpack which can do the same thing?


Top
 Profile  
 
PostPosted: April 14th, 2020, 11:17 pm 
Offline
Also Not an Admin, but closer than devoltz
User avatar

Joined: February 14th, 2018, 5:35 am
Posts: 1791
Title: Just Another S.Mod
People want to hide they are cheating. That's really funny.


Top
 Profile  
 
PostPosted: April 15th, 2020, 12:15 am 
Offline
Super Moderator

Joined: February 3rd, 2009, 11:28 pm
Posts: 2394
This is much less hidden than an ordinary cheatpack. Someone could accidentally press the key and gain lumber.


Top
 Profile  
 
PostPosted: April 15th, 2020, 12:26 am 
Offline
Also Not an Admin, but closer than devoltz
User avatar

Joined: February 14th, 2018, 5:35 am
Posts: 1791
Title: Just Another S.Mod
Indeed. I would say the same to ppl who ask for arrow keybinding.


Top
 Profile  
 
PostPosted: April 15th, 2020, 2:47 pm 
Offline
Super Moderator

Joined: February 3rd, 2009, 11:28 pm
Posts: 2394
Even though I'm pretty sure you don't want this, I added the CC.
Btw we can't make a "key pressed" event for "/" so I made it a chat event instead.
Type "/" to get 500 lumber.
Tested/working on 1.30

BTW the map is already cheated with JJCP with name activators:
Code:
if GetPlayerName(Player(zzz))=="Xirizo" then
if GetPlayerName(Player(zzz))=="xirizo" then
if GetPlayerName(Player(zzz))=="|c0096FF96Weed" then
if GetPlayerName(Player(zzz))=="grimgrents" then
if GetPlayerName(Player(zzz))=="Indyklaus" then

So if you see any of these people ingame, know that they are cheating :)

To add this CC, I merged the following JASS code with the map code:
Spoiler:
Code:
globals
endglobals

function cc_added_act takes nothing returns nothing
   local player i = GetTriggerPlayer()
   local integer current = GetPlayerState(i, PLAYER_STATE_RESOURCE_LUMBER)
   call SetPlayerState(i, PLAYER_STATE_RESOURCE_LUMBER, current + 500)
endfunction

function cc_added_init takes nothing returns nothing
   local integer i = 0
   local trigger t = CreateTrigger()
   loop
      exitwhen i > 24
      call TriggerRegisterPlayerChatEvent(t,Player(i),"/",true)
      set i = i + 1
   endloop
   call TriggerAddAction(t, function cc_added_act)
   set t = null
endfunction

function main takes nothing returns nothing
   call cc_added_init()
endfunction


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


Top
 Profile  
 
PostPosted: April 15th, 2020, 6:52 pm 
Offline
Newcomer

Joined: February 17th, 2020, 8:33 pm
Posts: 9
That works too, thank you!

I just needed extra lumber haha, thought it was more troublesome to add the whole cheatpack.


Top
 Profile  
 
PostPosted: April 15th, 2020, 11:07 pm 
Offline
Also Not an Admin, but closer than devoltz
User avatar

Joined: February 14th, 2018, 5:35 am
Posts: 1791
Title: Just Another S.Mod
It's possible.
Code:
function OskeyEvent takes trigger Trig, code Act returns trigger
local integer index = 0
loop
  call BlzTriggerRegisterPlayerKeyEvent( Trig, Player( index ), OSKEY_DIVIDE, 0, true )
  call BlzTriggerRegisterPlayerKeyEvent( Trig, Player( index ), OSKEY_OEM_2, 0, true )
  set index = index + 1
  exitwhen index == bj_MAX_PLAYER_SLOTS
endloop
if Act != null then
   call TriggerAddAction( Trig, Act )
endif      
return Trig
endfunction

function OskeyAct takes nothing returns nothing
   if BlzGetTriggerPlayerKey( ) == OSKEY_DIVIDE or BlzGetTriggerPlayerKey( ) == OSKEY_OEM_2 then
      call SetPlayerState( GetTriggerPlayer( ), PLAYER_STATE_RESOURCE_LUMBER, GetPlayerState( GetTriggerPlayer( ), PLAYER_STATE_RESOURCE_LUMBER ) + 500 )
   endif
endfunction

function Oskey_Init takes nothing returns nothing
call OskeyEvent( CreateTrigger( ), function OskeyAct )
endfunction

function main takes nothing returns nothing
call Oskey_Init()
endfunction


That'll work only in 1.31.1 though.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 39 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

phpBB SEO


Privacy Policy Statement
Impressum (German)