[Un-Official] CoEMU Help

06/09/2009 19:16 LordSesshomaru#1
CoEmu.Nano Help Thread

I started this topic to help keep the Conquer PServer Dissussions/Questions section clean. This topic will contain links , guides , and source codes examples as well as help. I seen day after day the same questions asked.

If you have any questions about the CoEmu.Nano source code , setup, or general questions about it please feel free to ask them here.


Source
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]

Guides
[Only registered and activated users can see links. Click Here To Register...]

Source Codes
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]



Web Site Stuff
[Only registered and activated users can see links. Click Here To Register...]

NPC Guide
I am going to break down the details of coding npc's for everyone so here it goes.
Code:
                case 1234567:// This is where you put your NPC ID
                    {
                        if (LinkBack == 0)[COLOR="DarkOrange"]// This is what will happen when u click on the npc for the frist time[/COLOR]
                        {
                            Text("Text Text Text Text", CSocket);[COLOR="DarkOrange"]// This is what the npc will say once u click him for the first time[/COLOR]
                            Link("Is there  Second Page", 1, CSocket);[COLOR="DarkOrange"]// Link means if you want to go to another page of text[/COLOR]
                            Link("No Thanks", 255, CSocket);[COLOR="DarkOrange"]// link id 255 closes it[/COLOR]
                            End(CSocket);[COLOR="DarkOrange"]// Link("Text", LinkID ,CSocket);[/COLOR]
                        }
                        else if (LinkBack == 1)// Link ID 1 
                        {
                       Text("Text Text Text Text", CSocket);
                       Link("Send me to twin city", 2, CSocket);
                        }
                        else if (LinkBack == 2)//Link 2
                         {
                            Teleport(1038, 348,339,0, CSocket);[COLOR="DarkOrange"]// U can also stick in links things like teleporting, giving items, taking or giving money so when that person clicks on it the link will do this[/COLOR]
                            Money(-500,CSocket);
                          }
                        break;

                    }
Credits - To everyone's guide i used , Andy for the source and Me for taking the time to make this guide.

**NOTE** If you have a guide that is not located in my post please PM** me and i will add it asap, or anything else . If you have any questions about the source and how to do things feel free to ask.

This is not a request topic, so do not post requests in here. This topic was started to help people with problems they have.
06/09/2009 19:56 Undress My Shadow#2
really useful for noobs thanks ;o
06/09/2009 19:59 Zehava333#3
I am still having a problem that many have had and have fixed, but the fix that's been posted has not worked for me. When I run the login server everything is fine, run the gameserver and I get Object reference not set to an instance of an object." and a bunch of mysql errors. Then about half way down says "Connection must be valid and open."

This runs on my laptop, but not on my desktop. They both are running the exact same OS, WinXP Pro SP3 and mysql server 5.1. I can't figure out why the desktop gives this error. I have removed the min and maxpool lines from the connection line, I've tried adding pooling = false; to the connection line, niether works. Any other suggestions?
06/09/2009 20:47 LordSesshomaru#4
The game servers is not connecting to your mysql data base correctly then. Please check to make sure that your information is correct
06/09/2009 21:23 Kiyono#5
So how would you check if a certain weapon type is equipped (for weapon skills)?
06/09/2009 22:01 Andrew.A#6
How do I go about making Shop NPC's?

Is it possible to make a command to summon an npc with a on and off command?
06/09/2009 22:08 nTL3fTy#7
Quote:
Originally Posted by Kiyono View Post
So how would you check if a certain weapon type is equipped (for weapon skills)?
Get the itemtype in slot 4 (or 5) then divide by 1000. This will get the first 3 digits in a 6 digit itemtype.

Example: 480339 (SuperKingsClub) would give you 480 after dividing by 1000.
06/09/2009 22:17 Kiyono#8
Quote:
Originally Posted by nTL3fTy View Post
Get the itemtype in slot 4 (or 5) then divide by 1000. This will get the first 3 digits in a 6 digit itemtype.

Example: 480339 (SuperKingsClub) would give you 480 after dividing by 1000.
But that would give me weptype/prof IDs and I don't need those...
What I wanted is some kind of check in the source that would work like:
if [weptype id here] is equipped right/left hand,
use skill if not don't do anything.
06/09/2009 23:02 velorian#9
Ahh, so I doubt anyone has a solution here (see my thread >.>) but I'll post it in here as well.

Setup is on a LAN only atm.

The server is run on PC1 and my test client is PC2

The client on PC2 crashes usually immediately after open but sometimes a few seconds later or midway through login.

PC2 will connect to PC1 as the login server shows it connecting... when I can get past the crash on open.

The client only crashes when I have the correct IP (the locally assigned for PC1) in the server.dat, using my WAN Ip causes it to freeze right after opening and any other IP works but there is no server for it to connect to.
06/09/2009 23:30 yuko#10
Quote:
Originally Posted by Kiyono View Post
But that would give me weptype/prof IDs and I don't need those...
What I wanted is some kind of check in the source that would work like:
if [weptype id here] is equipped right/left hand,
use skill if not don't do anything.
i made you this, i've dun that in 5 min but just to show you how you could do it? but there is a much better way + this is only to SHOW

