Jump to content

Coding Help, Offmap powers


zia

Recommended Posts

So I have begun coding for Darkworld: Slavery Expanded's off map empire and I have reached a road block I am in desperate need of help with. I have stared at this code enough to go cross eyed and want to chuck my laptop at the wall.

 

Below are both the offmap power and a decision that is goofing up. The empire is working, mostly. (One extra hostile button that does nothing :I) The real issue is the decision, its supposed to let you sell slaves for grace. That works, ot atleast it did when I used offmap_china instead of my empire. The issue is it keeps checking the TANG Empire (China) for isolationist policies instead of my empire's. There is no mention of policies in the code or even china at this point (except a few from_china's that I will remove later) 

 

Any Help would be appreciated! 

 

Spoiler

offmap_dwse = {
    name = dwseforest
    window_name = dwse_offmaps_window
    button_name = icon_offmaps_entry
    currency_name = TXT_GRACE
    currency_gain = monthly_grace
    currency_reset_on_dynasty_change = yes
    holder_title = title_dwse_emperor            # minor title used to identify a character as holder of this offmap power
    governor_title = e_offmap_dwse_voice 
    tier = emperor
    non_aggression_modifier = peace_deal_with_dwsw
    coa_religion = pagan
    government = confucian_bureaucracy
    beginning_of_history = 618.6.18
    sound = china_interaction_interface
    display_trigger = {
        has_dlc = "Jade Dragon"
    }
    policies = {
        china_open
        china_expansionist
    }
    statuses = {
        china_stable
        china_unrest
        china_civil_war
        china_mongol_invasion
        china_jurchen_invasion
        china_famine
        china_plague
        china_golden_age
    }
    buttons = {
    
        dwse_gifts = {
            is_active_trigger = {
                always = yes
            }
            display_trigger = {                                # When the button is visible at all. Same scopes as the active trigger
                always = yes
            }
        }
        dwse_boons = {
            is_active_trigger = {
                china_offmap_boon_decisions_enabled_trigger = yes
            }
        }
        dwse_hostility = {
            is_active_trigger = {
                china_offmap_hostile_decisions_enabled_trigger = yes
            }
            display_trigger = {
                NOT = { offmap_dwse= { offmap_ruler = { dynasty = FROM } } }
            }
        }
        dwse_hostility2 = {
            display_trigger = {
                always = no
            }
        }
    }
    
    #These conditions only effect the appearance of the button, it does not actually disable them from being clickable. The same triggers are used in all tribute/boon decisions respectively
    
    icon_triggers = {
        china_physician_cd = {
            frame = 9
            trigger = {
                hidden_tooltip = {
                    has_character_flag = chinese_grace_physician_sent
                }
            }
        }
        china_raid_cd = {
            frame = 8
            right = yes    
            trigger = {
                hidden_tooltip = {
                    has_character_modifier = china_raid_grace_cd
                }
            }
        }
        china_famine_cd = {
            frame = 7
            trigger = {
                hidden_tooltip = {
                    has_character_modifier = china_send_relief
                }
            }
        }
        china_tributary_cd = {
            frame = 6
            trigger = {
                hidden_tooltip = {
                    has_character_modifier = chinese_grace_tributary_timer
                }
            }
        }
        china_boon_cd = {
            frame = 5
            right = yes    
            trigger = {
                hidden_tooltip = {
                    has_character_modifier = jd_china_boon_cd
                }
            }
        }
        china_commander_cd = {
            frame = 4
            trigger = {
                hidden_tooltip = {
                    has_character_modifier = chinese_grace_send_commander_timer
                }
            }
        }
        china_eunuch_cd = {
            frame = 3
            trigger = {
                hidden_tooltip = {
                    has_character_modifier = chinese_grace_send_eunuch_timer
                }
            }
        }
        china_concubine_cd = {
            frame = 2
            trigger = {
                hidden_tooltip = {
                    has_character_modifier = chinese_grace_send_concubine_timer
                }
            }
        }
        china_gift_cd = {
            frame = 1
            trigger = {
                hidden_tooltip = {
                    has_character_modifier = chinese_grace_send_gift_timer
                }
            }
        }
    }
    
    monthly_currency_gain = {
        offmap_same_dynasty = {
            value = 10
            offmap_china = { offmap_ruler = { dynasty = FROM } }
        }
        offmap_war_with_me = {
            value = -10
            war_with = FROM
        }
        offmap_likes_me = {
            value = 1
            FROM = { is_liked_by_China_trigger = yes }
            is_within_diplo_range = FROM
        }
        offmap_likes_tributaries = {
            value = 2
            offmap_china = {            
                offmap_has_like = likes_tributaries
            }
            FROM = {
                is_tributary = {
                    type = offmap
                }
            }
        }
        vassal_of_WP = {
            value = 2
            FROM = {
                liege = {
                    has_landed_title = e_offmap_dwse_voice 
                }
            }
        }
        offmap_same_culture_and_religion = {
            value = 2
            offmap_ruler = {
                culture = FROM
                religion = FROM
            }
            is_within_diplo_range = FROM
        }
    }
    
    temple_names = {
        { # Founder names
            Gaozu
            Taizu
            Shizu
            Zhaozu
            Jingzu
            Xianzu
            Liezu
            Chengzu
        }
        { # Successor names
            Zhenzong
            Renzong
            Zhongzong
            Yingzong
            Shenzong
            Zhezhong
            Huizong
            Qinzong
            Xiaozong
            Guangzong
            Ningzong
            Lizong
            Duzong
            Duanzong
            Xuanzong
            Suzong
            Daizong
            Muzong
            Jingzong
            Wenzong
            Wuzong
            Zhaozong
            Xizong
            Xuanzong
            Shizong
            Zhangzong
            Ruizong
            Dingzong
            Xianzong
            Chengzong
            Mingzong
            Jinzong
            Yizong
            Xiangzong
            Huanzong
            Chongzong
            Daozong
            Liezong
            Aizong
            Zhangzong
            Dezong
            Shengzong
            Xingzong
            Kangzong
            Zhuangzong
            Pingzong
            Sizong
            Anzong
            Yangzong
            Shangzong
            Shunzong
            Zhizong
            Chuangzong
            Shaozong
            Gongzong
            Yingzong
        }
    }
    holder_succession = {
        is_female = {                    # chances of getting a female holder, as a percentage: if the total is >= 100, the new holder will always be female. If the total is <= 0, the new holder will always be male
            value = 5
            additive_modifier = {
                value = 45
                has_game_rule = {
                    name = gender
                    value = all
                }
            }
        }
        culture = {
            bear = { # default culture for new emperor
                value = 99 # if any other value reaches 100, it will be picked instead
            }
            FROM = { # default culture for new emperor
                                # the left side here (and for culture, religion, graphical_culture and dynasty) can be a right hand side value (FROM, ROOT, a culture name, etc). and the right hand side / inside the brackets is a standard MTTH evaluation. Only the one with the highest weight will be used. If there's a tie, one of the tied values is picked at random
                value = 0
                additive_modifier = { #the new emperor will keep current culture if things are great
                    value = 100
                    #china_is_fine_trigger = yes
                    FROM = { culture_scope = { always = yes } } # Essentially a check that the previous emperor actually exists
                }
            }
        }

        graphical_culture = { 
            FROM = {
                value = 100
            }
        }

        religion = {
            pagan = { # default religion for new emperor
                value = 99 # if any other value reaches 100, it will be picked instead (unless equal, then it will randomize)
            }
            FROM = {
                value = 0
                additive_modifier = { # the new emperor will keep current religion if things are great
                    value = 100
                    #china_is_fine_trigger = yes
                    FROM = { religion_scope = { always = yes } } # Essentially a check that the previous emperor actually exists
                }
            }
        }

        dynasty = {
            FROM = { #default dynasty for new emperor
                value = 99 #might drop from modifiers -- highest value will be picked instead (unless equal, then it will randomize)
            }
            actually_culture = {
                value = 0
                additive_modifier = {
                    value = 100
                    NOT = { FROM = { character = yes } }
                }
                additive_modifier = { #Fix for simulating Chinese history on old save boot-up
                    value = 100
                    random < 12
                    has_game_started = no
                }
            }
        }
        
        likes = {
            likes_concubines = {
                value = 300
                modifier = {
                    factor = 0.1
                    FROMFROM = { is_female = yes }
                }
            }
            likes_eunuchs = {
                value = 300
            }
            likes_wealth = {
                value = 300
            }
            likes_tributaries = {
                value = 100
            }
            likes_indians = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            culture_group = indo_aryan_group
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
            }
            likes_dravidians = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            culture_group = dravidian_group
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
            }
            likes_tibetans = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            culture_group = tibetan_group
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
            }
            
            likes_germanics = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            likes_germanics = yes
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
            }
            likes_latino_iberians = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            likes_latino_iberians = yes
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
            }
            likes_byzantines = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            likes_byzantines = yes
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
            }
            likes_celts = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            likes_celts = yes
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
            }
            likes_finno_ugrics = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            likes_finno_ugrics = yes
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
            }
            likes_altaics = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            likes_altaics = yes
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
            }
            likes_balto_slavics = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            likes_balto_slavics = yes
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
            }
            likes_arabs = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            likes_arabs = yes
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
            }
            likes_iranians = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            likes_iranians = yes
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
            }
            likes_africans = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            likes_africans = yes
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
            }
            likes_mesoamericans = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            likes_mesoamericans = yes
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
            }
            
            likes_muslims = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            religion_group = muslim
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0.5
                    FROMFROM = { religion_group = muslim }
                }
            }
            likes_christians = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            religion_group = christian
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0.5
                    FROMFROM = { religion_group = christian }
                }
            }
            likes_jews = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            religion_group = jewish_group
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0.5
                    FROMFROM = { likes_jews = yes }
                }
            }
            likes_zoroastrians = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            religion = zoroastrian
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0.5
                    FROMFROM = { religion = zoroastrian }
                }
            }
            likes_mazdakis = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            religion = mazdaki
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0.5
                    FROMFROM = { religion = mazdaki }
                }
            }
            likes_manicheans = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            religion = manichean
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0.5
                    FROMFROM = { religion = manichean }
                }
            }
            likes_khurmaztans = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            religion = khurmazta
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0.5
                    FROMFROM = { religion = khurmazta }
                }
            }
            likes_buddhists = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            religion = buddhist
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0.5
                    FROMFROM = { religion = buddhist }
                }
            }
            likes_hindus = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            religion = hindu
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0.5
                    FROMFROM = { religion = hindu }
                }
            }
            likes_jains = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            religion = jain
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0.5
                    FROMFROM = { religion = jain }
                }
            }
            likes_tengris = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            likes_tengris = yes
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0.5
                    FROMFROM = { likes_tengris = yes }
                }
            }
            likes_zunists = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            likes_zunists = yes
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0.5
                    FROMFROM = { likes_zunists = yes }
                }
            }
            likes_bon = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            likes_bon = yes
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0.5
                    FROMFROM = { likes_bon = yes }
                }
            }
        }
        
        dislikes = {
            likes_concubines = {
                value = 100
                modifier = {
                    factor = 5.0
                    FROMFROM = { is_female = yes }
                }
            }
            likes_eunuchs = {
                value = 100
            }
            likes_tributaries = {
                value = 100
            }
            likes_wealth = {
                value = 100
            }
            likes_indians = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            culture_group = indo_aryan_group
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0
                    FROMFROM = {
                        culture_group = indo_aryan_group
                    }
                }
            }
            likes_dravidians = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            culture_group = dravidian_group
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0
                    FROMFROM = {
                        culture_group = dravidian_group
                    }
                }
            }
            likes_tibetans = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            culture_group = tibetan_group
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0
                    FROMFROM = {
                        culture_group = tibetan_group
                    }
                }
            }
            likes_germanics = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            likes_germanics = yes
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0
                    FROMFROM = {
                        likes_germanics = yes
                    }
                }
            }
            likes_latino_iberians = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            likes_latino_iberians = yes
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0
                    FROMFROM = {
                        likes_latino_iberians = yes
                    }
                }
            }
            likes_byzantines = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            likes_byzantines = yes
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0
                    FROMFROM = {
                        likes_byzantines = yes
                    }
                }
            }
            likes_celts = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            likes_celts = yes
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0
                    FROMFROM = {
                        likes_celts = yes
                    }
                }
            }
            likes_finno_ugrics = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            likes_finno_ugrics = yes
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0
                    FROMFROM = {
                        likes_finno_ugrics = yes
                    }
                }
            }
            likes_altaics = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            likes_altaics = yes
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0
                    FROMFROM = {
                        likes_altaics = yes
                    }
                }
            }
            likes_balto_slavics = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            likes_balto_slavics = yes
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0
                    FROMFROM = {
                        likes_balto_slavics = yes
                    }
                }
            }
            likes_arabs = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            likes_arabs = yes
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0
                    FROMFROM = {
                        likes_arabs = yes
                    }
                }
            }
            likes_iranians = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            likes_iranians = yes
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0
                    FROMFROM = {
                        likes_iranians = yes
                    }
                }
            }
            likes_africans = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            likes_africans = yes
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0
                    FROMFROM = {
                        likes_africans = yes
                    }
                }
            }
            likes_mesoamericans = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            likes_mesoamericans = yes
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0
                    FROMFROM = {
                        likes_mesoamericans = yes
                    }
                }
            }
            likes_muslims = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            religion_group = muslim
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0
                    FROMFROM = { religion_group = muslim }
                }
            }
            likes_christians = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            religion_group = christian
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0
                    FROMFROM = { religion_group = christian }
                }
            }
            likes_jews = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            religion_group = jewish_group
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0
                    FROMFROM = { religion_group = jewish_group }
                }
            }
            likes_mazdans = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            religion_group = zoroastrian_group
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0
                    FROMFROM = { religion_group = zoroastrian_group }
                }
            }
            likes_buddhists = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            religion = buddhist
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0
                    FROMFROM = { religion = buddhist }
                }
            }
            likes_hindus = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            religion = hindu
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0
                    FROMFROM = { religion = hindu }
                }
            }
            likes_jains = {
                value = 25
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            religion = jain
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0
                    FROMFROM = { religion = jain }
                }
            }
            likes_tengris = {
                value = 100
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            likes_tengris = yes
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0
                    FROMFROM = { likes_tengris = yes }
                }
            }
            likes_zunists = {
                value = 5
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            likes_zunists = yes
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0
                    FROMFROM = { likes_zunists = yes }
                }
            }
            likes_bon = {
                value = 10
                modifier = {
                    factor = 0
                    NOT = {
                        any_province = {
                            likes_bon = yes
                            is_within_diplo_range = offmap_china
                        }
                    }
                }
                modifier = {
                    factor = 0
                    FROMFROM = { likes_bon = yes }
                }
            }
        }
    }
    
    diplomatic_range = { #Already includes the western governor's "normal" diplo range
        OR = {
            has_game_rule = {
                name = chinese_interactions
                value = all
            }
            top_liege = {
                suzerain = {
                    has_landed_title = e_offmap_dwse_voice 
                }
            }
            any_neighbor_independent_ruler = {
                OR = {
                    has_landed_title = e_offmap_dwse_voice 
                    suzerain = {
                        has_landed_title = e_offmap_dwse_voice 
                    }
                }
            }
            any_realm_province = { #Is within reach of the silk road
                OR = {
                    trade_route = silk_road

                    region = world_steppe_east
                    region = world_himalayas
                    region = world_india
                    region = world_persia
                    has_building = dwse_slave_port_c
                }
            }
        }
    }
}

