Beispiel #1
0
        public GameClient LearnSpell(Mundane source, SpellTemplate subject, string message)
        {
            var canLearn = false;

            if (subject.Prerequisites != null)
            {
                canLearn = PayPrerequisites(subject.Prerequisites);
            }

            if (subject.LearningRequirements != null && subject.LearningRequirements.Any())
            {
                canLearn = subject.LearningRequirements.TrueForAll(PayPrerequisites);
            }

            if (!canLearn)
            {
                return(this);
            }

            Spell.GiveTo(this, subject.Name);
            SendOptionsDialog(source, message);

            Aisling.Show(Scope.NearbyAislings,
                         new ServerFormat29((uint)Aisling.Serial, (uint)source.Serial,
                                            subject.TargetAnimation,
                                            subject.TargetAnimation, 100));

            return(this);
        }
        public override void OnGossip(GameServer server, GameClient client, string message)
        {
            if (message.Contains("pussy"))
            {
                Mundane.Show(Scope.NearbyAislings,
                             new ServerFormat0D {
                    Text = "Oh shit!", Type = 0x00, Serial = Mundane.Serial
                });

                new TaskFactory().StartNew(() =>
                {
                    Thread.Sleep(400);

                    Mundane.Direction = 2;
                    Mundane.Turn();
                });

                new TaskFactory().StartNew(() =>
                {
                    Thread.Sleep(1000);
                    Mundane.Show(Scope.NearbyAislings,
                                 new ServerFormat0D {
                        Text = "I was just joking!!", Type = 0x00, Serial = Mundane.Serial
                    });
                });
            }
        }
Beispiel #3
0
        public void SpawnMundanes()
        {
            foreach (var mundane in ServerContext.GlobalMundaneTemplateCache)
            {
                if (mundane.Value == null || mundane.Value.AreaID == 0)
                {
                    continue;
                }

                if (!ServerContext.GlobalMapCache.ContainsKey(mundane.Value.AreaID))
                {
                    continue;
                }

                var map = ServerContext.GlobalMapCache[mundane.Value.AreaID];

                if (map == null || !map.Ready)
                {
                    continue;
                }

                var npc = GetObject <Mundane>(map, i => i.CurrentMapId == map.Id && i.Template != null &&
                                              i.Template.Name ==
                                              mundane.Value.Name);

                if (npc != null && npc.CurrentHp > 0)
                {
                    continue;
                }

                Mundane.Create(mundane.Value);
            }
        }
        public StateExample(GameServer server, Mundane mundane)

            : base(server, mundane)
        {
            //this is called on script compile, build a quest.
            quest      = new Quest();
            quest.Name = "God Stats";
            quest.StatRewards.Add(new AttrReward()
            {
                Attribute = PlayerAttr.WIS,
                Operator  = new StatusOperator(StatusOperator.Operator.Add, 5),
            });
            quest.ItemRewards = new List <string>()
            {
                "Hy-Brasyl Boots"
            };
            quest.LegendRewards = new List <Legend.LegendItem>()
            {
                new Legend.LegendItem()
                {
                    Category = "Class",
                    Color    = (byte)LegendColor.Blue,
                    Icon     = (byte)LegendIcon.Heart,
                    Value    = "Glioca Worshipper"
                },
            };
        }
 public Erin(GameServer server, Mundane mundane) : base(server, mundane)
 {
     if (string.IsNullOrEmpty(mundane.Template.QuestKey))
     {
         mundane.Template.QuestKey = "Monk: Beginner Equipment";
     }
 }
 public override void OnGossip(GameServer server, GameClient client, string message)
 {
     {
         if (message.Contains("Help"))
         {
             Mundane.Show(Scope.NearbyAislings,
                          new ServerFormat0D {
                 Text = "What do you need? Talk to me closer boy I am getting old", Serial = Mundane.Serial
             });
         }
     }
 }
