HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Help: Holy Guidance - increases damage based on intellect

05-16-2007, 05:27 PM#1
illiro
hi, i working on a passive spell that will increase the hero's damage based on
5/10/15% of the units intellect.

also one that will increase the heros armor by 10/15/20% of the heros intellect.

thanks for any help
-illiro
05-18-2007, 01:14 PM#2
Vexorian
Intellect?

You'll need to manually increase the damage that is and that mostly involves adding the item damage bonus ability to the hero, but you application is as such that bonusmod is the only sane way to do it.
05-20-2007, 06:13 PM#3
CommanderZ
You can add "takes event" trigger to each unit and do the damage manually using triggers. It is not very difficult, but requres a lot of triggers created on the run.
05-20-2007, 09:35 PM#4
Dil999
If you dont care about MUI, you can do this:
have an ability with 100 levels (youll need more if you plan on increasing over 99) based off Item Attack Damage Bonus +1. Each level should go up, starting with 0 (level 1 = 0, 2 = 1, 3 = 2)
The hero starts off with this, but since level 1 is 0 it wont show anything. Every second or so, set RealInteger equal to the heros intellegence * .15 or whatever. Then set the level of damage bonus to the result + 1.
05-20-2007, 09:48 PM#5
wyrmlord
Quote:
Originally Posted by Vexorian
bonusmod is the only sane way to do it.
I think it would be a good idea to use Vex's advice. Bonus mod allows you to add bonuses very easily by calling only a single function. Might take a little bit of time to set it up, but it's worth it.

As for detecting when to update the bonus, I'd have a trigger that periodically goes off every second or so that checks for a change in the hero's intelligence. If there is one, adjust the damage or armor.
05-20-2007, 11:21 PM#6
Hydrolisk
Auto-Fill is your answer for the Object Editor part.
Do Dill's thing but use Auto-Fill (search, if you don't know what it is).

As for triggers, every second check the % of your Hero's INT (probably should set your Hero to a Global Variable), convert that to an integer, and use that integer as the level for the +DMG ability.
-
For your armour thing, and suggest making a dummy ability that at level 1, increases armour by 0, and level 2 is +1 armour, and yeah. (Auto-Fill!)

Every second, check the % of your Hero's armour (remember, use a variable), convert that number to an integer, and use that integer as the level of your dummy +DEF ability. Then, get the dummy to cast!
-
Auto-Fill will help, especially if these bonuses are expected to be above 5 levels.

Don't forget polishings and such...
05-21-2007, 01:50 PM#7
Bloodlust
I have an active ability similar to what you need, here is the line i use to add the damage and show it:

variables used:
warmaiden = my hero
keen edge = active buff ability based on frenzy

As you can see lvl-1 = 1x agility and every level adds x.25
This trigger is activated / deactivated with other triggers

Trigger:
Keen Edge 3
Collapse Events
Unit - A unit Is attacked
Collapse Conditions
(Attacking unit) Equal to Warmaiden
Collapse Actions
Unit - Cause Warmaiden to damage (Attacked unit), dealing ((0.75 + (0.25 x (Real((Level of Keen Edge for Warmaiden))))) x (Real((Agility of Warmaiden (Include bonuses))))) damage of attack type Hero and damage type Normal
Floating Text - Create floating text that reads ((String((Integer(((0.75 + (0.25 x (Real((Level of Keen Edge for Warmaiden))))) x (Real((Agility of Warmaiden (Include bonuses))))))))) + !) above (Attacking unit) with Z offset 20.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees

What you need to do is this: make a dummy ability (i suggest an aura that works only on self) and then make the event as above and use the condition "attacking unit has buff 'your dummy aura' equal to true".
then the action i used with the values you need. Add the floating text for style reasons if you like.

- Incon
05-21-2007, 01:59 PM#8
Toink
Quote:
Originally Posted by Hydrolisk
Do Dill's thing but use Auto-Fill

Are you out of your mind? Do you even know how much that could increase loading time?

And what is this "bonusmod" and where can I find it?
05-21-2007, 04:43 PM#9
hldzhuzhu
(not good at english,so.............)
Quote:
I have an active ability similar to what you need, here is the line i use to add the damage and show it:

variables used:
warmaiden = my hero
keen edge = active buff ability based on frenzy

As you can see lvl-1 = 1x agility and every level adds x.25
This trigger is activated / deactivated with other triggers
well ,you use "PlayerUnitAttackedEvent",what happens when you order
your hero to attack an unit,then you press "S" ,
trigger with PlayerUnitAttackedEvent will alse run.


Collapse JASS:
// Trigger: attack
function Trig_attack_Conditions takes nothing returns boolean
    if ( not ( GetUnitAbilityLevelSwapped('A000', GetEventDamageSource()) > 0 ) ) then
        return false
    endif
    return true
endfunction
function Trig_attack_Actions takes nothing returns nothing
    local texttag demage
    call DisableTrigger( GetTriggeringTrigger() )
    call UnitDamageTargetBJ( GetEventDamageSource(), GetTriggerUnit(), I2R(GetHeroStatBJ(bj_HEROSTAT_INT, GetEventDamageSource(), true)), ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL )
    set demage=CreateTextTagUnitBJ( I2S(GetHeroStatBJ(bj_HEROSTAT_AGI, GetEventDamageSource(), true)), GetTriggerUnit(), 0, 10, 100, 0.00, 0.00, 0 )
    call SetTextTagVelocityBJ( demage, 45, 90 )
    call SetTextTagPermanentBJ( demage, false )
    call SetTextTagLifespanBJ( demage, 1.0 )
    call PolledWait(1)
    call DestroyTextTag(demage)
    call DisableTrigger(GetTriggeringTrigger())
    call DestroyTrigger(GetTriggeringTrigger())
endfunction 
// Trigger: look
function Trig_look_Actions takes nothing returns nothing
    local trigger attack
    set attack=CreateTrigger()
    call TriggerRegisterUnitEvent( attack, GetEventTargetUnit(), EVENT_UNIT_DAMAGED )
    call TriggerAddCondition(attack,Condition(function Trig_attack_Conditions))
    call TriggerAddAction(attack,function Trig_attack_Actions)
endfunction
//start.
function Trig_start_Conditions takes nothing returns boolean
    if ( GetLearnedSkillBJ() == 'A000') then
        return true
    else
        return false
    endif
endfunction
function Trig_start_Actions takes nothing returns nothing
    local trigger look
    set look=CreateTrigger()
    call TriggerRegisterUnitEvent( look, GetTriggerUnit(), EVENT_UNIT_TARGET_IN_RANGE )
    call TriggerAddAction(look,function Trig_look_Actions)
endfunction
function InitTrig_start takes nothing returns nothing
    set gg_trg_start = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_start, EVENT_PLAYER_HERO_SKILL )
    call TriggerAddCondition( gg_trg_start, Condition( function Trig_start_Conditions ) )
    call TriggerAddAction( gg_trg_start, function Trig_start_Actions )
endfunction

05-21-2007, 07:51 PM#10
Dil999
I have one spell with 100 levels, which supports all damage bonuses in my game. It does increase loading time, but it makes the map a helluva lto easier when you just say 'add Damage Bonus'
Set level of 'Damage Bonus' to X + 1
05-21-2007, 08:05 PM#11
blu_da_noob
Blade's item system has bonus mod in it: http://www.wc3campaigns.net/showthread.php?t=85909 .

It basically means you only need to use log n ability for a bonus of n.