- Joined
- Jul 18, 2007
- Messages
- 110
Well I have a spell like:
-
Enhancemenf GUI
-
Events
- Unit - A unit enters Enhancement <gen>
-
Conditions
- (Unit-type of (Triggering unit)) Equal to (==) |cffffcc00Slave
- ((Owner of (Triggering unit)) Current gold) Greater than or equal to (>=) 6000
-
Actions
- Player - Set (Owner of (Triggering unit)) Current gold to (((Owner of (Triggering unit)) Current gold) - 6000)
-
Game - Display to (Owner of (Triggering unit)), at offset (0.00, 0.00) the text: |c00d9d9ffYou cast ...
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Triggering unit) is owned by Player 1 (Red)) Equal to (==) True
-
Then - Actions
- Set temp_group = (Units in (Playable map area) matching (((Matching unit) is owned by Player 1 (Red)) Equal to (==) True))
-
Unit Group - Pick every unit in temp_group and do (Actions)
-
Loop - Actions
- Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Human\Resurrect\ResurrectCaster.mdl
- Unit - Add Enchantment (Damage) to (Picked unit)
- Unit - Add Enchantment (Armor) to (Picked unit)
-
Loop - Actions
- Wait 3.00 seconds
-
Unit Group - Pick every unit in temp_group and do (Actions)
-
Loop - Actions
- Unit - Remove Enchantment (Damage) from (Picked unit)
- Unit - Remove Enchantment (Armor) from (Picked unit)
- Special Effect - Destroy (Last created special effect)
-
Loop - Actions
- Custom script: call DestroyGroup (udg_temp_group)
-
Else - Actions
- Do nothing
-
If - Conditions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Triggering unit) is owned by Player 4 (Purple)) Equal to (==) True
-
Then - Actions
- Set temp_group = (Units in (Playable map area) matching (((Picked unit) is owned by Player 4 (Purple)) Equal to (==) True))
- Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Human\DivineShield\DivineShieldTarget.mdl
-
Unit Group - Pick every unit in temp_group and do (Actions)
-
Loop - Actions
- Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Human\Resurrect\ResurrectCaster.mdl
- Unit - Add Enchantment (Damage) to (Picked unit)
- Unit - Add Enchantment (Armor) to (Picked unit)
- Wait 15.00 seconds
- Unit - Remove Enchantment (Damage) from (Picked unit)
- Unit - Remove Enchantment (Armor) from (Picked unit)
- Special Effect - Destroy (Last created special effect)
-
Loop - Actions
- Custom script: call DestroyGroup (udg_temp_group)
-
Else - Actions
- Do nothing
-
If - Conditions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Triggering unit) is owned by Player 12 (Brown)) Equal to (==) True
-
Then - Actions
- Set temp_group = (Units in (Playable map area) matching (((Picked unit) is owned by Player 12 (Brown)) Equal to (==) True))
-
Unit Group - Pick every unit in temp_group and do (Actions)
-
Loop - Actions
- Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Human\Resurrect\ResurrectCaster.mdl
- Unit - Add Enchantment (Damage) to (Picked unit)
- Unit - Add Enchantment (Armor) to (Picked unit)
- Wait 15.00 seconds
- Unit - Remove Enchantment (Damage) from (Picked unit)
- Unit - Remove Enchantment (Armor) from (Picked unit)
- Special Effect - Destroy (Last created special effect)
-
Loop - Actions
- Custom script: call DestroyGroup (udg_temp_group)
-
Else - Actions
- Do nothing
-
If - Conditions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Triggering unit) is owned by Player 2 (Blue)) Equal to (==) True
-
Then - Actions
- Set temp_group = (Units in (Playable map area) matching (((Picked unit) is owned by Player 2 (Blue)) Equal to (==) True))
-
Unit Group - Pick every unit in temp_group and do (Actions)
-
Loop - Actions
- Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Human\Resurrect\ResurrectCaster.mdl
- Unit - Add Enchantment (Damage) to (Picked unit)
- Unit - Add Enchantment (Armor) to (Picked unit)
- Wait 15.00 seconds
- Unit - Remove Enchantment (Damage) from (Picked unit)
- Unit - Remove Enchantment (Armor) from (Picked unit)
- Special Effect - Destroy (Last created special effect)
-
Loop - Actions
- Custom script: call DestroyGroup (udg_temp_group)
-
Else - Actions
- Do nothing
-
If - Conditions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Triggering unit) is owned by Player 9 (Gray)) Equal to (==) True
-
Then - Actions
- Set temp_group = (Units in (Playable map area) matching (((Picked unit) is owned by Player 9 (Gray)) Equal to (==) True))
-
Unit Group - Pick every unit in temp_group and do (Actions)
-
Loop - Actions
- Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Human\Resurrect\ResurrectCaster.mdl
- Unit - Add Enchantment (Damage) to (Picked unit)
- Unit - Add Enchantment (Armor) to (Picked unit)
- Wait 15.00 seconds
- Unit - Remove Enchantment (Damage) from (Picked unit)
- Unit - Remove Enchantment (Armor) from (Picked unit)
- Special Effect - Destroy (Last created special effect)
-
Loop - Actions
- Custom script: call DestroyGroup (udg_temp_group)
-
Else - Actions
- Do nothing
-
If - Conditions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Triggering unit) is owned by Player 7 (Green)) Equal to (==) True
-
Then - Actions
- Set temp_group = (Units in (Playable map area) matching (((Picked unit) is owned by Player 7 (Green)) Equal to (==) True))
-
Unit Group - Pick every unit in temp_group and do (Actions)
-
Loop - Actions
- Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Human\Resurrect\ResurrectCaster.mdl
- Unit - Add Enchantment (Damage) to (Picked unit)
- Unit - Add Enchantment (Armor) to (Picked unit)
- Wait 15.00 seconds
- Unit - Remove Enchantment (Damage) from (Picked unit)
- Unit - Remove Enchantment (Armor) from (Picked unit)
- Special Effect - Destroy (Last created special effect)
-
Loop - Actions
- Custom script: call DestroyGroup (udg_temp_group)
-
Else - Actions
- Do nothing
-
If - Conditions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Set temp_point = (Center of Enhancement Finish <gen>)
- Unit - Move (Triggering unit) instantly to temp_point
- Custom script: call RemoveLocation (udg_temp_point)
-
Events
JASS:
function EnhancementC takes nothing returns boolean
return GetUnitTypeId(GetTriggerUnit())=='u005' and GetPlayerState(GetOwningPlayer(GetTriggerUnit()),PLAYER_STATE_RESOURCE_GOLD)>=6000
endfunction
function EnhancementA takes nothing returns nothing
local unit triggerU = GetTriggerUnit()
local group inRect=CreateGroup()
local integer currentGold=GetPlayerState(GetOwningPlayer(GetTriggerUnit()),PLAYER_STATE_RESOURCE_GOLD)
local unit firstUnit
set udg_temp_point=Location(GetRectCenterX(gg_rct_Enhancement_Finish),GetRectCenterY(gg_rct_Enhancement_Finish))
call SetUnitPosition(GetTriggerUnit(),GetRectCenterX(gg_rct_Enhancement_Finish),GetRectCenterY(gg_rct_Enhancement_Finish))
call SetPlayerState(GetOwningPlayer(GetTriggerUnit()),PLAYER_STATE_RESOURCE_GOLD,currentGold-6000)
call DisplayTextToPlayer(GetOwningPlayer(GetTriggerUnit()),0,0,"|cffd9d9ffYou cast Enhancement...|r")
call GroupEnumUnitsInRect(inRect,bj_mapInitialPlayableArea,null)
set udg_temp_group=inRect
loop
exitwhen FirstOfGroup(udg_temp_group)==null
set firstUnit=FirstOfGroup(udg_temp_group)
if GetOwningPlayer(firstUnit)==GetOwningPlayer(GetTriggerUnit()) then
set bj_lastCreatedEffect=AddSpecialEffectTarget("Abilities\\Spells\\Human\\Resurrect\\ResurrectCaster.mdl",firstUnit,"overhead")
call UnitAddAbility(firstUnit,'A06S')
call UnitAddAbility(firstUnit,'A06T')
endif
call GroupRemoveUnit(udg_temp_group,firstUnit)
endloop
call TriggerSleepAction(15)
set udg_temp_group=inRect
loop
exitwhen FirstOfGroup(udg_temp_group)==null
set firstUnit=FirstOfGroup(udg_temp_group)
if GetOwningPlayer(firstUnit)==GetOwningPlayer(GetTriggerUnit()) then
call DestroyEffect(bj_lastCreatedEffect)
call UnitRemoveAbility(firstUnit,'A06S')
call UnitRemoveAbility(firstUnit,'A06T')
endif
call GroupRemoveUnit(udg_temp_group,firstUnit)
endloop
call DestroyGroup(inRect)
call DestroyGroup(udg_temp_group)
endfunction
function InitTrig_Enhancement takes nothing returns nothing
set gg_trg_Enhancement=CreateTrigger()
call TriggerRegisterEnterRectSimple(gg_trg_Enhancement,gg_rct_Enhancement)
call TriggerAddCondition(gg_trg_Enhancement,Condition(function EnhancementC))
call TriggerAddAction(gg_trg_Enhancement,function EnhancementA)
endfunction