Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into More-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DragonSlayer62 committed Apr 6, 2024
2 parents 67680f5 + 0ae55f8 commit 715c638
Show file tree
Hide file tree
Showing 16 changed files with 81 additions and 38 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);
}
}
25 changes: 11 additions & 14 deletions data/js/item/runebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ function onUseChecked( pUser, runeBook )
// get users socket
var pSocket = pUser.socket;

if( runeBook.GetTag( "useDelayed" ))
var iTime = GetCurrentClock();
var NextUse = runeBook.GetTag( "useDelayed" );
var Delay = 7000;

if( ( iTime - NextUse ) < Delay )
{
pSocket.SysMessage( GetDictionaryEntry( 9250, pSocket.language )); // This book needs time to recharge.
return false;
Expand Down Expand Up @@ -500,8 +504,8 @@ function onGumpPress( pSocket, myButton, gumpData )
pSocket.tempInt2 = ( myButton - 30 );
runeBook.SetTag( "inUse", null );
runeBook.SetTag( "userSerial", null );
runeBook.SetTag( "useDelayed", true );
runeBook.StartTimer( useDelay, 100, true );
var iTime = GetCurrentClock();
runeBook.SetTag( "useDelayed", iTime.toString() );
CastSpell( pSocket, pUser, 32, false );
}
else
Expand Down Expand Up @@ -598,8 +602,8 @@ function onGumpPress( pSocket, myButton, gumpData )
pSocket.tempInt2 = ( myButton - 120 );
runeBook.SetTag( "inUse", null );
runeBook.SetTag( "userSerial", null );
runeBook.SetTag( "useDelayed", true );
runeBook.StartTimer( useDelay, 100, true );
var iTime = GetCurrentClock();
runeBook.SetTag( "useDelayed", iTime.toString() );
CastSpell( pSocket, pUser, 32, true );
}
else
Expand Down Expand Up @@ -630,8 +634,8 @@ function onGumpPress( pSocket, myButton, gumpData )
pSocket.tempInt2 = ( myButton - 140 );
runeBook.SetTag( "inUse", null );
runeBook.SetTag( "userSerial", null );
runeBook.SetTag( "useDelayed", true );
runeBook.StartTimer( useDelay, 100, true );
var iTime = GetCurrentClock();
runeBook.SetTag( "useDelayed", iTime.toString() );
CastSpell( pSocket, pUser, 52, true );
}
else
Expand Down Expand Up @@ -813,13 +817,6 @@ function CastSpell( pSocket, pUser, spellNum, checkReagentReq )

function onTimer( timerObj, timerID )
{
if( timerID == 100 )
{
if( ValidateObject( timerObj ) && timerObj.isItem )
{
timerObj.SetTag( "useDelayed", null );
}
}
var pSocket = timerObj.socket;
if( !pSocket )
return;
Expand Down
2 changes: 1 addition & 1 deletion data/js/jse_fileassociations.scp
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@
6000=magic/helper/check_resist.js
6001=magic/helper/calc_final_spell_damage.js
6002=magic/helper/check_travel_restrictions.js
6003=magic/helper/check_teleport.js
6003=magic/helper/teleport_helper.js
6004=magic/helper/check_reagents.js

//-------------------------------------------
Expand Down
13 changes: 13 additions & 0 deletions source/Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
4/06/2024 - Dragon Slayer
Fixed Runebook Cooldown:
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.
Updated Bola to use GetCurrentClock() instead of a timer for delay.
Added checks for flying and grounded states related to the Bola.
Introduced two new dictionary messages for flying and grounded states in all supported languages.
Added a Bola definition tag (dfn) to relevant files for in-game use with 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.

22/03/2024 - Dragon Slayer/Xuri
Leading/trailing whitespace is now trimmed from account names during login.

Expand Down
4 changes: 3 additions & 1 deletion source/UOXJSPropertyFuncs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3317,6 +3317,7 @@ JSBool CSocketProps_getProperty( JSContext *cx, JSObject *obj, jsval id, jsval *
break;
}
case CSOCKP_CURRENTCHAR:
{
myChar = gPriv->CurrcharObj();
if( !ValidateObject( myChar ))
{
Expand All @@ -3327,7 +3328,8 @@ JSBool CSocketProps_getProperty( JSContext *cx, JSObject *obj, jsval id, jsval *
JSObject *myObj = JSEngine->AcquireObject( IUE_CHAR, myChar, JSEngine->FindActiveRuntime( JS_GetRuntime( cx )));
*vp = OBJECT_TO_JSVAL( myObj );
}

break;
}
case CSOCKP_IDLETIMEOUT:
break;
case CSOCKP_WASIDLEWARNED: *vp = BOOLEAN_TO_JSVAL( gPriv->WasIdleWarned() ); break;
Expand Down
2 changes: 1 addition & 1 deletion source/vendor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ bool CPISellItem::Handle( void )
{
if( ValidateObject( k ))
{
if( k->GetId() == j->GetId() && j->GetType() == k->GetType() )
if(( k->GetId() == j->GetId() || k->GetSectionId() == j->GetSectionId() ) && j->GetType() == k->GetType() )
{
if( j->GetId() != 0x14f0 || ( j->GetTempVar( CITV_MOREX ) == k->GetTempVar( CITV_MOREX )))
{
Expand Down

0 comments on commit 715c638

Please sign in to comment.