Skip to content

Commit

Permalink
Merge branch 'develop' into Swing-Speed-Increase
Browse files Browse the repository at this point in the history
  • Loading branch information
Xoduz authored Jan 25, 2025
2 parents 38f1ee5 + 54732fb commit 4fb3d03
Show file tree
Hide file tree
Showing 36 changed files with 1,108 additions and 81 deletions.
1 change: 1 addition & 0 deletions data/dfndata/items/gmmenu/spawners.dfn
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ interval=1 5
visible=1
decay=0
movable=2
script=2205
}

[orcspawn]
Expand Down
49 changes: 49 additions & 0 deletions data/dfndata/items/lootlists.dfn
Original file line number Diff line number Diff line change
Expand Up @@ -962,4 +962,53 @@
100|PaintedPlagueMask
100|PaintedDaemonMask
100|PaintedEvilClownMask
}

// Treasure Map Level 0
[LOOTLIST TreasureMapLvl0Loot]
{//approximately 1%
990|blank
10|treasuremaplvl0
}

// Treasure Map Level 1
[LOOTLIST TreasureMapLvl1Loot]
{//approximately 1%
990|blank
10|treasuremaplvl1
}

// Treasure Map Level 2
[LOOTLIST TreasureMapLvl2Loot]
{//approximately 1%
990|blank
10|treasuremaplvl2
}

// Treasure Map Level 3
[LOOTLIST TreasureMapLvl3Loot]
{//approximately 1%
990|blank
10|treasuremaplvl3
}

// Treasure Map Level 4
[LOOTLIST TreasureMapLvl4Loot]
{//approximately 1%
990|blank
10|treasuremaplvl4
}

// Treasure Map Level 5
[LOOTLIST TreasureMapLvl5Loot]
{//approximately 1%
990|blank
10|treasuremaplvl5
}

// Treasure Map Level 6
[LOOTLIST TreasureMapLvl6Loot]
{//approximately 1%
990|blank
10|treasuremaplvl6
}
8 changes: 4 additions & 4 deletions data/dfndata/skills/skills.dfn
Original file line number Diff line number Diff line change
Expand Up @@ -1206,10 +1206,10 @@ SKILLPOINT=990,5,0
SKILLPOINT=1000,0,0
}

// Imbuing
// Mysticism
[SKILL 55]
{
NAME=IMBUING
NAME=MYSTICISM
STR=0
DEX=0
INT=0
Expand All @@ -1227,10 +1227,10 @@ SKILLPOINT=990,5,0
SKILLPOINT=1000,0,0
}

// Mysticism
// Imbuing
[SKILL 56]
{
NAME=MYSTICISM
NAME=IMBUING
STR=0
DEX=0
INT=0
Expand Down
56 changes: 56 additions & 0 deletions data/js/combat/leechstats.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
function onEquip( pEquipper, iEquipped )
{
pEquipper.AddScriptTrigger( 7003 );
}

// Remove script trigger on unequip
function onUnequip( pUnequipper, iUnequipped )
{
pUnequipper.RemoveScriptTrigger( 7003 );
}

function onDamageDeal( attacker, damaged, damageValue, damageType )
{
// Fetch weapon in main hand or secondary hand
var iWeapon = attacker.FindItemLayer( 0x01 );
if( !ValidateObject( iWeapon ))
{
iWeapon = attacker.FindItemLayer( 0x02 );
}

if( ValidateObject( iWeapon ))
{ // Apply leech effects based on weapon properties
ApplyLeech( attacker, damaged, damageValue, iWeapon, 'healthLeech', 30 );
ApplyLeech( attacker, damaged, damageValue, iWeapon, 'staminaLeech', 100 );
ApplyLeech( attacker, damaged, damageValue, iWeapon, 'manaLeech', 40 );
}

return true;
}

function ApplyLeech( attacker, damaged, damageValue, weapon, leechType, multiplier )
{
// Get the leech amount for the specified leech type from the weapon
var leechPercentVal = weapon[ leechType ];
if( leechPercentVal > 0 )
{
// Calculate the percent of health restored to the attacker
var leechAmt = Math.round( damageValue * ( leechPercentVal / 100 ) * ( multiplier/100 ));

// Apply the leech effect based on the leech type
switch( leechType )
{
case 'healthLeech':
attacker.Heal( leechAmt );
break;
case 'staminaLeech':
attacker.stamina += leechAmt;
break;
case 'manaLeech':
attacker.mana += leechAmt;
break;
}

attacker.SoundEffect( 0x44D, true );
}
}
36 changes: 26 additions & 10 deletions data/js/commands/targeting/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,30 +297,27 @@ function HandleGetItem( socket, ourItem, uKey )
case "DESC":
socket.SysMessage( ourItem.desc );
break;
case "DEF":
socket.SysMessage( ourItem.Resist( 1 ));
break;
case "DEF":
case "RESISTARMOR":
socket.SysMessage( ourObj.Resist( 1 ));
socket.SysMessage( ourItem.Resist( 1 ));
break;
case "RESISTLIGHT":
socket.SysMessage( ourObj.Resist( 2 ));
socket.SysMessage( ourItem.Resist( 2 ));
break;
case "RESISTWATER":
socket.SysMessage( ourObj.Resist( 3 ));
socket.SysMessage( ourItem.Resist( 3 ));
break;
case "RESISTCOLD":
socket.SysMessage( ourObj.Resist( 4 ));
socket.SysMessage( ourItem.Resist( 4 ));
break;
case "RESISTFIRE":
socket.SysMessage( ourObj.Resist( 5 ));
socket.SysMessage( ourItem.Resist( 5 ));
break;
case "RESISTENERGY":
socket.SysMessage( ourObj.Resist( 6 ));
socket.SysMessage( ourItem.Resist( 6 ));
break;
case "RESISTPOISON":
socket.SysMessage( ourObj.Resist( 7 ));
socket.SysMessage( ourItem.Resist( 7 ));
break;
case "ARMORCLASS":
case "ARMOURCLASS":
Expand Down Expand Up @@ -601,8 +598,27 @@ function HandleGetChar( socket, ourChar, uKey )
break;
case "ARMOUR":
case "ARMOR":
case "RESISTARMOR":
socket.SysMessage( ourChar.Resist( 1 ));
break;
case "RESISTLIGHT":
socket.SysMessage( ourChar.Resist( 2 ));
break;
case "RESISTWATER":
socket.SysMessage( ourChar.Resist( 3 ));
break;
case "RESISTCOLD":
socket.SysMessage( ourChar.Resist( 4 ));
break;
case "RESISTFIRE":
socket.SysMessage( ourChar.Resist( 5 ));
break;
case "RESISTENERGY":
socket.SysMessage( ourChar.Resist( 6 ));
break;
case "RESISTPOISON":
socket.SysMessage( ourChar.Resist( 7 ));
break;
case "MAXHP":
socket.SysMessage( ourChar.maxhp );
break;
Expand Down
2 changes: 1 addition & 1 deletion data/js/item/holidays/addondeedgump.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ function CheckForNearbyDoors( myTarget, itemToCheck, pSocket )
}
}

