[FSOD] Shatters Updated Code

Posts 115 of 34 · Page 1 of 3
[FSOD] Shatters Updated Code
Hello,

I've been working on the shatters code that has been posted here before, but was originally used from a source by @MikeRaarupBirk, and i've updated some of the code(drops, npc behaviors, etc).

Link to his original source: http://www.mpgh.net/forum/showthread.php?t=1135142

The map and textures are all the same, just a change in the behavior code.


New Added Things:
•Updated Drop Rates To Real Realm Drops ( feel free to edit yourself )
•Added pointers/notes for what some of the behaviors do for the new people.
•Changed how the stone paladin and stone mage && knight spawn work[Explanation below]
•Made the 1st boss bridge pillars spawn *correct* minions like real realm, and I also made it be on how close you are.


When I first tested this code, I noticed that the spawner(paladin and stone knight/mage) only spawned one of them, so I tested a few different loops of code, and finally found one that worked.

A basic explanation of how it works: The code basically in dumbified terms:

Bridge Pillars: The bridge pillars spawn the coordinated monsters for their pillar if you are "x" range of the pillar, so that the monsters don't over-flood the map and ruin the experience.

Paladin / Stone Mage&Knight Spawner: When this code was posted, the spawners only spawned one monster and then stopped, what I have done is updated it so that when the monsters die, it loops to another State that checks if the monsters are alive, and if they are, it waits and checks again in a few seconds. Upon the second check, if they are dead, it loops back to the main part where it spawns the minions over again if you are in close enough proximity.


These aren't some epic major coding updates lol, just a few flaws I found in the shatters code that I thought I could help make work better.
Nothing more, but I do hope you guys enjoy this post, and if you find any flaws, feel free to tell me so I can try and help you to the fullest extent.

Have a great day, I will be posting a link to the code as it is past the 100,000 character limit allowed on MPGH, but also virus scans for the file for extra safety.

Raw Text Link: http://pastebin.com/raw/5bxeZdYb
I posted the RAW link, because as the code is hundreds of lines long, this allows you to press ctrl + a to select all and copy it, on the main pastebin site if you pressed ctrl + a, it would copy all the stuff on the website instead of just the code.

Virus Scan 1: https://virusscan.jotti.org/en-US/fi...job/xqrqczyed0
Virus Scan 2: https://www.virustotal.com/en/file/2...is/1484311905/

BehaviorDb.Shatters_mpgh.net.rar7 KB · 404 downloads Clean
If you updated my old one, it was originally from my source, no one elses ecks dee
Quote Originally Posted by MikeRaarupBirk View Post
If you updated my old one, it was originally from my source, no one elses ecks dee
Hello, You are correct.

I forgot where I got the beginning shatters code, but yes it was your code that you posted, I will update the thread with credit to you and link your thread as well, sorry for the mishap.
Looks good.

Approved
How are you guys so good at coding I tried changing the loot drop but then i got all messed up and didn't let me rebuild. Anyways TY for this new amazing shatters code. I also thank Mike for making an amazing code. I really want to code but i'm just stupid
Quote Originally Posted by Yul0627 View Post
How are you guys so good at coding I tried changing the loot drop but then i got all messed up and didn't let me rebuild. Anyways TY for this new amazing shatters code. I also thank Mike for making an amazing code. I really want to code but i'm just stupid
Haha don't be discouraged, you'll get there. It just takes time.

Keep your head up homie, and you'll get better, I believe in you.
You will make one for shaitan's?.. bcs my shaitan is broken as .. so yea , thanks anyways for shatters
Quote Originally Posted by badboyallan123 View Post
You will make one for shaitan's?.. bcs my shaitan is broken as .. so yea , thanks anyways for shatters
Hey, I assume you're running Fabiano's source as this is what the title is for.

I have gone ahead and looked over the shaitan's code I have, and ran it on multiple classes to test different survivability(not a word but go with it lol), mainly to check how accurate it is on different classes with differed defense bonus/abilities/DPS, as well as make sure the code works properly of course, so that when I gave u it, it would work 100%.

----------

