|
You last visited: Today at 19:08
Advertisement
Is there any way.
Discussion on Is there any way. within the CO2 Private Server forum part of the Conquer Online 2 category.
08/22/2010, 15:38
|
#1
|
elite*gold: 0
Join Date: Oct 2009
Posts: 70
Received Thanks: 3
|
Is there any way.
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.
|
|
|
08/22/2010, 15:54
|
#2
|
elite*gold: 0
Join Date: Aug 2010
Posts: 20
Received Thanks: 5
|
in mob.cs
|
|
|
08/22/2010, 16:06
|
#3
|
elite*gold: 0
Join Date: Oct 2009
Posts: 70
Received Thanks: 3
|
But how,can u say?
|
|
|
08/22/2010, 16:14
|
#4
|
elite*gold: 0
Join Date: May 2006
Posts: 1,190
Received Thanks: 516
|
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
|
#5
|
elite*gold: 0
Join Date: Oct 2009
Posts: 70
Received Thanks: 3
|
****,doesn't work for me :/
It builds witchout any error,but when i kill the mob,nothing happends :/
|
|
|
08/22/2010, 17:16
|
#6
|
elite*gold: 0
Join Date: May 2006
Posts: 1,190
Received Thanks: 516
|
Quote:
Originally Posted by buckeyes10
****,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
|
#7
|
elite*gold: 0
Join Date: Aug 2010
Posts: 20
Received Thanks: 5
|
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
|
#8
|
elite*gold: 0
Join Date: May 2006
Posts: 1,190
Received Thanks: 516
|
Quote:
Originally Posted by BLASTER!!!!
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
|
#9
|
elite*gold: 0
Join Date: Oct 2008
Posts: 342
Received Thanks: 66
|
how about u send the packet to update the cps :O
|
|
|
08/22/2010, 20:12
|
#10
|
elite*gold: 0
Join Date: Aug 2010
Posts: 20
Received Thanks: 5
|
Quote:
Originally Posted by mattyc2580
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
|
#11
|
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 912
|
Quote:
Originally Posted by mattyc2580
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!!!!
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
|
#12
|
elite*gold: 0
Join Date: May 2006
Posts: 1,190
Received Thanks: 516
|
Quote:
Originally Posted by kinshi88
A drain on resources!? For a bracket!?? Are you ******* 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
|
#13
|
elite*gold: 0
Join Date: Aug 2010
Posts: 20
Received Thanks: 5
|
Quote:
Originally Posted by kinshi88
A drain on resources!? For a bracket!?? Are you ******* 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
|
#14
|
elite*gold: 0
Join Date: Sep 2008
Posts: 1,683
Received Thanks: 505
|
@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
|
#15
|
elite*gold: 0
Join Date: Oct 2009
Posts: 70
Received Thanks: 3
|
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 :/
|
|
|
All times are GMT +2. The time now is 19:08.
|
|