Skip to content

Instantly share code, notes, and snippets.

View Langerz82's full-sized avatar

Joshua L Langerz82

View GitHub Profile
(function() {
//var jQuery = $;
function PxGamepad() {
// map button indices to names
this.buttonNames = [
'a',
'b',
'x',
diff --git a/Diablo.vcxproj b/Diablo.vcxproj
index dcdb974..261b9a8 100644
--- a/Diablo.vcxproj
+++ b/Diablo.vcxproj
@@ -198,6 +197,7 @@
<ClCompile Include="Source\towners.cpp" />
<ClCompile Include="Source\track.cpp" />
<ClCompile Include="Source\trigs.cpp" />
+ <ClCompile Include="Source\util.cpp" />
<ClCompile Include="Source\wave.cpp" />
diff --git a/Source/cursor.cpp b/Source/cursor.cpp
index 923f07c3..1aa6a318 100644
--- a/Source/cursor.cpp
+++ b/Source/cursor.cpp
@@ -196,8 +196,8 @@ void CheckCursMove()
sy = VIEWPORT_HEIGHT - 1;
}
if (!zoomflag) {
- sx >>= 1;
- sy >>= 1;
Formulas.crit = function(attacker, defender) {
var modDiff = attacker.crit + attacker.weaponEnchantedPoint;
var statDiff = (attacker instanceof Player) ? ~~(attacker.stats.strength/5) + ~~(attacker.stats.agility/5) + ~~(attacker.stats.luck / 3) : (attacker.level * 2)
- (defender instanceof Player) ? ~~(defender.stats.strength/5) + ~~(defender.stats.agility/5) + ~~(defender.stats.luck / 3) : (defender.level * 2);
var chance = (Utils.randomRange(0,400) <= Utils.clamp(5, 190, 15 + statDiff + modDiff));
//log.info("chance="+chance);
return chance;
}
// This calculates the triangle points in a rectangle grid.
// Used for 3D Webgl texture mapping.
// Copyright Joshua Langley 2019.
var rows=4;
var cols=4;
var LRs=2;
var triPoints = 6;
var grid = rows*cols;
var totalTris = grid*LRs;
// Read Synchrously
var fs = require("fs");
function getRandomInt(max) {
return Math.floor(Math.random() * Math.floor(max));
}
var map = fs.readFileSync("newworld1-1.json");
var jsonMap = JSON.parse(map);
console.log("Output Content : \n"+ jsonMap.backgroundcolor);
diff --git a/src/game/WorldHandlers/Spell.cpp b/src/game/WorldHandlers/Spell.cpp
index 28b2eab..c5a3e1e 100644
--- a/src/game/WorldHandlers/Spell.cpp
+++ b/src/game/WorldHandlers/Spell.cpp
@@ -264,12 +264,25 @@ void SpellCastTargets::write(ByteBuffer& data) const
{ data << m_strTarget; }
}
+void Spell::ApplySpellInfoHotfixes()
+{
diff --git a/src/game/Server/WorldSession.h b/src/game/Server/WorldSession.h
index 920096b..f763af8 100644
--- a/src/game/Server/WorldSession.h
+++ b/src/game/Server/WorldSession.h
@@ -648,6 +648,8 @@ class WorldSession
void HandleResurrectResponseOpcode(WorldPacket& recvPacket);
void HandleSummonResponseOpcode(WorldPacket& recv_data);
+ bool IsDefaultChatChannel(const char* channelName);
+
diff --git a/src/game/WorldHandlers/SpellEffects.cpp b/src/game/WorldHandlers/SpellEffects.cpp
index 73b58bf..0ede320 100644
--- a/src/game/WorldHandlers/SpellEffects.cpp
+++ b/src/game/WorldHandlers/SpellEffects.cpp
@@ -926,6 +926,39 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)
m_caster->CastCustomSpell(m_caster, 23783, &basepoints, NULL, NULL, true, NULL);
return;
}
+ case 24531: // Refocus
+ {
#include "ScriptPCH.h"
#include "ScriptedGossip.h"
#include "WorldSession.h"
#include "SpellAuras.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "GossipDef.h"
#include "Creature.h"