Skip to content

Commit

Permalink
Merge branch 'develop' into Plant-Growing-System
Browse files Browse the repository at this point in the history
  • Loading branch information
Xoduz authored Jan 4, 2025
2 parents 747ce72 + af5c34a commit 7a25042
Show file tree
Hide file tree
Showing 7 changed files with 278 additions and 69 deletions.
150 changes: 150 additions & 0 deletions data/dfndata/items/gear/clothing/aos_clothing.dfn
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
[0x2684]
{
get=base_clothing
name=hooded shroud of shadows
id=0x2684
colour=0x455
newbie
weight=300
value=68 34
layer=0x16
def=7
hp=50
orgin=aos
}

[0x2683]
{
get=0x2684
id=0x2683
}

[hoodedshroudofshadows]
{
get=0x2684 0x2683
}

[0x2310]
{
get=base_clothing
name=formal shirt
id=0x2310
weight=100
value=55 27
layer=0x5
str=1
hp=50
orgin=aos
}

[0x230F]
{
get=0x2310
id=0x230F
}

[formalshirt]
{
get=0x2310 0x230F
}

[0x2307]
{
get=base_clothing
name=fur boots
id=0x2307
weight=300
value=45 22
layer=0x03
def=6
hp=30
str=10
dyeable=1
decay=1
good=19
restock=10
orgin=aos
}

[0x2308]
{
get=0x2307
id=0x2308
}

[furboots]
{
get=0x2307 0x2308
}

[0x230A]
{
get=base_clothing
name=fur cap
id=0x230A
weight=500
value=43 21
layer=0x14
def=5
hp=50
orgin=aos
}

[0x2309]
{
get=0x230A
id=0x2309
}

[furcap]
{
get=0x230A 0x2309
}

[0x230C]
{
get=base_clothing
name=fur sarong
id=0x230C
weight=200
value=31 15
layer=0x17
def=3
hp=50
orgin=aos
}

[0x230B]
{
get=0x230C
id=0x230B
}

[fursarong]
{
get=0x230C 0x230B
}

[0x230E]
{
get=base_clothing
name=gilded dress
id=0x230E
weight=200
value=56 28
layer=0x11
def=4
hp=50
orgin=aos
}

[0x230D]
{
get=0x230E
id=0x230D
}

[gildeddress]
{
get=0x230E 0x230D
}
45 changes: 29 additions & 16 deletions data/js/magic/clumsy.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,17 @@ function onSpellCast( mSock, mChar, directCast, spellNum )
// The following loop checks to see if any item is currently equipped (if not a GM)
if( mChar.commandlevel < 2 )
{
if( spellType != 2 )
if( spellType != 2 )
{
var itemRHand = mChar.FindItemLayer( 0x01 );
var itemLHand = mChar.FindItemLayer( 0x02 );
var lHandBlocks = false;
var rHandBlocks = false;

// Evaluate blocking for left and right hand items
if( isSpellCastingAllowed( itemRHand ) || isSpellCastingAllowed( itemLHand ))
if( !isSpellCastingAllowed( itemRHand ) || !isSpellCastingAllowed( itemLHand ))
{
var result = handleItem( itemLHand, itemRHand, mChar );
var result = AutoUnequipAttempt( itemLHand, itemRHand, mChar );
lHandBlocks = result.lHandBlocks;
rHandBlocks = result.rHandBlocks;
}
Expand All @@ -137,7 +137,6 @@ function onSpellCast( mSock, mChar, directCast, spellNum )
return true;
}
}
return false;
}

if( mChar.visible == 1 || mChar.visible == 2 )
Expand Down Expand Up @@ -228,6 +227,7 @@ function onSpellCast( mSock, mChar, directCast, spellNum )
if( !GetServerSetting( "CastSpellsWhileMOving" ))
{
mChar.frozen = true;
mChar.Refresh();
}
}
else
Expand Down Expand Up @@ -257,7 +257,7 @@ function onSpellCast( mSock, mChar, directCast, spellNum )
mChar.TextMessage( tempString );
mChar.isCasting = true;

mChar.StartTimer( delay, spellNum, true );
mChar.StartTimer( delay * 1000, spellNum, true );

return true;
}
Expand All @@ -266,6 +266,7 @@ function onTimer( mChar, timerID )
{
mChar.isCasting = false;
mChar.frozen = false;
mChar.Refresh();

if( mChar.npc )
{
Expand Down Expand Up @@ -406,27 +407,39 @@ function onSpellSuccess( mSock, mChar, ourTarg )
}

// Function to check if an equipped item allows casting
function isSpellCastingAllowed( item )
function isSpellCastingAllowed( item )
{
return item != null && ( item.type == 9 || item.type == 119 ); // Assuming type 9 is spellbook, and type 119 is spell channeling item
}

// Function to handle items
function handleItem( itemLHand, itemRHand, mChar )
function AutoUnequipAttempt( itemLHand, itemRHand, mChar )
{
const UnEquipEnabled = GetServerSetting("AutoUnequippedCasting");
const autoUnequip = GetServerSetting( "AutoUnequippedCasting" );
var lHandBlocks = false; // Default to false
var rHandBlocks = false; // Default to false
if( UnEquipEnabled && itemLHand != null && !isSpellCastingAllowed( itemLHand ))
{ // Allow casting if item is spell channeling or type 9 spell book
itemLHand.container = mChar.pack;
lHandBlocks = true; // Set to true if item is blocking
if( itemLHand != null && !isSpellCastingAllowed( itemLHand ))
{
if( autoUnequip && mChar.pack.totalItemCount < mChar.pack.maxItems )
{
itemLHand.container = mChar.pack;
}
else
{
lHandBlocks = true; // Set to true if item is blocking
}
}

if( UnEquipEnabled && itemRHand != null && !isSpellCastingAllowed( itemRHand ))
{ // Allow casting if item is spell channeling or type 9 spell book
itemRHand.container = mChar.pack;
rHandBlocks = true; // Set to true if item is blocking
if( itemRHand != null && !isSpellCastingAllowed( itemRHand ))
{
if( autoUnequip && mChar.pack.totalItemCount < mChar.pack.maxItems )
{
itemRHand.container = mChar.pack;
}
else
{
rHandBlocks = true; // Set to true if item is blocking
}
}
return { lHandBlocks: lHandBlocks, rHandBlocks: rHandBlocks };
}
Expand Down
Loading

0 comments on commit 7a25042

Please sign in to comment.