Is there any way.

08/22/2010 15:38 buckeyes10#1
Is there any way to make an one monster drop x amount of CP's,and when someone kill him,or when it respawn all get message?
Im using 5165 Source.
:confused:
08/22/2010 15:54 BLASTER!!!!#2
in mob.cs
08/22/2010 16:06 buckeyes10#3
But how,can u say?
08/22/2010 16:14 .Beatz#4
Go into mob.cs and search for
Code:
if (MyMath.ChanceSuccess(30))
above that add something like
Code:
if (MyMath.ChanceSuccess(100))
                {
                    if (Char != null)
                    if (Name == "Pheasant") // Change this to the name of the mob
                    {
                        Char.CPs += 50; // Change this to the amount of CPs you want to drop
                        SendMsgToAll("SYSTEM", Name + " has killed a monster and recieved 50 CPs", 2000, 0);
                        return;
                    }
                }
08/22/2010 16:58 buckeyes10#5
Damn,doesn't work for me :/
It builds witchout any error,but when i kill the mob,nothing happends :/
08/22/2010 17:16 .Beatz#6
Quote:
Originally Posted by buckeyes10 View Post
Damn,doesn't work for me :/
It builds witchout any error,but when i kill the mob,nothing happends :/
add me on msn buck I will try and help you out a bit more
08/22/2010 19:25 BLASTER!!!!#7
Code:
if (MyMath.ChanceSuccess(100))
                {
                    if (Char != null)
{
                    if (Name == "Pheasant") // Change this to the name of the mob
                    {
                        Char.CPs += 50; // Change this to the amount of CPs you want to drop
                        SendMsgToAll("SYSTEM", Name + " has killed a monster and recieved 50 CPs", 2000, 0);
                        return;
                    }
}
                }
fixed
08/22/2010 19:53 .Beatz#8
Quote:
Originally Posted by BLASTER!!!! View Post
Code:
if (MyMath.ChanceSuccess(100))
                {
                    if (Char != null)
{
                    if (Name == "Pheasant") // Change this to the name of the mob
                    {
                        Char.CPs += 50; // Change this to the amount of CPs you want to drop
                        SendMsgToAll("SYSTEM", Name + " has killed a monster and recieved 50 CPs", 2000, 0);
                        return;
                    }
}
                }
fixed
Blaster you don't need the extra curly brackets there. That is just a drain on resources. Learn to code properly before failing at "fixing" other peoples posts. I have pretty much the EXACT same code in my source and works 100%.
If you want the same amount dropped for every mob it would be
Code:
if (MyMath.ChanceSuccess(100))
{ if (Char != null) { MyChar.CPs += 50; return; } }
08/22/2010 20:11 µ~Xero~µ#9
how about u send the packet to update the cps :O
08/22/2010 20:12 BLASTER!!!!#10
Quote:
Originally Posted by mattyc2580 View Post
Blaster you don't need the extra curly brackets there. That is just a drain on resources. Learn to code properly before failing at "fixing" other peoples posts. I have pretty much the EXACT same code in my source and works 100%.
If you want the same amount dropped for every mob it would be
Code:
if (MyMath.ChanceSuccess(100))
{ if (Char != null) { MyChar.CPs += 50; return; } }
dont talk before u got ur info.
u were the one who made one that didn't work.
I fixed ur brackets.
Code:
                    if (Char != null)
                    if (Name == "Pheasant") // Change this to the name of the mob
would never work

why?
Code:
                    if (Char != null)//checks only the next line after
                    if (Name == "Pheasant") // Change this to the name of the mob
when to use if without brackets then?
Code:
if (Char != null)
   //if not null
else
   //if null
u can only use 1 line methodes there.

so whos right or wrong?
08/22/2010 23:07 kinshi88#11
Quote:
Originally Posted by mattyc2580 View Post
Blaster you don't need the extra curly brackets there. That is just a drain on resources. Learn to code properly before failing at "fixing" other peoples posts. I have pretty much the EXACT same code in my source and works 100%.
A drain on resources!? For a bracket!?? Are you fucking kidding me?
No, adding a bracket won't drain your resources.


