HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Spell stat bonus problem

03-04-2006, 11:44 AM#1
Jiminiyainoda
Ok, im here again with another problem.
Im making a spell based on a stat bonus.
It gives +10% stat bonus to a target hero.

I have the trigger

Trigger:
Actions
-------- Local's --------
Custom script: local unit Trigger
Custom script: local unit Target
Custom script: local integer Int
Custom script: local integer TriggerLevel
Custom script: local integer TargetStrength
Custom script: local integer TargetAgility
Custom script: local integer TargetIntelligence
-------- Check for Active Spell --------
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Target unit of ability being cast) has buff Blessing of Kings ) Equal to True
Collapse Then - Actions
Unit - Remove Blessing of Kings buff from (Target unit of ability being cast)
Skip remaining actions
Else - Actions
-------- Set Local's --------
Custom script: set Trigger = GetTriggerUnit()
Custom script: set Target = GetSpellTargetUnit()
Custom script: set TriggerLevel = GetUnitAbilityLevelSwapped( 'A000', Trigger )
Custom script: set TargetStrength = GetHeroStatBJ(bj_HEROSTAT_STR, Target, false)
Custom script: set TargetAgility = GetHeroStatBJ(bj_HEROSTAT_AGI, Target, false)
Custom script: set TargetIntelligence = GetHeroStatBJ(bj_HEROSTAT_INT, Target, false)
-------- Strength --------
Custom script: set Int = TargetStrength
Custom script: set Int = (Int / 100 * (TriggerLevel * 10))
Custom script: call UnitAddAbilityBJ( 'A001', Target )
Custom script: call SetUnitAbilityLevelSwapped( 'A001', Target, Int )
-------- Agility --------
Custom script: set Int = TargetAgility
Custom script: set Int = (Int / 100 * (TriggerLevel * 10))
Custom script: call UnitAddAbilityBJ( 'A002', Target )
Custom script: call SetUnitAbilityLevelSwapped( 'A002', Target, Int )
-------- Intelligence --------
Custom script: set Int = TargetIntelligence
Custom script: set Int = (Int / 100 * (TriggerLevel * 10))
Custom script: call UnitAddAbilityBJ( 'A003', Target )
Custom script: call SetUnitAbilityLevelSwapped( 'A003', Target, Int )
-------- End Spell --------
Wait 30.00 seconds
Custom script: call UnitRemoveAbilityBJ( 'A001', Target )
Custom script: call UnitRemoveAbilityBJ( 'A002', Target )
Custom script: call UnitRemoveAbilityBJ( 'A003', Target )
Custom script: set Trigger = null
Custom script: set Target = null
Custom script: set Int = 0
Custom script: set TriggerLevel = 0
Custom script: set TargetStrength = 0
Custom script: set TargetAgility = 0
Custom script: set TargetIntelligence = 0

I have the ability attribute bonus, with 100 levels, (yes thats stupid and laggy)
But i have 3 attibute bonus's 1 for str, 1 for agil, and 1 for intel.
I dont understand why it dosent give 10% to a target hero though

Il send a little map with the spell in, cause nobody wants to spend 1 hour of their life making the bonus's

Blessing of Kings test.w3x
Attached Files
File type: w3xBlessing of Kings test.w3x (24.5 KB)
03-04-2006, 01:35 PM#2
Vexorian
The custom scripts you are using are poison, over use of lame BJ functions not to mention the hybrid usage of GUI and JASS which always is a mess.

But well I don't see any reason at all to use attribute bonus, Because there actually are native functions that allow you to modiffy stats
03-04-2006, 01:39 PM#3
Captain Griffen
Item stat bonuses only do level 1. The hero one won't stack with itself, probably.
03-04-2006, 03:56 PM#4
Jiminiyainoda
Yea i know theres natives, but i want it to show as +stat bonus, not merge with the other stat bonus. Like this ( Strenght - 60 + 4) i want it to show where the 4 is, and not merge with the 60.
The 3 abilitys stack, but dont work how i want them too.
This spell wont be in any of my maps, im just testing and learning.