[awaiting patch] Shadowstrike Ability

A place to submit .patch fixes for the DOL SVN

Moderator: Developer Team

[awaiting patch] Shadowstrike Ability

Postby stephenxpimentel » Mon Mar 09, 2009 11:35 pm

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);


}
}
}
Lets have some fun.
stephenxpimentel
Contributor
 
Posts: 1300
Joined: Wed Sep 19, 2007 5:09 pm

Re: Shadowstrike Ability

Postby LifeFlight » Tue Mar 10, 2009 12:28 am

Code: Select all
Style style = SkillBase.GetStyleByID(xxx);
if (style != null)
{
StyleProcessor.TryToUseStyle(this, style);
}
That should do it.
LifeFlight's PvP.
LifeFlight
Contributor
 
Posts: 114
Joined: Wed Jan 03, 2007 6:07 am
Website: http://lifeflight.utpdr.com
Location: Texas

Re: Shadowstrike Ability

Postby stephenxpimentel » Tue Mar 10, 2009 2:53 am

thanks will have this working by tomorrow :D
Lets have some fun.
stephenxpimentel
Contributor
 
Posts: 1300
Joined: Wed Sep 19, 2007 5:09 pm

Re: Shadowstrike Ability

Postby Graveen » Tue Mar 10, 2009 7:27 am

/cheer Stephen :)
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: Shadowstrike Ability

Postby stephenxpimentel » Thu Mar 12, 2009 11:03 pm

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.. :D
Lets have some fun.
stephenxpimentel
Contributor
 
Posts: 1300
Joined: Wed Sep 19, 2007 5:09 pm

Re: Shadowstrike Ability

Postby LifeFlight » Fri Mar 13, 2009 12:41 am

I'll do it, I have a plan already.
LifeFlight's PvP.
LifeFlight
Contributor
 
Posts: 114
Joined: Wed Jan 03, 2007 6:07 am
Website: http://lifeflight.utpdr.com
Location: Texas

Re: Shadowstrike Ability

Postby stephenxpimentel » Fri Mar 13, 2009 12:58 am

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) { }
}
}
Lets have some fun.
stephenxpimentel
Contributor
 
Posts: 1300
Joined: Wed Sep 19, 2007 5:09 pm

Re: [awaiting patch] Shadowstrike Ability

Postby Graveen » Fri Mar 13, 2009 7:07 am

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 ;)
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: [awaiting patch] Shadowstrike Ability

Postby LifeFlight » Fri Mar 13, 2009 7:31 am

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.
LifeFlight's PvP.
LifeFlight
Contributor
 
Posts: 114
Joined: Wed Jan 03, 2007 6:07 am
Website: http://lifeflight.utpdr.com
Location: Texas

Re: [awaiting patch] Shadowstrike Ability

Postby Xali » Fri Mar 13, 2009 7:57 am

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.
This forum is not a trashcan. Do i enter your home in yelling 'THERE IS A PROBLEM ?' ?
Xali
Contributor
 
Posts: 120
Joined: Tue Dec 23, 2008 1:08 am
ICQ: 149269579
Website: http://www.i50-classic.com
Location: Germany

Re: [awaiting patch] Shadowstrike Ability

Postby LifeFlight » Fri Mar 13, 2009 7:59 am

It shouldn't be a spell handler, it's an ability.
LifeFlight's PvP.
LifeFlight
Contributor
 
Posts: 114
Joined: Wed Jan 03, 2007 6:07 am
Website: http://lifeflight.utpdr.com
Location: Texas


Return to “%s” DOL Code Contributions

Who is online

Users browsing this forum: No registered users and 0 guests