i need some help in understanding Fly skill

10/19/2011 11:45 mujake#1
i need some help on the fly skill,i am wondering how to make the character come down to earth after using fly skill, i mean after the time expires.Does any one has any idea on that?
10/19/2011 13:53 pro4never#2
you....

Remove the status effect for fly... and send the screen an update packet for that character using their new status effect pool.

if you mean handling the timeout... well you need some sort of effects thread to deal with all of the status effects that expire (buff skills mostly). When they expire, remove them, update stateff and send to clients nearby.
10/19/2011 17:28 mujake#3
when the counter reaches zero the client will keep flying ,that is my problem,i am using an version of coemu ; i also found that after an monster die character it will keep attack it

I also tried elite coemu video guide u made but ,after i get the source and i open it in Visual studio 2010 i get errors
10/19/2011 17:41 pro4never#4
then you're not handling the end of the effect properly in the source. I seem to remember the client actually sends a general data requesting to stop flying actually... make sure you handle that properly.

Thing with monsters... just during their attack code check if target is dead and if so clear their target and return.
10/21/2011 06:33 mujake#5
i have this at skill
case 8002:
{

#region XPFly
if (CSocket.Client.XpTime)
{
CSocket.Client.XpTime = false;
CSocket.Client.XpFlying = true;
CSocket.Client.FlyTime = 40;
CSocket.Client.FlyActivated = DateTime.Now;
//DoSpell(CSocket.Client.ID, CSocket.Client.ID, CSocket.Client.X, CSocket.Client.Y, CSocket.Client.X, CSocket.Client.Y, (int)CSocket.Client.Map, Spell.ID, 0, Spell.Level);
ConquerPacket.ToLocal(ConquerPacket.Status(CSocket , 2, 0, Struct.StatusTypes.StatusEffect), CSocket.Client.X, CSocket.Client.Y, (int)CSocket.Client.Map, 0, 0);
DoSpell(CSocket.Client.ID, CSocket.Client.ID, CSocket.Client.X, CSocket.Client.Y, CSocket.Client.X, CSocket.Client.Y, (int)CSocket.Client.Map, Spell.ID, 0, Spell.Level);
}
else if CSocket.Client.FlyTime = 0;
break;
#endregion

should i try make like
else if
client flytime =0
unspell .....
to unload the skill???
10/21/2011 07:08 pro4never#6
That's only if they used the skill while already flying which should be impossible and would be wrong.


Right click FlyTime, find all references.

There SHOULD be somewhere in your threading saying something like...

if(DateTime.Now > CSocket.Client.FlyActivate.AddSeconds(CSocket.Clie nt.FlyTime))



By the looks of it though... you aren't even using any sort of status effect pool in that source... which means you're going to get LOTS of bugs.

Good luck with that lol.
10/21/2011 07:16 mujake#7
found it is in client socket.cs
if (Client.Flying)
if (DateTime.Now > Client.FlyActivated.AddSeconds(Client.FlyTime))
EndFly();
now where to put the code to end the skill?


public void EndFly()
{
Client.FlyTime = 0;
Client.Flying = false;
ConquerPacket.ToLocal(ConquerPacket.Status(this, 2, 0, Struct.StatusTypes.StatusEffect), Client.X, Client.Y, (int)Client.Map, 0, 0);
}
found this a bit down from that code

i also found in character.cs

//public int XpToEnd =0;

should i delete the "//"?
10/21/2011 23:08 Korvacs#8
The change to the status effect always used to be handled in the general data packet handler.
10/21/2011 23:35 mujake#9
Code:
case 8002:
 {

 #region XPFly
 if (CSocket.Client.XpTime)
 {
 CSocket.Client.XpTime = false;
 CSocket.Client.XpFlying = true;
 CSocket.Client.FlyTime = 40;
 CSocket.Client.FlyActivated = DateTime.Now;
 //DoSpell(CSocket.Client.ID, CSocket.Client.ID, CSocket.Client.X, CSocket.Client.Y, CSocket.Client.X, CSocket.Client.Y, (int)CSocket.Client.Map, Spell.ID, 0, Spell.Level);
 ConquerPacket.ToLocal(ConquerPacket.Status(CSocket , 2, 0, Struct.StatusTypes.StatusEffect), CSocket.Client.X, CSocket.Client.Y, (int)CSocket.Client.Map, 0, 0);
 DoSpell(CSocket.Client.ID, CSocket.Client.ID, CSocket.Client.X, CSocket.Client.Y, CSocket.Client.X, CSocket.Client.Y, (int)CSocket.Client.Map, Spell.ID, 0, Spell.Level);
 }
 else if CSocket.Client.FlyTime = 0;
Client.Flying = false;
 ConquerPacket.ToLocal(ConquerPacket.Status(this, 2, 0, Struct.StatusTypes.StatusEffect), Client.X, Client.Y, (int)Client.Map, 0, 0);
 break;
{
#endregion
will something like this work?