Quote:
Originally Posted by BLASTER!!!! View Post
dont talk before u got ur info.
u were the one who made one that didn't work.
I fixed ur brackets.
Code:
                    if (Char != null)
                    if (Name == "Pheasant") // Change this to the name of the mob
would never work

why?
Code:
                    if (Char != null)//checks only the next line after
                    if (Name == "Pheasant") // Change this to the name of the mob
when to use if without brackets then?
Code:
if (Char != null)
   //if not null
else
   //if null
u can only use 1 line methodes there.

so whos right or wrong?
You're both wrong in your own special little ways.

Blaster, you're right that an if statement without brackets can only affect one line, but if that line is another if statement then if will keep going.

Code:
if (x)
    if (y)
        if (z)
            Console.WriteLine("x, y, and z all have to be true for this to appear!");
08/22/2010 23:14 .Beatz#12
Quote:
Originally Posted by kinshi88 View Post
A drain on resources!? For a bracket!?? Are you fucking kidding me?
No, adding a bracket won't drain your resources.




You're both wrong in your own special little ways.

Blaster, you're right that an if statement without brackets can only affect one line, but if that line is another if statement then if will keep going.

Code:
if (x)
    if (y)
        if (z)
            Console.WriteLine("x, y, and z all have to be true for this to appear!");
lol I didn't mean drain on resources I couldn't think of the right word to use haha. Still can't think of the right word either lmao. But thanks for clearing that up
08/22/2010 23:19 BLASTER!!!!#13
Quote:
Originally Posted by kinshi88 View Post
A drain on resources!? For a bracket!?? Are you fucking kidding me?
No, adding a bracket won't drain your resources.




You're both wrong in your own special little ways.

Blaster, you're right that an if statement without brackets can only affect one line, but if that line is another if statement then if will keep going.

Code:
if (x)
    if (y)
        if (z)
            Console.WriteLine("x, y, and z all have to be true for this to appear!");
i know, but it wasnt a bool :)
08/22/2010 23:48 Basser#14
@Blaster, you were wrong twice.
@Matty, so were you.

Matty: It is not something you HAVE to do, Its style.
Matty: Resources won't really affect resources.
Blaster: You should never comment someone for his style, unless you OBVIOUSLY pointed out that you were commenting on his style, which you didn't.
Blaster: You corrected Matty saying he was wrong, but he wasn't.

@Kinshi,
You sir, posted a excellent answer on this page. <3
08/25/2010 10:00 buckeyes10#15
I've got
Code:
                if (MyMath.ChanceSuccess(100))
                {
                    if (MobID == 11169 || MobID == 83 || MobID == 1 || MobID == 2 || MobID == 3 || MobID == 4 || MobID == 5 || MobID == 6 || MobID == 7 || MobID == 8 || MobID == 9 || MobID == 10 || MobID == 11 || MobID == 12 || MobID == 13 || MobID == 14 || MobID == 15 || MobID == 16 || MobID == 17 || MobID == 18 || MobID == 19 || MobID == 20 || MobID == 21 || MobID == 22 || MobID == 23 || MobID == 24 || MobID == 25 || MobID == 26 || MobID == 27 || MobID == 28 || MobID == 29 || MobID == 30 || MobID == 31 || MobID == 32 || MobID == 33 || MobID == 34 || MobID == 35 || MobID == 36 || MobID == 37 || MobID == 38 || MobID == 39 || MobID == 40 || MobID == 41 || MobID == 42 || MobID == 43 || MobID == 45 || MobID == 46 || MobID == 47 || MobID == 48 || MobID == 49 || MobID == 50 || MobID == 51 || MobID == 52 || MobID == 53 || MobID == 54 || MobID == 55 || MobID == 56 || MobID == 57 || MobID == 58 || MobID == 59 || MobID == 60 || MobID == 61 || MobID == 62 || MobID == 63 || MobID == 64 || MobID == 65 || MobID == 66 || MobID == 67 || MobID == 68 || MobID == 69 || MobID == 70 || MobID == 71 || MobID == 72)
                    {
                        Char.Silvers += 1000;
                        Char.CPs += 50;
                    }
                }
That's giving 50CPs for any monster i kill.
But i want to some of monsters,give more CP's,and when they die there will appear message.
Now i dont really know whose version works :/