Help on remove floor effect

05/24/2013 21:01 zakkwilde_17#1
Well guys! I need some help here... i try to remove a floor effect from screen... but i got some problens... It's not cooded to remove a effect from a screen, just remove itens... I want to know if it's possible someone post an example for me to follow removing floor effect ...
05/24/2013 22:37 pro4never#2
What do you mean by floor effects? If you're sending an effect to an X/Y on the ground then that effect has to wear off as far as I'm aware. That's why you only send effects that should either be.

A: Permanent
B: Do not last longer then they are needed


Anything that does not fit that criteria should not be sent as a floor effect and should instead be handled some other way.

Think of it like casting a Spell on an X/Y coord then asking how to cancel out the spell effect before it's finished displaying... it's just not something the client was designed to do.
05/25/2013 00:06 Spirited#3
A workaround (which I don't completely support but will work) would be adding the effect to something with an id. Any entity that has an identity in the game can be removed from the map at any time (or at least moved). The way the client wants you to do it is make a new entry in the effects file and change the length of time it will display for.
05/25/2013 01:02 pro4never#4
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.
05/25/2013 01:50 zakkwilde_17#5
Quote:
Originally Posted by pro4never View Post
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:
[Only registered and activated users can see links. Click Here To Register...][Only registered and activated users can see links. Click Here To Register...]

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?!
05/27/2013 01:22 zakkwilde_17#6
UP
05/29/2013 20:45 zakkwilde_17#7
up
05/30/2013 00:54 Mr_PoP#8
you are doing it wrong!

AddEffect = 0xA,
RemoveEffect = 0xC,

you are adding the effect with the wrong subtype idk how it even works LOL!
05/31/2013 01:00 zakkwilde_17#9
Quote:
Originally Posted by Mr_PoP View Post
you are doing it wrong!

AddEffect = 0xA,
RemoveEffect = 0xC,

you are adding the effect with the wrong subtype idk how it even works LOL!
Hm... I saw this subtype 11 in some topic here in the forum. Who commented this subtype was the Fang... But NVM its done now. Thanks sir... now i got a full work DaggerStorm ;)