#feed choice confirmation
character_event = {
    id = vampires.4001
    is_triggered_only = yes

    title = EVTTITLEvampires.4001
    picture = GFX_evt_vampires_feed
    desc = {
        trigger = {
            FROM = {
                vampires_is_obviously_unhealthy = no
            }
        }
        text = EVTDESCAvampires.4001
    }
    desc = {
        trigger = {
            FROM = {
                vampires_is_obviously_unhealthy = yes
            }
        }
        text = EVTDESCBvampires.4001
    }

    immediate = {
        FROM = {
            #save event target so that it would be available for the follow up events
            save_event_target_as = feeding_target
        }        
    }

    option = {
        name = EVTOPTAvampires.4001
        trigger = {
            ai = no #AI should not go back on the decision to feed. disable the choice entirelly not to interfare with the other 0 preference choice.
        }
        #Nothing happens
    }

    option = {
        name = EVTOPTBvampires.4001
        trigger = {
            vampires_is_strong = yes
            FROM = {
                vampires_is_obviously_unhealthy = no
                prisoner = no
            }
        }
        tooltip_info = combat_rating 

        random_list = {
            96 = {
                modifier = {
                    factor = 0.25
                    vampires_is_at_home = no
                }
                modifier = {
                    factor = 0.25
                    vampires_is_at_home_realm = no
                }
                #success
                custom_tooltip = {
                    text  = TT_vampires.4001_success
                    character_event = {
                        id = vampires.4006
                    }
                }
            }
            1 = {
                #victim about to die
                custom_tooltip = {
                    text  = TT_vampires.4001_victim_dies
                    character_event = {
                        id = vampires.3001
                    }
                    set_character_flag = vampires_suspicious_behaviour
                }
            }
            1 = {
                #Just a slim chance no matter how tough the victim is
                #victim fights and escapes 
                custom_tooltip = {
                    text  = TT_vampires.4001_victim_fights
                    character_event = {
                        id = vampires.4011
                    }
                    set_character_flag = vampires_suspicious_behaviour
                }
            }
            1 = {
                modifier = {
                    factor = 43 #roughtly 1/3 to happen
                    FROM = {
                        vampires_victim_might_see_it_coming = yes
                    }
                }
                #victim notices you and escapes
                custom_tooltip = {
                    text  = TT_vampires.4001_victim_evades
                    character_event = {
                        id = vampires.4013
                    }
                    set_character_flag = vampires_suspicious_behaviour
                }
            }
            1 = {
                modifier = {
                    factor = 43 #roughtly 1/3 to happen
                    FROM = {
                        vampires_is_feeding_taboo = yes
                    }
                }
                #interupted by others
                custom_tooltip = {
                    text  = TT_vampires.4001_victim_interrupted
                    character_event = {
                        id = vampires.4015
                    }
                    set_character_flag = vampires_suspicious_behaviour
                }
            }
        }
    }
    option = {
        name = EVTOPTCvampires.4001
        trigger = {
            vampires_is_diplomatic = yes
            FROM = {
                vampires_is_obviously_unhealthy = no
                prisoner = no
            }
        }
        tooltip_info = diplomacy 

        random_list = {
            96 = {
                modifier = {
                    factor = 0.25
                    vampires_is_at_home = no
                }
                modifier = {
                    factor = 0.25
                    vampires_is_at_home_realm = no
                }
                #success
                custom_tooltip = {
                    text  = TT_vampires.4001_success
                    character_event = {
                        id = vampires.4006
                    }
                }
            }
            1 = {
                #victim about to die
                custom_tooltip = {
                    text  = TT_vampires.4001_victim_dies
                    character_event = {
                        id = vampires.3001
                    }
                    set_character_flag = vampires_suspicious_behaviour
                }
            }
            1 = {
                modifier = {
                    factor = 43 #roughtly 1/3 to happen
                    FROM = {
                        vampires_victim_might_resist = yes
                    }
                }
                #victim fights and escapes 
                custom_tooltip = {
                    text  = TT_vampires.4001_victim_fights
                    character_event = {
                        id = vampires.4011
                    }
                    set_character_flag = vampires_suspicious_behaviour
                }
            }
            1 = {
                modifier = {
                    factor = 43 #roughtly 1/3 to happen
                    FROM = {
                        vampires_victim_might_see_it_coming = yes
                    }
                }
                #victim notices you and escapes
                custom_tooltip = {
                    text  = TT_vampires.4001_victim_evades
                    character_event = {
                        id = vampires.4013
                    }
                    set_character_flag = vampires_suspicious_behaviour
                }
            }
            1 = { 
                #only a small chance of happening despite target being taboo
                #interupted by others
                custom_tooltip = {
                    text  = TT_vampires.4001_victim_interrupted
                    character_event = {
                        id = vampires.4015
                    }
                    set_character_flag = vampires_suspicious_behaviour
                }
            }
        }
    }
    option = {
        name = EVTOPTDvampires.4001
        trigger = {
            vampires_is_cunning = yes
            FROM = {
                vampires_is_obviously_unhealthy = no
                prisoner = no
            }
        }
        tooltip_info = intrigue 

        random_list = {
            96 = {
                modifier = {
                    factor = 0.25
                    vampires_is_at_home = no
                }
                modifier = {
                    factor = 0.25
                    vampires_is_at_home_realm = no
                }
                #success
                custom_tooltip = {
                    text  = TT_vampires.4001_success
                    character_event = {
                        id = vampires.4006
                    }
                }
            }
            1 = {
                #victim about to die
                custom_tooltip = {
                    text  = TT_vampires.4001_victim_dies
                    character_event = {
                        id = vampires.3001
                    }
                    set_character_flag = vampires_suspicious_behaviour
                }
            }
            1 = {
                modifier = {
                    factor = 43 #roughtly 1/3 to happen
                    FROM = {
                        vampires_victim_might_resist = yes
                    }
                }
                #victim fights and escapes 
                custom_tooltip = {
                    text  = TT_vampires.4001_victim_fights
                    character_event = {
                        id = vampires.4011
                    }
                    set_character_flag = vampires_suspicious_behaviour
                }
            }
            1 = {
                #only a small chance even if victim has high intrigue
                #victim notices you and escapes
                custom_tooltip = {
                    text  = TT_vampires.4001_victim_evades
                    character_event = {
                        id = vampires.4013
                    }
                    set_character_flag = vampires_suspicious_behaviour
                }
            }
            1 = {
                modifier = {
                    factor = 43 #roughtly 1/3 to happen
                    FROM = {
                        vampires_is_feeding_taboo = yes
                    }
                }
                #interupted by others
                custom_tooltip = {
                    text  = TT_vampires.4001_victim_interrupted
                    character_event = {
                        id = vampires.4015
                    }
                    set_character_flag = vampires_suspicious_behaviour
                }
            }
        }
    }
    option = {
        name = EVTOPTFvampires.4001
        trigger = {
            FROM = { vampires_is_obviously_unhealthy = no }
            OR = {
                AND = {#either no better options
                    vampires_is_strong = no
                    vampires_is_diplomatic= no
                    vampires_is_cunning = no
                } #or is a prisoner
                FROM = { prisoner = yes }
            }

        }

        ai_chance = { factor = 0 } #AI should go for other options first.

        random_list = {
            96 = {
                modifier = {
                    factor = 0.25
                    vampires_is_at_home = no
                }
                modifier = {
                    factor = 0.25
                    vampires_is_at_home_realm = no
                }
                #success
                custom_tooltip = {
                    text  = TT_vampires.4001_success
                    character_event = {
                        id = vampires.4006
                    }
                }
            }
            1 = {
                #victim about to die
                custom_tooltip = {
                    text  = TT_vampires.4001_victim_dies
                    character_event = {
                        id = vampires.3001
                    }
                    set_character_flag = vampires_suspicious_behaviour
                }
            }
            1 = {
                modifier = {
                    #prisoner does not resist
                    factor = 0
                    FROM = {
                        prisoner = yes
                    }
                }
                modifier = {
                    factor = 43 #roughtly 1/3 to happen
                    FROM = {
                        vampires_victim_might_resist = yes
                    }
                }
                #victim fights and escapes 
                custom_tooltip = {
                    text  = TT_vampires.4001_victim_fights
                    character_event = {
                        id = vampires.4011
                    }
                    set_character_flag = vampires_suspicious_behaviour
                }
            }
            1 = {
                modifier = {
                    #prisoner does not resist
                    factor = 0
                    FROM = {
                        prisoner = yes
                    }
                }
                modifier = {
                    factor = 43 #roughtly 1/3 to happen
                    FROM = {
                        vampires_victim_might_see_it_coming = yes
                    }
                }
                #victim notices you and escapes
                custom_tooltip = {
                    text  = TT_vampires.4001_victim_evades
                    character_event = {
                        id = vampires.4013
                    }
                    set_character_flag = vampires_suspicious_behaviour
                }
            }
            1 = {
                modifier = {
                    #prisoner does not resist
                    factor = 0
                    FROM = {
                        prisoner = yes
                    }
                }
                modifier = {
                    factor = 43 #roughtly 1/3 to happen
                    FROM = {
                        vampires_is_feeding_taboo = yes
                    }
                }
                #interupted by others
                custom_tooltip = {
                    text  = TT_vampires.4001_victim_interrupted
                    character_event = {
                        id = vampires.4015
                    }
                    set_character_flag = vampires_suspicious_behaviour
                }
            }
        }
    }

    #victim seriously sick choices
    option = {
        name = EVTOPTEvampires.4001
        trigger = {
            FROM = {
                vampires_is_obviously_unhealthy = yes
            }
            vampires_is_educated = yes
        }
        tooltip_info = learning 

        random_list = {
            66 = {
                #success
                custom_tooltip = {
                    text  = TT_vampires.4001_success
                    character_event = {
                        id = vampires.4006
                    }
                }
            }
            33 = {
                #victim about to die
                custom_tooltip = {
                    text  = TT_vampires.4001_victim_dies
                    character_event = {
                        id = vampires.3001
                    }
                    set_character_flag = vampires_suspicious_behaviour
                }
            }
        }
    }
    option = {
        name = EVTOPTFvampires.4001
        trigger = {
            FROM = { vampires_is_obviously_unhealthy = yes }
            vampires_is_educated =  no
        }

        ai_chance = { factor = 0 } #AI should go for other options first.

        random_list = {
            33 = {
                #success
                custom_tooltip = {
                    text  = TT_vampires.4001_success
                    character_event = {
                        id = vampires.4006
                    }
                }
            }
            66 = {
                #victim about to die
                custom_tooltip = {
                    text  = TT_vampires.4001_victim_dies
                    character_event = {
                        id = vampires.3001
                    }
                    set_character_flag = vampires_suspicious_behaviour
                }
            }
        }
    }
}

