Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 13:31

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



ATtack of a Certain Monster

Discussion on ATtack of a Certain Monster within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
marlyandedsel's Avatar
 
elite*gold: 0
Join Date: Aug 2010
Posts: 343
Received Thanks: 21
ATtack of a Certain Monster

can someone tell me how to to code
1. Terato Dragon will attack multiple player around him in just 1 blow...
meaning not single player affected...

I have made like this but I know its error or do you have Idea or some clue just a guide to do this...


Quote:
Sector sector = new Sector(attacker.X, attacker.Y, X, Y);
sector.Arrange(spell.Sector, spell.Distance);

foreach (Interfaces.IMapObject _obj in attacker.Monster.Screen.Objects)
{
if (_obj == null)
continue;
if ( _obj.MapObjType == MapObjectType.Player)
{
attacked = _obj as Entity;
if (sector.Inside(attacked.X, attacked.Y))
{
attack.Effect1 = Attack.AttackEffects1.None;
uint damage = Game.Attacking.Calculate.Ranged(attacker, attacked, spell, ref attack);
ReceiveAttack(attacker, attacked, attack, damage, spell);

suse.Targets.Add(attacked.UID, damage);
}
}
}
marlyandedsel is offline  
Old 03/18/2012, 11:33   #2
 
shadowman123's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
y dont u make it With spell.Range ? it would be Easier like this

Code:
if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
{
     // Attacker in this case is monster
     Ur Calculations
}
shadowman123 is offline  
Thanks
1 User
Old 03/18/2012, 11:34   #3
 
m7mdxlife's Avatar
 
elite*gold: 0
Join Date: Feb 2009
Posts: 920
Received Thanks: 3,514
A. Use code tags.
B. I'm pretty sure lots of public sources got Terato attacking multiple players with 1 blow. check pro4never's source
m7mdxlife is offline  
Old 03/18/2012, 11:46   #4
 
elite*gold: 0
Join Date: Oct 2009
Posts: 768
Received Thanks: 550
Code:
Sector sector = new Sector(attacker.X, attacker.Y, X, Y);
Your problem is probably related to the fact that maybe the variables X and Y got the value 0. You should do
Code:
Sector sector = new Sector(attacker.X, attacker.Y, attacked.X, attacked.Y);
In which case the sector will cover the main target and the ones around it, not some random direction.
-impulse- is offline  
Thanks
3 Users
Old 03/18/2012, 14:50   #5
 
marlyandedsel's Avatar
 
elite*gold: 0
Join Date: Aug 2010
Posts: 343
Received Thanks: 21
thanks ... and i got error in this part

foreach (IMapObject objs in attacker.Owner.Screen.Objects.ToArray())

the attacker is monster... is that correct I called it like attacker.Owner.Screen.Objects.ToArray() i have use the Impulse public source...
marlyandedsel is offline  
Old 03/18/2012, 21:38   #6
 
elite*gold: 0
Join Date: Oct 2009
Posts: 768
Received Thanks: 550
Quote:
Originally Posted by marlyandedsel View Post
thanks ... and i got error in this part

foreach (IMapObject objs in attacker.Owner.Screen.Objects.ToArray())

the attacker is monster... is that correct I called it like attacker.Owner.Screen.Objects.ToArray() i have use the Impulse public source...
You should use: attacked.Owner.Screen.Objects (as monsters don't have a Screen variable - they do have a variable called Owner but that is null).
Other than that your code is good except you should add before that foreach
this:
Code:
if (sector.Inside(attacked.X, attacked.Y))
{
attack.Effect1 = Attack.AttackEffects1.None;
uint damage = Game.Attacking.Calculate.Ranged(attacker, attacked, spell, ref attack);
ReceiveAttack(attacker, attacked, attack, damage, spell);

suse.Targets.Add(attacked.UID, damage);
}
With this code you will also attack the main target (without it you would attack just the players around).
-impulse- is offline  
Thanks
2 Users
Old 03/19/2012, 00:47   #7
 
marlyandedsel's Avatar
 
elite*gold: 0
Join Date: Aug 2010
Posts: 343
Received Thanks: 21
Thank very much impulse I got it....

edit:
some little error, dead player can still receive damage but I have manage it to correct....Thanks very much.... working Good Request Close
marlyandedsel is offline  
Reply


Similar Threads Similar Threads
[HELP] Monster dont attack
07/18/2011 - Dekaron Private Server - 0 Replies
Hello, I have a problem with monsters, some monsters action 7 and 8 action are not attacking the character, are just running from one side to another, but can not attack someone post here how to solve this problem. and that damn monster attack? thanks alot.
[HELP]Monster don't attack
06/15/2011 - Dekaron Private Server - 7 Replies
Hii to all, i'm actually work on files of KingTuT release Action 9. Here is my problem, is just that some monster follow me but they don't attack, i don't know why, i've been looking but i dont find anything so, any ideas? If you can help me I appreciated that. Greetings. :handsdown:
[HELP]Monster Attack Modding
04/09/2010 - Metin2 Private Server - 1 Replies
Also... Ich hab den Gelben Tigergeist gemoddet und den Schlag zu einem DS gemacht... Es geht auch... Aber er "verkrüpelt" sich wenn man die Attacke aussführt dann sieht er aus wie ein "Klumpen" und das sieht unschön aus, deshalb wollte ich fragen wie man das ändern kann... Pic: http://img534.imageshack.us/img534/9379/screensho t1fz.jpg
help with monster attack
01/31/2010 - CO2 Private Server - 6 Replies
fixed the problem !!!!!
My Agbot is dont attack untill monster attack him
08/21/2008 - Silkroad Online - 6 Replies
I use Agbot and he is not attack untill monster come and attack him. after monster attack him he is starting to kill like 20 seconds and after again dont attack. how can I make him attack always?



All times are GMT +1. The time now is 13:31.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.