HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Need Help with some Pasive spells.

10-05-2007, 02:23 PM#1
xmas92
First a pasive spell that gives a unit X% Block Chans to block Y Dmg

Now a pasive spell that reduce the Max and Min Dmg with X and incress the heros hp with Y hp

Last a Pasive spell that gives a hero a str bonus thats X times hes curent str (base and plus str)

Thx for your help =)
10-05-2007, 02:51 PM#2
Castlemaster
As far as I can tell, all these spells will need to be triggered. The good news is I don't think they will be difficult to trigger.

1) Unless someone knows another way, this will require a damage detection and damage modification system. When a unit is attacked, get a random integer to see if the block will activate. If it does, use damage detection and modification to reduce that damage by Y
2) I would try making a command aura with negative values (shift+double click), then use a disabled spellbook (look in our tutorials) to add a +hp ability.
3) Once again, use a disabled spellbook to add the strength.
10-05-2007, 02:57 PM#3
Captain Griffen
1) Hardened Skin does that.
10-05-2007, 06:05 PM#4
xmas92
Okey 2 questions what Ability should i base the +hp ans str spells on (or should i use jass triggers)

Could use some examples if you sugest Jass :)
10-05-2007, 07:17 PM#5
xmas92
Tryed this
Collapse JASS:
function Sylvas_Heart_SB_ID takes nothing returns integer
    return S2I("A002")
endfunction
function Sylvas_Spellbook_ID takes nothing returns integer
    return S2I("A003")
endfunction
function Sylvas_Heart_ID takes nothing returns integer
    return S2I("A004")
endfunction
function Learn_Actions takes nothing returns nothing
    local integer sba  = Sylvas_Heart_SB_ID()
    local integer s = Sylvas_Heart_ID()
    local integer sb = Sylvas_Spellbook_ID()
    if GetLearnedSkillLevel() >= 1 and GetLearnedSkill() == s then
    call UnitRemoveAbility(GetTriggerUnit(), GetLearnedSkill())
    call UnitAddAbility(GetLearningUnit(), sba)
    call UnitMakeAbilityPermanent(GetTriggerUnit() ,false , sb)
    call UnitMakeAbilityPermanent(GetTriggerUnit() ,false , sb)
    call BJDebugMsg("IT WORKED!!!")       //Not =(
endif
    call BJDebugMsg("IT DIDENT WORKED!!!")       //Not =(
endfunction

function InitTrig_Sylvas_Heart takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_HERO_SKILL)
    call TriggerAddAction(t, function Learn_Actions)
endfunction

but dident quite work maby not understand the trigger but...

i did disable the magics
Collapse JASS:
function Trig_Init_map_Copy_Actions takes nothing returns nothing
    call SetPlayerAbilityAvailableBJ( false, 'A003', Player(0) )
    call SetPlayerAbilityAvailableBJ( false, 'A002', Player(0) )
endfunction

//===========================================================================
function InitTrig_Init_map_Copy takes nothing returns nothing
    set gg_trg_Init_map_Copy = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Init_map_Copy, function Trig_Init_map_Copy_Actions )
endfunction


Please help me :P
10-05-2007, 08:11 PM#6
Captain Griffen
You don't disable the ability in the dummy spellbook, just the dummy spellbook.
10-05-2007, 08:24 PM#7
TaintedReality
And, here:

Collapse JASS:
function Sylvas_Heart_SB_ID takes nothing returns integer
    return S2I("A002")
endfunction
function Sylvas_Spellbook_ID takes nothing returns integer
    return S2I("A003")
endfunction
function Sylvas_Heart_ID takes nothing returns integer
    return S2I("A004")
endfunction

It should just return 'A002', etc. Rather than S2I("A002").
10-05-2007, 08:41 PM#8
xmas92
Ye but i got tons of errors so used a String to Integer
10-05-2007, 08:57 PM#9
TaintedReality
But it won't work!
10-05-2007, 09:42 PM#10
xmas92
But do anyone have a idea about how i add a Passive HP+ spell and the X times heros Str spell??
10-10-2007, 09:41 AM#11
Chop_tomato
for the 3rd one, the +strength ability, you could make an ability based of the item ability strength bonus (not sure what its called), with lots of levels starting at one strength and going up one each level.

then you could make a trigger to get the X*current strength as an interger (or a real and then convert to int, not sure what works best) and set the level of the +strength ability for that unit to the number. the +strength ability would have to be in a disabled spellbook with a placeholder ability that the hero actually learns.

hope this helped, made an account here just to post it.