public void CreateBloomNpc() { bloomNpc = Game.CreateNpc(bloomIDs, 1190, 449, 2, -1, 60, 0); bloomNpc.SetRelateDemagemRect(-10, -43, 15, 26); bloomNpc.Say(LanguageMgr.GetTranslation("GameServerScript.AI.Messions.TTSM3302.msg1"), 0, 1500, 3000); Game.AddAction(new ShowBloodItem(bloomNpc.Id, 0, 0)); }
public override void OnStartAttacking() { base.OnStartAttacking(); m_targer = Game.FindNearestPlayer(Body.X, Body.Y); SimpleNpc npc = (SimpleNpc)Body; m_bloom = Game.FindNearestAdverseNpc(Body.X, Body.Y, npc.NpcInfo.Camp); if (m_bloom != null) { if (Math.Abs(Body.X - m_targer.X) > Math.Abs(Body.X - m_bloom.X)) { attack = m_bloom; } else { attack = m_targer; } } else { attack = m_targer; } Beating(); }
public static string GetOneChat(SimpleNpc Body) { int index = 0; string chat = ""; switch (Body.NpcInfo.ID) { case 2001: case 2002: case 2004: case 2101: case 2102: case 2104: index = random.Next(0, AntChat.Length); chat = AntChat[index]; break; default: index = random.Next(0, BoguChat.Length); chat = BoguChat[index]; break; } return(chat); }
private void CreateTotem() { int delay = GetMaxDelay(); if (totemType == 0) { int x = Game.FindBombPlayerX(100); SimpleNpc npc = ((PVEGame)Game).CreateNpc(blowTotemID, x, 500, 1, 1, 1); ((PVEGame)Game).ChangeMissionDelay(1, delay + 100); } else { int rand = Game.Random.Next(0, 2); int x = 0; if (rand == 0) { x = Game.Random.Next(Body.X - 200, Body.X - 100); } else { x = Game.Random.Next(Body.X + 100, Body.X + 200); } TotemBlood = ((PVEGame)Game).CreateNpc(bloodTotemID, x, 500, 1, 1, 2); TotemBlood.SetRelateDemagemRect(-15, -120, 30, 120); ((PVEGame)Game).ChangeMissionDelay(2, delay + 100); } }
public override void OnStartAttacking() { base.OnStartAttacking(); m_targer = Game.FindRandomPlayer(); SimpleNpc npc = (SimpleNpc)Body; m_bloom = Game.FindNearestAdverseNpc(Body.X, Body.Y, npc.NpcInfo.Camp); if (m_bloom != null) { attack = m_bloom; } else { attack = m_targer; } if (Math.Abs(attack.X - Body.X) < 250) { MoveToPlayer(); return; } int dis = Game.Random.Next(Body.X - 100, Body.X + 100); Body.MoveTo(dis, Body.Y, "walk", 1000, new LivingCallBack(NextAttack)); }
public void Createbattle() { battleNpc = Game.CreateNpc(battleID, 1394, 500, 0, 1, -1); battleNpc.SetRelateDemagemRect(-21, -103, 39, 56); battleNpc.Degree = 3; Game.AddAction(new LivingCallFunctionAction(null, CreateBoss, 2000)); Game.AddAction(new ShowBloodItem(battleNpc.Id, 0, 0)); }
public void KillNpc() { if (someNpc != null && someNpc.IsLiving) { someNpc.Die(0); someNpc = null; } }
public void CreateBloom() { SimpleNpc bloom = Game.CreateNpc(bloomID, 750, 486, 0, -1); bloom.Say(LanguageMgr.GetTranslation("GameServerScript.AI.Messions.TNSM3105.msg2"), 0, 1500, 3000); bloom.PlayMovie("die", 5000, 0); bloom.Die(6500); }
public override void OnDiedEvent() { if (TotemBlood != null) { TotemBlood.Die(); Game.RemoveLiving(TotemBlood.Id); TotemBlood = null; } }
private void NextAttack() { if (TotemBlood != null) { TotemBlood.Die(0); TotemBlood = null; } BeginAttack(); }
public override void OnPrepareNewGame() { base.OnPrepareNewGame(); boss = Game.CreateNpc(bossID, 200, 435, 0, 1); boss.Say(LanguageMgr.GetTranslation("GameServerScript.AI.Messions.TTSM3302.msg3"), 0, 2000, 3000); boss.PlayMovie("call", 2000, 3000); boss.PlayMovie("out", 8000, 0); Game.AddAction(new FocusAction(1190, 0, 0, 11000, 1000)); Game.AddAction(new LivingCallFunctionAction(null, CreateNpc, 6000)); Game.AddAction(new LivingCallFunctionAction(null, ClearBoss, 10000)); Game.AddAction(new LivingCallFunctionAction(null, CreateBloomNpc, 12000)); }
public override void OnNewTurnStarted() { base.OnNewTurnStarted(); if (Game.GetLivedLivings().Count == 0) { Game.PveGameDelay = 0; } if (Game.TurnIndex > 1 && Game.CurrentLiving.Delay > Game.PveGameDelay) { if (Game.GetLivedLivings().Count + dieRedCount < Game.MissionInfo.TotalCount) { for (int i = 0; i < 3; i++) { if (shortNpc.Count + longNpc.Count == Game.MissionInfo.TotalCount) { break; } else { if (i == 0 && livingShortCount < 8) { livingShortCount++; int index = Game.Random.Next(0, npcBirthPoint.Length); SimpleNpc npc = Game.CreateNpc(npcIDs[0], npcBirthPoint[index].X, npcBirthPoint[index].Y, 1, -1, 100, 0); shortNpc.Add(npc); } if (i == 1 && livingShortCount < 8) { livingShortCount++; int index = Game.Random.Next(0, npcBirthPoint.Length); SimpleNpc npc = Game.CreateNpc(npcIDs[0], npcBirthPoint[index].X, npcBirthPoint[index].Y, 1, -1, 100, 0); shortNpc.Add(npc); } if (i == 2 && livingLongCount < 3) { livingLongCount++; int index = Game.Random.Next(0, npcBirthPoint.Length); SimpleNpc npc = Game.CreateNpc(npcIDs[1], npcBirthPoint[index].X, npcBirthPoint[index].Y, 1, -1, 100, 1); longNpc.Add(npc); } } } } } }
public void CreateNpc() { if (createNpcCount <= maxQuizSize) { if (isCreateNpcFirst) { someNpc = Game.CreateNpc(redNpcID, 1375, 505, 2); someNpc.SetRelateDemagemRect(-25, -55, 45, 55); isCreateNpcFirst = false; createNpcCount++; return; } someNpc = Game.CreateNpc(redNpcID, createNpcX[currQuizID], 505, 2); someNpc.SetRelateDemagemRect(-25, -55, 45, 55); createNpcCount++; } }
private void CreateTotem() { int x; SimpleNpc totem = null; if (totemType == 0) { x = Game.Random.Next(0, totemLeftPoint.Length); totem = ((PVEGame)Game).CreateNpc(lockTotemID, totemLeftPoint[x].X, totemLeftPoint[x].Y, 2, -1, -1); } else { x = Game.Random.Next(0, totemRightPoint.Length); totem = ((PVEGame)Game).CreateNpc(FagTotemID, totemRightPoint[x].X, totemRightPoint[x].Y, 2, -1, -1); } totem.SetRelateDemagemRect(-5, -65, 10, 44); totem.Degree = 3; }
public void CreateNpc() { if (createNpcCount <= maxTurnSize) { if (isCreateNpcFirst) { someNpc = Game.CreateNpc(redNpcID, 1075, 565, 2); someNpc.SetRelateDemagemRect(-25, -55, 45, 55); isCreateNpcFirst = false; Game.WaitTime(0); return; } someNpc = Game.CreateNpc(redNpcID, createNpcX[currTurnID], 565, 2); someNpc.SetRelateDemagemRect(-25, -55, 45, 55); createNpcCount++; currTurnID++; Game.WaitTime(0); } }
private void CreateTotem() { int delay = GetMaxDelay(); if (totemType == 0) { SimpleNpc npc1 = null; SimpleNpc npc2 = null; SimpleNpc npc3 = null; int x = Game.FindBombPlayerX(100); npc1 = ((PVEGame)Game).CreateNpc(blowTotemID, x, 500, 1, 1, 1); if (x < 250) { npc2 = ((PVEGame)Game).CreateNpc(blowTotemID, x + 200, 500, 1, 1, 1); npc3 = ((PVEGame)Game).CreateNpc(blowTotemID, x + 400, 500, 1, 1, 1); } else if (x > 250 && x < 1250) { npc2 = ((PVEGame)Game).CreateNpc(blowTotemID, x + 200, 500, 1, 1, 1); npc3 = ((PVEGame)Game).CreateNpc(blowTotemID, x - 200, 500, 1, 1, 1); } else if (x > 1250) { npc2 = ((PVEGame)Game).CreateNpc(blowTotemID, x - 200, 500, 1, 1, 1); npc3 = ((PVEGame)Game).CreateNpc(blowTotemID, x - 400, 500, 1, 1, 1); } ((PVEGame)Game).ChangeMissionDelay(1, delay + 100); } else { int rand = Game.Random.Next(0, 2); int x = Game.Random.Next(Body.X - 200, Body.X - 100); TotemBlood.Add(((PVEGame)Game).CreateNpc(bloodTotemID, x, 500, 1, 1, 2)); x = Game.Random.Next(Body.X + 100, Body.X + 200); TotemBlood.Add(((PVEGame)Game).CreateNpc(bloodTotemID, x, 500, 1, -1, 2)); foreach (SimpleNpc totem in TotemBlood) { totem.SetRelateDemagemRect(-15, -120, 30, 120); } ((PVEGame)Game).ChangeMissionDelay(2, delay + 100); } }
public void CreateNpc() { if (createNpcCount <= maxTurnSize) { if (isCreateNpcFirst) { someNpc = Game.CreateNpc(redNpcID, 932, 769, 2); someNpc.SetRelateDemagemRect(-25, -55, 45, 55); isCreateNpcFirst = false; Game.WaitTime(0); return; } int x = Game.Random.Next(0, createNpcX.Length); someNpc = Game.CreateNpc(redNpcID, createNpcX[x].X, createNpcX[x].Y, 2); someNpc.SetRelateDemagemRect(-25, -55, 45, 55); createNpcCount++; currTurnID++; Game.WaitTime(0); } }
public void StartGame() { if (base.GameState == eGameState.Loading) { this.m_gameState = eGameState.Playing; base.ClearWaitTimer(); base.SendSyncLifeTime(); List <Player> list = base.GetAllFightPlayers(); MapPoint mapPos = MapMgr.GetMapRandomPos(this.m_map.Info.ID); GSPacketIn pkg = new GSPacketIn(91); pkg.WriteByte(99); pkg.WriteInt(list.Count); foreach (Player p in list) { p.Reset(); Point pos = base.GetPlayerPoint(mapPos, p.Team); p.SetXY(pos); this.AddPlayer(p); p.StartFalling(true); p.StartGame(); pkg.WriteInt(p.Id); pkg.WriteInt(p.X); pkg.WriteInt(p.Y); pkg.WriteInt(p.Direction); pkg.WriteInt(p.Blood); } base.SendToAll(pkg); if (this.m_npcID != 0 && base.RoomType == eRoomType.Match) { SimpleNpc npc = new SimpleNpc(this.physicalId++, this, NPCInfoMgr.GetNpcInfoById(this.m_npcID), 1, -1, 0); Point npcPos = base.GetPlayerPoint(mapPos, 3); npc.Reset(); npc.SetXY(npcPos); this.AddLiving(npc); npc.StartFalling(false); npc.IsNoHole = true; } base.WaitTime(list.Count * 1000); base.OnGameStarted(); } }
public override void OnPrepareNewGame() { base.OnPrepareNewGame(); SimpleNpc npc = null; //右边小怪 int index = 0; for (int i = 0; i < 8; i++) { index = Game.Random.Next(0, npcBirthPoint.Length); npc = Game.CreateNpc(npcIDs[0], npcBirthPoint[index].X, npcBirthPoint[index].Y, 1, -1, 100, 0); shortNpc.Add(npc); } for (int i = 0; i < 2; i++) { index = Game.Random.Next(0, npcBirthPoint.Length); npc = Game.CreateNpc(npcIDs[1], npcBirthPoint[index].X, npcBirthPoint[index].Y, 1, -1, 100, 1); longNpc.Add(npc); } }
public override void OnMissionEvent(GSPacketIn packet) { int type = packet.ReadInt(); switch (type) { case 0: CreateNpc(); break; case 1: isBeginHit = false; Reset(); KillNpc(); break; case 2: isBeginHit = true; someNpc = null; Game.AddAction(new LivingCallFunctionAction(null, Skip, 4000)); break; } }
public override void OnPrepareNewGame() { base.OnPrepareNewGame(); doorNpc = Game.CreateNpc(doorNpcID, 1450, 400, 1); doorNpc.SetRelateDemagemRect(-26, -170, 52, 170); doorNpc.Degree = 1; blowNpc = Game.CreateBoss(blowNpcID, 600, 400, 1, 3); blowNpc.Degree = 3; gunNpc = Game.CreateBoss(gunNpcID, 1400, 400, 1, 3); gunNpc.SetRelateDemagemRect(-1000, -1000, 2, 2); int index = Game.Random.Next(0, npcBirthPoint.Length); someNpc.Add(Game.CreateNpc(shortNpcID, npcBirthPoint[index].X, npcBirthPoint[index].Y, 1)); index = Game.Random.Next(0, npcBirthPoint.Length); someNpc.Add(Game.CreateNpc(shortNpcID, npcBirthPoint[index].X, npcBirthPoint[index].Y, 1)); index = Game.Random.Next(0, npcBirthPoint.Length); someNpc.Add(Game.CreateNpc(shortNpcID, npcBirthPoint[index].X, npcBirthPoint[index].Y, 1)); someNpc[0].Degree = 2; someNpc[1].Degree = 2; someNpc[2].Degree = 2; }
public override void OnBeginNewTurn() { base.OnBeginNewTurn(); if (!blowNpc.IsLiving) { blowNpc = Game.CreateBoss(blowNpcID, 600, 400, 1, 3); blowNpc.Degree = 3; } foreach (Player player in Game.GetAllFightPlayers()) { if (player.IsLiving && player.X > 500 && player.X < 1450) { player.AddEffect(new ContinueReduceBloodEffect(800, 1, null), 0); } } for (int i = 0; i < 3 - npcCount; i++) { int index = Game.Random.Next(0, npcBirthPoint.Length); SimpleNpc npc = Game.CreateNpc(shortNpcID, npcBirthPoint[index].X, npcBirthPoint[index].Y, 1); npc.Degree = 2; someNpc.Add(npc); } }