wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Resources > Code Resources > Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 10-13-2009, 08:52 AM   #1
Earth-Fury
Two Blue
 
Earth-Fury's Avatar
 
Join Date: Mar 2003
Posts: 2,179

Submissions (7)

Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)

Send a message via MSN to Earth-Fury
Default BonusMod

Zoom (requires log in)
Version 3.3.1
Introduction
BonusMod is written in vJass and requires the NewGen editor, or Jass Helper with PitzerMike's Object Merger configured for it. BonusMod requires the latest version of Jass Helper.

BonusMod is a system for applying reversible bonuses to stats, such as damage, for specific units. Most of the bonuses provided by this system show green or red numbers in the command card, much like the bonuses provided by items. BonusMod is limited in the range of bonuses it can apply. The more abilities a bonus type uses, the larger the maximum and minimum bonuses.

BonusMod can also grant bonuses through code. For example, five optional bonus types are distributed with the basic BonusMod library. They are maximum life and mana, absolute mana per second regeneration, percentage of life per second regeneration, and movement speed. Even more bonus types can be provided by external libraries. The minimum and maximum bonuses these can apply differ depending on the library providing them.

Further explanation, and a guide to the API, is in the libraries documentation.
Credits
The BonusMod Library
Requirements:
The BonusMod library comes with the following bonus types with the given minimum and maximum values:

Bonus Types and Ranges:
Bonus Constant: Minimum:Maximum:
BONUS_DAMAGE
-1024
+1023
BONUS_ARMOR
-1024
+1023
BONUS_SIGHT_RANGE
-2048
+2047
BONUS_LIFE_REGEN
-256
+255
BONUS_AGILITY
-256
+255
BONUS_STRENGTH
-256
+255
BONUS_INTELLIGENCE
-256
+255
BONUS_ATTACK_SPEED
-512%
+511%
BONUS_MANA_REGEN_PERCENT
-512%
+511%
Note that you can easily remove unused bonuses, and easily increase or decrease the range of bonuses individually. Information on how is within the libraries documentation.

To add BonusMod to your map, copy and paste the below library in to a custom-text trigger in your map.

You will want to close your map after the first time you save it with BonusMod in it, reopen it, and disable ability (re)generation in the configuration section. If you fail to do that, a small delay will be added every time you save your map.
Expand BonusMod:


Additional Bonus Types
Bonus Maximum Life / Mana
Requirements:
This library provides two new bonus types:
Bonus Types and Ranges:
Bonus Constant:
BONUS_LIFE
BONUS_MANA
The minimum bonus these bonus types can apply depends on the unit. You can apply any positive or negative bonus that does not result in a unit's maximum life or maximum mana going below 1.

To add these bonuses to BonusMod, simply copy and paste the following library in to a custom-text trigger in your map.
Expand Bonus Max Life / Mana:


Bonus Life Regen (%) and Mana Regen (Absolute)
Requirements:
This library provides two new bonus types:
Bonus Types and Ranges:
Bonus Constant:
BONUS_MANA_REGEN
BONUS_LIFE_REGEN_PERCENT
These bonuses do not have minimum or maximum values. Any bonus amount is valid.

To add these bonuses to BonusMod, simply copy and paste the following library in to a custom-text trigger in your map. You may wish to change the refresh delay of the system, to either increase or decrease the time between updates.
Expand Bonus Life Regen (%) and Mana Regen (Absolute):

Bonus Movement Speed
Requirements:
This library provides one new bonus type:
Bonus Types and Ranges:
Bonus Constant:
BONUS_MOVEMENT_SPEED
The maximum and minimum bonus depends on a unit's base movement speed, and the maximum and minimum movement speed set in the gameplay constants. A unit's movement speed can not go below or above the minimum or maximum movement speed as defined in the gameplay constants.

To add this bonus to BonusMod, simply copy and paste the following library in to a custom-text trigger in your map. You must change the constants for maximum/minimum movement speed if you change the gameplay constants from their defaults.
Expand Bonus Movement Speed:

Demo Map
Below is the demo map for BonusMod. You can download it to test out the functionality.

BonusMod 3.3.1.w3x
Change Log

BonusMod & Additional Bonuses Change Log

  • 3.3.1:
    • Movement Speed bonus added
  • 3.3.0:
    • Switched ability creation to lua
    • Minor optimizations
  • 3.0 - 3.2:
    • Complete rewrite
    • Bug fixes
  • 1.0 - 2.0:
    • Ancient versions

__________________
Useful Links:
My Resources:
Good Resources:
Search
Tutorials
Ability Guide

UnitMaxState
BonusMod

AutoIndex
ARGB
TimerUtils


Last edited by Earth-Fury : 11-23-2009 at 01:45 AM.
Earth-Fury is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 10-13-2009, 08:59 AM   #2
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

Finally the BonusMod on Wc3c.net!

