Exemplo n.º 1
0
 public void OnWorldCreatureEvent(string EventName, Creature Creature, object Data)
 {
     for (int i = 0; i < Scripts.Count; ++i)
         Scripts[i].OnWorldCreatureEvent(EventName, Creature, Data);
 }
Exemplo n.º 2
0
        public virtual void OnWorldCreatureEvent(string EventName, Creature Creature, object Data)
        {

        }
Exemplo n.º 3
0
        public void HandleInteract(Player Plr, Creature Crea, InteractMenu Menu)
        {
            if(Entry == 0)
                return;

            List<Quest> Starter = Crea.Spawn.Proto.StartingQuests;
            List<Quest> Finisher = Crea.Spawn.Proto.FinishingQuests;
            List<Quest> InProgress = Starter != null ? Starter.FindAll(info => Plr.QtsInterface.HasQuest(info.Entry) && !Plr.QtsInterface.HasDoneQuest(info.Entry)) : null;

            string Text = WorldMgr.GetCreatureText(Entry);

            if (Starter == null && Finisher == null && Text.Length <= 0 && InProgress == null)
                return;

            PacketOut Out = new PacketOut((byte)Opcodes.F_INTERACT_RESPONSE);
            Out.WriteByte(0);
            Out.WriteUInt16(_Owner.Oid);
            Out.Fill(0, 3);
            Out.WriteByte(0x60);
            Out.WriteUInt32(0);
            Out.WriteUInt16(Plr.Oid);

            if (Starter != null)
            {
                List<Quest> Starts = Starter.FindAll(q => Plr.QtsInterface.CanStartQuest(q) );

                Out.WriteByte((byte)Starts.Count);
                foreach (Quest Q in Starts)
                {
                    Out.WriteByte(0);
                    Out.WriteUInt16(Q.Entry);
                    Out.WriteUInt16(0);
                    Out.WritePascalString(Q.Name);
                }
            }
            else
                Out.WriteByte(0);

            if (Finisher != null)
            {
                List<Quest> Finishs = Finisher.FindAll(q => Plr.QtsInterface.CanEndQuest(q));

                Out.WriteByte((byte)Finishs.Count);
                foreach (Quest Q in Finishs)
                {
                    Out.WriteByte(0);
                    Out.WriteUInt16(Q.Entry);
                    Out.WritePascalString(Q.Name);
                }
            }
            else if (InProgress != null)
            {
                Out.WriteByte((byte)InProgress.Count);
                foreach (Quest Q in InProgress)
                {
                    Out.WriteByte(0);
                    Out.WriteUInt16(Q.Entry);
                    Out.WritePascalString(Q.Name);
                }
            }
            else
                Out.WriteByte(0);

            Out.WritePascalString(Text);
            Out.WriteByte(0);

            Plr.SendPacket(Out);
        }
        public bool CheckHP(Object Obj, object instigator)
        {
            Creature c = this.Obj as Creature; // We are casting the script initiator as a Creature

            if (Stage < 0 && !c.IsDead)
            {
                Stage = 0; // Setting control value to 0
            }
            else if (c.Health < c.TotalHealth * 0.2 && Stage < 3 && !c.IsDead)
            {
                var prms = new List <object>()
                {
                    c, (ushort)14897, "This battle may be yours but my will persists. If we meet again, it is you that will return to the soil and eternally serve the Mourkain!"
                };                                                                                                                                                                                              // Iron Body
                c.EvtInterface.AddEvent(DelayedBuff, 100, 1, prms);

                foreach (Object o in c.ObjectsInRange.ToList())
                {
                    GameObject go = o as GameObject;
                    if (go != null && go.Entry == 100524)
                    {
                        go.Say("*** Magical barrier collaps and the gem is in your reach... ***", SystemData.ChatLogFilters.CHATLOGFILTERS_MONSTER_EMOTE);
                        go.Destroy();
                    }

                    if (go != null && go.Entry == 100523)
                    {
                        go.IsInvulnerable = false;
                        go.IsAttackable   = 1;
                        go.Health         = go.TotalHealth;

                        //go.Say("*** Cracks start to show upon surface of the gem... ***", SystemData.ChatLogFilters.CHATLOGFILTERS_MONSTER_EMOTE);

                        foreach (Player plr in go.PlayersInRange.ToList())
                        {
                            if (plr != null)
                            {
                                BuffInfo b = AbilityMgr.GetBuffInfo(13058, c, plr); // Killer dot
                                plr.BuffInterface.QueueBuff(new BuffQueueInfo(c, c.Level, b));
                                go.SendMeTo(plr);
                            }
                        }

                        break;
                    }
                }

                Stage = 3;

                //c.Say("Stage 3");
            }
            else if (c.Health < c.TotalHealth * 0.4 && Stage < 2 && !c.IsDead)
            {
                var prms = new List <object>()
                {
                    2000561, 1109983, 1119476, 19138, (int)Obj.Heading, (uint)0
                };                                                                                             // Deathshadow Drudge
                c.EvtInterface.AddEvent(SpawnGO, 100, 1, prms);

                prms = new List <object>()
                {
                    2000561, 1110752, 1119141, 19134, (int)Obj.Heading, (uint)0
                };                                                                                         // Deathshadow Drudge
                c.EvtInterface.AddEvent(SpawnGO, 100, 1, prms);

                prms = new List <object>()
                {
                    2000561, 1111016, 1119874, 19145, (int)Obj.Heading, (uint)0
                };                                                                                         // Deathshadow Drudge
                c.EvtInterface.AddEvent(SpawnGO, 100, 1, prms);

                prms = new List <object>()
                {
                    2000561, 1110467, 1120222, 19146, (int)Obj.Heading, (uint)0
                };                                                                                         // Deathshadow Drudge
                c.EvtInterface.AddEvent(SpawnGO, 100, 1, prms);

                c.Say("Arise, my servants, for it is time the Mourkain retake this word!", SystemData.ChatLogFilters.CHATLOGFILTERS_MONSTER_SAY);

                //c.IsInvulnerable = true;

                //c.EvtInterface.AddEvent(RemoveBuffs, 30000, 1);

                Stage = 2;

                //c.Say("Stage 2");
            }
            else if (c.Health < c.TotalHealth * 0.7 && Stage < 1 && !c.IsDead)
            {
                var prms = new List <object>()
                {
                    2000876, 1109983, 1119476, 19138, Obj.Heading
                };                                                                               // Deathshadow Construct
                c.EvtInterface.AddEvent(SpawnAdds, 100, 1, prms);

                prms = new List <object>()
                {
                    2000876, 1110752, 1119141, 19134, Obj.Heading
                };                                                                           // Deathshadow Construct
                c.EvtInterface.AddEvent(SpawnAdds, 100, 1, prms);

                prms = new List <object>()
                {
                    2000876, 1111016, 1119874, 19145, Obj.Heading
                };                                                                           // Deathshadow Construct
                c.EvtInterface.AddEvent(SpawnAdds, 100, 1, prms);

                prms = new List <object>()
                {
                    2000876, 1110467, 1120222, 19146, Obj.Heading
                };                                                                           // Deathshadow Construct
                c.EvtInterface.AddEvent(SpawnAdds, 100, 1, prms);

                c.Say("Arise, my servants, for it is time the Mourkain retake this word!", SystemData.ChatLogFilters.CHATLOGFILTERS_MONSTER_SAY);

                //c.IsInvulnerable = true;

                //c.EvtInterface.AddEvent(RemoveBuffs, 30000, 1);

                Stage = 1;

                //c.Say("Stage 1");
            }

            return(false);
        }
