Spell Fortitude

wraithseeker

Tired.
Reaction score
122
I have made a spell after some time and is happy to submit it to Thehelper.


Import Difficulty: Medium
GUI/JASS: VJASS
MUI/MPI: MUI
Leakless/Leak: Leakless
[
Ability Information

Gives a 5/10/15 percent chance to do 3/4/5 second stun when a unit attacks you and the enemy will fall down.



Verison 1.1 Update
-Removed PolledWait and replaced with TriggerSleepaction
-Depending on the level of your ability, the dummy ability will change in stun duration.
-Added.... some terrain


Verison 1.2 Update
-turned some BJS into natives
- Now there is tooltip for the spell
- Dummy no longer shows and you will never ever see it.


Verison 1.3 Update
-Changed some functions to make it more efficent
-Unit now spawns for neutral passive
- Ability is now added at Init

Verison 1.4 Update
-Some minor text changes and ability name changes
-screenshots are added




Code

JASS:
scope Fortitute initializer Init
// +------------------------------------------------------------------------+
// |     Fortitute - Created by wraithseeker.  Requires JassNewGen!     |   
// +------------------------------------------------------------------------+
// | Gives 5/10/15% chance to knock down a enemy unit that is attacking the
// | person who has the spell.
// |                                      
// +------------------------------------------------------------------------+
// | How to Import:                                                         |
// |  - Create a new trigger                                                |
// |  - Convert it to Custom text                                           |
// |  - Replace everything there with this code                             |
// |  - Change the constants to suit yourself                               |
// |  - Make a dummy unit and a dummy ability based off storm bolt          |
// |  - create a passive ability based off anything and set everything to 0%|
// |  - You don't have to give me credits but don't say this spell is yours.|                                                            |
// +------------------------------------------------------------------------+
//               | Credits to Viikuna for helping me with some bugs|
// |-------------|-------------------------------------------------|
// | Constants:  |
// |-------------|

globals
private constant string EFFECT =  "Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl"  // effect at the guy who attacked
private constant integer ID = 'A003' // ability ID of spell
private constant string POSITION = "origin" // the position where u want to attach for effect at the guy who attacked
private constant string DEATH = "death" // the animation you want to play for the unit which attacked the person who has the ability
private constant integer UNIT = 'h001' // ID of dummy unit
private constant integer SPELL = 'A002' // ID Of dummy ability which will be used to stun
private unit Dealer // dummy unit
endglobals
//|----------------|
//|End Of Constants|
//------------------
private function CHANCE takes integer level returns integer
return level * 5 // the amount of chance each level the person can get knocked down
endfunction
/// DO not touch below this line ///
private function True takes nothing returns boolean
return true
endfunction

private function Conditions takes nothing returns boolean
return IsUnitEnemy(GetTriggerUnit(), GetOwningPlayer(GetAttacker())) and GetRandomInt(0, 100) <= CHANCE(GetUnitAbilityLevel(GetTriggerUnit(), ID)) and GetUnitAbilityLevel(GetTriggerUnit(), ID) > 0
endfunction


private function Actions takes nothing returns nothing
local unit t = GetTriggerUnit() 
local unit u = GetAttacker()
call SetUnitX(Dealer,GetUnitX(u))
call SetUnitY(Dealer,GetUnitY(u))
call SetUnitAbilityLevel(Dealer, SPELL, GetUnitAbilityLevel(t, ID))
call IssueTargetOrder(Dealer,"thunderbolt",u)
call DestroyEffect(AddSpecialEffectTarget(EFFECT,u,POSITION))
call TriggerSleepAction(0.1)
call SetUnitAnimation(u,DEATH)
set t = null
set u = null
endfunction



//===========================================================================
private function Init takes nothing returns nothing
    local trigger t = CreateTrigger() 
    local integer i = 0
   loop
   exitwhen i > 15
   call TriggerRegisterPlayerUnitEvent(t,Player(i), EVENT_PLAYER_UNIT_ATTACKED, Filter(function True))   
   set i = i + 1
   endloop
    call TriggerAddCondition(t,Filter(function Conditions))
    call TriggerAddAction( t, function Actions )
    set Dealer = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),UNIT,0.0,0.0,0.0)
    call UnitAddAbility(Dealer,SPELL)
    
