[FUNCTION f_UseSkillBook]
DOSWITCH <ARGN1>
BEGIN //ARGV[0]=0
//None
IF <FINDLAYER(2).BASEID>==i_elven_composite_longbow
FINDLAYER(2).TAG.OVERRIDE.AMMOANIM=i_arrow_x
SERV.LOG ammoanim=<FINDLAYER(2).TAG.OVERRIDE.AMMOANIM>
ENDIF
EVENTS = -e_weaponskill
END
SYSMESSAGE @,3,1 Skill : Armor Ignore
SYSMESSAGE @,3,1 Skill : Bleed Attack
SYSMESSAGE @,3,1 Skill : Concussion Blow
SYSMESSAGE @,3,1 Skill : Crushing Blow
SYSMESSAGE @,3,1 Skill : Disarm
SYSMESSAGE @,3,1 Skill : Dismount
SYSMESSAGE @,3,1 Skill : Double Strike
SYSMESSAGE @,3,1 Skill : Infecting
SYSMESSAGE @,3,1 Skill : Mortal Strike
SYSMESSAGE @,3,1 Skill : Moving Shot
SYSMESSAGE @,3,1 Skill : Paralyzing Blow
SYSMESSAGE @,3,1 Skill : Shadow Strike
SYSMESSAGE @,3,1 Skill : Whirlwind Attack
SYSMESSAGE @,3,1 Skill : Riding Swipe
SYSMESSAGE @,3,1 Skill : Frenzied Whirlwind
SYSMESSAGE @,3,1 Skill : Block
SYSMESSAGE @,3,1 Skill : Defence Mastery
SYSMESSAGE @,3,1 Skill : Nerve Strike
SYSMESSAGE @,3,1 Skill : Talon Strike
SYSMESSAGE @,3,1 Skill : Feint
SYSMESSAGE @,3,1 Skill : Dual wield
SYSMESSAGE @,3,1 Skill : Double Shot
SYSMESSAGE @,3,1 Skill : Armor Pierce
SYSMESSAGE @,3,1 Skill : BladeWeave
SYSMESSAGE @,3,1 Skill : Force Arrow
SYSMESSAGE @,3,1 Skill : Lightning Arrow
SYSMESSAGE @,3,1 Skill : Psychic Attack
SYSMESSAGE @,3,1 Skill : Serpent Arrow
SYSMESSAGE @,3,1 Skill : Force of Nature
ENDDO
EVENTS = +e_weaponskill
TAG.WeaponSkillEnabled = <ARGN1>
[EVENTS e_weaponskillhit]
ON=@GetHit
// FIXME: Serialize?
IF (<TAG0.WeaponSkillHit> == 1) && (<TAG0.WeaponskillAttacker>==<SRC.UID>)
// Armor Ignore - Defender has zero physical resistance.
DAMAGE <ARGN1> <ARGN2> <SRC>
TAG.WeaponSkillHit =
TAG.WeaponSkillAttacker =
EVENTS = -e_WeaponSkillHit
RETURN 1
ELSEIF (<TAG0.WeaponSkillHit> == 3) && (<TAG0.WeaponskillAttacker>==<SRC.UID>)
// Armor Ignore - Defender has zero physical resistance.
DAMAGE <ARGN1> <ARGN2> <SRC>
TAG.WeaponSkillHit =
TAG.WeaponSkillAttacker =
EVENTS = -e_WeaponSkillHit
RETURN 1
ENDIF
[EVENTS e_weaponskill]
ON=@ItemUnequip
// Disable special attack when a weapon is unequiped.
IF (<SRC.ACT.LAYER>==1) //Hand
SRC.SENDPACKET (0bf 00 05 00 021)
SRC.SYSMESSAGE @,3,1 No fight skill is using.
SRC.f_UseSkillBook 0
ENDIF
IF (<SRC.ACT.LAYER>==2) //Hand
SRC.SENDPACKET (0bf 00 05 00 021)
SRC.f_UseSkillBook 0
SRC.SYSMESSAGE @,3,1 No fight skill is using.
IF <SRC.ACT.BASEID>==i_elven_composite_longbow
SRC.ACT.TAG.OVERRIDE.AMMOANIM=i_arrow_x
SERV.LOG ammoanim=<SRC.ACT.TAG.OVERRIDE.AMMOANIM>
ENDIF
ENDIF
ON=@UserWarMode
// Since a player can toggle war mode after HitTry but before @Hit or
// @HitMiss, this will undo the ammo override on the force arrow attack
IF <TAG0.WeaponSkillEnabled> == 25
// Force Arrow - The archer focuses their will into an arrow of pure
// force, dazing their enemy. Dazed enemies are temporarily easier
// to hit, and sometimes forget who they are attacking.
// Mana Cost: 5-15 (-5 archery -5 bushido)
IF <FINDLAYER(2).BASEID>==i_elven_composite_longbow
FINDLAYER(2).TAG.OVERRIDE.AMMOANIM=i_arrow_x
SERV.LOG ammoanim=<FINDLAYER(2).TAG.OVERRIDE.AMMOANIM>
ENDIF
ENDIF
ON=@Hit
// SRC is the person doing the hitting
// ACT is the person getting hit
// ARGO is the item being used to attack with. To look at this item, do
// not use UID.<ARGO>.BLAH, instead, it is ARGO.BLAH, as ARGO acts
// like ACT or OBJ.
// ARGN1 is the amount of damage to be done. This value can be rewritten.
// ARGN2 is the type of damage done
//
// NOTE: ARGN1 is the max possible damage to be done ... the target armor
// and other possible damage reducing effects will alter the actual
// damage result.
IF <TAG0.WeaponSkillEnabled> == 1
// Armor Ignore - This special move allows the skilled warrior to bypass
// his targets physical resistance, for one shot only. The Armor Ignore
// shot does slightly less damage than normal. Against a heavily armored
// opponent, this ability is a big win, but when used against a very
// lightly armored foe, it might be better to use a standard strike. For
// this attack, the defender has 0 Physical Resistance, but the attack
// only does 90% normal damage.
// Mana Cost: 20-30 (-5 parrying -5 bushido)
LOCAL.ManaUsed = <EVAL (30 - ( (<PARRYING>/200) + (<BUSHIDO>/200) )>
IF <MANA> >= <LOCAL.ManaUsed>
MANA -= <LOCAL.ManaUsed>
ELSE
RETURN 0
ENDIF
SYSMESSAGE @,3,1 Armor Ignore Attack!
ARGN1 = <ARGN1> - <ARGN1> / 9 // 90% of normal damage
ARGN2 = dam_god
ACT.TAG.WeaponSkillHit = 1
ACT.TAG.WeaponSkillAttacker = <UID>
ACT.EVENTS = +e_WeaponSkillHit
ELSEIF <TAG0.WeaponSkillEnabled> == 2
// Bleed Attack - Make your opponent bleed profusely with this wicked
// use of your weapon. When successful, the target will bleed for
// several seconds, taking damage as time passes for up to ten seconds.
// The rate of damage slows down as time passes, and the blood loss can
// be completely staunched with the use of bandages. Applies a total of
// 15-31 physical damage to the target over the next 10 seconds. This
// damage is not reduced by armor and can only be avoided through
// healing with bandages.
// Mana Cost: 20-30 (-5 parrying -5 bushido)
LOCAL.ManaUsed = <EVAL (30 - ( (<PARRYING>/200) + (<BUSHIDO>/200) )>
IF <MANA> >= <LOCAL.ManaUsed>
MANA -= <LOCAL.ManaUsed>
ELSE
RETURN 0
ENDIF
SYSMESSAGE @,3,1 Bleed Attack!
SRC.NEWITEM i_bleed_timer
NEW.LINK = <UID>
SRC.EQUIP <NEW>
ELSEIF <TAG0.WeaponSkillEnabled> == 3
// Concussion Blow - This devastating strike is most effective against
// those who are in good health and whose reserves of mana are low, or
// vice versa. Applies 10-35 additional physical damage that cannot
// be reduced by physical resistance or other defenses.
// Mana Cost: 15-25 (-5 parrying -5 bushido)
LOCAL.ManaUsed = <EVAL (25 - ( (<PARRYING>/200) + (<BUSHIDO>/200) )>
IF <MANA> >= <LOCAL.ManaUsed>
MANA -= <LOCAL.ManaUsed>
ELSE
RETURN 0
ENDIF
SYSMESSAGE @,3,1 Concussion Blow!
LOCAL.TargetHealthRatio = (<SRC.HITS>*100) / <SRC.MAXHITS>
LOCAL.TargetManaRatio = (<SRC.MANA>*100) / <SRC.MAXMANA>
LOCAL.ExtraDamage = <LOCAL.TargetHealthRatio> - <LOCAL.TargetManaRatio>
IF ( <LOCAL.ExtraDamage> < 0 ) // Make sure it is a positive integer
LOCAL.ExtraDamage -= <LOCAL.ExtraDamage> * 2
ENDIF
LOCAL.Extradamage = 10 + <LOCAL.ExtraDamage> / 4
SYSMESSAGE @,3,1 Extra <EVAL <LOCAL.ExtraDamage>> damage!
ARGN1 = <ARGN1> + <LOCAL.ExtraDamage>
ARGN2 = dam_god
ACT.TAG.WeaponSkillHit = 3
ACT.TAG.WeaponSkillAttacker = <UID>
ACT.EVENTS = +e_WeaponSkillHit
ELSEIF <TAG0.WeaponSkillEnabled> == 4
// Crushing Blow - Also known as the Haymaker, this attack increases the
// damage done by a weapon reaching its mark by 50%. Additional damage
// is applied as physical damage.
// Mana Cost: 15-25 (-5 parrying -5 swordsmanship)
LOCAL.ManaUsed = <EVAL (25 - ( (<PARRYING>/200) + (<SWORDSMANSHIP>/200) )>
IF <MANA> >= <LOCAL.ManaUsed>
MANA -= <LOCAL.ManaUsed>
ELSE
RETURN 0
ENDIF
SYSMESSAGE @,3,1 Crushing Blow!
ARGN1 = <ARGN1> + <ARGN1> / 2 //adds 50% damage
ARGN2 = dam_physical
ELSEIF <TAG0.WeaponSkillEnabled> == 5
// Disarm - This attack allows you to disarm your foe. A successful
// Disarm leaves the victim unable to re-arm another weapon for 5
// seconds.
// Mana Cost: 10-20 (-5 parrying -5 bushido ... or -10 wrestling?)
LOCAL.ManaUsed = <EVAL (20 - <WRESTLING>/100)>
IF <MANA> >= <LOCAL.ManaUsed>
MANA -= <LOCAL.ManaUsed>
ELSE
RETURN 0
ENDIF
SYSMESSAGE @,3,1 Disarm Opponent!
IF <SRC.FINDLAYER(1)>
SRC.FINDLAYER(1).BOUNCE
SRC.SYSMESSAGE @,3,1 You have been disarmed by <NAME>!
SYSMESSAGE @,3,1 You have disarmed <SRC.NAME>!
ENDIF
IF <SRC.FINDLAYER(2)>
SRC.FINDLAYER(2).BOUNCE
SRC.SYSMESSAGE @,3,1 You have been disarmed by <NAME>!
SYSMESSAGE @,3,1 You have disarmed <SRC.NAME>!
ENDIF
ELSEIF <TAG0.WeaponSkillEnabled> == 6
// Dismount - Perfect for the foot-soldier, the Dismount special attack
// can unseat a mounted opponent. The fighter using this ability must
// be on his own two feet and not in the saddle of a steed (with one
// exception: players may use a lance to dismount other players while
// mounted). If it works, the target will be knocked off his own mount
// and will take some extra damage from the fall. Inflicts 15-25
// additional physical damage. Cannot use this while mounted, unless
// using a lance.
// Mana Cost: 10-20 (-5 parrying -5 bushido)
IF <FLAGS> & statf_onhorse
IF !( <FINDLAYER(1).BASEID> == i_lance )
RETURN 0
ENDIF
ENDIF
LOCAL.ManaUsed = <EVAL (20 - ( (<PARRYING>/200) + (<BUSHIDO>/200) )>
IF <MANA> >= <LOCAL.ManaUsed>
MANA -= <LOCAL.ManaUsed>
ELSE
RETURN 0
ENDIF
SYSMESSAGE @,3,1 Dismount Attack!
IF (<SRC.FLAGS> & statf_onhorse)
SRC.DISMOUNT
SRC.EMOTE knocked off mount!
SRC.DAMAGE {15 25} dam_physical <UID>
ENDIF
ELSEIF <TAG0.WeaponSkillEnabled> == 8
// Infectious Strike - This special move represents a significant change
// to the use of poisons in Age of Shadows. Now, only certain weapon types
// those that have Infectious Strike as an available special move will be
// able to be poisoned. Targets will no longer be poisoned at random when
// hit by poisoned weapons. Instead, the wielder must use this ability to
// deliver the venom. While no skill in Poisoning is absolutely required
// to use this ability, being knowledgeable in the application and use of
// toxins will allow a character to use Infectious Strike at reduced mana
// cost and to inflict more deadly poison on his victim. With this change,
// weapons will no longer be corroded by poison. Level 5 poison will be
// possible when using this special move. Poisoning skill is not required,
// but without it you will only be able to inflict level 1 poisons on your
// victim. The Poisoning skill will give a (Poisoning Skill)% chance to
// increase the level of poison delivered by 1. The blade must have poison
// applied to it. The power of the poison depends on the type of poison
// used and your poisoning skill.
// Mana Cost: 5-15 (-5 for stealth -5 poisoning)
// Poisoning skill 0.0 - 19.9 inflict Level 1 (chance of level 0)
// Poisoning skill 20.0 - 39.9 inflict level 2 (chance of level 3)
// Poisoning skill 40.0 - 59.9 inflict level 3 (chance of level 4)
// Poisoning skill 60.0 - 100.0 inflict level 4 (chance of level 5)
LOCAL.ManaUsed = <EVAL (15 - ( (<STEALTH>/200) + (<POISONING>/200) )>
IF <MANA> >= <LOCAL.ManaUsed>
MANA -= <LOCAL.ManaUsed>
ELSE
RETURN 0
ENDIF
SYSMESSAGE @,3,1 Infectious Strike!
SRC.SOUND snd_spell_poison
SRC.POISON <POISONING>
// FIXME: fairly complicated to implement this exactly as described.
// It would require a modification to how sphere handles poisoning of
// weapons and how poisoned weapons deliver the poison etc ... for now
// it just posions the opponent at the poisoning skill of the attacker.
ELSEIF <TAG0.WeaponSkillEnabled> == 9
// Mortal Strike - The assassins friend. A successful Mortal Strike
// will render its victim unable to heal any damage for several seconds.
// Use a gruesome follow-up to finish off your foe. Lasts for 6 seconds
// (player) or 12 seconds (NPC). Does not prevent curing poison or
// stopping bleeding.
// Mana Cost: 20-30 (-5 parrying -5 bushido)
IF (<SRC.FINDID.i_blockheal_timer>)
RETURN 0
ENDIF
LOCAL.ManaUsed = <EVAL (30 - ( (<PARRYING>/200) + (<BUSHIDO>/200) )>
IF <MANA> >= <LOCAL.ManaUsed>
MANA -= <LOCAL.ManaUsed>
ELSE
RETURN 0
ENDIF
SYSMESSAGE @,3,1 Mortal Strike!
SRC.SOUND snd_spell_paralyze
SRC.NEWITEM = i_blockheal_timer
SRC.EQUIP <NEW>
ELSEIF <TAG0.WeaponSkillEnabled> == 10
// Moving Shot - Available on some crossbows, this special move allows
// archers to fire while on the move. This shot is somewhat less
// accurate than normal, but the ability to fire while running is a
// clear advantage.
// Mana Cost: 5-15 (-5 parrying -5 bushido ... or -10 archery?)
IF (<FINDID.i_archercanmove_timer>)
RETURN 0
ENDIF
LOCAL.ManaUsed = <EVAL (30 - ( (<PARRYING>/200) + (<BUSHIDO>/200) )>
IF <MANA> >= <LOCAL.ManaUsed>
MANA -= <LOCAL.ManaUsed>
ELSE
RETURN 0
ENDIF
SYSMESSAGE @,3,1 Moving Shot Attack
NEWITEM = i_archercanmove_timer
EQUIP <NEW>
// FIXME: Not sure how OSI does this, but I made the timer last 10-15
// seconds.
ELSEIF <TAG0.WeaponSkillEnabled> == 11
// Paralyzing Blow - A successful Paralyzing Blow will leave the
// target stunned, unable to move, attack, or cast spells, for a
// few seconds. Duration is 3 seconds (player), 6 seconds (NPC).
// The duration is not broken by combat damage the way the paralyze
// spell is.
// Mana Cost: 20-30 (-5 swordsmanship -5 bushido)
IF (<SRC.FINDID.i_parablow_timer>)
RETURN 0
ENDIF
LOCAL.ManaUsed = <EVAL (30 - ( (<SWORDSMANSHIP>/200) + (<BUSHIDO>/200) )>
IF <MANA> >= <LOCAL.ManaUsed>
MANA -= <LOCAL.ManaUsed>
ELSE
RETURN 0
ENDIF
SYSMESSAGE @,3,1 Paralyzing Blow!
SRC.SOUND snd_spell_paralyze
SRC.NEWITEM = i_parablow_timer
SRC.EQUIP <NEW>
ELSEIF <TAG0.WeaponSkillEnabled> == 12
// Shadow Strike - This powerful ability requires secondary skills
// to activate. Successful use of Shadowstrike deals extra damage
// to the target and renders the attacker invisible. Only those who
// are Adept (80) at the art of stealth will be able to use this
// ability. Weapon hit does an extra 25% damage, and hides the
// attacker.
// Mana Cost: 10-20 (-5 bushido -5 swordsmanship)
IF <STEALTH> < 800
SYSMESSAGE @,3,1 You need more Stealth skill to use shadow strike
RETURN 0
ENDIF
LOCAL.ManaUsed = <EVAL (20 - ( (<BUSHIDO>/200) + (<SWORDSMANSHIP>/200) )>
IF <MANA> >= <LOCAL.ManaUsed>
MANA -= <LOCAL.ManaUsed>
ELSE
RETURN 0
ENDIF
SYSMESSAGE @,3,1 Shadow Strike!
ARGN1 = <ARGN1> + <ARGN1> / 4 //adds 25% damage
FLAGS = <FLAGS> &~ 020 //disables war mode
NEWITEM = i_shadow_timer
EQUIP <NEW>
ELSEIF <TAG0.WeaponSkillEnabled> == 13
// Whirlwind Attack - A godsend to a warrior surrounded, the Whirlwind
// Attack allows the fighter to strike at all nearby targets in one
// mighty spinning swing. Will not accidentally strike innocents,
// allies, or party members.
// Mana Cost: 5-15 (-5 bushido -5 swordsmanship)
LOCAL.ManaUsed = <EVAL (15 - ( (<BUSHIDO>/200) + (<SWORDSMANSHIP>/200) )>
IF <MANA> >= <LOCAL.ManaUsed>
MANA -= <LOCAL.ManaUsed>
ELSE
RETURN 0
ENDIF
SYSMESSAGE @,3,1 Whirlwind Attack!
OBJ=<UID> //OBJ is the attacker, SRC is the primary target
//SERV.LOG HIT begins!
FORCHARS 1
//SERV.LOG <NAME> SRC=<UID>
FORCHARMEMORYTYPE MEMORY_FIGHT
//SERV.LOG Attack=<OBJ> Primary=<SRC> Secondary=<CONT.UID> LINK=<LINK>
IF (<LINK>==<OBJ>) && !(<SRC>==<CONT.UID>)
CONT.DAMAGE <ARGN1>/2 <ARGN2> <OBJ>
//CONT.SAY @02 I've been hit by <OBJ.NAME>!
ENDIF
ENDFOR
ENDFOR
// FIXME: I am not 100% certain the for loops above are doing the right
// thing... it almost appears like if you get hit by something after
// this trigger has started/finished, but before the damage is done,
// the thing that hit you becomes the new recipient of the damage...
// weird! I left some logging in so I can see if new nightly builds
// change anything...
ELSEIF <TAG0.WeaponSkillEnabled> == 14
// Riding Swipe - If you are on foot, dismounts your opponent and damage
// the ethereals rider or the living mount (which must be healed before
// ridden again). If you are mounted, it damages and stuns the mounted
// opponent.
// Mana Cost: 20-30 (-5 bushido -5 parrying)
IF !( <SRC.FLAGS> & statf_onhorse )
RETURN 0
ENDIF
LOCAL.ManaUsed = <EVAL (30 - ( (<PARRYING>/200) + (<BUSHIDO>/200) )>
IF <MANA> >= <LOCAL.ManaUsed>
MANA -= <LOCAL.ManaUsed>
ELSE
RETURN 0
ENDIF
SYSMESSAGE @,3,1 Riding Swipe Attack!
IF <FLAGS> & statf_onhorse
SRC.DAMAGE {5 15} <ARGN2> <UID>
SRC.SOUND snd_spell_paralyze
SRC.NEWITEM = i_parablow_timer
SRC.EQUIP <NEW>
ELSE
IF <R1>
SRC.DAMAGE {15 25} dam_physical <UID>
ELSE
SRC.FINDLAYER(25).HITS -= {15 25} //TESTME
ENDIF
SRC.DISMOUNT
SRC.EMOTE knocked off mount!
ENDIF
// FIXME: Technically the opponents ride should be damaged, and
// unridable till healed ... but this is quite complicated since it
// might have already been wounded and there is no way to know how
// much ACTUAL damage was done in this trigger (ARGN1 is just the
// amount of damage prior to AR and other protections being used
// to determine the real damage.)
ELSEIF <TAG0.WeaponSkillEnabled> == 15
// Frenzied Whirlwind - A quick attack to all enemies in range of your
// weapon that causes damage over time.
// Mana Cost: 20-30 (-5 bushido -5 ninjitsu)
LOCAL.ManaUsed = <EVAL (30 - ( (<BUSHIDO>/200) + (<NINJITSU>/200) )>
IF <MANA> >= <LOCAL.ManaUsed>
MANA -= <LOCAL.ManaUsed>
ELSE
RETURN 0
ENDIF
SYSMESSAGE @,3,1 Frenzied Whirlwind Attack!
OBJ=<UID> //OBJ is the attacker, SRC is the primary target
//SERV.LOG HIT begins!
FORCHARS 1
//SERV.LOG <NAME> SRC=<UID>
FORCHARMEMORYTYPE MEMORY_FIGHT
//SERV.LOG Attack=<OBJ> Primary=<SRC> Secondary=<CONT.UID> LINK=<LINK>
IF (<LINK>==<OBJ>) && !(<SRC>==<CONT.UID>)
CONT.NEWITEM i_lasting_damage_timer
NEW.LINK = <OBJ>
CONT.EQUIP <NEW>
//CONT.SAY @02 I've been hit by <OBJ.NAME>!
ENDIF
ENDFOR
ENDFOR
// FIXME: I am not 100% certain the for loops above are doing the right
// thing... it almost appears like if you get hit by something after
// this trigger has started/finished, but before the damage is done,
// the thing that hit you becomes the new recipient of the damage...
// weird!
ELSEIF <TAG0.WeaponSkillEnabled> == 18
// Nerve Strike - Does damage and paralyzes your opponent for a short
// time.
// Mana Cost: 20-30 (-5 swordsmanship -5 parrying)
LOCAL.ManaUsed = <EVAL (30 - ( (<SWORDSMANSHIP>/200) + (<PARRYING>/200) )>
IF <MANA> >= <LOCAL.ManaUsed>
MANA -= <LOCAL.ManaUsed>
ELSE
RETURN 0
ENDIF
SYSMESSAGE @,3,1 Nerve Strike!
SRC.SOUND snd_spell_paralyze
SRC.NEWITEM = i_parablow_timer
SRC.EQUIP <NEW>
ARGN1 = <ARGN1> + <ARGN1> / 4 //adds 25% damage
ELSEIF <TAG0.WeaponSkillEnabled> == 19
// Talon Strike - Attack with increased damage with additional damage
// over time. Requires Ninjitsu skill.
// Mana Cost: 20-30 (-5 bushido -5 parrying)
IF <NINJITSU> < 1
SYSMESSAGE @,3,1 You require Ninjistu skill to perform this attack
RETURN 0
ENDIF
LOCAL.ManaUsed = <EVAL (30 - ( (<BUSHIDO>/200) + (<PARRYING>/200) )>
IF <MANA> >= <LOCAL.ManaUsed>
MANA -= <LOCAL.ManaUsed>
ELSE
RETURN 0
ENDIF
SYSMESSAGE @,3,1 Talon Strike!
NEWITEM i_lasting_damage_timer
NEW.LINK = <UID>
EQUIP <NEW>
ARGN1 = <ARGN1> + <ARGN1> / 4 //adds 25% damage
ELSEIF <TAG0.WeaponSkillEnabled> == 23
// Armor Pierce - Send an arrow flying with the chance to pierce your
// opponents armor for additional damage. Requires Bushido or Ninjitsu
// skill.
// Mana Cost: 20-30 (-5 archery -5 ninjitsu)
IF ( <NINJITSU> < 1 ) && ( <BUSHIDO> < 1 )
SYSMESSAGE @,3,1 You require Ninjistu or Bushido skill to perform this attack
RETURN 0
ENDIF
LOCAL.ManaUsed = <EVAL (30 - ( (<NINJITSU>/200) + (<ARCHERY>/200) )>
IF <MANA> >= <LOCAL.ManaUsed>
MANA -= <LOCAL.ManaUsed>
ELSE
RETURN 0
ENDIF
SYSMESSAGE @,3,1 Armor Pierce Attack!
ARGN1 = <ARGN1> + <ARGN1> / 2 //adds 50% damage
ELSEIF <TAG0.WeaponSkillEnabled> == 24
// Bladeweave - The Warrior becomes one with their weapon, allowing
// it to guide their hand. The effects of this attack are unpredictable,
// but effective.
// Mana Cost: 15-25 (-5 parrying -5 bushido)
LOCAL.ManaUsed = <EVAL (25 - ( (<PARRYING>/200) + (<BUSHIDO>/200) )>
IF <MANA> >= <LOCAL.ManaUsed>
MANA -= <LOCAL.ManaUsed>
ELSE
RETURN 0
ENDIF
SYSMESSAGE @,3,1 Bladeweave Attack!
DOSWITCH <R3> // 4 possiblities
BEGIN
ARGN1 = <ARGN1> + <ARGN1> / 2 //adds 50% damage of random type
ARGN2 = { 02 1 04 1 08 1 010 1 020 1 040 1 080 1 0100 1 0200 1 }
END
BEGIN
ARGN1 = <ARGN1> + <ARGN1> / 4 //adds 25% unblockable damage
ARGN2 = dam_god
END
BEGIN
SRC.NEWITEM=i_parablow_timer
SRC.EQUIP <NEW>
END
BEGIN
NEWITEM i_lasting_damage_timer
NEW.LINK = <UID>
EQUIP <NEW>
END
ENDDO
ELSEIF <TAG0.WeaponSkillEnabled> == 25
// Force Arrow - The archer focuses their will into an arrow of pure
// force, dazing their enemy. Dazed enemies are temporarily easier
// to hit, and sometimes forget who they are attacking.
// Mana Cost: 5-15 (-5 archery -5 bushido)
LOCAL.ManaUsed = <EVAL (15 - ( (<ARCHERY>/200) + (<BUSHIDO>/200) )>
IF <MANA> >= <LOCAL.ManaUsed>
MANA -= <LOCAL.ManaUsed>
ELSE
RETURN 0
ENDIF
FINDLAYER(2).TAG.OVERRIDE.AMMOANIM=i_arrow_x
SERV.LOG ammoanim=<FINDLAYER(2).TAG.OVERRIDE.AMMOANIM>
SYSMESSAGE @,3,1 Force Arrow Attack!
// FIXME: Perhaps the MEMORY_FIGHT object could be removed from the
// target and that would "daze" them? I am not sure how to make a
// target easier to to hit tho...
ELSEIF <TAG0.WeaponSkillEnabled> == 26
// Lightning Arrow - A charged arrow that arcs lightning into its
// targets allied.
// Mana Cost: 5-15 (-5 bushido -5 archery)
LOCAL.ManaUsed = <EVAL (15 - ( (<ARCHERY>/200) + (<BUSHIDO>/200) )>
IF <MANA> >= <LOCAL.ManaUsed>
MANA -= <LOCAL.ManaUsed>
ELSE
RETURN 0
ENDIF
SYSMESSAGE @,3,1 Lightning Arrow Attack!
SRC.EFFECT 1,1
SRC.SOUND = snd_spell_lightning
ARGN1 = <ARGN1> + <ARGN1> / 3 // 33% more damage (type electrical)
ARGN2 = dam_lightning
// FIXME: I think that allies of the target should get hit too, but
// that is not going to be very easy to determine, so for now, only
// the target gets hit with lightning.
ELSEIF <TAG0.WeaponSkillEnabled> == 27
// Psychic Attack - Temporarily enchants the attackers weapon with
// deadly psychic energy, allowing it to damage the defenders mind and
// their ability to inflict damage with magic.
// Mana Cost: 15-25 (-5 parrying -5 swordsmanship)
LOCAL.ManaUsed = <EVAL (25 - ( (<PARRYING>/200) + (<SWORDSMANSHIP>/200) )>
IF <MANA> >= <LOCAL.ManaUsed>
MANA -= <LOCAL.ManaUsed>
ELSE
RETURN 0
ENDIF
SYSMESSAGE @,3,1 Psychic Attack!
SRC.SOUND snd_spell_mana_vampire
SRC.SPELLEFFECT s_mana_drain 1000 0
SRC.SPELLEFFECT s_mind_blast 1000 0
SRC.EFFECT=3,i_FX_SPARKLE_2,6,15,1 // Sparkle effect
ELSEIF <TAG0.WeaponSkillEnabled> == 28
// Serpent Arrow - Fires a snake at the target, poisoning them in
// addition to normal damage with a successful hit. The archer must
// be skilled in poisoning and nimble of hand to achieve success.
// Mana Cost: 25-35 (-5 parrying -5 poisoning)
IF <POISONING> < 1
SYSMESSAGE @,3,1 You require Poisoning skill to perform this attack
RETURN 0
ENDIF
LOCAL.ManaUsed = <EVAL (35 - ( (<PARRYING>/200) + (<POISONING>/200) )>
IF <MANA> >= <LOCAL.ManaUsed>
MANA -= <LOCAL.ManaUsed>
ELSE
RETURN 0
ENDIF
SYSMESSAGE @,3,1 Serpent Arrow Attack!
SRC.SOUND snd_spell_poison
SRC.POISON <POISONING>
SRC.NEWNPC c_snake
NEW.KARMA -= 500 //make sure it is angry!
NEW.P = <SRC.P>
NEW.ATTACK <SRC>
ELSEIF <TAG0.WeaponSkillEnabled> == 29
// Force of Nature - Enfuses the attacker with nature's fury, granting
// them unparalleled strength. This dangerous channeling causes leafy
// vines to violently erupt from beneath the attackers skin, dealing
// substantial physical and poison damage to them.
// Mana Cost: 25-35 (-5 bushido -5 swordsmanship)
LOCAL.ManaUsed = <EVAL (35 - ( (<BUSHIDO>/200) + (<SWORDSMANSHIP>/200) )>
IF <MANA> >= <LOCAL.ManaUsed>
MANA -= <LOCAL.ManaUsed>
ELSE
RETURN 0
ENDIF
SYSMESSAGE @,3,1 Force of Nature Attack!
SRC.POISON {500 750}
SRC.SOUND snd_spell_poison
ARGN1 = <ARGN1> + <ARGN1> / 3 // 33% more damage (type electrical)
ARGN2 = dam_poison
// FIXME: Perhaps add a short corpser summoning animation?
ENDIF
ON=@GetHit
// SRC = The person doing the hitting
// ARGN1 = Amount of damage being done. This is before armor and other
// variables are calculated.
// ARGN2 = Damage type. This is in flag format, which is documented on
// Taran's site.
// ARGN3 = result of difficulty calculation.
IF <TAG0.WeaponSkillEnabled> == 16
// Block - Raises your defenses for a short time. Requires Bushido or
// Ninjitsu skill.
// Mana Cost: 20-30 (-5 parrying -5 bushido or ninjitsu)
LOCAL.ManaUsed = <EVAL (30 - ( (<PARRYING>/200) + (<BUSHIDO>/200) )>
IF <MANA> >= <LOCAL.ManaUsed>
MANA -= <LOCAL.ManaUsed>
ELSE
RETURN 0
ENDIF
SYSMESSAGE @,3,1 Block Defense!
ARGN1 = <ARGN1> - <ARGN1> / 4 // remove 25% of the damage
// FIXME: This should add a timed event that reduces damage instead
ELSEIF <TAG0.WeaponSkillEnabled> == 17
SYSMESSAGE @,3,1 Defence Mastery!
// Defense Mastery - Raises your physical resistance for a short time
// while lowering your ability to inflict damage. Requires Bushido or
// Ninjitsu skill.
// Mana Cost: 20-30 (-5 swordsmanship -5 bushido or ninjitsu)
LOCAL.ManaUsed = <EVAL (30 - ( (<PARRYING>/200) + (<BUSHIDO>/200) )>
IF <MANA> >= <LOCAL.ManaUsed>
MANA -= <LOCAL.ManaUsed>
ELSE
RETURN 0
ENDIF
SYSMESSAGE @,3,1 Block Defense!
ARGN1 = <ARGN1> - <ARGN1> / 4 // remove 25% of the damage
// FIXME: This should add a timed event that raises physical resistance
// and lowers attack damage instead.
ELSEIF <TAG0.WeaponSkillEnabled> == 20
// Feint - Gain a defensive advantage over your primary opponent for a
// short time. Requires Bushido or Ninjitsu skill.
// Mana Cost: 20-30 (-5 parrying -5 bushido or ninjitsu)
LOCAL.ManaUsed = <EVAL (30 - ( (<PARRYING>/200) + (<BUSHIDO>/200) )>
IF <MANA> >= <LOCAL.ManaUsed>
MANA -= <LOCAL.ManaUsed>
ELSE
RETURN 0
ENDIF
SYSMESSAGE @,3,1 Feint Defense!
ARGN1 = <ARGN1> - <ARGN1> / 4 // remove 25% of the damage
// FIXME: This should add a timed event that raises physical resistance
// and lowers attack damage instead. What exacly is a "defensive
// advantage", and how do you calculate it?
ENDIF
ON=@HitTry
// SRC is the person you are trying to hit
// ARGO is the item being used to attack with. To look at this item, do
// not use UID.<ARGO>.BLAH, instead, it is ARGO.BLAH, as ARGO acts
// like ACT or OBJ.
// ACTDIFF can be used to force a hit or miss.
// ARGN1 is the delay in 1/10 seconds before the hit will actually take
// place. See SPEED for settings.
IF <TAG0.WeaponSkillEnabled> == 7
// Double Strike - The highly skilled warrior can use this special
// attack to make two quick swings in succession. Landing both blows
// would be devastating!
// Mana Cost: 20-30 (-5 parrying -5 bushido)
LOCAL.ManaUsed = <EVAL (30 - ( (<PARRYING>/200) + (<BUSHIDO>/200) )>
IF <MANA> >= <LOCAL.ManaUsed>
MANA -= <LOCAL.ManaUsed>
ELSE
RETURN 0
ENDIF
SYSMESSAGE @,3,1 Double Strike!
ARGN1 = 1
// FIXME: technically not a doublestrike, but it does speed the next
// hit.
ELSEIF <TAG0.WeaponSkillEnabled> == 10
// Moving Shot - Available on some crossbows, this special move allows
// archers to fire while on the move. This shot is somewhat less
// accurate than normal, but the ability to fire while running is a
// clear advantage.
// Mana Cost: 5-15 (-5 parrying -5 bushido ... or -10 archery?)
// FIXME: This trigger reduces hit% chance by 20% ... not sure how OSI
// does this calculation tho...
ACTDIFF = 20
ELSEIF <TAG0.WeaponSkillEnabled> == 21
// Dual Wield - Attack faster as you swing with both weapons. Requires
// Ninjitsu skill.
// Mana Cost: 20-30 (-5 parrying -5 ninjitsu)
IF <NINJITSU> < 1
SYSMESSAGE @,3,1 You require Ninjistu skill to perform this attack
RETURN 0
ENDIF
LOCAL.ManaUsed = <EVAL (30 - ( (<NINJITSU>/200) + (<PARRYING>/200) )>
IF <MANA> >= <LOCAL.ManaUsed>
MANA -= <LOCAL.ManaUsed>
ELSE
RETURN 0
ENDIF
SYSMESSAGE @,3,1 Dual Wield Attack!
ARGN1 = 1
ELSEIF <TAG0.WeaponSkillEnabled> == 22
// Double Shot - Send two arrows flying at your opponent if your are
// mounted. Requires Bushido or Ninjitsu skill.
// Mana Cost: 20-30 (-5 ninjitsu -5 archery)
IF ( <NINJITSU> < 1 ) && ( <BUSHIDO> < 1 )
SYSMESSAGE @,3,1 You require Ninjistu or Bushido skill to perform this attack
RETURN 0
ENDIF
LOCAL.ManaUsed = <EVAL (30 - ( (<NINJITSU>/200) + (<ARCHERY>/200) )>
IF <MANA> >= <LOCAL.ManaUsed>
MANA -= <LOCAL.ManaUsed>
ELSE
RETURN 0
ENDIF
SYSMESSAGE @,3,1 Double Shot Attack!
ARGN1 = 1
// FIXME: technically not a doublestrike, but it does speed the next
// hit.
ELSEIF <TAG0.WeaponSkillEnabled> == 25
// Force Arrow - The archer focuses their will into an arrow of pure
// force, dazing their enemy. Dazed enemies are temporarily easier to
// hit, and sometimes forget who they are attacking.
// Mana Cost: 5-15 (-5 parrying -5 swordsman)
IF <FINDLAYER(2).BASEID>==i_elven_composite_longbow
FINDLAYER(2).TAG.OVERRIDE.AMMOANIM=i_fx_energy_ray
SERV.LOG ammoanim=<FINDLAYER(2).TAG.OVERRIDE.AMMOANIM>
ENDIF
ENDIF
ON=@HitMiss
// SRC is the attacker
// ARGO is the item being used to attack with. To look at this item, do
// not use UID.<ARGO>.BLAH, instead, it is ARGO.BLAH, as ARGO acts
// like ACT or OBJ.
IF <TAG0.WeaponSkillEnabled> == 25
// Force Arrow - The archer focuses their will into an arrow of pure
// force, dazing their enemy. Dazed enemies are temporarily easier to
// hit, and sometimes forget who they are attacking.
// Mana Cost: 5-15 (-5 parrying -5 swordsman)
IF <FINDLAYER(2).BASEID>==i_elven_composite_longbow
FINDLAYER(2).TAG.OVERRIDE.AMMOANIM=i_arrow_x
SERV.LOG ammoanim=<FINDLAYER(2).TAG.OVERRIDE.AMMOANIM>
ENDIF
ENDIF
[ITEMDEF i_archercanmove_timer]
NAME=archer canmove timer
ID=01e2e
TYPE=t_eq_script
LAYER=30
WEIGHT=0
ON=@Equip
ATTR = 04002
TIMER = {10 15}
CONT.FLAGS = <CONT.FLAGS>|statf_archercanmove
ON=@Timer
CONT.FLAGS = <CONT.FLAGS>^statf_archercanmove
REMOVE
[ITEMDEF i_shadow_timer]
NAME=shadow timer
ID=0213f
TYPE=t_eq_script
LAYER=30
WEIGHT=0
ON=@Equip
ATTR=04002
TIMER=1
ON=@Timer
CONT.ACTION = -1 //stop attack
CONT.FLAGS = <CONT.FLAGS> | 0800000 //hides the attacker
CONT.UPDATE
REMOVE
[ITEMDEF i_blockheal_timer]
NAME=block heal timer
ID=i_bandage
TYPE=t_eq_script
LAYER=30
WEIGHT=0
ON=@Create
ATTR=04002
ON=@Equip
ATTR=04002
IF <CONT.NPC>
MORE1 = 12
ELSE
MORE1 = 6
ENDIF
CONT.EMOTE get hit with a mortal strike
TIMER=1
ON=@Timer
IF <MORE1>
CONT.ACTION = -1 //stop all actions
// FIXME: Need an event here that prevents healing spells and bandages
MORE1 -= 1
TIMER = 1
RETURN 1
ELSE
CONT.SYSMESSAGE @,3,1 The mortal strike has worn off
// FIXME: remove the event that was created earlier
REMOVE
ENDIF
[ITEMDEF i_parablow_timer]
NAME=paralyzing blow timer
ID=01d8c
TYPE=t_eq_script
LAYER=30
WEIGHT=0
ON=@Create
ATTR=04002
ON=@Equip
ATTR=04002
IF <CONT.NPC>
MORE1 = 6
ELSE
MORE1 = 3
ENDIF
CONT.EMOTE get paralyzed by the last attack
TIMER=1
ON=@Timer
IF <MORE1>
CONT.ACTION = -1 //stop all actions
CONT.FLAGS = <CONT.FLAGS> | 04 //paralyzed
MORE1 -= 1
TIMER = 1
RETURN 1
ELSE
CONT.FLAGS = <CONT.FLAGS> ^ 04 //unparalyzed
REMOVE
ENDIF
[ITEMDEF i_bleed_timer]
NAME=bleed timer
ID=0122a
TYPE=t_eq_script
LAYER=30
WEIGHT=0
ON=@Create
ATTR=04002
MORE1 = 6
ON=@Equip
ATTR=04002
TIMER = 2
ON=@Timer
IF ( <CONT> )
IF ( <CONT.HITS> < 1 )
MORE1 = 0
ELSE
MORE1 -= 1
ENDIF
DOSWITCH <MORE1>
BEGIN // MORE1=0
CONT.SYSMESSAGE @,3,1 The bleeding has stopped.
REMOVE
END
BEGIN // MORE1=1
CONT.EMOTE bleeding slowly
CONT.DAMAGE {1 2} dam_god <LINK>
TIMER = 2
END
BEGIN // MORE1=2
CONT.EMOTE bleeding slowly
CONT.DAMAGE {2 4} dam_god <LINK>
TIMER = 2
END
BEGIN // MORE1=3
CONT.EMOTE bleeding moderately
CONT.DAMAGE {3 6} dam_god <LINK>
TIMER = 2
END
BEGIN // MORE1=4
CONT.EMOTE bleeding heavily
CONT.DAMAGE {4 9} dam_god <LINK>
TIMER = 2
END
BEGIN // MORE1=5
CONT.EMOTE bleeding profusely
CONT.DAMAGE {5 12} dam_god <LINK>
TIMER = 2
END
ENDDO
ENDIF
RETURN 1
[ITEMDEF i_lasting_damage_timer]
NAME=damage timer
ID=0122a
TYPE=t_eq_script
LAYER=30
WEIGHT=0
ON=@Create
ATTR=04002
MORE1 = 6
ON=@Equip
ATTR=04002
TIMER = 2
ON=@Timer
IF ( <CONT> )
IF ( <CONT.HITS> < 1 )
MORE1 = 0
ELSE
MORE1 -= 1
ENDIF
IF <MORE1> < 1
REMOVE
ELSE
CONT.DAMAGE <MORE1> dam_god <LINK>
TIMER = 2
ENDIF
ENDIF
RETURN 1
[EOF]