[Help]Healing

07/10/2009 17:54 damianpesta#1
Well I have re-written healing skills a little bit.But they still doesnt work any Hints?

Code:
                            if (SkillAttributes[0] == 6)
                            {
                                Heal = (short)SkillAttributes[4];
                                CurHP += (ushort)Heal;
                                if (CurHP > MaxHP)
                                    CurHP = MaxHP;
                                World.UsingSkill(this, (short)SkillId, SkillLvl, UID, (ushort)Heal, (short)LocX, (short)LocY);
                                Mana = (short)SkillAttributes[5];
                                if (CurMP > (short)Mana)
                                {
                                    CurMP -= (ushort)Mana;
                                    General.MyPackets.Vital((long)UID, 0x02, CurMP);
                                }
                                else
                                {
                                    General.MyPackets.SendMsg(MyClient.MessageId, "NanoCo", Name, "You dont have enough mana!", 2011);
                                }

                            }
and heres an example of my Defined Spell.
Code:
            SkillAttributes[1170] = new ushort[5][];
            SkillAttributes[1170][0] = new ushort[6] { 6, 0, 0, 600, 25, 0 };
            SkillAttributes[1170][1] = new ushort[6] { 6, 0, 0, 700, 30, 0 };
            SkillAttributes[1170][2] = new ushort[6] { 6, 0, 0, 800, 30, 0 };
            SkillAttributes[1170][3] = new ushort[6] { 6, 0, 0, 900, 30, 0 };
            SkillAttributes[1170][4] = new ushort[6] { 6, 0, 0, 1000, 30, 0 };
            SkillsDone.Add(1170, 4);
07/10/2009 20:01 Incariuz#2
Are you trying to convert this to CoEmuV2?
07/10/2009 20:06 damianpesta#3
Quote:
Originally Posted by Incariuz View Post
Are you trying to convert this to CoEmuV2?
No no no lol , re-writing LOTF one lol.
07/10/2009 20:08 Incariuz#4
Why are you changing it?
07/10/2009 20:12 damianpesta#5
Quote:
Originally Posted by Incariuz View Post
Why are you changing it?
It doesnt work rofl , thats why I am changing it.Sometimes it doesnt work , sometimes it does ...
07/10/2009 20:16 Incariuz#6
I see, well use this, it works for me. Keep in mind, you need to replace the extra skillattributes with mine, some issue with the skill only being able to cast on monsters and gaurds, but I corrected it.


Code:
                            if (SkillAttributes[0] == 6)
                            {
                                Heal = (short)SkillAttributes[3];

                                if (Target.MaxHP - Target.CurHP < Heal)
                                    Heal = (short)(Target.MaxHP - Target.CurHP);

                                Target.CurHP += (uint)Heal;
                            }

                            if (SkillAttributes[0] == 2)
                            {
                                if (PKMode == 0)
                                    if (Target.MType == 1)
                                    {
                                        GotBlueName = DateTime.Now;
                                        BlueName = true;
                                        MyClient.SendPacket(General.MyPackets.Vital(UID, 26, GetStat()));
                                        World.UpdateSpawn(this);
                                        if (SkillId == 3050)
                                        {
                                            Target.CurHP -= Target.CurHP / 20;
                                        }
                                    }
                                if (PKMode == 0 || Target.MType != 1 && Target.MType != 7)
                                {
                                    MobTargets.Add(Target, Other.CalculateDamage(this, Target, 3, SkillId, SkillLvl));
                                }
                            }
                            if (SkillAttributes[0] == 12)
                            {
                                if (PKMode == 0)
                                    if (Target.MType == 1)
                                    {
                                        GotBlueName = DateTime.Now;
                                        BlueName = true;
                                        MyClient.SendPacket(General.MyPackets.Vital(UID, 26, GetStat()));
                                        World.UpdateSpawn(this);
                                    }

                                if (PKMode == 0 || Target.MType != 1)
                                    MobTargets.Add(Target, Other.CalculateDamage(this, Target, 1, SkillId, SkillLvl));
                            }
                            if (SkillAttributes[0] == 13)
                            {
                                if (PKMode == 0)
                                    if (Target.MType == 1)
                                    {
                                        GotBlueName = DateTime.Now;
                                        BlueName = true;
                                        MyClient.SendPacket(General.MyPackets.Vital(UID, 26, GetStat()));
                                        World.UpdateSpawn(this);
                                    }

                                if (PKMode == 0 || Target.MType != 1 && Target.MType != 7)
                                    MobTargets.Add(Target, Other.CalculateDamage(this, Target, 2, SkillId, SkillLvl));
                            }
                        }
