ProjectX Source

08/01/2011 00:06 soldiar...#76
i know. but where do i have to look in database.cs? i search for loadmobs and found some thing.

Quote:
public static void LoadMobs()
{
string[] FMobs = File.ReadAllLines(@"C:\OldCODB\MobInfos.txt");
Hashtable Mobs = new Hashtable(FMobs.Length);
for (int i = 0; i < FMobs.Length; i++)
{
if (FMobs[i][0] != '*')
{
Game.Mob M = new ProjectX.Game.Mob(FMobs[i]);
Mobs.Add(M.MobID, M);
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("Loading Mob: " + M.MobID);
Console.ResetColor();
}
}
int MobsCount = 0;

string[] FSpawns = File.ReadAllLines(@"C:\OldCODB\MobSpawns.txt");
foreach (string Spawn in FSpawns)
{
if (Spawn[0] == '*') return;
string[] SpawnInfo = Spawn.Split(' ');
int MobID = int.Parse(SpawnInfo[0]);
int Count = int.Parse(SpawnInfo[1]);
ushort Map = ushort.Parse(SpawnInfo[2]);
ushort XFrom = ushort.Parse(SpawnInfo[3]);
ushort YFrom = ushort.Parse(SpawnInfo[4]);
ushort XTo = ushort.Parse(SpawnInfo[5]);
ushort YTo = ushort.Parse(SpawnInfo[6]);
if (!Game.World.H_Mobs.Contains(Map))
Game.World.H_Mobs.Add(Map, new Hashtable());
Hashtable MapMobs = (Hashtable)Game.World.H_Mobs[Map];

DMap D = (DMap)DMaps.H_DMaps[Map];

for (int i = 0; i < Count; i++)
{
Game.Mob _Mob = new ProjectX.Game.Mob((Game.Mob)Mobs[MobID]);
_Mob.Loc = new ProjectX.Game.Location();
_Mob.Loc.Map = Map;
_Mob.Loc.X = (ushort)Program.Rnd.Next(Math.Min(XFrom, XTo), Math.Max(XFrom, XTo));
_Mob.Loc.Y = (ushort)Program.Rnd.Next(Math.Min(YFrom, YTo), Math.Max(YFrom, YTo));

while (D != null && D.GetCell(_Mob.Loc.X, _Mob.Loc.Y).NoAccess)
{
_Mob.Loc.X = (ushort)Program.Rnd.Next(Math.Min(XFrom, XTo), Math.Max(XFrom, XTo));
_Mob.Loc.Y = (ushort)Program.Rnd.Next(Math.Min(YFrom, YTo), Math.Max(YFrom, YTo));
}
_Mob.StartLoc = _Mob.Loc;
_Mob.EntityID = (uint)Program.Rnd.Next(400000, 500000);
while (Game.World.H_Chars.Contains(_Mob.EntityID) || MapMobs.Contains(_Mob.EntityID))
_Mob.EntityID = (uint)Program.Rnd.Next(400000, 500000);

MapMobs.Add(_Mob.EntityID, _Mob);
MobsCount++;
}
}
Program.WriteLine("Mobs loaded " + MobsCount.ToString());
}
the mobs arent spawning. whats wrong?
08/01/2011 00:10 F i n c h i#77
He said in LoadMobs.cs not in Database.cs
08/01/2011 01:05 BaussHacker#78
Oh wait a minute my bad, go to the database and add mobspawns in mobspawn.txt or take any others mob spawn from 5165 sources.

I apologize.
08/01/2011 02:01 soldiar...#79
Quote:
Originally Posted by BaussHacker View Post
Oh wait a minute my bad, go to the database and add mobspawns in mobspawn.txt or take any others mob spawn from 5165 sources.

I apologize.
Thnx ur the best.
it works.

But now my last question.

I know its PVP but i want to use bows and katanas. cuz when i try to buy katanas, system says Katanas & Bows are not allowed. how to allow it?
08/01/2011 05:57 BaussHacker#80
Quote:
Originally Posted by soldiar... View Post
Thnx ur the best.
it works.

But now my last question.

