[JASS] for the random trigger

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

User avatar
D00mYou
Junior Member
Posts: 40
Joined: September 27th, 2009, 2:50 am
Title: TheDooMeD

[JASS] for the random trigger

Post by D00mYou »

sorry for my bad english...
ok i just want to ask something about the random trigger...
Spoiler:

Code: Select all

//===========================================================================
//===========================================================================
//Trigger:End Round
//===========================================================================
function Trig_End_Round_Conditions takes nothing returns boolean
	if(not(udg_boolean01==true))then
		return false
	endif
	return true
endfunction

function Trig_End_Round_Func008C takes nothing returns boolean
	if(not(udg_integer01<40))then
		return false
	endif
	return true
endfunction

function Trig_End_Round_Actions takes nothing returns nothing
	set udg_boolean01=false
	set bj_forLoopAIndex=1
	set bj_forLoopAIndexEnd=11
	loop
		exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
		call AdjustPlayerStateBJ((80+(100*udg_integer01)),ConvertedPlayer(GetForLoopIndexA()),PLAYER_STATE_RESOURCE_GOLD)
		set bj_forLoopAIndex=bj_forLoopAIndex+1
	endloop

	call AdjustPlayerStateBJ((150+(150*udg_integer01)),Player(0),PLAYER_STATE_RESOURCE_GOLD)
	call AdjustPlayerStateBJ((100+(100*udg_integer01)),Player(7),PLAYER_STATE_RESOURCE_GOLD)
	call AdjustPlayerStateBJ((100+(100*udg_integer01)),Player(8),PLAYER_STATE_RESOURCE_GOLD)
	call AdjustPlayerStateBJ((100+(100*udg_integer01)),Player(9),PLAYER_STATE_RESOURCE_GOLD)
	call AdjustPlayerStateBJ((100+(100*udg_integer01)),Player(10),PLAYER_STATE_RESOURCE_GOLD)

	set bj_forLoopAIndex=GetRandomInt(0,10)
	set bj_forLoopAIndexEnd=200+100*udg_integer01

if udg_integer01 >= 6 then 
  	set bj_forLoopAIndexEnd=2000+1000*(udg_integer01-7)
endif

if udg_integer01 >= 10 then 
  	set bj_forLoopAIndexEnd=10000+1000*(udg_integer01-10)
endif

if udg_integer01 >= 20 then 
  	set bj_forLoopAIndexEnd=70000+10000*(udg_integer01-20)
endif

	call DisplayTextToForce(GetPlayersAll(),(udg_strings01[GetConvertedPlayerId(Player(bj_forLoopAIndex))]+(GetPlayerName(Player(bj_forLoopAIndex))+" is a Lucky Man |cffffcc00  |r")))
	call DisplayTextToForce(GetPlayersAll(),(udg_strings01[GetConvertedPlayerId(Player(bj_forLoopAIndex))]+(GetPlayerName(Player(bj_forLoopAIndex))+"|cffffcc00 : + "+I2S(bj_forLoopAIndexEnd)+" when End Round |r")))
	call AdjustPlayerStateBJ((bj_forLoopAIndexEnd),Player(bj_forLoopAIndex),PLAYER_STATE_RESOURCE_GOLD)
        call PolledWait( 1.5 )
	call DisplayTextToForce(GetPlayersAll(),(udg_strings01[GetConvertedPlayerId(Player(bj_forLoopAIndex))]+(GetPlayerName(Player(bj_forLoopAIndex))+"|cffffcc00 : + "+I2S(bj_forLoopAIndexEnd)+" when End Round |r")))
	call TriggerSleepAction(8.00)

if udg_integer01==6 then
	//***** Adjust REDs Gold by 1200
        call AdjustPlayerStateBJ((1200),Player(0),PLAYER_STATE_RESOURCE_GOLD)
endif

	if(Trig_End_Round_Func008C())then
		call StartTimerBJ(udg_timer01,false,10.00)
		call TimerDialogDisplayBJ(true,GetLastCreatedTimerDialogBJ())
	else
		call TriggerExecute(udg_trigger42)
	endif
endfunction
and i just want to make 1 player, e.g. red for being the lucky person to get the bonus gold....

anyone please help me.... i apreciate your help.. thanks alot

