diff --git a/.kotlin/sessions/kotlin-compiler-18058149951275275357.salive b/.kotlin/sessions/kotlin-compiler-18058149951275275357.salive new file mode 100644 index 0000000000..e69de29bb2 diff --git a/data/client/client.scripts.toml b/data/client/client.scripts.toml index f0fe4242ac..ca6c3f9f44 100644 --- a/data/client/client.scripts.toml +++ b/data/client/client.scripts.toml @@ -282,4 +282,7 @@ params = [ ] [refresh_item_info] -id = 917 \ No newline at end of file +id = 917 + +[reset_summoning_orb] +id = 2471 \ No newline at end of file diff --git a/data/client/enums.toml b/data/client/enums.toml index 7799368fc9..81eb88b6ca 100644 --- a/data/client/enums.toml +++ b/data/client/enums.toml @@ -332,9 +332,14 @@ id = 1100 [gravestone_price] id = 1101 +# From NPC id +# Lowercase, does not include dungeoneering IDs +[summoning_familiar_names_lowercase] +id = 931 + # From NPC id, used in interface 662, cs2 751 -# All seem to be in the format 4895#### -[summoning_familiar_hashes_1] +# Fruit bat (6817) -> 747, 30 +[summoning_orb_packed_components] id = 1092 # From index in crafting menu, no difference from summoning_pouch_ids_2 @@ -365,6 +370,15 @@ id = 1187 [summoning_scroll_ids_1] id = 1188 +# Used if varp 4282 > 50, 50 is immediately subtracted from the varp +# Not sure when these are actually used... When low health, maybe?? +[pet_details_chathead_animations_other] +id = 1275 + +# Used if varp 4282 <= 50 +[pet_details_chathead_animations_normal] +id = 1276 + # From index in the crafting menu, no difference from summoning_pouch_ids_1 [summoning_pouch_ids_2] id = 1277 @@ -378,8 +392,9 @@ id = 1278 id = 1279 # From NPC id, used in interface 662, cs2 751 -# All seem to be in the format 4338#### -[summoning_familiar_hashes] +# Fruit bat (6817) -> 662, 88 +# Seems to be 1 off on the component ID. Fruit bat's scroll is ID 89 +[pet_details_use_scroll_packed_components] id = 1282 # From associated summoning pouch ID @@ -435,5 +450,9 @@ id = 1077 [exchange_slot_interfaces] id = 1078 +# Familiar names from 0 - 77 in alphabetical order (Except phoenix, which is in place 77) +[summoning_familiar_names_alphabetical] +id = 1539 + [farming_protection] id = 2024 diff --git a/data/entity/player/modal/interface_types.toml b/data/entity/player/modal/interface_types.toml index 75f33196a7..5eb87b79e5 100644 --- a/data/entity/player/modal/interface_types.toml +++ b/data/entity/player/modal/interface_types.toml @@ -69,7 +69,7 @@ resizeIndex = 92 fixedIndex = 209 resizeIndex = 93 -[follower_details_tab] +[tasks_tab] fixedIndex = 210 resizeIndex = 94 @@ -105,6 +105,10 @@ resizeIndex = 101 fixedIndex = 197 resizeIndex = 83 +[follower_details_tab] +fixedIndex = 219 +resizeIndex = 103 + [logout_tab] fixedIndex = 220 resizeIndex = 104 diff --git a/data/entity/player/modal/toplevel/gameframe.ifaces.toml b/data/entity/player/modal/toplevel/gameframe.ifaces.toml index f12a33cdea..9f3fdbeea8 100644 --- a/data/entity/player/modal/toplevel/gameframe.ifaces.toml +++ b/data/entity/player/modal/toplevel/gameframe.ifaces.toml @@ -189,6 +189,261 @@ id = 165 id = 747 type = "summoning_orb" +[.leftclick_options] +id = 7 + +[.familiar_options] +id = 8 + +[.follower_details] +id = 9 + +[.call_follower] +id = 10 + +[.dismiss_follower] +id = 11 + +[.take_bob] +id = 12 + +[.renew_familiar] +id = 13 + +# Can't yet confirm that these 2 are cast / attack. +# Likely IDs 21 and 22 will be their left-click options as well +#[.n14] +#id = 14 +# +#[.n15] +#id = 15 + +[.leftclick_follower_details] +id = 16 + +[.leftclick_call_follower] +id = 17 + +[.leftclick_dismiss_follower] +id = 18 + +[.leftclick_take_bob] +id = 19 + +[.leftclick_renew_familiar] +id = 20 + + +[.cast_fetch_casket] +id = 87 + +[.cast_poison_shot] +id = 90 + +[.cast_sundering_strike] +id = 91 + +[.cast_clay_deposit] +id = 92 + +[.cast_aptitude] +id = 95 + +[.cast_glimmer_of_light] +id = 98 + +[.cast_second_wind] +id = 99 + +[.cast_snaring_wave] +id = 100 + +[.cast_inferno] +id = 101 + +[.cast_immense_heat] +id = 102 + +[.cast_iron_within] +id = 103 + +[.cast_rending] +id = 104 + +[.cast_fireball_assault] +id = 105 + +[.cast_pester] +id = 106 + +[.cast_essence_shipment] +id = 107 + +[.cast_volcanic_strength] +id = 108 + +[.cast_ebon_thunder] +id = 109 + +[.cast_ambush] +id = 110 + +[.cast_goad] +id = 111 + +[.cast_explode] +id = 112 + +[.cast_steel_of_legends] +id = 113 + +[.cast_boil] +id = 114 + +[.cast_titans_constitution] +id = 115 + +[.cast_call_to_arms] +id = 116 + +[.cast_swamp_plague] +id = 117 + +[.cast_swallow_whole] +id = 118 + +[.cast_magic_focus] +id = 119 + +[.cast_bull_rush] +id = 120 + +[.cast_spike_shot] +id = 121 + +[.cast_regrowth] +id = 122 + +[.cast_deadly_claw] +id = 123 + +[.cast_poisonous_blast] +id = 124 + +[.cast_acorn_missile] +id = 125 + +[.cast_generate_compost] +id = 126 + +[.cast_doomsphere_device] +id = 127 + +[.cast_dust_cloud] +id = 128 + +[.cast_blood_drain] +id = 129 + +[.cast_tireless_run] +id = 130 + +[.cast_petrifying_gaze] +id = 131 + +[.cast_abyssal_drain] +id = 132 + +[.cast_dissolve] +id = 133 + +[.cast_electric_lash] +id = 134 + +[.cast_slime_spray] +id = 135 + +[.cast_testudo] +id = 136 + +[.cast_ophidian_incubation] +id = 137 + +[.cast_healing_aura] +id = 138 + +[.cast_winter_storage] +id = 139 + +[.cast_arctic_blast] +id = 140 + +[.cast_toad_bark] +id = 141 + +[.cast_insane_ferocity] +id = 142 + +[.cast_cheese_feast] +id = 143 + +[.cast_venom_shot] +id = 144 + +[.cast_sandstorm] +id = 145 + +[.cast_famine] +id = 146 + +[.cast_mantis_strike] +id = 147 + +[.cast_crushing_claw] +id = 148 + +[.cast_unburden] +id = 149 + +[.cast_multichop] +id = 150 + +[.cast_abyssal_stealth] +id = 151 + +[.cast_fish_rain] +id = 152 + +[.cast_egg_spawn] +id = 153 + +[.cast_thieving_fingers] +id = 154 + +[.cast_fruitfall] +id = 155 + +[.cast_evil_flames] +id = 156 + +[.cast_stony_shell] +id = 157 + +[.cast_herbcall] +id = 158 + +[.cast_vampire_touch] +id = 159 + +[.cast_rise_from_the_ashes] +id = 160 + +[.cast_dreadfowl_strike] +id = 161 + +[.cast_howl] +id = 162 + [health_orb] id = 748 type = "health_orb" diff --git a/data/skill/summoning/summoning.gfx.toml b/data/skill/summoning/summoning.gfx.toml new file mode 100644 index 0000000000..4fcf922db5 --- /dev/null +++ b/data/skill/summoning/summoning.gfx.toml @@ -0,0 +1,5 @@ +[summon_familiar_size_1] +id = 1314 + +[summon_familiar_size_2] +id = 1315 \ No newline at end of file diff --git a/data/skill/summoning/summoning.ifaces.toml b/data/skill/summoning/summoning.ifaces.toml index 51184ade7b..26d2fcdef2 100644 --- a/data/skill/summoning/summoning.ifaces.toml +++ b/data/skill/summoning/summoning.ifaces.toml @@ -39,11 +39,244 @@ id = 27 [summoning_creation] id = 79 -[pet_details] +[familiar_details] id = 662 +type = "follower_details_tab" + +[.call] +id = 49 + +[.dismiss] +id = 51 + +[.attack] +id = 65 + +[.take_bob_items] +id = 67 + +[.renew] +id = 69 + +[.cast_howl] +id = 75 + +[.cast_dreadfowl_strike] +id = 77 + +[.cast_rise_from_the_ashes] +id = 78 + +[.cast_vampire_touch] +id = 81 + +[.cast_herbcall] +id = 83 + +[.cast_stony_shell] +id = 85 + +[.cast_evil_flames] +id = 87 + +[.cast_fruitfall] +id = 89 + +[.cast_thieving_fingers] +id = 91 + +[.cast_egg_spawn] +id = 93 + +[.cast_fish_rain] +id = 95 + +[.cast_abyssal_stealth] +id = 97 + +[.cast_multichop] +id = 99 + +[.cast_unburden] +id = 101 + +[.cast_crushing_claw] +id = 103 + +[.cast_mantis_strike] +id = 105 + +[.cast_famine] +id = 107 + +[.cast_sandstorm] +id = 109 + +[.cast_venom_shot] +id = 111 + +[.cast_cheese_feast] +id = 113 + +[.cast_insane_ferocity] +id = 115 + +[.cast_toad_bark] +id = 117 + +[.cast_arctic_blast] +id = 119 + +[.cast_winter_storage] +id = 121 + +[.cast_healing_aura] +id = 123 + +[.cast_oph_incubation] +id = 125 + +[.cast_testudo] +id = 127 + +[.cast_slime_spray] +id = 129 + +[.cast_electric_lash] +id = 131 + +[.cast_dissolve] +id = 133 + +[.cast_abyssal_drain] +id = 135 + +[.cast_petrifying_gaze] +id = 137 + +[.cast_tireless_run] +id = 139 + +[.cast_blood_drain] +id = 141 + +[.cast_dust_cloud] +id = 143 + +[.cast_doomsphere] +id = 145 + +[.cast_generate_compost] +id = 147 + +[.cast_acorn_missile] +id = 149 + +[.cast_poisonous_blast] +id = 151 + +[.cast_deadly_claw] +id = 153 + +[.cast_regrowth] +id = 155 + +[.cast_spike_shot] +id = 157 + +[.cast_addy_bull_rush] +id = 159 + +[.cast_magic_focus] +id = 161 -[pet_hunger_details] +[.cast_swallow_whole] +id = 163 + +[.cast_swamp_plague] +id = 165 + +[.cast_call_to_arms] +id = 167 + +[.cast_titans_con] +id = 169 + +[.cast_boil] +id = 171 + +[.cast_steel_of_legends] +id = 173 + +[.cast_explode] +id = 175 + +[.cast_goad] +id = 177 + +[.cast_ambush] +id = 179 + +[.cast_ebon_thunder] +id = 181 + +[.cast_volcanic_str] +id = 183 + +[.cast_essence_shipment] +id = 185 + +[.cast_pester] +id = 187 + +[.cast_fireball_assault] +id = 189 + +[.cast_rending] +id = 191 + +[.cast_iron_within] +id = 193 + +[.cast_immense_heat] +id = 195 + +[.cast_inferno] +id = 197 + +[.cast_clay_deposit] +id = 199 + +[.cast_fetch_casket] +id = 200 + +[.cast_sundering_strike] +id = 203 + +[.cast_poisonous_shot] +id = 205 + +[.cast_snaring_wave] +id = 207 + +[.cast_aptitude] +id = 209 + +[.cast_second_wind] +id = 211 + +[.cast_glimmer_of_light] +id = 213 + +[pet_details] id = 663 +type = "follower_details_tab" + +[.call] +id = 21 + +[.dismiss] +id = 23 [summoning_scroll_creation] id = 666 @@ -76,8 +309,54 @@ type = "dialogue_box" id = 737 type = "dialogue_box" -[familiar_options] +[follower_left_click_options] id = 880 +type = "overlay_tab" + +[.follower_details_circle] +id = 7 + +[.follower_details] +id = 8 + +[.special_move_circle] +id = 9 + +[.special_move] +id = 10 + +[.attack_circle] +id = 11 + +[.attack] +id = 12 + +[.call_follower_circle] +id = 13 + +[.call_follower] +id = 14 + +[.dismiss_follower_cricle] +id = 15 + +[.dismiss_follower] +id = 16 + +[.take_bob_cricle] +id = 17 + +[.take_bob] +id = 18 + +[.renew_familiar_circle] +id = 19 + +[.renew_familiar] +id = 20 + +[.confirm] +id = 21 [summoning_side] id = 722 diff --git a/data/skill/summoning/summoning.items.toml b/data/skill/summoning/summoning.items.toml index b90c99d7bd..2e6fa3f4fd 100644 --- a/data/skill/summoning/summoning.items.toml +++ b/data/skill/summoning/summoning.items.toml @@ -21,6 +21,7 @@ weight = 0.02 examine = "I can summon a spirit terrorbird familiar with this." summon_experience = 0.8 infuse_experience = 68.4 +summon_points = 6 [spirit_terrorbird_pouch_noted] id = 12008 @@ -33,6 +34,7 @@ weight = 0.02 examine = "I can summon a granite crab familiar with this." summon_experience = 0.2 infuse_experience = 21.6 +summon_points = 2 [granite_crab_pouch_noted] id = 12010 @@ -45,6 +47,7 @@ weight = 0.02 examine = "I can summon a praying mantis familiar with this." summon_experience = 3.6 infuse_experience = 329.6 +summon_points = 8 [praying_mantis_pouch_noted] id = 12012 @@ -57,6 +60,7 @@ weight = 0.02 examine = "I can summon a giant ent familiar with this." summon_experience = 1.6 infuse_experience = 136.8 +summon_points = 8 [giant_ent_pouch_noted] id = 12014 @@ -69,6 +73,7 @@ weight = 0.02 examine = "I can summon a spirit cobra familiar with this." summon_experience = 3.1 infuse_experience = 276.8 +summon_points = 7 [spirit_cobra_pouch_noted] id = 12016 @@ -81,6 +86,7 @@ weight = 0.02 examine = "I can summon a spirit dagannoth familiar with this." summon_experience = 4.1 infuse_experience = 364.8 +summon_points = 9 [spirit_dagannoth_pouch_noted] id = 12018 @@ -93,6 +99,7 @@ weight = 0.02 examine = "I can summon a thorny snail familiar with this." summon_experience = 0.2 infuse_experience = 12.6 +summon_points = 2 [thorny_snail_pouch_noted] id = 12020 @@ -105,6 +112,7 @@ weight = 0.02 examine = "I can summon a beaver familiar with this." summon_experience = 0.7 infuse_experience = 57.6 +summon_points = 4 [beaver_pouch_noted] id = 12022 @@ -129,6 +137,7 @@ weight = 0.02 examine = "I can summon a hydra familiar with this." summon_experience = 1.6 infuse_experience = 140.8 +summon_points = 8 [hydra_pouch_noted] id = 12026 @@ -141,6 +150,7 @@ weight = 0.02 examine = "I can summon a spirit jelly familiar with this." summon_experience = 5.5 infuse_experience = 484.0 +summon_points = 6 [spirit_jelly_pouch_noted] id = 12028 @@ -153,6 +163,7 @@ weight = 0.02 examine = "I can summon a bunyip familiar with this." summon_experience = 1.4 infuse_experience = 119.2 +summon_points = 7 [bunyip_pouch_noted] id = 12030 @@ -165,6 +176,7 @@ weight = 0.02 examine = "I can summon a war tortoise familiar with this." summon_experience = 0.7 infuse_experience = 58.6 +summon_points = 7 [war_tortoise_pouch_noted] id = 12032 @@ -177,6 +189,7 @@ weight = 0.02 examine = "I can summon a fruit bat familiar with this." summon_experience = 1.4 infuse_experience = 121.2 +summon_points = 7 [fruit_bat_pouch_noted] id = 12034 @@ -189,6 +202,7 @@ weight = 0.02 examine = "I can summon an abyssal parasite familiar with this." summon_experience = 1.1 infuse_experience = 94.8 +summon_points = 6 [abyssal_parasite_pouch_noted] id = 12036 @@ -201,6 +215,7 @@ weight = 0.02 examine = "I can summon an abyssal lurker familiar with this." summon_experience = 1.9 infuse_experience = 109.6 +summon_points = 7 [abyssal_lurker_pouch_noted] id = 12038 @@ -213,6 +228,7 @@ weight = 0.02 examine = "I can summon a unicorn stallion familiar with this." summon_experience = 1.8 infuse_experience = 154.4 +summon_points = 9 [unicorn_stallion_pouch_noted] id = 12040 @@ -225,6 +241,7 @@ weight = 0.02 examine = "I can summon a magpie familiar with this." summon_experience = 0.9 infuse_experience = 83.2 +summon_points = 5 [magpie_pouch_noted] id = 12042 @@ -237,6 +254,7 @@ weight = 0.02 examine = "I can summon a dreadfowl familiar with this." summon_experience = 0.1 infuse_experience = 9.3 +summon_points = 1 [dreadfowl_pouch_noted] id = 12044 @@ -249,6 +267,7 @@ weight = 0.02 examine = "I can summon a stranger plant familiar with this." summon_experience = 3.2 infuse_experience = 281.6 +summon_points = 7 [stranger_plant_pouch_noted] id = 12046 @@ -261,6 +280,7 @@ weight = 0.02 examine = "I can summon a spirit wolf familiar with this." summon_experience = 0.1 infuse_experience = 4.8 +summon_points = 1 [spirit_wolf_pouch_noted] id = 12048 @@ -273,6 +293,7 @@ weight = 0.02 examine = "I can summon a desert wyrm familiar with this." summon_experience = 0.4 infuse_experience = 31.2 +summon_points = 1 [desert_wyrm_pouch_noted] id = 12050 @@ -285,6 +306,7 @@ weight = 0.02 examine = "I can summon an evil turnip familiar with this." summon_experience = 2.1 infuse_experience = 184.8 +summon_points = 5 [evil_turnip_pouch_noted] id = 12052 @@ -297,6 +319,7 @@ weight = 0.02 examine = "I can summon a vampyre bat familiar with this." summon_experience = 1.5 infuse_experience = 136.0 +summon_points = 4 [vampyre_bat_pouch_noted] id = 12054 @@ -309,6 +332,7 @@ weight = 0.02 examine = "I can summon a spirit scorpion familiar with this." summon_experience = 0.9 infuse_experience = 83.2 +summon_points = 2 [spirit_scorpion_pouch_noted] id = 12056 @@ -321,6 +345,7 @@ weight = 0.02 examine = "I can summon an arctic bear familiar with this." summon_experience = 1.1 infuse_experience = 93.2 +summon_points = 8 [arctic_bear_pouch_noted] id = 12058 @@ -333,6 +358,7 @@ weight = 0.02 examine = "I can summon a spirit spider familiar with this." summon_experience = 0.2 infuse_experience = 12.6 +summon_points = 2 [spirit_spider_pouch_noted] id = 12060 @@ -345,6 +371,7 @@ weight = 0.02 examine = "I can summon a bloated leech familiar with this." summon_experience = 2.4 infuse_experience = 215.2 +summon_points = 5 [bloated_leech_pouch_noted] id = 12062 @@ -357,6 +384,7 @@ weight = 0.02 examine = "I can summon a spirit kalphite familiar with this." summon_experience = 2.5 infuse_experience = 220.0 +summon_points = 3 [spirit_kalphite_pouch_noted] id = 12064 @@ -369,6 +397,7 @@ weight = 0.02 examine = "I can summon a honey badger familiar with this." summon_experience = 1.6 infuse_experience = 140.8 +summon_points = 4 [honey_badger_pouch_noted] id = 12066 @@ -381,6 +410,7 @@ weight = 0.02 examine = "I can summon an albino rat familiar with this." summon_experience = 2.3 infuse_experience = 202.4 +summon_points = 3 [albino_rat_pouch_noted] id = 12068 @@ -393,6 +423,7 @@ weight = 0.02 examine = "I can summon a granite lobster familiar with this." summon_experience = 3.7 infuse_experience = 325.6 +summon_points = 8 [granite_lobster_pouch_noted] id = 12070 @@ -405,6 +436,7 @@ weight = 0.02 examine = "I can summon a macaw familiar with this." summon_experience = 0.8 infuse_experience = 72.4 +summon_points = 5 [macaw_pouch_noted] id = 12072 @@ -417,6 +449,7 @@ weight = 0.02 examine = "Summons a level 43 combat familiar." summon_experience = 3.6 infuse_experience = 316.8 +summon_points = 9 [bronze_minotaur_pouch_noted] id = 12074 @@ -429,6 +462,7 @@ weight = 0.02 examine = "I can summon an iron minotaur familiar with this." summon_experience = 4.6 infuse_experience = 404.8 +summon_points = 9 [iron_minotaur_pouch_noted] id = 12076 @@ -441,6 +475,7 @@ weight = 0.02 examine = "I can summon a steel minotaur familiar with this." summon_experience = 1.1 infuse_experience = 492.8 +summon_points = 9 [steel_minotaur_pouch_noted] id = 12078 @@ -453,6 +488,7 @@ weight = 0.02 examine = "I can summon a mithril minotaur with this." summon_experience = 1.0 infuse_experience = 580.8 +summon_points = 9 [mithril_minotaur_pouch_noted] id = 12080 @@ -465,6 +501,7 @@ weight = 0.02 examine = "I can summon an adamant minotaur familiar with this." summon_experience = 1.5 infuse_experience = 668.8 +summon_points = 9 [adamant_minotaur_pouch_noted] id = 12082 @@ -477,6 +514,7 @@ weight = 0.02 examine = "I can summon a rune minotaur with this." summon_experience = 8.6 infuse_experience = 756.8 +summon_points = 9 [rune_minotaur_pouch_noted] id = 12084 @@ -489,6 +527,7 @@ weight = 0.02 examine = "I can summon a smoke devil familiar with this." summon_experience = 3.0 infuse_experience = 268.0 +summon_points = 7 [smoke_devil_pouch_noted] id = 12086 @@ -501,6 +540,7 @@ weight = 0.02 examine = "I can summon a bull ant familiar with this." summon_experience = 0.6 infuse_experience = 52.8 +summon_points = 5 [bull_ant_pouch_noted] id = 12088 @@ -513,6 +553,7 @@ weight = 0.02 examine = "I can summon a wolpertinger familiar with this." summon_experience = 4.5 infuse_experience = 404.8 +summon_points = 10 [wolpertinger_pouch_noted] id = 12090 @@ -525,6 +566,7 @@ weight = 0.02 examine = "I can summon a compost mound familiar with this." summon_experience = 0.6 infuse_experience = 49.8 +summon_points = 6 [compost_mound_pouch_noted] id = 12092 @@ -537,6 +579,7 @@ weight = 0.02 examine = "I can summon a pack yak familiar with this." summon_experience = 4.8 infuse_experience = 422.4 +summon_points = 10 [pack_yak_pouch_noted] id = 12094 @@ -549,6 +592,7 @@ weight = 0.02 examine = "I can summon a spirit cockatrice familiar with this." summon_experience = 0.9 infuse_experience = 75.2 +summon_points = 5 [spirit_cockatrice_pouch_noted] id = 12096 @@ -561,6 +605,7 @@ weight = 0.02 examine = "I can summon a spirit guthatrice familiar with this." summon_experience = 0.9 infuse_experience = 75.2 +summon_points = 5 [spirit_guthatrice_pouch_noted] id = 12098 @@ -573,6 +618,7 @@ weight = 0.02 examine = "I can summon a spirit saratrice familiar with this." summon_experience = 0.9 infuse_experience = 75.2 +summon_points = 5 [spirit_saratrice_pouch_noted] id = 12100 @@ -585,6 +631,7 @@ weight = 0.02 examine = "I can summon a spirit zamatrice familiar with this." summon_experience = 0.9 infuse_experience = 75.2 +summon_points = 5 [spirit_zamatrice_pouch_noted] id = 12102 @@ -597,6 +644,7 @@ weight = 0.02 examine = "I can summon a spirit pengatrice familiar with this." summon_experience = 0.9 infuse_experience = 75.2 +summon_points = 5 [spirit_pengatrice_pouch_noted] id = 12104 @@ -609,6 +657,7 @@ weight = 0.02 examine = "I can summon a spirit coraxatrice familiar with this." summon_experience = 0.9 infuse_experience = 75.2 +summon_points = 5 [spirit_coraxatrice_pouch_noted] id = 12106 @@ -621,6 +670,7 @@ weight = 0.02 examine = "I can summon a spirit vulatrice familiar with this." summon_experience = 0.9 infuse_experience = 75.2 +summon_points = 5 [spirit_vulatrice_pouch_noted] id = 12108 @@ -703,6 +753,7 @@ weight = 0.02 examine = "I can summon a barker toad familiar with this." summon_experience = 6.6 infuse_experience = 87.0 +summon_points = 7 [barker_toad_pouch_noted] id = 12124 @@ -2346,7 +2397,7 @@ limit = 5000 examine = "A scroll for a desert wyrm familiar." transform_experience = 0.4 use_experience = 0.4 -special_points = 6 +special_points = 6 [bronze_bull_rush_scroll] id = 12461 @@ -2839,6 +2890,7 @@ weight = 0.02 examine = "I can summon an ibis familiar with this." summon_experience = 5.6 infuse_experience = 98.8 +summon_points = 6 [ibis_pouch_noted] id = 12532 @@ -3849,6 +3901,7 @@ weight = 0.02 examine = "I can summon a swamp titan familiar with this." summon_experience = 4.2 infuse_experience = 373.6 +summon_points = 9 [swamp_titan_pouch_noted] id = 12777 @@ -3861,6 +3914,7 @@ weight = 0.02 examine = "I can summon a spirit mosquito familiar with this." summon_experience = 0.5 infuse_experience = 46.5 +summon_points = 2 [spirit_mosquito_pouch_noted] id = 12779 @@ -3873,6 +3927,7 @@ weight = 0.02 examine = "I can summon a void spinner familiar with this." summon_experience = 0.7 infuse_experience = 59.6 +summon_points = 4 [void_spinner_pouch_noted] id = 12781 @@ -3885,6 +3940,7 @@ weight = 0.02 examine = "I can summon a forge regent familiar with this." summon_experience = 7.6 infuse_experience = 134.0 +summon_points = 9 [forge_regent_pouch_noted] id = 12783 @@ -3897,6 +3953,7 @@ weight = 0.02 examine = "I can summon a spirit larupia familiar with this." summon_experience = 5.7 infuse_experience = 501.6 +summon_points = 6 [spirit_larupia_pouch_noted] id = 12785 @@ -3909,6 +3966,7 @@ weight = 0.02 examine = "I can summon a geyser titan familiar with this." summon_experience = 8.9 infuse_experience = 783.2 +summon_points = 10 [geyser_titan_pouch_noted] id = 12787 @@ -3921,6 +3979,7 @@ weight = 0.02 examine = "I can summon a lava titan familiar with this." summon_experience = 8.3 infuse_experience = 730.4 +summon_points = 9 [lava_titan_pouch_noted] id = 12789 @@ -3933,6 +3992,7 @@ weight = 0.02 examine = "I can summon a steel titan familiar with this." summon_experience = 4.9 infuse_experience = 435.2 +summon_points = 10 [steel_titan_pouch_noted] id = 12791 @@ -3945,6 +4005,7 @@ weight = 0.02 examine = "I can summon an obsidian golem familiar with this." summon_experience = 7.3 infuse_experience = 642.4 +summon_points = 8 [obsidian_golem_pouch_noted] id = 12793 @@ -3957,6 +4018,7 @@ weight = 0.02 examine = "I can summon a talon beast familiar with this." summon_experience = 3.9 infuse_experience = 1015.2 +summon_points = 9 [talon_beast_pouch_noted] id = 12795 @@ -3969,6 +4031,7 @@ weight = 0.02 examine = "I can summon an abyssal titan familiar with this." summon_experience = 1.9 infuse_experience = 163.2 +summon_points = 10 [abyssal_titan_pouch_noted] id = 12797 @@ -3981,6 +4044,7 @@ weight = 0.02 examine = "I can summon a void torcher familiar with this." summon_experience = 0.7 infuse_experience = 59.6 +summon_points = 4 [void_torcher_pouch_noted] id = 12799 @@ -3993,6 +4057,7 @@ weight = 0.02 examine = "I can summon a giant chinchompa familiar with this." summon_experience = 2.9 infuse_experience = 225.2 +summon_points = 1 [giant_chinchompa_pouch_noted] id = 12801 @@ -4005,6 +4070,7 @@ weight = 0.02 examine = "I can summon a fire titan familiar with this." summon_experience = 7.9 infuse_experience = 695.2 +summon_points = 9 [fire_titan_pouch_noted] id = 12803 @@ -4017,6 +4083,7 @@ weight = 0.02 examine = "I can summon a moss titan familiar with this." summon_experience = 7.9 infuse_experience = 695.2 +summon_points = 9 [moss_titan_pouch_noted] id = 12805 @@ -4029,6 +4096,7 @@ weight = 0.02 examine = "I can summon an ice titan familiar with this." summon_experience = 7.9 infuse_experience = 695.2 +summon_points = 9 [ice_titan_pouch_noted] id = 12807 @@ -4041,6 +4109,7 @@ weight = 0.02 examine = "I can summon a spirit Tz-Kih familiar with this." summon_experience = 1.1 infuse_experience = 96.8 +summon_points = 3 [spirit_tz_kih_pouch_noted] id = 12809 @@ -4053,6 +4122,7 @@ weight = 0.02 examine = "I can summon a spirit graahk familiar with this." summon_experience = 5.7 infuse_experience = 501.6 +summon_points = 6 [spirit_graahk_pouch_noted] id = 12811 @@ -4065,6 +4135,7 @@ weight = 0.02 examine = "I can summon a spirit kyatt familiar with this." summon_experience = 5.7 infuse_experience = 501.6 +summon_points = 6 [spirit_kyatt_pouch_noted] id = 12813 @@ -4077,6 +4148,7 @@ weight = 0.02 examine = "I can summon a void shifter familiar with this." summon_experience = 0.7 infuse_experience = 59.6 +summon_points = 4 [void_shifter_pouch_noted] id = 12815 @@ -4089,6 +4161,7 @@ weight = 0.02 examine = "I can summon a pyrelord familiar with this." summon_experience = 2.3 infuse_experience = 202.4 +summon_points = 5 [pyrelord_pouch_noted] id = 12817 @@ -4101,6 +4174,7 @@ weight = 0.02 examine = "I can summon a void ravager familiar with this." summon_experience = 0.7 infuse_experience = 59.6 +summon_points = 4 [void_ravager_pouch_noted] id = 12819 @@ -4113,6 +4187,7 @@ weight = 0.02 examine = "I can summon a ravenous locust familiar with this." summon_experience = 1.5 infuse_experience = 132.0 +summon_points = 4 [ravenous_locust_pouch_noted] id = 12821 @@ -4125,6 +4200,7 @@ weight = 0.02 examine = "I can summon an iron titan familiar with this." summon_experience = 4.7 infuse_experience = 417.6 +summon_points = 10 [iron_titan_pouch_noted] id = 12823 @@ -4315,6 +4391,7 @@ weight = 0.02 examine = "I can summon a phoenix familiar with this." summon_experience = 1.1 infuse_experience = 301.0 +summon_points = 8 [phoenix_pouch_noted] id = 14624 @@ -4387,6 +4464,7 @@ price = 1698 limit = 100 weight = 0.02 examine = "I can summon meerkat familiars with this." +summon_points = 1 [meerkats_pouch_noted] id = 19623 diff --git a/data/skill/summoning/summoning.npcs.toml b/data/skill/summoning/summoning.npcs.toml new file mode 100644 index 0000000000..ca1b0e6081 --- /dev/null +++ b/data/skill/summoning/summoning.npcs.toml @@ -0,0 +1,432 @@ +[spirit_terrorbird_familiar] +id = 6794 + +[granite_crab_familiar] +id = 6796 + +[praying_mantis_familiar] +id = 6798 + +[giant_ent_familiar] +id = 6800 + +[spirit_cobra_familiar] +id = 6802 + +[spirit_dagannoth_familiar] +id = 6804 + +[thorny_snail_familiar] +id = 6806 + +[beaver_familiar] +id = 6808 + +[karamthulhu_overlord_familiar] +id = 6809 + +[hydra_familiar] +id = 6811 + +[spirit_jelly_familiar] +id = 6992 + +[bunyip_familiar] +id = 6813 + +[war_tortoise_familiar] +id = 6815 + +[fruit_bat_familiar] +id = 6817 + +[abyssal_parasite_familiar] +id = 6818 + +[abyssal_lurker_familiar] +id = 6820 + +[unicorn_stallion_familiar] +id = 6822 + +[magpie_familiar] +id = 6824 + +[dreadfowl_familiar] +id = 6825 + +[stranger_plant_familiar] +id = 6827 + +[spirit_wolf_familiar] +id = 6829 + +[desert_wyrm_familiar] +id = 6831 + +[evil_turnip_familiar] +id = 6833 + +[vampire_bat_familiar] +id = 6835 + +[spirit_scorpion_familiar] +id = 6837 + +[arctic_bear_familiar] +id = 6839 + +[spirit_spider_familiar] +id = 6841 + +[bloated_leech_familiar] +id = 6843 + +[spirit_kalphite_familiar] +id = 6994 + +[honey_badger_familiar] +id = 6845 + +[albino_rat_familiar] +id = 6847 + +[granite_lobster_familiar] +id = 6849 + +[macaw_familiar] +id = 6851 + +[bronze_minotaur_familiar] +id = 6853 + +[iron_minotaur_familiar] +id = 6855 + +[steel_minotaur_familiar] +id = 6857 + +[mithril_minotaur_familiar] +id = 6859 + +[adamant_minotaur_familiar] +id = 6861 + +[rune_minotaur_familiar] +id = 6863 + +[smoke_devil_familiar] +id = 6865 + +[bull_ant_familiar] +id = 6867 + +[wolpertinger_familiar] +id = 6869 + +[compost_mound_familiar] +id = 6871 + +[pack_yak_familiar] +id = 6873 + +[spirit_cockatrice_familiar] +id = 6875 + +[spirit_guthatrice_familiar] +id = 6877 + +[spirit_saratrice_familiar] +id = 6879 + +[spirit_zamatrice_familiar] +id = 6881 + +[spirit_pengatrice_familiar] +id = 6883 + +[spirit_coraxatrice_familiar] +id = 6885 + +[spirit_vulatrice_familiar] +id = 6887 + +[barker_toad_familiar] +id = 6889 + +[ibis_familiar] +id = 6991 + +[swamp_titan_familiar] +id = 7329 + +[spirit_mosquito_familiar] +id = 7331 + +[void_spinner_familiar] +id = 7333 + +[forge_regent_familiar] +id = 7335 + +[spirit_larupia_familiar] +id = 7337 + +[geyser_titan_familiar] +id = 7339 + +[lava_titan_familiar] +id = 7341 + +[steel_titan_familiar] +id = 7343 + +[obsidian_golem_familiar] +id = 7345 + +[talon_beast_familiar] +id = 7347 + +[abyssal_titan_familiar] +id = 7349 + +[void_torcher_familiar] +id = 7351 + +[giant_chinchompa_familiar] +id = 7353 + +[fire_titan_familiar] +id = 7355 + +[moss_titan_familiar] +id = 7357 + +[ice_titan_familiar] +id = 7359 + +[spirit_tz-kih_familiar] +id = 7361 + +[spirit_graahk_familiar] +id = 7363 + +[spirit_kyatt_familiar] +id = 7365 + +[void_shifter_familiar] +id = 7367 + +[pyrelord_familiar] +id = 7377 + +[void_ravager_familiar] +id = 7370 + +[ravenous_locust_familiar] +id = 7372 + +[iron_titan_familiar] +id = 7375 + +[clay_familiar_class_1_familiar] +id = 8240 + +[clay_familiar_class_2_familiar] +id = 8242 + +[clay_familiar_class_3_familiar] +id = 8244 + +[clay_familiar_class_4_familiar] +id = 8246 + +[clay_familiar_class_5_familiar] +id = 8248 + +[phoenix_familiar] +id = 8575 + +[cub_bloodrager_familiar] +id = 11106 + +[little_bloodrager_familiar] +id = 11108 + +[naïve_bloodrager_familiar] +id = 11110 + +[keen_bloodrager_familiar] +id = 11112 + +[brave_bloodrager_familiar] +id = 11114 + +[brah_bloodrager_familiar] +id = 11116 + +[naabe_bloodrager_familiar] +id = 11118 + +[wise_bloodrager_familiar] +id = 11120 + +[adept_bloodrager_familiar] +id = 11122 + +[sachem_bloodrager_familiar] +id = 11124 + +[cub_stormbringer_familiar] +id = 11126 + +[little_stormbringer_familiar] +id = 11128 + +[naïve_stormbringer_familiar] +id = 11130 + +[keen_stormbringer_familiar] +id = 11132 + +[brave_stormbringer_familiar] +id = 11134 + +[brah_stormbringer_familiar] +id = 11136 + +[naabe_stormbringer_familiar] +id = 11138 + +[wise_stormbringer_familiar] +id = 11140 + +[adept_stormbringer_familiar] +id = 11142 + +[sachem_stormbringer_familiar] +id = 11144 + +[cub_hoardstalker_familiar] +id = 11146 + +[little_hoardstalker_familiar] +id = 11148 + +[naïve_hoardstalker_familiar] +id = 11150 + +[keen_hoardstalker_familiar] +id = 11152 + +[brave_hoardstalker_familiar] +id = 11154 + +[brah_hoardstalker_familiar] +id = 11156 + +[naabe_hoardstalker_familiar] +id = 11158 + +[wise_hoardstalker_familiar] +id = 11160 + +[adept_hoardstalker_familiar] +id = 11162 + +[sachem_hoardstalker_familiar] +id = 11164 + +[cub_skinweaver_familiar] +id = 11166 + +[little_skinweaver_familiar] +id = 11168 + +[naïve_skinweaver_familiar] +id = 11170 + +[keen_skinweaver_familiar] +id = 11172 + +[brave_skinweaver_familiar] +id = 11174 + +[brah_skinweaver_familiar] +id = 11176 + +[naabe_skinweaver_familiar] +id = 11178 + +[wise_skinweaver_familiar] +id = 11180 + +[adept_skinweaver_familiar] +id = 11182 + +[sachem_skinweaver_familiar] +id = 11184 + +[cub_worldbearer_familiar] +id = 11186 + +[little_worldbearer_familiar] +id = 11188 + +[naïve_worldbearer_familiar] +id = 11190 + +[keen_worldbearer_familiar] +id = 11192 + +[brave_worldbearer_familiar] +id = 11194 + +[brah_worldbearer_familiar] +id = 11196 + +[naabe_worldbearer_familiar] +id = 11198 + +[wise_worldbearer_familiar] +id = 11200 + +[adept_worldbearer_familiar] +id = 11202 + +[sachem_worldbearer_familiar] +id = 11204 + +[cub_deathslinger_familiar] +id = 11206 + +[little_deathslinger_familiar] +id = 11208 + +[naive_deathslinger_familiar] +id = 11210 + +[keen_deathslinger_familiar] +id = 11212 + +[brave_deathslinger_familiar] +id = 11214 + +[brah_deathslinger_familiar] +id = 11216 + +[naabe_deathslinger_familiar] +id = 11218 + +[wise_deathslinger_familiar] +id = 11220 + +[adept_deathslinger_familiar] +id = 11222 + +[sachem_deathslinger_familiar] +id = 11224 + +[meerkats_familiar] +id = 11640 +familiar_time = 40 \ No newline at end of file diff --git a/data/skill/summoning/summoning.varbits.toml b/data/skill/summoning/summoning.varbits.toml new file mode 100644 index 0000000000..06c21866e3 --- /dev/null +++ b/data/skill/summoning/summoning.varbits.toml @@ -0,0 +1,102 @@ +# 1043 - 1048 hold numbers representing a string. First character will always be capitalized +# Characters are space as 0 and A-Z as 1-26 +[pet_name_char_1] +id = 1043 + +[pet_name_char_2] +id = 1044 + +[pet_name_char_3] +id = 1045 + +[pet_name_char_4] +id = 1046 + +[pet_name_char_6] +id = 1047 + +[pet_name_char_7] +id = 1048 + +# Displays text from 1043 - 1048 in the pet's name space if set to 1 in the pet details interface (663) +[override_pet_name] +id = 1049 + +[show_summoning_orb] +id = 4280 +format = "boolean" +persist = true +default = true + +# TODO: Confirm animations for familiars above level 33 +# Others were confirmed from this video: https://www.youtube.com/watch?v=R8voU8lsXoY +[follower_details_chathead_animation] +id = 4282 +format = "int" +persist = true +#values = { +# # Confirmed +# dreadfowl = 2, +# granite_crab = 3, +# vampire_bat = 4, +# giant_chinchompa = 4, +# beaver = 4, +# spirit_spider = 6, +# spirit_scorpion = 6, +# spirit_wolf = 7, +# desert_wyrm = 7, +# albino_rat = 7, +# honey_badger = 7, +# thorny_snail = 12, +# hydra = 19, +# compost_mound = 20, +# spirit_mosquito = 31, +# spirit_tz_kih = 32, +# meerkats = 38 +# +# # Unconfirmed +# void_torcher = 4, +# spirit_kalphite = 6, +# minotaur = 7, +# bull_ant = 9, +# void_ravager = 13, +# void_spinner = 29, +# void_shifter = 30, +#} + +[pet_details_growth_percentage] +id = 4285 +format = "int" +persist = true + +[pet_details_hunger_percentage] +id = 4286 +format = "int" +persist = true + +# Changes the mouseover info for the cast button in inter 662 (pet_details) +# E.g. "Level 1: Howl (-->#<-- Special Move points)" +[summoning_special_points_needed] +id = 4288 +format = "int" +persist = true + +[familiar_details_seconds_remaining] +id = 4290 +format = "int" +persist = true + +[familiar_details_minutes_remaining] +id = 4534 +format = "int" +persist = true + +[summoning_orb_left_click_option] +id = 6454 +format = "int" +persist = true + +[summoning_menu_left_click_option] +id = 6455 +format = "int" +persist = true \ No newline at end of file diff --git a/data/skill/summoning/summoning.varps.toml b/data/skill/summoning/summoning.varps.toml new file mode 100644 index 0000000000..71a3d96fcc --- /dev/null +++ b/data/skill/summoning/summoning.varps.toml @@ -0,0 +1,16 @@ +# Value is the pouch id of the summed familiar +[follower_details_name] +id = 448 +format = "int" +persist = true + +# Value is the NPC id of the summoned familiar +[follower_details_chathead] +id = 1174 +format = "int" +persist = true + +[summoning_special_points_remaining] +id = 1177 +format = "int" +persist = true \ No newline at end of file diff --git a/engine/src/main/kotlin/world/gregs/voidps/engine/entity/character/mode/Follow.kt b/engine/src/main/kotlin/world/gregs/voidps/engine/entity/character/mode/Follow.kt index c562d1b29d..158fcac3e9 100644 --- a/engine/src/main/kotlin/world/gregs/voidps/engine/entity/character/mode/Follow.kt +++ b/engine/src/main/kotlin/world/gregs/voidps/engine/entity/character/mode/Follow.kt @@ -32,6 +32,7 @@ class Follow( } if (character is NPC && character.tile.distanceTo(target) > 15) { character.tele(strategy.tile, clearMode = false) + character.clearWatch() } if (!smart) { character.steps.clearDestination() diff --git a/engine/src/main/kotlin/world/gregs/voidps/engine/entity/character/player/Player.kt b/engine/src/main/kotlin/world/gregs/voidps/engine/entity/character/player/Player.kt index af834e9ae7..28996a82fa 100644 --- a/engine/src/main/kotlin/world/gregs/voidps/engine/entity/character/player/Player.kt +++ b/engine/src/main/kotlin/world/gregs/voidps/engine/entity/character/player/Player.kt @@ -16,10 +16,13 @@ import world.gregs.voidps.engine.entity.character.Character import world.gregs.voidps.engine.entity.character.mode.EmptyMode import world.gregs.voidps.engine.entity.character.mode.Mode import world.gregs.voidps.engine.entity.character.mode.move.Steps +import world.gregs.voidps.engine.entity.character.npc.NPC +import world.gregs.voidps.engine.entity.character.npc.NPCs import world.gregs.voidps.engine.entity.character.player.chat.clan.ClanRank import world.gregs.voidps.engine.entity.character.player.equip.BodyParts import world.gregs.voidps.engine.entity.character.player.skill.exp.Experience import world.gregs.voidps.engine.entity.character.player.skill.level.Levels +import world.gregs.voidps.engine.get import world.gregs.voidps.engine.inv.Inventories import world.gregs.voidps.engine.queue.ActionQueue import world.gregs.voidps.engine.suspend.DialogueSuspension diff --git a/game/src/main/kotlin/content/skill/summoning/Summoning.kt b/game/src/main/kotlin/content/skill/summoning/Summoning.kt index c60f0778cf..29e6af2870 100644 --- a/game/src/main/kotlin/content/skill/summoning/Summoning.kt +++ b/game/src/main/kotlin/content/skill/summoning/Summoning.kt @@ -1,7 +1,245 @@ package content.skill.summoning +import content.entity.player.dialogue.type.choice +import world.gregs.voidps.cache.definition.data.NPCDefinition +import world.gregs.voidps.engine.Script +import world.gregs.voidps.engine.client.message +import world.gregs.voidps.engine.client.sendScript +import world.gregs.voidps.engine.data.definition.EnumDefinitions +import world.gregs.voidps.engine.data.definition.ItemDefinitions +import world.gregs.voidps.engine.data.definition.NPCDefinitions import world.gregs.voidps.engine.entity.character.Character +import world.gregs.voidps.engine.entity.character.mode.Follow +import world.gregs.voidps.engine.entity.character.move.tele import world.gregs.voidps.engine.entity.character.npc.NPC +import world.gregs.voidps.engine.entity.character.npc.NPCs +import world.gregs.voidps.engine.entity.character.player.Player +import world.gregs.voidps.engine.entity.character.player.skill.Skill +import world.gregs.voidps.engine.entity.item.Item +import world.gregs.voidps.engine.inject +import world.gregs.voidps.engine.inv.inventory +import world.gregs.voidps.engine.inv.remove +import world.gregs.voidps.engine.queue.softQueue + +val itemDefinitions: ItemDefinitions by inject() +val npcs: NPCs by inject() +val enums: EnumDefinitions by inject() val Character?.isFamiliar: Boolean get() = this != null && this is NPC && id.endsWith("_familiar") + +var Player.follower: NPC? + get() { + val index = get("follower_index", -1) + return world.gregs.voidps.engine.get().indexed(index) + } + set(value) { + if (value != null) { + set("follower_index", value.index) + set("follower_id", value.id) + } + } + +/** + * Summons the given familiar if the player doesn't already have a follower + * + * @param familiar: The [NPCDefinition] of the familiar being summoned + * @param restart: A boolean used to tell if this familiar is being summoned at log in. If set to false will start a new + * familiar timer + */ +fun Player.summonFamiliar(familiar: NPCDefinition, restart: Boolean): NPC? { + if (follower != null) { + // TODO: Find actual message for this + message("You must dismiss your current follower before summoning another.") + return null + } + + val familiarNpc = npcs.add(familiar.stringId, tile) + familiarNpc.mode = Follow(familiarNpc, this) + + softQueue("summon_familiar", 2) { + follower = familiarNpc + + follower!!.gfx("summon_familiar_size_${follower!!.size}") + player.updateFamiliarInterface() + if (!restart) timers.start("familiar_timer") + } + + return familiarNpc +} + +/** + * Dismisses the familiar that is following the player and resets the summoning orb and varbits back to their default + * states. Also stops the familiar timer. + */ +fun Player.dismissFamiliar() { + npcs.remove(follower) + follower = null + interfaces.close("familiar_details") + sendScript("reset_summoning_orb") + + // Need to wait for the above sendScript to reach the client before resetting + // Cast option for previous familiar will not be cleared from summoning_orb right-click menu otherwise + softQueue("reset_familiar_vars", 1) { + player["follower_details_name"] = 0 + player["follower_details_chathead"] = 0 + player["familiar_details_minutes_remaining"] = 0 + player["familiar_details_seconds_remaining"] = 0 + } + timers.stop("familiar_timer") +} + +/** + * Updates the familiar interface (663) with the details of the player's current follower + */ +fun Player.updateFamiliarInterface() { + if (follower == null) return + + interfaces.open("familiar_details") + + set("follower_details_name", enums.get("summoning_familiar_ids").getKey(follower!!.def.id)) + set("follower_details_chathead", follower!!.def.id) + + set("follower_details_chathead_animation", 1) +} + +/** + * Opens the interface used to set the left-click option of the summoning orb on the minimap + */ +fun Player.openFollowerLeftClickOptions() { + interfaces.open("follower_left_click_options") +} + +/** + * Confirms the selected option in the follower_left_click_options interface and sets the var. + */ +fun Player.confirmFollowerLeftClickOptions() { + set("summoning_orb_left_click_option", get("summoning_menu_left_click_option", -1)) + interfaces.close("follower_left_click_options") +} + +/** + * Teleports the player's follower to their position + */ +fun Player.callFollower() { + follower!!.tele(steps.follow, clearMode = false) + follower!!.clearWatch() +} + +/** + * Resets the familiar back to its maximum remaining time based on the summoned familiar. Removes the pouch from the player's + * inventory and rewards xp. + */ +fun Player.renewFamiliar() { + val pouchId = enums.get("summoning_familiar_ids").getKey(follower!!.def.id) + val pouchItem = Item(itemDefinitions.get(pouchId).stringId) + + if (!inventory.contains(pouchItem.id)) { + // TODO: Find the actual message used here in 2011 + message("You don't have the required pouch to renew your familiar.") + return + } + + inventory.remove(pouchItem.id) + set("familiar_details_minutes_remaining", follower!!.def["summoning_time_minutes", 0]) + set("familiar_details_seconds_remaining", 0) + follower!!.gfx("summon_familiar_size_${follower!!.size}") +} + +class Summoning : Script { + + val enums: EnumDefinitions by inject() + val npcDefinitions: NPCDefinitions by inject() + + init { + itemOption("Summon", "*_pouch") { option -> + val familiarLevel = enums.get("summoning_pouch_levels").getInt(option.item.def.id) + val familiarId = enums.get("summoning_familiar_ids").getInt(option.item.def.id) + val summoningXp = option.item.def["summon_experience", 0.0] + val familiar = npcDefinitions.get(familiarId) + + if (levels.get(Skill.Summoning) < familiarLevel) { + // TODO: Get actual message + message("You don't have the level needed to summon that familiar...") + return@itemOption + } + + summonFamiliar(familiar, false) ?: return@itemOption + inventory.remove(option.item.id) + experience.add(Skill.Summoning, summoningXp) + } + + interfaceOption("Select left-click option", id = "summoning_orb:leftclick_options") { + openFollowerLeftClickOptions() + } + + interfaceOption("Select", id = "follower_left_click_options:*") { option -> + val component = option.component + val varbitValue = when { + component.startsWith("follower_details") -> 0 + component.startsWith("special_move") -> 1 + component.startsWith("attack") -> 2 + component.startsWith("call_follower") -> 3 + component.startsWith("dismiss_follower") -> 4 + component.startsWith("take_bob") -> 5 + component.startsWith("renew_familiar") -> 6 + else -> -1 + } + + set("summoning_menu_left_click_option", varbitValue) + } + + interfaceOption("Confirm Selection", "follower_left_click_options:confirm") { + confirmFollowerLeftClickOptions() + } + + interfaceOption("Dismiss", id = "summoning_orb:*dismiss_follower") { + dismissFamiliar() + } + + interfaceOption("Renew Familiar", id = "summoning_orb:*renew_familiar") { + renewFamiliar() + } + + interfaceOption("*", "familiar_details:dismiss") { option -> + when (option.option) { + "Dismiss Familiar" -> { + choice("Are you sure you want to dismiss your familiar?") { + option("Yes.") { + dismissFamiliar() + } + option("No.") + } + } + "Dismiss Now" -> dismissFamiliar() + } + } + + interfaceOption("Renew Familiar", "familiar_details:renew") { + renewFamiliar() + } + + interfaceOption("Call Follower", "*_details:call") { + callFollower() + } + + interfaceOption("Call Follower", "summoning_orb:*call_follower") { + callFollower() + } + + playerSpawn { + if (get("familiar_details_seconds_remaining", 0) == 0 && get("familiar_details_minutes_remaining", 0) == 0) { + return@playerSpawn + } + + val familiarDef = npcDefinitions.get(get("follower_details_chathead", -1)) + variables.send("follower_details_name") + variables.send("follower_details_chathead") + variables.send("familiar_details_minutes_remaining") + variables.send("familiar_details_seconds_remaining") + variables.send("follower_details_chathead_animation") + timers.restart("familiar_timer") + summonFamiliar(familiarDef, true) + } + } +} diff --git a/game/src/main/kotlin/content/skill/summoning/SummoningTimers.kt b/game/src/main/kotlin/content/skill/summoning/SummoningTimers.kt new file mode 100644 index 0000000000..63da78c15c --- /dev/null +++ b/game/src/main/kotlin/content/skill/summoning/SummoningTimers.kt @@ -0,0 +1,47 @@ +package content.skill.summoning + +import world.gregs.voidps.engine.Script +import world.gregs.voidps.engine.timer.Timer +import world.gregs.voidps.engine.timer.toTicks +import java.util.concurrent.TimeUnit + +class SummoningTimers : Script { + + init { + timerStart("familiar_timer") { restart -> + + if(!restart) { + set("familiar_details_minutes_remaining", follower!!.def["summoning_time_minutes", 0]) + set("familiar_details_seconds_remaining", 0) + } + + return@timerStart TimeUnit.SECONDS.toTicks(30) + } + + timerTick("familiar_timer") { + if (get("familiar_details_seconds_remaining", 0) == 0) { + dec("familiar_details_minutes_remaining") + } + set("familiar_details_seconds_remaining", (get("familiar_details_seconds_remaining", 0) + 1) % 2) + + if (get("familiar_details_seconds_remaining", 0) <= 0 && get("familiar_details_minutes_remaining", 0) <= 0) { + return@timerTick Timer.CANCEL + } + + return@timerTick Timer.CONTINUE + } + + timerStop("familiar_timer") { logout -> + if (logout) { + npcs.remove(follower) + return@timerStop + } + + if (follower != null) { + dismissFamiliar() + } + } + + } + +}