#drained after feeding
character_event = {
    id = vampires.4002
    is_triggered_only = yes
    hide_from = yes

    title = EVTTITLEvampires.4002
    picture = GFX_evt_vampires_drained
    desc = EVTDESCvampires.4002
    option = {
        name = EVTOPTAvampires.4002
    }
    immediate= {
        add_character_modifier = {
            modifier = vampires_drained
            years = 1
        }
    }
}

#dead after feeding
character_event = {
    id = vampires.4003
    is_triggered_only = yes

    title = EVTTITLEvampires.4003
    picture = GFX_evt_vampires_frenzy
    desc = EVTDESCvampires.4003
    option = {
        name = EVTOPTAvampires.4003
    }
    immediate= {
        death = {
            death_reason = death_vanished
            killer = FROM
        }
    }
}

#ping event to chain into vampires.4001 when from other events
character_event = {
    id = vampires.4004
    hide_window = yes
    is_triggered_only = yes

    immediate = {
        FROM = {
            character_event = { id = vampires.4001 }
        }
    }
}

#hunting preference choice
character_event = {
    id = vampires.4005
    is_triggered_only = yes
    hide_from = yes

    title = EVTTITLEvampires.4005
    picture = GFX_evt_vampires_feed
    desc = EVTDESCvampires.4005

    immediate = {
        ROOT = {
            location = {
                save_event_target_as = current_hunt_location
            }
        }
        random_character = {
            limit = {
                vampires_is_valid_feeding_target = yes
                vampires_is_obviously_unhealthy = no
            }
            preferred_limit = {
                vampires_is_feeding_taboo = no
            }
            save_event_target_as = healthy_victim
        }
        random_character = {
            limit = {
                NOT = { character = event_target:healthy_victim }

                vampires_is_valid_feeding_target = yes
                vampires_victim_might_resist = no
            }
            preferred_limit = {
                vampires_is_obviously_unhealthy = no
                vampires_is_feeding_taboo = no
            }
            preferred_limit = {
                vampires_is_feeding_taboo = no
            }
            save_event_target_as = weak_victim
        }
        random_character = {
            limit = {
                NOT = { character = event_target:healthy_victim }
                NOT = { character = event_target:weak_victim }

                vampires_is_valid_feeding_target = yes
                vampires_victim_might_see_it_coming = no
            }
            preferred_limit = {
                vampires_is_obviously_unhealthy = no
                vampires_is_feeding_taboo = no
            }
            preferred_limit = {
                vampires_is_feeding_taboo = no
            }
            save_event_target_as = unsuspecting_victim
        }
        random_character = {
            limit = {
                NOT = { character = event_target:healthy_victim }
                NOT = { character = event_target:weak_victim }
                NOT = { character = event_target:unsuspecting_victim }

                vampires_is_valid_feeding_target = yes
                vampires_is_obviously_unhealthy = no
                vampires_is_feeding_taboo = no
            }
            save_event_target_as = ok_victim
        }
        random_character = {
            #only used if no other option available
            limit = {
                vampires_is_valid_feeding_target = yes
            }
            save_event_target_as = last_resort_victim
        }
    }

    option = {
        name = EVTOPTAvampires.4005
        show_portrait = event_target:healthy_victim
        trigger = {
            event_target:healthy_victim = { always = yes }
        }
        event_target:healthy_victim  = {
            #feed ping event
            character_event = {
                id = vampires.4004
            }
        }
        ai_chance = { factor = 100 }
    }

    option = {
        name = EVTOPTBvampires.4005
        show_portrait = event_target:weak_victim
        trigger = {
            event_target:weak_victim = { always = yes }
        }
        event_target:weak_victim  = {
            #feed ping event
            character_event = {
                id = vampires.4004
            }
        }
        ai_chance = { factor = 1 } 
    }

    option = {
        name = EVTOPTCvampires.4005
        show_portrait = event_target:unsuspecting_victim
        trigger = {
            event_target:unsuspecting_victim = { always = yes }
        }
        event_target:unsuspecting_victim  = {
            #feed ping event
            character_event = {
                id = vampires.4004
            }
        }
        ai_chance = { factor = 1 } 
    }

    option = {
        name = EVTOPTDvampires.4005
        show_portrait = event_target:ok_victim
        trigger = {
            event_target:ok_victim = { always = yes }
        }
        event_target:ok_victim  = {
            #feed ping event
            character_event = {
                id = vampires.4004
            }
        }
        ai_chance = { factor = 1 } 
    }

    option = {
        name = EVTOPTEvampires.4005
        show_portrait = event_target:last_resort_victim
        trigger = {
            NOT = { event_target:healthy_victim = { always = yes } }
            NOT = { event_target:weak_victim = { always = yes } }
            NOT = { event_target:unsuspecting_victim = { always = yes } }
            NOT = { event_target:ok_victim = { always = yes } }
            event_target:last_resort_victim = { always = yes }
        }
        event_target:last_resort_victim  = {
            #feed ping event
            character_event = {
                id = vampires.4004
            }
        }
        ai_chance = { factor = 0 } #AI should go for other options first.
    }
}