Beispiel #7
0
        public Delta(GameServer server, Mundane mundane) : base(server, mundane)
        {
            Mundane.Template.QuestKey = "delta_quest";

            SequenceMenu.DisplayImage = (ushort)Mundane.Template.Image;
            SequenceMenu.Sequences.Add(new DialogSequence
            {
                Title       = Mundane.Template.Name,
                DisplayText = "This place is infested with walkers. if you help me, In return, I'll take care of you.",
                CanMoveBack = false,
                CanMoveNext = true
            });
            SequenceMenu.Sequences.Add(new DialogSequence
            {
                Title       = Mundane.Template.Name,
                DisplayText = "So i'll do you, if you scratch mine. wait that does not sound right does it?",
                CanMoveBack = true,
                CanMoveNext = true
            });
            SequenceMenu.Sequences.Add(new DialogSequence
            {
                Title          = Mundane.Template.Name,
                DisplayText    = "Interested?",
                HasOptions     = true,
                OnSequenceStep = (sender, args) =>
                {
                    if (args.HasOptions)
                    {
                        sender.Client.SendOptionsDialog(Mundane, "Keen?",
                                                        new OptionsDataItem(0x0010, "Yes"),
                                                        new OptionsDataItem(0x0011, "what's do you mean by scratch?"),
                                                        new OptionsDataItem(0x0012, "f**k off, this is not the time.")
                                                        );
                    }
                }
            });
            SequenceMenu.Sequences.Add(new DialogSequence
            {
                Title          = Mundane.Template.Name,
                DisplayText    = string.Empty,
                HasOptions     = true,
                OnSequenceStep = (sender, args) =>
                {
                    if (args.HasOptions)
                    {
                        sender.Client.SendOptionsDialog(Mundane,
                                                        "You killed them?! i actually was not expecting you to come back....... um.... (shrugs)",
                                                        new OptionsDataItem(0x0017, "Now about my reward...")
                                                        );
                    }
                }
            });
        }
        public void LearnSkill(Mundane Source, SkillTemplate subject, string message)
        {
            if (PayPrerequisites(subject.Prerequisites))
            {
                Skill.GiveTo(this, subject.Name);
                SendOptionsDialog(Source, message);

                Aisling.Show(Scope.NearbyAislings,
                             new ServerFormat29((uint)Aisling.Serial, (uint)Source.Serial,
                                                subject?.TargetAnimation ?? 124,
                                                subject?.TargetAnimation ?? 124, 100));
            }
        }
        public macronator(GameServer server, Mundane mundane) : base(server, mundane)
        {
            Mundane.Template.QuestKey = "macronator_quest";

            SequenceMenu.DisplayImage = (ushort)Mundane.Template.Image;
            SequenceMenu.Sequences.Add(new DialogSequence
            {
                Title       = Mundane.Template.Name,
                DisplayText =
                    "We trapped these monsters here to harvest there bones, but it seems we are under staffed."
            });
            SequenceMenu.Sequences.Add(new DialogSequence
            {
                Title       = Mundane.Template.Name,
                DisplayText =
                    "The guy who was supposed to knock them on the head shot through, Said he had the shits or something."
            });
            SequenceMenu.Sequences.Add(new DialogSequence
            {
                Title          = Mundane.Template.Name,
                DisplayText    = "Interested?",
                HasOptions     = true,
                OnSequenceStep = (sender, args) =>
                {
                    if (args.HasOptions)
                    {
                        sender.Client.SendOptionsDialog(Mundane, "Can you help me knock these on the head?",
                                                        new OptionsDataItem(0x0010, "My Pleasure."),
                                                        new OptionsDataItem(0x0011, "But they are in a cage.. how?"),
                                                        new OptionsDataItem(0x0012, "I'm not ya slave c**t.")
                                                        );
                    }
                }
            });
            SequenceMenu.Sequences.Add(new DialogSequence
            {
                Title          = Mundane.Template.Name,
                DisplayText    = string.Empty,
                HasOptions     = true,
                OnSequenceStep = (sender, args) =>
                {
                    if (args.HasOptions)
                    {
                        sender.Client.SendOptionsDialog(Mundane,
                                                        "See you look good at this. Not so bad - was it?",
                                                        new OptionsDataItem(0x0017, "a piece of piss mate.")
                                                        );
                    }
                }
            });
        }
