- Eat_bacon_daily wrote:
- Question 1: I require help finding out how to make a custom passives. For example making a 15% chance to summon a unit when attacking or attacked.
You would need to make an ability (copy something like evasion), erase all the stuff in there and put it what you want it to say, and make it look the way you want
Then make a trigger
I dont feel like going over every action you need, so im just going to go over the basic idea
The event would be the "unit is attacked", or the "unit is attacking" events
The conditions would be that the unit has the ability
The actions would be to generate a random number between 1 and 100, and save it to a variable
Then an if statement to check if that random number is greater then or equal to 1, and less then or equal to 15
Another if statement in that one to check the level 1 of the ability that you copied
The actions in that if statement would be to create the unit that you want them to get for that level of the ability
Then an else if for the level 2 of the ability
Then repeat the actions for creating the unit for each lvl of the ability, making sure the unit that is created is for the right level of the ability
It would look something like this:
- Code:
-
Event - Unit is attacked
Condtions - Unit has the ability
Actions -
random = (random number 1-100)
if (random >=1 && random <= 15)
then
if (level of ability == 1)
then
create weak unit
else if (level of ability == 2)
then
create medium unit
else if (level of ability == 3)
then
create strong unit
If you dont want the unit that is summoned to just appear like how create unit works, you can either use a dummy unit to actually summon the unit, or just play an effect where the unit is being created
- Eat_bacon_daily wrote:
- Question 2: I also would like to know if theres a way to upgrade a custom skill. For Example if i make cast an average ability like avatar, then make through a trigger an explosion that damages area. How do i boost the explosion for every lvl avatar is boosted
Use an if statement to check the level of avatar when avatar is activated and change the dmg accordingly
Would look something like this:
- Code:
-
Event - Ability avatar is used
Actions -
if (level of avatar == 1)
then
(actions for w/e your explosion currently is)
else if (level of avatar ==2
then
(actions for w/e your explosion currently is with added dmg)