From 9403edafa9b8b521ba8d8c0a3ac372819322f7e4 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 29 Oct 2023 12:35:12 -0500 Subject: [PATCH 01/14] First Aid Belt First Aid Belt and Bandage Bonus Property. --- data/dfndata/items/gear/clothing/ej_clothing.dfn | 13 +++++++++++++ data/js/item/equip_effects/bandagehealingbonus.js | 6 ++++++ data/js/jse_fileassociations.scp | 1 + data/js/skill/healing.js | 12 ++++++++++++ source/Changelog.txt | 6 ++++++ source/items.cpp | 1 + 6 files changed, 39 insertions(+) create mode 100644 data/dfndata/items/gear/clothing/ej_clothing.dfn create mode 100644 data/js/item/equip_effects/bandagehealingbonus.js diff --git a/data/dfndata/items/gear/clothing/ej_clothing.dfn b/data/dfndata/items/gear/clothing/ej_clothing.dfn new file mode 100644 index 000000000..0cf5b6af4 --- /dev/null +++ b/data/dfndata/items/gear/clothing/ej_clothing.dfn @@ -0,0 +1,13 @@ +[FirstAidBelt] +{ +get=base_clothing +name=First Aid Belt +id=0xA1F6 +type=1 +weight=100 +weightmax=40000 +maxitems=10000 +layer=0x12 +script=5049 +custominttag=healingbonus 15 +} \ No newline at end of file diff --git a/data/js/item/equip_effects/bandagehealingbonus.js b/data/js/item/equip_effects/bandagehealingbonus.js new file mode 100644 index 000000000..8f12a9a2d --- /dev/null +++ b/data/js/item/equip_effects/bandagehealingbonus.js @@ -0,0 +1,6 @@ +function onTooltip(equipment, pSocket) +{ + var healingBonus = parseInt(equipment.GetTag("healingbonus")); + var tooltipText = healingBonus + "% Bandage Healing Bonus"; + return tooltipText; +} \ No newline at end of file diff --git a/data/js/jse_fileassociations.scp b/data/js/jse_fileassociations.scp index d92b05035..cf0563348 100644 --- a/data/js/jse_fileassociations.scp +++ b/data/js/jse_fileassociations.scp @@ -267,6 +267,7 @@ 5046=item/corpse.js 5047=item/consumables/new_player_ticket.js 5048=item/teleport_item.js +5049=item/equip_effects/bandagehealingbonus.js //------------------------------------------- // Camps [5500-5599] diff --git a/data/js/skill/healing.js b/data/js/skill/healing.js index 002743d28..1751042c6 100644 --- a/data/js/skill/healing.js +++ b/data/js/skill/healing.js @@ -407,6 +407,16 @@ function onTimer( mChar, timerID ) } else if( mChar.CheckSkill( skillNum, 0, healthLoss * 10 )) // Requires higher and higher amount of health lost in order for healer to gain skill { + var mItem; + var healBonus; + for( mItem = mChar.FirstItem(); !mChar.FinishedItems(); mItem = mChar.NextItem() ) + { + if( !ValidateObject( mItem )) + continue; + + healBonus += parseInt( mItem.GetTag( "healingBonus" ) ); + } + // Increase karma when healing innocent/neutral characters if( ourObj != mChar && ( ourObj.innocent || ourObj.neutral )) { @@ -449,6 +459,8 @@ function onTimer( mChar, timerID ) var maxValue = Math.round(( secondarySkill / 50 ) + ( healSkill / 20 ) + 10 ); var healAmt = RandomNumber( minValue, maxValue ); + healAmt += healAmt * ( healBonus / 100 ); + // Reduce the amount healed with each slip caused by damage taken while healing for( var i = 0; i < slipCount; i++ ) { diff --git a/source/Changelog.txt b/source/Changelog.txt index 9e375d49e..6b22e94e5 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,3 +1,9 @@ +29/10/2023 - Dragon Slayer, Xuri (0.99.6a) + Added DFN entries for first aid belt. (dfn item/gear/clothing/ej_clothing) + Added First Aid Belt ID to backpack type. (cpp items) + Added bandage healing bonus to healing. (js healing) + Added JS script bandagehealingbonus (js items/equip_effect/bandagehealingbonus) + 28/10/2023 - Dragon Slayer (0.99.6a) Added DFN entries for hallow pumpkins, jack o lanterns and halloween decorations. (dfn item/misc/halloween) Added DFN entrie for killerpumpkin in daemons.dfn. (dfn daemons) diff --git a/source/items.cpp b/source/items.cpp index 71c8b964e..344ab2794 100644 --- a/source/items.cpp +++ b/source/items.cpp @@ -1402,6 +1402,7 @@ PackTypes cItem::GetPackType( CItem *i ) case 0x0E75: // backpack case 0x0E79: // pouch case 0x09B0: // pouch + case 0xA1F6: // First Aid Belt packType = PT_PACK; break; case 0x0E76: // leather bag From 93459a07a92ba70ca3d909321c001838182d3ec0 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 29 Oct 2023 12:36:50 -0500 Subject: [PATCH 02/14] Update bandagehealingbonus.js --- data/js/item/equip_effects/bandagehealingbonus.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/js/item/equip_effects/bandagehealingbonus.js b/data/js/item/equip_effects/bandagehealingbonus.js index 8f12a9a2d..eb90b4104 100644 --- a/data/js/item/equip_effects/bandagehealingbonus.js +++ b/data/js/item/equip_effects/bandagehealingbonus.js @@ -1,6 +1,6 @@ -function onTooltip(equipment, pSocket) +function onTooltip( equipment, pSocket ) { - var healingBonus = parseInt(equipment.GetTag("healingbonus")); + var healingBonus = parseInt( equipment.GetTag( "healingbonus" )); var tooltipText = healingBonus + "% Bandage Healing Bonus"; return tooltipText; } \ No newline at end of file From 25fb7e4ef0e225d68a11df2d2ccaf4abd975735e Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 29 Oct 2023 12:38:10 -0500 Subject: [PATCH 03/14] Update ej_clothing.dfn --- data/dfndata/items/gear/clothing/ej_clothing.dfn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/dfndata/items/gear/clothing/ej_clothing.dfn b/data/dfndata/items/gear/clothing/ej_clothing.dfn index 0cf5b6af4..bc155e336 100644 --- a/data/dfndata/items/gear/clothing/ej_clothing.dfn +++ b/data/dfndata/items/gear/clothing/ej_clothing.dfn @@ -9,5 +9,5 @@ weightmax=40000 maxitems=10000 layer=0x12 script=5049 -custominttag=healingbonus 15 +custominttag=healingBonus 15 } \ No newline at end of file From 20e19c19209984d4973db9306410990d5283deac Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 29 Oct 2023 12:38:53 -0500 Subject: [PATCH 04/14] Update bandagehealingbonus.js --- data/js/item/equip_effects/bandagehealingbonus.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/js/item/equip_effects/bandagehealingbonus.js b/data/js/item/equip_effects/bandagehealingbonus.js index eb90b4104..0c1248671 100644 --- a/data/js/item/equip_effects/bandagehealingbonus.js +++ b/data/js/item/equip_effects/bandagehealingbonus.js @@ -1,6 +1,6 @@ function onTooltip( equipment, pSocket ) { - var healingBonus = parseInt( equipment.GetTag( "healingbonus" )); + var healingBonus = parseInt( equipment.GetTag( "healingBonus" )); var tooltipText = healingBonus + "% Bandage Healing Bonus"; return tooltipText; } \ No newline at end of file From 7b1702525aebd9f0ddbf7bcfda8578aa2b68e38a Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 29 Oct 2023 12:42:31 -0500 Subject: [PATCH 05/14] Update Changelog.txt --- source/Changelog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Changelog.txt b/source/Changelog.txt index 6b22e94e5..25564a163 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,4 +1,4 @@ -29/10/2023 - Dragon Slayer, Xuri (0.99.6a) +29/10/2023 - Dragon Slayer, Xuri Added DFN entries for first aid belt. (dfn item/gear/clothing/ej_clothing) Added First Aid Belt ID to backpack type. (cpp items) Added bandage healing bonus to healing. (js healing) From a785caed97a1c08713e9f17805ab7db697b37bb5 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 29 Oct 2023 12:48:51 -0500 Subject: [PATCH 06/14] renamed file --- .../items/gear/clothing/{ej_clothing.dfn => tol_clothing.dfn} | 1 + 1 file changed, 1 insertion(+) rename data/dfndata/items/gear/clothing/{ej_clothing.dfn => tol_clothing.dfn} (93%) diff --git a/data/dfndata/items/gear/clothing/ej_clothing.dfn b/data/dfndata/items/gear/clothing/tol_clothing.dfn similarity index 93% rename from data/dfndata/items/gear/clothing/ej_clothing.dfn rename to data/dfndata/items/gear/clothing/tol_clothing.dfn index bc155e336..2c36bfe27 100644 --- a/data/dfndata/items/gear/clothing/ej_clothing.dfn +++ b/data/dfndata/items/gear/clothing/tol_clothing.dfn @@ -10,4 +10,5 @@ maxitems=10000 layer=0x12 script=5049 custominttag=healingBonus 15 +origin=tol } \ No newline at end of file From 9a45c2942bd8cb562ad859fe37afcc1fecc945b1 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 29 Oct 2023 15:04:36 -0500 Subject: [PATCH 07/14] Fixed healing Bonus --- data/js/skill/healing.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/data/js/skill/healing.js b/data/js/skill/healing.js index 1751042c6..6523eb4a7 100644 --- a/data/js/skill/healing.js +++ b/data/js/skill/healing.js @@ -459,8 +459,6 @@ function onTimer( mChar, timerID ) var maxValue = Math.round(( secondarySkill / 50 ) + ( healSkill / 20 ) + 10 ); var healAmt = RandomNumber( minValue, maxValue ); - healAmt += healAmt * ( healBonus / 100 ); - // Reduce the amount healed with each slip caused by damage taken while healing for( var i = 0; i < slipCount; i++ ) { @@ -482,7 +480,7 @@ function onTimer( mChar, timerID ) } else { - ourObj.Heal( healAmt, mChar ); + ourObj.Heal(healAmt * (healBonus / 100), mChar ); socket.SysMessage( GetDictionaryEntry( 1271, socket.language )); // You apply the bandages and the patient looks a bit healthier. } } From 172983ab282d4fe115c98579cac5c92cc153dab9 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Mon, 30 Oct 2023 10:59:15 -0500 Subject: [PATCH 08/14] Added msg to dictionary files --- data/dictionaries/dictionary.CSY | 2 ++ data/dictionaries/dictionary.ENG | 2 ++ data/dictionaries/dictionary.FRE | 2 ++ data/dictionaries/dictionary.GER | 2 ++ data/dictionaries/dictionary.ITA | 2 ++ data/dictionaries/dictionary.POL | 2 ++ data/dictionaries/dictionary.PTG | 2 ++ data/dictionaries/dictionary.SPA | 2 ++ data/dictionaries/dictionary.ZRO | 2 ++ data/js/item/equip_effects/bandagehealingbonus.js | 4 ++-- 10 files changed, 20 insertions(+), 2 deletions(-) diff --git a/data/dictionaries/dictionary.CSY b/data/dictionaries/dictionary.CSY index fde773a06..b4a6bc2e1 100644 --- a/data/dictionaries/dictionary.CSY +++ b/data/dictionaries/dictionary.CSY @@ -5149,5 +5149,7 @@ 18769=Barviva a kádinka s barvivy byly umístěny do tvého batohu. 18770=Toto je polovina výherního lístku! Dvakrát klikni na tento tip a zaměř jakýkoli jiný tip označený jako NOVÝ HRÁČ a získej výhru! Tento los bude fungovat pouze pro TEBE, takže ho nikomu nedávej! 18771=Plná sada rangerské zbroje. +// [18800-19000] Vlastnosti AOS +18800=%i% Bonus za hojení obvazů } EOF diff --git a/data/dictionaries/dictionary.ENG b/data/dictionaries/dictionary.ENG index df08f4018..4b38d6239 100644 --- a/data/dictionaries/dictionary.ENG +++ b/data/dictionaries/dictionary.ENG @@ -5149,5 +5149,7 @@ 18769=The dyes and dye tub have been placed in your backpack. 18770=This is half a prize ticket! Double-click this ticket and target any other ticket marked NEW PLAYER and get a prize! This ticket will only work for YOU, so don’t give it away! 18771=A full set of ranger armor. +// [18800-19000] AOS properties +18800=%i% Bandage Healing Bonus } EOF diff --git a/data/dictionaries/dictionary.FRE b/data/dictionaries/dictionary.FRE index 47cf0430b..7194e3336 100644 --- a/data/dictionaries/dictionary.FRE +++ b/data/dictionaries/dictionary.FRE @@ -5305,5 +5305,7 @@ 18769=Les teintures et le bac à teinture ont été placés dans votre sac à dos. 18770=Voici la moitié d'un ticket de prix ! Double-cliquez sur ce ticket et ciblez n'importe quel autre ticket marqué NEW PLAYER et obtenez un prix ! Ce ticket ne fonctionnera que pour TOI, alors ne le donne pas ! 18771=Une armure de ranger complète. +// [18800-19000] Propriétés de l’AOS +18800=%i% Bonus de soins de bandage } EOF diff --git a/data/dictionaries/dictionary.GER b/data/dictionaries/dictionary.GER index 3d398d740..8c41ee586 100644 --- a/data/dictionaries/dictionary.GER +++ b/data/dictionaries/dictionary.GER @@ -5149,5 +5149,7 @@ 18769=Die Färbemittel und der Färbebecher wurden in deinen Rucksack gelegt. 18770=Dies ist ein halber Gewinnschein! Doppelklicke auf dieses Ticket und auf ein beliebiges anderes Ticket mit der Aufschrift NEUER SPIELER und du bekommst einen Preis! Dieses Ticket funktioniert nur für dich, also verschenke es nicht! 18771=Ein kompletter Satz Waldläufer-Rüstung. +// [18800-19000] AOS-Eigenschaften +18800=%i% Verbandsheilungsbonus } EOF diff --git a/data/dictionaries/dictionary.ITA b/data/dictionaries/dictionary.ITA index f9e9d1851..c47a0a19c 100644 --- a/data/dictionaries/dictionary.ITA +++ b/data/dictionaries/dictionary.ITA @@ -5149,5 +5149,7 @@ 18769=I coloranti e la vasca per i coloranti sono stati messi nel tuo zaino. 18770=Questo è mezzo biglietto premio! Fai doppio clic su questo biglietto e punta su qualsiasi altro biglietto con la dicitura NUOVO GIOCATORE per ottenere un premio! Questo biglietto funzionerà solo per te, quindi non darlo via! 18771=Un set completo di armatura da ranger. +// [18800-19000] Proprietà AOS +18800=%i% Bonus di guarigione della benda } EOF diff --git a/data/dictionaries/dictionary.POL b/data/dictionaries/dictionary.POL index 292144cb4..dbdc431e2 100644 --- a/data/dictionaries/dictionary.POL +++ b/data/dictionaries/dictionary.POL @@ -5149,5 +5149,7 @@ 18769=Barwniki i pojemnik na barwniki zostały umieszczone w twoim plecaku. 18770=To jest połowa biletu z nagrodą! Kliknij dwukrotnie ten bilet i wybierz dowolny inny bilet oznaczony jako NOWY GRACZ, a otrzymasz nagrodę! Ten bilet będzie działał tylko dla CIEBIE, więc go nie rozdawaj! 18771=Pełny zestaw zbroi strażnika. +// [18800-19000] Właściwości AOS +18800=%i% Premia do leczenia bandażem } EOF diff --git a/data/dictionaries/dictionary.PTG b/data/dictionaries/dictionary.PTG index efd386c00..81b5da2af 100644 --- a/data/dictionaries/dictionary.PTG +++ b/data/dictionaries/dictionary.PTG @@ -5149,5 +5149,7 @@ 18769=As tinturas e o tubo de tinturas foram colocados na tua mochila. 18770=Isto é metade de um bilhete premiado! Faz duplo clique neste bilhete e aponta para qualquer outro bilhete marcado NOVO JOGADOR e ganha um prémio! Este bilhete só serve para ti, por isso não o dês de mão beijada! 18771=Um conjunto completo de armadura de guarda-florestal. +// [18800-19000] Propriedades AOS +18800=%i% Bônus de cura de curativo } EOF diff --git a/data/dictionaries/dictionary.SPA b/data/dictionaries/dictionary.SPA index 6300de916..2c82493bd 100644 --- a/data/dictionaries/dictionary.SPA +++ b/data/dictionaries/dictionary.SPA @@ -5149,5 +5149,7 @@ 18769=Los tintes y la tina de tintes han sido colocados en tu mochila. 18770=¡Este es medio billete de premio! Haga doble clic en este billete y apunte a cualquier otro billete marcado como NUEVO JUGADOR ¡y consiga un premio! Este billete sólo te servirá a TI, ¡así que no lo regales! 18771=Un conjunto completo de armadura de guardabosques. +// [18800-19000] Propiedades AOS +18800=%i% Bonificación de curación de vendaje } EOF diff --git a/data/dictionaries/dictionary.ZRO b/data/dictionaries/dictionary.ZRO index 5c6792765..aca5a8424 100644 --- a/data/dictionaries/dictionary.ZRO +++ b/data/dictionaries/dictionary.ZRO @@ -5143,5 +5143,7 @@ 18769=The dyes and dye tub have been placed in your backpack. 18770=This is half a prize ticket! Double-click this ticket and target any other ticket marked NEW PLAYER and get a prize! This ticket will only work for YOU, so don’t give it away! 18771=A full set of ranger armor. +// [18800-19000] AOS properties +18800=%i% Bandage Healing Bonus } EOF diff --git a/data/js/item/equip_effects/bandagehealingbonus.js b/data/js/item/equip_effects/bandagehealingbonus.js index 0c1248671..eca48b330 100644 --- a/data/js/item/equip_effects/bandagehealingbonus.js +++ b/data/js/item/equip_effects/bandagehealingbonus.js @@ -1,6 +1,6 @@ function onTooltip( equipment, pSocket ) { var healingBonus = parseInt( equipment.GetTag( "healingBonus" )); - var tooltipText = healingBonus + "% Bandage Healing Bonus"; - return tooltipText; + var tooltipText = GetDictionaryEntry(18800, pSocket.language ); // %i% Bandage Healing Bonus + return tooltipText.replace( /%i/gi, healingBonus ); } \ No newline at end of file From bebad07c18925a8761e6c1db7807d5a133610f59 Mon Sep 17 00:00:00 2001 From: Danny Shoun Date: Fri, 10 Nov 2023 07:58:10 -0700 Subject: [PATCH 09/14] Fix switch case for Sturdy Shovel BOD reward. --- data/js/npc/ai/vendor_bdo_dispenser.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/js/npc/ai/vendor_bdo_dispenser.js b/data/js/npc/ai/vendor_bdo_dispenser.js index 9e453a24a..79e849be9 100644 --- a/data/js/npc/ai/vendor_bdo_dispenser.js +++ b/data/js/npc/ai/vendor_bdo_dispenser.js @@ -694,17 +694,17 @@ function DispenseBODRewards( pDropper, npcDroppedOn, iDropped ) minReward = 0 + minMaxMod[0]; maxReward = 16 + minMaxMod[1]; - switch( WeightedRandom( minReward, maxReward, weightVal )) + switch( WeightedRandom( minReward, maxReward, weightVal ) ) { case 0: // Sturdy Pickaxe / Sturdy Shovel (equal chance) - switch( RandomNumber( 0, 1 )) + switch( RandomNumber( 0, 1 ) ) { case 0: // Sturdy Pickaxe bodRewardItem = CreateBODReward( 0, socket, pDropper, 0 ); break; case 1: // Sturdy Shovel - break; bodRewardItem = CreateBODReward( 1, socket, pDropper, 0 ); + break; default: break; } From 62dc86ff2f23fc347801a1d6d9fbbb378ca7f8d8 Mon Sep 17 00:00:00 2001 From: Danny Shoun Date: Fri, 10 Nov 2023 09:27:50 -0700 Subject: [PATCH 10/14] Modify effective skills instead of base skills with boost items. --- data/js/item/equip_effects/skill_boosting_equipment.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/data/js/item/equip_effects/skill_boosting_equipment.js b/data/js/item/equip_effects/skill_boosting_equipment.js index 7fa391fd1..641e56b94 100644 --- a/data/js/item/equip_effects/skill_boosting_equipment.js +++ b/data/js/item/equip_effects/skill_boosting_equipment.js @@ -21,10 +21,10 @@ function onEquip( pEquipper, iEquipped ) switch( skillBonusID ) { case 7: // Blacksmithing - pEquipper.baseskills.blacksmithing += skillBonusVal; + pEquipper.skills.blacksmithing += skillBonusVal; break; case 45: // Mining - pEquipper.baseskills.mining += skillBonusVal; + pEquipper.skills.mining += skillBonusVal; break; default: break; @@ -39,10 +39,10 @@ function onUnequip( pUnquipper, iUnequipped ) switch( skillBonusID ) { case 7: // Blacksmithing - pUnquipper.baseskills.blacksmithing -= skillBonusVal; + pUnquipper.skills.blacksmithing -= skillBonusVal; break; case 45: // Mining - pUnquipper.baseskills.mining -= skillBonusVal; + pUnquipper.skills.mining -= skillBonusVal; break; default: break; From 9effa8e662bf33f3816ef5093146935f2b4168af Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Fri, 10 Nov 2023 12:12:52 -0600 Subject: [PATCH 11/14] Missing Item IDs for Gumps The Stocking IDs was missing for the items.cpp file for the gumps --- source/Changelog.txt | 3 +++ source/items.cpp | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/source/Changelog.txt b/source/Changelog.txt index 9e375d49e..fd3c9956d 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,3 +1,6 @@ +10/11/2023 - Dragon Slayer + Added Stocking IDs to items.cpp (cpp items) + 28/10/2023 - Dragon Slayer (0.99.6a) Added DFN entries for hallow pumpkins, jack o lanterns and halloween decorations. (dfn item/misc/halloween) Added DFN entrie for killerpumpkin in daemons.dfn. (dfn daemons) diff --git a/source/items.cpp b/source/items.cpp index 71c8b964e..af8462584 100644 --- a/source/items.cpp +++ b/source/items.cpp @@ -1518,6 +1518,12 @@ PackTypes cItem::GetPackType( CItem *i ) packType = PT_PACK2; } break; + case 0x2bd9: + case 0x2BDA: + case 0x2BDB: + case 0x2BDC: + packType = PT_STOCKING; + break; case 0x232A: // giftbox case 0x232B: // giftbox packType = PT_GIFTBOX1; From b7fe9555a5a93a56f8e77c7ca20c08ca973bf101 Mon Sep 17 00:00:00 2001 From: Danny Shoun Date: Fri, 10 Nov 2023 20:16:23 -0700 Subject: [PATCH 12/14] Improvements to BOD GUMP UX. - Multiple items can now be added in a row. - The cursor will automatically stop being a target at the BOD max. - The GUMP no longer closes after first clicking 'Combine...' - (Backend Only) Target clicking empty space no longer throws an error. --- data/js/item/smallbod.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/data/js/item/smallbod.js b/data/js/item/smallbod.js index cfc7c4081..62b16d0ab 100644 --- a/data/js/item/smallbod.js +++ b/data/js/item/smallbod.js @@ -43,9 +43,6 @@ function onUseChecked( pUser, smallBOD ) } else { - // Store iUsed as a custom property on pUser - pUser.bodItem = smallBOD; - var init = smallBOD.GetTag( "init" ) // just to make sure we dont set the bod over if( init == false ) // Keep from resetting the amount needed. { @@ -91,6 +88,8 @@ function SmallBODGump( pUser, smallBOD ) var socket = pUser.socket; var bodGump = new Gump; + pUser.bodItem = smallBOD; // Store BOD on the user for access in callbacks. + bodGump.AddPage( 0 ); bodGump.AddBackground( 50, 10, 455, 260, 5054 ); @@ -201,6 +200,7 @@ function onGumpPress( socket, pButton, gumpData ) delete pUser.bodItem; // Remove bodItem as a temporary property on pUser break; case 1: + SmallBODGump(pUser, smallBOD); CombineItemWithBod( pUser, smallBOD ); break; } @@ -238,10 +238,13 @@ function onCallback0( socket, myTarget ) var bodItemID = smallBOD.GetTag( "graphicID" ); delete pUser.bodItem; // Remove bodItem as a temporary property on pUser - // Abort if player cancels target cursor + // Abort if player cancels target cursor or clicks empty space. var cancelCheck = parseInt( socket.GetByte( 11 )); - if( cancelCheck == 255 ) + if( cancelCheck == 255 || !myTarget) + { + SmallBODGump(pUser, smallBOD); return; + } if( !socket.GetWord( 1 ) && myTarget.isItem && ( myTarget.sectionID == bodSectionID ) || ( myTarget.id == bodItemID && myTarget.name == bodItemName )) { @@ -352,11 +355,11 @@ function onCallback0( socket, myTarget ) myTarget.Delete(); pUser.TextMessage( GetDictionaryEntry( 17263, socket.language ), false, 0x3b2, 0, pUser.serial ); // The item has been combined with the deed. - if( amountCur < amountMax ) + if( amountCur + 1 < amountMax ) { pUser.CustomTarget( 0 ); - SmallBODGump( pUser, smallBOD ); } + SmallBODGump( pUser, smallBOD ); } } } From 058418a8a807b187b540ca7aa73377aaee924607 Mon Sep 17 00:00:00 2001 From: Danny Shoun Date: Fri, 10 Nov 2023 20:18:58 -0700 Subject: [PATCH 13/14] Formatting fixes. --- data/js/item/smallbod.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/js/item/smallbod.js b/data/js/item/smallbod.js index 62b16d0ab..8b37f39bc 100644 --- a/data/js/item/smallbod.js +++ b/data/js/item/smallbod.js @@ -240,9 +240,9 @@ function onCallback0( socket, myTarget ) // Abort if player cancels target cursor or clicks empty space. var cancelCheck = parseInt( socket.GetByte( 11 )); - if( cancelCheck == 255 || !myTarget) + if( cancelCheck == 255 || !myTarget ) { - SmallBODGump(pUser, smallBOD); + SmallBODGump( pUser, smallBOD ); return; } From 6e2905ca77ee8f46890edb96f4e4d65fa884a506 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sat, 11 Nov 2023 11:40:46 -0600 Subject: [PATCH 14/14] Update Changelog.txt --- source/Changelog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Changelog.txt b/source/Changelog.txt index fd3c9956d..c42f7ed94 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,5 +1,5 @@ 10/11/2023 - Dragon Slayer - Added Stocking IDs to items.cpp (cpp items) + Added IDs for stocking items to cItem::GetPackType() in items.cpp, so they can be used as containers 28/10/2023 - Dragon Slayer (0.99.6a) Added DFN entries for hallow pumpkins, jack o lanterns and halloween decorations. (dfn item/misc/halloween)