endfunction

endscope
Screenshots
screeny.jpg


L0lz.jpg
 

Attachments

  • Fortitute.w3x
    19 KB · Views: 369

wraithseeker

Tired.
Reaction score
122
Well, they "fall down" since the person who has the ability is "so strong" and I can't find a better animation that every unit have lol.
 

WolfieeifloW

WEHZ Helper
Reaction score
372
Ah, true enough.
IMO, it would just look/be weird :p .
Just trying to help you improve your spell though;
I'm not flaming you or anything :) .
Just in case you thought I was or something.
 

WolfieeifloW

WEHZ Helper
Reaction score
372
I'll actually check it out now, and edit this post with feedback :) .

EDIT: Bahh...
It looks very weird with the death animation.
The unit falls, then is still standing there lol.

"Woosh" effect = :thup: ,
Death animation = :thdown: .
 

WolfieeifloW

WEHZ Helper
Reaction score
372
For me, the death animation plays, the unit falls, but then he stands there while he's stunned.
It makes it look like a mirror image of him laying on the ground :p .
 

w00t22

CSS L4D DoD? Steam ID = w00t22
Reaction score
43
I don't see the point of having this in vJass just looks like a normal trigger converted with fixing of leaks and MUI
 

wraithseeker

Tired.
Reaction score
122
sure, upload one, Isn't that vjass? I am using a scope and globals. But can anyone tell me where can I download a file that can read .TGA.
 

Viikuna

No Marlo no game.
Reaction score
265
Why it is vJass is really stupid question really...

Or am I the only one who thinks that GUIs variable editor sucks?

EDIT. I think you should set that stormbolt dummys ability level to match Heros ability level. Now it is using level 1 stun for all levels.

Also dont use PolledWait -function. It leaks one timer.
 

Flare

Stops copies me!
Reaction score
662
Fairly simple spell, can't see much wrong with it (other than PolledWait, but that's just mainly because I don't like waits at all)

Indenetation could really use some improvement, looks quite ugly when all your code is stuck to the left side :(

Ahm... why isn't ownership of the dummy changed? If the Stormbolt does any damage, you do have an issue with kill credit coming into play

Why are you removing the ability from said dummy? You could just add it at Map Init and leave it on that dummy all the time (which is not likely to cause problems)

You can make your CHANCE function constant (just add 'constant', without inverted commas' between private and function) - not really a big deal, just a little bit of extra efficiency if you want :p

Possession - Created by wraithseeker. Requires JassNewGen!
You might wanna change that ;)

I don't see the point of having this in vJass just looks like a normal trigger converted with fixing of leaks and MUI
I don't think you (or anyone else, for that matter) have any right to question the author's choice to make this in vJASS - whatever the reasoning for making it in vJASS is, it shouldn't really matter, since he's the one making the spell and, as such, it's entirely his decision as to how he goes about it.

Also, why not make it in vJASS?
It's already in vJASS, as wraithseeker said - scopes, free global declaration, private members are all part of vJASS

Why it is vJass is really stupid question really...

Or am I the only one who thinks that GUIs variable editor sucks?

EDIT. I think you should set that stormbolt dummys ability level to match Heros ability level. Now it is using level 1 stun for all levels.

Also dont use PolledWait -function. It leaks one timer.
You're not the only one who thinks it sucks :) Free globals > all

And PolledWait only leaks the local handle, not the timer itself :p
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
I don't see the point of having this in vJass just looks like a normal trigger converted with fixing of leaks and MUI

A few reasons to make things in vJASS:

  • MUI
  • Leakless
  • Optimized
  • Easy to edit options
  • Easy to import
  • No naming problems

vJASS is good. It was also probably good practice for him.
 

wraithseeker

Tired.
Reaction score
122
This is the first spell I have made in vjass after reading romek's tutorial and darth's and some other, so, I should use a timer for the polled wait?
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top