This commit is contained in:
@@ -200,14 +200,15 @@ func (Controller) OnPlayerFightNpcMonster(data1 *fight.FightNpcMonsterInboundInf
|
|||||||
if foi.Reason == 0 && foi.WinnerId == p.Info.UserID {
|
if foi.Reason == 0 && foi.WinnerId == p.Info.UserID {
|
||||||
|
|
||||||
exp := uint32(xmlres.PetMAP[int(monster.ID)].YieldingExp) * monster.Level / 7
|
exp := uint32(xmlres.PetMAP[int(monster.ID)].YieldingExp) * monster.Level / 7
|
||||||
leve := p.CanGetExp()
|
addlevel, pookevel := p.CanGetExp()
|
||||||
exp = uint32(leve) * (exp)
|
addexp := uint32(addlevel) * (exp)
|
||||||
|
poolexp := uint32(pookevel) * (exp)
|
||||||
items := &info.S2C_GET_BOSS_MONSTER{
|
items := &info.S2C_GET_BOSS_MONSTER{
|
||||||
//EV: 45,
|
//EV: 45,
|
||||||
EXP: exp / 2,
|
EXP: addexp,
|
||||||
}
|
}
|
||||||
p.Info.ExpPool += int64(exp)
|
p.Info.ExpPool += int64(poolexp + addexp)
|
||||||
p.AddPetExp(foi.Winpet, int64((exp)/2))
|
p.AddPetExp(foi.Winpet, int64(addexp))
|
||||||
if refPet.Item != 0 {
|
if refPet.Item != 0 {
|
||||||
count := int64(grand.Intn(2) + 1)
|
count := int64(grand.Intn(2) + 1)
|
||||||
p.ItemAdd(refPet.Item, count)
|
p.ItemAdd(refPet.Item, count)
|
||||||
|
|||||||
@@ -64,15 +64,15 @@ func (p *Player) Save() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 经验倍数返回
|
// 经验倍数返回
|
||||||
func (p *Player) CanGetExp() int {
|
func (p *Player) CanGetExp() (int, int) {
|
||||||
if p.Info.TimeToday >= p.Info.TimeLimit {
|
if p.Info.TimeToday >= p.Info.TimeLimit {
|
||||||
return 0
|
return 0, 0
|
||||||
}
|
}
|
||||||
|
|
||||||
islogintime := (int64(time.Now().Unix()) - int64(p.Logintime))
|
islogintime := (int64(time.Now().Unix()) - int64(p.Logintime))
|
||||||
|
|
||||||
if islogintime > (p.Info.TimeLimit - p.Info.TimeToday) {
|
if islogintime > (p.Info.TimeLimit - p.Info.TimeToday) {
|
||||||
return 0
|
return 0, 0
|
||||||
}
|
}
|
||||||
base := 1
|
base := 1
|
||||||
if p.Info.TwoTimes != 0 {
|
if p.Info.TwoTimes != 0 {
|
||||||
@@ -85,5 +85,5 @@ func (p *Player) CanGetExp() int {
|
|||||||
base *= 3
|
base *= 3
|
||||||
|
|
||||||
}
|
}
|
||||||
return base
|
return base, 1
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user