#feeding - enough or kill choice
character_event = {
    id = vampires.4006
    is_triggered_only = yes
    portrait = event_target:feeding_target

    title = EVTTITLEvampires.4006
    picture = GFX_evt_vampires_feed
    desc = EVTDESCvampires.4006

    option = {
        #enough
        name = EVTOPTAvampires.4006

        reduce_hunger = yes

        event_target:feeding_target = {
            #inform about being drained
            character_event = {
                id = vampires.4002
            }            
        }

        ai_chance = {
            factor = 1
            modifier = {
                factor = 0
                is_maimed_trigger = yes #being maimed should encourage vampire to kill the victim
            }
        }
    }
    option = {
        #kill
        name = EVTOPTBvampires.4006

        reduce_hunger_fully = yes

        #embrace choice
        character_event = {
            id = vampires.3001
        }
        set_character_flag = vampires_suspicious_behaviour

        ai_chance = {
            factor = 1
            modifier = {
                factor = 0
                is_maimed_trigger = no #not maimed AIs should not give npc while feeding
            }
        }
    }
}

#feeding - victim fights and escapes
character_event = {
    id = vampires.4011
    is_triggered_only = yes
    portrait = event_target:feeding_target

    title = EVTTITLEvampires.4011
    picture = GFX_evt_vampires_victim_escapes
    desc = EVTDESCvampires.4011

    option = {
        name = EVTOPTAvampires.4011

        event_target:feeding_target = {
            #inform the victim
            character_event = {
                id = vampires.4012
            }            
        }
    }
}

