public void AddBuff(Buff B)
public void AddBuff(Buff B)
{
Buff ExBuff = BuffOf(B.Eff);
if (ExBuff.Eff == B.Eff)
Buffs.Remove(ExBuff);
foreach (Game.Character CC in Game.World.H_Chars.Values)
{
if (CC.Loc.Map == MyClient.MyChar.Loc.Map && MyMath.InBox(MyClient.MyChar.Loc.X, MyClient.MyChar.Loc.Y, CC.Loc.X, CC.Loc.Y, 100))
{
if (B.Eff == SkillsClass.ExtraEffect.Transform)
{
switch (B.Transform)
{
case 2000:
case 2001:
case 2002:
case 2003:
case 2010:
case 2011:
case 2012:
case 2013:
CC.MyClient.AddSend(Packets.Status(MyClient.MyChar.EntityID, Status.Mesh, (ulong)2141000000)); /// golem
break;
case 2005:
case 2006:
case 2007:
case 2008:
case 2009:
case 2040:
case 2041:
case 2042:
case 2043:
CC.MyClient.AddSend(Packets.Status(MyClient.MyChar.EntityID, Status.Mesh, (ulong)2131000000)); /// water elf
break;
case 2020:
case 2021:
case 2022:
case 2023:
case 2024:
CC.MyClient.AddSend(Packets.Status(MyClient.MyChar.EntityID, Status.Mesh, (ulong)2071000000)); /// divine hare
break;
case 2030:
case 2031:
case 2032:
case 2033:
case 2034:
CC.MyClient.AddSend(Packets.Status(MyClient.MyChar.EntityID, Status.Mesh, (ulong)2171000000)); /// night devil
break;
default:
CC.MyClient.AddSend(Packets.Status(MyClient.MyChar.EntityID, Status.Mesh, (ulong)(B.Transform * 10000000 + Avatar * 10000 + Mesh)));
break;
}
}
}
Buffs.Add(B);
StatEff.Add(B.StEff);
}
=\ Nice try... but it doesn't quite work. If that did work, it would make the character looking at the Nightdevil caster ... a nightdevil. (if that makes sense).Quote:
for it to be seen by other player try this code:
Code:foreach (Game.Character CC in Game.World.H_Chars.Values) { if (CC.Loc.Map == MyClient.MyChar.Loc.Map && MyMath.InBox(MyClient.MyChar.Loc.X, MyClient.MyChar.Loc.Y, CC.Loc.X, CC.Loc.Y, 100)) { if (B.Eff == SkillsClass.ExtraEffect.Transform) { switch (B.Transform) { case 2000: case 2001: case 2002: case 2003: case 2010: case 2011: case 2012: case 2013: CC.MyClient.AddSend(Packets.Status(MyClient.MyChar.EntityID, Status.Mesh, (ulong)2141000000)); /// golem break; case 2005: case 2006: case 2007: case 2008: case 2009: case 2040: case 2041: case 2042: case 2043: CC.MyClient.AddSend(Packets.Status(MyClient.MyChar.EntityID, Status.Mesh, (ulong)2131000000)); /// water elf break; case 2020: case 2021: case 2022: case 2023: case 2024: CC.MyClient.AddSend(Packets.Status(MyClient.MyChar.EntityID, Status.Mesh, (ulong)2071000000)); /// divine hare break; case 2030: case 2031: case 2032: case 2033: case 2034: CC.MyClient.AddSend(Packets.Status(MyClient.MyChar.EntityID, Status.Mesh, (ulong)2171000000)); /// night devil break; default: CC.MyClient.AddSend(Packets.Status(MyClient.MyChar.EntityID, Status.Mesh, (ulong)(B.Transform * 10000000 + Avatar * 10000 + Mesh))); break; } } }
the code will only fix the client side problem... not the Mesh of the transformation. If you notice, the code was only an update of the original code of the OP of this thread...Quote:
=\ Nice try... but it doesn't quite work. If that did work, it would make the character looking at the Nightdevil caster ... a nightdevil. (if that makes sense).
Epic Fail Guy.Quote:
hm... what is that efg?
Quote:
switch (Info.ExtraEff)
{
case ExtraEffect.BlessPray:
{
Buff B = new Buff();
B.Eff = Info.ExtraEff;
B.Lasts = Info.EffectLasts;
B.Value = Info.EffectValue;
B.Started = DateTime.Now;
B.StEff = StatusEffectEn.Pray;
C.AddBuff(B);
C.Prayer = true;
C.PrayDT = DateTime.Now;
C.GettingLuckyTime = true;
break;
}
case ExtraEffect.UnMount:
{
if (C.Equips.Steed.Plus < User.Equips.Steed.Plus)
{
C.StatEff.Remove(StatusEffectEn.Ride);
}
break;
}
case ExtraEffect.Scapegoat:
{
Buff B = new Buff();
B.Eff = Info.ExtraEff;
B.Lasts = Info.EffectLasts;
B.Value = Info.EffectValue;
B.Started = DateTime.Now;
B.StEff = StatusEffectEn.Normal;
C.AddBuff(B);
break;
}
case ExtraEffect.NoPots:
{
C.UnableToUseDrugsFor = Info.EffectLasts;
C.UnableToUseDrugs = DateTime.Now;
break;
}
case ExtraEffect.Ride:
{
if (!User.StatEff.Contains(StatusEffectEn.Ride))
User.StatEff.Add(StatusEffectEn.Ride);
else
User.StatEff.Remove(StatusEffectEn.Ride);
User.Vigor = User.MaxVigor;
break;
}
case ExtraEffect.Summon:
{
if (User.MyCompanion != null) User.MyCompanion.Dissappear();
User.MyCompanion = new Game.Companion(User, Info.Damage);
break;
}
case ExtraEffect.RemoveFly:
{
Buff B = C.BuffOf(ExtraEffect.Fly);
if (B.Eff == ExtraEffect.Fly && C.Potency < User.Potency)
C.RemoveBuff(B);
break;
}
case ExtraEffect.Transform:
{
Buff B = new Buff();
B.Eff = Info.ExtraEff;
B.Lasts = Info.EffectLasts;
B.Value = Info.EffectValue;
B.Transform = Info.Damage;
B.Started = DateTime.Now;
B.StEff = StatusEffectEn.Normal;
C.AddBuff(B);
break;
}
case ExtraEffect.Fly:
{
Buff B = new Buff();
B.Eff = Info.ExtraEff;
B.Lasts = Info.EffectLasts;
B.Value = Info.EffectValue;
B.Started = DateTime.Now;
B.StEff = StatusEffectEn.Fly;
C.AddBuff(B);
break;
}
case ExtraEffect.Revive:
{
C.Ghost = false;
C.BlueName = false;
C.CurHP = (ushort)C.MaxHP;
C.Alive = true;
C.StatEff.Clear();
C.PKPoints = C.PKPoints;
C.Body = C.Body;
C.Hair = C.Hair;
C.Equips.Send(C.MyClient, false);
World.Spawn(C, false);
break;
}
case ExtraEffect.FatalStrike:
{
Buff B = new Buff();
B.Eff = Info.ExtraEff;
B.Lasts = Info.EffectLasts;
B.Value = Info.EffectValue;
B.Started = DateTime.Now;
B.StEff = StatusEffectEn.FatalStrike;
C.AddBuff(B);
break;
}
case ExtraEffect.ShurikenVortex:
{
Buff B = new Buff();
B.Eff = Info.ExtraEff;
B.Lasts = Info.EffectLasts;
B.Value = Info.EffectValue;
B.Started = DateTime.Now;
B.StEff = StatusEffectEn.ShurikenVortex;
[uC.AddBuff(B);[/u]
C.VortexOn = true;
C.LastVortexAttk = DateTime.Now;
break;
}
case ExtraEffect.Stigma:
{
Buff B = new Buff();
B.Eff = Info.ExtraEff;
B.Lasts = Info.EffectLasts;
B.Value = Info.EffectValue;
B.Started = DateTime.Now;
B.StEff = StatusEffectEn.Stigma;
C.AddBuff(B);
break;
}
case ExtraEffect.MagicShield:
{
Buff B = new Buff();
B.Eff = Info.ExtraEff;
B.Lasts = Info.EffectLasts;
B.Value = Info.EffectValue;
B.Started = DateTime.Now;
B.StEff = StatusEffectEn.Shield;
C.AddBuff(B);
break;
}
case ExtraEffect.Invisibility:
{
Buff B = new Buff();
B.Eff = Info.ExtraEff;
B.Lasts = Info.EffectLasts;
B.Value = Info.EffectValue;
B.Started = DateTime.Now;
B.StEff = StatusEffectEn.Invisible;
C.AddBuff(B);
break;
}
case ExtraEffect.Accuracy:
{
Buff B = new Buff();
B.Eff = Info.ExtraEff;
B.Lasts = Info.EffectLasts;
B.Value = Info.EffectValue;
B.Started = DateTime.Now;
B.StEff = StatusEffectEn.Accuracy;
C.AddBuff(B);
break;
}
case ExtraEffect.Cyclone:
{
Buff B = new Buff();
B.Eff = Info.ExtraEff;
B.Lasts = Info.EffectLasts;
B.Value = Info.EffectValue;
B.Started = DateTime.Now;
B.StEff = StatusEffectEn.Cyclone;
C.AddBuff(B);
break;
}
case ExtraEffect.Superman:
{
Buff B = new Buff();
B.Eff = Info.ExtraEff;
B.Lasts = Info.EffectLasts;
B.Value = Info.EffectValue;
B.Started = DateTime.Now;
B.StEff = StatusEffectEn.SuperMan;
C.AddBuff(B);
break;