Page 1 of 1
[awaiting patch] Shadowstrike Ability
PostPosted: Mon Mar 09, 2009 11:35 pm
by stephenxpimentel
Heya, I'm working on Shadowstrike ability, And i'm trying to figure out how to make it call the PA style. Any ideas?
here is a sample of the handler.
- Code: Select all
namespace DOL.GS.SkillHandler
{
[SkillHandlerAttribute(Abilities.ShadowStrike)]
public class ShadowStrikeAbilityHandler : IAbilityActionHandler
{
/// <summary>
/// Defines a logger for this class.
/// </summary>
private static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// The reuse time in milliseconds for Shadow Strike ability
/// </summary>
protected const int REUSE_TIMER = 60000 * 10; // 10 minutes
/// <summary>
/// Execute Shadowstrike
/// </summary>
public void Execute(Ability ab, GamePlayer player)
{
if (player == null)
{
if (log.IsWarnEnabled)
log.Warn("Could not find player using ShadowStrikeAbility.");
return;
}
if (!player.IsAlive) //has to be alive.
{
player.Out.SendMessage("You cannot use this while Dead!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
return;
}
if (player.IsMezzed) //cant be mezzed.
{
player.Out.SendMessage("You cannot use this while Mezzed!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
return;
}
if (player.IsStunned) //cant be stunned.
{
player.Out.SendMessage("You cannot use this while Stunned!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
return;
}
if (player.IsSitting) //cant be sitting.
{
player.Out.SendMessage("You must be standing to use this ability!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
return;
}
if (player.TargetObject != player) //target must be a player.
{
player.Out.SendMessage("You can only use this ability on a player!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
return;
}
if (!player.IsStealthed)
{
player.Out.SendMessage("You must be Stealthed to use this ability!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
return;
}
GameLiving target = (GameLiving)player.TargetObject;
int xrange = 0;
int yrange = 0;
double angle = 0.00153248422;
player.MoveTo(player.CurrentRegionID, (int)(target.X - ((xrange + 5) * Math.Sin(angle * target.Heading))), (int)(target.Y + ((yrange + 5) * Math.Cos(angle * target.Heading))), target.Z, player.Heading);
player.DisableSkill(ab, REUSE_TIMER);
}
}
}
Re: Shadowstrike Ability
PostPosted: Tue Mar 10, 2009 12:28 am
by LifeFlight
- Code: Select all
Style style = SkillBase.GetStyleByID(xxx);
if (style != null)
{
StyleProcessor.TryToUseStyle(this, style);
}
That should do it.
Re: Shadowstrike Ability
PostPosted: Tue Mar 10, 2009 2:53 am
by stephenxpimentel
thanks will have this working by tomorrow

Re: Shadowstrike Ability
PostPosted: Tue Mar 10, 2009 7:27 am
by Graveen
/cheer Stephen

Re: Shadowstrike Ability
PostPosted: Thu Mar 12, 2009 11:03 pm
by stephenxpimentel
Heya, sorry for the delay, need a little help tho.
Here is ShadowStrikeSpellHandler.cs... - Have some issues tho - TARGET gets moved (and not to the caster) - Spell Un-stealths the caster - And i cant figure out how to make it perform the PA style. (Although due to lag issues that MoveTo causes we should make copies of the PA style with no frontal req, for performance issues.) I'm sorry but this is just frustrating the crap out of me now, and i would like someone else to take a whack at it.
- Code: Select all
using System;
using System.Collections.Generic;
using DOL.GS.Styles;
using DOL.GS.Spells;
using DOL.GS.PlayerClass;
using DOL.GS.Effects;
using DOL.GS.SkillHandler;
using System.Text;
using System.Collections;
using System.Reflection;
using DOL.Language;
using DOL.AI.Brain;
using DOL.Database;
using DOL.GS.Keeps;
using DOL.GS.PacketHandler;
using log4net;
namespace DOL.GS.Spells
{
[SpellHandler("ShadowStrike")]
public class ShadowStrikeSpellHandler : SpellHandler
{
public override void FinishSpellCast(GameLiving player)
{
GameLiving target = (GamePlayer)player.TargetObject;
int xrange = 0;
int yrange = 0;
double angle = 0.00153248422;
player.MoveTo(player.CurrentRegionID, (int)(target.X - ((xrange + 10) * Math.Sin(angle * target.Heading))), (int)(target.Y + ((yrange + 10) * Math.Cos(angle * target.Heading))), target.Z, player.Heading);
base.FinishSpellCast(player);
}
/* public static void TryToUseStyle(GameLiving living, Style style)
{
GamePlayer player = living as GamePlayer;
if (living.AttackState == false)
{
living.StartAttack(player.TargetObject);
living.NextCombatStyle = style;
}
}*/
public ShadowStrikeSpellHandler(GameLiving caster, Spell spell, SpellLine line) : base(caster, spell, line) { }
}
}
ShadowStrikeAbility.cs
- Code: Select all
using System;
using System.Collections;
using System.Reflection;
using DOL.GS.PacketHandler;
using DOL.GS.Effects;
using DOL.Events;
using log4net;
namespace DOL.GS.SkillHandler
{
[SkillHandlerAttribute(Abilities.ShadowStrike)]
public class ShadowStrikeAbilityHandler : SpellCastingAbilityHandler
{
public override long Preconditions
{
get
{
return DEAD | SITTING | MEZZED | STUNNED;
}
}
public void Execute(Ability ab, GamePlayer player)
{
if (!player.IsStealthed)
player.Out.SendMessage("You must be stealthed to use this ability.", eChatType.CT_System, eChatLoc.CL_SystemWindow);
return;
}
public override int SpellID
{
get
{
return 10000;
}
}
}
}
Sorry again - Just cant look at this anymore!! lol. the MoveTo angles etc. should be good.. just a matter of making YOU move, and making the PA style happen..

Re: Shadowstrike Ability
PostPosted: Fri Mar 13, 2009 12:41 am
by LifeFlight
I'll do it, I have a plan already.
Re: Shadowstrike Ability
PostPosted: Fri Mar 13, 2009 12:58 am
by stephenxpimentel
UPDATE ---- PORT IS FIXED ------- NEED PA + NO - UN-STEALTH. -- NEEDS BETTER HEADING CALCULATOR.
SHADOWSTRIKESPELLHANDLER.CS
- Code: Select all
using System;
using System.Collections.Generic;
using DOL.GS.Styles;
using DOL.GS.Spells;
using DOL.GS.PlayerClass;
using DOL.GS.Effects;
using DOL.GS.SkillHandler;
using System.Text;
using System.Collections;
using System.Reflection;
using DOL.GS.RealmAbilities;
using DOL.Language;
using DOL.AI.Brain;
using DOL.Database;
using DOL.GS.Keeps;
using DOL.GS.PacketHandler;
using log4net;
namespace DOL.GS.Spells
{
[SpellHandler("ShadowStrike")]
public class ShadowStrikeSpellHandler : SpellHandler
{
public override void FinishSpellCast(GameLiving player)
{
GameLiving target = (GamePlayer)m_caster.TargetObject;
int xrange = 0;
int yrange = 0;
double angle = 0.00153248422;
m_caster.MoveTo(player.CurrentRegionID, (int)(target.X - ((xrange + 10) * Math.Sin(angle * target.Heading))), (int)(target.Y + ((yrange + 10) * Math.Cos(angle * target.Heading))), target.Z, m_caster.Heading);
base.FinishSpellCast(player);
}
/* public static void TryToUseStyle(GameLiving living, Style style)
{
GamePlayer player = living as GamePlayer;
if (living.AttackState == false)
{
living.StartAttack(player.TargetObject);
living.NextCombatStyle = style;
}
}*/
public ShadowStrikeSpellHandler(GameLiving caster, Spell spell, SpellLine line) : base(caster, spell, line) { }
}
}
Re: [awaiting patch] Shadowstrike Ability
PostPosted: Fri Mar 13, 2009 7:07 am
by Graveen
Thx Stephen
Can you clean a bit the code, and post it as a patch ?
If this is a brand new file, can you give us db entry needed ?
Thx

Re: [awaiting patch] Shadowstrike Ability
PostPosted: Fri Mar 13, 2009 7:31 am
by LifeFlight
Not to be a bugger, but I think we should wait till this is acurate:
I logged on my shadowblade on mordred and jotted down some notes:
ShadowStrike
In the Abilities list,
mouse over says it's a Realm Ability, delve says realm ability
<Delve Description>
Function: assassination
Player selects a target within 1000 range and spends 10 seconds preparing the shaow strike.
The attempt fails if the assassins moves or initiates any attack during those 10 seconds, or if the target moves more than 1000 units away from the user, or if the assassin can no longer see the target.
After 10 seconds, the assassin teleports to the target and executes either Perforate Artery, Backstab II or Backstab 1. or a regular attack, depending on their specialization in Critical Strike.
Can use every: 10:00 minutes.
</delve description>
Requires an enemy realm member, can't shadow strike mobs aparently
Only checks the distance when it's ready to cast.
Isn't a spell cast timer, it's like the purge timer delay
You can miss the target totally, not a guaranteed hit.
Re: [awaiting patch] Shadowstrike Ability
PostPosted: Fri Mar 13, 2009 7:57 am
by Xali
Shadowstrike was the old RA5 of the Sbs but after alot of qq from other assins about the uber ra5 from ns all got the same RA5 and Shadowstrike was moved to an ability you receive when you spec 35 Stealth.
Re: [awaiting patch] Shadowstrike Ability
PostPosted: Fri Mar 13, 2009 7:59 am
by LifeFlight
It shouldn't be a spell handler, it's an ability.