Beispiel #10
0
        public Sunup(GameServer server, Mundane mundane) : base(server, mundane)
        {
            Mundane.Template.QuestKey = "sunup_quest";

            SequenceMenu.DisplayImage = (ushort)Mundane.Template.Image;
            SequenceMenu.Sequences.Add(new DialogSequence
            {
                Title       = Mundane.Template.Name,
                DisplayText =
                    "Wow, You made it this far! that's impressive. I guess you need to get over this gate huh?"
            });
            SequenceMenu.Sequences.Add(new DialogSequence
            {
                Title       = Mundane.Template.Name,
                DisplayText = "Well if you wanna get past this, you need to prove yourself first."
            });
            SequenceMenu.Sequences.Add(new DialogSequence
            {
                Title          = Mundane.Template.Name,
                DisplayText    = "?",
                HasOptions     = true,
                OnSequenceStep = (sender, args) =>
                {
                    if (args.HasOptions)
                    {
                        sender.Client.SendOptionsDialog(Mundane, "So, what's it gonna be mate?",
                                                        new OptionsDataItem(0x0010, "Get me over gate you."),
                                                        new OptionsDataItem(0x0011, "you seriously gonna make me do more shit?"),
                                                        new OptionsDataItem(0x0012, "f**k off dick head.")
                                                        );
                    }
                }
            });
            SequenceMenu.Sequences.Add(new DialogSequence
            {
                Title          = Mundane.Template.Name,
                DisplayText    = string.Empty,
                HasOptions     = true,
                OnSequenceStep = (sender, args) =>
                {
                    if (args.HasOptions)
                    {
                        sender.Client.SendOptionsDialog(Mundane,
                                                        $"Nice work {sender.Username.ToString()}. Now give me that shit.",
                                                        new OptionsDataItem(0x0017, "Hand the items to Sunup")
                                                        );
                    }
                }
            });
        }
Beispiel #11
0
        public Gos(GameServer server, Mundane mundane) : base(server, mundane)
        {
            Mundane.Template.QuestKey = "gos_quest";

            SequenceMenu.DisplayImage = (ushort)Mundane.Template.Image;
            SequenceMenu.Sequences.Add(new DialogSequence
            {
                Title       = Mundane.Template.Name,
                DisplayText = "Man, Look around, can you believe this shit?! f****n rats everywhere!"
            });
            SequenceMenu.Sequences.Add(new DialogSequence
            {
                Title       = Mundane.Template.Name,
                DisplayText = "Looks like you need to level, so why not go kill some."
            });
            SequenceMenu.Sequences.Add(new DialogSequence
            {
                Title          = Mundane.Template.Name,
                DisplayText    = "Interested?",
                HasOptions     = true,
                OnSequenceStep = (sender, args) =>
                {
                    if (args.HasOptions)
                    {
                        sender.Client.SendOptionsDialog(Mundane, "Want to help?",
                                                        new OptionsDataItem(0x0010, "Yeah, I'll help."),
                                                        new OptionsDataItem(0x0011, "what's in it for me?"),
                                                        new OptionsDataItem(0x0012, "nah, I'm not killing rats for you. f**k off.")
                                                        );
                    }
                }
            });
            SequenceMenu.Sequences.Add(new DialogSequence
            {
                Title          = Mundane.Template.Name,
                DisplayText    = string.Empty,
                HasOptions     = true,
                OnSequenceStep = (sender, args) =>
                {
                    if (args.HasOptions)
                    {
                        sender.Client.SendOptionsDialog(Mundane,
                                                        $"oye {sender.Path.ToString()}, Nice job.",
                                                        new OptionsDataItem(0x0017, "Hand over the rat shit")
                                                        );
                    }
                }
            });
        }
