[REQUEST] an example spell

06/25/2009 17:16 Akarama#1
i honestly do not get at all how to add spells.

can someone please like give me an example skill and how to code it and explain what certain things mean?
06/25/2009 17:23 Kiyono#2
Here is a example of a TwoFoldBlades code:
Code:
case 6000: //TwoFoldBlades
                                {
                                    Dictionary<int, int> Targets = new Dictionary<int, int>();
                                    int RemainingHP = AttackedMob.CurrentHP;
                                    int Level = AttackSkill.Level;
                                    double ExtPCT = 0;
                                    if (Level == 0)
                                        ExtPCT = 1.10;
                                    if (Level == 1)
                                        ExtPCT = 1.15;
                                    if (Level == 2)
                                        ExtPCT = 1.20;
                                    if (Level == 3)
                                        ExtPCT = 1.25;
                                    if (Level == 4)
                                        ExtPCT = 1.30;
                                    Damage = (int)Math.Floor((Calculation.Damage(Attacker, AttackedMob, 2, 0, 0) * 1.725) * ExtPCT);
                                    bool killed = Calculation.doMonster(AttackedMob, Damage, AType, CSocket);
                                    Targets.Add(AttackedMob.UID, Damage);
                                    ConquerPacket.ToLocal(ConquerPacket.MagicAttack(CSocket.Client.ID, AttackSkill.ID, AttackSkill.Level, Targets, AttackedMob.X, AttackedMob.Y), CSocket.Client.X, CSocket.Client.Y, (int)CSocket.Client.Map, 0, 0);
                                    Targets.Clear();
                                    break;
                                }
06/25/2009 17:34 Akarama#3
Quote:
Originally Posted by Kiyono View Post
Here is a example of a TwoFoldBlades code:
Code:
case 6000: //TwoFoldBlades
                                {
                                    Dictionary<int, int> Targets = new Dictionary<int, int>();
                                    int RemainingHP = AttackedMob.CurrentHP;
                                    int Level = AttackSkill.Level;
                                    double ExtPCT = 0;
                                    if (Level == 0)
                                        ExtPCT = 1.10;
                                    if (Level == 1)
                                        ExtPCT = 1.15;
                                    if (Level == 2)
                                        ExtPCT = 1.20;
                                    if (Level == 3)
                                        ExtPCT = 1.25;
                                    if (Level == 4)
                                        ExtPCT = 1.30;
                                    Damage = (int)Math.Floor((Calculation.Damage(Attacker, AttackedMob, 2, 0, 0) * 1.725) * ExtPCT);
                                    bool killed = Calculation.doMonster(AttackedMob, Damage, AType, CSocket);
                                    Targets.Add(AttackedMob.UID, Damage);
                                    ConquerPacket.ToLocal(ConquerPacket.MagicAttack(CSocket.Client.ID, AttackSkill.ID, AttackSkill.Level, Targets, AttackedMob.X, AttackedMob.Y), CSocket.Client.X, CSocket.Client.Y, (int)CSocket.Client.Map, 0, 0);
                                    Targets.Clear();
                                    break;
                                }
that helps alot. could you tell me how you can take a percentage of someones hp when they use a skill?
06/25/2009 21:17 duddz#4
Quote:
Damage = (int)Math.Floor((Calculation.Damage(Attacker, AttackedMob, 2, 0, 0) * 1.725) * ExtPCT);
Not a 100% sure on this, im taking a shot in the dark but this looks Like the Damage.
06/25/2009 21:46 Kiyono#5
Yes that's the damage xD
06/25/2009 22:29 n0mansland#6
Quote:
Damage "="
Yeah im gonna bet thats the damage lol.. Btw kiyono thanks for the two folds Ill thank you again for it
06/25/2009 22:40 Akarama#7
instead of asking for something simple i will ask about this error in general

if something says "<name> doesnt exist in the current context" what would the code be to add in order to fix this?
i have a couple errors with that twinfold code from that
06/25/2009 23:05 Kiyono#8
Well you probably placed this in the wrong place cause I added nothing more and nothing less then what I posted.
06/26/2009 02:46 n0mansland#9
no code most likely right click the error then see if it has extract method stub or something if it does there you go.. If not then you placed it in wrong.. btw it goes in attack.cs if you didnt know (handlers)
06/26/2009 04:18 Akarama#10
i put it in attack.cs, and the extract method sub doesnt work
06/26/2009 04:22 dextercsar#11
What ist the place for thes speel what cs?
06/26/2009 05:16 n0mansland#12
Quote:
Originally Posted by dextercsar View Post
What ist the place for thes speel what cs?
Go into C# then Handlers/Attack.cs/ then add the code somewhere in the middle or w/e works for you