I know its PVP but i want to use bows and katanas. cuz when i try to buy katanas, system says Katanas & Bows are not allowed. how to allow it?
Find the buyitem.cs or something, then you just remove the check for it.
08/01/2011 12:23 soldiar...#81
awh. thnx i found shop.cs in itempacket and i found this
Quote:
catch (Exception Exc) { Program.WriteLine(Exc); }
Game.ItemIDManipulation e = new ProjectX.Game.ItemIDManipulation(I.ID);
if (e.Part(0, 2) == 11 || e.Part(0, 2) == 13 || e.Part(0, 3) == 123 || e.Part(0, 3) == 141 || e.Part(0, 3) == 142)
I.Color = ProjectX.Game.Item.ArmorColor.Orange;

string iid = I.ID.ToString();
if (iid.StartsWith("601") || iid.StartsWith("5003") || iid.StartsWith("5002") || iid.StartsWith("5001") || iid.StartsWith("5000"))
{
GC.MyChar.MyClient.LocalMessage(2000, "Katanas & Bows are not allowed!");
}
else
{
GC.MyChar.AddItem(I);
GC.MyChar.Silvers -= DBI.Worth;
}
}
else if (S.MoneyType == 1 && GC.MyChar.CPs >= DBI.CPsWorth)
{
Game.Item I = new ProjectX.Game.Item();
I.ID = ItemID;
I.UID = (uint)Game.World.Rnd.Next(10000000);
try
{
I.MaxDur = DBI.Durability;
I.CurDur = I.MaxDur;
}
catch (Exception Exc) { Program.WriteLine(Exc); }

if (Game.ItemIDManipulation.Part(I.ID, 0, 2) == 73)
I.Plus = Game.ItemIDManipulation.Digit(I.ID, 6);

string iid = I.ID.ToString();
if (iid.StartsWith("601") || iid.StartsWith("5003") || iid.StartsWith("5002") || iid.StartsWith("5001") || iid.StartsWith("5000"))
{
GC.MyChar.MyClient.LocalMessage(2000, "Katanas & Bows are not allowed!");
}
else
{
GC.MyChar.AddItem(I);
GC.MyChar.CPs -= DBI.CPsWorth;
what should i delete?
08/01/2011 12:56 sitdownson#82
Well all Katanas start with the ID 601 if you checked in items.txt
if (iid.StartsWith("601")
08/01/2011 13:24 soldiar...#83
i removed it but i cant still buy katanas and bows
08/01/2011 15:22 BaussHacker#84
Did you build or debug?
08/01/2011 17:33 soldiar...#85
yea i pressed f6 and f5.

but still cant buy them.

i see the problem i got c# 2008. i think i need c# 2010. but i got no reg key =(
08/01/2011 20:46 sitdownson#86
Quote:
Originally Posted by soldiar... View Post
yea i pressed f6 and f5.

but still cant buy them.

i see the problem i got c# 2008. i think i need c# 2010. but i got no reg key =(
You got to register the product, it was free when someone told me to do that, if i remember right they will send you a register key once you registered the product.
08/01/2011 21:12 BaussHacker#87
Quote:
Originally Posted by soldiar... View Post
yea i pressed f6 and f5.

but still cant buy them.

i see the problem i got c# 2008. i think i need c# 2010. but i got no reg key =(
Just register your product at microsoft and activate it with your mail.
08/02/2011 00:37 soldiar...#88
yea i got it now. microsoft blocked my isp. :S i registrated @ a friend. but now i try to debug and it gives me an error in connection.cs when i try to login. does anyone having the same?

Quote:
pinvokestackimbalance was detected
Quote:
A call to PInvoke function ProjectX!ProjectX.Native::memcpy has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.
[Only registered and activated users can see links. Click Here To Register...]

Uploaded with [Only registered and activated users can see links. Click Here To Register...]
08/02/2011 01:26 BaussHacker#89
Quote:
Originally Posted by soldiar... View Post
yea i got it now. microsoft blocked my isp. :S i registrated @ a friend. but now i try to debug and it gives me an error in connection.cs when i try to login. does anyone having the same?




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

Uploaded with [Only registered and activated users can see links. Click Here To Register...]
Please search, the fix for it have been posted multiple times ^^
08/05/2011 03:42 siGA123#90
[Only registered and activated users can see links. Click Here To Register...]

anyone know how to fix the timer file?