Skip to content

Commit

Permalink
Merge pull request #215 from DragonSlayer62/Spell-Channeling-Property
Browse files Browse the repository at this point in the history
Spell Channeling Property
  • Loading branch information
Xoduz authored Nov 11, 2023
2 parents f6461de + 63e9315 commit efc8950
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion data/js/item/runebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ function CastSpell( pSocket, pUser, spellNum, checkReagentReq )
// Is the player casting recall holding any objects?
var itemRHand = pUser.FindItemLayer( 0x01 );
var itemLHand = pUser.FindItemLayer( 0x02 );
if( ValidateObject( itemLHand ) || ( ValidateObject( itemRHand ) && itemRHand.type != 9 )) // Spellbook
if( ValidateObject( itemLHand ) && itemLHand.type != 119 || ( ValidateObject( itemRHand ) && ( itemRHand.type != 9 || itemRHand.type != 119 ))) // Spellbook //spell channeling
{
pSocket.SysMessage( GetDictionaryEntry( 708, pSocket.language )); // You cannot cast with a weapon equipped.
return;
Expand Down
2 changes: 1 addition & 1 deletion data/js/magic/clumsy.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function onSpellCast( mSock, mChar, directCast, spellNum )
{
var itemRHand = mChar.FindItemLayer( 0x01 );
var itemLHand = mChar.FindItemLayer( 0x02 );
if( itemLHand || ( itemRHand && itemRHand.type != 9 )) // Spellbook
if(( itemLHand && itemLHand.type != 119 ) || ( itemRHand && ( itemRHand.type != 9 || itemRHand.type != 119 ))) // Spellbook
{
if( mSock != null )
{
Expand Down
2 changes: 1 addition & 1 deletion data/js/magic/createfood.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function onSpellCast( mSock, mChar, directCast, spellNum )
{
var itemRHand = mChar.FindItemLayer( 0x01 );
var itemLHand = mChar.FindItemLayer( 0x02 );
if( itemLHand || ( itemRHand && itemRHand.type != 9 )) // Spellbook
if(( itemLHand && itemLHand.type != 119 ) || ( itemRHand && ( itemRHand.type != 9 || itemRHand.type != 119 ))) // Spellbook
{
if( mSock )
{
Expand Down
2 changes: 1 addition & 1 deletion data/js/magic/level1targ.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function ItemInHandCheck( mChar, mSock, spellType )
{
var itemRHand = mChar.FindItemLayer( 0x01 );
var itemLHand = mChar.FindItemLayer( 0x02 );
if( itemLHand || ( itemRHand && itemRHand.type != 9 )) // Spellbook
if(( itemLHand && itemLHand.type != 119 ) || ( itemRHand && ( itemRHand.type != 9 || itemRHand.type != 119 ))) // Spellbook
{
if( mSock )
{
Expand Down
5 changes: 5 additions & 0 deletions source/CPacketSend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7465,6 +7465,11 @@ void CPToolTip::CopyItemData( CItem& cItem, size_t &totalStringLen, bool addAmou
tempEntry.ourText = oldstrutil::number( cItem.GetTempVar( CITV_MOREZ ));
FinalizeData( tempEntry, totalStringLen );
}
if( cItem.GetType() == IT_SPELLCHANNELING )
{
tempEntry.stringNum = 1060482; // spell channeling
FinalizeData( tempEntry, totalStringLen );
}

bool hideMagicItemStats = cwmWorldState->ServerData()->HideStatsForUnknownMagicItems();
if( !cwmWorldState->ServerData()->BasicTooltipsOnly() && ( !hideMagicItemStats || ( hideMagicItemStats && ( !cItem.GetName2().empty() && cItem.GetName2() == "#"))))
Expand Down
3 changes: 3 additions & 0 deletions source/cPlayerAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2853,6 +2853,8 @@ bool HandleDoubleClickTypes( CSocket *mSock, CChar *mChar, CItem *iUsed, ItemTyp
}
}
return true;
case IT_SPELLCHANNELING: // Spell Channeling
return true;
case IT_MAP: // Map
{
CPMapMessage m1;
Expand Down Expand Up @@ -3389,6 +3391,7 @@ void InitTagToItemType( void )
tagToItemType["CLOCK"] = IT_CLOCK;
tagToItemType["SEXTANT"] = IT_SEXTANT;
tagToItemType["HAIRDYE"] = IT_HAIRDYE;
tagToItemType["SPELLCHANNELING"] = IT_SPELLCHANNELING;
}

ItemTypes FindItemTypeFromTag( const std::string &strToFind )
Expand Down
1 change: 1 addition & 0 deletions source/enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ enum ItemTypes
IT_ZEROKILLSGATE = 111,
IT_PLANK = 117,
IT_FIREWORKSWAND = 118,
IT_SPELLCHANNELING = 119,
IT_ESCORTNPCSPAWNER = 125,
IT_RENAMEDEED = 186,
IT_LEATHERREPAIRTOOL = 190,
Expand Down
2 changes: 1 addition & 1 deletion source/magic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4114,7 +4114,7 @@ bool CMagic::SelectSpell( CSocket *mSock, SI32 num )
{
CItem *itemRHand = mChar->GetItemAtLayer( IL_RIGHTHAND );
CItem *itemLHand = mChar->GetItemAtLayer( IL_LEFTHAND );
if( itemLHand != nullptr || ( itemRHand != nullptr && itemRHand->GetType() != IT_SPELLBOOK ))
if(( itemLHand != nullptr && itemLHand->GetType() != IT_SPELLCHANNELING ) || ( itemRHand != nullptr && itemRHand->GetType() != IT_SPELLBOOK && itemRHand->GetType() != IT_SPELLCHANNELING ))
{
mSock->SysMessage( 708 ); // You cannot cast with a weapon equipped.
mChar->StopSpell();
Expand Down

0 comments on commit efc8950

Please sign in to comment.