And with an even better code, which sadly doesn't give more functionality.

Is there any chance you can add Attackspeed and Movespeed aswell?
(Attackspeed with "Gloves Of Haste"-Spell and Movespeed with triggering?)
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]
Anachron is offline   Reply With Quote
Old 10-13-2009, 09:05 AM   #3
Earth-Fury
Two Blue
 
Earth-Fury's Avatar
 
Join Date: Mar 2003
Posts: 2,179

Submissions (7)

Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)

Send a message via MSN to Earth-Fury
Default

Quote:
Originally Posted by Anachron
And with an even better code, which sadly doesn't give more functionality.
Did you miss the whole part of the code and documentation about having code-based bonuses? Also, each bonus now has it's own range, allowing you to minimize the number of abilities it uses.
Quote:
Originally Posted by Anachron
Is there any chance you can add Attackspeed and Movespeed aswell?
(Attackspeed with "Gloves Of Haste"-Spell and Movespeed with triggering?)
Maybe.
__________________
Useful Links:
My Resources:
Good Resources:
Search
Tutorials
Ability Guide

UnitMaxState
BonusMod

AutoIndex
ARGB
TimerUtils

Earth-Fury is offline   Reply With Quote
Old 10-13-2009, 09:16 AM   #4
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

Quote:
Did you miss the whole part of the code and documentation about having code-based bonuses? Also, each bonus now has it's own range, allowing you to minimize the number of abilities it uses.
Well, but who wants to have an value smaller as -4096 or higher as 4095?
Anyway, I (as you may have noticed) added an attackspeed bonus and movespeed bonus right to your system at hws, so yeah, would be good if you could add those.
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]
Anachron is offline   Reply With Quote
Old 10-13-2009, 02:15 PM   #5
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,727

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

You should probably add the movespeed with the boots of speed ability. A single, changeable boots of speed ability can work, I've done lots of testing on that already for one of my maps. Anyways, if you insist you could use the natives.

The general stuff this should cover is as follows:
  • Strength
  • Intelligence
  • Agility
  • Damage
  • Armor
  • Attack Speed
  • Movement Speed
  • Life Regeneration (Flat)
  • Mana Regeneration (Flat)
  • Mana Regeneration (%)
  • Max Life
  • Max Mana
  • Sight Range

Anyways, just offhand the code looks okay and so does the documentation.
__________________
Rising_Dusk is offline   Reply With Quote
Old 10-13-2009, 03:48 PM   #6
Fledermaus
default string
 
Fledermaus's Avatar
 
Join Date: May 2006
Posts: 637

Submissions (1)

Fledermaus has a spectacular aura about (148)

Send a message via MSN to Fledermaus
Default

I'd go with boots of speed ability to make it consistent with everything else (green bonus).
Fledermaus is offline   Reply With Quote
Old 10-13-2009, 06:33 PM   #7
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,727

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

That was my logic as well. Since they don't stack, however, even if you properly set the gameplay constant, you'd have to use one ability with a crapton of levels. I think either way it'd be the way to go, though.
__________________
Rising_Dusk is offline   Reply With Quote
Old 10-13-2009, 07:12 PM   #8
Ignitedstar
Moderator
 
Ignitedstar's Avatar


RP Section Moderator
 
Join Date: Jul 2005
Posts: 1,755

Ignitedstar has a spectacular aura about (102)Ignitedstar has a spectacular aura about (102)Ignitedstar has a spectacular aura about (102)Ignitedstar has a spectacular aura about (102)

Send a message via MSN to Ignitedstar Send a message via Yahoo to Ignitedstar
Default

Quote:
Originally Posted by Earth-Fury
Did you miss the whole part of the code and documentation about having code-based bonuses? Also, each bonus now has it's own range, allowing you to minimize the number of abilities it uses.
This is the thing that stood out to me the most. It's exactly why this rendition of BonusMod is awesome. Now I can have ~8000 bonus health and not have to do the same thing for everything else. Thank you, Earth-Fury!

Other than that, from what I take, calling setbonus is no different from the old BonusMod, right?
__________________
Current Activity: School
Evaluation: I actually logged in?!?!
"If I speak in the tongues of men and of angels, but have not love,
I am only a resounding gong or a clanging cymbal.
If I have the gift of prophecy and can fathom all mysteries and all knowledge,
and if I have a faith that can move mountains, but have not love, I am nothing."

1 Corinthians 13:1-2

Current Works:
None.

Last edited by Ignitedstar : 10-13-2009 at 08:10 PM.
Ignitedstar is offline   Reply With Quote
Old 10-13-2009, 07:40 PM   #9
Earth-Fury
Two Blue
 
Earth-Fury's Avatar
 
Join Date: Mar 2003
Posts: 2,179

Submissions (7)

Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)

Send a message via MSN to Earth-Fury
Default

