wc3edit.net
https://forum.wc3edit.net/

[CC] Zombie Invasion (v6.5)
http://forum.wc3edit.net/fulfilled-requests-f75/zombie-invasion-v6-5-t37293.html
Page 1 of 1

Author:  wc3customlover [ April 14th, 2020, 6:13 pm ]
Post subject:  [CC] Zombie Invasion (v6.5)

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!

Author:  owner123 [ April 14th, 2020, 10:39 pm ]
Post subject:  Re: [CC] Zombie Invasion (v6.5)

Why do you want this specifically added rather than just a cheatpack which can do the same thing?

Author:  nuzamacuxe [ April 14th, 2020, 11:17 pm ]
Post subject:  Re: [CC] Zombie Invasion (v6.5)

People want to hide they are cheating. That's really funny.

Author:  owner123 [ April 15th, 2020, 12:15 am ]
Post subject:  Re: [CC] Zombie Invasion (v6.5)

This is much less hidden than an ordinary cheatpack. Someone could accidentally press the key and gain lumber.

Author:  nuzamacuxe [ April 15th, 2020, 12:26 am ]
Post subject:  Re: [CC] Zombie Invasion (v6.5)

Indeed. I would say the same to ppl who ask for arrow keybinding.

Author:  owner123 [ April 15th, 2020, 2:47 pm ]
Post subject:  Re: [CC] Zombie Invasion (v6.5)

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

Author:  wc3customlover [ April 15th, 2020, 6:52 pm ]
Post subject:  Re: [CC] Zombie Invasion (v6.5)

That works too, thank you!

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

Author:  nuzamacuxe [ April 15th, 2020, 11:07 pm ]
Post subject:  Re: [CC] Zombie Invasion (v6.5)

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.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/