七日杀Mods:公爵雇佣兵

描述

击杀对应丧尸时,给予公爵币。

前置

运行环境:7 Days To Die V1.0(b309)
涉及内容:gameevents.xmlbuffs.xmlLocalization.txt
文件布局:
在这里插入图片描述

编辑 gameevents.xml

gameevents.xml中,追加我们所需要的事件。

<config>
	<append xpath="/gameevents">
		<!-- T0:击杀普通丧尸,给予30-50的公爵币。 -->
		<action_sequence name="agAction_give_casinoCoin_T0">
			<action class="AddItems">
				<property name="added_items" value="casinoCoin" />
				<property name="added_item_counts" value="30-50" />
			</action>
		</action_sequence>

		<!-- T1:击杀凶残丧尸,给予50-100的公爵币。 -->
		<action_sequence name="agAction_give_casinoCoin_T1">
			<action class="AddItems">
				<property name="added_items" value="casinoCoin" />
				<property name="added_item_counts" value="50-100" />
			</action>
		</action_sequence>

		<!-- T2:击杀辐射丧尸,给予100-150的公爵币。 -->
		<action_sequence name="agAction_give_casinoCoin_T2">
			<action class="AddItems">
				<property name="added_items" value="casinoCoin" />
				<property name="added_item_counts" value="100-150" />
			</action>
		</action_sequence>

		<!-- T3:击杀丧尸熊,给予200的公爵币。 -->
		<action_sequence name="agAction_give_casinoCoin_T3">
			<action class="AddItems">
				<property name="added_items" value="casinoCoin" />
				<property name="added_item_counts" value="200" />
			</action>
		</action_sequence>
	</append>
</config>
  • action_sequence:动作序列,包含一系列连续发生的动作;
  • action:将要执行的动作,AddItems向玩家物品栏添加指定数量的物品;

编辑 buffs.xml

buffs.xml中,添加buff,并追加buffStatusCheck01事件中,给玩家添加上buff。

<config>
    <append xpath="/buffs">
        <buff name="agBuffDucalMercenary" name_key="agBuffDucalMercenaryName" description_key="agBuffDucalMercenaryDesc" tooltip_key="agBuffDucalMercenaryTooltip" icon="ui_game_symbol_skull_crusher" remove_on_death="false">
            <stack_type value="ignore"/>
            <display_value_key value="agBuffDucalMercenaryNameShort"/>
            <duration value="0"/>

            <!-- 击杀普通丧尸 -->
            <effect_group>
                <triggered_effect trigger="onSelfKilledOther" action="CallGameEvent" event="agAction_give_casinoCoin_T0" allow_client_call="true">
                    <requirement name="EntityTagCompare" target="other" tags="zombie"/>
                    <requirement name="!EntityTagCompare" target="other" tags="feral"/>
                    <requirement name="!EntityTagCompare" target="other" tags="radiated"/>
                    <requirement name="!EntityTagCompare" target="other" tags="animal"/>
                </triggered_effect>
            </effect_group>
            <!-- 击杀凶残丧尸 -->
            <effect_group>
                <triggered_effect trigger="onSelfKilledOther" action="CallGameEvent" event="agAction_give_casinoCoin_T1" allow_client_call="true">
                    <requirement name="EntityTagCompare" target="other" tags="zombie"/>
                    <requirement name="EntityTagCompare" target="other" tags="feral"/>
                    <requirement name="!EntityTagCompare" target="other" tags="radiated"/>
                    <requirement name="!EntityTagCompare" target="other" tags="animal"/>
                </triggered_effect>
            </effect_group>
            <!-- 击杀辐射丧尸 -->
            <effect_group>
                <triggered_effect trigger="onSelfKilledOther" action="CallGameEvent" event="agAction_give_casinoCoin_T2" allow_client_call="true">
                    <requirement name="EntityTagCompare" target="other" tags="zombie"/>
                    <requirement name="EntityTagCompare" target="other" tags="radiated"/>
                    <requirement name="!EntityTagCompare" target="other" tags="animal"/>
                </triggered_effect>
            </effect_group>
            <!-- 击杀动物丧尸 -->
            <effect_group>
                <triggered_effect trigger="onSelfKilledOther" action="CallGameEvent" event="agAction_give_casinoCoin_T0" allow_client_call="true">
                    <requirement name="EntityTagCompare" target="other" tags="zombie"/>
                    <requirement name="EntityTagCompare" target="other" tags="animal"/>
                    <requirement name="!EntityTagCompare" target="other" tags="bear"/>
                </triggered_effect>
            </effect_group>
            <!-- 击杀丧尸熊 -->
            <effect_group>
                <triggered_effect trigger="onSelfKilledOther" action="CallGameEvent" event="agAction_give_casinoCoin_T3" allow_client_call="true">
                    <requirement name="EntityTagCompare" target="other" tags="zombie"/>
                    <requirement name="EntityTagCompare" target="other" tags="animal"/>
                    <requirement name="EntityTagCompare" target="other" tags="bear"/>
                </triggered_effect>
            </effect_group>
        </buff>
    </append>

    <!-- 追加Buff -->
    <append xpath="/buffs/buff[@name='buffStatusCheck01']">
        <effect_group>
            <triggered_effect trigger="onSelfBuffUpdate" action="AddBuff" target="self" buff="agBuffDucalMercenary">
                <requirement name="!HasBuff" buff="agBuffDucalMercenary"/>
            </triggered_effect>
        </effect_group>
    </append>
</config>
  • stack_type:buff效果是否可以叠加,ignore不可叠加;
  • duration:buff效果持续时间,0表示无限,最大值为214748364秒;
  • triggered_effect:触发器,onSelfKilledOther击杀他人(包含玩家自身以外的所有实体类)时CallGameEvent调用事件;EntityTagCompare判断击杀对象Tags属性是否包含对应值,可在entityclasses.xml中查看;
  • buffStatusCheck01:七日杀中定义的检查buff状态的事件,onSelfBuffUpdate自身buff刷新时,AddBuff追加buff给self自身,前提条件是!HasBuff不存在指定buff。
  • allow_client_call:允许客户端调用;

编辑 Localization.txt

Localization.txt中,编写对应数据,实现本土化翻译。

Key,File,Type,UsedInMainMenu,NoTranslate,english,Context / Alternate Text,german,spanish,french,italian,japanese,koreana,polish,brazilian,russian,turkish,schinese,tchinese
agBuffDucalMercenaryName,buffs,buff,,,,,,,,,,,,,,,公爵雇佣兵,
agBuffDucalMercenaryDesc,buffs,bufss,,,,,,,,,,,,,,,你受公爵雇佣,击杀丧尸可获得公爵的赏赐,越凶猛的丧尸,赏赐越丰厚。,
agBuffDucalMercenaryTooltip,buffs,bufss,,,,,,,,,,,,,,,已成为公爵的雇佣兵,
agBuffDucalMercenaryNameShort,buffs,bufss,,,,,,,,,,,,,,,雇佣兵,
  • 25
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值