Quote:
Originally Posted by pro4never
That being said... i cannot think of a single example where a ground effect used properly would need to be removed early.
use traps if you want something that displays and is removed early imo.
|
This is an spell effecto, from DaggerStorm spell. Is a circle in that area can reach monsters and players during a given time. The effect is utilized by the method "floorItem" with a subtype 11 (for effect on ground). Is the right way to do a spell... Like this:
Code:
Network.GamePackets.FloorItem floorItem = new Network.GamePackets.FloorItem(true);
floorItem.ValueType = Network.GamePackets.FloorItem.FloorValueType.Item;
floorItem.ItemID = 48;//ID from MapMagicItem.ini
floorItem.MapID = attacker.MapID;
floorItem.MapObjType = Game.MapObjectType.Item;
floorItem.X = X;
floorItem.Y = Y;
floorItem.Owner = attacker.Owner;
floorItem.Type = Network.GamePackets.FloorItem.Effect;//Subtype 11
floorItem.OnFloor = Time32.Now;
floorItem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
while (Map.Npcs.ContainsKey(floorItem.UID))
floorItem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
Map.AddFloorItem(floorItem);
attacker.Owner.SendScreenSpawn(floorItem, true);
and to it on spell:
But the method of removing items from the screen, is not treated for subtype 11
Code:
if (obj.MapObjType == MapObjectType.Item)
{
Network.GamePackets.FloorItem item = obj as Network.GamePackets.FloorItem;
if (item.Type != Network.GamePackets.FloorItem.Effect)
{
if (Time32.Now > item.OnFloor.AddSeconds(ServerBase.Constants.FloorItemSeconds))
{
item.Type = Network.GamePackets.FloorItem.Remove;
foreach (Interfaces.IMapObject _obj in Objects)
{
if (_obj != null)
{
if (_obj.MapObjType == MapObjectType.Player)
{
(_obj as Entity).Owner.Send(item);
}
}
}
Owner.Map.Floor[item.X, item.Y, MapObjectType.Item, null] = true;
Remove(obj);
}
}
else
{
// Console.WriteLine("zaza");
item.Type = Network.GamePackets.FloorItem.Effect;
foreach (Interfaces.IMapObject _obj in Objects)
{
if (_obj != null)
{
if (_obj.MapObjType == MapObjectType.Player)
{
(_obj as Entity).Owner.Send(item);
}
}
}
}
}
Any idea?!