- Joined
- May 14, 2011
- Messages
- 524
I've messed around with the triggers and understood the basics,can anyone teach me farther? I need to learn Hashtables,MUI and leaks,I have never coded in my life but I'll catch on really fast
You decleare the dummy when the unit 'haven't created', all 'last created unit refer to this action:
- Overheat index
- Events
- Conditions
- Actions
- Set Color_Blue = 100.00
- Set Color_Green = 100.00
- Set Oh_Fin = (Oh_Fin 1)
- Set Oh = Oh_Fin
- Overheat cast
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Overheat
- Actions
- Trigger - Run Overheat index <gen> (ignoring conditions)
- Set Oh_Caster[Oh] = (Triggering unit)
- Special Effect - Create a special effect attached to the head of Oh_Caster[Oh] using Abilities\Spells\Orc\Voodoo\VoodooAuraTarget.mdl
- Set SFX = (Last created special effect)
- Set Caster_Point[Oh] = (Position of Oh_Caster[Oh])
- Set Too_Close[Oh] = (Units within 150.00 of (Position of Oh_Caster[Oh]) matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) is A structure) Equal to ((Matching unit) belongs to an enemy of (Owner of Oh_Caster[Oh])))))
- Set Too_Close_Units[Oh] = (Picked unit)
- Set Dummy = (Last created unit)
- Set Oh_Angle[Oh] = (Angle from Caster_Point[Oh] to (Position of (Random unit from Too_Close[Oh])))
- Set Max_Dist[Oh] = 250.00
- Set KB_Speed[Oh] = 50.00
- Set Dist[Oh] = 0.00
- Trigger - Turn on Overheat Effect <gen>
Spell don't work I have not removed the leaks yet and don't know how to describe the spell.
- Overheat Effect
- Events
- Time - Every 0.02 seconds of game time
- Conditions
- Actions
- Animation - Change Oh_Caster[Oh]'s vertex coloring to (100.00%, (Color_Green - 20.00)%, (Color_Blue - 20.00)%) with 0.00% transparency
- For each (Integer Oh) from 1 to Oh_Fin, do (Actions)
- Loop - Actions
- Set Point_1 = (Position of Too_Close_Units[Oh])
- Set Point_2 = ((Position of Too_Close_Units[Oh]) offset by KB_Speed[Oh] towards Oh_Angle[Oh] degrees)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Or - Any (Conditions) are true
- Conditions
- Dist[Oh] Greater than or equal to Max_Dist[Oh]
- (Terrain pathing at Point_2 of type Walkability is off) Equal to True
- Then - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Oh_Fin Equal to 1
- Then - Actions
- Special Effect - Create a special effect attached to the chest of Too_Close_Units[Oh] using Abilities\Spells\Other\Doom\DoomDeath.mdl
- Special Effect - Destroy (Last created special effect)
- Unit - Create 1 DUMMY for (Owner of Oh_Caster[Oh]) at Caster_Point[Oh] facing Caster_Point[Oh]
- Unit - Add Stun Dummy to Dummy
- Unit - Set level of Stun Dummy for Dummy to (Level of Overheat for Oh_Caster[Oh])
- Unit - Order Dummy to Human Mountain King - Storm Bolt Too_Close_Units[Oh]
- Unit - Add a 1.00 second Generic expiration timer to Dummy
- Unit - Hide Dummy
- Animation - Change Oh_Caster[Oh]'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
- Special Effect - Destroy SFX
- Trigger - Turn off (This trigger)
- Else - Actions
- Set Oh_Caster[Oh] = Oh_Caster[Oh_Fin]
- Set Caster_Point[Oh] = Caster_Point[Oh_Fin]
- Set Dist[Oh] = Dist[Oh_Fin]
- Set Oh_Angle[Oh] = Oh_Angle[Oh_Fin]
- Set KB_Speed[Oh] = KB_Speed[Oh_Fin]
- Set Max_Dist[Oh] = Max_Dist[Oh_Fin]
- Set Too_Close_Units[Oh] = Too_Close_Units[Oh_Fin]
- Set Oh = (Oh - 1)
- Set Oh_Fin = (Oh_Fin - 1)
- Else - Actions
- Unit - Move Too_Close_Units[Oh] instantly to Point_2
- Special Effect - Create a special effect at Point_2 using Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
- Special Effect - Destroy (Last created special effect)
- Set Dist[Oh] = (KB_Speed[Oh] Dist[Oh])
Should I start with hashtables or indexing?
scope SimpleDamageSpell initializer init
private function SimpleDamage takes nothing returns boolean
//here we check if the casted spell corresponds to the spell that we want
//this code to work for
//I didn't use a local for the unit since I think two calls is tolerable
if GetSpellAbilityId() == YOUR_SPELL_RAWCODE_HERE then
//here we deal damage to the target
call UnitDamageTarget(GetTriggerUnit(), GetSpellTargetUnit(), 100.0*(GetUnitAbilityLevel(GetTriggerUnit(), YOUR_SPELL_RAWCODE_HERE)), false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_DIVINE, null)
endif
//we need this line since the function should return a boolean
return false
endfunction
//This is the function run at map init
private function init takes nothing returns nothing
//here we create a trigger
local trigger t = CreateTrigger()
local integer i = 0
loop
exitwhen i > 15
//We register the event Unit - A unit starts the effect of an ability
//for all player units
call TriggerRegisterPlayerUnitEvent(t, Player(i), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
set i = i + 1
endloop
//we merge the actions into the condition because its faster than actions
call TriggerAddCondition(t, Condition(function SimpleDamage))
set t = null
endfunction
endscope
if GetSpellAbilityId () == A000
GetSpellAbilityId () == 'A000'
/*
you need to put rawcodes inside ' '
*/
then
?Did usmwe support vjass?you forgot to putthen
?
or did you copy the whole code? your editor might not support vJASS (since I used scopes and privates, which are vJASS things, you need to use NewGenWE)...
If (not ( GetSpellAbilityId() == 'A000')) then
Did usmwe support vjass?
i use it
But the problem is solved when i use
But when i used it, the spell does no damageJASS:If (not ( GetSpellAbilityId() == 'A000')) then
If (not ( GetSpellAbilityId() == 'A000')) then
Umm...
My umswe say that the
Is an error,how i fix this?JASS:if GetSpellAbilityId () == A000
return GetSpellAbilityId () == 'A000'
if GetSpellAbilityId () == 'A000' then
// actions here
endif
function JOIN_US takes unit GUIer returns nothing
call IssueImmediateOrder(GUIer,"smart")
call TriggerSleepAction (ENOUGH_TIME_FOR_A_GUIER_TO_UNDERSTAND_HOW_GUI_IS_INEFFICIENT)
call BJDebugMsg("A GUIer has went to the JASS side ^^")
call set NUMBER_OF_JASSERS = NUMBER_OF_JASSERS + 1
endfunction