Edit : I'm sorry for the trouble and thanks for helping me.. thanks alot FS
Last edited by D00mYou on March 13th, 2010, 9:33 am, edited 1 time in total.
owner123
Forum Staff
Posts: 1943
Joined: February 3rd, 2009, 11:28 pm
Been thanked: 2 times

Re: [HELP] for the random trigger

Post by owner123 »

D00mYou wrote:sorry for my bad english...
ok i just want to ask something about the random trigger...

Code: Select all

//===========================================================================
//===========================================================================
//Trigger:End Round
//===========================================================================
function Trig_End_Round_Conditions takes nothing returns boolean
	if(not(udg_boolean01==true))then
		return false
	endif
	return true
endfunction

function Trig_End_Round_Func008C takes nothing returns boolean
	if(not(udg_integer01<40))then
		return false
	endif
	return true
endfunction

function Trig_End_Round_Actions takes nothing returns nothing
	set udg_boolean01=false
	set bj_forLoopAIndex=1
	set bj_forLoopAIndexEnd=11
	loop
		exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
		call AdjustPlayerStateBJ((80+(100*udg_integer01)),ConvertedPlayer(GetForLoopIndexA()),PLAYER_STATE_RESOURCE_GOLD)
		set bj_forLoopAIndex=bj_forLoopAIndex+1
	endloop

	call AdjustPlayerStateBJ((150+(150*udg_integer01)),Player(0),PLAYER_STATE_RESOURCE_GOLD)
	call AdjustPlayerStateBJ((100+(100*udg_integer01)),Player(7),PLAYER_STATE_RESOURCE_GOLD)
	call AdjustPlayerStateBJ((100+(100*udg_integer01)),Player(8),PLAYER_STATE_RESOURCE_GOLD)
	call AdjustPlayerStateBJ((100+(100*udg_integer01)),Player(9),PLAYER_STATE_RESOURCE_GOLD)
	call AdjustPlayerStateBJ((100+(100*udg_integer01)),Player(10),PLAYER_STATE_RESOURCE_GOLD)

	set bj_forLoopAIndex=GetRandomInt(0,10)
	set bj_forLoopAIndexEnd=200+100*udg_integer01

if udg_integer01 >= 6 then 
  	set bj_forLoopAIndexEnd=2000+1000*(udg_integer01-7)
endif

if udg_integer01 >= 10 then 
  	set bj_forLoopAIndexEnd=10000+1000*(udg_integer01-10)
endif

if udg_integer01 >= 20 then 
  	set bj_forLoopAIndexEnd=70000+10000*(udg_integer01-20)
endif

	call DisplayTextToForce(GetPlayersAll(),(udg_strings01[GetConvertedPlayerId(Player(bj_forLoopAIndex))]+(GetPlayerName(Player(bj_forLoopAIndex))+" is a Lucky Man |cffffcc00  |r")))
	call DisplayTextToForce(GetPlayersAll(),(udg_strings01[GetConvertedPlayerId(Player(bj_forLoopAIndex))]+(GetPlayerName(Player(bj_forLoopAIndex))+"|cffffcc00 : + "+I2S(bj_forLoopAIndexEnd)+" when End Round |r")))
	call AdjustPlayerStateBJ((bj_forLoopAIndexEnd),Player(bj_forLoopAIndex),PLAYER_STATE_RESOURCE_GOLD)
        call PolledWait( 1.5 )
	call DisplayTextToForce(GetPlayersAll(),(udg_strings01[GetConvertedPlayerId(Player(bj_forLoopAIndex))]+(GetPlayerName(Player(bj_forLoopAIndex))+"|cffffcc00 : + "+I2S(bj_forLoopAIndexEnd)+" when End Round |r")))
	call TriggerSleepAction(8.00)

if udg_integer01==6 then
	//***** Adjust REDs Gold by 1200
        call AdjustPlayerStateBJ((1200),Player(0),PLAYER_STATE_RESOURCE_GOLD)
endif

	if(Trig_End_Round_Func008C())then
		call StartTimerBJ(udg_timer01,false,10.00)
		call TimerDialogDisplayBJ(true,GetLastCreatedTimerDialogBJ())
	else
		call TriggerExecute(udg_trigger42)
	endif
endfunction
and i just want to make 1 player, e.g. red for being the lucky person to get the bonus gold....

anyone please help me.... i apreciate your help.. thanks alot
Rules.

Code: Select all

