lately I've seen LordGragen. post about buffs and he was asking for the traps system so I've come up with something like that : //P.S don't Blame me for the coding way I'm less than a beginner
Steps :
1-sending map effect
2-code your action
floor effect has been released before :
in packethandler:
Ive made it like a portal :
the end.
Steps :
1-sending map effect
2-code your action
floor effect has been released before :
Code:
if (ServerBase.Kernel.GetDistance(client.Entity.X, client.Entity.Y, 376, 392) < 17 && !client.Effect3)
{
client.Effect3 = true;
if (client.Entity.MapID == 1002) //mapid
{
Network.GamePackets.FloorItem floorItem = new Network.GamePackets.FloorItem(true);
floorItem.ItemID = 791; //effectid
floorItem.MapID = 1002;//mapid
floorItem.X = 376; //X,Co-ordinate
floorItem.Y = 392; //Y,Co-ordinate
floorItem.Type = Network.GamePackets.FloorItem.Effect;
client.Send(floorItem);
}
}
else
{
if (ServerBase.Kernel.GetDistance(client.Entity.X, client.Entity.Y, 376, 392) > 17)
{
client.Effect3 = false;
}
}
in packethandler:
Code:
if (client.Entity.MapID == 1002)//mapid
{
if (new_X == 376 && new_Y == 392) //x.y
{
if (client.Entity.EntityFlag == Projectname.Game.EntityFlag.Player)
{
client.Entity.Teleport(1004, 50, 50);//action
client.Send(new Message("You have been teleported to " + client.Entity.MapID + "!", System.Drawing.Color.Yellow, Message.Whisper));
}
}
}
Ive made it like a portal :
|
|
the end.