Eval Collection: Arcane Larceny (Guild Wars)

arcane_larceny

(Requested here) (Picture Source)

Arcane Larceny is a skill from Guild Wars. It will “steal” a random skill of the targeted enemy and add it to the user’s skill pool for a short duration. The enemy’s skill will go on cooldown for the duration.

Requirements:

  • YEP_BuffsStatesCore.js
  • YEP_X_SkillCooldowns.js
  • YEP_SkillCore.js

First of all you’ll want to create your Arcane Larceny skill. Set its scope to 1 Enemy.

In its notebox, use the following:


<After Eval>
// Skills with these IDs will not be stolen.
var excludeSkills = [1, 2];
var skills = target.skills();

// Loop through the skills and remove excluded skills from the array.
for (var i = 0; i < skills.length; i++) {
var skill = skills[i];
if (skill && excludeSkills.indexOf(skill.id) !== -1) {
skills.splice(i, 1);
};
};

// Do not continue if there are no skills to steal.
if (skills.length > 0) {
var randomSkill = skills[Math.floor(skills.length * Math.random())];
user.learnSkill(randomSkill.id);
user._stolenSkillAL = randomSkill.id;
// Remove Arcane Larceny.
user.forgetSkill(161);
// Set Cooldown of stolen spell for enemy.
target._cooldownTurns[randomSkill.id] = 5;
// Add the Arcane Larceny state.
user.addState(60);

// The text to show after stealing a skill. Remove everything until the next // marker
// if you don't want to show a message.
var text = user.name() + " has stolen " + $dataSkills[randomSkill.id].name + "!";
var window = SceneManager._scene._logWindow;
window._lines.push(text);
window.refresh();
// Remove everything until here if you don't want text.

};
</After Eval>

Please make your changes in lines 3, 20, 22 and 24.

Line 3 = These skill IDs will never be stolen. (I added this to prevent the player from stealing the Attack or Wait Command or any other skill you feel like shouldn’t be able to be stolen)

Line 20 = Replace the number in here with the ID of your Arcane Larceny skill.

Line 22 = Replace the number 5 with the cooldown you want to add to the enemy’s stolen skill.

Line 24 = Replace the number 60 with the ID of your Arcane Larceny state (which we will create now)


Now you’ll need an Arcane Larceny state. This state will ensure that after a few turns you’ll lose the stolen skill and regain access to Arcane Larceny.

In the state’s notebox use this:


<Custom Remove Effect>
// Initialize to prevent fail.
var skillId = user._stolenSkillAL || 0;
// Forget stolen skill.
user.forgetSkill(skillId);
// Learn Arcane Larceny.
user.learnSkill(161);
</Custom Remove Effect>

Change the number in line 7 to your Arcane Larceny skill ID.

Now you’ll have to go to your Death state (the one with ID: 001) and add this:


<Custom Remove Effect>
var skillId = user._stolenSkillAL || 0;
if (skillId > 0) {
user.forgetSkill(skillId);
user.learnSkill(161);
};
</Custom Remove Effect>

Change the number in line 5 to your Arcane Larceny skill ID.

And that’s it! Now you should be able to steal the skills of your enemies!

Advertisements

5 thoughts on “Eval Collection: Arcane Larceny (Guild Wars)

  1. I really appreciate this! But I’m afraid that the stolen skill is still replacing Arcane Larceny if you are knocked down. When you lose the Arcane Larceny state because of being defeated, the Custom Remove Effect doesn’t seem to proc šŸ˜¦

    Like

      1. It’s almost perfect now, but if you tick K.O by slip damage, this non-direct damage won’t activate the Custom React Effect. I suppose that DoT isn’t real damage and so it isn’t possible for it to proc React Effects. For now, I decided to use Category: Bypass Death Removal to avoid forgetting Arcane Larceny (some states I made involve DoT, and so I need to be 100% sure that they won’t mess up things).

        Like

    1. Oh my xD Sorry!!
      I guess there’s a solution though. Could you try this and report back:
      Place the following in your Death state’s notebox. I hope this works!
      And don’t forget to change the 161 in line 5 šŸ™‚

      <Custom Remove Effect>
      var skillId = user._stolenSkillAL || 0;
      if (skillId > 0) {
      user.forgetSkill(skillId);
      user.learnSkill(161);
      };
      </Custom Remove Effect>
      

      Liked by 1 person

Write a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s