Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class GraphicDecoder : DefinitionDecoder<GraphicDefinition>(GRAPHICS) {

override fun GraphicDefinition.read(opcode: Int, buffer: Reader) {
when (opcode) {
1 -> modelId = buffer.readShort()
1 -> modelId = buffer.readUnsignedShort()
2 -> animationId = buffer.readShort()
4 -> sizeXY = buffer.readShort()
5 -> sizeZ = buffer.readShort()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,33 @@
[frost_dragon]
id = 11633
hitpoints = 230
att = 180
str = 150
def = 150
mage = 150
height = 25
combat_def = "frost_dragon"
drop_table = "frost_dragon"
wander_range = 4
hunt_mode = "aggressive"
allowed_under = true
slayer_xp = 235.5
categories = ["dragons", "frost_dragons"]
respawn_delay = 30
examine = "A dragon covered in frost and ice."

[frost_dragon_2]
id = 11634
clone = "frost_dragon"

[frost_dragon_3]
id = 11635
clone = "frost_dragon"

[frost_dragon_4]
id = 11636
clone = "frost_dragon"

[frost_dragon_5]
id = 51
categories = ["dragons"]
examine = "A dragon covered in frost and ice."

clone = "frost_dragon"
15 changes: 15 additions & 0 deletions data/entity/npc/monster/draconic/dragon.anims.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,18 @@ id = 14249

[metal_dragon_shoot]
id = 14252

[frost_dragon_attack]
id = 13151

[frost_dragon_breath_close]
id = 13152

[frost_dragon_death]
id = 13153

[frost_dragon_block]
id = 13154

[frost_dragon_shoot]
id = 13155
63 changes: 62 additions & 1 deletion data/entity/npc/monster/draconic/dragon.drops.toml
Original file line number Diff line number Diff line change
Expand Up @@ -319,4 +319,65 @@ drops = [
type = "all"
drops = [
{ id = "babydragon_bones" }
]
]

[frost_dragon_drop_table]
type = "all"
drops = [
{ id = "frost_dragon_bones" },
{ table = "frost_dragon_secondary" },
{ table = "frost_dragon_tertiary" },
{ table = "hard_clue_scroll", chance = 128 },
]
[frost_dragon_secondary]
roll = 512
drops = [
{ id = "adamant_kiteshield", chance = 8 },
{ id = "adamant_platebody", chance = 8 },
{ id = "rune_dagger", chance = 2 },
{ id = "rune_longsword", chance = 8 },
{ id = "rune_spear" },
{ id = "rune_arrow", amount = 12, chance = 32 },
{ id = "rune_javelin", amount = 5, chance = 2 },
{ id = "water_rune", amount = 14, chance = 2 },
{ id = "law_rune", amount = 10, chance = 8 },
{ id = "blood_rune", amount = 10, chance = 8 },
{ id = "death_rune", min = 10, max = 15, chance = 32 },
{ id = "water_talisman_noted", amount = 2, chance = 32 },
{ id = "air_talisman_noted", amount = 2, chance = 32 },
{ id = "pure_essence_noted", amount = 50, chance = 8 },
{ id = "nature_talisman", chance = 8 },
{ id = "uncut_sapphire", chance = 8 },
{ id = "uncut_emerald", chance = 8 },
{ id = "uncut_ruby", chance = 8 },
{ id = "uncut_diamond", chance = 2 },
{ id = "uncut_dragonstone"},
{ id = "silver_ore_noted", amount = 100 },
{ id = "adamant_bar_noted", amount = 3, chance = 2 },
{ id = "grimy_guam_noted", chance = 32 },
{ id = "grimy_marrentill_noted", chance = 32 },
{ id = "grimy_tarromin_noted", chance = 32 },
{ id = "grimy_harralander_noted", chance = 32 },
{ id = "grimy_ranarr_noted", chance = 32 },
{ id = "grimy_irit_noted", chance = 32 },
{ id = "grimy_avantoe_noted", chance = 32 },
{ id = "grimy_kwuarm_noted", chance = 32 },
{ id = "grimy_cadantine_noted", chance = 32 },
{ id = "grimy_lantadyme_noted", chance = 32 },
{ id = "grimy_dwarf_weed_noted", chance = 32 },
]

[frost_dragon_tertiary]
roll = 10000
drops = [
{ id = "coins", min = 200, max = 1337, chance = 32 },
{ id = "draconic_visage" },
{ id = "limpwurt_root_noted", chance = 8 },
{ id = "mahogany_logs_noted", amount = 3, chance = 8 },
{ id = "shark", min = 1, max = 2, chance = 32 },
{ id = "shield_left_half" },
{ id = "water_orb_noted", amount = 2, chance = 8 },
{ id = "tooth_half_of_a_key" },
{ id = "loop_half_of_a_key" },
{ id = "starved_ancient_effigy", chance = 2 },
]
9 changes: 8 additions & 1 deletion data/entity/npc/monster/draconic/dragon.gfx.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,11 @@ time_offset = 20
multiplier = 0

[dragon_breath_shoot]
id = 2465
id = 2465

[frost_dragon_breath_ranged]
id = 2464
delay = 40

[frost_dragon_orb]
id = 2875
Comment thread
GregHib marked this conversation as resolved.
60 changes: 60 additions & 0 deletions data/entity/npc/monster/draconic/frost_dragon.combat.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
[frost_dragon]
retreat_range = 8
defend_anim = "frost_dragon_block"
defend_sound = "dragon_defend"
death_anim = "frost_dragon_death"
death_sound = "dragon_death"

[frost_dragon.melee]
chance = 75
range = 1
anim = "frost_dragon_attack"
target_hit = { offense = "slash", max = 650 }
target_sound = "dragon_attack"

[frost_dragon.breath_swipe]
chance = 25
range = 1
anim = "frost_dragon_breath_close"
gfx = "dragon_breath_shoot"
target_hit = { offense = "dragonfire", special = true, max = 650 }
target_sound = "dragon_breath"

[frost_dragon.dragonfire_ranged]
chance = 25
range = 10
anim = "frost_dragon_shoot"
projectile = "frost_dragon_breath_ranged"
projectile_origin_y = 1
projectile_origin_x = 1
target_hit = { offense = "dragonfire", special = true, max = 650 }
target_sound = "dragon_breath"

[frost_dragon.ice_arrows]
condition = "frost_range"
chance = 25
Comment thread
MrSlayerGod marked this conversation as resolved.
range = 10
anim = "frost_dragon_shoot"
projectile = "ice_arrow"
projectile_origin_y = 1
projectile_origin_x = 1
target_hit = { offense = "range", max = 250 }
target_sound = "dragon_attack"

[frost_dragon.magic]
condition = "frost_magic"
chance = 25
Comment thread
MrSlayerGod marked this conversation as resolved.
range = 10
anim = "frost_dragon_shoot"
projectile = "water_blast"
projectile_origin_y = 1
projectile_origin_x = 1
target_hit = { offense = "magic", max = 250 }
target_sound = "dragon_breath"
impact_gfx = "water_blast_impact"

[frost_dragon.orb]
condition = "no_frost_orb"
chance = 100
range = 10
impact_regardless = true
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package content.area.asgarnia.asgarnian_ice_dungeon

import content.entity.proj.shoot
import world.gregs.voidps.engine.Script
import world.gregs.voidps.engine.client.variable.hasClock
import world.gregs.voidps.engine.client.variable.start
import world.gregs.voidps.type.Delta

class FrostDragons : Script {

Check warning on line 9 in game/src/main/kotlin/content/area/asgarnia/asgarnian_ice_dungeon/FrostDragons.kt

View workflow job for this annotation

GitHub Actions / qodana

Unused symbol

Class "FrostDragons" is never used

init {
npcAttack("frost_dragon*", "orb") {
start("orb_protection", 8)
start("movement_delay", 8)
val list = listOf(Delta(1, 0), Delta(0, 1), Delta(0, 2), Delta(1, 3), Delta(2, 3), Delta(3, 2), Delta(3, 1), Delta(2, 0), Delta(1, 0))
var step = 20
var delay = 0
for (loop in 0 until 3) {
for (i in 0 until list.lastIndex) {
tile.add(list[i]).shoot(
"frost_dragon_orb",
tile.add(list[i + 1]),
delay = delay,
flightTime = step,
height = 0,
endHeight = 0,
width = 0,
)
delay += step
}
}
}
Comment thread
MrSlayerGod marked this conversation as resolved.

npcCondition("frost_magic") { get("frost_style", "magic") == "magic" }

npcCondition("frost_range") { get("frost_style", "range") == "range" }

npcCondition("no_frost_orb") { hasClock("orb_protection") }

npcAttack("frost_dragon", "ice_arrows") {
set("frost_style", "range")
}

npcAttack("frost_dragon", "magic") {
set("frost_style", "magic")
}

npcDeath("frost_dragon*") {
clear("frost_style")
}
}
}
5 changes: 5 additions & 0 deletions game/src/main/kotlin/content/entity/combat/Target.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import content.area.wilderness.inPvp
import content.area.wilderness.inSingleCombat
import content.area.wilderness.inWilderness
import content.entity.combat.hit.Hit
import content.entity.combat.hit.directHit
import content.entity.effect.transform
import content.entity.player.equip.Equipment
import content.skill.melee.weapon.fightStyle
Expand Down Expand Up @@ -167,6 +168,10 @@ object Target {
Hit.meleeType(type) && !weapon.id.startsWith("leaf_bladed") -> 0
else -> damage
}
is NPC if target.id.startsWith("frost_dragon") && target.hasClock("orb_protection") -> {
source.directHit(damage, "deflect", source = target)
0
}
is NPC if target.id == "harpie_bug_swarm" && source is Player && source.equipped(EquipSlot.Shield).id != "lit_bug_lantern" -> 0
is NPC if target.def.contains("damage_cap") -> damage.coerceAtMost(target.def["damage_cap"])
is NPC if target.def.contains("immune_death") -> damage.coerceAtMost(target.levels.get(Skill.Constitution) - 10)
Expand Down
2 changes: 2 additions & 0 deletions game/src/main/kotlin/content/entity/proj/ShootProjectile.kt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ fun Tile.shoot(
endHeight: Int? = null,
curve: Int? = null,
offset: Int? = null,
width: Int? = null,
) = projectile(
id = id,
flightTime = flightTime,
Expand All @@ -66,6 +67,7 @@ fun Tile.shoot(
offset = offset,
targetTile = tile,
sourceTile = this,
width = width ?: 1,
)

fun Character.shootNearest(
Expand Down
Loading