Revive Trigger

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

User avatar
DragoonJett
Member
Posts: 53
Joined: March 5th, 2008, 3:51 am
Title: FOR PONY!
Location: Canada

Revive Trigger

Post by DragoonJett »

I am new to JASS, anyways I was wondering if someone could make a simple Hero dies remove one lumber revive hero at region, if player has no lumber defeat, so that I can deconstruct the trigger, please and thank you
Nerf Paper.
Scissors are fine.
Sincerely, Rock.
Spoiler:
Why did you open me? RUN FOR YOUR LIFE!
User avatar
Ozzapoo
The Flying Cow!
Posts: 2196
Joined: November 2nd, 2007, 10:34 pm
Location: Melbourne

Re: Revive Trigger

Post by Ozzapoo »

Here... This 'should' work.

Code: Select all

globals //Globals Variable Needed
trigger Made_By_Ozza=CreateTrigger()
endglobals

function Made_By_Ozzapoo takes nothing returns nothing
local player p=GetOwningPlayer(GetDyingUnit())
local integer i=GetPlayerState(p,PLAYER_STATE_RESOURCE_LUMBER)-1
if i==-1 then
call CustomDefeatBJ(p,"You got Pwn3d")
else
call SetPlayerState(p,PLAYER_STATE_RESOURCE_LUMBER,i)
endif
endfunction

function main takes nothing returns nothing
local integer i=0
loop
exitwhen i>11
call TriggerRegisterPlayerUnitEvent(Made_By_Ozza,Player(i),EVENT_PLAYER_UNIT_DEATH,null)
set i=i+1
endloop
call TriggerAddAction(Made_By_Ozza,function Made_By_Ozzapoo)
endfunction
Visit Ozzapoo.net, my blog and the home of AutoCP and Cheatpack Detector!
AutoCP3 now available for free!
User avatar
lilmanbryan
Member
Posts: 52
Joined: January 10th, 2008, 6:29 am
Title: Learning to Model
Location: Shoreline, Wa

Re: Revive Trigger

Post by lilmanbryan »

Lol, I like how you set that when he's defeated, it says UGotPwn3d.
;D
niceeeeeeeeeeeeee
[blinking]lilmanbryan[/blinking] appreciates you reading this...

[blinking]Look Down...[/blinking]

Spoiler:
You Weren't Supposed to Look Here...


[blinking]Look Up...[/blinking]
User avatar
weirdone2
Forum Staff
Posts: 926
Joined: June 3rd, 2007, 8:03 pm

Re: Revive Trigger

Post by weirdone2 »

You forgot to check if it's a hero.

Code: Select all

function HeroCondition takes nothing returns nothing
if IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO)then
return true
endif
return false
endfunction
call TriggerAddCondition(trig,Condition(function HeroCondition)