1. The topic title must have a (GUI) or (JASS) in it. If you don't want triggering, then you don't need to, but if you do, failing to regard this will result in a trash. If you want either, put (EITHER).

2. If you want us to make a spell or something, please give us accurate descriptions of what you want. We can't work blindly. No, "remake so-and-so from Anime Fight plzzzzzzzzzzzzz". Details, people.

3. Try to use coherent English, because if you don't, whatever you want us to help with may be messed up, and it would be better to simply avoid wasting your time, as well as our own.
Read #1 and edit your title.
User avatar
Lanaya
Banned-To-Be
Posts: 1378
Joined: July 28th, 2008, 6:28 pm
Title: Administrator

Re: [HELP] for the random trigger

Post by Lanaya »

And.. it'll help if you upload the map
Image
League of legends North America - Nietono
User avatar
Ken
Spice Pirate
Posts: 862
Joined: January 29th, 2009, 5:35 pm
Title: LHC
Location: Canada

Re: [HELP] for the random trigger

Post by Ken »

1) We don't need [JASS] or [GUI] in the title. I mean, just look at all the other threads here.
2) Please don't quote bigass posts without throwing them inside of spoilers.
3) Please put big blocks of code in spoilers.

That being said:
Spoiler:

Code: Select all

//===========================================================================
//===========================================================================
//Trigger:End Round
//===========================================================================
function Trig_End_Round_Conditions takes nothing returns boolean
   if(not(udg_boolean01==true))then
      return false
   endif
   return true
endfunction

function Trig_End_Round_Func008C takes nothing returns boolean
   if(not(udg_integer01<40))then
      return false
   endif
   return true
endfunction

function Trig_End_Round_Actions takes nothing returns nothing
   local integer udg_randInt = 0
   set udg_boolean01=false
   set bj_forLoopAIndex=1
   set bj_forLoopAIndexEnd=11
   loop
      exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
      call AdjustPlayerStateBJ((80+(100*udg_integer01)),ConvertedPlayer(GetForLoopIndexA()),PLAYER_STATE_RESOURCE_GOLD)
      set bj_forLoopAIndex=bj_forLoopAIndex+1
   endloop

   call AdjustPlayerStateBJ((150+(150*udg_integer01)),Player(0),PLAYER_STATE_RESOURCE_GOLD)
   call AdjustPlayerStateBJ((100+(100*udg_integer01)),Player(7),PLAYER_STATE_RESOURCE_GOLD)
   call AdjustPlayerStateBJ((100+(100*udg_integer01)),Player(8),PLAYER_STATE_RESOURCE_GOLD)
   call AdjustPlayerStateBJ((100+(100*udg_integer01)),Player(9),PLAYER_STATE_RESOURCE_GOLD)
   call AdjustPlayerStateBJ((100+(100*udg_integer01)),Player(10),PLAYER_STATE_RESOURCE_GOLD)

   set bj_forLoopAIndex=GetRandomInt(0,10)
   set bj_forLoopAIndexEnd=200+100*udg_integer01

if udg_integer01 >= 6 then 
     set bj_forLoopAIndexEnd=2000+1000*(udg_integer01-7)
endif

if udg_integer01 >= 10 then 
     set bj_forLoopAIndexEnd=10000+1000*(udg_integer01-10)
endif

if udg_integer01 >= 20 then 
     set bj_forLoopAIndexEnd=70000+10000*(udg_integer01-20)
endif

   call DisplayTextToForce(GetPlayersAll(),(udg_strings01[GetConvertedPlayerId(Player(bj_forLoopAIndex))]+(GetPlayerName(Player(bj_forLoopAIndex))+" is a Lucky Man |cffffcc00  |r")))
   call DisplayTextToForce(GetPlayersAll(),(udg_strings01[GetConvertedPlayerId(Player(bj_forLoopAIndex))]+(GetPlayerName(Player(bj_forLoopAIndex))+"|cffffcc00 : + "+I2S(bj_forLoopAIndexEnd)+" when End Round |r")))
   call AdjustPlayerStateBJ((bj_forLoopAIndexEnd),Player(bj_forLoopAIndex),PLAYER_STATE_RESOURCE_GOLD)
        call PolledWait( 1.5 )
   call DisplayTextToForce(GetPlayersAll(),(udg_strings01[GetConvertedPlayerId(Player(bj_forLoopAIndex))]+(GetPlayerName(Player(bj_forLoopAIndex))+"|cffffcc00 : + "+I2S(bj_forLoopAIndexEnd)+" when End Round |r")))
   call TriggerSleepAction(8.00)

