Discussion on [Release] Extremely basic (but working/bugless) C# Source within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.
Hopefully more people will start working on this source base, and actually learn stuff.
Here's Monster Loading/Spawning.
Monster Class:
Code:
public class Monster
{
public uint ID;
public string Name;
public byte Type;
public ushort Lookface;
public uint Life;
public uint AttackMin;
public uint AttackMax;
public uint Defence;
public uint Dexterity;
public uint Dodge;
public ushort AttackRange;
public ushort ViewRange;
public uint EscapeLife;
public uint MoveSpeed;
public ushort Level;
public byte AttackUser;
public uint DropMoney;
public uint DropItemType;
public uint DropHP;
public uint DropMP;
public byte MagicType;
public uint MagicDefence;
public uint MagicHitRate;
public byte AIType;
public uint Defence2;
public uint ExtraExp;
}
public class MobSpawn
{
public uint SpawnID;
public ushort MapID;
public ushort X;
public ushort Y;
public ushort Xc;
public ushort Yc;
public uint MaxMobs;
public ushort RestSecs;
public uint SpawnAmount;
public uint MobID;
}
public static Dictionary<uint, Entity> eMonsters = new Dictionary<uint, Entity>();
public static Dictionary<uint, Monster> Mobs = new Dictionary<uint, Monster>();
public static Dictionary<uint, MobSpawn> MobSpawns = new Dictionary<uint, MobSpawn>();
Screen:
Code:
foreach (Entity mob in Kernel.eMonsters.Values)
{
if (mob.MapID == Client.Entity.MapID)
if (Kernel.GetDistance(mob.X, mob.Y, Client.Entity.X, Client.Entity.Y) <= 24)
{
if (!mob.Dead)
mob.SendSpawn(Client);
}
}
This is just a "alpha" code I guess you could say, it's prolly not the greatest, but it works.
I've been away for quite some time, and probably forgotten quite a bit, but... I'll be getting into this in the next few weeks, when life calms down, and see if I can offer something usefull to this work. Till then, goodluck on your works guys, and thanks for this great release Infamous.
Hopefully more people will start working on this source base, and actually learn stuff.
Here's Monster Loading/Spawning.
Monster Class: <-- i've made a new .cs called Monster.cs and put this in it.
Code:
public class Monster
{
public uint ID;
public string Name;
public byte Type;
public ushort Lookface;
public uint Life;
public uint AttackMin;
public uint AttackMax;
public uint Defence;
public uint Dexterity;
public uint Dodge;
public ushort AttackRange;
public ushort ViewRange;
public uint EscapeLife;
public uint MoveSpeed;
public ushort Level;
public byte AttackUser;
public uint DropMoney;
public uint DropItemType;
public uint DropHP;
public uint DropMP;
public byte MagicType;
public uint MagicDefence;
public uint MagicHitRate;
public byte AIType;
public uint Defence2;
public uint ExtraExp;
}
Monster Loading: <--- i've put this in Database.cs
public class MobSpawn
{
public uint SpawnID;
public ushort MapID;
public ushort X;
public ushort Y;
public ushort Xc;
public ushort Yc;
public uint MaxMobs;
public ushort RestSecs;
public uint SpawnAmount;
public uint MobID;
}
Monster Spawn Loading: <---- i've put this in Database.cs
public static Dictionary<uint, Entity> eMonsters = new Dictionary<uint, Entity>();
public static Dictionary<uint, Monster> Mobs = new Dictionary<uint, Monster>();
public static Dictionary<uint, MobSpawn> MobSpawns = new Dictionary<uint, MobSpawn>();
Screen: <--- i've put this in the constructor of Screen.cs
Code:
foreach (Entity mob in Kernel.eMonsters.Values)
{
if (mob.MapID == Client.Entity.MapID)
if (Kernel.GetDistance(mob.X, mob.Y, Client.Entity.X, Client.Entity.Y) <= 24)
{
if (!mob.Dead)
mob.SendSpawn(Client);
}
}
This is just a "alpha" code I guess you could say, it's prolly not the greatest, but it works.
I'm still working on lots more with monsters =P
Above i've written where I have put the codes :P
Is it good where I put it?
And I found some errors, I tryed to fix it:
My version of SpawnMobs (because of errors in the code of you :P
I've put //<--- Changed after things i changed :P
I've done it and its same as what I did in last line in LoadDatabase()
If I add them without removing the same in LoadDatabase it gives an
error exception that it is already in the Dictionary that means that it runs
the function 2 times. So I removed them in LoadDatabase() and put them in
Program.cs but its the same result as I had :P no monsters :P
Thnx for the info tho I didnt know where LoadDatabase(); was executed,
but now i know ^^
[Huge-Release] All-In-One Basic NPC Scripts For The 5165 Source! 02/19/2010 - CO2 PServer Guides & Releases - 30 Replies Well I'm sorry that I spammed the whole forum full of my posts So pro4never and .Ryu gave me the idea of making this All-In-One thread about all my NPC's! THESE ARE UPDATED DAILY!
NOTE: TO PEOPLE... SOME OF THE CODES ARE NOT MADE BY ME! I USUALLY JUST FIXED/UPDATED THE BASIC ONES! SORRY I'M LEARNING ON HOW TO CODE!
1. Birth-Island-NPC's(The NPC text is not from "REAL CONQUER" SORRY!...)
#region BirthOldGeneralYang
case 425:
{
[RELEASE] Basic LOTF Source 09/03/2009 - CO2 PServer Guides & Releases - 17 Replies hey this is a basic lotf source edited based off shadowco, if you dont like it then dont post here... flames will be told on!!! :D i will tell on you to the mods if you flame
What it has...
- LuckyTime
- Guard
- 24/7 GW