Skip to content

Commit

Permalink
Merge pull request #253 from DragonSlayer62/powder-of-trasnlaction
Browse files Browse the repository at this point in the history
Powder of Translaction
  • Loading branch information
Xoduz committed Dec 29, 2023
2 parents cd8fc16 + 268b3a9 commit c4c947c
Show file tree
Hide file tree
Showing 13 changed files with 142 additions and 1 deletion.
22 changes: 22 additions & 0 deletions data/dfndata/items/misc/consumables.dfn
Original file line number Diff line number Diff line change
Expand Up @@ -241,4 +241,26 @@ name=new player ticket
id=0x14f0
newbie=1
script=5047//new player ticket
}

[powderoftranslocation]
{
get=base_item
name=powder of translocation
id=0x26B8
weight=01
color=0x0835
pileable=1
amount=1
script=5059//powderoftranslocation.js
}

[zoogifungus]
{
get=base_item
name=a zoogi fungus
id=0x26B7
pileable=1
amount=1
decay=1
}
5 changes: 5 additions & 0 deletions data/dictionaries/dictionary.CSY
Original file line number Diff line number Diff line change
Expand Up @@ -5299,5 +5299,10 @@
19075=Nemáte dostatek poplatků k odeslání takové hmotnosti
19076=Položka byla umístěna do vaší bankovní schránky.
19077=Sáček s odesláním tuto položku odmítá.
// [19081-19090] Powder of Translocation
19081=Tato položka nemůže absorbovat žádný další prášek translokace.
19082=Tato položka byla přesycena práškem translokace a již ji nelze dobíjet.
19083= září zelenou energií a absorbuje magickou sílu z prášku.
19084=Translokační prášek nemá na tuto položku žádný vliv.
}
EOF
5 changes: 5 additions & 0 deletions data/dictionaries/dictionary.ENG
Original file line number Diff line number Diff line change
Expand Up @@ -5300,5 +5300,10 @@
19075=You don't have enough charges to send that much weight
19076=The item was placed in your bank box.
19077=The bag of sending rejects that item.
// [19081-19090] Powder of Translocation
19081=This item cannot absorb any more powder of translocation.
19082=This item has been oversaturated with powder of translocation and can no longer be recharged.
19083= glows with green energy and absorbs magical power from the powder.
19084=Powder of translocation has no effect on this item.
}
EOF
5 changes: 5 additions & 0 deletions data/dictionaries/dictionary.FRE
Original file line number Diff line number Diff line change
Expand Up @@ -5455,5 +5455,10 @@
19075=Vous n'avez pas assez de charges pour envoyer autant de poids
19076=L'objet a été placé dans votre boîte bancaire.
19077=Le sac d'envoi rejette cet article.
// [19081-19090] Poudre de Translocation
19081=Cet objet ne peut plus absorber de poudre de translocation.
19082=Cet objet a été sursaturé en poudre de translocation et ne peut plus être rechargé.
19083= brille d'énergie verte et absorbe le pouvoir magique de la poudre.
19084=La poudre de translocation n'a aucun effet sur cet objet.
}
EOF
5 changes: 5 additions & 0 deletions data/dictionaries/dictionary.GER
Original file line number Diff line number Diff line change
Expand Up @@ -5299,5 +5299,10 @@
19075=Sie haben nicht genügend Gebühren, um so viel Gewicht zu senden
19076=Der Artikel wurde in Ihr Bankfach gelegt.
19077=Der Versandbeutel lehnt diesen Artikel ab.
// [19081-19090] Pulver der Translokation
19081=Dieser Gegenstand kann kein Translokationspulver mehr absorbieren.
19082=Dieser Gegenstand ist mit Translokationspulver übersättigt und kann nicht mehr aufgeladen werden.
19083= leuchtet vor grüner Energie und absorbiert magische Kraft aus dem Pulver.
19084=Translokationspulver hat keine Auswirkung auf diesen Gegenstand.
}
EOF
5 changes: 5 additions & 0 deletions data/dictionaries/dictionary.ITA
Original file line number Diff line number Diff line change
Expand Up @@ -5299,5 +5299,10 @@
19075=Non hai abbastanza addebiti per inviare così tanto peso
19076=L'oggetto è stato depositato nella tua cassetta della banca.
19077=Il sacchetto di spedizione rifiuta l'oggetto.
// [19081-19090] Polvere di traslocazione
19081=Questo oggetto non può più assorbire polvere di traslocazione.
19082=Questo oggetto è stato saturo di polvere di traslocazione e non può più essere ricaricato.
19083= brilla di energia verde e assorbe il potere magico dalla polvere.
19084=La polvere di traslocazione non ha effetto su questo oggetto.
}
EOF
5 changes: 5 additions & 0 deletions data/dictionaries/dictionary.POL
Original file line number Diff line number Diff line change
Expand Up @@ -5299,5 +5299,10 @@
19075=Nie masz wystarczającej liczby ładunków, aby wysłać tak dużą wagę
19076=Przedmiot został umieszczony w Twojej skrzynce bankowej.
19077=Torba wysyłkowa odrzuca ten przedmiot.
// [19081-19090] Proszek translokacji
19081=Ten przedmiot nie może wchłonąć więcej proszku translokacji.
19082=Ten przedmiot został przesycony proszkiem translokacji i nie można go już ponownie naładować.
19083= świeci zieloną energią i pochłania magiczną moc z proszku.
19084=Proszek translokacji nie ma wpływu na ten przedmiot.
}
EOF
5 changes: 5 additions & 0 deletions data/dictionaries/dictionary.PTG
Original file line number Diff line number Diff line change
Expand Up @@ -5299,5 +5299,10 @@
19075=Você não tem cobranças suficientes para enviar tanto peso
19076=O item foi colocado em sua caixa bancária.
19077=A sacola de envio rejeita esse item.
// [19081-19090] Pó de Translocação
19081=Este item não pode absorver mais pó de translocação.
19082=Este item foi saturado com pó de translocação e não pode mais ser recarregado.
19083= brilha com energia verde e absorve o poder mágico do pó.
19084=Pó de translocação não tem efeito neste item.
}
EOF
5 changes: 5 additions & 0 deletions data/dictionaries/dictionary.SPA
Original file line number Diff line number Diff line change
Expand Up @@ -5299,5 +5299,10 @@
19075=No tienes suficientes cargos para enviar tanto peso
19076=El artículo fue colocado en su caja bancaria.
19077=La bolsa de envío rechaza ese artículo.
// [19081-19090] Polvo de Translocación
19081=Este objeto no puede absorber más polvo de translocación.
19082=Este objeto ha sido sobresaturado con polvo de translocación y ya no se puede recargar.
19083= brilla con energía verde y absorbe el poder mágico del polvo.
19084=El polvo de translocación no tiene ningún efecto en este elemento.
}
EOF
5 changes: 5 additions & 0 deletions data/dictionaries/dictionary.ZRO
Original file line number Diff line number Diff line change
Expand Up @@ -5294,5 +5294,10 @@
19075=You don't have enough charges to send that much weight
19076=The item was placed in your bank box.
19077=The bag of sending rejects that item.
// [19081-19090] Powder of Translocation
19081=This item cannot absorb any more powder of translocation.
19082=This item has been oversaturated with powder of translocation and can no longer be recharged.
19083= glows with green energy and absorbs magical power from the powder.
19084=Powder of translocation has no effect on this item.
}
EOF
70 changes: 70 additions & 0 deletions data/js/item/powderoftranslocation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
function onUseChecked( pUser, iPowder )
{
var socket = pUser.socket;
socket.tempObj = iPowder;
socket.CustomTarget( 0 );
}