Quote:
Originally Posted by Ignitedstar
This is the thing that stood out to me the most. It's exactly why this rendition of BonusMod is awesome. Now I can have ~8000 bonus health and not have to do the same thing for everything else. Thank you, Earth-Fury!
if you mean maximum health, you'll hopefully be able to have an arbitrary health bonus. And mana bonus. If I can get it to work right... (It's basically a whole different thing jammed in to the same interface as the rest of it, which is why the other part of what you quoted is also awesome.)

Quote:
Originally Posted by Ignitedstar
Other than that, from I take, calling setbonus is no different from the old BonusMod, right?
Well, different naming convention for one.

Also, the old one returned a boolean, and failed if you tried to set something above/below the maximum. This one returns an integer which tells you the ACTUAL new bonus the unit got, and will simply give the min/max bonus if you go over/under. (And toss a warning if compiled in debug mode.)

In short: Basically, yeah. Barring the shit I'm sure no one ever used, they are identical.
__________________
Useful Links:
My Resources:
Good Resources:
Search
Tutorials
Ability Guide

UnitMaxState
BonusMod

AutoIndex
ARGB
TimerUtils

Earth-Fury is offline   Reply With Quote
Old 10-19-2009, 09:11 PM   #10
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

Still doesn't support movespeed. Will you add it?
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]
Anachron is offline   Reply With Quote
Old 10-19-2009, 09:13 PM   #11
Earth-Fury
Two Blue
 
Earth-Fury's Avatar
 
Join Date: Mar 2003
Posts: 2,179

Submissions (7)

Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)

Send a message via MSN to Earth-Fury
Default

Quote:
Originally Posted by Anachron
Still doesn't support movespeed. Will you add it?
Eventually. It turned out to be even more complex a thing than I had thought. It will require substantial testing to figure out all the possible kinks. For now, enjoy it without movement speed.
__________________
Useful Links:
My Resources:
Good Resources:
Search
Tutorials
Ability Guide

UnitMaxState
BonusMod

AutoIndex
ARGB
TimerUtils

Earth-Fury is offline   Reply With Quote
Old 10-20-2009, 03:22 AM   #12
Av3n
Roar!
 
Av3n's Avatar


Project Leader: TBR
Project Member: PoC
 
Join Date: May 2006
Posts: 1,853

Submissions (7)

Av3n is a jewel in the rough (240)Av3n is a jewel in the rough (240)Av3n is a jewel in the rough (240)Av3n is a jewel in the rough (240)Av3n is a jewel in the rough (240)

Hero #4 extra-official winner2008 Spell olympics - Fire - BronzeHero Contest #3 - 3rd Place

Default

Earth-Fury I would suggest to add the negatives like this: -1, -2 etc.
Since I did had problems before with negative bonuses where a -hp (shouldn't happen since of the method you are using) or a -str bonus that is changed can kill a unit.

-Av3n
__________________

Thanks to FatherTime for the sig
.:
Current ProjectsSubmissions
Power of CorruptionMy Terrain
The Black RoadMy Resources
Strikeforce
Twitter
Av3n is offline   Reply With Quote
Old 10-20-2009, 03:27 AM   #13
Earth-Fury
Two Blue
 
Earth-Fury's Avatar
 
Join Date: Mar 2003
Posts: 2,179

Submissions (7)

Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)

Send a message via MSN to Earth-Fury
Default

Quote:
Originally Posted by Av3n
Earth-Fury I would suggest to add the negatives like this: -1, -2 etc.
Since I did had problems before with negative bonuses where a -hp (shouldn't happen since of the method you are using) or a -str bonus that is changed can kill a unit.

-Av3n

The negative bonuses are applied using a massive negative ability, which is added after the positive abilities. In other words, that issue has already been solved.
__________________
Useful Links:
My Resources:
Good Resources:
Search
Tutorials
Ability Guide

UnitMaxState
BonusMod

AutoIndex
ARGB
TimerUtils

Earth-Fury is offline   Reply With Quote
Old 10-20-2009, 07:38 AM   #14
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

Hmm, I think some guys should seriously look at the code before posting.

Thanks again for doing this, I already used it 4 times.
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]
Anachron is offline   Reply With Quote
Old 10-21-2009, 02:37 PM   #15
Fulla
Evil Overlord
 
Fulla's Avatar
 
Join Date: Jan 2006
Posts: 1,416

Submissions (3)

Fulla has a spectacular aura about (79)Fulla has a spectacular aura about (79)Fulla has a spectacular aura about (79)

Default

I tried implementing it, but came across the following error:
Zoom (requires log in)
Attached Images
File Type: jpg Error.JPG (87.4 KB, 790 views)
__________________
Fulla is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 09:36 AM.


Donate

Affiliates
The Hubb http://bylur.com - Warcraft, StarCraft, Diablo and DotA Blog & Forums The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2014, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services