Skip to content

Commit

Permalink
Powder of Translaction
Browse files Browse the repository at this point in the history
DragonSlayer62 committed Dec 20, 2023
1 parent c416dfe commit fc16fb4
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
@@ -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
@@ -5290,5 +5290,10 @@
19062=Tato křišťálová koule již není spojena s domácím mazlíčkem.
19063=Nové jméno mazlíčka je: %s
19064=To se nezdá být platným mazlíčkem.
// [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
@@ -5291,5 +5291,10 @@
19062=This crystal ball is no longer linked to a pet.
19063=The new name of the pet is: %s
19064=That does not seem to be a valid pet.
// [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
@@ -5446,5 +5446,10 @@
19062=Cette boule de cristal n'est plus liée à un animal de compagnie.
19063=Le nouveau nom de l'animal est : %s
19064=Cela ne semble pas être un animal de compagnie valide.
// [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
@@ -5290,5 +5290,10 @@
19062=Diese Kristallkugel ist nicht mehr mit einem Haustier verknüpft.
19063=Der neue Name des Haustiers ist: %s
19064=Das scheint kein gültiges Haustier zu sein.
// [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
@@ -5290,5 +5290,10 @@
19062=Questa sfera di cristallo non è più collegata ad un animale domestico.
19063=Il nuovo nome dell'animale è: %s
19064=Non sembra essere un animale domestico valido.
// [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
@@ -5290,5 +5290,10 @@
19062=Ta kryształowa kula nie jest już powiązana ze zwierzakiem.
19063=Nowa nazwa zwierzaka to: %s
19064=Wygląda na to, że to nie jest prawidłowe zwierzę.
// [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
@@ -5290,5 +5290,10 @@
19062=Esta bola de cristal não está mais vinculada a um animal de estimação.
19063=O novo nome do animal de estimação é: %s
19064=Esse não parece ser um animal de estimação válido.
// [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
@@ -5290,5 +5290,10 @@
19062=Esta bola de cristal ya no está vinculada a una mascota.
19063=El nuevo nombre de la mascota es: %s
19064=Esa no parece ser una mascota válida.
// [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
@@ -5285,5 +5285,10 @@
19062=This crystal ball is no longer linked to a pet.
19063=The new name of the pet is: %s
19064=That does not seem to be a valid pet.
// [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
@@ -277,6 +277,7 @@
//reserved for granitebook
5056=item/crystalball.js
5057=item/ballofpetsummoning.js
5059=item/powderoftranslocation.js

//-------------------------------------------
// treasure maps and chest [5400-5405]
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).

0 comments on commit fc16fb4

Please sign in to comment.