Arbink
New Member
- Reaction score
- 0
im making an rpg and i want if a player kills another player the player that kills the other gets sent to a region, if its possible can i give them a warning the 1st time they do it?
when hero dies
check
> if
killing unit is a hero and player controlled
and killing unit has 0 in his array
> then
set pX[player number] = pX[player number] + 1
give warning
> else
JAIL TIME! Send to region
*additional fun thing*
make dummy unit to cast entangling roots to entering unit. roots
dont have to deal damage but they will prevent spell cast and moving.
30 second penalty should be enough
>
Event: A unit dies
Condition: Owner of (Killed Unit) is an ally of (Killing Unit) Player
Actions: Move (Killing Unit) to (YOURJAIL)
Pause (Killing Unit)
Wait(30.)
UnPause(Killing Unit)
Move (Killing Unit) to (OUTOFYOURJAIL)
Just do:
Code:Event: A unit dies Condition: Owner of (Killed Unit) is an ally of (Killing Unit) Player Actions: Move (Killing Unit) to (YOURJAIL) Pause (Killing Unit) Wait(30.) UnPause(Killing Unit) Move (Killing Unit) to (OUTOFYOURJAIL)
Put Killing Unit into a unit variable.
There isn't much to it actually.
This is, however, not a MUI Version.
You'd have to index your Units.
However, this can be made very easily in JASS/vJASS. I suggest you go learn it =P
Jail
Events
Unit - A unit Dies
Conditions
((Dying unit) belongs to an ally of (Owner of (Killing unit))) Equal to True
Actions
Set Jail[(Player number of (Owner of (Killing unit)))] = Jail[((Player number of (Owner of (Killing unit))) + 1)]
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Jail[(Player number of (Owner of (Killing unit)))] Less than or equal to 1.00
Then - Actions
Game - Display to (All players matching ((Matching player) Equal to (Triggering player))) the text: NO BETRAYING, DO IT...
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Jail[(Player number of (Owner of (Killing unit)))] Greater than or equal to 2.00
Then - Actions
Unit - Move (Killing unit) instantly to (Center of Jail Region <gen>)
Else - Actions
The array of the variable and the value of the variable is NOT the same.
You should do
If Jail[Player number of owner of killing unit] = 0,
Then set Jail[player number of owner of killing unit = 1
Display warning
If Jail[Player number of owner of killing unit] = 1,
Send to jail
Jail
Events
Unit - A unit Dies
Conditions
((Dying unit) belongs to an ally of (Owner of (Killing unit))) Equal to True
Actions
Set Jail[(Player number of (Owner of (Killing unit)))] = Jail[((Player number of (Owner of (Killing unit))) + 0)]
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Jail[((Player number of (Owner of (Killing unit))) + 1)] Less than or equal to 1.00
Then - Actions
Game - Display to (All players matching ((Matching player) Equal to (Triggering player))) the text: NO BETRAYING, DO IT...
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Jail[((Player number of (Owner of (Killing unit))) + 1)] Greater than or equal to 2.00
Then - Actions
Unit - Move (Killing unit) instantly to (Center of Jail Region <gen>)
Else - Actions