Skip to content

Commit

Permalink
Merge branch 'develop' into DFN-Item-Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Xoduz authored Mar 15, 2024
2 parents 8b1ef94 + 40d65be commit 9c8b08b
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/UOX3Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-13]
os: [ubuntu-latest, windows-latest, macos-latest]
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ${{ matrix.os }}
Expand Down
22 changes: 22 additions & 0 deletions data/js/commands/targeting/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,28 @@ function HandleGetItem( socket, ourItem, uKey )
case "DEF":
socket.SysMessage( ourItem.Resist( 1 ));
break;
case "DEF":
case "RESISTARMOR":
socket.SysMessage( ourObj.Resist( 1 ));
break;
case "RESISTLIGHT":
socket.SysMessage( ourObj.Resist( 2 ));
break;
case "RESISTWATER":
socket.SysMessage( ourObj.Resist( 3 ));
break;
case "RESISTCOLD":
socket.SysMessage( ourObj.Resist( 4 ));
break;
case "RESISTFIRE":
socket.SysMessage( ourObj.Resist( 5 ));
break;
case "RESISTENERGY":
socket.SysMessage( ourObj.Resist( 6 ));
break;
case "RESISTPOISON":
socket.SysMessage( ourObj.Resist( 7 ));
break;
case "ARMORCLASS":
case "ARMOURCLASS":
case "AC":
Expand Down
29 changes: 29 additions & 0 deletions data/js/commands/targeting/set.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,35 @@ function onCallback0( socket, ourObj )
ourObj.fame = nVal;
okMsg( socket );
break;
case "DEF":
case "RESISTARMOR":
ourObj.Resist( 1, nVal );
okMsg( socket );
break;
case "RESISTLIGHT":
ourObj.Resist( 2, nVal );
okMsg( socket );
break;
case "RESISTWATER":
ourObj.Resist( 3, nVal );
okMsg( socket );
break;
case "RESISTCOLD":
ourObj.Resist( 4, nVal );
okMsg( socket );
break;
case "RESISTFIRE":
ourObj.Resist( 5, nVal );
okMsg( socket );
break;
case "RESISTENERGY":
ourObj.Resist( 6, nVal );
okMsg( socket );
break;
case "RESISTPOISON":
ourObj.Resist( 7, nVal );
okMsg( socket );
break;
case "HP":
case "HEALTH":
ourObj.health = nVal;
Expand Down
6 changes: 3 additions & 3 deletions data/js/magic/clumsy.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ function onSpellCast( mSock, mChar, directCast, spellNum )
{
//Check for enough reagents
// type == 0 -> SpellBook
if( spellType == 0 && !TriggerEvent( 6004, "CheckReagents", pUser, mSpell))
if( spellType == 0 && !TriggerEvent( 6004, "CheckReagents", mChar, mSpell))
{
mChar.SetTimer( Timer.SPELLTIME, 0 );
mChar.isCasting = false;
Expand Down Expand Up @@ -194,7 +194,7 @@ function onSpellCast( mSock, mChar, directCast, spellNum )

if( spellType == 0 )
{
TriggerEvent( 6004, "DeleteReagents", pUser, mSpell );
TriggerEvent( 6004, "DeleteReagents", mChar, mSpell );
mChar.SpellFail();
mChar.SetTimer( Timer.SPELLTIME, 0 );
mChar.isCasting = false;
Expand Down Expand Up @@ -318,7 +318,7 @@ function onSpellSuccess( mSock, mChar, ourTarg )
}
if( !mChar.npc && spellType == 0 )
{
TriggerEvent( 6004, "DeleteReagents", pUser, mSpell );
TriggerEvent( 6004, "DeleteReagents", mChar, mSpell );
}

if( !mChar.InRange( ourTarg, 10 ))
Expand Down
6 changes: 3 additions & 3 deletions data/js/magic/createfood.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ function onSpellSuccess( mSock, mChar, ourTarg )
{
//Check for enough reagents
// type == 0 -> SpellBook
if( spellType == 0 && !TriggerEvent( 6004, "CheckReagents", pUser, mSpell))
if( spellType == 0 && !TriggerEvent( 6004, "CheckReagents", mChar, mSpell))
{
mChar.SetTimer( Timer.SPELLTIME, 0 );
mChar.isCasting = false;
Expand Down Expand Up @@ -263,7 +263,7 @@ function onSpellSuccess( mSock, mChar, ourTarg )
// Only remove reagents for normal spells
if( spellType == 0 )
{
TriggerEvent( 6004, "DeleteReagents", pUser, mSpell );
TriggerEvent( 6004, "DeleteReagents", mChar, mSpell );
mChar.SpellFail();
mChar.SetTimer( Timer.SPELLTIME, 0 );
mChar.isCasting = false;
Expand All @@ -280,7 +280,7 @@ function onSpellSuccess( mSock, mChar, ourTarg )
}
if( !mChar.npc && spellType == 0 )
{
TriggerEvent( 6004, "DeleteReagents", pUser, mSpell );
TriggerEvent( 6004, "DeleteReagents", mChar, mSpell );
}

sourceChar.SoundEffect( mSpell.soundEffect, true );
Expand Down
6 changes: 3 additions & 3 deletions data/js/magic/level1targ.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ function onSpellSuccess( mSock, mChar, ourTarg, spellID )
{
//Check for enough reagents
// type == 0 -> SpellBook
if( spellType == 0 && !TriggerEvent( 6004, "CheckReagents", pUser, mSpell))
if( spellType == 0 && !TriggerEvent( 6004, "CheckReagents", mChar, mSpell))
{
mChar.SetTimer( Timer.SPELLTIME, 0 );
mChar.isCasting = false;
Expand All @@ -393,7 +393,7 @@ function onSpellSuccess( mSock, mChar, ourTarg, spellID )
{
if( spellType == 0 )
{
TriggerEvent( 6004, "DeleteReagents", pUser, mSpell );
TriggerEvent( 6004, "DeleteReagents", mChar, mSpell );
mChar.SpellFail();
mChar.SetTimer( Timer.SPELLTIME, 0 );
mChar.isCasting = false;
Expand All @@ -410,7 +410,7 @@ function onSpellSuccess( mSock, mChar, ourTarg, spellID )
}
if( !mChar.npc && spellType == 0 )
{
TriggerEvent( 6004, "DeleteReagents", pUser, mSpell );
TriggerEvent( 6004, "DeleteReagents", mChar, mSpell );
}

if( !mChar.InRange( ourTarg, 10 ) )
Expand Down
4 changes: 4 additions & 0 deletions source/Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
18/02/2024 - Dragon Slayer/Xuri
Updated set and get commands (set.js, get.js) with additional ways to set/get resistance types on objects using the syntax 'set/set [type] #. Available resistance types:
resistarmor, resistlight, resistwater, resistcold, resistfire, resistenergy, resistpoison

20/12/2023 - Dragon Slayer
Added Elixiers of Ingot Conversions (js ElixierOfIngots)

Expand Down

0 comments on commit 9c8b08b

Please sign in to comment.