{$CLEO}

//Electric damage
0000: NOP

0004: 19@ = 40
//
0004: 20@ = 10
0004: 23@ = 1190
0004: 24@ = 50
0004: 26@ = 1

if
    0AAB: file_exists "cleo\electricdamage.ini"
then
    0AF0: 19@ = get_int_from_ini_file "cleo\electricdamage.ini" section "Main" key "Delay"
    0AF0: 20@ = get_int_from_ini_file "cleo\electricdamage.ini" section "Main" key "ObjInt"
    0AF0: 23@ = get_int_from_ini_file "cleo\electricdamage.ini" section "Main" key "SoundID"
    0AF0: 24@ = get_int_from_ini_file "cleo\electricdamage.ini" section "Main" key "Health"
    0AF0: 26@ = get_int_from_ini_file "cleo\electricdamage.ini" section "Main" key "Effect"
end

:main

wait 19@

if and
    0256: player $PLAYER_CHAR defined
    044B: actor $PLAYER_ACTOR on_foot
else_jump @main

//These only work with dynamic or procedural objects
00A0: store_actor $PLAYER_ACTOR position_to 0@ 1@ 2@

//Agressive object search
0004: 13@ = 0
while 001D: 20@ > 13@
    gosub @proc
    if
        0039: 12@ == 1
    then
        0004: 12@ = 0
        jump @main
    end
    000A: 13@ += 1
end

jump @main

0A93: terminate_this_custom_script

:proc
0AE3: 10@ = random_object_near_point 0@ 1@ 2@ in_radius 50.0 find_next 1 //IF and SET

if
    03CA: object 10@ exists
then
else
    return
end

//Has collision - IPL file ones need to be added to object.dat
if or
    09CC: object 10@ model_is 3244 //Pylon
    09CC: object 10@ model_is 3638 //Transformers, etc.
    09CC: object 10@ model_is 3272
    09CC: object 10@ model_is 3273
    09CC: object 10@ model_is 3274
then
    if
        0179: actor $PLAYER_ACTOR colliding_with_object 10@
    then
        0851: set_actor $PLAYER_ACTOR decrease_health_by 24@ affect_armour 0
        if
            8039: not 23@ == 0
        then
            018C: play_sound 23@ at 0.0 0.0 0.0
        end
        if
            8039: not 26@ == 0
        then
            0326: 11@ = create_actor $PLAYER_ACTOR fire
        end
        12@ = 1
        return
    end
end
return