First I will teach you how to read/write from certain files in the OldCODB.
[SIZE="4"]NPCs.txt[/SIZE] - Code:
-
[COLOR="Blue"]4358 [/COLOR][COLOR="Red"]9927[/COLOR] [COLOR="SeaGreen"]1[/COLOR] [COLOR="Orange"]0[/COLOR] [COLOR="DarkOrchid"]1000[/COLOR] [COLOR="Magenta"]467[/COLOR] [COLOR="Olive"]633[/COLOR]
4358 is the NPC ID.9927 is the NPC type, meaning the mesh used for this npc.1 is the flag. The flag is used to decide whether the npc is a dialog npc, a shop npc, a face change npc, a stake, a scarecrow, etc.0 is the avatar. Meaning the picture that pops up in the npc dialog box. If the npc is a flag other than 2, 3, 4, 10 ,15, or 27 then you will set this as 0.
1000 is the map you will set the npc on.467 is the X coordinate of the NPC's location.633 is the Y coordinate of the NPC's location.[SIZE="4"]MobInfos.txt[/SIZE] - Code:
-
1 Bull 1 235 1 33 0 0 0 5 6 1 36 2 True 2 1 50 1000 12 True
1 is the MobID.
Bull is the Mob's name.
1 is the type, meaning behavior. It can be set to 1, 2, 3, 4, or 6.
-If the behavior is set to 1, then it just hunts players.
-If the behavior is set to 2, then it just hunts other mobs.
-If the behavior is set to 3, then it hunts others mobs and players.
-If the behavior is set to 4, then it just hunts bluenames.
-If the behavior is set to 6, then is hunts mobs and bluenames. This is the behavior Guards are set to.
235 is the Mob's mesh.
1 is the Mob's level.
33 is the Mob's MaxHP.
0 is the Mob's defense.
0 is the Mob's magic defense.
0 is the Mob's magic attack.
5 is the Mob's minimum attack.
6 is the Mob's maximum attack.
1 is the Mob's damage reduce time.
36 is the Mob's dodge.
2 is the Mob's attack type. The attack type can be set to 2 or 21.
-If the attack type is set to 2, then the Mob uses melee attacks.
-If the attack type is set to 21, then the Mob uses magic attacks.
True is the boolean statement regarding if the Mob drops or doesn't drop.
2 is the Mob's attack distance. Meaning how far away the Mob can be and still attack.
1 is the minimum amount of silvers the mob can drop.
50 is the maximum amount of silvers the mob can drop.
1000 is the Mob's move speed.
12 is the Mob's spawn speed.
True is the boolean statement regarding level damage difference.
[SIZE="4"]MobSpawns.txt[/SIZE]Lets take an example out of MobSpawns.txt
- Code:
-
[COLOR="Red"]1[/COLOR] [COLOR="Blue"]75[/COLOR] [COLOR="Orange"]1002[/COLOR] [COLOR="DarkOrchid"]454[/COLOR] [COLOR="SeaGreen"]455[/COLOR] [COLOR="Magenta"]474[/COLOR] [COLOR="Sienna"]470[/COLOR]
1 is the ID of the Mob you are creating a spawn for.75 is the amount of Mob's you are spawning.1002 is the map which you are spawning the Mob's in.454 is X-Starting point of the spawn.455 is the Y-Starting point of the spawn.474 is the X-Ending point of the spawn.470 is the Y-Ending point of the spawn.[SIZE="4"]Portals.txt[/SIZE]Lets take an example out of Portals.txt
- Code:
-
[COLOR="Red"]1511[/COLOR] [COLOR="Blue"]51[/COLOR] [COLOR="Orange"]73[/COLOR] [COLOR="DarkOrchid"]1002[/COLOR] [COLOR="Magenta"]439[/COLOR] [COLOR="Sienna"]385[/COLOR]
1511 is the MapID in which the portal is located.51 is the X-Coordinate in which the portal is located.73 is the Y-Coordinate in which the portal is located.1002 is the MapID of the Map the portal is taking you to.
439 is the X-Coordinate in which the portal is taking you to.385 is the Y-Coordinate in which the portal is taking you to.[SIZE="4"]ItemAdd.ini[/SIZE]Lets take an example out of ItemAdd.ini
- Code:
-
150130 9 0 256 256 0 0 0 0 0
150130 is the ItemID.
9 is the Plus.
0 is the AdditionalHP.
256 is the Additional MinAttack.
256 is the Additional MaxAttack.
0 is the Additional Defense.
0 is the Additional MagicAttack
0 is the Additional MagicDefense.
0 is the Additional Dexterity/Agility.
0 is the Additional Dodge.
[SIZE="4"]Companions.txt[/SIZE]Lets take an example out of Companions.txt
- Code:
-
9000 3500 3500 90 1000 10000 268 DarkGuard
9000 is the type;
-9000-9003 is the reborn guard summon set.
-9005-9008 is the ghostbat summon set.
-9010-9013 is the ghostbatboss summon set.
-9015-9018 is the EvilBatA/B/C/D summon set.
-9020-9023 is the FireRatA/B/C/D summon set.
-9025-9028 is the SkeletonA/B/C/D summon set
3500 is the Companion's minimum attack.
3500 is the Companion's maximum attack.
90 is the Companion's level.
1000 is the SkillID of the Skill that the Companion uses; in this case, thunder.
10000 is the Companion's MaxHP.
268 is the Companion's mesh.
DarkGuard is the Companion's name.
[SIZE="4"]Nobility.dat[/SIZE]Lets take an example out of my Nobility.dat
- Code:
-
Hadise¿�È; „-î ~FearMe~ eÍ žûA Sun_TzuÀˆ º0 ShinobIÀIn
T¼ .Š*ü ØÚ sheep1`¢Ü ê@Ž CipiÀÂÚ ü¦! whoops¿¹� zæh ~Seth~ ê2 —à ^Yang^ÀŒl #Á# TheNinjaäA ôÈ… ~^A.r.u.r.u.u^~Àzò 1;Q Laura^^ ´Ä ½H€ ~Blaze~ÀVþ P Ú Mjoao@þ
ÞÇ ^Dark^^moon^€ðú §{ _Gamma_€ðú ¡P� SaRaH@¥
:× ShinobI€Þ€ ¤Y ~Laura~ Zb Cî
Black.WolfÀS ¼ karen÷j$
'� NewDream€ÃÉ Ë�† Oakley@x} .A¿ ~!ARWEN!~€±O ó˜ö ~Gods~of~hell~à‚ì K<M Apollon@]Æ dc¶ moon · ¨¬î X_Ninja · ,´î timetodie R¦ �‹ Wesleey.(x)*7* L=… Sexy*****€–˜ }ƒ
s2Shkiras2€–˜ ¿3ÿ Malvious€–˜ ÎÂ7
johnalex10 |’ Z° ~Baby~ z ü× $un$h!n3`Vl Œ6 SadnesSÀÏj ˆú ~D4ng3rÀÏj ?¦À
Pro~NiNjahà;f ÛM Raven@µd Crú FailasinÀš^ ƒ X~NinjaÀš^ v) RyuzukiNajAizen€�[ xÜõ RavenSkye€�[ —) goldenarrow@KL êÞÛ ~SaLLy~@KL 5£ 5£
Looks like a bunch of nonsense right?
It's normal text encoded into binary.
Really simple to decode. If you take a look into the Empire.Info.ReadThis method you see this:
- Code:
-
public void WriteThis(System.IO.BinaryWriter BW)
{
if (Name == null)
Name = "";
BW.Write(Name.Length);
BW.Write(Encoding.ASCII.GetBytes(Name));
BW.Write(Donation);
BW.Write(ID);
}
From this you know its string, ulong, uint by looking at the definitions above.
I did something really simple to decode this.
I went to the ReadThis method right below this and under
- Code:
-
ID = BR.ReadUInt32();
I put this
Program.WriteLine(Name + " " + Donation + " " + ID);
That writes the name, donation, and UID of the player on the console. Now you just /exit and close the console, open your debug file that writes everytime you exit the server and you will see your decoded Nobility.dat.
For me it writes:
[php]Hadise 1002999999 15609220
~FearMe~ 500000000 4324254
Sun_Tzu 203000000 19970592
ShinobI 175000000 17415252
. 134000010 14342169
sheep1 131900000 9322730
Cipi 115000000 2205436
whoops 110999999 6874746
~Seth~ 104000000 18407575
^Yang^ 91000000 2343203
TheNinja 86000100 8767732
~^A.r.u.r.u.u^~ 83000000 5323569
Laura^^ 80000000 8407229
~Blaze~ 67000000 14295120
Mjoao 61800000 13098513
^Dark^^moon^ 50000000 8062631
_Gamma_ 50000000 10309793
SaRaH 45000000 9945914
ShinobI 42000000 17389988
~Laura~ 40000000 18935363
Black.Wolf 39000000 17833404
karen 35941111 8464138
NewDream 30000000 8818891
Oakley 25000000 12534062
~!ARWEN!~ 22000000 16161011
~Gods~of~hell~ 15500000 5061707
Apollon 13000000 11952996
moon 12000000 15641768
X_Ninja 12000000 15643692
timetodie 10900000 9114255
Wesleey.(x) 10500000 8731980
Sexy***** 10000000 1475453
s2Shkiras2 10000000 16724927
Malvious 10000000 3654350
johnalex10 9600000 11538010
~Baby~ 8000000 14096380
$un$h!n3 7100000 16856716
SadnesS 7000000 16392072
~D4ng3r 7000000 12625471
Pro~NiNjah 6700000 5051611
Raven 6600000 16413251
Failasin 6200000 17990418
X~Ninja 6200000 2688630
RyuzukiNajAizen 6000000 16112760
RavenSkye 6000000 1321367
goldenarrow 5000000 14409450
~SaLLy~ 5000000 18391861[/php]
And thats Nobility.dat for you.
You can do the same for KOBoard.dat.
[SIZE="4"]Different methods to use through NPC's[/SIZE]There are different things you can do with NPC's, first I will teach you the basics.
[SIZE="2"]How to teleport:[/SIZE]The action used to teleport is GC.MyChar.Teleport(Mapid, X, Y); That's the way to teleport. For example, if you want the npc to teleport the character to the center of Twin City it would be
GC.MyChar.Teleport(1002, 438, 377);
[SIZE="2"]How to give a character an item:[/SIZE]There are a few different method for giving characters items. In character.cs you will see a couple of listed voids and they are:
public void AddItem(uint ID)
-which is just using giving them item with no extra bonuses.
public void AddItem(uint ID, byte Plus)
-which is the itemid then then plus amount.
I think its pretty simple on how to use them
GC.MyChar.AddItem(410339);
GC.MyChar.AddItem(410339, 12);