The first code will be the Worlds code: Create a new class code named LairofShaitan.cs in your, "wServer/Realm/Worlds" folder in your Visual Studio. Once you've done this, go ahead and put this code into it.

 
LairofShaitan.cs
Code:
#region

using wServer.networking;

#endregion

namespace wServer.realm.worlds
{
    public class LairofShaitan : World
    {
        public LairofShaitan()
        {
            Name = "Lair of Shaitan";
            ClientWorldName = "dungeons.Lair_of_Shaitan";
            Background = 0;
            AllowTeleport = true;
        }

        protected override void Init()
        {
            LoadMap("wServer.realm.worlds.maps.shaitan.jm", MapType.Json);
        }

        public override World GetInstance(Client psr)
        {
            return Manager.AddWorld(new LairofShaitan());
        }
    }
}


---------

The second code is going to be the behavior's of the dungeon for you.

You're going to want to place this code/create a new class, in your Visual Studio under the folders, "wServer/Logic/db".
Name this file: BehaviorDb.Shaitan.cs -> Inside this code you're going to put this:

 
BehaviorDb.Shaitan.cs
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using wServer.logic.behaviors;
using wServer.logic.transitions;
using wServer.logic.loot;

namespace wServer.logic
{
    partial class BehaviorDb
    {

        private _ Shaitan = () => Behav()
            .Init("md1 Head of Shaitan",
                new State(
                    new DropPortalOnDeath("Glowing Realm Portal", 100, PortalDespawnTimeSec: 360),

                    new OnDeathBehavior(new ApplySetpiece("ShaitanBossDeath")),
                    new TransformOnDeath("md1 Loot Balloon Shaitan", returnToSpawn: true),
                    new CopyDamageOnDeath("md1 Loot Balloon Shaitan"),
                    new Taunt(new string[3]
                    {
                        "Start",
                        "Ring_Attack",
                        "Ring_Attack2"
                    },
                    text: "You are nothing more than nutiment for my roots.", cooldown: 15000),         //Feel free to make the cooldown between 11500->16500 depending
                                                                                                        //On the latency of your server, or how quick you want it.

                    new State("Idle",
                        new ConditionalEffect(ConditionEffectIndex.Invulnerable),
                        new PlayerWithinTransition(3, "Start")
                    ),
                    new State("Start",
                        new Taunt("Come closer, feel the HELL!"),
                        new Shoot(10, count: 9, shootAngle: (float)(180 / 4), predictive: 0.7, coolDown: 1000),
                        new Shoot(10, count: 1, shootAngle: (float)30, angleOffset: (float)45, projectileIndex: 1, coolDown: 1000),
                        new Shoot(10, count: 1, shootAngle: (float)30, angleOffset: (float)-45, projectileIndex: 0, coolDown: 1000),
                        new HpLessTransition(0.9, "Ring_Attack")
                    ),
                    new State("Ring_Attack",
                        new Prioritize(
                            new StayCloseToSpawn(0.5, 10)
                        ),
                        new Shoot(10, count: 24, projectileIndex: 1, coolDown: 5000),
                        new Shoot(10, count: 24, projectileIndex: 1, coolDown: 3000),
                        new HpLessTransition(0.7, "Ring_Attack2")
                    ),
                    new State("Ring_Attack2",
                        new State("Yo_man_I_show_you_what_I_can_do",
                            new Timed(600, new Shoot(2, count: 12)),
                            new TimedTransition(800, "Ring")
                        ),
                        new State("Ring",
                            new Shoot(0, count: 3, projectileIndex: 1, fixedAngle: 0),
                            new TimedTransition(250, "Ring1")
                        ),
                        new State("Ring1",
                            new Shoot(0, count: 5, projectileIndex: 0, fixedAngle: fixedAngle_RingAttack2),
                            new TimedTransition(250, "Ring2")
                        ),
                        new State("Ring2",
                            new Shoot(0, count: 2, projectileIndex: 1, fixedAngle: fixedAngle_RingAttack2 * 2),
                            new TimedTransition(250, "Ring3")
                        ),
                        new State("Ring3",
                            new Shoot(10, count: 7, projectileIndex: 0, fixedAngle: fixedAngle_RingAttack2 * 3),
                            new TimedTransition(250, "Ring4")
                        ),
                        new State("Ring4",
                            new Shoot(10, count: 11, projectileIndex: 1, fixedAngle: fixedAngle_RingAttack2 * 4),
                            new TimedTransition(250, "Ring5")
                        ),
                        new State("Ring5",
                            new Shoot(10, count: 3, projectileIndex: 0, fixedAngle: fixedAngle_RingAttack2 * 5),
                            new TimedTransition(250, "-Ring")
                        ),
                        new State("-Ring",
                            new Shoot(10, count: 4, projectileIndex: 1, fixedAngle: fixedAngle_RingAttack2 * 6),
                            new TimedTransition(250, "-Ring1")
                        ),
                        new State("-Ring1",
                            new Shoot(10, count: 5, projectileIndex: 0, fixedAngle: fixedAngle_RingAttack2 * 5),
                            new TimedTransition(250, "-Ring2")
                        ),
                        new State("-Ring2",
                            new Shoot(10, count: 6, projectileIndex: 1, fixedAngle: fixedAngle_RingAttack2 * 4),
                            new TimedTransition(250, "-Ring3")
                        ),
                        new State("-Ring3",
                            new Shoot(10, count: 2, projectileIndex: 0, fixedAngle: fixedAngle_RingAttack2 * 3),
                            new TimedTransition(250, "-Ring4")
                        ),
                        new State("-Ring4",
                            new Shoot(10, count: 3, projectileIndex: 1, fixedAngle: fixedAngle_RingAttack2 * 2),
                            new TimedTransition(250, "-Ring5")
                        ),
                        new State("-Ring5",
                            new Shoot(10, count: 12, projectileIndex: 0, fixedAngle: fixedAngle_RingAttack2),
                            new TimedTransition(250, "-Ring6")
                        ),
                        new State("-Ring6",
                            new Shoot(10, count: 7, projectileIndex: 1, fixedAngle: 0),
                            new Timed(200, new Shoot(10, count: 3, shootAngle: (float)30, defaultAngle: (float)45, projectileIndex: 1)),
                            new Timed(200, new Shoot(10, count: 3, shootAngle: (float)30, defaultAngle: (float)135, projectileIndex: 1)),
                            new TimedTransition(200, "StartTheFun")
                        )
                    ),
                    new State("StartTheFun",
                        new Taunt(true, 0, "Die!"),
                        new Flash(0xf0e68c, flashPeriod: 0.5, flashRepeats: 10),
                        new ReturnToSpawn(speed: 1),
                        new TimedTransition(5000, "RAGE_MODE")
                    ),
                    new State("RAGE_MODE",
                        new State("Everything_is_cool",
                            new State("spawn_minions",
                                new HpLessTransition(0.2, "Ending Phase"),
                                new InvisiToss("md1 Right Hand of Shaitan", range: 5.0, angle: 180),
                                new InvisiToss("md1 Left Hand of Shaitan", range: 5.0, angle: 360),

                                new TimedTransition(0, "shoot1")
                            ),
                            new State("shoot1",
                                new HpLessTransition(0.3, "Ending Phase"),
                                new Shoot(0, projectileIndex: 1, fixedAngle: 225),
                                new Shoot(0, projectileIndex: 0, fixedAngle: 315),
                                new TimedTransition(800, "shoot2")
                            ),
                            new State("shoot2",
                                new HpLessTransition(0.3, "Ending Phase"),
                                new Shoot(0, 2, shootAngle: 10, projectileIndex: 1, fixedAngle: 45),
                                new Shoot(0, 2, shootAngle: 10, projectileIndex: 0, fixedAngle: 135),
                                new TimedTransition(800, "shoot3")
                            ),
                            new State("shoot3",
                                new HpLessTransition(0.3, "Ending Phase"),
                                new Shoot(0, 2, shootAngle: 15, projectileIndex: 0, fixedAngle: 45),
                                new Shoot(0, 2, shootAngle: 15, projectileIndex: 1, fixedAngle: 135),
                                new TimedTransition(800, "shoot1")
                            )
                        )
                    ),
                    new State("Ending Phase",
                        new Taunt(1, true, "Ahahaha!"),
                        new Shoot(10, count: 6, projectileIndex: 1),
                        new Shoot(10, count: 3, shootAngle: 15, predictive: 0.7, coolDown: 1000),
                        new State("shoot1",
                            new Shoot(0, projectileIndex: 0, fixedAngle: 45),
                            new Shoot(0, projectileIndex: 1, fixedAngle: 135),
                            new TimedTransition(1000, "shoot2")
                        ),
                        new State("shoot2",
                            new Shoot(0, 2, shootAngle: 15, projectileIndex: 0, fixedAngle: 45),
                            new Shoot(0, 2, shootAngle: 15, projectileIndex: 0, fixedAngle: 135),
                            new TimedTransition(1000, "shoot1")
                        )
                    )
                )
            )
            .Init("md1 Right Hand of Shaitan",
                new State(
                    new ConditionalEffect(ConditionEffectIndex.Invulnerable, true),

                    new EntityNotExistsTransition("md1 Head of Shaitan", 100, "Despawn"),

                                new TossObject("md1 CreepyHead", coolDown: 3600, coolDownOffset: 0),
                        new Shoot(10, count: 3, shootAngle: 15, predictive: 0.7, coolDown: 2000),
                    new State("I_WILL_HALP_YOU_BUD_<3",
                        new State("IMMA_MOVE_NAOW",
                                new InvisiToss("md1 CreepyHead", range: 5.0, angle: 180),
                            new PlayerWithinTransition(1, "IMMA_DONT_MOVE_NAOW"),
                            new State("shoot1",
                                new Shoot(10, fixedAngle: 25),
                                new TimedTransition(333, "shoot2")
                            ),
                            new State("shoot2",
                                new Shoot(10, fixedAngle: 50),
                            new Follow(.4, 14, 1),
                                new TimedTransition(333, "shoot3")
                            ),
                            new State("shoot3",

                                new Shoot(10, fixedAngle: 75),
                                new TimedTransition(333, "shoot1")
                            )
                        ),
                        new State("IMMA_DONT_MOVE_NAOW",
                            new TimedTransition(2000, "IMMA_MOVE_NAOW"),
                            new State("shoot1",
                                new Shoot(50, fixedAngle: 145),
                                new TimedTransition(333, "shoot2")
                            ),
                            new State("shoot2",
                                new Shoot(70, fixedAngle: 265),
                                new TimedTransition(333, "shoot3")
                            ),
                            new State("shoot3",
                                new Shoot(10, fixedAngle: 385),

                                new TimedTransition(333, "shoot1")
                            )
                        )
                    ),
                    new State("CUTIES_PROTECT_ME",
                        new Orbit(0.7, 1, target: "md1 Head of Shaitan", radiusVariance: 1),
                        new Shoot(10, coolDown: 2000)
                    ),
                    new State("Despawn",
                        new Timed(1000, new Suicide())
                    )
                )
            )
            .Init("md1 Left Hand of Shaitan",
                new State(
                    new ConditionalEffect(ConditionEffectIndex.Invulnerable, true),
                    new EntityNotExistsTransition("md1 Head of Shaitan", 100, "Despawn"),

                                new TossObject("md1 CreepyHead", coolDown: 3600, coolDownOffset: 0),

                        new Shoot(10, count: 3, shootAngle: 15, predictive: 0.7, coolDown: 2000),
                    new State("I_WILL_HALP_YOU_BUD_<3",
                        new State("IMMA_MOVE_NAOW",
                            new PlayerWithinTransition(1, "IMMA_DONT_MOVE_NAOW"),
                            new State("shoot1",
                                new Shoot(10, fixedAngle: 145),
                                new TimedTransition(333, "shoot2")
                            ),
                            new State("shoot2",
                                new Shoot(10, fixedAngle: 165),
                                new TimedTransition(333, "shoot3")
                            ),
                            new State("shoot3",
                                new Shoot(10, fixedAngle: 185),
                            new Follow(.4, 14, 1),
                                new TimedTransition(333, "shoot1")
                            )
                        ),
                        new State("IMMA_DONT_MOVE_NAOW",
                            new TimedTransition(2000, "IMMA_MOVE_NAOW"),
                            new State("shoot1",
                                new Shoot(10, fixedAngle: 145),
                                new TimedTransition(333, "shoot2")
                            ),
                            new State("shoot2",
                                new Shoot(10, fixedAngle: 65),
                                new TimedTransition(333, "shoot3")
                            ),
                            new State("shoot3",
                                new Shoot(10, fixedAngle: 285),
                                new TimedTransition(333, "shoot1")
                            )
                        )
                    ),
                    new State("CUTIES_PROTECT_ME",
                        new Orbit(0.7, 1, target: "md1 Head of Shaitan", radiusVariance: 1),
                        new Shoot(10, coolDown: 2000)
                    ),
                    new State("Despawn",
                        new Timed(1000, new Suicide())
                    )
                )
            )