Exemplo n.º 5
0
        //This checks the current HP of boss
        public bool CheckHP(Object Obj, object instigator)
        {
            Creature c = this.Obj as Creature; // We are casting the script initiator as a Creature

            if (Stage < 0 && !c.IsDead)
            {
                AddWall();                                                                                                  // First time he is damaged he spawns a wall to block exit
                Stage = 0;                                                                                                  // Setting control value to 0
                c.Say("Fools! How dare you disturb my experiments!", SystemData.ChatLogFilters.CHATLOGFILTERS_MONSTER_SAY); // Banter
            }

            if (c.Health < c.TotalHealth * 0.2 && Stage < 4 && !c.IsDead) // At 20% HP he fails to summon anything
            {
                c.IsImmovable    = true;                                  // Boss immovable when walking to table
                c.IsInvulnerable = true;                                  // Boss invulnerable when walking to table
                c.Say("Watch this!", SystemData.ChatLogFilters.CHATLOGFILTERS_MONSTER_SAY);

                c.MvtInterface.Move(38761, 33364, 11103);      // Move to some coordinates

                c.EvtInterface.AddEvent(FinalWords, 5000, 1);  // Banter
                c.EvtInterface.AddEvent(RemoveBuffs, 5000, 1); // We are removing is immovability and invulnerability

                Stage = 4;
            }
            else if (c.Health < c.TotalHealth * 0.4 && Stage < 3 && !c.IsDead)
            {
                c.IsImmovable    = true;
                c.IsInvulnerable = true;
                c.Say("This isn't even my final form yet!", SystemData.ChatLogFilters.CHATLOGFILTERS_MONSTER_SAY);

                c.MvtInterface.Move(38761, 33364, 11103);

                c.EvtInterface.AddEvent(SpawnMaggots, AddsSpawnTimer, 1); // We are spawnning some adds
                c.EvtInterface.AddEvent(RemoveBuffs, 5000, 1);

                Stage = 3;
            }
            else if (c.Health < c.TotalHealth * 0.6 && Stage < 2 && !c.IsDead)
            {
                c.IsImmovable    = true;
                c.IsInvulnerable = true;
                c.Say("Tremble at my illogical glory!", SystemData.ChatLogFilters.CHATLOGFILTERS_MONSTER_SAY);

                c.MvtInterface.Move(38761, 33364, 11103);

                c.EvtInterface.AddEvent(SpawnSpiders, AddsSpawnTimer, 1);
                c.EvtInterface.AddEvent(RemoveBuffs, 5000, 1);

                Stage = 2;
            }
            else if (c.Health < c.TotalHealth * 0.8 && Stage < 1 && !c.IsDead)
            {
                c.IsImmovable    = true;
                c.IsInvulnerable = true;
                c.Say("You are just a nurgling bait!", SystemData.ChatLogFilters.CHATLOGFILTERS_MONSTER_SAY);

                c.MvtInterface.Move(38761, 33364, 11103);

                c.EvtInterface.AddEvent(SpawnNurglings, AddsSpawnTimer, 1);
                c.EvtInterface.AddEvent(RemoveBuffs, 5000, 1);

                Stage = 1;
            }

            return(false);
        }