Spoiler

offmap_decisions = {
    chinese_grace_offer_slave = {
        only_playable = yes
        button_name = dwse_gifts
        
        third_party_filter = home_court
        ai_third_party_filter = home_court
        third_party = FROM
        ai_check_interval = 36
        show_third_party_potential = yes

        potential = {
            is_offmap_tag = offmap_dwse    
        }
    
        from_potential = {
            has_dlc = "Jade Dragon"
            mercenary = no
            holy_order = no
            is_landed = yes
        }

        allow = {
            show_only_failed_conditions = yes
            offmap_dwse= {
            }
            FROM = {
                show_scope_change = no
                custom_tooltip = {
                    text = chinese_grace_send_gift_allow_tt 
                    NOT = { has_character_modifier = chinese_grace_send_gift_timer}
                }
                prisoner = no
                NOT = { trait = incapable }
                is_inaccessible_trigger = no
            }
            # china_offmap_decisions_enabled_trigger = yes #leave in please, to be used if the tooltip for china_offmap_tribute_decisions_enabled_trigger changes and we need to reference things uniquely again
            china_offmap_tribute_decisions_enabled_trigger = yes
        }
        
        third_party_potential = {
            show_only_failed_conditions = yes
            FROMFROM = {
                show_scope_change = no

                is_adult = yes
                trait = branded_slave
                is_heir = no
                NOT = { is_landed = yes }
                custom_tooltip = {
                    text = is_not_from_china_tt
                    courtier_from_china_trigger = no
                }
                custom_tooltip = {
                    text = is_not_incapable_inbred_or_imbecile_tt
                    NOT = { trait = incapable }
                    NOT = { trait = inbred }
                    NOT = { trait = imbecile }
                }
                custom_tooltip = {
                    text = is_not_maimed_or_infirm_tt
                    NOT = { trait = maimed }
                    NOT = { trait = infirm }
                }

                NOT = { prisoner = yes }
                
            }
        }

        third_party_allow = {
            show_only_failed_conditions = yes
            FROMFROM = {
                is_ill = no
                custom_tooltip = {
                    text = is_not_wounded_severely_injured_tt
                    NOT = { trait = wounded }
                    NOT = { trait = severely_injured }
                }
                is_inaccessible_trigger = no
            }
        }
        
        third_party_score = {
            factor = 100
            
            additive_modifier = {
                value = 20
                FROMFROM = { 
                    show_scope_change = no
                    martial = 12                    
                    hidden_trigger = {
                        NOT = { martial = 14 }
                    }
                }
            }
            additive_modifier = {
                value = 40
                FROMFROM = { 
                    show_scope_change = no
                    martial = 14                    
                    hidden_trigger = {
                        NOT = { martial = 16 }
                    }
                }
            }
            additive_modifier = {
                value = 60
                FROMFROM = {
                    show_scope_change = no 
                    martial = 16                
                    hidden_trigger = {
                        NOT = { martial = 18 }
                    }
                }
            }
            additive_modifier = {
                value = 20
                FROMFROM = { 
                    show_scope_change = no
                    diplomacy = 8                    
                    hidden_trigger = {
                        NOT = { diplomacy = 12 }
                    }
                }
            }
            additive_modifier = {
                value = 40
                FROMFROM = { 
                    show_scope_change = no
                    diplomacy = 12                    
                    hidden_trigger = {
                        NOT = { diplomacy = 16 }
                    }
                }
            }
            additive_modifier = {
                value = 75
                FROMFROM = { 
                    show_scope_change = no
                    diplomacy = 16                
                    hidden_trigger = {
                        NOT = { diplomacy = 20 }
                    }
                }
            }
            additive_modifier = {
                value = 120
                FROMFROM = { 
                    show_scope_change = no
                    diplomacy = 20
                }
            }
            additive_modifier = {
                value = 20
                FROMFROM = { 
                    show_scope_change = no
                    martial = 8                    
                    hidden_trigger = {
                        NOT = { martial = 12 }
                    }
                }
            }
            additive_modifier = {
                value = 40
                FROMFROM = { 
                    show_scope_change = no
                    martial = 12                    
                    hidden_trigger = {
                        NOT = { martial = 16 }
                    }
                }
            }
            additive_modifier = {
                value = 75
                FROMFROM = { 
                    show_scope_change = no
                    martial = 16                
                    hidden_trigger = {
                        NOT = { martial = 20 }
                    }
                }
            }
            additive_modifier = {
                value = 120
                FROMFROM = { 
                    show_scope_change = no
                    martial = 20
                }
            }
            additive_modifier = {
                value = 20
                FROMFROM = { 
                    show_scope_change = no
                    stewardship = 8                    
                    hidden_trigger = {
                        NOT = { stewardship = 12 }
                    }
                }
            }
            additive_modifier = {
                value = 40
                FROMFROM = { 
                    show_scope_change = no
                    stewardship = 12                    
                    hidden_trigger = {
                        NOT = { stewardship = 16 }
                    }
                }
            }
            additive_modifier = {
                value = 75
                FROMFROM = { 
                    show_scope_change = no
                    stewardship = 16                
                    hidden_trigger = {
                        NOT = { stewardship = 20 }
                    }
                }
            }
            additive_modifier = {
                value = 120
                FROMFROM = { 
                    show_scope_change = no
                    stewardship = 20
                }
            }
            additive_modifier = {
                value = 20
                FROMFROM = { 
                    show_scope_change = no
                    intrigue = 8                    
                    hidden_trigger = {
                        NOT = { intrigue = 12 }
                    }
                }
            }
            additive_modifier = {
                value = 40
                FROMFROM = { 
                    show_scope_change = no
                    intrigue = 12                    
                    hidden_trigger = {
                        NOT = { intrigue = 16 }
                    }
                }
            }
            additive_modifier = {
                value = 75
                FROMFROM = { 
                    show_scope_change = no
                    intrigue = 16                
                    hidden_trigger = {
                        NOT = { intrigue = 20 }
                    }
                }
            }
            additive_modifier = {
                value = 120
                FROMFROM = { 
                    show_scope_change = no
                    intrigue = 20
                }
            }
            additive_modifier = {
                value = 20
                FROMFROM = { 
                    show_scope_change = no
                    learning = 8                    
                    hidden_trigger = {
                        NOT = { learning = 12 }
                    }
                }
            }
            additive_modifier = {
                value = 40
                FROMFROM = { 
                    show_scope_change = no
                    learning = 12                    
                    hidden_trigger = {
                        NOT = { learning = 16 }
                    }
                }
            }
            additive_modifier = {
                value = 75
                FROMFROM = { 
                    show_scope_change = no
                    learning = 16                
                    hidden_trigger = {
                        NOT = { learning = 20 }
                    }
                }
            }
            additive_modifier = {
                value = 120
                FROMFROM = { 
                    show_scope_change = no
                    learning = 20
                }
            }
            additive_modifier = {
                value = 80
                FROMFROM = { 
                    show_scope_change = no
                    trait = fair
                }
            }
            additive_modifier = {
                value = -80
                FROMFROM = { 
                    show_scope_change = no
                    trait = ugly
                }
            }
            additive_modifier = {
                value = 40
                FROMFROM = { 
                    show_scope_change = no
                    trait = genius
                }
            }
            additive_modifier = {
                value = 30
                FROMFROM = { 
                    show_scope_change = no
                    trait = quick
                }
            }
            additive_modifier = {
                value = 40
                FROMFROM = { 
                    show_scope_change = no
                    trait = strong
                }
            }
            additive_modifier = {
                value = 30
                FROMFROM = {
                    show_scope_change = no
                    trait = robust
                }
            }
            additive_modifier = {
                value = 30
                FROMFROM = {
                    show_scope_change = no
                    trait = shrewd
                }
            }
            additive_modifier = {
                value = 30
                FROMFROM = {
                    show_scope_change = no
                    trait = charitable
                }
            }
            additive_modifier = {
                value = 30
                FROMFROM = {
                    show_scope_change = no
                    trait = gregarious
                }
            }
            additive_modifier = {
                value = 30
                FROMFROM = {
                    show_scope_change = no
                    trait = kind
                }
            }
            additive_modifier = {
                value = -50
                FROMFROM = {
                    show_scope_change = no
                    trait = lunatic
                }
            }
            additive_modifier = {
                value = 25
                custom_tooltip = {
                    text = tribute_interaction_level3_education_tt
                    FROMFROM = { 
                        OR = {
                            trait = intricate_webweaver
                            trait = charismatic_negotiator
                            trait = fortune_builder
                            trait = skilled_tactician
                            trait = scholarly_theologian
                        }
                    }
                }
            }
            additive_modifier = {
                value = 50
                custom_tooltip = {
                    text = tribute_interaction_level4_education_tt
                    FROMFROM = { 
                        OR = {
                            trait = elusive_shadow
                            trait = grey_eminence
                            trait = midas_touched
                            trait = brilliant_strategist
                            trait = mastermind_theologian
                        }
                    }
                }
            }

            additive_modifier = {
                value = 80
                FROMFROM = {
                    show_scope_change = no 
                    martial = 18                
                    hidden_trigger = {
                        NOT = { martial = 20 }
                    }
                }
            }
            additive_modifier = {
                value = 100
                FROMFROM = {
                    show_scope_change = no 
                    martial = 20                
                    hidden_trigger = {
                        NOT = { martial = 22 }
                    }
                }
            }
            additive_modifier = {
                value = 120
                FROMFROM = {
                    show_scope_change = no 
                    martial = 22                
                    hidden_trigger = {
                        NOT = { martial = 24 }
                    }
                }
            }
            additive_modifier = {
                value = 140
                FROMFROM = { 
                    show_scope_change = no
                    martial = 24
                }
            }
            additive_modifier = {
                value = 40
                FROMFROM = { 
                    show_scope_change = no
                    trait = genius
                }
            }
            additive_modifier = {
                value = 30
                FROMFROM = { 
                    show_scope_change = no
                    trait = quick
                }
            }
            additive_modifier = {
                value = 40
                FROMFROM = { 
                    show_scope_change = no
                    trait = strong
                }
            }
            additive_modifier = {
                value = 30
                FROMFROM = {
                    show_scope_change = no
                    trait = robust
                }
            }
            additive_modifier = {
                value = 30
                FROMFROM = {
                    show_scope_change = no
                    trait = shrewd
                }
            }
            additive_modifier = {
                value = 40
                FROMFROM = { 
                    show_scope_change = no
                    trait = strategist
                }
            }
            additive_modifier = {
                value = 40
                FROMFROM = { 
                    show_scope_change = no
                    trait = duelist
                }
            }
            additive_modifier = {
                value = 20
                FROMFROM = { 
                    show_scope_change = no
                    trait = hunter
                }
            }
            additive_modifier = {
                value = 100
                FROMFROM = { 
                    show_scope_change = no
                    trait = berserker
                }
            }
            additive_modifier = {
                value = 40
                FROMFROM = { 
                    show_scope_change = no
                    trait = adventurer
                }
            }
            additive_modifier = {
                value = 20
                FROMFROM = { 
                    show_scope_change = no
                    trait = patient
                }
            }
            additive_modifier = {
                value = 20
                FROMFROM = { 
                    show_scope_change = no
                    trait = brave
                }
            }
            additive_modifier = {
                value = 20
                FROMFROM = { 
                    show_scope_change = no
                    trait = diligent
                }
            }
            additive_modifier = {
                value = 40
                FROMFROM = { 
                    show_scope_change = no
                    trait = shieldmaiden
                }
            }
        
            additive_modifier = {
                value = 50
                FROMFROM = { 
                    show_scope_change = no
                    trait = sapper
                }
            }
            additive_modifier = {
                value = 50
                FROMFROM = { 
                    show_scope_change = no
                    trait = master_of_flame
                }
            }
            additive_modifier = {
                value = 50
                FROMFROM = { 
                    show_scope_change = no
                    trait = logistics_expert
                }
            }
            additive_modifier = {
                value = 50
                FROMFROM = { 
                    show_scope_change = no
                    trait = levy_coordinator
                }
            }
            
            additive_modifier = {
                value = 40
                FROMFROM = { 
                    show_scope_change = no
                    trait = light_foot_leader
                }
            }
            additive_modifier = {
                value = 40
                FROMFROM = { 
                    show_scope_change = no
                    trait = heavy_infantry_leader
                }
            }
            additive_modifier = {
                value = 40
                FROMFROM = { 
                    show_scope_change = no
                    trait = cavalry_leader
                }
            }
            additive_modifier = {
                value = 40
                FROMFROM = { 
                    show_scope_change = no
                    trait = inspiring_leader
                }
            }
            additive_modifier = {
                value = 40
                FROMFROM = { 
                    show_scope_change = no
                    trait = trickster
                }
            }
            additive_modifier = {
                value = 40
                FROMFROM = { 
                    show_scope_change = no
                    trait = organizer
                }
            }
            additive_modifier = {
                value = 40
                FROMFROM = { 
                    show_scope_change = no
                    trait = defensive_leader
                }
            }
            additive_modifier = {
                value = 40
                FROMFROM = { 
                    show_scope_change = no
                    trait = experimenter
                }
            }
            additive_modifier = {
                value = 40
                FROMFROM = { 
                    show_scope_change = no
                    trait = flanker
                }
            }
            additive_modifier = {
                value = 40
                FROMFROM = { 
                    show_scope_change = no
                    trait = aggressive_leader
                }
            }
            additive_modifier = {
                value = 40
                FROMFROM = { 
                    show_scope_change = no
                    trait = siege_leader
                }
            }
            additive_modifier = {
                value = 100
                FROMFROM = { 
                    show_scope_change = no
                    trait = neko
                }
            }
            additive_modifier = {
                value = 100
                FROMFROM = { 
                    show_scope_change = no
                    trait = werewolf
                }
            }
            additive_modifier = {
                value = 100
                FROMFROM = { 
                    show_scope_change = no
                    trait = futa
                }
            }
            additive_modifier = {
                value = 100
                FROMFROM = { 
                    show_scope_change = no
                    trait = vampire
                }
            }
            additive_modifier = {
                value = 100
                FROMFROM = { 
                    show_scope_change = no
                    trait = elf
                }
            }
            additive_modifier = {
                value = 100
                FROMFROM = { 
                    show_scope_change = no
                    trait = orc
                }
            }
                        additive_modifier = {
                value = 40
                FROMFROM = { 
                    show_scope_change = no
                    is_female = yes
                }
            }

            additive_modifier = {
                value = 25
                custom_tooltip = {
                    text = tribute_interaction_level3_education_tt
                    FROMFROM = { 
                        trait = skilled_tactician
                    }
                }
            }
            additive_modifier = {
                value = 50
                custom_tooltip = {
                    text = tribute_interaction_level4_education_tt
                    FROMFROM = { 
                        trait = brilliant_strategist
                    }
                }
            }
            modifier = {
                factor = 2.0
                FROMFROM = { 
                    show_scope_change = no
                    liked_by_offmap = {
                        type = offmap_dwse
                    }
                }
            }
            modifier = {
                factor = 0.5
                FROMFROM = {
                    show_scope_change = no 
                    disliked_by_offmap = {
                        type = offmap_dwse
                    }
                }
            }
            modifier = {
                factor = 1.5
                FROM = { 
                    show_scope_change = no
                    liked_by_offmap = {
                        type = offmap_dwse
                    }
                }
            }
            modifier = {
                factor = 0.66
                FROM = {
                    show_scope_change = no 
                    disliked_by_offmap = {
                        type = offmap_dwse
                    }
                }
            }
        }
    
        effect = {
            save_event_target_as = target_governor
            FROM = {
                sound_effect = china_grace_gain
                save_event_target_as = target_tribute_sender
            }
            FROMFROM = {
                save_event_target_as = person_sent_as_tribute
            }
            #if = {
            #    limit = {
            #        FROMFROM = { disliked_by_offmap = offmap_dwse}
            #    }
            #    custom_tooltip = { text = notification_china_dislike_tt }
            #}
            #if = {
            #    limit = {
            #        NOT = { FROMFROM = { disliked_by_offmap = offmap_dwse} }
            #        FROMFROM = { liked_by_offmap = offmap_dwse}
            #    }
            #    custom_tooltip = { text = notification_china_like_tt }
            #}
            FROM = {
                show_scope_change = no
                add_offmap_currency = {
                    offmap = offmap_dwse
                    value = local_third_party_score
                }
            }
            
            # Like/Dislike effect description
            #################################
            if = {
                limit = {
                    OR = {
                        FROM = {
                            liked_by_offmap = {
                                type = offmap_dwse
                            }
                        }
                        FROMFROM = {
                            liked_by_offmap = {
                                type = offmap_dwse
                            }
                        }
                    }
                    NOR = {
                        FROM = {
                            disliked_by_offmap = {
                                type = offmap_dwse
                            }
                        }
                        FROMFROM = {
                            disliked_by_offmap = {
                                type = offmap_dwse
                            }
                        }
                    }
                }
                e_offmap_dwse_voice = {
                    show_scope_change = no
                    offmap_power = {
                        show_scope_change = no
                        custom_tooltip = { text = likes_tt }
                    }
                }
            }
            
            if = {
                limit = {
                    OR = {
                        FROM = {
                            disliked_by_offmap = {
                                type = offmap_dwse
                            }
                        }
                        FROMFROM = {
                            disliked_by_offmap = {
                                type = offmap_dwse
                            }
                        }
                    }
                    NOR = {
                        FROM = {
                            liked_by_offmap = {
                                type = offmap_dwse
                            }
                        }
                        FROMFROM = {
                            liked_by_offmap = {
                                type = offmap_dwse
                            }
                        }
                    }
                }
                e_offmap_dwse_voice= {
                    show_scope_change = no
                    offmap_power = {
                        show_scope_change = no
                        custom_tooltip = { text = dislikes_tt }
                    }
                }
            }
            if = {
                limit = {
                    OR = {
                        FROM = {
                            liked_by_offmap = {
                                type = offmap_dwse
                            }
                        }
                        FROMFROM = {
                            liked_by_offmap = {
                                type = offmap_dwse
                            }
                        }
                    }
                    OR = {
                        FROM = {
                            disliked_by_offmap = {
                                type = offmap_dwse
                            }
                        }
                        FROMFROM = {
                            disliked_by_offmap = {
                                type = offmap_dwse
                            }
                        }
                    }
                }
                e_offmap_dwse_voice= {
                    show_scope_change = no
                    offmap_power = {
                        show_scope_change = no
                        custom_tooltip = { text = likes_but_dislikes_tt }
                    }
                }
            }
            #################################
            
            FROMFROM = {
                show_scope_change = no
                leave_court_for_china_effect = yes
            }
            hidden_effect = {
                FROM = {
                    add_character_modifier = {
                        modifier = chinese_grace_send_gift_timer
                        hidden = yes
                        days = 100
                    }
                    if = {
                        limit = { local_third_party_score_low_trigger = yes }
                        set_character_flag = sent_bad_tribute
                    }
                    if = {
                        limit = { local_third_party_score_medium_trigger = yes }
                        set_character_flag = sent_decent_tribute
                    }
                    if = {
                        limit = { local_third_party_score_great_trigger = yes }
                        set_character_flag = sent_great_tribute
                    }
                    letter_event = { id = JD.10050 days = 5 random = 2 }
                }
            }
        }
    
        revoke_allowed = {
            always = no
        }
    
        ai_will_do = {
            factor = 1
            modifier = {
                factor = 0.3 # slow down
            }
        }
    }
}

 

Now I am going to go do other things for a bit to save my sanity and then have another crack at this myself.

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use