if udg_integer01==6 then
        set udg_randInt = GetRandomInt(0,11) // I dunno if it's inclusive on upper or lower bound, you might have to change this. Also, this assumes you have 12 players as human, so fixing required on that too if applicable
        call AdjustPlayerStateBJ((1200),Player(udg_randInt),PLAYER_STATE_RESOURCE_GOLD)
	call DisplayTextToPlayer(GetLocalPlayer(),0,0,GetPlayerName(Player(udg_randInt)) + "'s gold increased by 1200.")
endif

   if(Trig_End_Round_Func008C())then
      call StartTimerBJ(udg_timer01,false,10.00)
      call TimerDialogDisplayBJ(true,GetLastCreatedTimerDialogBJ())
   else
      call TriggerExecute(udg_trigger42)
   endif
endfunction
Read my comment, fix the functions if I messed up, but that's the general thing that would happen. What happens is it picks a random number 0-11 (inclusive, for each player ID) and gives gold to that player, and also informs everyone that the player was given 1200 gold.

Post again if you have problems with this.
Spoiler:
xkiska wrote:BARTIMEAUS is more understandable then u
Senethior459 wrote:Wow, Dream Theatre reminds me of Dragonforce, but with real skill.
Ozzapoo wrote:We laughed, we cried. Trashed.
FatherSpace: You don't find smart chicks hawt?
GeorgeMots: not anymore, im fed up with that kind of girls
FatherSpace: lol
FatherSpace: What happened?
GeorgeMots: most smart girls find out that i date/do/see other girls....
FatherSpace: ...
FatherSpace: So monogamy is your enemy?
Bartimaeus: Hmm, well, I hope my sister hasn't been kidnapped.
FatherSpace: What happened, Bart?
Bartimaeus: She walked out of the house saying that she was going over to some friends, and it's been like two hours, and my mom is trying to get a hold of her, which she's been unable to.
Bartimaeus: I can also hear three car alarms going off.
GeorgeMots: how old is she?
Bartimaeus: I haven't a clue. Probably 17.
UndeadxAssassin: wut
AbusivePie: You don't know how old your sister is?
Bartimaeus: Nope.
UndeadxAssassin: Epic fail
GeorgeMots: is she cute??
Bartimaeus: So, uh, how about you get into the Christmas spirit and put that avatar on before I do it myself and take away your bloody avatar-changin' rights?
UndeadxAssassin: If I thought of a random one...
UndeadxAssassin: Like....
UndeadxAssassin: I'll get back to you on that
owner123
Forum Staff
Posts: 1943
Joined: February 3rd, 2009, 11:28 pm
Been thanked: 2 times

Re: [HELP] for the random trigger

Post by owner123 »

So, lemme get this straight...
1- Ok, so its not right to tell others to follow the rules... because most people dont ?
2- Ok, it was stupid to not put it in spoiler.
3- How is 9 lines a "big code"
User avatar
Lanaya
Banned-To-Be
Posts: 1378
Joined: July 28th, 2008, 6:28 pm
Title: Administrator

Re: [HELP] for the random trigger

Post by Lanaya »

owner123 wrote:So, lemme get this straight...
1- Ok, so its not right to tell others to follow the rules... because most people dont ?
2- Ok, it was stupid to not put it in spoiler.
3- How is 9 lines a "big code"
1- I'm pretty sure this goes under deprotecting/cheating
2- Ok..
3- 9 lines isnt big, but in a code it is
3.2 - your quote should've been in spoiler too, it was huge.
Image
League of legends North America - Nietono
User avatar
UndeadxAssassin
Grammar King
Posts: 2119
Joined: June 22nd, 2008, 10:11 pm
Title: Worst human for 4eva
Location: Mostly USEast

Re: [JASS] for the random trigger

Post by UndeadxAssassin »

By God, stop going off topic or be warned.
(20:53:52) Bartimaeus: Thank you, Jen.
(20:53:56) Bartimaeus: Truly, you are wise.
(23:44:12) Bartimaeus: I was in pubic school until middle school...
Learn how to extract and read RAW Codes here!

Need help? Click here and ask your question!