Edit: I'm going out for a little bit, let me know how it works, and I'll get back to you when I can.
07/10/2009 20:21 damianpesta#7
Quote:
Originally Posted by Incariuz View Post
I see, well use this, it works for me. Keep in mind, you need to replace the extra skillattributes with mine, some issue with the skill only being able to cast on monsters and gaurds, but I corrected it.


Code:
                            if (SkillAttributes[0] == 6)
                            {
                                Heal = (short)SkillAttributes[3];

                                if (Target.MaxHP - Target.CurHP < Heal)
                                    Heal = (short)(Target.MaxHP - Target.CurHP);

                                Target.CurHP += (uint)Heal;
                            }

                            if (SkillAttributes[0] == 2)
                            {
                                if (PKMode == 0)
                                    if (Target.MType == 1)
                                    {
                                        GotBlueName = DateTime.Now;
                                        BlueName = true;
                                        MyClient.SendPacket(General.MyPackets.Vital(UID, 26, GetStat()));
                                        World.UpdateSpawn(this);
                                        if (SkillId == 3050)
                                        {
                                            Target.CurHP -= Target.CurHP / 20;
                                        }
                                    }
                                if (PKMode == 0 || Target.MType != 1 && Target.MType != 7)
                                {
                                    MobTargets.Add(Target, Other.CalculateDamage(this, Target, 3, SkillId, SkillLvl));
                                }
                            }
                            if (SkillAttributes[0] == 12)
                            {
                                if (PKMode == 0)
                                    if (Target.MType == 1)
                                    {
                                        GotBlueName = DateTime.Now;
                                        BlueName = true;
                                        MyClient.SendPacket(General.MyPackets.Vital(UID, 26, GetStat()));
                                        World.UpdateSpawn(this);
                                    }

                                if (PKMode == 0 || Target.MType != 1)
                                    MobTargets.Add(Target, Other.CalculateDamage(this, Target, 1, SkillId, SkillLvl));
                            }
                            if (SkillAttributes[0] == 13)
                            {
                                if (PKMode == 0)
                                    if (Target.MType == 1)
                                    {
                                        GotBlueName = DateTime.Now;
                                        BlueName = true;
                                        MyClient.SendPacket(General.MyPackets.Vital(UID, 26, GetStat()));
                                        World.UpdateSpawn(this);
                                    }

                                if (PKMode == 0 || Target.MType != 1 && Target.MType != 7)
                                    MobTargets.Add(Target, Other.CalculateDamage(this, Target, 2, SkillId, SkillLvl));
                            }
                        }
Edit: I'm going out for a little bit, let me know how it works, and I'll get back to you when I can.
Thanx.Maybe it's gonna work.
07/10/2009 21:22 Incariuz#8
Did it work alright?
07/10/2009 22:01 damianpesta#9
Quote:
Originally Posted by Incariuz View Post
Did it work alright?
Nah , gonna code the healing skills my way.
07/10/2009 23:23 Incariuz#10
Hmmm... Odd, but w/e, goodluck.
07/10/2009 23:28 damianpesta#11
Quote:
Originally Posted by Incariuz View Post
Hmmm... Odd, but w/e, goodluck.
nvm thanks to alexbigfoot , the problem was really obvious but my brain didnt really work fine to spot it lol.
#request close.
07/10/2009 23:57 kinshi88#12
#Closed