public override void AfterPlayerEnterOver(ObjPlayer player) { if (player.IsDead()) { player.Relive(); } else { player.Attr.SetDataValue(eAttributeType.HpNow, player.Attr.GetDataValue(eAttributeType.HpMax)); player.Attr.SetDataValue(eAttributeType.MpNow, player.Attr.GetDataValue(eAttributeType.MpMax)); } if (mPlayerInfo.ContainsKey(player.ObjId)) { return; } mPlayerInfo.Add(player.ObjId, player.GetName()); mPlayers.Add(player); // 限制buff player.AddBuff(3001, 1, player); // 同步位置 player.SyncCharacterPostion(); if (Trggers[(int)eDungeonTimerType.WaitStart] == null) { StartTimer(eDungeonTimerType.WaitStart, DateTime.Now.AddSeconds(5), TimeOverStart); } NotifyDungeonTime(player, eDungeonTimerType.WaitStart); OnTriggerStartWarn(player); }
public override void OnPlayerLeave(ObjPlayer player) { Log(Logger, "OnPlayerLeave:player id = {0}, name = {1}", player.ObjId, player.GetName()); base.OnPlayerLeave(player); RefreshInfoPlayerCount(); }
public override void OnPlayerEnterOver(ObjPlayer player) { if (player == null) { return; } base.OnPlayerEnterOver(player); int idx = _playerList.FindIndex(r => r.objId == player.ObjId); if (idx >= 0) { _playerList.RemoveAt(idx); } JPlayer p = new JPlayer(); p.objId = player.ObjId; p.name = player.GetName(); p.lv = 1; _playerList.Add(p); var tb = Table.GetCheckenLv(p.lv); if (tb != null) {//buff player.AddBuff(tb.BaseBuff, 1, player); } SendRadius(player); }
public override void ExitDungeon(ObjPlayer player) { //玩家强退,1s之后关闭副本 Log(Logger, "ExitDungeon:player id = {0}, name = {1}", player.ObjId, player.GetName()); EnterAutoClose(30); }
public override void OnPlayerEnter(ObjPlayer player) { Log(Logger, "OnPlayerEnter:player id = {0}, name = {1}", player.ObjId, player.GetName()); base.OnPlayerEnter(player); RefreshInfoPlayerCount(); SendFubenInfo(player); }
public override void ExitDungeon(ObjPlayer player) { base.ExitDungeon(player); Log(Logger, "ExitDungeon:player id = {0}, name = {1}", player.ObjId, player.GetName()); var result = new FubenResult(); result.CompleteType = (int)eDungeonCompleteType.Quit; CompleteToAll(result); }
public override void OnPlayerEnter(ObjPlayer player) { Log(Logger, "OnPlayerEnter:player id = {0}, name = {1}", player.ObjId, player.GetName()); base.OnPlayerEnter(player); mPlayers.modifyValue(player.ObjId, 0); if (State == eDungeonState.Start) { mDropPlayers.Remove(player.ObjId); } }
public override void OnPlayerEnter(ObjPlayer player) { Log(Logger, "OnPlayerEnter:player id = {0}, name = {1}", player.ObjId, player.GetName()); base.OnPlayerEnter(player); if (mLeaveTrigger.ContainsKey(player.ObjId)) { var trigger = mLeaveTrigger[player.ObjId]; SceneServerControl.Timer.DeleteTrigger(trigger); mLeaveTrigger.Remove(player.ObjId); } }
public override void StartDungeon() { StartTimer(eDungeonTimerType.WaitEnd, DateTime.Now.AddMinutes(5), TimeOverEnd); mHasHold = false; Exdata = 0; base.StartDungeon(); // 保存数据 mResult.Name = mPlayer.GetName(); mResult.Id = mPlayer.ObjId; mResult.ServerId = mPlayer.ServerId; mResult.NpcName = mAutoPlayer.GetName(); }
public override void OnPlayerEnter(ObjPlayer player) { base.OnPlayerEnter(player); //恢复满血满蓝 ResetPlayer(player); //初始化玩家积分 if (!PlayerScore.ContainsKey(player.ObjId)) { var unit = new DamageUnit(); unit.CharacterId = player.ObjId; unit.Name = player.GetName(); PlayerScore.Add(player.ObjId, unit); RankData.Data.Add(unit); } }
public override void OnPlayerEnter(ObjPlayer player) { base.OnPlayerEnter(player); this.addExp.Clear(); ResetMonsterLevel(); if (mSyncBuildingPet) { return; } if (null != Param) { if (Param.ObjId == player.ObjId) { mSyncBuildingPet = true; mLeaderName = player.GetName(); var characterId = player.ObjId; CoroutineFactory.NewCoroutine(RequestPlayCount, characterId).MoveNext(); CoroutineFactory.NewCoroutine(RequestBuildingPets, characterId).MoveNext(); } } }
public override void OnPlayerDie(ObjPlayer player, ulong characterId = 0) { var side = GetPlayerSide(player); if (side == -1) { Logger.Error("OnPlayerDie GetPlayerSide ObjOd{0}", player.ObjId); return; } PlayerLog.WriteLog(player.ObjId, "----HSJDKBattle------PlayerDie----------KillId={0}", characterId); //死人了,重置一下trigger area的状态 var playerPos = player.GetPosition(); var area = mAreaDict.Values.FirstOrDefault(a => a.IsInArea(playerPos)); if (area != null) { OnTriggerAreaPlayersChanged(area); } var reliveObj = SceneServerControl.Timer.CreateTrigger(DateTime.Now.AddSeconds(10.0f), () => { if (mLeaveTrigger.ContainsKey(player.ObjId)) { return; } mReliveTrigger.Remove(player.ObjId); FixPostion(player); player.Relive(); PlayerLog.WriteLog(player.ObjId, "----HSJDKBattle------PlayerRelive----------Time Over"); }); mReliveTrigger.Add(player.ObjId, reliveObj); var caster = FindCharacter(characterId); if (caster == null) { return; } caster = caster.GetRewardOwner(); var strColor = ""; if (side == 0) { strColor = "FF0000";//红色 } else if (side == 1) { strColor = "2866E1";//蓝色 } // var args = new List <string>(); args.Add(strColor); args.Add(caster.GetName()); var content = Utils.WrapDictionaryId(224008, args); player.Proxy.NotifyCountdown((ulong)DateTime.Now.AddSeconds(10f).ToBinary(), (int)eCountdownType.BattleRelive); player.Proxy.NotifyBattleReminder(14, content, 1); args.Clear(); args.Add(caster.GetName());//此处 A 击杀了 B player是被击杀者 args.Add(player.GetName()); string text = side == 1 ? Utils.WrapDictionaryId(61000, args) : Utils.WrapDictionaryId(61001, args); PushActionToAllPlayer(p => { p.Proxy.NotifyBattleReminder(14, text, 1); }); }
public override void OnPlayerDie(ObjPlayer player, ulong characterId = 0) { if (player == null) { return; } var obj = FindCharacter(characterId); var killer = obj.GetRewardOwner(); if (killer.GetObjType() != ObjType.PLAYER) { return; } SceneServer.Instance.ServerControl.BroadcastSceneChat(EnumAllPlayerId(), killer.GetName() + "|" + player.GetName(), 272000); }
public IEnumerator ResultOver(Coroutine co, ObjPlayer player, bool end = false) { if (mIsEnd) {// 已经结算过了 yield break; } mIsEnd = true; ulong winnerId = 0; foreach (var objPlayer in mPlayerInfo) { if (objPlayer.Key != player.ObjId) { winnerId = objPlayer.Key; break; } } if (0 == winnerId) {//异常了?? yield break; } // 世界广播 string content; var args = new List <string>(); if (end) { //平手 args.Add(mPlayerInfo[winnerId]); args.Add(player.GetName()); content = Utils.WrapDictionaryId(100003326, args); } else { if (player.IsDead()) { //胜负 args.Add(mPlayerInfo[winnerId]); args.Add(player.GetName()); content = Utils.WrapDictionaryId(100003327, args); } else { //放弃 args.Add(player.GetName()); args.Add(mPlayerInfo[winnerId]); content = Utils.WrapDictionaryId(100003325, args); } } var msg2 = SceneServer.Instance.ChatAgent.SSBroadcastAllServerMsg(player.ObjId, (int)eChatChannel.SystemScroll, player.GetName(), new ChatMessageContent { Content = content }); yield return(msg2.SendAndWaitUntilDone(co)); // 5秒后自动关闭 if (false == end) { EnterAutoClose(5); } }
public override void OnPlayerDie(ObjPlayer player, ulong characterId = 0) { var killer = FindPlayer(characterId); if (null == killer) { var obj = FindCharacter(characterId); if (null != obj && obj.GetObjType() == ObjType.RETINUE) { var retinue = obj as ObjRetinue; if (null != retinue.Owner && retinue.Owner.GetObjType() == ObjType.PLAYER) { killer = retinue.Owner as ObjPlayer; } } if (null == killer) { return; } } var oldKills = GetContinuesKillRecord(player.ObjId); bool bfirst = false; if (Msg.Int64List.Count > 0 && Msg.Int64List[0] == player.ObjId && oldKills >= 10) { bfirst = true; } AddKillOrDeadRecord(player.ObjId, false); AddKillOrDeadRecord(killer.ObjId, true); Dirty = true; CreateDropItem(99, new List <ulong> { characterId }, 0uL, 2, CalculateKillerGold(TableParam[ParamIdx_KillGoldBase], player.GetLevel(), oldKills, killer.GetLevel()), player.GetPosition()); GiveItem(characterId, 1, CalculateKillerExp(TableParam[ParamIdx_KillExpBase], player.GetLevel(), oldKills, killer.GetLevel(), TableParam[ParamIdx_KillExpRate])); //移除死亡给叠加的buff foreach (var buffId in DieBuffId) { var datas = killer.BuffList.GetBuffById(buffId); foreach (var data in datas) { MissBuff.DoEffect(this, killer, data); killer.DeleteBuff(data, eCleanBuffType.EffectOver); } } AssignMsg(); PushActionToAllPlayer(proxyPlayer => { if (!proxyPlayer.Active) { return; } AssignSelfMsg(proxyPlayer.ObjId); proxyPlayer.Proxy.NotifyRefreshDungeonInfo(Msg); }); if (bfirst) { SceneServer.Instance.ServerControl.BroadcastSceneChat(EnumAllPlayerId(), killer.GetName() + "|" + player.GetName(), 272005); } var num = GetContinuesKillRecord(killer.ObjId); if (3 == num) { SceneServer.Instance.ServerControl.BroadcastSceneChat(EnumAllPlayerId(), killer.GetName() + "|" + player.GetName(), 272001); //[{0}]正在大杀特杀! } else if (6 == num) { SceneServer.Instance.ServerControl.BroadcastSceneChat(EnumAllPlayerId(), killer.GetName() + "|" + player.GetName(), 272002); //[{0}]已经主宰比赛了! } else if (8 == num) { SceneServer.Instance.ServerControl.BroadcastSceneChat(EnumAllPlayerId(), killer.GetName() + "|" + player.GetName(), 272003); //[{0}]已经无人能挡! } else if (num >= 10 && num % 5 == 0) { SceneServer.Instance.ServerControl.BroadcastSceneChat(EnumAllPlayerId(), killer.GetName() + "|" + player.GetName(), 272004); //[{0}]已经超越神了! } }
public IEnumerator RespawnGuard(Coroutine co, ObjPlayer player, int index, AsyncReturnValue <ErrorCodes> err) { if (player.GetCamp() != DefenderCampId) { err.Value = ErrorCodes.Error_JurisdictionNotEnough; yield break; } if (GuardReliveCount >= StaticVariable.AllianceWarGuardRespawnMaxCount) { err.Value = ErrorCodes.Error_GuardRespawnExceed; yield break; } var guard = Guards[index]; if (!guard.IsDead()) { NotifyAllianceWarNpcData(new List <ulong> { player.ObjId }); err.Value = ErrorCodes.Error_GuardNotDie; yield break; } //扣钱 var cost = Table.GetSkillUpgrading(73000).GetSkillUpgradingValue(GuardReliveCount); var msg = SceneServer.Instance.LogicAgent.DeleteItem(player.ObjId, (int)eResourcesType.DiamondRes, cost, (int)eDeleteItemType.FuHuoShouWei); yield return(msg.SendAndWaitUntilDone(co)); if (msg.State != MessageState.Reply) { err.Value = ErrorCodes.Unknow; yield break; } var errCode = (ErrorCodes)msg.ErrorCode; if (errCode != ErrorCodes.OK) { err.Value = errCode; yield break; } err.Value = ErrorCodes.OK; var npc = CreateSceneNpc(index + GuardSceneNpcId0, Vector2.Zero, NpcLevel); Guards[index] = npc; ++GuardReliveCount; GuardState.Items[index] = 0; NotifyAllianceWarNpcDataToAllPlayer(); // var idx = MapNpcRecords.FindIndex(r => r.NpcID == npc.TypeId); if (idx != -1) { var info = MapNpcInfo.Data[idx]; info.Alive = true; } //发通告 var args = new List <string>(); args.Add(player.GetName()); var content = Utils.WrapDictionaryId(300930, args); PushActionToAllPlayer(p => { p.Proxy.NotifyBattleReminder(14, content, 1); }); }
public override void OnPlayerDie(ObjPlayer player, ulong characterId = 0) { var side = GetPlayerSide(player); if (side == -1) { Logger.Error("OnPlayerDie GetPlayerSide ObjOd{0}", player.ObjId); return; } var bossName = ""; var caster = FindCharacter(characterId); if (caster == null) { return; } caster = caster.GetRewardOwner(); var strColor1 = ""; var strColor2 = ""; if (side == 0) { bossName = Utils.AddDictionaryId(220451); strColor1 = Utils.AddDictionaryId(220453); strColor2 = Utils.AddDictionaryId(220454); } else if (side == 1) { bossName = Utils.AddDictionaryId(220452); strColor1 = Utils.AddDictionaryId(220454); strColor2 = Utils.AddDictionaryId(220453); } //所有获得2层BUFF- Add3003Buff(side, 2, true); var args = new List <string>(); args.Add(strColor1); args.Add(caster.GetName()); args.Add(strColor2); args.Add(player.GetName()); args.Add(bossName); args.Add(mBuffLayer[side].ToString()); var reliveTime = DateTime.Now.AddSeconds(10); var reliveObj = SceneServerControl.Timer.CreateTrigger(reliveTime, () => { if (mLeaveTrigger.ContainsKey(player.ObjId)) { return; } FixPostion(player); player.Relive(); mReliveTrigger.Remove(player.ObjId); PlayerLog.WriteLog(player.ObjId, "----HLKBattle------PlayerRelive----------Time Over"); }); mReliveTrigger.Add(player.ObjId, reliveObj); PlayerLog.WriteLog(player.ObjId, "----HLKBattle------PlayerDie----------KillId={0}", caster.ObjId); //通告,某人被某人杀了 //var info = Utils.WrapDictionaryId(220421, args); //BroadcastScene( // objPlayer => // { // if (objPlayer != null && objPlayer.Proxy != null) // { // objPlayer.Proxy.NotifyBattleReminder(14, info, 1); // } // }); args.Clear(); args.Add(caster.GetName());//此处 A 击杀了 B player是被击杀者 args.Add(player.GetName()); string text = side == 1 ? Utils.WrapDictionaryId(61000, args) : Utils.WrapDictionaryId(61001, args); PushActionToAllPlayer(p => { p.Proxy.NotifyBattleReminder(14, text, 1); }); //通知死者,复活倒计时 player.Proxy.NotifyBattleReminder(14, Utils.WrapDictionaryId(220450), 1); player.Proxy.NotifyCountdown((ulong)reliveTime.ToBinary(), (int)eCountdownType.BattleRelive); }
public override void OnPlayerLeave(ObjPlayer player) { Log(Logger, "OnPlayerLeave:player id = {0}, name = {1}, State = {2}", player.ObjId, player.GetName(), State); if (State == eDungeonState.Start) { if (!mQuitPlayers.ContainsKey(player.ObjId)) { mDropPlayers.Add(player.ObjId, player); } } base.OnPlayerLeave(player); }
public override void OnPlayerLeave(ObjPlayer player) { Log(Logger, "OnPlayerLeave:player id = {0}, name = {1}, State = {2}", player.ObjId, player.GetName(), State); if (State >= eDungeonState.WillClose) { CoroutineFactory.NewCoroutine(PlayerLeave, player).MoveNext(); } else { var leave = SceneServerControl.Timer.CreateTrigger(DateTime.Now.AddMinutes(1), () => { CoroutineFactory.NewCoroutine(PlayerLeave, player).MoveNext(); mLeaveTrigger.Remove(player.ObjId); }); mLeaveTrigger.Add(player.ObjId, leave); } base.OnPlayerLeave(player); }
public override void OnPlayerDie(ObjPlayer player, ulong characterId = 0) { if (player == null) { return; } var killer = FindCharacter(characterId); if (killer == null) { return; } int idkill = _playerList.FindIndex(r => r.objId == characterId); _playerList[idkill].kill += 1; if (_playerList[idkill].enemyId == player.ObjId)//杀死了自己的仇人 { var content1 = _playerList[idkill].name + "手刃了仇人" + player.mName; SceneServer.Instance.ChatAgent.BroadcastWorldMessage((uint)this.ServerId, (int)eChatChannel.Scene, 0, string.Empty, new ChatMessageContent { Content = content1 }); } int idx = _playerList.FindIndex(r => r.objId == player.ObjId); _playerList[idx].die += 1; _playerList[idx].point = _playerList[idx].point * DieRate / 100; //加入敌人列表 _playerList[idx].enemyId = characterId; //死亡掉落一半积分 DropPoint(_playerList[idx].point, player); //通知场景玩家被杀死了 var killerObj = killer.GetRewardOwner(); if (killerObj.GetObjType() != ObjType.PLAYER) { return; } SceneServer.Instance.ServerControl.BroadcastSceneChat(EnumAllPlayerId(), killer.GetName() + "|" + player.GetName(), 272000); base.OnPlayerDie(player, characterId); }