It depends on what object you are throwing the poison, this means that you are esditing the poison to the characters and you are testing the monsters, you must look carefully since they are different objects.
This skill code works perfectly for me on a source 6090, configure it your way, the only thing is that in your code there are plenty of things, remember that monster and player objects are handled differently, you cannot make conditions to a player object as a monster or vice versa since it will give you some error.
**
Handle:
case 6001:
{
if (CanUseSpell(spell, attacker.Owner))
{
PrepareSpell(spell, attacker.Owner);
SpellUse suse = new SpellUse(true);
suse.Attacker = attacker.UID;
suse.SpellID = spell.ID;
suse.SpellLevel = spell.Level;
suse.X = X;
suse.Y = Y;
//suse.SpellLevelHu = client_Spell.LevelHu2;
if (Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Distance)
{
foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
{
if (_obj.MapObjType == MapObjectType.Player || _obj.MapObjType == MapObjectType.Monster)
{
attacked = _obj as Entity;
if (attacked.MapObjType == MapObjectType.Monster)
if (attacked.MonsterInfo.Boss)
continue;
if (Kernel.GetDistance(X, Y, attacked.X, attacked.Y) <= spell.Range)
{
if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
{
int potDifference = attacker.BattlePower - attacked.BattlePower;
int rate = spell.Percent + potDifference - 20;
if (Kernel.Rate(rate))
{
attacked.ToxicFogStamp = Time32.Now;
attacked.ToxicFogLeft = 20;
attacked.ToxicFogPercent = spell.PowerPercent * 2;
attacked.AddFlag(Update.Flags.Poisoned);
suse.AddTarget(attacked, 1, null);
}
else
{
suse.AddTarget(attacked, 0, null);
suse.Targets[attacked.UID].Hit = false;
}
}
}
}
}
}
else
{
attacker.AttackPacket = null;
}
attacker.Owner.SendScreen(suse, true);
}
break;
}
**
**
World.cs
#region ToxicFog
if (client.Entity.ToxicFogLeft > 0)
{
if (Now >= client.Entity.ToxicFogStamp.AddSeconds(2))
{
float Percent = client.Entity.ToxicFogPercent;
float immu = client.Entity.Detoxication / 100F;
Percent = Math.Max(0.1F, Percent * immu);
//Remove this line if you want it normal
client.Entity.ToxicFogLeft--;
if (client.Entity.ToxicFogLeft == 0)
{
client.Entity.RemoveFlag(Update.Flags.Poisoned);
return;
}
client.Entity.ToxicFogStamp = Now;
if (client.Entity.Hitpoints > 1)
{
uint damage = Game.Attacking.Calculate.Percent(client.Entity, Percent);
if (client.Entity.ContainsFlag2(Network.GamePackets.Update.Flags2.AzureShield))
{
if (damage > client.Entity.AzureShieldDefence)
{
damage -= client.Entity.AzureShieldDefence;
Game.Attacking.Calculate.CreateAzureDMG(client.Entity.AzureShieldDefence, client.Entity, client.Entity);
client.Entity.RemoveFlag2(Network.GamePackets.Update.Flags2.AzureShield);
}
else
{
Game.Attacking.Calculate.CreateAzureDMG((uint)damage, client.Entity, client.Entity);
client.Entity.AzureShieldDefence -= (ushort)damage;
client.Entity.AzureShieldPacket();
damage = 1;
}
}
else
client.Entity.Hitpoints -= damage;
if (client.Entity.Hitpoints - damage <= 1)
{
client.Entity.Hitpoints = 1;
}
Network.GamePackets.SpellUse suse = new Network.GamePackets.SpellUse(true);
suse.Attacker = client.Entity.UID;
suse.SpellID = 10010;
suse.AddTarget(client.Entity, damage, null);
client.SendScreen(suse, true);
if (client != null)
client.UpdateQualifier(client.ArenaStatistic.PlayWith, client, damage);
}
}
}
else
{
if (client.Entity.ContainsFlag(Update.Flags.Poisoned))
client.Entity.RemoveFlag(Update.Flags.Poisoned);
}
#endregion
**
The code is not quite right, some fixes must be made but they are very basic, in addition to this you must handle the antiveven if your source handles it
I hope I can help you
good luck!