How to make it after kill a Specific number of monster its drops item or giving money or cps.
===============================
Open
MonsterTable.cs
Find this code
PHP Code:
if (Owner.Name.Contains("Guard") || killer.Name.Contains("Guard"))
return;
add this under it
PHP Code:
if (this.Name == "BirdMan")
{
killer.BirdMan += 1;
if (killer.BirdMan == 20)
{
killer.ConquerPoints += 50000;
killer.BirdMan = 0;
}
}
this code means the monster name is " BirdMan "
and it will add 1 to the current number of killed monsters.
then if total killed monsters was 20
it will add 50 k CPs.
if we wanna it drop item
we will replace this code :
PHP Code:
killer.ConquerPoints += 50000;
with this
PHP Code:
var infos = Database.ConquerItemInformation.BaseInformations[123456789];
ushort X = Owner.X, Y = Owner.Y;
Game.Map Map = ServerBase.Kernel.Maps[Owner.MapID];
if (Map.SelectCoordonates(ref X, ref Y))
{
Network.GamePackets.FloorItem floorItem = new Network.GamePackets.FloorItem(true);
floorItem.Item = new Network.GamePackets.ConquerItem(true);
floorItem.Item.Color = (Conquer_Online_Server.Game.Enums.Color)ServerBase.Kernel.Random.Next(4, 8);
floorItem.Item.ID = (uint)123456789;
floorItem.Item.MaximDurability = infos.Durability;
floorItem.Item.MobDropped = true;
floorItem.ValueType = Network.GamePackets.FloorItem.FloorValueType.Item;
floorItem.ItemID = (uint)123456789;
floorItem.MapID = Owner.MapID;
floorItem.MapObjType = Game.MapObjectType.Item;
floorItem.X = X;
floorItem.Y = Y;
floorItem.Type = Network.GamePackets.FloorItem.Drop;
floorItem.OnFloor = Time32.Now;
floorItem.ItemColor = floorItem.Item.Color;
floorItem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
while (Map.Npcs.ContainsKey(floorItem.UID))
floorItem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
Map.AddFloorItem(floorItem);
SendScreenSpawn(floorItem);
}
and it will looks like this.
PHP Code:
if (this.Name == "BirdMan")
{
killer.BirdMan += 1;
if (killer.BirdMan == 20)
{
var infos = Database.ConquerItemInformation.BaseInformations[123456789];
ushort X = Owner.X, Y = Owner.Y;
Game.Map Map = ServerBase.Kernel.Maps[Owner.MapID];
if (Map.SelectCoordonates(ref X, ref Y))
{
Network.GamePackets.FloorItem floorItem = new Network.GamePackets.FloorItem(true);
floorItem.Item = new Network.GamePackets.ConquerItem(true);
floorItem.Item.Color = (Conquer_Online_Server.Game.Enums.Color)ServerBase.Kernel.Random.Next(4, 8);
floorItem.Item.ID = (uint)123456789;
floorItem.Item.MaximDurability = infos.Durability;
floorItem.Item.MobDropped = true;
floorItem.ValueType = Network.GamePackets.FloorItem.FloorValueType.Item;
floorItem.ItemID = (uint)123456789;
floorItem.MapID = Owner.MapID;
floorItem.MapObjType = Game.MapObjectType.Item;
floorItem.X = X;
floorItem.Y = Y;
floorItem.Type = Network.GamePackets.FloorItem.Drop;
floorItem.OnFloor = Time32.Now;
floorItem.ItemColor = floorItem.Item.Color;
floorItem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
while (Map.Npcs.ContainsKey(floorItem.UID))
floorItem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
Map.AddFloorItem(floorItem);
SendScreenSpawn(floorItem);
}
}
}
to modify item ID, change this number "123456789" in 3 places with item ID.
if you want to change Monster to other, just rename " BirdMan " with the new Monster name , or create a new one with different Code in Entity.cs as we will see ....
if you wanna make it add money , so just replace this code :
PHP Code:
var infos = Database.ConquerItemInformation.BaseInformations[123456789];
ushort X = Owner.X, Y = Owner.Y;
Game.Map Map = ServerBase.Kernel.Maps[Owner.MapID];
if (Map.SelectCoordonates(ref X, ref Y))
{
Network.GamePackets.FloorItem floorItem = new Network.GamePackets.FloorItem(true);
floorItem.Item = new Network.GamePackets.ConquerItem(true);
floorItem.Item.Color = (Conquer_Online_Server.Game.Enums.Color)ServerBase.Kernel.Random.Next(4, 8);
floorItem.Item.ID = (uint)123456789;
floorItem.Item.MaximDurability = infos.Durability;
floorItem.Item.MobDropped = true;
floorItem.ValueType = Network.GamePackets.FloorItem.FloorValueType.Item;
floorItem.ItemID = (uint)123456789;
floorItem.MapID = Owner.MapID;
floorItem.MapObjType = Game.MapObjectType.Item;
floorItem.X = X;
floorItem.Y = Y;
floorItem.Type = Network.GamePackets.FloorItem.Drop;
floorItem.OnFloor = Time32.Now;
floorItem.ItemColor = floorItem.Item.Color;
floorItem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
while (Map.Npcs.ContainsKey(floorItem.UID))
floorItem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
Map.AddFloorItem(floorItem);
SendScreenSpawn(floorItem);
}
with this one :
PHP Code:
killer.Money += 50000;
and it will add 50 k of gold.
==============================
now go to Entity.cs
search this code
PHP Code:
public class Entity : Writer, Interfaces.IBaseEntity, Interfaces.IMapObject
{
under it add this code :
==========================
PHP Code:
private uint _birdman;
public uint BirdMan
{
get
{
return _birdman;
}
set
{
_birdman = value;
}
}
now we have done , hit F5 and its will work with you.
here is download links :
Intity.Txt
CPs and Money.Txt
Drop item.Txt