Simple Question [About SubClasses]

10/27/2011 01:44 shadowman123#1
well iam adding full function subclass ..i've added Martial Artists , Chi Master And Warlock..and i've made sage like each level the magic atk increases and i wrote it like that

Code:
if (attacker.SubClassLevel == 7)
                                    {
                                        attacker.MagicAttack += 1000;
                                    }
but the problem in that code is that when i attack ..my magicatk increases by 1000 points each time i attack so i want it to make magic attack increases only once..what should i do or i add in my code to make it work
10/27/2011 02:04 abdeen#2
Code:
if (attacker.SubClassLevel == 7)
                                    {
                                        attacker.MagicAttack = 1000;
                                    }
10/27/2011 03:18 shadowman123#3
Quote:
Originally Posted by abdeen View Post
Code:
if (attacker.SubClassLevel == 7)
                                    {
                                        attacker.MagicAttack = 1000;
                                    }
Rofl ..nah if so this means that if my magic atk is 12k when i Activate Sage Subclass it gonna reduce my magic atk till it becomes 1k and thats not desired at all
10/27/2011 03:25 abdeen#4
Quote:
Originally Posted by shadowman123 View Post
Rofl ..nah if so this means that if my magic atk is 12k when i Activate Sage Subclass it gonna reduce my magic atk till it becomes 1k and thats not desired at all
so add this code to Sub class NPC , after he leveled up to level 7
10/27/2011 06:49 pro4never#5
Or make your damage boost more of a calculation and add it into your damage calculation method...


Something like...


switch(attacker.SubclassType)
{
case SubclassTypes.Warlock:
//100 extra damage for level, just using it as an example
damage += attacker.SubclassLevel * 100;
}

Something like that would work perfectly well
10/27/2011 18:35 abdeen#6
Quote:
Originally Posted by pro4never View Post
Or make your damage boost more of a calculation and add it into your damage calculation method...


Something like...


switch(attacker.SubclassType)
{
case SubclassTypes.Warlock:
//100 extra damage for level, just using it as an example
damage += attacker.SubclassLevel * 100;
}

Something like that would work perfectly well
good Idea from a good person too .