[5165] Arrow reload

10/04/2010 15:21 †he Knight#1
Ughh.. again the noob juiced xD
This time I need help with Arrow reload ... I was searching for it , Nothing found so it would be nice if you can help.
Thanks.
[Only registered and activated users can see links. Click Here To Register...]
10/04/2010 16:05 Korvacs#2
Help with what....or do you just want to leach a complete system?
10/04/2010 16:26 †he Knight#3
Quote:
Originally Posted by Korvacs View Post
Help with what....or do you just want to leach a complete system?
What u mean??
10/04/2010 16:26 _Vodka#4
Find in Character.cs:
Code:
            Step:
inside it put:
Code:
                if (Equips.RightHand.ID >= 500003 && Equips.RightHand.ID < 500999 && arrowsloaded == false)
                {
                    if (InventoryContains(1050000, 1) && Equips.LeftHand.ID != 1050000 && Equips.LeftHand.ID != 1050001 && Equips.LeftHand.ID != 1050002)
                    {
                        arrowsloaded = true;
                        Item I = Equips.Get(5);
                        I.ID = 1050000;
                        I.UID = (uint)Rnd.Next(10000000);
                        I.MaxDur = I.DBInfo.Durability;
                        I.CurDur = I.MaxDur;

                        if (I.UID == 0)
                        {
                            I.UID = (uint)Rnd.Next(10000000);
                        }
                        MyClient.AddSend(Packets.AddItem(I, 5));
                        RemoveItem(this.NextItem(1050000));
                    }
                    if (InventoryContains(1050001, 1) && Equips.LeftHand.ID != 1050001 && Equips.LeftHand.ID != 1050000 && Equips.LeftHand.ID != 1050002)
                    {
                        arrowsloaded = true;
                        Item I = Equips.Get(5);
                        I.ID = 1050001;
                        I.UID = (uint)Rnd.Next(10000000);
                        I.MaxDur = I.DBInfo.Durability;
                        I.CurDur = I.MaxDur;

                        if (I.UID == 0)
                        {
                            I.UID = (uint)Rnd.Next(10000000);
                        }
                        MyClient.AddSend(Packets.AddItem(I, 5));
                        RemoveItem(this.NextItem(1050001));
                    }
                    if (InventoryContains(1050002, 1) && Equips.LeftHand.ID != 1050002 && Equips.LeftHand.ID != 1050001 && Equips.LeftHand.ID != 1050000)
                    {
                        arrowsloaded = true;
                        Item I = Equips.Get(5);
                        I.ID = 1050002;
                        I.UID = (uint)Rnd.Next(10000000);
                        I.MaxDur = I.DBInfo.Durability;
                        I.CurDur = I.MaxDur;

                        if (I.UID == 0)
                        {
                            I.UID = (uint)Rnd.Next(10000000);
                        }
                        MyClient.AddSend(Packets.AddItem(I, 5));
                        RemoveItem(this.NextItem(1050002));
                    }
                }
                /*
                Add more arrows down here, this is a really simple way, could be done much better
                */
define in character.cs
Code:
public bool arrowsloaded = false;
now find:
Code:
public uint PrepareAttack(byte AtkType, bool ArrowCost)
replace it with:
Code:
        public uint PrepareAttack(byte AtkType, bool ArrowCost)
        {
            AtkMem.LastAttack = DateTime.Now;
            AttackType A = (AttackType)AtkType;

            bool EnoughArrows = true;
            if (A == AttackType.Ranged && ArrowCost)
            {
                if (Loc.Map != 1039)
                {
                    if (Equips.LeftHand.ID != 0 && Item.IsArrow(Equips.LeftHand.ID))
                    {
                        Equips.LeftHand.CurDur -= 1;
                        if (Equips.LeftHand.CurDur == 0)
                        {
                            arrowsloaded = false;
                            MyClient.AddSend(Packets.ItemPacket(Equips.LeftHand.UID, 5, 6));
                            MyClient.AddSend(Packets.ItemPacket(Equips.LeftHand.UID, 0, 3));
                            Equips.LeftHand = new Item();
                        }
                        else
                            MyClient.AddSend(Packets.AddItem(Equips.LeftHand, 5));
                    }
                    else
                    {
                        AtkMem.Attacking = false;
                        EnoughArrows = false;
                    }
                }
            }
10/04/2010 16:28 †he Knight#5
Sorry but i should add this to the bottom or at the top of the step?
10/04/2010 16:29 _Vodka#6
I made it under:
Code:
                if (BlessingLasts > 0 && DateTime.Now > BlessingStarted.AddDays(BlessingLasts))
                {
                    BlessingLasts = 0;
                    StatEff.Remove(StatusEffectEn.Blessing);
                    MyClient.LocalMessage(2000, "Your heaven blessing has expired.");
                }
but dosnt really matter as long is inside step: and is inside public void Step()
10/04/2010 16:34 Korvacs#7
Looks like you were looking to leach a full system, give it a try yourself first next time.
10/04/2010 16:36 †he Knight#8
oO , Doesnt work kinda. Just Removes the arrow from inventory
10/04/2010 16:46 _Vodka#9
Try it now
10/04/2010 18:58 †he Knight#10
It reloads every arrow i buy .. all the time .. no matter of my job...
10/04/2010 19:07 _Vodka#11
Quote:
Originally Posted by JuiceDCodeR View Post
It reloads every arrow i buy .. all the time .. no matter of my job...
What about now?
10/04/2010 19:20 †he Knight#12
hahahaha Fully Fully working.
#request close