diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/EventType.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/EventType.java index 8f1e6372d..8343f0d03 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/EventType.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/EventType.java @@ -93,6 +93,7 @@ public class EventType { public static final int thirtyThree = 33; public static final int thirtyFour = 34; public static final int thirtyFive = 35; + public static final int thirtySix = 36; public static final int updatePonintEvent = 1; public static final int fightEvent = 2; diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/behavior/ThirtySexBehavior.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/behavior/ThirtySexBehavior.java new file mode 100644 index 000000000..9358a81b5 --- /dev/null +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/behavior/ThirtySexBehavior.java @@ -0,0 +1,27 @@ +package com.ljsd.jieling.handler.map.behavior; + +import com.ljsd.jieling.handler.map.EventType; +import com.ljsd.jieling.logic.dao.root.User; +import com.ljsd.jieling.protocols.MapInfoProto; +import com.ljsd.jieling.util.ItemUtil; + +import java.util.Arrays; + +public class ThirtySexBehavior extends BaseBehavior{ + @Override + public int getBehaviorType() { + return EventType.thirtySix; + } + + @Override + public boolean process(int optionId, User user, int[][] behaviorTypeValues, MapInfoProto.EventUpdateResponse.Builder eventUpdateResponse) throws Exception { + int[][] ints = Arrays.copyOfRange(behaviorTypeValues, 1, behaviorTypeValues.length); + boolean isEnough = ItemUtil.itemCost(user, ints); + if (!isEnough) { + return isEnough; + } + BehaviorUtil.updateMission(user, eventUpdateResponse); + BehaviorUtil.destoryPoint(user, 0, behaviorTypeValues[0][0]); + return true; + } +}