From d2a37237526bdb85896a5477f49072347b2bc2e3 Mon Sep 17 00:00:00 2001 From: Sebastian Nobbelin Date: Sat, 16 Dec 2023 21:58:24 +0100 Subject: [PATCH 1/4] fixed: speed change issues --- data-canary/monster/demons/fury.lua | 2 +- data-canary/monster/magicals/guzzlemaw.lua | 2 +- data-otservbr-global/monster/bosses/the_abomination.lua | 2 +- data-otservbr-global/monster/bosses/the_collector.lua | 2 +- data-otservbr-global/monster/constructs/ice_golem.lua | 2 +- data-otservbr-global/monster/constructs/infected_weeper.lua | 2 +- data-otservbr-global/monster/constructs/lava_golem.lua | 2 +- data-otservbr-global/monster/constructs/magma_crawler.lua | 2 +- data-otservbr-global/monster/constructs/orewalker.lua | 2 +- data-otservbr-global/monster/constructs/weeper.lua | 2 +- data-otservbr-global/monster/demons/dawnfire_asura.lua | 2 +- data-otservbr-global/monster/demons/fury.lua | 2 +- data-otservbr-global/monster/demons/midnight_asura.lua | 2 +- data-otservbr-global/monster/demons/plaguesmith.lua | 2 +- data-otservbr-global/monster/dragons/ghastly_dragon.lua | 2 +- data-otservbr-global/monster/elementals/ironblight.lua | 2 +- data-otservbr-global/monster/humanoids/dworc_voodoomaster.lua | 2 +- data-otservbr-global/monster/humanoids/lost_berserker.lua | 2 +- data-otservbr-global/monster/magicals/choking_fear.lua | 2 +- data-otservbr-global/monster/magicals/guzzlemaw.lua | 2 +- data-otservbr-global/monster/magicals/shock_head.lua | 2 +- data-otservbr-global/monster/plants/carniphila.lua | 2 +- data-otservbr-global/monster/quests/ancient_tombs/thalas.lua | 2 +- .../monster/quests/cults_of_tibia/animated_guzzlemaw.lua | 2 +- .../monster/quests/cults_of_tibia/bosses/essence_of_malice.lua | 2 +- .../monster/quests/forgotten_knowledge/thorn_minion.lua | 2 +- .../monster/quests/pits_of_inferno/the_plasmother.lua | 2 +- .../monster/quests/the_dream_courts/lucifuga_aranea.lua | 2 +- .../monster/quests/the_elemental_spheres/ice_overlord.lua | 2 +- .../the_secret_library/bosses/the_scourge_of_oblivion.lua | 2 +- data-otservbr-global/monster/undeads/lost_soul.lua | 2 +- data-otservbr-global/monster/vermins/crystal_spider.lua | 2 +- 32 files changed, 32 insertions(+), 32 deletions(-) diff --git a/data-canary/monster/demons/fury.lua b/data-canary/monster/demons/fury.lua index f12b4ba628f..7c1946d7991 100644 --- a/data-canary/monster/demons/fury.lua +++ b/data-canary/monster/demons/fury.lua @@ -108,7 +108,7 @@ monster.attacks = { -- {name ="fury skill reducer", interval = 2000, chance = 5, target = false}, { name = "combat", interval = 2000, chance = 10, type = COMBAT_LIFEDRAIN, minDamage = -120, maxDamage = -300, radius = 3, effect = CONST_ME_HITAREA, target = false }, { name = "combat", interval = 2000, chance = 10, type = COMBAT_DEATHDAMAGE, minDamage = -125, maxDamage = -250, range = 7, shootEffect = CONST_ANI_SUDDENDEATH, effect = CONST_ME_SMALLCLOUDS, target = false }, - { name = "speed", interval = 2000, chance = 15, speedChange = -800, range = 7, shootEffect = CONST_ANI_SUDDENDEATH, effect = CONST_ME_SMALLCLOUDS, target = false, duration = 30000 }, + { name = "speed", interval = 2000, chance = 15, speedChange = -100, range = 7, shootEffect = CONST_ANI_SUDDENDEATH, effect = CONST_ME_SMALLCLOUDS, target = false, duration = 30000 }, } monster.defenses = { diff --git a/data-canary/monster/magicals/guzzlemaw.lua b/data-canary/monster/magicals/guzzlemaw.lua index 8d3902203d1..8e38d459779 100644 --- a/data-canary/monster/magicals/guzzlemaw.lua +++ b/data-canary/monster/magicals/guzzlemaw.lua @@ -114,7 +114,7 @@ monster.attacks = { { name = "condition", type = CONDITION_BLEEDING, interval = 2000, chance = 10, minDamage = -500, maxDamage = -1000, radius = 3, target = false }, { name = "combat", interval = 2000, chance = 10, type = COMBAT_PHYSICALDAMAGE, minDamage = 0, maxDamage = -900, length = 8, spread = 3, effect = CONST_ME_EXPLOSIONAREA, target = false }, { name = "combat", interval = 2000, chance = 20, type = COMBAT_PHYSICALDAMAGE, minDamage = 0, maxDamage = -500, radius = 2, shootEffect = CONST_ANI_LARGEROCK, effect = CONST_ME_STONES, target = true }, - { name = "speed", interval = 2000, chance = 15, speedChange = -800, radius = 6, effect = CONST_ME_MAGIC_RED, target = false, duration = 15000 }, + { name = "speed", interval = 2000, chance = 15, speedChange = -100, radius = 6, effect = CONST_ME_MAGIC_RED, target = false, duration = 15000 }, { name = "combat", interval = 2000, chance = 10, type = COMBAT_LIFEDRAIN, minDamage = 0, maxDamage = -800, length = 8, spread = 3, effect = CONST_ME_MAGIC_RED, target = false }, } diff --git a/data-otservbr-global/monster/bosses/the_abomination.lua b/data-otservbr-global/monster/bosses/the_abomination.lua index e6ba0b1ae06..5d0c02c4b14 100644 --- a/data-otservbr-global/monster/bosses/the_abomination.lua +++ b/data-otservbr-global/monster/bosses/the_abomination.lua @@ -92,7 +92,7 @@ monster.loot = { monster.attacks = { { name = "melee", interval = 2000, chance = 100, skill = 90, attack = 120 }, - { name = "speed", interval = 1000, chance = 12, speedChange = -800, radius = 6, effect = CONST_ME_POISONAREA, target = false, duration = 10000 }, + { name = "speed", interval = 1000, chance = 12, speedChange = -100, radius = 6, effect = CONST_ME_POISONAREA, target = false, duration = 10000 }, { name = "combat", interval = 1000, chance = 9, type = COMBAT_EARTHDAMAGE, minDamage = -200, maxDamage = -650, radius = 4, effect = CONST_ME_POISONAREA, target = false }, { name = "combat", interval = 1000, chance = 11, type = COMBAT_LIFEDRAIN, minDamage = -400, maxDamage = -900, radius = 4, shootEffect = CONST_ANI_POISON, effect = CONST_ME_SOUND_GREEN, target = true }, { name = "combat", interval = 2000, chance = 19, type = COMBAT_PHYSICALDAMAGE, minDamage = -350, maxDamage = -850, length = 7, spread = 0, shootEffect = CONST_ANI_POISON, effect = CONST_ME_HITBYPOISON, target = false }, diff --git a/data-otservbr-global/monster/bosses/the_collector.lua b/data-otservbr-global/monster/bosses/the_collector.lua index b3fa70f85c6..b63f6c8ace3 100644 --- a/data-otservbr-global/monster/bosses/the_collector.lua +++ b/data-otservbr-global/monster/bosses/the_collector.lua @@ -67,7 +67,7 @@ monster.loot = {} monster.attacks = { { name = "melee", interval = 2000, chance = 100, skill = 100, attack = 40 }, - { name = "speed", interval = 1000, chance = 13, speedChange = -800, length = 8, spread = 0, effect = CONST_ME_ENERGYHIT, target = false, duration = 20000 }, + { name = "speed", interval = 1000, chance = 13, speedChange = -100, length = 8, spread = 0, effect = CONST_ME_ENERGYHIT, target = false, duration = 20000 }, { name = "combat", interval = 1000, chance = 15, type = COMBAT_PHYSICALDAMAGE, minDamage = 0, maxDamage = -85, range = 7, shootEffect = CONST_ANI_LARGEROCK, target = false }, { name = "melee", interval = 2000, chance = 15, minDamage = -10, maxDamage = -80 }, } diff --git a/data-otservbr-global/monster/constructs/ice_golem.lua b/data-otservbr-global/monster/constructs/ice_golem.lua index e5c226bae5c..0ab245558c1 100644 --- a/data-otservbr-global/monster/constructs/ice_golem.lua +++ b/data-otservbr-global/monster/constructs/ice_golem.lua @@ -94,7 +94,7 @@ monster.loot = { monster.attacks = { { name = "melee", interval = 2000, chance = 100, minDamage = 0, maxDamage = -220 }, - { name = "speed", interval = 1000, chance = 13, speedChange = -800, length = 8, spread = 0, effect = CONST_ME_ENERGYHIT, target = false, duration = 20000 }, + { name = "speed", interval = 1000, chance = 13, speedChange = -100, length = 8, spread = 0, effect = CONST_ME_ENERGYHIT, target = false, duration = 20000 }, { name = "combat", interval = 1000, chance = 15, type = COMBAT_ICEDAMAGE, minDamage = -50, maxDamage = -85, range = 7, shootEffect = CONST_ANI_SMALLICE, effect = CONST_ME_ICEATTACK, target = false }, { name = "ice golem skill reducer", interval = 2000, chance = 10, target = false }, } diff --git a/data-otservbr-global/monster/constructs/infected_weeper.lua b/data-otservbr-global/monster/constructs/infected_weeper.lua index e302618f3eb..4bcccd5b9fa 100644 --- a/data-otservbr-global/monster/constructs/infected_weeper.lua +++ b/data-otservbr-global/monster/constructs/infected_weeper.lua @@ -91,7 +91,7 @@ monster.attacks = { { name = "melee", interval = 2000, chance = 100, minDamage = 0, maxDamage = -280 }, { name = "combat", interval = 2000, chance = 15, type = COMBAT_LIFEDRAIN, minDamage = -250, maxDamage = -700, length = 5, spread = 3, effect = CONST_ME_MAGIC_RED, target = false }, { name = "combat", interval = 2000, chance = 30, type = COMBAT_FIREDAMAGE, minDamage = -80, maxDamage = -250, radius = 3, effect = CONST_ME_HITBYFIRE, target = false }, - { name = "speed", interval = 2000, chance = 10, speedChange = -800, length = 5, spread = 3, effect = CONST_ME_BLOCKHIT, target = false, duration = 30000 }, + { name = "speed", interval = 2000, chance = 10, speedChange = -100, length = 5, spread = 3, effect = CONST_ME_BLOCKHIT, target = false, duration = 30000 }, } monster.defenses = { diff --git a/data-otservbr-global/monster/constructs/lava_golem.lua b/data-otservbr-global/monster/constructs/lava_golem.lua index aed9ad864c0..38db564d494 100644 --- a/data-otservbr-global/monster/constructs/lava_golem.lua +++ b/data-otservbr-global/monster/constructs/lava_golem.lua @@ -112,7 +112,7 @@ monster.attacks = { { name = "combat", interval = 2000, chance = 10, type = COMBAT_MANADRAIN, minDamage = -600, maxDamage = -1300, length = 8, spread = 3, effect = CONST_ME_MORTAREA, target = false }, { name = "lava golem soulfire", interval = 2000, chance = 15, target = false }, { name = "combat", interval = 2000, chance = 15, type = COMBAT_FIREDAMAGE, minDamage = -220, maxDamage = -350, radius = 4, effect = CONST_ME_FIREAREA, target = true }, - { name = "speed", interval = 2000, chance = 10, speedChange = -800, length = 5, spread = 3, effect = CONST_ME_BLOCKHIT, target = false, duration = 30000 }, + { name = "speed", interval = 2000, chance = 10, speedChange = -100, length = 5, spread = 3, effect = CONST_ME_BLOCKHIT, target = false, duration = 30000 }, { name = "combat", interval = 2000, chance = 30, type = COMBAT_FIREDAMAGE, minDamage = -280, maxDamage = -350, radius = 3, effect = CONST_ME_HITBYFIRE, target = false }, } diff --git a/data-otservbr-global/monster/constructs/magma_crawler.lua b/data-otservbr-global/monster/constructs/magma_crawler.lua index 39c58ab8838..84ad15af13b 100644 --- a/data-otservbr-global/monster/constructs/magma_crawler.lua +++ b/data-otservbr-global/monster/constructs/magma_crawler.lua @@ -111,7 +111,7 @@ monster.attacks = { { name = "magma crawler soulfire", interval = 2000, chance = 20, target = false }, { name = "soulfire rune", interval = 2000, chance = 10, target = false }, { name = "combat", interval = 2000, chance = 15, type = COMBAT_FIREDAMAGE, minDamage = -140, maxDamage = -180, radius = 3, effect = CONST_ME_HITBYFIRE, target = false }, - { name = "speed", interval = 2000, chance = 10, speedChange = -800, radius = 2, effect = CONST_ME_MAGIC_RED, target = false, duration = 20000 }, + { name = "speed", interval = 2000, chance = 10, speedChange = -100, radius = 2, effect = CONST_ME_MAGIC_RED, target = false, duration = 20000 }, } monster.defenses = { diff --git a/data-otservbr-global/monster/constructs/orewalker.lua b/data-otservbr-global/monster/constructs/orewalker.lua index 767b8a049ae..0ebf08181ff 100644 --- a/data-otservbr-global/monster/constructs/orewalker.lua +++ b/data-otservbr-global/monster/constructs/orewalker.lua @@ -113,7 +113,7 @@ monster.attacks = { -- poison { name = "condition", type = CONDITION_POISON, interval = 2000, chance = 10, minDamage = -800, maxDamage = -1080, radius = 3, shootEffect = CONST_ANI_SMALLEARTH, effect = CONST_ME_SMALLPLANTS, target = true }, { name = "drunk", interval = 2000, chance = 15, radius = 4, effect = CONST_ME_SOUND_PURPLE, target = false, duration = 6000 }, - { name = "speed", interval = 2000, chance = 15, speedChange = -800, radius = 2, effect = CONST_ME_MAGIC_RED, target = false, duration = 20000 }, + { name = "speed", interval = 2000, chance = 15, speedChange = -100, radius = 2, effect = CONST_ME_MAGIC_RED, target = false, duration = 20000 }, } monster.defenses = { diff --git a/data-otservbr-global/monster/constructs/weeper.lua b/data-otservbr-global/monster/constructs/weeper.lua index 75a8d7ebb42..63dfa572727 100644 --- a/data-otservbr-global/monster/constructs/weeper.lua +++ b/data-otservbr-global/monster/constructs/weeper.lua @@ -101,7 +101,7 @@ monster.attacks = { { name = "melee", interval = 2000, chance = 100, minDamage = 0, maxDamage = -450 }, { name = "combat", interval = 2000, chance = 15, type = COMBAT_FIREDAMAGE, minDamage = -400, maxDamage = -1000, length = 8, spread = 0, effect = CONST_ME_FIREATTACK, target = false }, { name = "combat", interval = 3000, chance = 100, type = COMBAT_FIREDAMAGE, minDamage = -80, maxDamage = -250, radius = 3, effect = CONST_ME_HITBYFIRE, target = false }, - { name = "speed", interval = 2000, chance = 10, speedChange = -800, length = 5, spread = 0, effect = CONST_ME_BLOCKHIT, target = false, duration = 30000 }, + { name = "speed", interval = 2000, chance = 10, speedChange = -100, length = 5, spread = 0, effect = CONST_ME_BLOCKHIT, target = false, duration = 30000 }, } monster.defenses = { diff --git a/data-otservbr-global/monster/demons/dawnfire_asura.lua b/data-otservbr-global/monster/demons/dawnfire_asura.lua index ac6fb0d5308..a3b50cfef84 100644 --- a/data-otservbr-global/monster/demons/dawnfire_asura.lua +++ b/data-otservbr-global/monster/demons/dawnfire_asura.lua @@ -110,7 +110,7 @@ monster.attacks = { { name = "combat", interval = 3700, chance = 17, type = COMBAT_LIFEDRAIN, minDamage = -100, maxDamage = -300, length = 8, spread = 0, effect = CONST_ME_PURPLEENERGY, target = false }, { name = "combat", interval = 3200, chance = 25, type = COMBAT_DEATHDAMAGE, minDamage = -100, maxDamage = -350, radius = 4, range = 5, target = true, effect = CONST_ME_MORTAREA }, { name = "combat", interval = 2700, chance = 20, type = COMBAT_FIREDAMAGE, minDamage = -95, maxDamage = -180, range = 3, shootEffect = CONST_ANI_FIRE, target = true }, - { name = "speed", interval = 2000, chance = 20, speedChange = -800, radius = 1, shootEffect = CONST_ANI_EXPLOSION, effect = CONST_ME_SLEEP, target = true, duration = 15000 }, + { name = "speed", interval = 2000, chance = 20, speedChange = -100, radius = 1, shootEffect = CONST_ANI_EXPLOSION, effect = CONST_ME_SLEEP, target = true, duration = 15000 }, } monster.defenses = { diff --git a/data-otservbr-global/monster/demons/fury.lua b/data-otservbr-global/monster/demons/fury.lua index cdaad15cf8f..cfa187717a8 100644 --- a/data-otservbr-global/monster/demons/fury.lua +++ b/data-otservbr-global/monster/demons/fury.lua @@ -107,7 +107,7 @@ monster.attacks = { { name = "fury skill reducer", interval = 2000, chance = 5, target = false }, { name = "combat", interval = 2000, chance = 10, type = COMBAT_LIFEDRAIN, minDamage = -120, maxDamage = -300, radius = 3, effect = CONST_ME_HITAREA, target = false }, { name = "combat", interval = 2000, chance = 10, type = COMBAT_DEATHDAMAGE, minDamage = -125, maxDamage = -250, range = 7, shootEffect = CONST_ANI_SUDDENDEATH, effect = CONST_ME_SMALLCLOUDS, target = false }, - { name = "speed", interval = 2000, chance = 15, speedChange = -800, range = 7, shootEffect = CONST_ANI_SUDDENDEATH, effect = CONST_ME_SMALLCLOUDS, target = false, duration = 30000 }, + { name = "speed", interval = 2000, chance = 15, speedChange = -100, range = 7, shootEffect = CONST_ANI_SUDDENDEATH, effect = CONST_ME_SMALLCLOUDS, target = false, duration = 30000 }, } monster.defenses = { diff --git a/data-otservbr-global/monster/demons/midnight_asura.lua b/data-otservbr-global/monster/demons/midnight_asura.lua index c3b0b3791e6..f73ceb8e519 100644 --- a/data-otservbr-global/monster/demons/midnight_asura.lua +++ b/data-otservbr-global/monster/demons/midnight_asura.lua @@ -118,7 +118,7 @@ monster.attacks = { { name = "combat", interval = 4100, chance = 27, type = COMBAT_DEATHDAMAGE, minDamage = -150, maxDamage = -300, length = 8, spread = 0, effect = CONST_ME_MORTAREA, target = false }, { name = "combat", interval = 2700, chance = 15, type = COMBAT_DEATHDAMAGE, minDamage = -50, maxDamage = -200, range = 5, shootEffect = CONST_ANI_SUDDENDEATH, target = true }, { name = "combat", interval = 3100, chance = 15, type = COMBAT_ENERGYDAMAGE, minDamage = -50, maxDamage = -100, range = 1, shootEffect = CONST_ANI_ENERGY, target = true }, - { name = "speed", interval = 2000, chance = 20, speedChange = -800, radius = 1, shootEffect = CONST_ANI_EXPLOSION, effect = CONST_ME_SLEEP, target = true, duration = 15000 }, + { name = "speed", interval = 2000, chance = 20, speedChange = -100, radius = 1, shootEffect = CONST_ANI_EXPLOSION, effect = CONST_ME_SLEEP, target = true, duration = 15000 }, } monster.defenses = { diff --git a/data-otservbr-global/monster/demons/plaguesmith.lua b/data-otservbr-global/monster/demons/plaguesmith.lua index 6fbc96b533d..28470a0500a 100644 --- a/data-otservbr-global/monster/demons/plaguesmith.lua +++ b/data-otservbr-global/monster/demons/plaguesmith.lua @@ -115,7 +115,7 @@ monster.attacks = { { name = "melee", interval = 1500, chance = 100, minDamage = 0, maxDamage = -539, condition = { type = CONDITION_POISON, totalDamage = 200, interval = 4000 } }, { name = "combat", interval = 2000, chance = 15, type = COMBAT_EARTHDAMAGE, minDamage = -60, maxDamage = -114, radius = 4, effect = CONST_ME_POISONAREA, target = false }, { name = "plaguesmith wave", interval = 2000, chance = 10, minDamage = -100, maxDamage = -350, target = false }, - { name = "speed", interval = 2000, chance = 15, speedChange = -800, radius = 4, effect = CONST_ME_POISONAREA, target = false, duration = 30000 }, + { name = "speed", interval = 2000, chance = 15, speedChange = -100, radius = 4, effect = CONST_ME_POISONAREA, target = false, duration = 30000 }, } monster.defenses = { diff --git a/data-otservbr-global/monster/dragons/ghastly_dragon.lua b/data-otservbr-global/monster/dragons/ghastly_dragon.lua index a4e989ea21f..11ade52fea9 100644 --- a/data-otservbr-global/monster/dragons/ghastly_dragon.lua +++ b/data-otservbr-global/monster/dragons/ghastly_dragon.lua @@ -115,7 +115,7 @@ monster.attacks = { { name = "combat", interval = 2000, chance = 15, type = COMBAT_LIFEDRAIN, minDamage = -80, maxDamage = -230, range = 7, effect = CONST_ME_MAGIC_RED, target = true }, { name = "ghastly dragon wave", interval = 2000, chance = 10, minDamage = -120, maxDamage = -250, target = false }, { name = "combat", interval = 2000, chance = 15, type = COMBAT_DEATHDAMAGE, minDamage = -110, maxDamage = -180, radius = 4, effect = CONST_ME_MORTAREA, target = false }, - { name = "speed", interval = 2000, chance = 20, speedChange = -800, range = 7, effect = CONST_ME_SMALLCLOUDS, target = true, duration = 30000 }, + { name = "speed", interval = 2000, chance = 20, speedChange = -100, range = 7, effect = CONST_ME_SMALLCLOUDS, target = true, duration = 30000 }, } monster.defenses = { diff --git a/data-otservbr-global/monster/elementals/ironblight.lua b/data-otservbr-global/monster/elementals/ironblight.lua index 593069318ed..a7fba4ab036 100644 --- a/data-otservbr-global/monster/elementals/ironblight.lua +++ b/data-otservbr-global/monster/elementals/ironblight.lua @@ -110,7 +110,7 @@ monster.attacks = { { name = "condition", type = CONDITION_POISON, interval = 2000, chance = 10, minDamage = -460, maxDamage = -480, radius = 6, shootEffect = CONST_ANI_POISON, effect = CONST_ME_POISONAREA, target = false }, { name = "combat", interval = 2000, chance = 15, type = COMBAT_ICEDAMAGE, minDamage = -260, maxDamage = -350, length = 7, spread = 0, shootEffect = CONST_ANI_ICE, effect = CONST_ME_ICEATTACK, target = false }, { name = "combat", interval = 2000, chance = 20, type = COMBAT_EARTHDAMAGE, minDamage = -180, maxDamage = -250, radius = 2, shootEffect = CONST_ANI_GREENSTAR, effect = CONST_ME_BIGPLANTS, target = true }, - { name = "speed", interval = 2000, chance = 10, speedChange = -800, length = 5, spread = 0, effect = CONST_ME_BLOCKHIT, target = false, duration = 30000 }, + { name = "speed", interval = 2000, chance = 10, speedChange = -100, length = 5, spread = 0, effect = CONST_ME_BLOCKHIT, target = false, duration = 30000 }, } monster.defenses = { diff --git a/data-otservbr-global/monster/humanoids/dworc_voodoomaster.lua b/data-otservbr-global/monster/humanoids/dworc_voodoomaster.lua index 9a9770186f3..c614fc2cbbc 100644 --- a/data-otservbr-global/monster/humanoids/dworc_voodoomaster.lua +++ b/data-otservbr-global/monster/humanoids/dworc_voodoomaster.lua @@ -93,7 +93,7 @@ monster.loot = { monster.attacks = { { name = "melee", interval = 2000, chance = 100, minDamage = 0, maxDamage = -20 }, { name = "combat", interval = 2000, chance = 10, type = COMBAT_LIFEDRAIN, minDamage = 0, maxDamage = -40, range = 1, effect = CONST_ME_MAGIC_RED, target = false }, - { name = "speed", interval = 2000, chance = 10, speedChange = -800, range = 7, effect = CONST_ME_MAGIC_RED, target = false, duration = 5000 }, + { name = "speed", interval = 2000, chance = 10, speedChange = -100, range = 7, effect = CONST_ME_MAGIC_RED, target = false, duration = 5000 }, { name = "drunk", interval = 2000, chance = 10, range = 7, shootEffect = CONST_ANI_ENERGY, effect = CONST_ME_TELEPORT, target = false }, { name = "outfit", interval = 2000, chance = 10, range = 7, effect = CONST_ME_MAGIC_BLUE, target = false, duration = 5000, outfitMonster = "chicken" }, { name = "combat", interval = 2000, chance = 10, type = COMBAT_EARTHDAMAGE, minDamage = -6, maxDamage = -18, radius = 6, effect = CONST_ME_GREEN_RINGS, target = false }, diff --git a/data-otservbr-global/monster/humanoids/lost_berserker.lua b/data-otservbr-global/monster/humanoids/lost_berserker.lua index cd48787df95..fb161e8cd63 100644 --- a/data-otservbr-global/monster/humanoids/lost_berserker.lua +++ b/data-otservbr-global/monster/humanoids/lost_berserker.lua @@ -112,7 +112,7 @@ monster.attacks = { { name = "combat", interval = 2000, chance = 15, type = COMBAT_PHYSICALDAMAGE, minDamage = 0, maxDamage = -300, range = 7, shootEffect = CONST_ANI_WHIRLWINDAXE, target = false }, { name = "combat", interval = 2000, chance = 15, type = COMBAT_PHYSICALDAMAGE, minDamage = 0, maxDamage = -250, range = 7, radius = 3, shootEffect = CONST_ANI_EXPLOSION, effect = CONST_ME_EXPLOSIONAREA, target = true }, { name = "combat", interval = 2000, chance = 10, type = COMBAT_MANADRAIN, minDamage = -150, maxDamage = -250, radius = 5, effect = CONST_ME_MAGIC_RED, target = false }, - { name = "speed", interval = 2000, chance = 10, speedChange = -800, radius = 2, effect = CONST_ME_MAGIC_RED, target = false, duration = 20000 }, + { name = "speed", interval = 2000, chance = 10, speedChange = -100, radius = 2, effect = CONST_ME_MAGIC_RED, target = false, duration = 20000 }, { name = "drunk", interval = 2000, chance = 10, radius = 4, effect = CONST_ME_STUN, target = true, duration = 6000 }, } diff --git a/data-otservbr-global/monster/magicals/choking_fear.lua b/data-otservbr-global/monster/magicals/choking_fear.lua index 16361bab0e9..9e95ff23aa9 100644 --- a/data-otservbr-global/monster/magicals/choking_fear.lua +++ b/data-otservbr-global/monster/magicals/choking_fear.lua @@ -109,7 +109,7 @@ monster.attacks = { -- poison { name = "condition", type = CONDITION_POISON, interval = 2000, chance = 10, minDamage = -700, maxDamage = -900, length = 5, spread = 0, effect = CONST_ME_HITBYPOISON, target = false }, { name = "combat", interval = 2000, chance = 10, type = COMBAT_PHYSICALDAMAGE, minDamage = 0, maxDamage = -300, radius = 1, shootEffect = CONST_ANI_EXPLOSION, effect = CONST_ME_SLEEP, target = true }, - { name = "speed", interval = 2000, chance = 20, speedChange = -800, radius = 1, shootEffect = CONST_ANI_EXPLOSION, effect = CONST_ME_SLEEP, target = true, duration = 15000 }, + { name = "speed", interval = 2000, chance = 20, speedChange = -100, radius = 1, shootEffect = CONST_ANI_EXPLOSION, effect = CONST_ME_SLEEP, target = true, duration = 15000 }, { name = "combat", interval = 2000, chance = 10, type = COMBAT_MANADRAIN, minDamage = -130, maxDamage = -300, radius = 4, effect = CONST_ME_SOUND_RED, target = false }, { name = "choking fear drown", interval = 2000, chance = 20, target = false }, { name = "combat", interval = 2000, chance = 20, type = COMBAT_DEATHDAMAGE, minDamage = -250, maxDamage = -500, radius = 4, shootEffect = CONST_ANI_SUDDENDEATH, effect = CONST_ME_MORTAREA, target = true }, diff --git a/data-otservbr-global/monster/magicals/guzzlemaw.lua b/data-otservbr-global/monster/magicals/guzzlemaw.lua index d402a6921da..9ea1f726827 100644 --- a/data-otservbr-global/monster/magicals/guzzlemaw.lua +++ b/data-otservbr-global/monster/magicals/guzzlemaw.lua @@ -113,7 +113,7 @@ monster.attacks = { { name = "condition", type = CONDITION_BLEEDING, interval = 2000, chance = 10, minDamage = -500, maxDamage = -1000, radius = 3, effect = CONST_ME_DRAWBLOOD, target = false }, { name = "combat", interval = 2000, chance = 10, type = COMBAT_LIFEDRAIN, minDamage = 0, maxDamage = -900, length = 8, spread = 0, effect = CONST_ME_EXPLOSIONAREA, target = false }, { name = "combat", interval = 2000, chance = 20, type = COMBAT_PHYSICALDAMAGE, minDamage = 0, maxDamage = -500, radius = 2, shootEffect = CONST_ANI_LARGEROCK, effect = CONST_ME_STONES, target = true }, - { name = "speed", interval = 2000, chance = 15, speedChange = -800, radius = 6, effect = CONST_ME_MAGIC_RED, target = false, duration = 15000 }, + { name = "speed", interval = 2000, chance = 15, speedChange = -100, radius = 6, effect = CONST_ME_MAGIC_RED, target = false, duration = 15000 }, { name = "combat", interval = 2000, chance = 10, type = COMBAT_LIFEDRAIN, minDamage = 0, maxDamage = -800, length = 8, spread = 0, effect = CONST_ME_MAGIC_RED, target = false }, } diff --git a/data-otservbr-global/monster/magicals/shock_head.lua b/data-otservbr-global/monster/magicals/shock_head.lua index 22c1e30890e..0394008118d 100644 --- a/data-otservbr-global/monster/magicals/shock_head.lua +++ b/data-otservbr-global/monster/magicals/shock_head.lua @@ -86,7 +86,7 @@ monster.loot = { monster.attacks = { { name = "melee", interval = 2000, chance = 100, minDamage = 0, maxDamage = -798 }, { name = "combat", interval = 2000, chance = 15, type = COMBAT_DEATHDAMAGE, minDamage = -200, maxDamage = -300, length = 5, spread = 2, effect = CONST_ME_BLACKSMOKE, target = false }, - { name = "speed", interval = 2000, chance = 15, speedChange = -800, length = 8, spread = 0, effect = CONST_ME_PURPLEENERGY, target = false, duration = 7500 }, + { name = "speed", interval = 2000, chance = 15, speedChange = -100, length = 8, spread = 0, effect = CONST_ME_PURPLEENERGY, target = false, duration = 7500 }, { name = "combat", interval = 2000, chance = 20, type = COMBAT_PHYSICALDAMAGE, minDamage = 0, maxDamage = -350, radius = 4, shootEffect = CONST_ANI_EARTH, effect = CONST_ME_STONES, target = true }, { name = "shock head skill reducer 1", interval = 2000, chance = 5, range = 5, target = false }, { name = "shock head skill reducer 2", interval = 2000, chance = 5, target = false }, diff --git a/data-otservbr-global/monster/plants/carniphila.lua b/data-otservbr-global/monster/plants/carniphila.lua index 4251cde140a..ab52039d6a9 100644 --- a/data-otservbr-global/monster/plants/carniphila.lua +++ b/data-otservbr-global/monster/plants/carniphila.lua @@ -88,7 +88,7 @@ monster.loot = { monster.attacks = { { name = "melee", interval = 2000, chance = 100, minDamage = 0, maxDamage = -100, condition = { type = CONDITION_POISON, totalDamage = 100, interval = 4000 } }, { name = "combat", interval = 2000, chance = 15, type = COMBAT_EARTHDAMAGE, minDamage = -60, maxDamage = -95, range = 7, shootEffect = CONST_ANI_POISON, effect = CONST_ME_GREEN_RINGS, target = false }, - { name = "speed", interval = 2000, chance = 15, speedChange = -800, range = 7, shootEffect = CONST_ANI_POISON, effect = CONST_ME_GREEN_RINGS, target = false, duration = 30000 }, + { name = "speed", interval = 2000, chance = 15, speedChange = -100, range = 7, shootEffect = CONST_ANI_POISON, effect = CONST_ME_GREEN_RINGS, target = false, duration = 30000 }, { name = "combat", interval = 2000, chance = 10, type = COMBAT_EARTHDAMAGE, minDamage = -40, maxDamage = -130, radius = 3, effect = CONST_ME_POISONAREA, target = false }, } diff --git a/data-otservbr-global/monster/quests/ancient_tombs/thalas.lua b/data-otservbr-global/monster/quests/ancient_tombs/thalas.lua index d6ad2f68864..6f27b9f17f2 100644 --- a/data-otservbr-global/monster/quests/ancient_tombs/thalas.lua +++ b/data-otservbr-global/monster/quests/ancient_tombs/thalas.lua @@ -92,7 +92,7 @@ monster.attacks = { { name = "melee", interval = 2000, chance = 100, minDamage = 0, maxDamage = -900 }, { name = "combat", interval = 2000, chance = 25, type = COMBAT_EARTHDAMAGE, minDamage = -150, maxDamage = -650, range = 7, shootEffect = CONST_ANI_POISON, effect = CONST_ME_POISONAREA, target = false }, { name = "melee", interval = 3000, chance = 20, minDamage = -150, maxDamage = -650 }, - { name = "speed", interval = 1000, chance = 6, speedChange = -800, range = 7, effect = CONST_ME_MAGIC_RED, target = false, duration = 20000 }, + { name = "speed", interval = 1000, chance = 6, speedChange = -100, range = 7, effect = CONST_ME_MAGIC_RED, target = false, duration = 20000 }, -- poison { name = "condition", type = CONDITION_POISON, interval = 1000, chance = 15, minDamage = -34, maxDamage = -35, radius = 5, effect = CONST_ME_POISONAREA, target = false }, { name = "combat", interval = 3000, chance = 17, type = COMBAT_EARTHDAMAGE, minDamage = -55, maxDamage = -550, length = 8, spread = 3, effect = CONST_ME_POISONAREA, target = false }, diff --git a/data-otservbr-global/monster/quests/cults_of_tibia/animated_guzzlemaw.lua b/data-otservbr-global/monster/quests/cults_of_tibia/animated_guzzlemaw.lua index 009f8a83209..6d723c594ea 100644 --- a/data-otservbr-global/monster/quests/cults_of_tibia/animated_guzzlemaw.lua +++ b/data-otservbr-global/monster/quests/cults_of_tibia/animated_guzzlemaw.lua @@ -99,7 +99,7 @@ monster.attacks = { { name = "condition", type = CONDITION_BLEEDING, interval = 2000, chance = 10, minDamage = -500, maxDamage = -1000, radius = 3, effect = CONST_ME_DRAWBLOOD, target = false }, { name = "combat", interval = 2000, chance = 10, type = COMBAT_PHYSICALDAMAGE, minDamage = 0, maxDamage = -900, length = 8, spread = 0, effect = CONST_ME_EXPLOSIONAREA, target = true }, { name = "combat", interval = 2000, chance = 20, type = COMBAT_PHYSICALDAMAGE, minDamage = 0, maxDamage = -500, radius = 2, shootEffect = CONST_ANI_LARGEROCK, effect = CONST_ME_STONES, target = true }, - { name = "speed", interval = 2000, chance = 15, speedChange = -800, radius = 6, effect = CONST_ME_MAGIC_RED, target = false, duration = 15000 }, + { name = "speed", interval = 2000, chance = 15, speedChange = -100, radius = 6, effect = CONST_ME_MAGIC_RED, target = false, duration = 15000 }, { name = "combat", interval = 2000, chance = 10, type = COMBAT_LIFEDRAIN, minDamage = 0, maxDamage = -800, length = 8, spread = 0, effect = CONST_ME_MAGIC_RED, target = false }, } diff --git a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/essence_of_malice.lua b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/essence_of_malice.lua index 26aceb32010..3c9b9b0bba4 100644 --- a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/essence_of_malice.lua +++ b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/essence_of_malice.lua @@ -101,7 +101,7 @@ monster.attacks = { { name = "combat", interval = 2000, chance = 15, type = COMBAT_LIFEDRAIN, minDamage = -80, maxDamage = -230, range = 7, effect = CONST_ME_MAGIC_RED, target = true }, { name = "combat", interval = 2000, chance = 10, type = COMBAT_DEATHDAMAGE, minDamage = -120, maxDamage = -250, length = 8, spread = 0, effect = CONST_ME_LOSEENERGY, target = false }, { name = "combat", interval = 2000, chance = 15, type = COMBAT_DEATHDAMAGE, minDamage = -110, maxDamage = -180, radius = 4, effect = CONST_ME_MORTAREA, target = false }, - { name = "speed", interval = 2000, chance = 20, speedChange = -800, range = 7, effect = CONST_ME_SMALLCLOUDS, target = true, duration = 30000 }, + { name = "speed", interval = 2000, chance = 20, speedChange = -100, range = 7, effect = CONST_ME_SMALLCLOUDS, target = true, duration = 30000 }, } monster.defenses = { diff --git a/data-otservbr-global/monster/quests/forgotten_knowledge/thorn_minion.lua b/data-otservbr-global/monster/quests/forgotten_knowledge/thorn_minion.lua index 8d4bebd6665..abfc779efc1 100644 --- a/data-otservbr-global/monster/quests/forgotten_knowledge/thorn_minion.lua +++ b/data-otservbr-global/monster/quests/forgotten_knowledge/thorn_minion.lua @@ -67,7 +67,7 @@ monster.loot = {} monster.attacks = { { name = "melee", interval = 2000, chance = 100, minDamage = -0, maxDamage = -264 }, { name = "combat", interval = 2000, chance = 15, type = COMBAT_EARTHDAMAGE, minDamage = -100, maxDamage = -195, range = 7, shootEffect = CONST_ANI_POISON, effect = CONST_ME_GREEN_RINGS, target = false }, - { name = "speed", interval = 2000, chance = 15, speedChange = -800, range = 7, shootEffect = CONST_ANI_POISON, effect = CONST_ME_GREEN_RINGS, target = false, duration = 30000 }, + { name = "speed", interval = 2000, chance = 15, speedChange = -100, range = 7, shootEffect = CONST_ANI_POISON, effect = CONST_ME_GREEN_RINGS, target = false, duration = 30000 }, { name = "combat", interval = 2000, chance = 20, type = COMBAT_PHYSICALDAMAGE, minDamage = -200, maxDamage = -280, radius = 4, effect = CONST_ME_GROUNDSHAKER, target = false }, { name = "combat", interval = 2000, chance = 10, type = COMBAT_DEATHDAMAGE, minDamage = -200, maxDamage = -400, length = 4, spread = 0, effect = CONST_ME_CARNIPHILA, target = false }, } diff --git a/data-otservbr-global/monster/quests/pits_of_inferno/the_plasmother.lua b/data-otservbr-global/monster/quests/pits_of_inferno/the_plasmother.lua index b530d1e96c1..fd98f95e5b0 100644 --- a/data-otservbr-global/monster/quests/pits_of_inferno/the_plasmother.lua +++ b/data-otservbr-global/monster/quests/pits_of_inferno/the_plasmother.lua @@ -89,7 +89,7 @@ monster.loot = { monster.attacks = { { name = "melee", interval = 2000, chance = 100, skill = 30, attack = 50 }, - { name = "speed", interval = 1000, chance = 8, speedChange = -800, radius = 6, effect = CONST_ME_POISONAREA, target = false, duration = 10000 }, + { name = "speed", interval = 1000, chance = 8, speedChange = -100, radius = 6, effect = CONST_ME_POISONAREA, target = false, duration = 10000 }, { name = "combat", interval = 2000, chance = 15, type = COMBAT_EARTHDAMAGE, minDamage = -200, maxDamage = -350, radius = 4, effect = CONST_ME_POISONAREA, target = false }, { name = "combat", interval = 3000, chance = 15, type = COMBAT_EARTHDAMAGE, minDamage = -200, maxDamage = -530, radius = 4, shootEffect = CONST_ANI_POISON, effect = CONST_ME_HITBYPOISON, target = true }, } diff --git a/data-otservbr-global/monster/quests/the_dream_courts/lucifuga_aranea.lua b/data-otservbr-global/monster/quests/the_dream_courts/lucifuga_aranea.lua index 717a1fe0814..5fbd324c0fd 100644 --- a/data-otservbr-global/monster/quests/the_dream_courts/lucifuga_aranea.lua +++ b/data-otservbr-global/monster/quests/the_dream_courts/lucifuga_aranea.lua @@ -73,7 +73,7 @@ monster.loot = { monster.attacks = { { name = "melee", interval = 2000, chance = 100, minDamage = 0, maxDamage = -250, condition = { type = CONDITION_POISON, totalDamage = 160, interval = 4000 } }, - { name = "speed", interval = 2000, chance = 15, speedChange = -800, range = 7, radius = 6, effect = CONST_ME_POFF, target = false, duration = 15000 }, + { name = "speed", interval = 2000, chance = 15, speedChange = -100, range = 7, radius = 6, effect = CONST_ME_POFF, target = false, duration = 15000 }, { name = "combat", interval = 2000, chance = 15, type = COMBAT_ICEDAMAGE, minDamage = -50, maxDamage = -100, range = 7, shootEffect = CONST_ANI_ICE, effect = CONST_ME_ICEAREA, target = true }, { name = "speed", interval = 2000, chance = 20, speedChange = -600, range = 7, shootEffect = CONST_ANI_SNOWBALL, target = true, duration = 10000 }, } diff --git a/data-otservbr-global/monster/quests/the_elemental_spheres/ice_overlord.lua b/data-otservbr-global/monster/quests/the_elemental_spheres/ice_overlord.lua index 9a65a1c8ef2..44bf1a162e1 100644 --- a/data-otservbr-global/monster/quests/the_elemental_spheres/ice_overlord.lua +++ b/data-otservbr-global/monster/quests/the_elemental_spheres/ice_overlord.lua @@ -74,7 +74,7 @@ monster.loot = { monster.attacks = { { name = "melee", interval = 2000, chance = 100, minDamage = 0, maxDamage = -400 }, - { name = "speed", interval = 2000, chance = 18, speedChange = -800, radius = 6, effect = CONST_ME_ICETORNADO, target = false, duration = 5000 }, + { name = "speed", interval = 2000, chance = 18, speedChange = -100, radius = 6, effect = CONST_ME_ICETORNADO, target = false, duration = 5000 }, { name = "combat", interval = 1000, chance = 9, type = COMBAT_ICEDAMAGE, minDamage = -50, maxDamage = -400, range = 7, shootEffect = CONST_ANI_SMALLICE, effect = CONST_ME_ICEATTACK, target = true }, } diff --git a/data-otservbr-global/monster/quests/the_secret_library/bosses/the_scourge_of_oblivion.lua b/data-otservbr-global/monster/quests/the_secret_library/bosses/the_scourge_of_oblivion.lua index 491b946adba..bd4f897e03a 100644 --- a/data-otservbr-global/monster/quests/the_secret_library/bosses/the_scourge_of_oblivion.lua +++ b/data-otservbr-global/monster/quests/the_secret_library/bosses/the_scourge_of_oblivion.lua @@ -134,7 +134,7 @@ monster.attacks = { { name = "choking fear drown", interval = 2000, chance = 20, target = false }, { name = "combat", interval = 2000, chance = 20, type = COMBAT_DEATHDAMAGE, minDamage = -450, maxDamage = -1400, radius = 4, shootEffect = CONST_ANI_SUDDENDEATH, effect = CONST_ME_MORTAREA, target = true }, { name = "combat", interval = 1000, chance = 10, type = COMBAT_MANADRAIN, minDamage = -800, maxDamage = -2300, radius = 8, effect = CONST_ME_MAGIC_GREEN, target = false }, - { name = "speed", interval = 1000, chance = 12, speedChange = -800, radius = 6, effect = CONST_ME_POISONAREA, target = false, duration = 60000 }, + { name = "speed", interval = 1000, chance = 12, speedChange = -100, radius = 6, effect = CONST_ME_POISONAREA, target = false, duration = 60000 }, { name = "strength", interval = 1000, chance = 8, radius = 5, effect = CONST_ME_HITAREA, target = false }, { name = "combat", interval = 1000, chance = 34, type = COMBAT_FIREDAMAGE, minDamage = -100, maxDamage = -700, range = 7, radius = 7, shootEffect = CONST_ANI_FIRE, effect = CONST_ME_FIREAREA, target = true }, { name = "combat", interval = 1000, chance = 15, type = COMBAT_LIFEDRAIN, minDamage = -300, maxDamage = -950, length = 8, spread = 0, effect = CONST_ME_MAGIC_RED, target = false }, diff --git a/data-otservbr-global/monster/undeads/lost_soul.lua b/data-otservbr-global/monster/undeads/lost_soul.lua index d00e9eb9d18..99002595639 100644 --- a/data-otservbr-global/monster/undeads/lost_soul.lua +++ b/data-otservbr-global/monster/undeads/lost_soul.lua @@ -103,7 +103,7 @@ monster.loot = { monster.attacks = { { name = "melee", interval = 2000, chance = 100, minDamage = 0, maxDamage = -420 }, { name = "combat", interval = 2000, chance = 10, type = COMBAT_DEATHDAMAGE, minDamage = -40, maxDamage = -210, length = 3, spread = 0, effect = CONST_ME_MAGIC_RED, target = false }, - { name = "speed", interval = 2000, chance = 20, speedChange = -800, radius = 6, effect = CONST_ME_SMALLCLOUDS, target = false, duration = 4000 }, + { name = "speed", interval = 2000, chance = 20, speedChange = -100, radius = 6, effect = CONST_ME_SMALLCLOUDS, target = false, duration = 4000 }, } monster.defenses = { diff --git a/data-otservbr-global/monster/vermins/crystal_spider.lua b/data-otservbr-global/monster/vermins/crystal_spider.lua index ecb4b9ee62c..b6dd122b188 100644 --- a/data-otservbr-global/monster/vermins/crystal_spider.lua +++ b/data-otservbr-global/monster/vermins/crystal_spider.lua @@ -100,7 +100,7 @@ monster.loot = { monster.attacks = { { name = "melee", interval = 2000, chance = 100, minDamage = 0, maxDamage = -250, condition = { type = CONDITION_POISON, totalDamage = 160, interval = 4000 } }, - { name = "speed", interval = 2000, chance = 15, speedChange = -800, range = 7, radius = 6, effect = CONST_ME_POFF, target = false, duration = 15000 }, + { name = "speed", interval = 2000, chance = 15, speedChange = -100, range = 7, radius = 6, effect = CONST_ME_POFF, target = false, duration = 15000 }, { name = "combat", interval = 2000, chance = 15, type = COMBAT_ICEDAMAGE, minDamage = -50, maxDamage = -100, range = 7, shootEffect = CONST_ANI_ICE, effect = CONST_ME_ICEAREA, target = true }, { name = "speed", interval = 2000, chance = 20, speedChange = -600, range = 7, shootEffect = CONST_ANI_SNOWBALL, target = true, duration = 10000 }, } From 5b7a604c2b9ed4ca65745057e40cdfeaf036b138 Mon Sep 17 00:00:00 2001 From: Sebastian Nobbelin Date: Sun, 14 Jan 2024 16:05:07 +0100 Subject: [PATCH 2/4] feat: refill jewelry --- data/scripts/talkactions/player/refill.lua | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 data/scripts/talkactions/player/refill.lua diff --git a/data/scripts/talkactions/player/refill.lua b/data/scripts/talkactions/player/refill.lua new file mode 100644 index 00000000000..8a820d3f8d7 --- /dev/null +++ b/data/scripts/talkactions/player/refill.lua @@ -0,0 +1,37 @@ +-- Usage talkaction: "!refill will refill all your amulets and rings for silver tokens" +local refill = TalkAction("!refill") + +local chargeItem = { + ["pendulet"] = { noChargeID = 29429, ChargeID = 30344, cost = 2 }, + ["sleep shawl"] = { noChargeID = 29428, ChargeID = 30342, cost = 2 }, + ["blister ring"] = { noChargeID = 31621, ChargeID = 31557, cost = 2 }, + ["theurgic amulet"] = { noChargeID = 30401, ChargeID = 30403, cost = 2 }, + ["ring of souls"] = { noChargeID = 32636, ChargeID = 32621, cost = 2 }, + ["turtle amulet"] = { noChargeID = 39235, ChargeID = 39233, cost = 2 }, + ["spiritthorn ring"] = { noChargeID = 39179, ChargeID = 39177, cost = 5 }, + ["alicorn ring"] = { noChargeID = 39182, ChargeID = 39180, cost = 5 }, + ["arcanomancer sigil"] = { noChargeID = 39185, ChargeID = 39183, cost = 5 }, + ["arboreal ring"] = { noChargeID = 39188, ChargeID = 39187, cost = 5 }, +} +local silverTokenID = 22516 + +function refill.onSay(player, words, param) + logger.debug("!refill executed") + for k, v in pairs(chargeItem) do + local chargeableCount = player:getItemCount(v.noChargeID) + local silverTokensCount = player:getItemCount(silverTokenID) + + if (chargeableCount >= 1 and silverTokensCount >= v.cost) then + player:removeItem(silverTokenID, v.cost) + player:removeItem(v.noChargeID, 1) + player:addItem(v.ChargeID, 1) + player:sendTextMessage(MESSAGE_LOOK, "Refilled " .. k .. '.') + end + end + + return true +end + +refill:separator(" ") +refill:groupType("normal") +refill:register() From 9ca0a7727f0553940431a9f474da95ee65d1d0f0 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Sun, 14 Jan 2024 15:05:47 +0000 Subject: [PATCH 3/4] Lua code format - (Stylua) --- data/scripts/talkactions/player/refill.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/scripts/talkactions/player/refill.lua b/data/scripts/talkactions/player/refill.lua index 8a820d3f8d7..1e996f49b1a 100644 --- a/data/scripts/talkactions/player/refill.lua +++ b/data/scripts/talkactions/player/refill.lua @@ -21,11 +21,11 @@ function refill.onSay(player, words, param) local chargeableCount = player:getItemCount(v.noChargeID) local silverTokensCount = player:getItemCount(silverTokenID) - if (chargeableCount >= 1 and silverTokensCount >= v.cost) then + if chargeableCount >= 1 and silverTokensCount >= v.cost then player:removeItem(silverTokenID, v.cost) player:removeItem(v.noChargeID, 1) player:addItem(v.ChargeID, 1) - player:sendTextMessage(MESSAGE_LOOK, "Refilled " .. k .. '.') + player:sendTextMessage(MESSAGE_LOOK, "Refilled " .. k .. ".") end end From 8fc609118f42c54b339a953d15c018fc002e532a Mon Sep 17 00:00:00 2001 From: Sebastian Nobbelin Date: Sun, 4 Feb 2024 12:49:29 +0100 Subject: [PATCH 4/4] update: refill talkaction based on feedback --- data/scripts/talkactions/player/refill.lua | 25 ++++++++++++++-------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/data/scripts/talkactions/player/refill.lua b/data/scripts/talkactions/player/refill.lua index 1e996f49b1a..7d8dca9e8ef 100644 --- a/data/scripts/talkactions/player/refill.lua +++ b/data/scripts/talkactions/player/refill.lua @@ -17,18 +17,25 @@ local silverTokenID = 22516 function refill.onSay(player, words, param) logger.debug("!refill executed") - for k, v in pairs(chargeItem) do - local chargeableCount = player:getItemCount(v.noChargeID) + local refilledItems = {} + local totalCost = 0 + for itemName, itemData in pairs(chargeItem) do + local chargeableCount = player:getItemCount(itemData.noChargeID) local silverTokensCount = player:getItemCount(silverTokenID) - - if chargeableCount >= 1 and silverTokensCount >= v.cost then - player:removeItem(silverTokenID, v.cost) - player:removeItem(v.noChargeID, 1) - player:addItem(v.ChargeID, 1) - player:sendTextMessage(MESSAGE_LOOK, "Refilled " .. k .. ".") + if chargeableCount >= 1 and silverTokensCount >= itemData.cost then + totalCost = totalCost + itemData.cost + table.insert(refilledItems, itemName) + player:removeItem(silverTokenID, itemData.cost) + player:removeItem(itemData.noChargeID, 1) + player:addItem(itemData.ChargeID, 1) end end - + if #refilledItems == 0 then + player:sendTextMessage(MESSAGE_INFO_DESCR, "You do not have any items to refill or lack silver tokens.") + else + local itemList = table.concat(refilledItems, ", ") + player:sendTextMessage(MESSAGE_INFO_DESCR, "Refilled " .. itemList .. " for a total of " .. totalCost .. " silver tokens.") + end return true end