XP Gift Spawner

Posts 1–11 of 11 · Page 1 of 1
XP Gift Spawner
Here is the XP Gift Spawner made by @ManKindGaming and myself. Please contact either of us if you require assistance.

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using wServer.realm;
using wServer.logic.behaviors;
using wServer.logic.loot;
using wServer.logic.transitions;

namespace wServer.logic
{
    partial class BehaviorDb
    {
        _ XpGift = () => Behav()
      .Init("XP Gift C",
                new State(
                    new Prioritize(
                        new Protect(0.5, "XP Gift Spawner", protectionRange: 10),
                        new Wander(0.5)
                        )
                    ),
                    new Threshold(0.1,
                    new ItemLoot("Common Farm Egg", 0.05),
                    new ItemLoot("Uncommon Farm Egg", 0.01),
                    new ItemLoot("Legendary Farm Egg", 0.001)
                        )
           );
    }
}
Components:
XP Gift Spawner, wandering around and dropping loot.

Here is a different one if you want it:

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using wServer.realm;
using wServer.logic.behaviors;
using wServer.logic.loot;
using wServer.logic.transitions;

namespace wServer.logic
{
    partial class BehaviorDb
    {
        _ Xpfarm = () => Behav()
            .Init("XP Gift Spawner",
                new State(
                    new ConditionalEffect(ConditionEffectIndex.Invincible, true),
                    new State("idle",
                    new PlayerWithinTransition(10, "spawn1")
                    ),
                new State("spawn1",
                    new Spawn("XP Gift C", maxChildren: 1000, initialSpawn: 0.050, coolDown: 3500),
                    new TimedTransition(3600, "check")
                    ),
                new State("check",
                    new EntityNotExistsTransition("XP Gift C", 50, "idle")
                    )
                    )
            )
        ;
    }
}
Just make a file called BehaviorDb.xpspawner.cs
Enjoy


- - - Updated - - -

The bottom one is my one, whilst the top one is ManKind's.
Personally, the top one seems better.
Quote Originally Posted by Anime View Post
Here is the XP Gift Spawner made by @ManKindGaming and myself. Please contact either of us if you require assistance.

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using wServer.realm;
using wServer.logic.behaviors;
using wServer.logic.loot;
using wServer.logic.transitions;

namespace wServer.logic
{
    partial class BehaviorDb
    {
        _ XpGift = () => Behav()
      .Init("XP Gift C",
                new State(
                    new Prioritize(
                        new Protect(0.5, "XP Gift Spawner", protectionRange: 10),
                        new Wander(0.5)
                        )
                    ),
                    new Threshold(0.1,
                    new ItemLoot("Common Farm Egg", 0.05),
                    new ItemLoot("Uncommon Farm Egg", 0.01),
                    new ItemLoot("Legendary Farm Egg", 0.001)
                        )
           );
    }
}
Components:
XP Gift Spawner, wandering around and dropping loot.

Here is a different one if you want it:

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using wServer.realm;
using wServer.logic.behaviors;
using wServer.logic.loot;
using wServer.logic.transitions;

namespace wServer.logic
{
    partial class BehaviorDb
    {
        _ Xpfarm = () => Behav()
            .Init("XP Gift Spawner",
                new State(
                    new ConditionalEffect(ConditionEffectIndex.Invincible, true),
                    new State("idle",
                    new PlayerWithinTransition(10, "spawn1")
                    ),
                new State("spawn1",
                    new Spawn("XP Gift C", maxChildren: 1000, initialSpawn: 0.050, coolDown: 3500),
                    new TimedTransition(3600, "check")
                    ),
                new State("check",
                    new EntityNotExistsTransition("XP Gift C", 50, "idle")
                    )
                    )
            )
        ;
    }
}
Just make a file called BehaviorDb.xpspawner.cs
Enjoy


- - - Updated - - -

The bottom one is my one, whilst the top one is ManKind's.
Personally, the top one seems better.
Credits:
I did the original behavior on the bottom and them Mike patched it up for me and made it work, and then Infernape made it more rewarding. And the top behavior is 100% by me, if you want a cleaner version of the bottom code I am posting (posted) one.
Where should i post the file with the code?
Quote Originally Posted by mohammedss View Post
Where should i post the file with the code?
wserver-logic-db is the normal location to place behaviors
Quote Originally Posted by WcCrusher View Post
wserver-logic-db is the normal location to place behaviors
Yes, and rename it to whatever you want.
u should add at 1st rare egg 0.010
Quote Originally Posted by Littlizard View Post
u should add at 1st rare egg 0.010
It Should look like this
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using wServer.realm;
using wServer.logic.behaviors;
using wServer.logic.loot;
using wServer.logic.transitions;

namespace wServer.logic
{
partial class BehaviorDb
{
_ XpGift = () => Behav()
.Init("XP Gift C",
new State(
new Prioritize(
new Protect(0.5, "XP Gift Spawner", protectionRange: 10),
new Wander(0.5)
)
),
new Threshold(0.1,
new ItemLoot("Common Farm Egg", 0.05),
new ItemLoot("Uncommon Farm Egg", 0.01),
new ItemLoot("Rare Farm Egg", 0.010),
new ItemLoot("Legendary Farm Egg", 0.001)
)
);
}
}
Quote Originally Posted by TheFullMC123 View Post
It Should look like this
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using wServer.realm;
using wServer.logic.behaviors;
using wServer.logic.loot;
using wServer.logic.transitions;

namespace wServer.logic
{
partial class BehaviorDb
{
_ XpGift = () => Behav()
.Init("XP Gift C",
new State(
new Prioritize(
new Protect(0.5, "XP Gift Spawner", protectionRange: 10),
new Wander(0.5)
)
),
new Threshold(0.1,
new ItemLoot("Common Farm Egg", 0.05),
new ItemLoot("Uncommon Farm Egg", 0.01),
new ItemLoot("Rare Farm Egg", 0.010),
new ItemLoot("Legendary Farm Egg", 0.001)
)
);
}
}
i was gonna post it but.. ty

- - - Updated - - -
@Anime Something is wrong at both in 14 line when i build it it works but when i start is doesent
Quote Originally Posted by Littlizard View Post
i was gonna post it but.. ty

- - - Updated - - -
@Anime Something is wrong at both in 14 line when i build it it works but when i start is doesent
It is working 100% for me, so idk what is your problem. Maybe you don't actually have the XPGift spawner in your dat1.xml
Quote Originally Posted by Littlizard View Post
i was gonna post it but.. ty

- - - Updated - - -
@Anime Something is wrong at both in 14 line when i build it it works but when i start is doesent
As the creator of this code, I know that a common problem is that you are copying+pasting it wrong, or you are not using the FSOD source.
Its ok i forgot to add the XP Gift Spawner xml in dat1
Posts 1–11 of 11 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?