- Joined
- Feb 22, 2006
- Messages
- 752
Can't you just replace the jasshelper.exe?
(2 ratings)
I must wait for an update to JNGPS then. >.>
scope Critical initializer onInit
private constant real CRIT_CHANCE
private function actions takes EventDamage eventDamage returns nothing
if GetRandomReal(0., 1.) <= CRIT_CHANCE then
set eventDamage.damage = eventDamage.damage * BONUS_DMG
endif
endfunction
private function onInit takes nothing returns nothing
call DamageEngine_OnAnyUnitDamageEvent(actions)
endfunction
struct HealHealer extends Healer
static HealType ht
method getHealType takes unit attacker, unit target returns HealType
return .ht
endmethod
method isTarget takes unit attacker, unit target returns boolean
return IsUnitAlly(target, GetOwningPlayer(attacker))
endmethod
static method onInit takes nothing returns nothing
set .ht = HealType.create()
call .ht.addFlag(HEAL_TYPE_POTION)
endmethod
endstruct
function LFPotionUser takes real min, real max, unit healer, unit healed returns nothing
call PotHeal.healTargetForced(healer, healed, GetRandomReal(min, max))
call DestroyEffect(AddSpecialEffectTarget( VHSeffectLF, healed, "origin"))
endfunction
private function ReplenishPotionUserByPotionExec takes nothing returns nothing
if GetItemTypeId(GetManipulatedItem()) == 'I011' then
call LFPotionUser(100.00, 200.00, GetTriggerUnit(), GetTriggerUnit())
elseif GetItemTypeId(GetManipulatedItem()) == 'I012' then
call LFPotionUser(200.00, 300.00, GetTriggerUnit(), GetTriggerUnit())
elseif GetItemTypeId(GetManipulatedItem()) == 'I013' then
call LFPotionUser(300.00, 400.00, GetTriggerUnit(), GetTriggerUnit())
endif
if GetItemTypeId(GetManipulatedItem()) == 'I01U' then
call MFPotionUser(100.00, 200.00, GetTriggerUnit(), GetTriggerUnit())
elseif GetItemTypeId(GetManipulatedItem()) == 'I01W' then
call MFPotionUser(200.00, 300.00, GetTriggerUnit(), GetTriggerUnit())
elseif GetItemTypeId(GetManipulatedItem()) == 'I01X' then
call MFPotionUser(300.00, 400.00, GetTriggerUnit(), GetTriggerUnit())
endif
endfunction
return
//....
if GetItemTypeId(GetManipulatedItem()) == 'I011' then
call LFPotionUser(100.00, 200.00, GetTriggerUnit(), GetTriggerUnit())
return
elseif GetItemTypeId(GetManipulatedItem()) == 'I012' then
//....
Thanks, when will it be?In several hours, I'll post the code for you