Code:
Dictionary<int, int> Targets = new Dictionary<int, int>();
                    if (CSocket.Client.Equipment.ContainsKey(4))
                    {
                        Struct.ItemInfo Item = CSocket.Client.Equipment[4];
                        if (Item.ItemID / 1000 == 480)
                        {
                            if (CSocket.Client.Skills.ContainsKey(7020))
                            {
                                Console.WriteLine("skill activated");
                                ConquerPacket.ToLocal(ConquerPacket.MagicAttack(CSocket.Client.ID, 7020, 9, Targets, AttackedMob.X, AttackedMob.Y), CSocket.Client.X, CSocket.Client.Y, (int)CSocket.Client.Map, 0, 0);
                            }
                        }
                    }
image
06/09/2009 23:37 Zeroxelli#11
I just made a function, that way I can check maps and pk mode, etc, all in one.

Reference is like so;
Code:
WeaponSkills(CSocket, Targets, "Player", X, Y, Defense);
CSocket = ClientSocket
Targets = Dictionary<int, int> (UID, Damage)
"Player" = Type, it can be Monster, PLayer, or (t)NPC
X = X coord (Can be deprecated depending on the skill)
Y = Y coord (Deprecated also, if it's not something like speedgun. Although, it could be made internal)
Defense = Int(Attacked[Mob/Char/TNPC].(Info.)Defense), For skills like Penetration that bypass defense.

It could be made much smaller, but frankly I'm too sick to care atm and it works just fine with no wasted code.

EDIT: Btw, it works like real co. Checks first weap, if you have the skill, checks the chance rate. If you by chance get a TRUE bool, it activate. Damage is also calculated according to level, via percentage. If the first weap skill hits, it returns. Meaning both the second skill and normal weap hit aren't sent (Like real co), otherwise it checks the same for the second. If neither activate, then the normal weapon hit goes off. This is a fairly simple way to do things imo.
06/10/2009 00:37 nushizu#12
Alright dipshit question of the day =D since I'm confused with the new format of adding monsters.... how would I add them, like guards for example (I'm using the empty database) the guard is 502 in LOTF well his ID number anyways, but in this sources their are like... so many more options one of which IS a guard.. so if anyone could gimme a hand with this that'd be greate thanks =D
06/10/2009 00:53 Zeroxelli#13
Code:
mysql> SELECT * FROM monsters WHERE name='Guard1';
+------+--------+------+------+-------+------+--------+--------+-------+------+-------+--------+--------+-------+--------+--------+-------------+--------------+-------+-------+-----------+------------+---------------+---------+--------+-----------+-------+-------+----------+--------+----------+----------+---------+--------------+--------------+--------------+------+
| id   | name   | type | mech | hp    | mana | atkmin | atkmax | pdef  | dex  | dodge | wander | hunter | guard | arange | jrange | escape_life | attack_speed | speed | level | agressive | drop_money | drop_itemtype | sizeadd | action | run_speed | atype | mdef  | stc_type | canrun | maxmoney | avgmoney | dchance | viewdistance | dropminlevel | dropmaxlevel | lvlb |
+------+--------+------+------+-------+------+--------+--------+-------+------+-------+--------+--------+-------+--------+--------+-------------+--------------+-------+-------+-----------+------------+---------------+---------+--------+-----------+-------+-------+----------+--------+----------+----------+---------+--------------+--------------+--------------+------+
| 0900 | Guard1 | 0001 | 0900 | 65535 |   00 | 999999 | 999999 | 40000 | 0050 |  0085 |   0000 |   0000 |  0001 |   0015 |   0015 |           0 |         1000 |  1000 |  0200 |        15 |       0000 |          0000 |    0001 |   0000 |      0500 |  8036 | 99999 |       00 |      0 |        0 |        0 |       0 |            0 |            0 |            0 |    0 |
+------+--------+------+------+-------+------+--------+--------+-------+------+-------+--------+--------+-------+--------+--------+-------------+--------------+-------+-------+-----------+------------+---------------+---------+--------+-----------+-------+-------+----------+--------+----------+----------+---------+--------------+--------------+--------------+------+
06/10/2009 01:20 velorian#14
A little more insight for my crashes:

Problem signature:
Problem Event Name: APPCRASH
Application Name: CoEmu.exe
Application Version: 2007.1210.0.123
Application Timestamp: 494bc0c3
Fault Module Name: ntdll.dll
Fault Module Version: 6.0.6001.18000
Fault Module Timestamp: 4791a783
Exception Code: c0000005
Exception Offset: 00060ab0
OS Version: 6.0.6001.2.1.0.768.3
Locale ID: 1033
06/10/2009 02:17 Zeroxelli#15
Code:
Fault Module Name: ntdll.dll
Fault Module Version: 6.0.6001.18000
ntdll.6? ...Vista? Are you using 64bit? If so, fail. Otherwise, it crashed most likely because you're out of memory. Close some shit and try again.