Moderator
M
Moderator
19th Jul 2011
Maker:
Simple but could be useful.
Change GetLastCreatedUnit() to bj_lastCreatedUnit
Maker:
Simple but could be useful.
Change GetLastCreatedUnit() to bj_lastCreatedUnit
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
(1 ratings)
Approvedversion 1.06In version 1.06 user can select any chance to cast a random spell, instead of using Max and min factors. Also I have imroved some description.
spirit protection ini

События


Map initialization

Условия

Действия


-------- Choose the number of your dummy spells --------


-------- In this test map I have 5 dummy spells --------


Set Random_spell_Count = 5


-------- This is value - the max number for the chance --------


-------- For example: --------


-------- if [1] value = 8 and [2] value = 1 --------


-------- then the change to cast random spell is --------


-------- 1/(8-1*lvl) * 100% --------


-------- 1 lvl - 14.28% --------


-------- 2 lvl - 16.66% --------


-------- 3 lvl - 20.00% --------


Set Integer_DATA[1] = 8


-------- This is value - factor of descreasing change --------


Set Integer_DATA[2] = 1


-------- --------


-------- --------


-------- choose your dummy spells --------


Set Random_Spell[1] = Отравленный нож random spell


Set Random_Spell[2] = Полиморф random spell


Set Random_Spell[3] = Цепь молний random spell


Set Random_Spell[4] = Очищение random spell


Set Random_Spell[5] = Ледяная звезда random spell


-------- --------


-------- --------


-------- choose ordercodes of your spells --------


-------- In the same procedure --------


Set Order[1] = Тюремщица (Ночные эльфы) - Отравленный нож


Set Order[2] = Волшебница (Альянс) - Полиморф


Set Order[3] = Говорящий с Духами (Орда) - Цепь молний


Set Order[4] = Шаман (Орда) - Очищение


Set Order[5] = Король Мертвых (Нежить) - Ледяной взрыв
spirit protection effect

События


Боевая единица - A unit Атакован

Условия


(Level of Spirit protection for (Triggering unit)) не равно (!=) 0

Действия


Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)



Если - Условия




(Random integer number between 1 and (Integer_DATA[1] - (Integer_DATA[2] x (Level of Spirit protection for (Triggering unit))))) равно (==) 1



То - Действия




-------- This is a random value beetween 1 and the count of your random spells --------




Set Random_Value = (Random integer number between 1 and Random_spell_Count)




Set TempPoint = (Position of (Triggering unit))




Боевая единица - Create 1 dummy for (Owner of (Triggering unit)) at TempPoint facing Стандартная ориентация зданий (270.0) degrees




Боевая единица - Add a 2.00 second Общий expiration timer to (Last created unit)




-------- order to cast your chose spell with the correspond orders --------




Set Random_Value2 = (Random integer number between 1 and Random_spell_Count)




Боевая единица - Add Random_Spell[Random_Value2] to (Last created unit)




Боевая единица - Order (Last created unit) to Order[Random_Value2] (Attacking unit)




Custom script: call RemoveLocation(udg_TempPoint)



Р˜РЅР°С‡Рµ - Действия
Unit - Order (Last created unit) to Order[Random_Value] (Attacking unit)

call IssueTargetOrderById(bj_lastCreatedUnit, udg_Random_Value, GetAttacker())
Custom script: call IssueTargetOrderById( GetLastCreatedUnit(), udg_Order[udg_Random_Value], GetAttacker() )
call IssueTargetOrderById(bj_lastCreatedUnit, udg_Order[udg_Random_Value], GetAttacker())
spirit protection ini

Events


Map initialization

Conditions

Actions


-------- Choose the number of your dummy spells --------


-------- In this test map I have 5 dummy spells --------


Set Random_spell_Count = 5


-------- This is value - the max number for the chance --------


-------- For example: --------


-------- if [1] value = 8 and [2] value = 1 --------


-------- then the change to cast random spell is --------


-------- 1/(8-1*lvl) * 100% --------


-------- 1 lvl - 14.28% --------


-------- 2 lvl - 16.66% --------


-------- 3 lvl - 20.00% --------


Set Integer_DATA[1] = 8


-------- This is value - factor of descreasing change --------


Set Integer_DATA[2] = 1


-------- --------


-------- --------


-------- choose your dummy spells --------


Set Random_Spell[1] = Shadow Strike random spell


Set Random_Spell[2] = Polymorph random spell


Set Random_Spell[3] = Chain Lightning random spell


Set Random_Spell[4] = Purge random spell


Set Random_Spell[5] = Frost Nova random spell


-------- --------


-------- --------


-------- choose ordercodes of your spells --------


-------- In the same procedure --------


Set Order[1] = Unknown


Set Order[2] = Unknown


Set Order[3] = Unknown


Set Order[4] = Unknown


Set Order[5] = Unknown
spirit protection effect

Events


Unit - A unit Is attacked

Conditions


(Level of Spirit protection for (Triggering unit)) Not equal to 0

Actions


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(Random integer number between 1 and (Integer_DATA[1] - (Integer_DATA[2] x (Level of Spirit protection for (Triggering unit))))) Equal to 1



Then - Actions




-------- This is a random value beetween 1 and the count of your random spells --------




Set Random_Value = (Random integer number between 1 and Random_spell_Count)




Set TempPoint = (Position of (Triggering unit))




Unit - Create 1 dummy for (Owner of (Triggering unit)) at TempPoint facing Default building facing degrees




Unit - Add a 2.00 second Generic expiration timer to (Last created unit)




-------- order to cast your chose spell with the correspond orders --------




Unit - Add Random_Spell[Random_Value] to (Last created unit)




Custom script: call IssueTargetOrderById(bj_lastCreatedUnit, udg_Order[udg_Random_Value], GetAttacker())




Custom script: call RemoveLocation(udg_TempPoint)



Else - Actions
Lol double post,just edit ur old post next time,I can't open and test the spell either
I don`t know why...Lol double post,just edit ur old post next time,I can't open and test the spell either
Set Order[1] = Unknown

Set Order[2] = Unknown

Set Order[3] = Unknown

Set Order[4] = Unknown

Set Order[5] = Unknown
Owner of (triggering unit)=>triggering player
Yes it works now,great job
Unless you want to download icon manager,you should just change it to another iconHow can I make icon with border?
Unit - Set level of Random_Spell[Random_Value] for (Last created unit) to (Level of Spirit protection for (Triggering unit))
Ask bribe,he might let you,but I suggest notCan I just import icon and give credits?
So, I am increasing power of spells with increasing level of ability.
Unit - Set level of Random_Spell[Random_Value] for (Last created unit) to (Level of Spirit protection for (Triggering unit))
Repost the code?
Dang,you really need some help here...sry i cant help you on it,but you can go to the forum for help ^^
For posting the codesHelp? Why?
|
For now this spell is too simple to be approved, as well as it is way too easy to abuse in game because it is using
I will rate this spell.. 1/5. That is enough for a vote of rejection. HELP FOR FUTURE; Go learn some tutorials at this place, go for either indexing or hashtables. TRIGGERS;
|
