c52e02936d
Implemented admin audio command ::audio audioId loops[optional] Implemented admin globalaudio command ::globalaudio audioId radius playername (plays from that players location) or can be used by coords ::globalaudio audioId radius x y z Refactored the following sounds: Tribal totem quest Cromperty teleport (fixed looping) Vinesweeper tool leprechaun teleport sound (Corrected this sound so it does not loop 10 times) Antifire and poision immunity 30 seconds remaining tick tock sounds and sound of the potions expiring (Fixed it so it plays the correct number of tick tocks) Sound when summoning a familiar (All familiars were using the summon unicorn sound. It is now defaulted to the normal summoning sound instead of the unicorn summon sound. All familiars on first summon have a their own sounds that will need to be implemented later) Door and gate sounds Bank interface sounds Unicorn stallion special move sound Agility pyramid rolling block sounds Prayer book sounds Lunar stat spy Hunter falconry Picking items in a field like potatoes Ectophial teleport and refill Summoning pouch creation and renewing points Runecrafting at altar sound Making finished and unfinished potions Cutting gems Entering giant mole area Praying at an altar Warriors guild animator sounds Chiseling limestone Spirit wolf special move sound Telegrab spell sound Glassblowing sound Strong of security opening reward chest creaking sound Butterfly net sound Desert rug travel rise and descend sound Enchanting bolts Woodcutting tree falling and chopping sound Hunter setting up dismantling traps and pitfall sounds Explorers ring run energy restore sound Farming: Raking, adding compost to patch, picking from fruit trees, seed dibb, using plant cure on patch, opening/closing/adding to/from compost bin Mage training arena alchemy spell sounds Breaking bones to peaches/bananas tab sound Casting silver sickle bloom Entrana magic door teleport Cabbage teleport Teleother cast sound Fairy ring teleport sound Lunar vengeance spells Running out of prayer sound Lunar (non teleport) spells Super heat and bones to bananas normal spell book sounds Equip/unequip item sound Revenant combat sounds Herb cleaning sound Emptying buckets/bowls/jugs of water Making cannonballs at a furnace Digging with a spade Peer the seer fremmenik trials challenge: heating items on the range Blessing a spirit shield at a POH altar ContentAPI function stun sound Picking up items off the ground Eating food sound Cooking and intentionally burning food Drinking a potion Warriors guild catapult Pulling wilderness teleport levers Offering bones on a POH altar Slashing spider webs in Varrock sewers Entering POH portal teleport sound GE exchanging item set sound Jumping wilderness ditch Dragon axe special Digging up a farming patch Lunar heal spells Chaos elemental projectile impact sounds Mounted glory teleport Lunar share and boost potion spell Dwarf multi cannon setup, rotate, and firing sounds NPC attacking sound Enchanted bolt effect combat sound
163 lines
5.5 KiB
Java
163 lines
5.5 KiB
Java
package content.global.skill.magic.ancient;
|
|
|
|
import java.util.List;
|
|
|
|
import core.game.node.entity.combat.spell.Runes;
|
|
import core.game.node.Node;
|
|
import core.game.node.entity.Entity;
|
|
import core.game.node.entity.combat.BattleState;
|
|
import core.game.node.entity.combat.spell.CombatSpell;
|
|
import core.game.node.entity.combat.spell.SpellType;
|
|
import core.game.node.entity.impl.Projectile;
|
|
import core.game.node.entity.impl.Animator.Priority;
|
|
import core.game.node.entity.player.link.SpellBookManager.SpellBook;
|
|
import core.game.node.item.Item;
|
|
import core.game.world.update.flag.context.Animation;
|
|
import core.game.world.update.flag.context.Graphics;
|
|
import core.plugin.Initializable;
|
|
import core.plugin.Plugin;
|
|
import org.rs09.consts.Sounds;
|
|
|
|
import static core.api.ContentAPIKt.*;
|
|
|
|
/**
|
|
* Handles the Ice spells from the Ancient spellbook.
|
|
* @author Emperor
|
|
* @version 1.0
|
|
*/
|
|
@Initializable
|
|
public final class IceSpells extends CombatSpell {
|
|
|
|
/**
|
|
* The barrage orb GFX.
|
|
*/
|
|
private static final Graphics BARRAGE_ORB = new Graphics(1677, 96); //119
|
|
|
|
/**
|
|
* The projectile for Ice rush.
|
|
*/
|
|
private static final Projectile RUSH_PROJECTILE = Projectile.create((Entity) null, null, 360, 40, 36, 52, 75, 15, 11);
|
|
|
|
/**
|
|
* The end graphic for Ice rush.
|
|
*/
|
|
private static final Graphics RUSH_END = new Graphics(361, 96);
|
|
|
|
/**
|
|
* The projectile for Ice barrage.
|
|
*/
|
|
private static final Projectile BURST_PROJECTILE = Projectile.create((Entity) null, null, 362, 40, 36, 52, 75, 15, 11);
|
|
|
|
/**
|
|
* The end graphic for Ice barrage.
|
|
*/
|
|
private static final Graphics BURST_END = new Graphics(363, 0);
|
|
|
|
/**
|
|
* The start graphic for Ice rush.
|
|
*/
|
|
private static final Graphics BLITZ_START = new Graphics(366, 96);
|
|
|
|
/**
|
|
* The end graphic for Ice rush.
|
|
*/
|
|
private static final Graphics BLITZ_END = new Graphics(367, 96);
|
|
|
|
/**
|
|
* The projectile for Ice barrage.
|
|
*/
|
|
private static final Projectile BARRAGE_PROJECTILE = Projectile.create((Entity) null, null, 368, 40, 36, 52, 75, 15, 11);
|
|
|
|
/**
|
|
* The end graphic for Ice barrage.
|
|
*/
|
|
private static final Graphics BARRAGE_END = new Graphics(369, 0);
|
|
|
|
/**
|
|
* Constructs a new {@code IceSpells} {@code Object}.
|
|
*/
|
|
public IceSpells() {
|
|
/*
|
|
* empty.
|
|
*/
|
|
}
|
|
|
|
/**
|
|
* Constructs a new {@code IceSpells} {@Code Object}
|
|
* @param type The spell type.
|
|
* @param impactSound The impact sound id.
|
|
* @param anim The animation.
|
|
* @param start The start graphics.
|
|
* @param projectile The projectile.
|
|
* @param end The end graphics.
|
|
*/
|
|
private IceSpells(SpellType type, int level, double baseExperience, int impactSound, Animation anim, Graphics start, Projectile projectile, Graphics end, Item... runes) {
|
|
super(type, SpellBook.ANCIENT, level, baseExperience, Sounds.ICE_CAST_171, impactSound, anim, start, projectile, end, runes);
|
|
}
|
|
|
|
@Override
|
|
public void visualize(Entity entity, Node target) {
|
|
entity.graphics(graphic);
|
|
if (projectile != null) {
|
|
projectile.transform(entity, (Entity) target, false, 58, 10).send();
|
|
}
|
|
entity.animate(animation);
|
|
playGlobalAudio(entity.getLocation(), audio.id, 20);
|
|
|
|
}
|
|
|
|
@Override
|
|
public void visualizeImpact(Entity entity, Entity target, BattleState state) {
|
|
if (state.isFrozen()) {
|
|
playGlobalAudio(target.getLocation(), impactAudio, 20);
|
|
target.graphics(BARRAGE_ORB);
|
|
return;
|
|
}
|
|
super.visualizeImpact(entity, target, state);
|
|
}
|
|
|
|
@Override
|
|
public Plugin<SpellType> newInstance(SpellType arg) throws Throwable {
|
|
SpellBook.ANCIENT.register(0, new IceSpells(SpellType.RUSH, 58, 34.0, Sounds.ICE_RUSH_IMPACT_173, new Animation(1978, Priority.HIGH), null, RUSH_PROJECTILE, RUSH_END, Runes.DEATH_RUNE.getItem(2), Runes.CHAOS_RUNE.getItem(2), Runes.WATER_RUNE.getItem(2)));
|
|
SpellBook.ANCIENT.register(2, new IceSpells(SpellType.BURST, 70, 40.0, Sounds.ICE_BURST_IMPACT_170, new Animation(1979, Priority.HIGH), null, BURST_PROJECTILE, BURST_END, Runes.DEATH_RUNE.getItem(2), Runes.CHAOS_RUNE.getItem(4), Runes.WATER_RUNE.getItem(4)));
|
|
SpellBook.ANCIENT.register(1, new IceSpells(SpellType.BLITZ, 82, 46.0, Sounds.ICE_BLITZ_IMPACT_169, new Animation(1978, Priority.HIGH), BLITZ_START, null, BLITZ_END, Runes.BLOOD_RUNE.getItem(2), Runes.DEATH_RUNE.getItem(2), Runes.WATER_RUNE.getItem(3)));
|
|
SpellBook.ANCIENT.register(3, new IceSpells(SpellType.BARRAGE, 94, 52.0, Sounds.ICE_BARRAGE_IMPACT_168, new Animation(1979, Priority.HIGH), null, BARRAGE_PROJECTILE, BARRAGE_END, Runes.BLOOD_RUNE.getItem(2), Runes.DEATH_RUNE.getItem(4), Runes.WATER_RUNE.getItem(6)));
|
|
return this;
|
|
}
|
|
|
|
@Override
|
|
public void fireEffect(Entity entity, Entity victim, BattleState state) {
|
|
if (state.getEstimatedHit() == -1) {
|
|
return;
|
|
}
|
|
int ticks = (1 + (type.ordinal() - SpellType.RUSH.ordinal())) * 8;
|
|
if (state.getEstimatedHit() > -1) {
|
|
if (!hasTimerActive(victim, "frozen:immunity")) {
|
|
registerTimer(victim, spawnTimer("frozen", ticks, true));
|
|
} else if (type == SpellType.BARRAGE) {
|
|
state.setFrozen(true);
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public BattleState[] getTargets(Entity entity, Entity target) {
|
|
if (animation.getId() == 1978 || !entity.getProperties().isMultiZone() || !target.getProperties().isMultiZone()) {
|
|
return super.getTargets(entity, target);
|
|
}
|
|
List<Entity> list = getMultihitTargets(entity, target, 9);
|
|
BattleState[] targets = new BattleState[list.size()];
|
|
int index = 0;
|
|
for (Entity e : list) {
|
|
targets[index++] = new BattleState(entity, e);
|
|
}
|
|
return targets;
|
|
}
|
|
|
|
@Override
|
|
public int getMaximumImpact(Entity entity, Entity victim, BattleState state) {
|
|
return getType().getImpactAmount(entity, victim, 4);
|
|
}
|
|
|
|
}
|