|
You last visited: Today at 20:26
Advertisement
[Release]SuperGemEffects
Discussion on [Release]SuperGemEffects within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.
01/23/2010, 21:51
|
#1
|
elite*gold: 0
Join Date: Jan 2010
Posts: 139
Received Thanks: 45
|
[Release]SuperGemEffects
Quote:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace NewestCOServer.Features
{
class GemEffect
{
public static void GemEffects(Game.Item.Gem Gem, Main.GameClient MyClient)
{
switch (Gem)
{
#region GemEffects
case Game.Item.Gem.SuperDragonGem:
{
if (MyMath.ChanceSuccess(1.0)) { MyClient.AddSend(Packets.String(MyClient.MyChar.En tityID, 10, "goldendragon")); }
break;
}
case Game.Item.Gem.SuperPhoenixGem:
{
if (MyMath.ChanceSuccess(1.0)) { MyClient.AddSend(Packets.String(MyClient.MyChar.En tityID, 10, "phoenix")); }
break;
}
case Game.Item.Gem.SuperRainbowGem:
{
if (MyMath.ChanceSuccess(1.0)) { MyClient.AddSend(Packets.String(MyClient.MyChar.En tityID, 10, "rainbow")); }
break;
}
case Game.Item.Gem.SuperMoonGem:
{
if (MyMath.ChanceSuccess(1.0)) { MyClient.AddSend(Packets.String(MyClient.MyChar.En tityID, 10, "moon")); }
break;
}
case Game.Item.Gem.SuperFuryGem:
{
if (MyMath.ChanceSuccess(1.0)) { MyClient.AddSend(Packets.String(MyClient.MyChar.En tityID, 10, "fastflash")); }
break;
}
case Game.Item.Gem.SuperKylinGem:
{
if (MyMath.ChanceSuccess(1.0)) { MyClient.AddSend(Packets.String(MyClient.MyChar.En tityID, 10, "goldenkylin")); }
break;
}
#endregion
}
}
}
}
|
Second go to Attack.cs in PacketHandling and search for
Code:
Quote:
else if (AttackType == 44)
{
ushort SkillId = 6003;
ushort x = GC.MyChar.Loc.X;
ushort y = GC.MyChar.Loc.Y;
uint Target = GC.MyChar.EntityID;
|
and paste bellow
Code:
Quote:
for (byte i = 1; i < 8; i++)
{
Game.Item I = GC.MyChar.Equips.Get(i);
if (I.ID != 0 && I.Soc1 != Game.Item.Gem.EmptySocket)
{
Features.GemEffect.GemEffects(I.Soc1, GC);
}
}
|
and search for
Code:
Quote:
else if (AttackType == 24)
{
ushort SkillId;
long x;
long y;
uint Target;
#region GetSkillID
SkillId = Convert.ToUInt16(((long)Data[24] & 0xFF) | (((long)Data[25] & 0xFF) << 8));
SkillId ^= (ushort)0x915d;
SkillId ^= (ushort)GC.MyChar.EntityID;
SkillId = (ushort)(SkillId << 0x3 | SkillId >> 0xd);
SkillId -= 0xeb42;
#endregion
#region GetCoords
x = (Data[16] & 0xFF) | ((Data[17] & 0xFF) << 8);
x = x ^ (uint)(GC.MyChar.EntityID & 0xffff) ^ 0x2ed6;
x = ((x << 1) | ((x & 0x8000) >> 15)) & 0xffff;
x |= 0xffff0000;
x -= 0xffff22ee;
y = (Data[18] & 0xFF) | ((Data[19] & 0xFF) << 8);
y = y ^ (uint)(GC.MyChar.EntityID & 0xffff) ^ 0xb99b;
y = ((y << 5) | ((y & 0xF800) >> 11)) & 0xffff;
y |= 0xffff0000;
y -= 0xffff8922;
#endregion
#region GetTarget
Target = ((uint)Data[12] & 0xFF) | (((uint)Data[13] & 0xFF) << 8) | (((uint)Data[14] & 0xFF) << 16) | (((uint)Data[15] & 0xFF) << 24);
Target = ((((Target & 0xffffe000) >> 13) | ((Target & 0x1fff) << 19)) ^ 0x5F2D2463 ^ GC.MyChar.EntityID) - 0x746F4AE6;
#endregion
|
bellow code, paste
Code:
Quote:
for (byte i = 1; i < 8; i++)
{
Game.Item I = GC.MyChar.Equips.Get(i);
if (I.ID != 0 && I.Soc1 != Game.Item.Gem.EmptySocket)
{
Features.GemEffect.GemEffects(I.Soc1, GC);
}
}
|
Credits Go To felipeboladao !
|
|
|
01/23/2010, 21:56
|
#2
|
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
|
Few things that really aren't a problem but I just wanted to bring up.
Instead of using the same or checks for each one, why not just combine the different eq socket checks together and then have them checked for a specific gem.
As it is right now you are A) calculating effects fully separate from eachother (meaning if you have more than 1 type of super gem statistically EVERY ATTACK is going to show a gem effect) B) using a super high chance of success (meaning spammed effects) and C) not using any sort of control to see how often they can come out (not a big deal but even with lower chances of success... archers + cyclone.. holy **** that's alot of sdg effects)
Not a big issue, just thinking of ways it might be able to be improved. Ooh also, this one has no handling for AMOUNT of gems. (so sdg effect chance is the same with 1 sdg as it is with 14). Personal preference I suppose but shouldn't amount of gems change the amount the effect is displayed slightly?
|
|
|
01/23/2010, 21:57
|
#3
|
elite*gold: 0
Join Date: Jan 2010
Posts: 139
Received Thanks: 45
|
hmm w8  I look on that code
|
|
|
01/23/2010, 22:35
|
#4
|
elite*gold: 0
Join Date: Mar 2008
Posts: 555
Received Thanks: 99
|
first post got changed
|
|
|
01/24/2010, 04:02
|
#5
|
elite*gold: 0
Join Date: Jul 2007
Posts: 255
Received Thanks: 273
|
hehe, good release, my code is very simple..
First create an GemEffects.cs in PacketHandling and paste the code below
Code:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace NewestCOServer.Features
{
class GemEffect
{
public static void GemEffects(Game.Item.Gem Gem, Main.GameClient MyClient)
{
switch (Gem)
{
#region GemEffects
case Game.Item.Gem.SuperDragonGem:
{
if (MyMath.ChanceSuccess(1.0)) { MyClient.AddSend(Packets.String(MyClient.MyChar.EntityID, 10, "goldendragon")); }
break;
}
case Game.Item.Gem.SuperPhoenixGem:
{
if (MyMath.ChanceSuccess(1.0)) { MyClient.AddSend(Packets.String(MyClient.MyChar.EntityID, 10, "phoenix")); }
break;
}
case Game.Item.Gem.SuperRainbowGem:
{
if (MyMath.ChanceSuccess(1.0)) { MyClient.AddSend(Packets.String(MyClient.MyChar.EntityID, 10, "rainbow")); }
break;
}
case Game.Item.Gem.SuperMoonGem:
{
if (MyMath.ChanceSuccess(1.0)) { MyClient.AddSend(Packets.String(MyClient.MyChar.EntityID, 10, "moon")); }
break;
}
case Game.Item.Gem.SuperFuryGem:
{
if (MyMath.ChanceSuccess(1.0)) { MyClient.AddSend(Packets.String(MyClient.MyChar.EntityID, 10, "fastflash")); }
break;
}
case Game.Item.Gem.SuperKylinGem:
{
if (MyMath.ChanceSuccess(1.0)) { MyClient.AddSend(Packets.String(MyClient.MyChar.EntityID, 10, "goldenkylin")); }
break;
}
#endregion
}
}
}
}
Second go to Attack.cs in PacketHandling and search for
Code:
else if (AttackType == 44)
{
ushort SkillId = 6003;
ushort x = GC.MyChar.Loc.X;
ushort y = GC.MyChar.Loc.Y;
uint Target = GC.MyChar.EntityID;
and pasta bellow
Code:
for (byte i = 1; i < 8; i++)
{
Game.Item I = GC.MyChar.Equips.Get(i);
if (I.ID != 0 && I.Soc1 != Game.Item.Gem.EmptySocket)
{
Features.GemEffect.GemEffects(I.Soc1, GC);
Features.GemEffect.GemEffects(I.Soc2, GC);
}
}
and search for
Code:
else if (AttackType == 24)
{
ushort SkillId;
long x;
long y;
uint Target;
#region GetSkillID
SkillId = Convert.ToUInt16(((long)Data[24] & 0xFF) | (((long)Data[25] & 0xFF) << 8));
SkillId ^= (ushort)0x915d;
SkillId ^= (ushort)GC.MyChar.EntityID;
SkillId = (ushort)(SkillId << 0x3 | SkillId >> 0xd);
SkillId -= 0xeb42;
#endregion
#region GetCoords
x = (Data[16] & 0xFF) | ((Data[17] & 0xFF) << 8);
x = x ^ (uint)(GC.MyChar.EntityID & 0xffff) ^ 0x2ed6;
x = ((x << 1) | ((x & 0x8000) >> 15)) & 0xffff;
x |= 0xffff0000;
x -= 0xffff22ee;
y = (Data[18] & 0xFF) | ((Data[19] & 0xFF) << 8);
y = y ^ (uint)(GC.MyChar.EntityID & 0xffff) ^ 0xb99b;
y = ((y << 5) | ((y & 0xF800) >> 11)) & 0xffff;
y |= 0xffff0000;
y -= 0xffff8922;
#endregion
#region GetTarget
Target = ((uint)Data[12] & 0xFF) | (((uint)Data[13] & 0xFF) << 8) | (((uint)Data[14] & 0xFF) << 16) | (((uint)Data[15] & 0xFF) << 24);
Target = ((((Target & 0xffffe000) >> 13) | ((Target & 0x1fff) << 19)) ^ 0x5F2D2463 ^ GC.MyChar.EntityID) - 0x746F4AE6;
#endregion
bellow code, paste
Code:
for (byte i = 1; i < 8; i++)
{
Game.Item I = GC.MyChar.Equips.Get(i);
if (I.ID != 0 && I.Soc1 != Game.Item.Gem.EmptySocket)
{
Features.GemEffect.GemEffects(I.Soc1, GC);
Features.GemEffect.GemEffects(I.Soc2, GC);
}
}
hehe, this full working??, give me tranks  ;D
|
|
|
01/24/2010, 05:16
|
#6
|
elite*gold: 0
Join Date: Dec 2007
Posts: 1,326
Received Thanks: 539
|
Quote:
Originally Posted by QuickCo
Search
Under That Add Next code
DragonGem Effects
PheonixGem Effect
RainbowGem
Violet Gem Effect
MoonGem Effect
KylinGem Effect
FuryGem Effect
TortoiseGem Effect
Thanks Me If you Use That Code
|
where to put this code i mean what is the name of the file?
|
|
|
01/24/2010, 06:16
|
#7
|
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
|
Quote:
Originally Posted by [GM]
where to put this code i mean what is the name of the file?
|
Did you search for #region GetTarget?
|
|
|
01/24/2010, 15:33
|
#8
|
elite*gold: 0
Join Date: Dec 2007
Posts: 1,326
Received Thanks: 539
|
Quote:
Originally Posted by Hepatitis C
Did you search for #region GetTarget?
|
yea i did its in Attack.cs
|
|
|
01/24/2010, 20:59
|
#9
|
elite*gold: 0
Join Date: Dec 2009
Posts: 583
Received Thanks: 119
|
Goodjob
|
|
|
01/25/2010, 00:42
|
#10
|
elite*gold: 0
Join Date: Mar 2006
Posts: 61
Received Thanks: 88
|
Heya dudes, I think if you put it like my code, this work a lot better.
This is for 5165 source.
Try to find in file Attack.cs
Code:
if (!GC.MyChar.Alive) return;
Try put only this one at below
Code:
for (byte i = 1; i <= 12; i++)
{
Game.Item I = GC.MyChar.Equips.Get(i);
if (I.ID != 0 && I.Soc1 != Game.Item.Gem.EmptySocket)
Features.GemEffect.GemEffects(I.Soc1, GC);
if (I.ID != 0 && I.Soc2 != Game.Item.Gem.EmptySocket)
Features.GemEffect.GemEffects(I.Soc2, GC);
}
and last, put this into PacketHandling.GemEffects
Code:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace NewestCOServer.Features
{
class GemEffect
{
public static void GemEffects(Game.Item.Gem Gem, Main.GameClient MyClient)
{
switch (Gem)
{
#region GemEffects
case Game.Item.Gem.SuperDragonGem:
{
if (MyMath.ChanceSuccess(2.0)) { MyClient.AddSend(Packets.String(MyClient.MyChar.EntityID, 10, "goldendragon")); }
break;
}
case Game.Item.Gem.SuperPhoenixGem:
{
if (MyMath.ChanceSuccess(2.0)) { MyClient.AddSend(Packets.String(MyClient.MyChar.EntityID, 10, "phoenix")); }
break;
}
case Game.Item.Gem.SuperRainbowGem:
{
if (MyMath.ChanceSuccess(2.0)) { MyClient.AddSend(Packets.String(MyClient.MyChar.EntityID, 10, "rainbow")); }
break;
}
case Game.Item.Gem.SuperMoonGem:
{
if (MyMath.ChanceSuccess(2.0)) { MyClient.AddSend(Packets.String(MyClient.MyChar.EntityID, 10, "moon")); }
break;
}
case Game.Item.Gem.SuperFuryGem:
{
if (MyMath.ChanceSuccess(2.0)) { MyClient.AddSend(Packets.String(MyClient.MyChar.EntityID, 10, "fastflash")); }
break;
}
case Game.Item.Gem.SuperKylinGem:
{
if (MyMath.ChanceSuccess(2.0)) { MyClient.AddSend(Packets.String(MyClient.MyChar.EntityID, 10, "goldenkylin")); }
break;
}
case Game.Item.Gem.SuperVioletGem:
{
if (MyMath.ChanceSuccess(2.0)) { MyClient.AddSend(Packets.String(MyClient.MyChar.EntityID, 10, "purpleray")); }
break;
}
case Game.Item.Gem.SuperTortoiseGem:
{
if (MyMath.ChanceSuccess(2.0)) { MyClient.AddSend(Packets.String(MyClient.MyChar.EntityID, 10, "recovery")); }
break;
}
#endregion
}
}
}
}
It's work for me with all type attack
|
|
|
01/25/2010, 02:01
|
#11
|
elite*gold: 0
Join Date: Feb 2009
Posts: 700
Received Thanks: 79
|
good job.
|
|
|
01/26/2010, 18:19
|
#12
|
elite*gold: 0
Join Date: Dec 2007
Posts: 1,326
Received Thanks: 539
|
GemEffects is underlined RED
|
|
|
01/28/2010, 11:00
|
#13
|
elite*gold: 0
Join Date: Aug 2008
Posts: 272
Received Thanks: 61
|
only work when you use your skills :S if you atack normaly not work :S
|
|
|
01/28/2010, 16:01
|
#14
|
elite*gold: 0
Join Date: Mar 2006
Posts: 61
Received Thanks: 88
|
ramix you wrong look at page 1 on my post look where i added once this gemeffect checker. it work on any attacks.
|
|
|
01/28/2010, 16:25
|
#15
|
elite*gold: 0
Join Date: Jan 2010
Posts: 116
Received Thanks: 33
|
What source is this code for?
#edit
Because if it is for 5017 it has already been released a half a dozen times.
|
|
|
All times are GMT +1. The time now is 20:26.
|
|