Beispiel #12
0
        public Slyk(GameServer server, Mundane mundane)

            : base(server, mundane)
        {
            //this is called on script compile, build a quest.
            quest             = new Quest();
            quest.Name        = "Stick n' Swing";
            quest.ItemRewards = new List <string>()
            {
                "Stick"
            };
            quest.SkillRewards = new List <string>()
            {
                "Assail"
            };
        }
 public StateExample(GameServer server, Mundane mundane)
     : base(server, mundane)
 {
     quest               = new Quest();
     quest.Name          = "some unique name";
     quest.LegendRewards = new List <Legend.LegendItem>
     {
         new Legend.LegendItem
         {
             Category = "Class",
             Color    = (byte)LegendColor.Blue,
             Icon     = (byte)LegendIcon.Priest,
             Value    = "some legend mark"
         }
     };
 }
        public Benson(GameServer server, Mundane mundane) : base(server, mundane)
        {
            Mundane.Template.QuestKey = "Benson_quest";

            SequenceMenu.DisplayImage = (ushort)Mundane.Template.Image;
            SequenceMenu.Sequences.Add(new DialogSequence
            {
                Title       = Mundane.Template.Name,
                DisplayText = "See that c**t -  Gos, over there?"
            });
            SequenceMenu.Sequences.Add(new DialogSequence
            {
                Title       = Mundane.Template.Name,
                DisplayText = "go and tell Gos that he's a pussy."
            });
            SequenceMenu.Sequences.Add(new DialogSequence
            {
                Title          = Mundane.Template.Name,
                DisplayText    = "Interested?",
                HasOptions     = true,
                OnSequenceStep = (sender, args) =>
                {
                    if (args.HasOptions)
                    {
                        sender.Client.SendOptionsDialog(Mundane, "Or are you the pussy?",
                                                        new OptionsDataItem(0x0010, "I'll go tell him"),
                                                        new OptionsDataItem(0x0011, "no, you are.")
                                                        );
                    }
                }
            });
            SequenceMenu.Sequences.Add(new DialogSequence
            {
                Title          = Mundane.Template.Name,
                DisplayText    = string.Empty,
                HasOptions     = true,
                OnSequenceStep = (sender, args) =>
                {
                    if (args.HasOptions)
                    {
                        sender.Client.SendOptionsDialog(Mundane, "haha, what a wanker, here you go.");
                    }
                }
            });
        }
Beispiel #15
0
 public override void OnGossip(GameServer server, GameClient client, string message)
 {
     {
         if (message.Contains("Praise Glioca"))
         {
             {
                 var script = ScriptManager.Load <SpellScript>("armachd", Spell.Create(3, ServerContext.GlobalSpellTemplateCache["armachd"]));
                 {
                     script.OnUse(Mundane, client.Aisling);
                 }
                 Mundane.Show(Scope.NearbyAislings,
                              new ServerFormat0D {
                     Text = "Thou Art Our Savior!", Serial = Mundane.Serial
                 });
             }
         }
     }
 }
Beispiel #16
0
        public StateExample(GameServer server, Mundane mundane)
            : base(server, mundane)
        {
            //this is called on script compile, build a quest.

            quest               = new Quest();
            quest.Name          = "some unique name";
            quest.LegendRewards = new List <Legend.LegendItem>()
            {
                new Legend.LegendItem()
                {
                    Category = "Class",
                    Color    = (byte)LegendColor.Blue,
                    Icon     = (byte)LegendIcon.Priest,
                    Value    = "some legend mark"
                },
            };
        }
        public buffgiver(GameServer server, Mundane mundane) : base(server, mundane)
        {
            var Steps = new List <Step>();

            Steps.Add(new Step()
            {
                Body = "Hello.", ScriptId = 0x0000, Serial = (uint)Mundane.Serial, StepId = 0x0000, Title = this.Mundane.Template.Name, HasBack = false, HasNext = true, Image = (ushort)Mundane.Template.Image
            });
            Steps.Add(new Step()
            {
                Body = "There becomes a point in everybodys life. Where one must say to himself, Shit.", ScriptId = 0x0001, Serial = (uint)Mundane.Serial, StepId = 0x0001, Title = this.Mundane.Template.Name, HasBack = false, HasNext = true, Image = (ushort)Mundane.Template.Image
            });
            Steps.Add(new Step()
            {
                Body = "Shit becomes the shadow to that of a dark and fearful happening.", ScriptId = 0x0002, Serial = (uint)Mundane.Serial, StepId = 0x0002, Title = this.Mundane.Template.Name, HasBack = false, HasNext = true, Image = (ushort)Mundane.Template.Image
            });
            Steps.Add(new Step()
            {
                Body = "We call this the fruits of the happening", ScriptId = 0x0003, Serial = (uint)Mundane.Serial, StepId = 0x0003, Title = this.Mundane.Template.Name, HasBack = false, HasNext = true, Image = (ushort)Mundane.Template.Image
            });
            Steps.Add(new Step()
            {
                Body = "Don't let this happen to you!", ScriptId = 0x0004, Serial = (uint)Mundane.Serial, StepId = 0x0004, Title = this.Mundane.Template.Name, HasBack = false, HasNext = true, Image = (ushort)Mundane.Template.Image
            });
            Steps.Add(new Step()
            {
                Body = "Let me aid your fagile frame. I will cast apon the magic of great magnitude. ", ScriptId = 0x0005, Serial = (uint)Mundane.Serial, StepId = 0x0005, Title = this.Mundane.Template.Name, HasBack = false, HasNext = false, Image = (ushort)0x8066
            });


            dialogs = new NormalPopup()
            {
                Steps       = Steps,
                CurrentStep = 0,
                TotalSteps  = Steps.Count,
            };
        }