function onCallback0( socket, myTarget )
{
var pUser = socket.currentChar;
var iPowder = socket.tempObj;

if( !socket.GetWord( 1 ) && myTarget.isItem && ( myTarget.sectionID == "bagofsending" || myTarget.sectionID == "crystalballofpetsummoning" ))
{
var chargeTag = myTarget.GetTag("charges");
if( !chargeTag )
return false;

var myCharges = chargeTag.split("|");
if( myCharges.length != 3 )
return false;

var charges = parseInt( myCharges[0] );
var reCharges = parseInt( myCharges[1] );
var maxCharges = parseInt( myCharges[2] );

if( charges >= maxCharges )
{
socket.SysMessage( GetDictionaryEntry( 19081, socket.language )); // This item cannot absorb any more powder of translocation.
return false;
}

var maxReCharges = maxCharges - charges;
if( maxReCharges > maxCharges - reCharges )
{
maxReCharges = maxCharges - reCharges;
if( maxReCharges == 0 )
{
socket.SysMessage( GetDictionaryEntry( 19082, socket.language )); // This item has been oversaturated with powder of translocation and can no longer be recharged.
return false;
}
}

if( iPowder.amount > maxReCharges )
{
// We've got more powder than we can use
charges += maxReCharges;
iPowder.amount -= maxReCharges;
reCharges += maxReCharges;
}
else
{
// We've got less or exactly the amount of powder we can use
charges += iPowder.amount;
reCharges += iPowder.amount;
iPowder.Delete()
}

myTarget.SetTag( "charges", charges + "|" + reCharges + "|" + maxCharges );
socket.SysMessage( "The " + myTarget.name + GetDictionaryEntry( 19083, socket.language )); // The ~1_translocationItem~ glows with green energy and absorbs magical power from the powder.
myTarget.Refresh();
}
else
{
socket.SysMessage( GetDictionaryEntry( 19084, socket.language )); // Powder of translocation has no effect on this item.
return false;
}
}

function _restorecontext_() {}
1 change: 1 addition & 0 deletions data/js/jse_fileassociations.scp
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@
5056=item/crystalball.js
5057=item/ballofpetsummoning.js
5058=item/bagofsending.js
5059=item/powderoftranslocation.js

//-------------------------------------------
// treasure maps and chest [5400-5405]
Expand Down
5 changes: 4 additions & 1 deletion source/Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
19/12/2023 - Dragon Slayer
Added Powder of translocation. (js powderoftranslocation)

17/12/2023 - Dragon Slayer
Added OnContextMenuRequest and OnContextMenuSelect. (Thanks Xuri)

16/12/2023 - Dragon Slayer
Added Crystal ball that says random msgs. (js crystalball)
Added Crystal Ball of Pet Summoning. (js ballofpetsummoning)
Added Crystal Ball of Pet Summoning. (js ballofpetsummoning)

10/12/2023 - Dragon Slayer
Implemented Check_travel_restriction, Check_teleport, and Check_regeants in magic/helpers (js).
Expand Down

0 comments on commit c4c947c

Please sign in to comment.