#feeding - victim fights and escapes - inform the victim
character_event = {
    id = vampires.4012
    is_triggered_only = yes
    hide_from = yes

    title = EVTTITLEvampires.4012
    picture = GFX_evt_vampires_victim_escapes
    desc = EVTDESCvampires.4012

    option = {
        name = EVTOPTAvampires.4012
        add_character_modifier = {
            modifier = vampires_precaution
            months = 1
        }
    }
}

#feeding - victim notices you stalking him and escapes
character_event = {
    id = vampires.4013
    is_triggered_only = yes
    portrait = event_target:feeding_target

    title = EVTTITLEvampires.4013
    picture = GFX_evt_vampires_victim_escapes
    desc = EVTDESCvampires.4013

    option = {
        name = EVTOPTAvampires.4013

        event_target:feeding_target = {
            #inform the victim
            character_event = {
                id = vampires.4014
            }            
        }
    }
}

#feeding - victim notices you stalking him and escapes - inform the victim
character_event = {
    id = vampires.4014
    is_triggered_only = yes
    hide_from = yes

    title = EVTTITLEvampires.4014
    picture = GFX_evt_vampires_victim_escapes
    desc = EVTDESCvampires.4014

    option = {
        name = EVTOPTAvampires.4014
        add_character_modifier = {
            modifier = vampires_precaution
            months = 1
        }
    }
}

#feeding - feeding interupted
character_event = {
    id = vampires.4015
    is_triggered_only = yes
    portrait = event_target:feeding_target

    title = EVTTITLEvampires.4015
    picture = GFX_evt_vampires_feeding_interupted
    desc = EVTDESCvampires.4015

    option = {
        name = EVTOPTAvampires.4015
        
        event_target:feeding_target = {
            #inform the victim
            character_event = {
                id = vampires.4016
            }       
        }
    }
}

#feeding - feeding interupted - inform the victim
character_event = {
    id = vampires.4016
    is_triggered_only = yes

    title = EVTTITLEvampires.4016
    picture = GFX_evt_vampires_feeding_interupted
    desc = EVTDESCvampires.4016

    option = {
        name = EVTOPTAvampires.4016
        add_character_modifier = {
            modifier = vampires_precaution
            months = 1
        }
    }
}