Beispiel #18
0
 public LearnSkills(GameServer server, Mundane mundane)
     : base(server, mundane)
 {
 }
Beispiel #19
0
 public shop1(GameServer server, Mundane mundane) : base(server, mundane)
 {
 }
 public void SendSpellForgetDialog(Mundane mundane, string text, ushort step)
 {
     Send(new ServerFormat2F(mundane, text, new SpellForfeitData(step)));
 }
 public ArenaMaster(GameServer server, Mundane mundane)
     : base(server, mundane)
 {
 }
 public void SendOptionsDialog(Mundane mundane, string text, string args, params OptionsDataItem[] options)
 {
     Send(new ServerFormat2F(mundane, text, new OptionsPlusArgsData(options, args)));
 }
 public void SendSpellLearnDialog(Mundane mundane, string text, ushort step, IEnumerable <SpellTemplate> spells)
 {
     Send(new ServerFormat2F(mundane, text, new SpellAcquireData(step, spells)));
 }
Beispiel #24
0
 public MundaneReactorExample(GameServer server, Mundane mundane) : base(server, mundane)
 {
 }
 public void SendItemSellDialog(Mundane mundane, string text, ushort step, IEnumerable <byte> items)
 {
     Send(new ServerFormat2F(mundane, text, new ItemSellData(step, items)));
 }
Beispiel #26
0
 public ClassChooser(GameServer server, Mundane mundane)
     : base(server, mundane)
 {
 }
Beispiel #27
0
 public MultiScriptNpc(GameServer server, Mundane mundane) : base(server, mundane)
 {
 }
Beispiel #28
0
 public simple_generic(GameServer server, Mundane mundane) : base(server, mundane)
 {
 }
