PostDr. Terrible Behavior (not fully complete)

Posts 18 of 8 · Page 1 of 1
Dr. Terrible Behavior
Ok i so am VERY new to coding, i started about 2 days ago. i used examples from other behaviors to learn how to do simple things with code. This Code took me about 1 day to complete. it needs a lot of perfection, but as i said, im a beginner. here it is:

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using wServer.realm;
using wServer.logic.attack;
using wServer.logic.movement;
using wServer.logic.loot;
using wServer.logic.taunt;
using wServer.logic.cond;

namespace wServer.logic
{
    partial class BehaviorDb
    {
        static _ Madlab = Behav()
            .Init(0x0976, Behaves("Dr Terrible",
                    new RunBehaviors(
                        Cooldown.Instance(4950, new SimpleTaunt("Have a taste of my Putrid Concoction, Hahaha!")),
                        Cooldown.Instance(5000, TossEnemyAtPlayer.Instance(10, 0x0978)),
                        Cooldown.Instance(10000, TossEnemyAtPlayer.Instance(10, 0x12aa)),
                        SimpleWandering.Instance(2, 1)
                               ),
                        HpLesserPercent.Instance(0.3f,
                                   new RunBehaviors(
                        Once.Instance(SetConditionEffect.Instance(ConditionEffectIndex.Invulnerable)),
                        Once.Instance(new SimpleTaunt("ARGHH! You have not deafeated me! Minions KILL THEM!!!")),
                        Once.Instance(SpawnMinion.Instance(0x1e25, 1, 2, 0, 100)),
                        Once.Instance(SpawnMinion.Instance(0x1e23, 1, 2, 0, 100)),
                        Once.Instance(SpawnMinion.Instance(0x1e24, 1, 2, 0, 100)),
                        Once.Instance(SpawnMinion.Instance(0x1e25, 1, 2, 0, 100)),
                        Once.Instance(SpawnMinion.Instance(0x1e23, 1, 2, 0, 100)),
                        Once.Instance(SpawnMinion.Instance(0x1e24, 1, 2, 0, 100)),
                        Cooldown.Instance(20000, Once.Instance(UnsetConditionEffect.Instance(ConditionEffectIndex.Invulnerable)))
                       )),

                    loot: new LootBehavior(LootDef.Empty,
                        Tuple.Create(100, new LootDef(0, 3, 0, 3,
                            Tuple.Create(0.01, (ILoot) new ItemLoot("Scepter of Fulmination")),
                            Tuple.Create(0.01, (ILoot) new ItemLoot("Conducting Wand")),
                            Tuple.Create(0.01, (ILoot) new ItemLoot("Robe of the Mad Scientist")),
                            Tuple.Create(0.01, (ILoot) new ItemLoot("Experimental Ring")),
                            Tuple.Create(0.15, (ILoot)new ItemLoot("Wine Cellar Incantation")),
                            Tuple.Create(0.05, (ILoot) new TierLoot(5, ItemType.Ability)),
                            Tuple.Create(0.05, (ILoot) new TierLoot(11, ItemType.Weapon)),
                            Tuple.Create(0.05, (ILoot) new TierLoot(12, ItemType.Armor)),
                            Tuple.Create(1.0, (ILoot) new StatPotionLoot(StatPotion.Wis))
                           )))))
            
            .Init(0x1e25, Behaves("Dr Terrible Mini Bot",
                    new RunBehaviors(
                        Chasing.Instance(3, 25, 3, null),
                        Cooldown.Instance(1000, MultiAttack.Instance( 10, 20 * (float)Math.PI / 180, 2, 0, 0))
                                  )))
            
            .Init(0x1e24, Behaves("Dr Terrible Rampage Cyborg",
                          new RunBehaviors(
                                      Chasing.Instance(5, 25, 1, null),
                                      Cooldown.Instance(800, SimpleAttack.Instance(10,0)),
                                      Cooldown.Instance(300, RingAttack.Instance(8,1,0,1))
                                  )))
            
            .Init(0x1e23, Behaves("Dr Terrible Escaped Experiment",
                          new RunBehaviors(
                                      SimpleWandering.Instance(2,1),
                                      Cooldown.Instance(800, SimpleAttack.Instance(10,0))
                                  )))
            
             .Init(0x0978, Behaves("Green Potion",
                    new RunBehaviors(
                        Cooldown.Instance(3000, RingAttack.Instance(6, 6, 0,0)),
                        Cooldown.Instance(3010, Die.Instance)
                       )))
            
             .Init(0x12aa, Behaves("Turret Attack",
                    new RunBehaviors(
                        Cooldown.Instance(1000, MultiAttack.Instance( 10, 20 * (float)Math.PI / 180, 2, 0, 0)),
                        Cooldown.Instance(9950, Die.Instance)
                       )));
    }
}
Credits to Trapped for the server files, Lunati for the TossEnemyAtPlayer Behavior, and C453 for a little help with the Green Potion Behaviors
I was actually about to make this my self.
Thanks!
Quote Originally Posted by Tachyonic View Post
I was actually about to make this my self.
Thanks!
NP, and if you dont mind, this is my first code i made, can you give any constructive criticism on improving my codes in the future?
@rangewolf5
For your fist, this is actually really good!
I've actually started messing around with setkey lately. C453 said it would be a good idea to start figuring it out.
Basically if you didn't know, it is used for setting different phases. After a new setkey is activated, then all the behaviors from the last key stop.
Just a little something that makes the codes a little easier.
Again though, This is very nice!
+1
@Tachyonic thanks, i will look into that, that might be just the key to start a O1 code but thats way far off for me right now.
Niiiceee i wonder if you'll gonna finish him before me ^^ and btw @Tachyonic Me and @Lunati already started on doing O1 on Trapped's source ^^
@pLolz i would love to finish him but i really don't know how to use set key, so i might make it a bit more like production realm, but i dont know if i can make him fully like production.
Well, SetKey is quite easy to use.

Code:
new SetKey (X,Y)
(with X and Y being two numbers. They can be anything as long as they aren't omitted.)

The code above should be placed with a group of behaviors (RunBehaviors/QueuedBehavior). Once a key has been set, all the behaviors within


Code:
IfEqual.Instance(X,Y
code,
code,
code,
derp,
code
)
will activate, and the behaviors that have been running before the SetKey will nullify. That's my understanding of SetKey to say the least.
Posts 18 of 8 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?