if( myTarget.DistanceTo(itemToCheck) <= 2 )
if( myTarget.DistanceTo( itemToCheck ) <= 2 )
{
return true;
}
Expand Down
2 changes: 0 additions & 2 deletions data/js/item/holidays/candy.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@ function onUseChecked(pUser, iUsed)
}
else
{
socket.SysMessage("test 1");
if( Acidity <= 30 )
{
pUser.SetTempTag( "Acidity", Acidity += 5 );
}

if ( Toothach == 0)
{
socket.SysMessage("test 2");
pUser.SetTempTag( "toothach", 1 );
pUser.StartTimer( 1000, 0, true );
}
Expand Down
2 changes: 1 addition & 1 deletion data/js/item/holidays/halloweenmasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ function onCreateDFN( objMade, objType )
if( objType == 0 )
{
var maskname = "";
switch(objMade.GetTag( "paintedmask" ))
switch( objMade.GetTag( "paintedmask" ))
{
case 1: maskname = "A Evil Clown Mask"; break;
case 2: maskname = "A Daemon Mask"; break;
Expand Down
6 changes: 3 additions & 3 deletions data/js/item/holidays/headonaspike.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function onUseChecked( pUser, iUsed )
var headspike = new Gump;
var head = 0;

switch (iUsed.sectionID)
switch( iUsed.sectionID )
{
case "MrsTroubleMakersHeadOnASpike": head = 30522; break;
case "BrutrinsHeadOnASpike": head = 30522; break;
Expand All @@ -20,7 +20,7 @@ function onUseChecked( pUser, iUsed )
default: head = 30522;
}

headspike.AddGump(100, 100, head);
headspike.Send(pUser);
headspike.AddGump( 100, 100, head );
headspike.Send( pUser );
headspike.Free();
}
8 changes: 4 additions & 4 deletions data/js/item/holidays/holidaypottedplant.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ function onUseChecked( pUser, iUsed )
PottedPlantGump( pUser, iUsed );
}

function PottedPlantGump(pUser, iUsed)
function PottedPlantGump( pUser, iUsed )
{
var socket = pUser.socket;
socket.tempObj = iUsed;
var pottedPlant = new Gump;

pottedPlant.AddPage( 0 );
pottedPlant.AddBackground(0, 0, 360, 195, 0xA28);
pottedPlant.AddBackground( 0, 0, 360, 195, 0xA28 );

pottedPlant.AddPage( 1 );
pottedPlant.AddText( 45, 15, 0, "Choose a Potted Plant:" );
Expand All @@ -35,7 +35,7 @@ function PottedPlantGump(pUser, iUsed)
pottedPlant.Free();
}

function onGumpPress(pSock, pButton, gumpData)
function onGumpPress( pSock, pButton, gumpData )
{
var pUser = pSock.currentChar;
var iUsed = pSock.tempObj;
Expand All @@ -48,7 +48,7 @@ function onGumpPress(pSock, pButton, gumpData)
}

var pottedplant = "";
if ( pButton >= 1 && pButton <= 5 )
if( pButton >= 1 && pButton <= 5 )
{
var plantIds = [0x11C8, 0x11C9, 0x11CA, 0x11CB, 0x11CC];
pottedplant = "0x" + ( plantIds[pButton - 1] ).toString( 16 );
Expand Down
20 changes: 10 additions & 10 deletions data/js/item/holidays/pumpkins.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function onCreateDFN( objMade, objType )

if( objMade.id == 0x0C6A || objMade.id == 0x0C6B )
{
objMade.weight = Math.floor(Math.random() * ( 2500 - 1200 + 1 ) + 1200);
objMade.weight = Math.floor( Math.random() * ( 2500 - 1200 + 1 ) + 1200 );
}
else if( objMade.id == 0x0C6C )
{
Expand Down Expand Up @@ -72,22 +72,22 @@ function onUseChecked( pUser, iUsed )
// Randomize countdown length, if enabled
if( randomizePumpkinCountdown )
{
iUsed.speed = RandomNumber(iUsed.speed - 1, iUsed.speed + 1);
iUsed.speed = RandomNumber( iUsed.speed - 1, iUsed.speed + 1 );
}
// Item's speed forms the basis of the countdownTime
var countdownTime = iUsed.speed * 1000;

// Start the initial timer that shows the first number over the character/object's head
iUsed.StartTimer(200, 1, true);
iUsed.StartTimer( 200, 1, true );

// Start timers with IDs from 2, and count until we reach item's speed + 1
var iCount = 2;
for (iCount = 2; iCount < (iUsed.speed + 2); iCount++)
for( iCount = 2; iCount < ( iUsed.speed + 2 ); iCount++ )
{
iUsed.StartTimer((iCount - 1) * 1000, iCount, true);
iUsed.StartTimer(( iCount - 1) * 1000, iCount, true );
}

socket.CustomTarget(0, GetDictionaryEntry(1348, socket.language)); //Now would be a good time to throw it!
socket.CustomTarget( 0, GetDictionaryEntry( 1348, socket.language )); //Now would be a good time to throw it!
}
return false;
}
Expand All @@ -96,7 +96,7 @@ function onCallback0( socket, ourObj )
{
var mChar = socket.currentChar;
var iUsed = socket.tempObj;
if ( mChar && mChar.isChar && iUsed && iUsed.isItem )
if( mChar && mChar.isChar && iUsed && iUsed.isItem )
{
var StrangeByte = socket.GetWord( 1 );
if( StrangeByte == 0 && ourObj )
Expand All @@ -107,7 +107,7 @@ function onCallback0( socket, ourObj )
iUsed.container = null;
iUsed.Teleport( ourObj );
}
else
else
{
socket.SysMessage( GetDictionaryEntry( 1646, socket.language )); // You cannot see that

Expand Down Expand Up @@ -252,7 +252,7 @@ function ApplyExplosionDamage( timerObj, targetChar )
return;

// Deal damage, and do criminal check for source character!
targetChar.Damage(RandomNumber( timerObj.lodamage, timerObj.hidamage ), 5, sourceChar, true );
targetChar.Damage( RandomNumber( timerObj.lodamage, timerObj.hidamage ), 5, sourceChar, true );

// If target is an NPC, make them attack the person who threw the potion!
if( targetChar.npc && targetChar.target == null && targetChar.atWar == false )
Expand Down Expand Up @@ -299,7 +299,7 @@ function onPickup( iPickedUp, pGrabber, containerObj )
else if( iPickedUp.GetTag( "Named" ) == 0 )
{
iPickedUp.name = pGrabber.name + " Pumpkin";
iPickedUp.SetTag("Named", 1);
iPickedUp.SetTag( "Named", 1 );
}
}
return true;
Expand Down
6 changes: 3 additions & 3 deletions data/js/item/holidays/snowpile.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function onCallback0( socket, myTarget )
pUser.visible = 0;
}

if (!socket.GetWord(1) && myTarget.isChar && myTarget.socket )
if( !socket.GetWord( 1 ) && myTarget.isChar && myTarget.socket )
{
pUser.DoAction( 0x9 );
pUser.SoundEffect( 0x145, true );
Expand All @@ -73,10 +73,10 @@ function onCallback0( socket, myTarget )
}
}

function onTimer( pUser, timerID )
function onTimer( pUser, timerID )
{
var socket = pUser.socket;
if( pUser.visible == 1 || pUser.visible == 2 )
if( pUser.visible == 1 || pUser.visible == 2 )
{
pUser.visible = 0;
}
Expand Down
Loading

0 comments on commit 4fb3d03

Please sign in to comment.