Skip to content

Commit 5eda892

Browse files
MrSlayerGodGregHib
andauthored
add frost dragons combat & gfx (#941)
* added frost dragon gfx and anims and drops and combat * fixed drop table and fixed wrong gfx for frost dragon * added orb stuff for frost dragon * updated more files * fixed frost dragon combat related stuff * fixed combat * Add frost dragon gfx --------- Co-authored-by: GregHib <greghib@users.noreply.github.com>
1 parent 69d0b9b commit 5eda892

File tree

9 files changed

+224
-6
lines changed

9 files changed

+224
-6
lines changed

cache/src/main/kotlin/world/gregs/voidps/cache/definition/decoder/GraphicDecoder.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class GraphicDecoder : DefinitionDecoder<GraphicDefinition>(GRAPHICS) {
1515

1616
override fun GraphicDefinition.read(opcode: Int, buffer: Reader) {
1717
when (opcode) {
18-
1 -> modelId = buffer.readShort()
18+
1 -> modelId = buffer.readUnsignedShort()
1919
2 -> animationId = buffer.readShort()
2020
4 -> sizeXY = buffer.readShort()
2121
5 -> sizeZ = buffer.readShort()
Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,33 @@
11
[frost_dragon]
22
id = 11633
3+
hitpoints = 230
4+
att = 180
5+
str = 150
6+
def = 150
7+
mage = 150
8+
height = 25
9+
combat_def = "frost_dragon"
10+
drop_table = "frost_dragon"
11+
wander_range = 4
12+
hunt_mode = "aggressive"
13+
allowed_under = true
14+
slayer_xp = 235.5
15+
categories = ["dragons", "frost_dragons"]
16+
respawn_delay = 30
17+
examine = "A dragon covered in frost and ice."
318

419
[frost_dragon_2]
520
id = 11634
21+
clone = "frost_dragon"
622

723
[frost_dragon_3]
824
id = 11635
25+
clone = "frost_dragon"
926

1027
[frost_dragon_4]
1128
id = 11636
29+
clone = "frost_dragon"
1230

1331
[frost_dragon_5]
1432
id = 51
15-
categories = ["dragons"]
16-
examine = "A dragon covered in frost and ice."
17-
33+
clone = "frost_dragon"

data/entity/npc/monster/draconic/dragon.anims.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,18 @@ id = 14249
6060

6161
[metal_dragon_shoot]
6262
id = 14252
63+
64+
[frost_dragon_attack]
65+
id = 13151
66+
67+
[frost_dragon_breath_close]
68+
id = 13152
69+
70+
[frost_dragon_death]
71+
id = 13153
72+
73+
[frost_dragon_block]
74+
id = 13154
75+
76+
[frost_dragon_shoot]
77+
id = 13155

data/entity/npc/monster/draconic/dragon.drops.toml

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,4 +319,65 @@ drops = [
319319
type = "all"
320320
drops = [
321321
{ id = "babydragon_bones" }
322-
]
322+
]
323+
324+
[frost_dragon_drop_table]
325+
type = "all"
326+
drops = [
327+
{ id = "frost_dragon_bones" },
328+
{ table = "frost_dragon_secondary" },
329+
{ table = "frost_dragon_tertiary" },
330+
{ table = "hard_clue_scroll", chance = 128 },
331+
]
332+
[frost_dragon_secondary]
333+
roll = 512
334+
drops = [
335+
{ id = "adamant_kiteshield", chance = 8 },
336+
{ id = "adamant_platebody", chance = 8 },
337+
{ id = "rune_dagger", chance = 2 },
338+
{ id = "rune_longsword", chance = 8 },
339+
{ id = "rune_spear" },
340+
{ id = "rune_arrow", amount = 12, chance = 32 },
341+
{ id = "rune_javelin", amount = 5, chance = 2 },
342+
{ id = "water_rune", amount = 14, chance = 2 },
343+
{ id = "law_rune", amount = 10, chance = 8 },
344+
{ id = "blood_rune", amount = 10, chance = 8 },
345+
{ id = "death_rune", min = 10, max = 15, chance = 32 },
346+
{ id = "water_talisman_noted", amount = 2, chance = 32 },
347+
{ id = "air_talisman_noted", amount = 2, chance = 32 },
348+
{ id = "pure_essence_noted", amount = 50, chance = 8 },
349+
{ id = "nature_talisman", chance = 8 },
350+
{ id = "uncut_sapphire", chance = 8 },
351+
{ id = "uncut_emerald", chance = 8 },
352+
{ id = "uncut_ruby", chance = 8 },
353+
{ id = "uncut_diamond", chance = 2 },
354+
{ id = "uncut_dragonstone"},
355+
{ id = "silver_ore_noted", amount = 100 },
356+
{ id = "adamant_bar_noted", amount = 3, chance = 2 },
357+
{ id = "grimy_guam_noted", chance = 32 },
358+
{ id = "grimy_marrentill_noted", chance = 32 },
359+
{ id = "grimy_tarromin_noted", chance = 32 },
360+
{ id = "grimy_harralander_noted", chance = 32 },
361+
{ id = "grimy_ranarr_noted", chance = 32 },
362+
{ id = "grimy_irit_noted", chance = 32 },
363+
{ id = "grimy_avantoe_noted", chance = 32 },
364+
{ id = "grimy_kwuarm_noted", chance = 32 },
365+
{ id = "grimy_cadantine_noted", chance = 32 },
366+
{ id = "grimy_lantadyme_noted", chance = 32 },
367+
{ id = "grimy_dwarf_weed_noted", chance = 32 },
368+
]
369+
370+
[frost_dragon_tertiary]
371+
roll = 10000
372+
drops = [
373+
{ id = "coins", min = 200, max = 1337, chance = 32 },
374+
{ id = "draconic_visage" },
375+
{ id = "limpwurt_root_noted", chance = 8 },
376+
{ id = "mahogany_logs_noted", amount = 3, chance = 8 },
377+
{ id = "shark", min = 1, max = 2, chance = 32 },
378+
{ id = "shield_left_half" },
379+
{ id = "water_orb_noted", amount = 2, chance = 8 },
380+
{ id = "tooth_half_of_a_key" },
381+
{ id = "loop_half_of_a_key" },
382+
{ id = "starved_ancient_effigy", chance = 2 },
383+
]

data/entity/npc/monster/draconic/dragon.gfx.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,11 @@ time_offset = 20
3131
multiplier = 0
3232

3333
[dragon_breath_shoot]
34-
id = 2465
34+
id = 2465
35+
36+
[frost_dragon_breath_ranged]
37+
id = 2464
38+
delay = 40
39+
40+
[frost_dragon_orb]
41+
id = 2875
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
[frost_dragon]
2+
retreat_range = 8
3+
defend_anim = "frost_dragon_block"
4+
defend_sound = "dragon_defend"
5+
death_anim = "frost_dragon_death"
6+
death_sound = "dragon_death"
7+
8+
[frost_dragon.melee]
9+
chance = 75
10+
range = 1
11+
anim = "frost_dragon_attack"
12+
target_hit = { offense = "slash", max = 650 }
13+
target_sound = "dragon_attack"
14+
15+
[frost_dragon.breath_swipe]
16+
chance = 25
17+
range = 1
18+
anim = "frost_dragon_breath_close"
19+
gfx = "dragon_breath_shoot"
20+
target_hit = { offense = "dragonfire", special = true, max = 650 }
21+
target_sound = "dragon_breath"
22+
23+
[frost_dragon.dragonfire_ranged]
24+
chance = 25
25+
range = 10
26+
anim = "frost_dragon_shoot"
27+
projectile = "frost_dragon_breath_ranged"
28+
projectile_origin_y = 1
29+
projectile_origin_x = 1
30+
target_hit = { offense = "dragonfire", special = true, max = 650 }
31+
target_sound = "dragon_breath"
32+
33+
[frost_dragon.ice_arrows]
34+
condition = "frost_range"
35+
chance = 25
36+
range = 10
37+
anim = "frost_dragon_shoot"
38+
projectile = "ice_arrow"
39+
projectile_origin_y = 1
40+
projectile_origin_x = 1
41+
target_hit = { offense = "range", max = 250 }
42+
target_sound = "dragon_attack"
43+
44+
[frost_dragon.magic]
45+
condition = "frost_magic"
46+
chance = 25
47+
range = 10
48+
anim = "frost_dragon_shoot"
49+
projectile = "water_blast"
50+
projectile_origin_y = 1
51+
projectile_origin_x = 1
52+
target_hit = { offense = "magic", max = 250 }
53+
target_sound = "dragon_breath"
54+
impact_gfx = "water_blast_impact"
55+
56+
[frost_dragon.orb]
57+
condition = "no_frost_orb"
58+
chance = 100
59+
range = 10
60+
impact_regardless = true
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package content.area.asgarnia.asgarnian_ice_dungeon
2+
3+
import content.entity.proj.shoot
4+
import world.gregs.voidps.engine.Script
5+
import world.gregs.voidps.engine.client.variable.hasClock
6+
import world.gregs.voidps.engine.client.variable.start
7+
import world.gregs.voidps.type.Delta
8+
9+
class FrostDragons : Script {
10+
11+
init {
12+
npcAttack("frost_dragon*", "orb") {
13+
start("orb_protection", 8)
14+
start("movement_delay", 8)
15+
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))
16+
var step = 20
17+
var delay = 0
18+
for (loop in 0 until 3) {
19+
for (i in 0 until list.lastIndex) {
20+
tile.add(list[i]).shoot(
21+
"frost_dragon_orb",
22+
tile.add(list[i + 1]),
23+
delay = delay,
24+
flightTime = step,
25+
height = 0,
26+
endHeight = 0,
27+
width = 0,
28+
)
29+
delay += step
30+
}
31+
}
32+
}
33+
34+
npcCondition("frost_magic") { get("frost_style", "magic") == "magic" }
35+
36+
npcCondition("frost_range") { get("frost_style", "range") == "range" }
37+
38+
npcCondition("no_frost_orb") { hasClock("orb_protection") }
39+
40+
npcAttack("frost_dragon", "ice_arrows") {
41+
set("frost_style", "range")
42+
}
43+
44+
npcAttack("frost_dragon", "magic") {
45+
set("frost_style", "magic")
46+
}
47+
48+
npcDeath("frost_dragon*") {
49+
clear("frost_style")
50+
}
51+
}
52+
}

game/src/main/kotlin/content/entity/combat/Target.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import content.area.wilderness.inPvp
55
import content.area.wilderness.inSingleCombat
66
import content.area.wilderness.inWilderness
77
import content.entity.combat.hit.Hit
8+
import content.entity.combat.hit.directHit
89
import content.entity.effect.transform
910
import content.entity.player.equip.Equipment
1011
import content.skill.ranged.ammo
@@ -148,6 +149,10 @@ object Target {
148149
Hit.meleeType(type) && !weapon.id.startsWith("leaf_bladed") -> 0
149150
else -> damage
150151
}
152+
is NPC if target.id.startsWith("frost_dragon") && target.hasClock("orb_protection") -> {
153+
source.directHit(damage, "deflect", source = target)
154+
0
155+
}
151156
is NPC if target.id == "harpie_bug_swarm" && source is Player && source.equipped(EquipSlot.Shield).id != "lit_bug_lantern" -> 0
152157
is NPC if target.def.contains("damage_cap") -> damage.coerceAtMost(target.def["damage_cap"])
153158
is NPC if target.def.contains("immune_death") -> damage.coerceAtMost(target.levels.get(Skill.Constitution) - 10)

game/src/main/kotlin/content/entity/proj/ShootProjectile.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ fun Tile.shoot(
5656
endHeight: Int? = null,
5757
curve: Int? = null,
5858
offset: Int? = null,
59+
width: Int? = null,
5960
) = projectile(
6061
id = id,
6162
flightTime = flightTime,
@@ -66,6 +67,7 @@ fun Tile.shoot(
6667
offset = offset,
6768
targetTile = tile,
6869
sourceTile = this,
70+
width = width ?: 1,
6971
)
7072

7173
fun Character.shootNearest(

0 commit comments

Comments
 (0)