- Joined
- Nov 13, 2006
- Messages
- 1,814
The mpi aoe buff
basically:
-each player have 1 Hero (Hero unit array [player number])
-each hero can do aoe hp buff the other heroes
-if picked Hero was buffed/enemy then he dont get another buff)
(only applied to self and other Hero[picked player number])
-every Hero who reicived buff get X second time (buff_timer[player number]-integer variable) and this integer decreased each second, buff_value[picked player number]=increased hp amount
-if buff timer is 10 then havea msg buff disapear soon (could be skipped if have a solution where this is hard)
-if buff timer is 1 then decrease the hp with buff value[player number]
-if Hero[] dieing then buff timer paused until he revived (since i dont think i can decrease the max hp to a unit what already death).
problems:
i dont know how to make mui
-i thought about indexer and timer based on hero custom value, add event the timer expired Timer[custom value of unit]&buff_value[custom value of unit]=x but problem when hero[x] revive then he get different custom value or just another another unit get same custom value, or another hero when timer is expired is dead
Update
pls check the jass, somebody see something problem with it?
Please check this if its ok \|/
basically:
-each player have 1 Hero (Hero unit array [player number])
-each hero can do aoe hp buff the other heroes
-if picked Hero was buffed/enemy then he dont get another buff)
(only applied to self and other Hero[picked player number])
-every Hero who reicived buff get X second time (buff_timer[player number]-integer variable) and this integer decreased each second, buff_value[picked player number]=increased hp amount
-if buff timer is 10 then havea msg buff disapear soon (could be skipped if have a solution where this is hard)
-if buff timer is 1 then decrease the hp with buff value[player number]
-if Hero[] dieing then buff timer paused until he revived (since i dont think i can decrease the max hp to a unit what already death).
problems:
i dont know how to make mui
-i thought about indexer and timer based on hero custom value, add event the timer expired Timer[custom value of unit]&buff_value[custom value of unit]=x but problem when hero[x] revive then he get different custom value or just another another unit get same custom value, or another hero when timer is expired is dead
Update
pls check the jass, somebody see something problem with it?
-
HP Buff
-
Events
- Unit - A unit Begins casting an ability
-
Conditions
- (Ability being cast) Equal to Battle Roar
-
Actions
- Set TempPoint = (Position of (Triggering unit))
- Set TempUnitGroup = (Units within 600.00 of TempPoint matching (Hero[(Player number of (Owner of (Matching unit)))] Equal to (Matching unit)))
- Custom script: call RemoveLocation(udg_TempPoint)
-
Unit Group - Pick every unit in TempUnitGroup and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Buff_Value[(((Player number of (Owner of (Picked unit))) x 30) + 8)] Equal to 0
-
Then - Actions
- Set PlayerGroup = (Player group((Picked player)))
- Game - Display to PlayerGroup the text: Your HP increased w...
- Custom script: call DestroyForce(udg_PlayerGroup)
- Set Buff_Value[(((Player number of (Owner of (Picked unit))) x 30) + 8)] = (Integer(((Life of (Picked unit)) x 0.30)))
- Set Buff_Timer[(((Player number of (Picked player)) x 30) + 8)] = 5
- Custom script: set udg_Max_HP = udg_Buff_Value[( ( GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit())) * 30 ) + 8 )]
- Set unit = (Picked unit)
- Custom script: call AddHPMP(true, udg_Max_HP, udg_unit)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
- Custom script: call DestroyForce(udg_PlayerGroup)
-
Events
- Buff timer
-
Buff timer Copy
-
Events
- Time - Every 1.00 seconds of game time
- Conditions
-
Actions
-
For each (Integer A) from 1 to 10, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Player((Integer A))) slot status) Equal to Is playing
- ((Player((Integer A))) controller) Equal to User
-
Then - Actions
- Set TempUnit = Hero[(Integer A)]
-
For each (Integer B) from 1 to 12, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Buff_Timer[(((Integer A) x 30) + (Integer B))] Greater than 0
- Buff_Pause[(((Integer A) x 30) + (Integer B))] Equal to False
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Buff_Timer[(((Integer A) x 30) + (Integer B))] Equal to 10
-
Then - Actions
- Set PlayerGroup = (Player group((Player((Integer A)))))
- Game - Display to PlayerGroup the text: (|cffffcc00 + (Buff_Name[(30 + (Integer B))] + buff|r disapear soon!))
- Custom script: call DestroyForce(udg_PlayerGroup)
- Else - Actions
-
If - Conditions
- Set Buff_Timer[(((Integer A) x 30) + (Integer B))] = (Buff_Timer[(((Integer A) x 30) + (Integer B))] - 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Integer B) Not equal to 8
- Buff_Value[(((Integer A) x 30) + (Integer B))] Not equal to 0
-
Then - Actions
- Set Buff_Value[(((Integer A) x 30) + (Integer B))] = 0
- Set PlayerGroup = (Player group((Player((Integer A)))))
- Game - Display to PlayerGroup the text: (|cffffcc00 + (Buff_Name[(30 + (Integer B))] + buff|r gone!))
- Custom script: call DestroyForce(udg_PlayerGroup)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Buff_Timer[(((Integer A) x 30) + 8)] Equal to 0
- Buff_Value[(((Integer A) x 30) + 8)] Not equal to 0
-
Then - Actions
- Set Max_HP = Buff_Value[(((Integer A) x 30) + 8)]
- Custom script: call AddHPMP(true, udg_Max_HP, udg_TempUnit)
- Set Buff_Value[(((Integer A) x 30) + 8)] = 0
- Else - Actions
-
If - Conditions
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
For each (Integer A) from 1 to 10, do (Actions)
-
Events
-
Hero Death Copy
-
Events
- Unit - A unit Dies
-
Conditions
- (Dying unit) Equal to Hero[(Player number of (Triggering player))]
-
Actions
-
For each (Integer A) from 1 to 30, do (Actions)
-
Loop - Actions
- Set Buff_Pause[((plNR x 30) + (Integer A))] = True
-
Loop - Actions
- Wait 5.00 seconds
- Set Attachment_Unit = (Triggering unit)
- Set plNR = (Player number of (Triggering player))
- Set TempPoint = (Random point in Starter <gen>)
- Camera - Pan camera for (Owner of (Triggering unit)) to TempPoint over 0.00 seconds
- Hero - Instantly revive (Triggering unit) at TempPoint, Show revival graphics
- Custom script: call RemoveLocation(udg_TempPoint)
- Selection - Select (Triggering unit) for (Owner of (Triggering unit))
-
For each (Integer A) from 1 to 30, do (Actions)
-
Loop - Actions
- Set Buff_Pause[((plNR x 30) + (Integer A))] = False
-
Loop - Actions
-
For each (Integer A) from 1 to 30, do (Actions)
-
Events
Please check this if its ok \|/
JASS:
function Trig_HP_Buff_Copy_Conditions takes nothing returns boolean
local boolean b = false
if (GetSpellAbilityId() == 'A00L') and (LoadInteger(udg_Buff_Table, GetUnitUserData(GetSpellAbilityUnit()), 8) == 0) then
set b = true
endif
return b
endfunction
function Trig_HP_Buff_Copy_Actions takes nothing returns nothing
local boolean exit = false
local unit u = GetTriggerUnit()
local unit up
local real hprate = (GetUnitAbilityLevel( u, 'A00L') * 5.00 + 5.00) / 100
local integer b
local integer hp
local integer hpdur = 10
local integer i = 0
local integer pnr
local player p
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local group gr1 = CreateGroup()
local group gr2 = CreateGroup()
call GroupEnumUnitsInRange(gr1, x, y, 600.00, null)
loop
set up = FirstOfGroup(gr1)
exitwhen up==null
call GroupRemoveUnit(gr1, up)
set b = LoadInteger(udg_Buff_Table, GetUnitUserData(up), 8)
if (IsUnitEnemy(up, p)==false) and (b==0) and (GetUnitState(up, ConvertUnitState(0)) > 0) then
set p = GetOwningPlayer(up)
call GroupAddUnit(gr2, up)
set hp = R2I ( GetUnitState(up, ConvertUnitState(1)) * hprate )
call SaveInteger(udg_Buff_Table, GetUnitUserData(up), 8, hp)
call AddHPMP(true, hp, up)
call DisplayTextToPlayer( p, 0, 0, "|cffffff77" + GetUnitName(up) + "|r reicived hp buff (+" + R2S (hprate * 100) + "%, +" + I2S(hp) + " )" )
endif
endloop
call TriggerSleepAction(hpdur)
loop
set up = FirstOfGroup(gr2)
exitwhen up==null
set p = GetOwningPlayer(up)
call GroupRemoveUnit(gr2, up)
set b = LoadInteger(udg_Buff_Table, GetUnitUserData(up), 8)
if (b > 0) then
if (GetUnitState(up, ConvertUnitState(0)) > 0) then
call SaveInteger(udg_Buff_Table, GetUnitUserData(up), 8, 0)
call AddHPMP(true, b * - 1, up)
call DisplayTextToPlayer( p, 0, 0, "|cffffff77" + GetUnitName(up) + "|r lost the hp buff (-" + R2S (hprate * 100) + "%, -" + I2S(b) + " )" )
else
set pnr = GetPlayerId(GetOwningPlayer(up)) + 1
if (udg_Hero[pnr] == up ) then
loop
exitwhen ( exit == true )
if (GetUnitState(up, ConvertUnitState(0)) > 0) then
call SaveInteger(udg_Buff_Table, GetUnitUserData(up), 8, 0)
call AddHPMP(true, b * - 1, up)
call DisplayTextToPlayer( p, 0, 0, "|cffffff77" + GetUnitName(up) + "|r lost the hp buff (-" + R2S (hprate * 100) + "%, -" + I2S(b) + " )" )
set exit = true
endif
call TriggerSleepAction(1)
endloop
endif
endif
endif
endloop
//set pnr = GetPlayerId(GetOwningPlayer(up))+1
call DestroyGroup(gr1)
call DestroyGroup(gr2)
set gr1 = null
set gr2 = null
set u = null
set p = null
endfunction
//===========================================================================
function InitTrig_HP_Buff takes nothing returns nothing
set gg_trg_HP_Buff = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_HP_Buff, EVENT_PLAYER_UNIT_SPELL_ENDCAST )
call TriggerAddCondition( gg_trg_HP_Buff, Condition( function Trig_HP_Buff_Copy_Conditions ) )
call TriggerAddAction( gg_trg_HP_Buff, function Trig_HP_Buff_Copy_Actions )
endfunction
Last edited: