[CC] Zombie Invasion (v6.5)

This is where fulfilled requests go. You can make a new thread here if you edit a map and want to share it, such as if you cheat a new map without anybody actually requesting it.

Moderator: Cheaters

wc3customlover
Newcomer
Posts: 9
Joined: February 17th, 2020, 8:33 pm

[CC] Zombie Invasion (v6.5)

Post by wc3customlover »

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!
owner123
Super Moderator
Posts: 1943
Joined: February 3rd, 2009, 11:28 pm
Been thanked: 1 time

Re: [CC] Zombie Invasion (v6.5)

Post by owner123 »

Why do you want this specifically added rather than just a cheatpack which can do the same thing?
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
Been thanked: 6 times

Re: [CC] Zombie Invasion (v6.5)

Post by nuzamacuxe »

People want to hide they are cheating. That's really funny.
owner123
Super Moderator
Posts: 1943
Joined: February 3rd, 2009, 11:28 pm
Been thanked: 1 time

Re: [CC] Zombie Invasion (v6.5)

Post by owner123 »

This is much less hidden than an ordinary cheatpack. Someone could accidentally press the key and gain lumber.
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
Been thanked: 6 times

Re: [CC] Zombie Invasion (v6.5)

Post by nuzamacuxe »

Indeed. I would say the same to ppl who ask for arrow keybinding.
owner123
Super Moderator
Posts: 1943
Joined: February 3rd, 2009, 11:28 pm
Been thanked: 1 time

Re: [CC] Zombie Invasion (v6.5)

Post by owner123 »

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: Select all

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: Select all

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.
wc3customlover
Newcomer
Posts: 9
Joined: February 17th, 2020, 8:33 pm

Re: [CC] Zombie Invasion (v6.5)

Post by wc3customlover »

That works too, thank you!

I just needed extra lumber haha, thought it was more troublesome to add the whole cheatpack.
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
Been thanked: 6 times

Re: [CC] Zombie Invasion (v6.5)

Post by nuzamacuxe »

It's possible.

Code: Select all

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.