Register for your free account! | Forgot your password?

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

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

Advertisement



How to properly fix or implement monsters using magic/skill?

Discussion on How to properly fix or implement monsters using magic/skill? within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
KingGannon's Avatar
 
elite*gold: 0
Join Date: Oct 2005
Posts: 26
Received Thanks: 2
Question How to properly fix or implement monsters using magic/skill?

I do feel that I should know this but missed out on something

I'm using conquer client v5065, this is redux source
The original code for Redux source will have magic monsters (messengers, AZ spawns, snake king, fiend bats etc) and guards using physical attacks and magic spells/skills are non-existent in the AI.

I went to look at Monster.cs and made my attempt under the
case MonsterMode.Attack
then under
else if (Common.Clock - LastAttack > BaseMonster.AttackSpeed)

I have changed to this code

Code:
if (BaseMonster.SkillType == 8036 && (target is Player) && !target.HasEffect(ClientEffect.BlueName))
{
	Mode = MonsterMode.Idle;
}
else if(BaseMonster.SkillType > 0)
{
	LastAttack = Common.Clock; 

	var skill = Database.ServerDatabase.Context.MagicType.GetById(BaseMonster.SkillType);

	uint dmg = CalculateSkillDamage(target, skill, skill.Percent < 100);
	var packet = SkillEffectPacket.Create(UID, target.UID, BaseMonster.SkillType, 0);
	packet.AddTarget(target.UID, dmg);

	SendToScreen(packet);
	var pack = InteractPacket.Create(UID, target.UID, target.X, target.Y, InteractAction.MagicAttack, 0);
	pack.MagicType = BaseMonster.SkillType;
	pack.MagicLevel = 0;
	pack.Target = target.UID;
	CombatEngine.ProcessInteractionPacket(pack);
                            
	if (dmg > 0) 
	{
		target.ReceiveDamage(dmg, UID);
	}
}
else
{
	LastAttack = Common.Clock;
	CombatEngine.ProcessInteractionPacket(InteractPacket.Create(UID, TargetID, target.X, target.Y, InteractAction.Attack, 0));
}
Problem is whenever the monster using magic spell/skill reduces their target's HP to 0, it's still not considered dead. As a player you're not dead. When the guard kills a monster that monster HP is 0 but not dead it sits there idle with 0 HP and doesn't respawn.

Anyone know what to do?
KingGannon is offline  
Old 06/17/2022, 12:38   #2


 
Energetic(H)'s Avatar
 
elite*gold: 384
Join Date: Feb 2016
Posts: 116
Received Thanks: 21
my advice let this source if you cant code this source alot missy and bad coded
Energetic(H) is offline  
Old 06/17/2022, 20:41   #3
 
KingGannon's Avatar
 
elite*gold: 0
Join Date: Oct 2005
Posts: 26
Received Thanks: 2
Quote:
Originally Posted by Energetic(H) View Post
my advice let this source if you cant code this source
Not sure I understand what exactly you are trying to say "let this source if I cannot code this source" ???

Quote:
Originally Posted by Energetic(H) View Post
alot missy and bad coded
My best interpretation is for me to choose another source that's not redux cause it's "missy and bad coded" No idea what you mean by missy


Either way, whatever public source released, Redux or not. There will still be work required to be done and changing sources doesn't solve underlying issues which is the ongoing process of coding and making the game work. None of the sources out there, public or not, are even close to being flawlessly coded nor complete without needing any work to get it in a "playable" state.
Eventually, it will comes back to something similar this. Where I will have a bug in the game code or game issues and have to try to fix it up.
For this case, somehow fixing one part of the bug and then breaking another part of the game. Still ended up coming back to ask to help or fix advice.
Getting stuck is only part of the process. Learning and coding and fixing the source + bugs in the code is still something not just me but all of us will have to do if we are going to properly run a game.
KingGannon is offline  
Old 06/17/2022, 22:01   #4
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,220
Received Thanks: 4,124
Was curious and looked a little more into it. It looks like most combat methods check the Alive property on entities after dealing damage. The ReceiveDamage method doesn't have any checks against life and doesn't call Kill on the player. Take a look at references to ReceiveDamage and you'll see what I mean.
Spirited is offline  
Thanks
1 User
Old 06/19/2022, 08:20   #5
 
KingGannon's Avatar
 
elite*gold: 0
Join Date: Oct 2005
Posts: 26
Received Thanks: 2
Spirited to the rescue again
Thank you Boss, for taking the time and looking into it
I don't know what I'd do without you pointing that out
I probably be frantically searching all over the place before I learn it was right under my nose all along

I had a look at the code and fixed it
and pretty much as you had said too - there isn't any checks against life so I added it
if Life <= 0
Kill target

and for those Messengers + Snake King + Water Devils etc now the price of death really hurts melee classes like they are supposed to
KingGannon is offline  
Old 06/19/2022, 08:39   #6
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,220
Received Thanks: 4,124
Quote:
Originally Posted by KingGannon View Post
Spirited to the rescue again
Thank you Boss, for taking the time and looking into it
I don't know what I'd do without you pointing that out I probably be frantically searching all over the place before I learn it was right under my nose all along

I had a look at the code and fixed it
and pretty much as you had said to there isn't any checks against life so I added it
if Life <= 0
Kill target

and those Messengers + Snake King + Water Devils etc now the price of death really hurts melee classes like they are supposed to
Awesome, glad to know that fixed it. Have fun!
Spirited is offline  
Reply


Similar Threads Similar Threads
mysql error: 1 client is using or hasn't closed the table properly
09/13/2015 - Metin2 Private Server - 1 Replies
Wenn ich meine Mysql Tabelle checken möchte, kommt "1 client is using or hasn't closed the table properly". Wenn ich sie repair, crasht der Server :(
[04.09.13] GigaByte v2.6 [FIX, FIX, FIX, FIX AND FIX]
09/11/2013 - WarRock Hacks, Bots, Cheats & Exploits - 79 Replies
http://www.elitepvpers.com/forum/warrock-hacks-bot s-cheats-exploits/2843300-11-09-gigabyte-public-v2 -7-a.html
AUTOIT - script using pixel search doesnt work properly
08/11/2011 - AutoIt - 2 Replies
I have posted again triying to explain better wich is my problem. My level of english is very low and a friend is helping me to express my problem i got whith the script. Is the secon time i post the same please apologize me , and delete old post because here everyone will understand better what i am asking , and what i need. I have done a bot that must be running all time. It has 2 diferents parts. Part 1 must do :
Properly Using SV (Or any bot)
02/18/2007 - Conquer Online 2 - 3 Replies
With the cost of bot jail set at a DB (20KK plus for most), its not cheap to get busted. I thought maybe it would be useful to post tips here and maybe personal experiences on what will get you sent to jail. Examples are settings and things like that. I'll start with about all I know. 1. Dont use the jump seting. Jumping + Item Drop = Bot Jail Lets help each other out and see if we can't come up with some good, safe settings to use.



All times are GMT +2. The time now is 09:40.


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.