I want try spawn monster like this code:
(but not work!)
PHP Code:
public class MobSpawn : ExodusPacket
{
public MobSpawn(uint UID,Status type,ulong value)
: base(8 + 36)
{
byte[] bt=new byte[8+36];
WORD((ushort)(bt.Length-8));
WORD((ushort)10017);
DWORD32(UID);
DWORD32(0x01);
DWORD32((uint)type);
DWORD(value);
}
}
PHP Code:
static void MobThread_Execute()
{
try
{
if (H_Chars.Count > 0)
{
try
{
foreach (Hashtable H in H_Mobs.Values)
{
foreach (MobStruct M in H.Values)
{
//M.Step();
if (M.PoisonedInfo != null)
{
if (DateTime.Now > M.PoisonedInfo.LastAttack.AddSeconds(3))
{
if (M.CurrentHP == 0)
{
M.PoisonedInfo = null;
foreach (Entity C in H_Chars.Values)
if (M.Loc.Map == C.MapID)
if (MyMath.PointDistance(M.Loc.X, M.Loc.Y, C.X, C.Y) <= 20)
C.Client.Send(new MobSpawn(M.EntityID, Status.Effect, 0));
continue;
}
//M.PoisonedInfo.Times--;
M.PoisonedInfo.LastAttack = DateTime.Now;
uint Dmg = (uint)(M.CurrentHP * (10 + M.PoisonedInfo.SpellLevel * 10) / 100);
if (Dmg == 1)
continue;
// M.TakeAttack(M, Dmg, AttackType.Melee);
if (M.PoisonedInfo.Times == 0)
{
M.PoisonedInfo = null;
foreach (Entity C in H_Chars.Values)
if (M.Loc.Map == C.MapID)
if (MyMath.PointDistance(M.Loc.X, M.Loc.Y, C.X, C.Y) <= 20)
C.Client.Send(new MobSpawn(M.EntityID, Status.Effect, 0));//.AddSend(Packets.Status(M.EntityID, ConquerSx.Game.Status.Effect, 0));
}
}
}
}
}
}
catch (Exception Exc) { Console.WriteLine(Exc); }
}
}
catch (Exception Exc) { Console.WriteLine(Exc); }
}
PHP Code:
MyThread MobThread = new MyThread();
MobThread.Execute += new Execute(MobThread_Execute);
MobThread.Start(400);
I hope study to this will help!






