Skip to content

Commit

Permalink
bola adjustaments
Browse files Browse the repository at this point in the history
  • Loading branch information
DragonSlayer62 committed Apr 6, 2024
1 parent 1d4cd9d commit 0e23b54
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 21 deletions.
5 changes: 5 additions & 0 deletions data/dfndata/items/gear/weapons/missile_weapons.dfn
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ good=23
origin=td
}

[bola]
{
get=0x26AC
}

//------------------------------------------------------------------------------------------------//

// SAMURAI EMPIRE
Expand Down
2 changes: 2 additions & 0 deletions data/dictionaries/dictionary.CSY
Original file line number Diff line number Diff line change
Expand Up @@ -2554,6 +2554,8 @@
2794=pro %i zlato
2795=Z trosek vylovíš nějaké drahokamy.
2796=* Tvé tělo se zmítá v křečích z elektrického šoku *
2797=Toto nemůžete použít při létání!
2798=Byli jste uzemněni.
// [2800-2999] House script
2800=Vlastník domu:
2801=VLASTNÍCI DOMU
Expand Down
2 changes: 2 additions & 0 deletions data/dictionaries/dictionary.ENG
Original file line number Diff line number Diff line change
Expand Up @@ -2554,6 +2554,8 @@
2794=for %i gold
2795=You scrounge some gems from the wreckage.
2796=* Your body convulses from electric shock *
2797=You can't use this while flying!
2798=You have been grounded.
// [2800-2999] House script
2800=House Owner:
2801=CO-OWNERS
Expand Down
2 changes: 2 additions & 0 deletions data/dictionaries/dictionary.FRE
Original file line number Diff line number Diff line change
Expand Up @@ -2718,6 +2718,8 @@
2794=pour %i d'or
2795=Vous récupérez quelques pierres précieuses dans les décombres.
2796=* Votre corps convulse sous l'effet du choc électrique *
2797=Vous ne pouvez pas l'utiliser en vol !
2798=Vous avez été cloué au sol.
// [2800-2999] House script
2800=Propriétaire de la maison :
2801=CO-PARENTS
Expand Down
2 changes: 2 additions & 0 deletions data/dictionaries/dictionary.GER
Original file line number Diff line number Diff line change
Expand Up @@ -2554,6 +2554,8 @@
2794=für %i Gold
2795=Du schnappst dir ein paar Edelsteine aus den Trümmern.
2796=* Dein Körper verkrampft sich durch den Stromschlag *
2797=Sie können dies nicht während des Fliegens verwenden!
2798=Sie haben Hausverbot.
// [2800-2999] House script
2800=Hauseigentümer:
2801=HAUSBESITZER
Expand Down
2 changes: 2 additions & 0 deletions data/dictionaries/dictionary.ITA
Original file line number Diff line number Diff line change
Expand Up @@ -2554,6 +2554,8 @@
2794=per %i oro
2795=Raccolgi alcune gemme dai rottami.
2796=* Il tuo corpo è in preda alle convulsioni a causa delle scosse elettriche.
2797=Non puoi usarlo mentre voli!
2798=Sei stato messo a terra.
// [2800-2999] House Scripts
2800=Proprietario della casa:
2801=COOPERATORI
Expand Down
2 changes: 2 additions & 0 deletions data/dictionaries/dictionary.POL
Original file line number Diff line number Diff line change
Expand Up @@ -2554,6 +2554,8 @@
2794=Za %i złota
2795=Zgarniasz trochę klejnotów z wraku.
2796=* Twoje ciało drży od porażenia prądem *.
2797=Nie możesz tego używać podczas lotu!
2798=Zostałeś uziemiony.
// [2800-2999] Skrypt domu
2800=Właściciel domu:
2801=WŁAŚCICIELE
Expand Down
2 changes: 2 additions & 0 deletions data/dictionaries/dictionary.PTG
Original file line number Diff line number Diff line change
Expand Up @@ -2554,6 +2554,8 @@
2794=para %i ouro
2795=Vocês procuram algumas pedras preciosas nos destroços.
2796=* Your body convulses from electric shock *
2797=Você não pode usar isto enquanto voa!
2798=Você foi castigado.
// [2800-2999] House script
2800=Possuidor da casa:
2801=CO-PROPRIETÁRIOS
Expand Down
2 changes: 2 additions & 0 deletions data/dictionaries/dictionary.SPA
Original file line number Diff line number Diff line change
Expand Up @@ -2554,6 +2554,8 @@
2794=por %i oro
2795=Buscas algunas gemas entre los escombros.
2796=* Tu cuerpo convulsiona por la descarga eléctrica *
2797=¡No puedes usar esto mientras vuelas!
2798=Has sido castigado.
// [2800-2999] Escritura de la casa
2800=Propietario de la casa:
2801=CO-OWNERS
Expand Down
2 changes: 2 additions & 0 deletions data/dictionaries/dictionary.ZRO
Original file line number Diff line number Diff line change
Expand Up @@ -2554,6 +2554,8 @@
2794=for %i gold
2795=You scrounge some gems from the wreckage.
2796=* Your body convulses from electric shock *
2797=You can't use this while flying!
2798=You have been grounded.
// [2800-2999] House script
2800=House Owner:
2801=CO-OWNERS
Expand Down
50 changes: 29 additions & 21 deletions data/js/item/bola.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
function onUseChecked( pUser, iUsed )
{
var socket = pUser.socket;
var iTime = GetCurrentClock();
var NextUse = iUsed.GetTempTag( "bolaDelayed" );
var Delay = 10000;

if ( pUser.visible == 1 || pUser.visible == 2 )
{
pUser.visible = 0;
Expand All @@ -25,23 +29,24 @@ function onUseChecked( pUser, iUsed )
pUser.SysMessage( GetDictionaryEntry( 2713, socket.language )); // You cannot use this while riding a mount.
return false;
}
if( pUser.GetTag( "bola" ) == null || pUser.GetTag( "bola" ) == 0)
else if( pUser.isflying )
{
socket.tempObj = iUsed;
pUser.SetTag( "bola", 1 );

//the addition of the false-flag in the EmoteMessage below tells the server to only
//send the message to this character
pUser.EmoteMessage( GetDictionaryEntry( 2714, socket.language ), false ); // * You begin to swing the bola...*
pUser.StartTimer( 3000, 0, true );
pUser.SysMessage( GetDictionaryEntry( 2797, socket.language )); // You can't use this while flying!
return false;
}
else if( pUser.GetTag( "bola" ) == 1 )
else if(( iTime - NextUse ) < Delay )
{
pUser.SysMessage( GetDictionaryEntry( 2715, socket.language )); // You have to wait a few moments before you can use another bola!
return false;
}
else
{
return true;
socket.tempObj = iUsed;
pUser.EmoteMessage( GetDictionaryEntry( 2714, socket.language )); // * You begin to swing the bola...*
var tempMsg = GetDictionaryEntry( 2720, socket.language ); // %s begins to menacingly swing a bola...
pUser.EmoteMessage( tempMsg.replace( /%s/gi, pUser.name ));
iUsed.SetTempTag( "bolaDelayed", iTime.toString() );
pUser.StartTimer( 3000, 0, true );
}
}
return false;
Expand All @@ -59,7 +64,7 @@ function onCallback0( socket, myTarget)
if( !socket.GetWord( 1 ) && myTarget.isChar )
{
// Don't allow throwing bolas at Young players, or Young players throwing bolas at other players
if( GetServerSetting( "YoungPlayerStatus" ))
if( GetServerSetting( "YoungPlayerSystem" ))
{
if(( !myTarget.npc && myTarget.account.isYoung )
|| ( myTarget.npc && ValidateObject( myTarget.owner ) && !myTarget.owner.npc && myTarget.owner.account.isYoung ))
Expand All @@ -80,7 +85,18 @@ function onCallback0( socket, myTarget)

if( pUser.InRange( myTarget, 8 ))
{
if( myTarget.isonhorse )
if( myTarget.isflying )
{
myTarget.isflying = false;
pUser.DoAction( 0x9 );
DoMovingEffect( pUser, myTarget, 0x26AC, 0x10, 0x00, false );
if( myTarget.socket != null )
{
myTarget.socket.SysMessage( GetDictionaryEntry( 2798, myTarget.socket.language )); // You have been grounded
}
iUsed.Delete();
}
else if( myTarget.isonhorse )
{
myTarget.Dismount();
pUser.DoAction( 0x9 );
Expand Down Expand Up @@ -117,14 +133,6 @@ function onTimer( pUser, timerID )

if( timerID == 0 )
{
var tempMsg = GetDictionaryEntry( 2720, socket.language ); // %s begins to menacingly swing a bola...
pUser.EmoteMessage( tempMsg.replace( /%s/gi, pUser.name ));
pUser.StartTimer( 1000, 1, true );
}

if( timerID == 1 )
{
pUser.SetTag( "bola", null );
socket.CustomTarget( 0 );
socket.CustomTarget(0);
}
}
7 changes: 7 additions & 0 deletions source/Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
The Runebook now uses GetCurrentClock() instead of a timer, ensuring accurate checks for a 7-second delay using the system clock of the server.
Teleport Helper Name Correction:
The incorrect name in jse_fileassociations for the Teleport Helper has been fixed.
Bola Cooldown Update:
You’ve modified the Bola functionality to use GetCurrentClock() instead of a timer for handling delays. This change ensures accurate timing behavior.
Additionally, you’ve added checks for flying and grounded states related to the Bola.
Dictionary Messages:
Introduced two new dictionary messages for flying and grounded states. These messages will be available in all supported languages.
Bola Definition Tag:
The Bola now has a definition tag (dfn) in the relevant files. This allows you to add the Bola item in the game using the command 'add item bola'.

30/03/2024 - Dragon Slayer/Xuri
Fixed a bug where crafted items were not selling properly. Now, players can successfully sell their crafted gear at vendors.
Expand Down

0 comments on commit 0e23b54

Please sign in to comment.