皮肤加成
This commit is contained in:
parent
d3c40dde03
commit
fe1e66fec2
|
@ -96,7 +96,7 @@ func (p *RabbitMQPublisher) publish(topic string, msg interface{}, opts ...broke
|
||||||
|
|
||||||
err = p.Publish(topic, &broker.Message{Body: buf}, opts...)
|
err = p.Publish(topic, &broker.Message{Body: buf}, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Logger.Error("RabbitMQPublisher.publish() topic:%v message:%v err:%v", topic, msg, err)
|
logger.Logger.Errorf("RabbitMQPublisher.publish() topic:%v message:%v err:%v", topic, msg, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -561,6 +561,11 @@ func CSSkinUpgrade(s *netlib.Session, packetid int, data interface{}, sid int64)
|
||||||
pack.RetCode = pets.OpResultCode_OPRC_Sucess
|
pack.RetCode = pets.OpResultCode_OPRC_Sucess
|
||||||
pack.Info = PetMgrSington.GetSkinInfo(p, msg.GetId())
|
pack.Info = PetMgrSington.GetSkinInfo(p, msg.GetId())
|
||||||
send()
|
send()
|
||||||
|
|
||||||
|
// 任务加成变更
|
||||||
|
if info.GetSkillId() == common.SkillIdTask && p.GetSkillAdd(common.SkillIdTask) > 0 {
|
||||||
|
OnNotifyChange(p, common.TaskActivityTypeEveryDay)
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -621,6 +626,11 @@ func SkinUnLock(p *Player, id int32) (*pets.SkinInfo, pets.OpResultCode) {
|
||||||
p.SendToClient(int(pets.PetsPacketID_PACKET_SC_SKIN_UNLOCK), pack)
|
p.SendToClient(int(pets.PetsPacketID_PACKET_SC_SKIN_UNLOCK), pack)
|
||||||
logger.Logger.Tracef("SCSkinUnlock: %v", pack)
|
logger.Logger.Tracef("SCSkinUnlock: %v", pack)
|
||||||
|
|
||||||
|
// 任务加成变更
|
||||||
|
if info.GetSkillId() == common.SkillIdTask && p.GetSkillAdd(common.SkillIdTask) > 0 {
|
||||||
|
OnNotifyChange(p, common.TaskActivityTypeEveryDay)
|
||||||
|
}
|
||||||
|
|
||||||
// 自动使用
|
// 自动使用
|
||||||
if cfg.GetUnlockType() == common.SkinGetAuto {
|
if cfg.GetUnlockType() == common.SkinGetAuto {
|
||||||
CSSkinUse(p.gateSess, int(pets.PetsPacketID_PACKET_CS_SKIN_USE), &pets.CSSkinUse{Id: id}, p.sid)
|
CSSkinUse(p.gateSess, int(pets.PetsPacketID_PACKET_CS_SKIN_USE), &pets.CSSkinUse{Id: id}, p.sid)
|
||||||
|
|
|
@ -144,6 +144,7 @@ func CSTaskList(s *netlib.Session, packetId int, data interface{}, sid int64) er
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
add := p.GetSkillAdd(common.SkillIdTask)
|
||||||
ret := &taskproto.SCTaskList{
|
ret := &taskproto.SCTaskList{
|
||||||
Tp: msg.GetTp(),
|
Tp: msg.GetTp(),
|
||||||
}
|
}
|
||||||
|
@ -154,9 +155,16 @@ func CSTaskList(s *netlib.Session, packetId int, data interface{}, sid int64) er
|
||||||
N: GetTaskTimes(p, v.Id),
|
N: GetTaskTimes(p, v.Id),
|
||||||
TargetN: v.GetTargetTimes(),
|
TargetN: v.GetTargetTimes(),
|
||||||
Status: 0,
|
Status: 0,
|
||||||
Reward: v.GetAward(),
|
Reward: make(map[int64]int64),
|
||||||
TaskType: v.GetTaskType(),
|
TaskType: v.GetTaskType(),
|
||||||
}
|
}
|
||||||
|
// 皮肤技能每日任务金币加成
|
||||||
|
for k, vv := range v.GetAward() {
|
||||||
|
if v.GetActivityType() == common.TaskActivityTypeEveryDay && add > 0 && k == common.ItemIDCoin {
|
||||||
|
vv += int64((float64(vv) * float64(add)) / 100.0)
|
||||||
|
}
|
||||||
|
item.Reward[k] = vv
|
||||||
|
}
|
||||||
if item.N > item.TargetN {
|
if item.N > item.TargetN {
|
||||||
item.N = item.TargetN
|
item.N = item.TargetN
|
||||||
}
|
}
|
||||||
|
|
|
@ -3766,7 +3766,7 @@ func (this *Player) SCVIPInfo() {
|
||||||
LineId: cfg.RewardOutlineID,
|
LineId: cfg.RewardOutlineID,
|
||||||
ShopId2: cfg.ShopId2,
|
ShopId2: cfg.ShopId2,
|
||||||
ShopId7: cfg.ShopId7,
|
ShopId7: cfg.ShopId7,
|
||||||
MatchFreeTimes: cfg.MatchFreeTimes,
|
MatchFreeTimes: cfg.MatchFreeTimes + this.GetSkillAdd(common.SkillIdVipTimes),
|
||||||
}
|
}
|
||||||
money := cfg.Privilege1[0]
|
money := cfg.Privilege1[0]
|
||||||
// 皮肤技能加成
|
// 皮肤技能加成
|
||||||
|
|
|
@ -229,6 +229,37 @@ func (t *TaskHandle) AllTask(id int, data any) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func OnNotifyChange(p *Player, activityType int32) {
|
||||||
|
add := p.GetSkillAdd(common.SkillIdTask)
|
||||||
|
var l []*taskproto.TaskData
|
||||||
|
for _, v := range srvdata.TaskMgr.GetActivityType(activityType) {
|
||||||
|
if !IsTaskReward(p, v.Id) {
|
||||||
|
// 皮肤技能每日任务金币加成
|
||||||
|
item := &taskproto.TaskData{
|
||||||
|
Id: v.Id,
|
||||||
|
N: GetTaskTimes(p, v.Id),
|
||||||
|
TargetN: v.GetTargetTimes(),
|
||||||
|
Status: 0,
|
||||||
|
Reward: make(map[int64]int64),
|
||||||
|
TaskType: v.GetTaskType(),
|
||||||
|
}
|
||||||
|
for k, vv := range v.GetAward() {
|
||||||
|
if v.GetActivityType() == common.TaskActivityTypeEveryDay && add > 0 && k == common.ItemIDCoin {
|
||||||
|
vv += int64((float64(vv) * float64(add)) / 100.0)
|
||||||
|
}
|
||||||
|
item.Reward[k] = vv
|
||||||
|
}
|
||||||
|
l = append(l, item)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pack := &taskproto.SCTaskChange{
|
||||||
|
Tp: activityType,
|
||||||
|
List: l,
|
||||||
|
}
|
||||||
|
p.SendToClient(int(taskproto.TaskPacketID_PACKET_SCTaskChange), pack)
|
||||||
|
logger.Logger.Tracef("SCTaskChange %v", pack)
|
||||||
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
taskHandle := new(TaskHandle)
|
taskHandle := new(TaskHandle)
|
||||||
TaskSubjectSingleton.Attach(common.TaskTypeAdv, taskHandle)
|
TaskSubjectSingleton.Attach(common.TaskTypeAdv, taskHandle)
|
||||||
|
|
Loading…
Reference in New Issue