描述
击杀对应丧尸时,给予公爵币。
前置
运行环境:7 Days To Die V1.0(b309)
涉及内容:gameevents.xml
,buffs.xml
,Localization.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,,,,,,,,,,,,,,,雇佣兵,