Exemplo n.º 6
0
        public bool CheckHP(Object Obj, object instigator)
        {
            Creature c = this.Obj as Creature; // We are casting the script initiator as a Creature

            if (Stage < 0 && !c.IsDead)
            {
                Stage = 0; // Setting control value to 0
            }

            if (c.Health < c.TotalHealth * 0.3 && Stage < 4 && !c.IsDead)  // At 20% HP he fails to summon anything
            {
                ApplyIronSkin();

                DismountNPC();

                SquigForm(1);

                c.Say("I almost 'ad ya!", SystemData.ChatLogFilters.CHATLOGFILTERS_MONSTER_SAY);

                c.PlayEffect(2185); // Mount puff effect

                Stage = 4;
            }
            else if (c.Health < c.TotalHealth * 0.4 && Stage < 3 && !c.IsDead)
            {
                var prms = new List <object>()
                {
                    2000866, 929787, 930312, 27020, Obj.Heading
                };                                                                             // Spikestabbin'Squigs
                c.EvtInterface.AddEvent(SpawnAdds, 100, 1, prms);

                prms = new List <object>()
                {
                    2000866, 930761, 931907, 27026, Obj.Heading
                };                                                                         // Spikestabbin'Squigs
                c.EvtInterface.AddEvent(SpawnAdds, 100, 1, prms);

                prms = new List <object>()
                {
                    2000866, 929366, 932515, 27062, Obj.Heading
                };                                                                         // Spikestabbin'Squigs
                c.EvtInterface.AddEvent(SpawnAdds, 100, 1, prms);

                prms = new List <object>()
                {
                    2000866, 928632, 931686, 26987, Obj.Heading
                };                                                                         // Spikestabbin'Squigs
                c.EvtInterface.AddEvent(SpawnAdds, 100, 1, prms);

                prms = new List <object>()
                {
                    2000866, 928715, 930710, 27000, Obj.Heading
                };                                                                         // Spikestabbin'Squigs
                c.EvtInterface.AddEvent(SpawnAdds, 100, 1, prms);

                ApplyIronSkin();

                MountNPC(c, 136);
                c.EvtInterface.AddEvent(DismountNPC, 30 * 10000, 1);

                c.Say("Spikestabba' Squigs, get out 'ere!", SystemData.ChatLogFilters.CHATLOGFILTERS_MONSTER_SAY);

                c.PlayEffect(1359); // Skull Effect
                c.PlayEffect(2185); // Mount puff effect

                Stage = 3;
            }
            else if (c.Health < c.TotalHealth * 0.6 && Stage < 2 && !c.IsDead)
            {
                var prms = new List <object>()
                {
                    2000865, 929787, 930312, 27020, Obj.Heading
                };                                                                             // Stinkspewin'Squigs
                c.EvtInterface.AddEvent(SpawnAdds, 100, 1, prms);

                prms = new List <object>()
                {
                    2000865, 930761, 931907, 27026, Obj.Heading
                };                                                                         // Stinkspewin'Squigs
                c.EvtInterface.AddEvent(SpawnAdds, 100, 1, prms);

                prms = new List <object>()
                {
                    2000865, 929366, 932515, 27062, Obj.Heading
                };                                                                         // Stinkspewin'Squigs
                c.EvtInterface.AddEvent(SpawnAdds, 100, 1, prms);

                prms = new List <object>()
                {
                    2000865, 928632, 931686, 26987, Obj.Heading
                };                                                                         // Stinkspewin'Squigs
                c.EvtInterface.AddEvent(SpawnAdds, 100, 1, prms);

                prms = new List <object>()
                {
                    2000865, 928715, 930710, 27000, Obj.Heading
                };                                                                         // Stinkspewin'Squigs
                c.EvtInterface.AddEvent(SpawnAdds, 100, 1, prms);

                ApplyIronSkin();

                MountNPC(c, 136);
                c.EvtInterface.AddEvent(DismountNPC, 30 * 10000, 1);

                c.Say("Stinkspewin' Squigs, get out 'ere!", SystemData.ChatLogFilters.CHATLOGFILTERS_MONSTER_SAY);

                c.PlayEffect(1359); // Skull Effect
                c.PlayEffect(2185); // Mount puff effect

                Stage = 2;
            }
            else if (c.Health < c.TotalHealth * 0.90 && Stage < 1 && !c.IsDead)
            {
                var prms = new List <object>()
                {
                    2000864, 929787, 930312, 27020, Obj.Heading
                };                                                                             // Skewering'Squigs
                c.EvtInterface.AddEvent(SpawnAdds, 100, 1, prms);

                prms = new List <object>()
                {
                    2000864, 930761, 931907, 27026, Obj.Heading
                };                                                                         // Skewering'Squigs
                c.EvtInterface.AddEvent(SpawnAdds, 100, 1, prms);

                prms = new List <object>()
                {
                    2000864, 929366, 932515, 27062, Obj.Heading
                };                                                                         // Skewering'Squigs
                c.EvtInterface.AddEvent(SpawnAdds, 100, 1, prms);

                prms = new List <object>()
                {
                    2000864, 928632, 931686, 26987, Obj.Heading
                };                                                                         // Skewering'Squigs
                c.EvtInterface.AddEvent(SpawnAdds, 100, 1, prms);

                prms = new List <object>()
                {
                    2000864, 928715, 930710, 27000, Obj.Heading
                };                                                                         // Skewering'Squigs
                c.EvtInterface.AddEvent(SpawnAdds, 100, 1, prms);

                ApplyIronSkin();
                MountNPC(c, 136); // Squig Mount
                c.EvtInterface.AddEvent(DismountNPC, 30 * 10000, 1);

                c.Say("Skewerin' Squigs, get out 'ere!", SystemData.ChatLogFilters.CHATLOGFILTERS_MONSTER_SAY);

                c.PlayEffect(1359); // Skull Effect
                c.PlayEffect(2185); // Mount puff effect

                Stage = 1;
            }

            return(false);
        }
Exemplo n.º 7
0
        public Creature CreateCreature(Creature_spawn Spawn)
        {
            if (Spawn == null || Spawn.Proto == null)
                return null;

            Creature Crea = new Creature(Spawn);
            AddObject((Object)Crea,Spawn.ZoneId);
            return Crea;
        }
Exemplo n.º 8
0
 public Creature CreateCreature(Creature_spawn Spawn)
 {
     Creature Crea = new Creature(Spawn);
     AddObject((Object)Crea,Spawn.ZoneId);
     return Crea;
 }