                    .Init("md1 CreepyHead",
                new State(
                    new EntityNotExistsTransition("md1 Left Hand of Shaitan", 100, "Despawn"),
                    new State("I_WILL_HALP_YOU_BUD_<3",
                        new State("IMMA_MOVE_NAOW",
                            new Follow(.2, 14, 1),
                            new PlayerWithinTransition(1, "shoot1"),
                            new State("shoot1",
                        new Shoot(10, count: 1, shootAngle: (float)30, angleOffset: (float)45, projectileIndex: 0, coolDown: 1000)
                            )
                        )
                    ),
                    new State("CUTIES_PROTECT_ME",
                        new Orbit(0.7, 1, target: "md1 Head of Shaitan", radiusVariance: 1),
                        new Shoot(10, coolDown: 2000)
                    ),
                    new State("Despawn",
                        new Timed(1000, new Suicide())              //If this code doesn't work properly, or gives you errors, change the code to;
                                                                    //new Decay()        I never had issues, but just a heads up -KO
                    )
                )
            )

            .Init("md1 Loot Balloon Shaitan",
                new State(
                    new State("Idle",
                        new ConditionalEffect(ConditionEffectIndex.Invulnerable),
                        new TimedTransition(5000, "UnsetEffect")
                    ),
                    new State("UnsetEffect")
                ),
                new Threshold(0.1,
                    new ItemLoot("Skull of Endless Torment", 0.012),
                    new ItemLoot("Potion of Attack", 0.6)
                )
            );
    }
}


