[Release] a new command

02/07/2009 23:19 taylor2846#1
ok this is the /pet command ok its not hard to do and i thank it will only work if u have the summon guard working becaz i us its atk type or u can edit it if u want but ul hafe to fix it up so it wont atk its self if u do that well any way here u go

find wear u put commands in and put this
Code:
                                        if (Splitter[0] == "/pet")
                                        {
                                            // /pet HP atk name mech lvl
                                            uint hp = 0;
                                            uint atk = 0;
                                            int mech = 0;
                                            short lvl = 0;
                                            hp = (uint.Parse(Splitter[1]));
                                            atk = (uint.Parse(Splitter[2]));
                                            string name = Splitter[3];
                                            mech = (int.Parse(Splitter[4]));
                                            lvl = (short.Parse(Splitter[5]));
                                            Mobs.newpet(Convert.ToInt16(MyChar.LocX), Convert.ToInt16(MyChar.LocY), Convert.ToInt16(MyChar.LocMap), hp, atk, name, mech, lvl, MyChar.UID);
                                        }
ok u got that now in Entities.cs find
Code:
public static void NewRBGuard(short x, short y, short map, uint owner,short glvl)
under that in a new void add

Code:
public static void newpet(short x, short y, short map, uint hp, uint atk, string name, int mech, short lvl, uint owner)
        {
            try
            {
                uint UID = (uint)General.Rand.Next(400000, 500000);
                while (AllMobs.Contains(UID))
                {
                    UID = (uint)General.Rand.Next(400000, 500000);
                }
                SingleMob Mob = new SingleMob(x, y, map, hp, hp, atk, atk, UID, name, mech, lvl, (byte)General.Rand.Next(8), 7, owner, false);
                AllMobs.Add(UID, Mob);
                Other.Charowner(owner).Guard = Mob;
                World.SpawnMobForPlayers(Mob, true);

            }
            catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); }
        }
ok i thak thats all fo rthe command it will be /pet HP atk name mech lvl
a exp will be /pet 200 200 test 111 255
tell me if thar are any problem and yes i codded this my self xD with the help of the summon guard skill

if u like press thanks
02/08/2009 00:28 Hoven#2
nice xD

AcidCo used 2 have this haha was always a fun command
02/08/2009 00:37 PeTe Ninja#3
how can i summon this while summoning guard
02/08/2009 01:11 taylor2846#4
u can us this to summon as much pets as u want xD so u can have 100 tatins atk your targit with tornado xd
02/08/2009 01:24 _Emme_#5
Quote:
if (Splitter[0] == "/pet")
{
// /pet HP atk name mech lvl
uint hp = 0;
uint atk = 0;
int mech = 0;
short lvl = 0;
hp = (uint.Parse(Splitter[1]));
atk = (uint.Parse(Splitter[2]));
string name = Splitter[3];
mech = (int.Parse(Splitter[4]));
lvl = (short.Parse(Splitter[5]));
Mobs.newpet(Convert.ToInt16(MyChar.LocX), Convert.ToInt16(MyChar.LocY), Convert.ToInt16(MyChar.LocMap), hp, atk, name, mech, lvl, MyChar.UID);
}
if (Splitter[0] == "/pet")
{
Mobs.newpet(Convert.ToInt16(MyChar.LocX), Convert.ToInt16(MyChar.LocY), Convert.ToInt16(MyChar.LocMap), uint.Parse(Splitter[1]), uint.Parse(Splitter[2]), Splitter[3], int.Parse(Splitter[4]), short.Parse(Splitter[5), MyChar.UID);
}
02/08/2009 02:03 InfamousNoone#6
Quote:
Originally Posted by EmmeTheCoder View Post
if (Splitter[0] == "/pet")
{
Mobs.newpet(Convert.ToInt16(MyChar.LocX), Convert.ToInt16(MyChar.LocY), Convert.ToInt16(MyChar.LocMap), uint.Parse(Splitter[1]), uint.Parse(Splitter[2]), Splitter[3], int.Parse(Splitter[4]), short.Parse(Splitter[5), MyChar.UID);
}
no he had the right idea

T.Parse() is faster than Convert.ToT()
02/08/2009 02:06 justprownage#7
How do you make it so it attacks the monster your character attacks?
02/08/2009 05:44 taylor2846#8
it will if u have it so guard do to becaaz it us atk type 7 so if u have summon guard it will work
07/16/2009 23:04 Pyro-G#9
I get errors Oo