|
You last visited: Today at 07:01
Advertisement
Help Needed Script,
Discussion on Help Needed Script, within the CO2 Private Server forum part of the Conquer Online 2 category.
02/19/2010, 23:04
|
#1
|
elite*gold: 0
Join Date: Apr 2008
Posts: 1,152
Received Thanks: 321
|
Help Needed Script,
What is Wrong with this, Idk Why but the Bless Effect Does not Seem to be Going Off,
Code:
using System;
using System.Collections.Generic;
using System.Text;
namespace NewestCOServer.Extra
{
public class BlessEffect
{
public static void Handler(Main.GameClient GC)
{
byte bless1 = 0;
byte bless3 = 0;
byte bless5 = 0;
byte bless7 = 0;
for (byte i = 1; i < 12; i++)
{
if (i != 7)
{
Game.Item I = (Game.Item)GC.MyChar.Equips.Get(i);
if (I.Bless == 1)
bless1++;
if (I.Bless == 3)
bless3++;
if (I.Bless == 5)
bless5++;
if (I.Bless == 7)
bless7++;
}
}
#region Check for bless 7
if (bless7 > bless5 && bless7 > bless3 && bless7 > bless1)
{
GC.AddSend(Packets.String(GC.MyChar.EntityID, 10, "aegis4"));
goto end;
}
#endregion
#region Check for bless 5
else if (bless5 > bless7 && bless5 > bless3 && bless5 > bless1)
{
GC.AddSend(Packets.String(GC.MyChar.EntityID, 10, "aegis3"));
goto end;
}
#endregion
#region Check for bless 3
else if (bless3 > bless7 && bless3 > bless5 && bless3 > bless1)
{
GC.AddSend(Packets.String(GC.MyChar.EntityID, 10, "aegis2"));
goto end;
}
#endregion
#region Check for bless 1
else if (bless1 > bless7 && bless1 > bless5 && bless1 > bless3)
{
GC.AddSend(Packets.String(GC.MyChar.EntityID, 10, "aegis1"));
goto end;
}
#endregion
end:
Console.WriteLine("This");
return;
}
}
}
|
|
|
02/19/2010, 23:08
|
#2
|
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 794
|
Try it like this :
else if ((bless1 > bless7) && (bless1 > bless5) && (bless1 > bless3))
And I don`t see why you`re adding that 'goto end' part, since only one of the if statements is going to be true.
|
|
|
02/19/2010, 23:15
|
#3
|
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
|
There's no MyMath.ChanceSuccess. So the source doesn't know how often for the effect to appear.
|
|
|
02/19/2010, 23:19
|
#4
|
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 794
|
Just a question, when you send an effect, do you send it so the effect will loop or just play it one single time?
|
|
|
02/19/2010, 23:22
|
#5
|
elite*gold: 0
Join Date: Apr 2008
Posts: 1,152
Received Thanks: 321
|
@ElDeRnEcRo
Still Dosent Seem to do anything, the first post u did
Play it one single time because i want to see if iam going the right way, So i wanted to see if the Effects WOrk, Thats the Whole Point of that Script So then i can move on to Fixing it better,
@Arco, I Thod with out a ChanceSucces, It would Just Happen Eavery Time, I WilL Try Adding 1
|
|
|
02/19/2010, 23:29
|
#6
|
elite*gold: 0
Join Date: Apr 2008
Posts: 1,152
Received Thanks: 321
|
Added, if (MyMath.ChanceSuccess(15))
Before Game.Item I =
Still Nothing,
|
|
|
02/19/2010, 23:31
|
#7
|
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
|
I look at your code and all its doing is checking for the bless and then sending the effect.
Shouldn't you be putting something in the attack.cs as well so when your char gets attacked the effect comes up.
|
|
|
02/19/2010, 23:36
|
#8
|
elite*gold: 0
Join Date: Apr 2008
Posts: 1,152
Received Thanks: 321
|
Quote:
Originally Posted by .Arco
I look at your code and all its doing is checking for the bless and then sending the effect.
Shouldn't you be putting something in the attack.cs as well so when your char gets attacked the effect comes up.
|
I Did In GetAttack, Also When Hes Attacking,
This is in Attack.cs
Extra.BlessEffect.Handler(GC);
This is In Character.cs in TakeAttack Void
Extra.BlessEffect.Handler(MyClient);
And Again in TakeAttack( Mob Void
Extra.BlessEffect.Handler(MyClient);
And in 1 more Spot for Attacking,
|
|
|
02/19/2010, 23:36
|
#9
|
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 794
|
How are you using the Handle() void? Please show us it`s use! The whole part please if possible :P
|
|
|
02/19/2010, 23:40
|
#10
|
elite*gold: 0
Join Date: Apr 2008
Posts: 1,152
Received Thanks: 321
|
Quote:
Originally Posted by ElDeRnEcRo
How are you using the Handle() void? Please show us it`s use! The whole part please if possible :P
|
What do You Exactly Mean When Geting Attacking/Or Hes Attacking, Should Activate
Code:
public static void Handler(Main.GameClient GC)
In BlessEffect.cs
|
|
|
02/19/2010, 23:49
|
#11
|
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 794
|
I mean where do you put the void in use, like
//xy codes;
Handler(xy2);
// xy3 codes;
|
|
|
02/20/2010, 00:28
|
#12
|
elite*gold: 0
Join Date: Apr 2008
Posts: 1,152
Received Thanks: 321
|
Quote:
Originally Posted by ElDeRnEcRo
I mean where do you put the void in use, like
//xy codes;
Handler(xy2);
// xy3 codes;
|
When player is attacking or getting attacked
|
|
|
02/20/2010, 00:30
|
#13
|
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
|
Quote:
Originally Posted by -Shunsui-
When player is attacking or getting attacked
|
Paste the entire code here.
|
|
|
02/20/2010, 00:32
|
#14
|
elite*gold: 0
Join Date: Apr 2008
Posts: 1,152
Received Thanks: 321
|
Quote:
Originally Posted by .Arco
Paste the entire code here.
|
This is in Attack.cs
Code:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NewestCOServer.PacketHandling
{
public class Attack
{
public static void Handle(Main.GameClient GC, byte[] Data)
{
try
{
[COLOR="Red"]Extra.BlessEffect.Handler(GC);[/COLOR]
Extra.Durability.AttackDurability(GC);
uint AttackType = BitConverter.ToUInt32(Data, 20);
if (AttackType != 24)
GC.MyChar.AtkMem.AtkType = (byte)AttackType;
GC.MyChar.Action = 100;
if (!GC.MyChar.Alive) return;
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);
}
Part of TakeAttack Void
Code:
public void TakeAttack(Mob Attacker, uint Damage, AttackType AT)
{
if (Damage != 0)
{
[COLOR="red"]Extra.BlessEffect.Handler(MyClient);[/COLOR]
Extra.Durability.DefenceDurability(MyClient);
if (Protection) Damage = 0;
if (BuffOf(SkillsClass.ExtraEffect.Scapegoat).Eff == SkillsClass.ExtraEffect.Scapegoat && MyMath.ChanceSuccess(30))
{
Buff B = BuffOf(SkillsClass.ExtraEffect.Scapegoat);
RemoveBuff(B);
uint Dmg = (uint)(PrepareAttack(2, false) * B.Value);
Attacker.TakeAttack(this, ref Dmg, AttackType.Scapegoat, false);
return;//Will not be damaged
}
if (CanReflect)
{
if (MyMath.ChanceSuccess(2))
{
Attacker.GetReflect(ref Damage, AT);
World.Action(Attacker, Packets.String(Attacker.EntityID, 10, "MagicReflect").Get);
Damage = 0;
return;
}
}
|
|
|
02/20/2010, 04:59
|
#15
|
elite*gold: 0
Join Date: Apr 2008
Posts: 1,152
Received Thanks: 321
|
Well. I Edited, the Script and I Tested it with different Effects, I Did it with the Super Rainbow Gem Effect and it works well, so iam guesing this Aint the Right Effect, Can Anyone help me out try finding the correct Bless Gear Effect
|
|
|
 |
|
Similar Threads
|
[L2Walker: Script Needed] Berserker Spirit
08/29/2010 - Lineage 2 - 11 Replies
Hello.
I need a script which will work as described below I need it because I have an 80 LVL Hierophant and I don't want him in the party.
1) Party Invite XXX
2) PM XXX Zerk or Delay XX Secs (the delay will be used to give time to the prophet)
3) After Zerk is received kick
4) Delay 1200 secs
5) Repeat
Can someone make it or make something similar?
Thanks
|
skill hack 1 and 2 script needed
03/31/2010 - Dekaron - 4 Replies
som1 has skill hack 1 and 2.
and i need a good speed script also..
cus the 1 i got doesnt works proper..
greetz
|
Gamesite200 - vote bot/script needed
03/04/2010 - General Coding - 0 Replies
Hello everyone. I'm in need of a vote bot/script for: http://www.top200.gs/
I'm a newbie to coding myself, so I don't know exactly what I'm looking for.
I want something that auto votes (it's restricted to 1 vote per ip-adress/12 or 24h).
Can anyone help me out?
Thanks and have a nice weekend everyone!
|
script for Actools needed
05/16/2008 - RF Online - 12 Replies
I need a script that "pushes" a button on my keybord allowing one of my chars to debuff the other one using force extract and skilthaw (if not both are possible then atleast force extract) since its not possible to run 2 rf and have 2 keys pressed.
I rly hope some1 can do this stuff
|
HELP NEEDED......EXP Script
04/19/2008 - RF Online - 20 Replies
I found this script somewhere in the internet...
if somebody can help us what we should do with these....
thanks
=============
# = variable
SET EXP RATE = %exp_rate #
|
All times are GMT +1. The time now is 07:01.
|
|