获得卡牌跑马灯
parent
58e335b60e
commit
2f2d597546
|
@ -7,7 +7,7 @@ public interface BIReason {
|
|||
int DECOMPOS_ITEM_REWARD = 3 ;//分解道具奖励
|
||||
int DECOMPOS_EQUIP_REWARD = 4 ;//分解道具奖励
|
||||
int DECOMPOS_HERO_REWARD = 5;//分解妖灵师获取奖励
|
||||
int COMPOS_HERO_REWARD = 6 ;//分解妖灵师获取奖励
|
||||
int COMPOS_HERO_REWARD = 6 ;//合成妖灵师
|
||||
|
||||
int HERO_RANDOM = 7 ;//抽卡
|
||||
|
||||
|
|
|
@ -42,4 +42,9 @@ public interface Global {
|
|||
//返回状态
|
||||
int USER_NO_EXIT_STATE = 10000; // 玩家不存在
|
||||
int NO_FIND_ONESELF_STATE = 10001; // 不能查找自己
|
||||
|
||||
|
||||
//跑马灯状态
|
||||
int LUCKY_LUCK = 1; //吉运
|
||||
int DILIGENT = 2; //勤勉
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ import com.ljsd.jieling.protocols.HeroInfoProto;
|
|||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.util.*;
|
||||
import com.sun.org.apache.regexp.internal.RE;
|
||||
import org.omg.CORBA.PUBLIC_MEMBER;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -1150,16 +1151,9 @@ public class HeroLogic {
|
|||
.newBuilder()
|
||||
.setDrop(drop)
|
||||
.build();
|
||||
List<CommonProto.Hero> heroList = drop.getHeroList();
|
||||
CommonProto.Hero hero = heroList.get(0);
|
||||
int heroId = hero.getHeroId();
|
||||
SCHero scHero = SCHero.getsCHero().get(heroId);
|
||||
String quality = getQuality(scHero.getNatural());
|
||||
String message = SErrorCodeEerverConfig.getI18NMessage("lamp_lottery_synthesize_content",new Object[]{playerInfoManager.getNickName(), quality,scHero.getReadingName()});
|
||||
ChatLogic.getInstance().sendSysChatMessage(message,1,heroId,0,0,0,0,0);
|
||||
MessageUtil.sendMessage(iSession,1,msgId,heroComposeResponse,true); }
|
||||
|
||||
private String getQuality(int natural) {
|
||||
public String getQuality(int natural) {
|
||||
String quality = "N";
|
||||
switch (natural){
|
||||
case 2:
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.ljsd.jieling.util;
|
||||
|
||||
import com.ljsd.jieling.chat.logic.ChatLogic;
|
||||
import com.ljsd.jieling.config.*;
|
||||
import com.ljsd.jieling.core.GlobalsDef;
|
||||
import com.ljsd.jieling.core.VipPrivilegeType;
|
||||
|
@ -10,6 +11,7 @@ import com.ljsd.jieling.handler.map.MapManager;
|
|||
import com.ljsd.jieling.handler.map.TemporaryItems;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.logic.mail.MailLogic;
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.protocols.CommonProto;
|
||||
|
@ -684,7 +686,7 @@ public class ItemUtil {
|
|||
}
|
||||
continue;
|
||||
}
|
||||
addCard(user, entry.getKey(),heroList);
|
||||
addCard(user, entry.getKey(),heroList,reason);
|
||||
}
|
||||
}
|
||||
if (reward.length() > 0) {
|
||||
|
@ -694,12 +696,24 @@ public class ItemUtil {
|
|||
dropBuilder.addAllHero(heroList);
|
||||
}
|
||||
|
||||
public static void addCard(User user,int cardId,List<CommonProto.Hero> heroList) throws Exception {
|
||||
public static void addCard(User user,int cardId,List<CommonProto.Hero> heroList,int reason) throws Exception {
|
||||
HeroManager heroManager = user.getHeroManager();
|
||||
PlayerManager playerInfoManager = user.getPlayerInfoManager();
|
||||
int[] heroStar = SItem.getsItemMap().get(cardId).getHeroStar();
|
||||
Hero hero = new Hero(user.getId(),heroStar[0],heroStar[1]);
|
||||
heroManager.addHero(hero);
|
||||
heroList.add(CBean2Proto.getHero(hero));
|
||||
String message = "";
|
||||
SCHero scHero = SCHero.getsCHero().get(hero.getTemplateId());
|
||||
if (scHero.getNatural() >= 3) {
|
||||
String quality = HeroLogic.getInstance().getQuality(scHero.getNatural());
|
||||
if (reason == BIReason.COMPOS_HERO_REWARD) {
|
||||
message = SErrorCodeEerverConfig.getI18NMessage("lamp_lottery_synthesize_content", new Object[]{playerInfoManager.getNickName(), quality, scHero.getReadingName()});
|
||||
} else if (reason == BIReason.HERO_RANDOM) {
|
||||
message = SErrorCodeEerverConfig.getI18NMessage("lamp_lottery_recruit_content", new Object[]{playerInfoManager.getNickName(), quality, scHero.getReadingName()});
|
||||
}
|
||||
ChatLogic.getInstance().sendSysChatMessage(message,Global.LUCKY_LUCK,hero.getTemplateId(),0,0,0,0,0);
|
||||
}
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.GET_HERO,heroStar[0],heroStar[1]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue