public void Reset() { foreach (PQuest_Spawn Spawn in Objective.Spawns) { //Log.Info("Creature", "npc = " + Name + " Oid = " + Oid + " X= " + Spawn.WorldX + " Y= " + Spawn.WorldY + " Z= " + Spawn.WorldZ); Log.Success("SENDING Spawn.Type", "STARTING Spawn.Type "); if (Spawn.Type == 1) { Creature_proto Proto = WorldMgr.GetCreatureProto(Spawn.Entry); if (Proto == null) { Log.Error("PQCreatue", "No Proto"); return; } Creature_spawn S = new Creature_spawn(); S.Guid = (uint)WorldMgr.GenerateCreatureSpawnGUID(); S.BuildFromProto(Proto); S.WorldO = Spawn.WorldO; S.WorldY = Spawn.WorldY; S.WorldZ = Spawn.WorldZ; S.WorldX = Spawn.WorldX; S.ZoneId = Spawn.ZoneId; S.Bytes = ""; PQuestCreature NewCreature = new PQuestCreature(S, this); this.ActiveCreatures.Add(NewCreature); Quest.Region.AddObject((Object)NewCreature, Spawn.ZoneId); } } }
public Creature CreateCreature(uint Entry, ushort ZoneId, ushort Px, ushort Py, ushort Pz) { Creature_proto Proto = WorldMgr.GetCreatureProto((uint)Entry); if (Proto == null) { return(null); } Creature_spawn Spawn = new Creature_spawn(); Spawn.Guid = (uint)WorldMgr.GenerateCreatureSpawnGUID(); Spawn.BuildFromProto(Proto); Spawn.ZoneId = ZoneId; ZoneMgr.CalculWorldPosition(ZoneId, Px, Py, Pz, ref Spawn._WorldO, ref Spawn._WorldY, ref Spawn._WorldZ); return(CreateCreature(Spawn)); }
public void SendCurrentStage(Player Plr) { Plr.QtsInterface.updateObjects(); PacketOut Out = new PacketOut((byte)Opcodes.F_OBJECTIVE_INFO); Out.WriteUInt32(Info.Entry); Out.WriteByte(0); Out.WriteByte((byte)Plr.Realm); Out.WriteByte(Info.Type); Out.WriteUInt16(0); Out.WritePascalString(Info.Name); Out.WriteByte((byte)Plr.Realm); Out.WriteUInt16(0); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Guid); Out.WriteByte((byte)Stage.Objectives.First().Objective.G0); Out.WriteByte((byte)Stage.Objectives.First().Objective.G1); Out.WriteByte(Stage.Objectives.First().Objective.RedDot); // SEND GREEN DOT 1 Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); Out.WriteUInt16((ushort)0); Out.WriteByte(0); Out.WritePascalString(Stage.Objectives.First().Objective.Objective); //RUINS OF SCHLOS EASY (2 dots) ST 1 if (Stage.Objectives.First().Objective.Guid == (ushort)0x0385) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count2); Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective2); } //RUINS OF SCHLOS EASY (2 dots) ST 2 if (Stage.Objectives.First().Objective.Guid == (ushort)0x0386) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count2); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); Out.WritePascalString(Stage.Objectives.First().Objective.Objective2); } //THE WEBWORKS EASY if (Stage.Objectives.First().Objective.Guid == (ushort)0x0439) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective2); } // PLAGUE ON THE WIND EASY if (Stage.Objectives.First().Objective.Guid == (ushort)0x0472) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective2); } // THE BLACK MIRE EASY (OSTLAND) if (Stage.Objectives.First().Objective.Guid == (ushort)0x049D) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective2); } // HOCHNAR EASY (OSTLAND) // if (Stage.Objectives.First().Objective.Guid == (ushort)0x0488) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective2); } // THE GRISLY HEARD EASY (HIGH PASS) if (Stage.Objectives.First().Objective.Guid == (ushort)0x057D) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective2); } // CULT OF THE MAGUS EASY (HIGH PASS) if (Stage.Objectives.First().Objective.Guid == (ushort)0x0559) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective2); } // CULT OF THE MAGUS EASY (HIGH PASS) if (Stage.Objectives.First().Objective.Guid == (ushort)0x0559) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective3); } // TOMB OF THE TRAITOR EASY (HIGH PASS) if (Stage.Objectives.First().Objective.Guid == (ushort)0x0565) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective2); } // THE FALL OF NIGHT EASY (CHAOS WASTE) (3 COUNTERS) if (Stage.Objectives.First().Objective.Guid == (ushort)0x06E9) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective2); } // THE FALL OF NIGHT EASY (CHAOS WASTE) (3 COUNTERS) if (Stage.Objectives.First().Objective.Guid == (ushort)0x06E9) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective3); } // THE siren sea EASY (CHAOS WASTE) (2 COUNTERS) if (Stage.Objectives.First().Objective.Guid == (ushort)0x06A1) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective2); } // burning windmill NORMAL(nordland st3) if (Stage.Objectives.First().Objective.Guid == (ushort)0x036C) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count2); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective2); } // lost artifacts normal (CHAOS WASTE) if (Stage.Objectives.First().Objective.Guid == (ushort)0x06B8) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective2); } // PLAGUE TROLLS NORMAL(TROLL COUNTRY) if (Stage.Objectives.First().Objective.Guid == (ushort)0x049A) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective2); } // siege of bohsenfels NORMAL (OSTLAND) if (Stage.Objectives.First().Objective.Guid == (ushort)0x04AF) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective2); } // TEMPLE OF CHANGE NORMAL (HIGH PASS) if (Stage.Objectives.First().Objective.Guid == (ushort)0x055C) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective2); } // TEMPLE OF CHANGE NORMAL (HIGH PASS) if (Stage.Objectives.First().Objective.Guid == (ushort)0x055C) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective3); } // THE FOETID PLAINS NORMAL(HIGH PASS) if (Stage.Objectives.First().Objective.Guid == (ushort)0x0568) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective2); } // ALTAR OF MADNESS NORMAL(chaos waste) if (Stage.Objectives.First().Objective.Guid == (ushort)0x06E5) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective2); } // ALTAR OF MADNESS NORMAL(chaos waste) if (Stage.Objectives.First().Objective.Guid == (ushort)0x06E5) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective3); } // MADNESS NORMAL(chaos wastes) if (Stage.Objectives.First().Objective.Guid == (ushort)0x06AB) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective2); } // GREEN DOT 2 /////////////// if (Stage.Objectives.First().Objective.Guid == (ushort)0x034F) { ///////////////SECOND STUFF counter/////////////// Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective2); } // DEATHSTONE QUARRY HARD (sent 4 times) 2 if (Stage.Objectives.First().Objective.Guid == (ushort)0x0469) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective2); } // DEATHSTONE QUARRY HARD 3 if (Stage.Objectives.First().Objective.Guid == (ushort)0x0469) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective3); } // DEATHSTONE QUARRY HARD 4 if (Stage.Objectives.First().Objective.Guid == (ushort)0x0469) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective4); } //Gore Wood HARD (ostland) if (Stage.Objectives.First().Objective.Guid == (ushort)0x04C3) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective2); } //LAKE OF THE DAMNED HARD (HIGH PASS) if (Stage.Objectives.First().Objective.Guid == (ushort)0x055F) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective2); } //The Reaping Field HARD (chaos wastes) if (Stage.Objectives.First().Objective.Guid == (ushort)0x06A8) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective2); } //The Reaping Field HARD (chaos wastes) if (Stage.Objectives.First().Objective.Guid == (ushort)0x06A8) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective3); } //Ebon keep HARD (chaos wastes) if (Stage.Objectives.First().Objective.Guid == (ushort)0x06E0) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective2); } //Ebon keep HARD (chaos wastes) if (Stage.Objectives.First().Objective.Guid == (ushort)0x06E0) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective3); } //Ebon keep HARD (chaos wastes) if (Stage.Objectives.First().Objective.Guid == (ushort)0x06E0) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective4); } //DANCE OF BONES HARD (chaos wastes) if (Stage.Objectives.First().Objective.Guid == (ushort)0x06AE) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective); } //Broken ground HARD (pragg) if (Stage.Objectives.First().Objective.Guid == (ushort)0x062F) { Out.WriteByte(Stage.Objectives.First().Objective.RedDot); Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); //second dot counter 0/4 Out.WriteUInt16(0); // count killed ? Out.WriteByte(0); // Out.WritePascalString(Stage.Objectives.First().Objective.Objective2); } // DISABLING THIS MAKES NORSE ARE COMING EASY GREEN // GREEN DOT 3 // some bug on guidbyte1 set at 3dots if (Stage.Objectives.First().Objective.Guid == (ushort)0x034F) { ///////////////THIRD STUFF counter/////////////// Out.WriteByte(Stage.Objectives.First().Objective.RedDot); // 0= green 1= red //turns THIRD dot red Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count); // Out.WriteUInt16(0); // THIRD HOW MANY BEEN KILLED COUNT 0028= 40 Out.WriteByte(0); Out.WritePascalString(Stage.Objectives.First().Objective.Objective3); ///////////////////////////////////////////////////////// } // ENABLING this makes PILLAGERS APPROCH RED HARD // GREEN DOT 4 // 0445= 1093= pillagers approch if (Stage.Objectives.First().Objective.Guid == (ushort)0x0445) { ////////////////////////////// Out.WriteByte(Stage.Objectives.First().Objective.RedDot); // 0= green 1= red //turns THIRD dot red Out.WriteUInt16((ushort)Stage.Objectives.First().Objective.Count2); // Out.WriteUInt16(0); // THIRD HOW MANY BEEN KILLED COUNT 0028= 40 Out.WriteByte(0); Out.WritePascalString(Stage.Objectives.First().Objective.Objective2); ///////////////////////////////////////////////////////// } foreach (PQuest_Spawn Spawn in Stage.Objectives.First().Objective.Spawns) { Log.Info("Creature", "npc = " + Name + " Oid = " + Oid + " X= " + Spawn.WorldX + " Y= " + Spawn.WorldY + " Z= " + Spawn.WorldZ); // Log.Success("SENDING Spawn.Type", "STARTING Spawn.Type "); //if (Stage.Objectives.First().Objective.Guid == (UInt16)0x052E) if (Spawn.Type == 1 & Stage.Objectives.First().Objective.Guid == (UInt16)0x052E) { Creature_proto Proto = WorldMgr.GetCreatureProto(Spawn.Entry); if (Proto == null) { Log.Error("PQCreatue", "No Proto"); return; } Creature_spawn S = new Creature_spawn(); S.Guid = (uint)WorldMgr.GenerateCreatureSpawnGUID(); S.BuildFromProto(Proto); S.WorldO = Spawn.WorldO; S.WorldY = Spawn.WorldY; S.WorldZ = Spawn.WorldZ; S.WorldX = Spawn.WorldX; S.ZoneId = Spawn.ZoneId; S.Bytes = ""; } } ///////////////////////////////////////////////// Out.WriteByte(Stage.Objectives.First().Objective.PQDifficulty); // THIS SHOULD BE 0 // dificulty // 0= easy 2-3 players 1= normal but shows no players // 2= hard 9 or more players // 4,5= normal 6-9 players Out.WriteByte(0); Out.WritePascalString(Stage.StageName); Out.WriteByte(0); // added this which shows the description in white writing kill the raven host marauders terr Out.WritePascalString(Stage.Objectives.First().Objective.Description); //52=size of string= 4B 69 6C 6C 20 74 68 65 20 52 61 76 65 6E 20 48 6F 73 Out.WriteUInt32((uint)Stage.Objectives.First().Objective.Timer); //00 00 00 00// clock//////////// Out.WriteUInt32((uint)Stage.Objectives.First().Objective.Timer); // 00 00 00 00 // clock//////////// //Out.WriteUInt32(0);//00 00 00 00 Out.WriteUInt16(0);///////////////// Out.WriteByte(0);// is this in here ??? // MAY BE ADD THE IF TO THIS FOR BATTLEFEALD OBJECTIVE ? // Out.WritePascalString(Info.Name);// weard this shows battle feald objective if anabled //Out.WriteUInt16(0x0048);// GetInfluenceInfo()->influenceid);////////////////////// Out.WriteUInt16(0x0044);// only for pillger pq////////////// Out.WriteUInt32(0); Plr.SendPacket(Out); // GOLD CHEST ON MAP TURNS GOLD WHEN MORE THAN ONE PLAYER IS IN THE ZONE Out = new PacketOut((byte)Opcodes.F_OBJECTIVE_UPDATE); Out.WriteUInt32(0); Out.WriteByte(6); Out.WriteUInt32(Info.ZoneId); //zoneid Out.WriteUInt16(2); // zone public quests size 00 02 zone.public quest counts Out.WriteUInt32(Info.Entry); //(entry);//02 26// entry=550 Out.WriteUInt16((ushort)Zone._Players.Count); //(0x0004);// get player counts //Out.WriteUInt16((UInt16)1); Out.WriteUInt16(0); Out.WriteUInt16(0x0238);// ??? Out.WriteUInt16(0); DispatchPacket(Out, true); // SENDS STATE OF BO FLAGS }