Beispiel #29
0
        public override void Load()
        {
            // Will show up in client.log under the ExampleMod name
            Logger.InfoFormat("{0} example logging", Name);
            // In older tModLoader versions we used: ErrorLogger.Log("blabla");
            // Replace that with above

            // Registers a new hotkey
            RandomBuffHotKey = RegisterHotKey("Random Buff", "P");             // See https://docs.microsoft.com/en-us/previous-versions/windows/xna/bb197781(v%3dxnagamestudio.41) for special keys

            // Registers a new custom currency
            FaceCustomCurrencyId = CustomCurrencyManager.RegisterCurrency(new ExampleCustomCurrency(ModContent.ItemType <Items.Face>(), 999L));

            Mundane.AddHacks();

            // All code below runs only if we're not loading on a server
            if (!Main.dedServ)
            {
                // Add certain equip textures
                AddEquipTexture(null, EquipType.Legs, "ExampleRobe_Legs", "ExampleMod/Items/Armor/ExampleRobe_Legs");
                AddEquipTexture(new Items.Armor.BlockyHead(), null, EquipType.Head, "BlockyHead", "ExampleMod/Items/Armor/ExampleCostume_Head");
                AddEquipTexture(new Items.Armor.BlockyBody(), null, EquipType.Body, "BlockyBody", "ExampleMod/Items/Armor/ExampleCostume_Body", "ExampleMod/Items/Armor/ExampleCostume_Arms");
                AddEquipTexture(new Items.Armor.BlockyLegs(), null, EquipType.Legs, "BlockyLeg", "ExampleMod/Items/Armor/ExampleCostume_Legs");

                // Register a new music box
                AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/MarbleGallery"), ItemType("ExampleMusicBox"), TileType("ExampleMusicBox"));

                // Change the vanilla loom texture
                Main.instance.LoadTiles(TileID.Loom);                             // First load the tile texture
                Main.tileTexture[TileID.Loom] = GetTexture("Tiles/AnimatedLoom"); // Now we change it

                //What if....Replace a vanilla item texture and equip texture.
                //Main.itemTexture[ItemID.CopperHelmet] = GetTexture("Resprite/CopperHelmet_Item");
                //Item copperHelmet = new Item();
                //copperHelmet.SetDefaults(ItemID.CopperHelmet);
                //Main.armorHeadLoaded[copperHelmet.headSlot] = true;
                //Main.armorHeadTexture[copperHelmet.headSlot] = GetTexture("Resprite/CopperHelmet_Head");

                // Create new skies and screen filters
                Filters.Scene["ExampleMod:PuritySpirit"]       = new Filter(new PuritySpiritScreenShaderData("FilterMiniTower").UseColor(0.4f, 0.9f, 0.4f).UseOpacity(0.7f), EffectPriority.VeryHigh);
                SkyManager.Instance["ExampleMod:PuritySpirit"] = new PuritySpiritSky();
                Filters.Scene["ExampleMod:MonolithVoid"]       = new Filter(new ScreenShaderData("FilterMoonLord"), EffectPriority.Medium);
                SkyManager.Instance["ExampleMod:MonolithVoid"] = new VoidSky();
                GameShaders.Armor.BindShader(ModContent.ItemType <Items.ExampleDye>(), new ArmorShaderData(new Ref <Effect>(GetEffect("Effects/ExampleEffect")), "ExampleDyePass"));
                GameShaders.Hair.BindShader(ModContent.ItemType <Items.ExampleHairDye>(), new LegacyHairShaderData().UseLegacyMethod((Player player, Color newColor, ref bool lighting) => Color.Green));
                GameShaders.Misc["ExampleMod:DeathAnimation"] = new MiscShaderData(new Ref <Effect>(GetEffect("Effects/ExampleEffectDeath")), "DeathAnimation").UseImage("Images/Misc/Perlin");

                if (FontExists("Fonts/ExampleFont"))
                {
                    exampleFont = GetFont("Fonts/ExampleFont");
                }

                // Custom UI
                ExampleUI = new ExampleUI();
                ExampleUI.Activate();
                _exampleUserInterface = new UserInterface();
                _exampleUserInterface.SetState(ExampleUI);

                // Custom Resource Bar
                ExampleResourceBar = new ExampleResourceBar();
                _exampleResourceBarUserInterface = new UserInterface();
                _exampleResourceBarUserInterface.SetState(ExampleResourceBar);

                // UserInterface can only show 1 UIState at a time. If you want different "pages" for a UI, switch between UIStates on the same UserInterface instance.
                // We want both the Coin counter and the Example Person UI to be independent and coexist simultaneously, so we have them each in their own UserInterface.
                ExamplePersonUserInterface = new UserInterface();
                // We will call .SetState later in ExamplePerson.OnChatButtonClicked
            }

            // Register custom mod translations, lives left is for Spirit of Purity
            // See the .lang files in the Localization folder for an easier to manage approach to translations. These few examples are here just to illustrate the concept.
            ModTranslation text = CreateTranslation("LivesLeft");

            text.SetDefault("{0} has {1} lives left!");
            AddTranslation(text);
            text = CreateTranslation("LifeLeft");
            text.SetDefault("{0} has 1 life left!");
            AddTranslation(text);
            text = CreateTranslation("NPCTalk");
            text.SetDefault("<{0}> {1}");
            AddTranslation(text);
            text = CreateTranslation("Common.LocalizedLabelDynamic");
            text.SetDefault($"[i:{ModContent.ItemType<Items.Weapons.SpectreGun>()}]  This dynamic label is added in ExampleMod.Load");
            AddTranslation(text);

            // Volcano warning is for the random volcano tremor
            text = CreateTranslation("VolcanoWarning");
            text.SetDefault("Did you hear something....A Volcano! Find Cover!");
            AddTranslation(text);
        }
Beispiel #30
0
 public MonkForms(GameServer server, Mundane mundane) : base(server, mundane)
 {
 }