The final code is going to be the map code, as the file is a .jm file, i'm going to be giving you a pastebin link so that you are able to copy the code into your text editor(notepad++/Notepad) and save it yourself.

http://pastebin.com/raw/JEriNiTB

Once on the pastebin website, go ahead and copy the entire code and put it into notepad++ / notepad and save the file as LoD.jm and make sure you set it as all types when saving it so it is LoD.jm not LoD.jm.txt.

Once this is done, go into your "wServer/Realn/Worlds/Maps" folder inside your visual basic and right click on the maps folder and hover over Add and then select "Existing Item". Once that has been done click on the LoD.jm file you saved onto your PC and then once it has uploaded it to your maps folder, find the file on the side and make sure once it is in, you click "Build Action" and set it as, "Embedded Resource".


If you have complications with this code or set-up feel free to reply or inbox me and I will gladly help you.

Have a great day.
Lul , u gave me the map for LoD , not for shaitans
Quote Originally Posted by badboyallan123 View Post
Lul , u gave me the map for LoD , not for shaitans
Oh shit i'm sorry dude lmfao, I was trying to upload the LoD to another thread, my bad dude.

http://pastebin.com/raw/Pd9R3AsS
why does my reply not get sent?
Quote Originally Posted by Yul0627 View Post
why does my reply not get sent?
What was your reply?
Fixed loot to prod?
Quote Originally Posted by reveng3d View Post
•Updated Drop Rates To Real Realm Drops ( feel free to edit yourself )
Doesn't seem fixed.
Quote Originally Posted by USARotMG View Post
Fixed loot to prod?


Doesn't seem fixed.
yeah, it drops like that in prod agree xD
Quote Originally Posted by USARotMG View Post
Fixed loot to prod?


Doesn't seem fixed.
You're the only one getting loot, In a normal shatters on prod there's "x" amount of people to disperse the loot between.
Posts 115 of 34 · Page 1 of 3

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?