| 
 | 
 
 本帖最后由 swdn 于 2012-10-22 19:04 编辑  
 
Hello. 
 
As you know, the item "Light of the Fireflies" [萤火虫之光] (code 'I07Z') has been remade recently. Now it gives +1.3 mana regen and +14 damage. Also, killing or assisting gives stacks for attack damage. 
 
When I decided to check the script, I've found some interesting things. 
 
It still decreases duration of debuffs by 35%: 
- function DebuffDuration takes unit target, real time returns real
 
 - // . . .
 
 -  
 
 - elseif UnitHasItemOfTypeBJ(target, 'I07Z') then
 
 -     set time = time * 0.65
 
 - endif
 
  
- // . . .
 
 - endfunction
 
 
  复制代码 It reduces stun duration by 25%: 
- function GetUnitControlAllReduce takes unit caster, unit target returns real
 
 - // . . .
 
  
- if UnitHasItemOfTypeBJ(target, 'I07Z') then
 
 -     set timeper = timeper * 0.75
 
 - endif
 
  
- // . . .
 
 - endfunction
 
 
  复制代码 Stats in item database have not changed (does not matter in current version): 
- call ItemRegisterDataDefence('I07Z', 6000, 0, 0, 0, 0, 0, 0, 0)
 
 - call ItemRegisterDataAttack('I07Z', 0, 0, 0, 0, 0, 0)
 
 - call ItemRegisterDataStat('I07Z', 21, 21, 21)
 
 
  复制代码 However, I did not see declarations for this item in functions "GetUnitAttack" and "GetUnitMagicRegen". 
 
How to fix: 
 
- Remove declarations from "DebuffDuration" and "GetUnitControlAllReduce" functions 
 
- Change stats in item database: 
- call ItemRegisterDataDefence('I07Z', 2000, 0, 0, 0, 1.3, 0, 0, 0)
 
 - call ItemRegisterDataAttack('I07Z', 14, 0, 0, 0, 0, 0)
 
 - call ItemRegisterDataStat('I07Z', 0, 0, 0)
 
 
  复制代码 - Add declarations to "GetUnitAttack" and "GetUnitMagicRegen" functions: 
- function GetUnitItemAttackCharges takes unit v, integer itemr returns real
 
 -     local integer i = 0
 
 -     local real attack = 0.0
 
 -     loop
 
 -         if GetItemTypeId(UnitItemInSlot(v, i)) == itemr then
 
 -             set attack = attack + GetItemCharges(UnitItemInSlot(v, i))
 
 -         endif
 
 -         set i = i + 1
 
 -         exitwhen i > 6
 
 -     endloop
 
 -     return attack
 
 - endfunction
 
  
- function GetUnitAttack takes unit v returns integer
 
 - // . . .
 
  
-     set attack = attack + GetUnitItemAttack(v, 'I07Z', 14)
 
 -     set attack = attack + GetUnitItemAttackCharges(v, 'I07Z')
 
  
- // . . .
 
 - endfunction
 
 
  复制代码 
- function GetUnitMagicRegen takes unit v returns real
 
 - // . . .
 
  
-     set regen = regen + GetUnitItemMagicRegen_Single(v, 'I07Z', 1.30)
 
  
- // . . .
 
 - endfunction
 
 
  复制代码 That's all. 
 |   
 
 
 
 |