Skip to content

Instantly share code, notes, and snippets.

src/game/Group.cpp | 33 ++++++++++++++++++++++++
src/game/Group.h | 3 ++
src/game/GroupHandler.cpp | 3 ++
src/game/Object.cpp | 62 ++++++++++++++++++++++++++++++++++++++++++++-
src/game/Object.h | 3 ++
src/game/TradeHandler.cpp | 6 +++-
src/game/Unit.cpp | 3 ++
src/game/Unit.h | 9 ++++++-
8 files changed, 118 insertions(+), 4 deletions(-)
bool Unit::IsSpellCrit(...)
{
....
// Creatures cant crit with spells
if (GetTypeId() == TYPEID_UNIT && (((Creature*)this)->GetSubtype() == CREATURE_SUBTYPE_GENERIC // If its normal creature
|| (((Creature*)this)->GetSubtype() == CREATURE_SUBTYPE_TEMPORARY_SUMMON && !((Creature*)this)->GetOwnerGUID())) // or temporary summon without owner, hope this is correct
&& spellProto->DmgClass == SPELL_DAMAGE_CLASS_MAGIC) // Also affect only magic
return false;
....
}
@Tasssadar
Tasssadar / gist:642687
Created October 23, 2010 20:57
Highguid instance
diff --git a/src/game/ObjectGuid.cpp b/src/game/ObjectGuid.cpp
index eefc901..c297263 100644
--- a/src/game/ObjectGuid.cpp
+++ b/src/game/ObjectGuid.cpp
@@ -37,6 +37,7 @@ char const* ObjectGuid::GetTypeName(HighGuid high)
case HIGHGUID_DYNAMICOBJECT:return "DynObject";
case HIGHGUID_CORPSE: return "Corpse";
case HIGHGUID_MO_TRANSPORT: return "MoTransport";
+ case HIGHGUID_INSTANCE: return "InstanceID";
default:
@Tasssadar
Tasssadar / kindle_xkcd_screensaver.sh
Created December 26, 2011 15:50
This script will periodicaly try to download newest xkcd comic strip and put it into /mnt/us/screensaver, so it will show as screensaver
#!/bin/sh
# This script will periodicaly try to download newest xkcd comic strip
# and put it into /mnt/us/screensaver, so it will show as screensaver
# It is for Kindle 4 and requires screensaver hack
lastVer=0
w=0
h=0
while :; do
echo "check"
rm /tmp/xkcd &> /dev/null
@Tasssadar
Tasssadar / kindle_eink.sh
Created December 27, 2011 12:31
This script will change between two eink modes - normal and fast-redraw with ungly font on predefined key sequence. Currently it is 2x back 2x home.
#!/bin/sh
# This script will change between two eink modes - normal and fast-redraw with ungly font
# on predefined key sequence. Currently it is 2x back 2x home.
# It also can show battery level in % - that is 2x home, look at the bottom of the screen
# It is for Kindle 4
#
# Key codes
# 158 1 - back
# 29 1 - keyboard
# 102 1 - home
@Tasssadar
Tasssadar / snake.js
Created March 15, 2012 19:58
JavaScript implementation of Snake game for Lorris
var MOVE_UP = 0;
var MOVE_DOWN = 1;
var MOVE_LEFT = 2;
var MOVE_RIGHT = 3;
var STEP_LEN = script.height;
clearTerm();
var timer = newTimer();
@Tasssadar
Tasssadar / protocol.js
Created March 30, 2012 19:40
Lorris (JavaScript) implementation of our communication protocol
var SMSG_POT_VALUES_8 = 0x00; // (int8_t x, int8_t y) pro kazdy joystick, min -128, max 127
var SMSG_POT_VALUES_16 = 0x01; // (int16_t x, int16_t y) pro kazdy joystick, min -32768, max 32787
var SMSG_BINARY_VALUES = 0x02; // (uint8_t count, uint8_t values...) hodnoty napr. z tlacitek, count je pocet,
// values muze byt vice bytu podle poctu tlacitek
var SMSG_SET_MOTOR_POWER_8 = 0x03; // (int8_t right, int8_t left) hodnoty pro nastaveni motoru, min -128, max 127
var SMSG_SET_MOTOR_POWER_16 = 0x04; // (int16_t right, int16_t left) hodnoty pro nastaveni motoru, min -32768, max 32767
var SMSG_GET_VALUES = 0x05; // (uint8_t valueType) typ hodnoty, viz Prikazy clienta.
// Dalsi data jsou potreba v pripade CMSG_RANGE_VALUE a CMSG_COLOR_VALUE,
// kdy struktura vypada takto: (uint16_t valueType, uint8_t sensorId)
var CMSG_BOA
diff --git a/src/connection/connection.cpp b/src/connection/connection.cpp
index 3b9d95b..a62adee 100644
--- a/src/connection/connection.cpp
+++ b/src/connection/connection.cpp
@@ -25,7 +25,7 @@
#include "../WorkTab/WorkTab.h"
Connection::Connection()
- : m_type(0), m_state(st_disconnected), m_refcount(1), m_removable(true)
+ : m_type(0), m_state(st_disconnected), m_refcount(1), m_tabcount(0), m_removable(true)
@Tasssadar
Tasssadar / lorris_mac.diff
Created June 2, 2012 23:57
Patch for lorris to make it compilable under Mac OS X
diff --git a/dep/SDL/include/SDL_main.h b/dep/SDL/include/SDL_main.h
index 3312cb6..38564a3 100644
--- a/dep/SDL/include/SDL_main.h
+++ b/dep/SDL/include/SDL_main.h
@@ -51,8 +51,9 @@
* }
* @endcode
*/
-#ifndef USING_PCH
+#if !defined USING_PCH && !defined(Q_OS_MAC)
@Tasssadar
Tasssadar / py_snake.py
Created June 10, 2012 13:32
Python implementation of Snake game for Lorris
from random import *
MOVE_UP = 0
MOVE_DOWN = 1
MOVE_LEFT = 2
MOVE_RIGHT = 3
STEP_LEN = script.height
terminal.clear()