Skip to content

Commit

Permalink
Add new magic and distance effect constants
Browse files Browse the repository at this point in the history
Thanks to @comedinha for the patch.
  • Loading branch information
marksamman committed Mar 31, 2015
1 parent dbac265 commit 97458df
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 13 deletions.
2 changes: 1 addition & 1 deletion data/talkactions/scripts/looktype.lua
Expand Up @@ -4,7 +4,7 @@ function onSay(player, words, param)
end

local lookType = tonumber(param)
if lookType >= 0 and lookType ~= 1 and lookType ~= 135 and lookType ~= 411 and lookType ~= 415 and lookType ~= 424 and (lookType <= 160 or lookType >= 192) and lookType ~= 439 and lookType ~= 440 and lookType ~= 468 and lookType ~= 469 and (lookType < 474 or lookType > 485) and lookType ~= 501 and lookType ~= 518 and lookType ~= 519 and lookType ~= 520 and lookType ~= 524 and lookType ~= 525 and lookType ~= 536 and lookType ~= 543 and lookType ~= 549 and lookType ~= 576 and lookType ~= 581 and lookType ~= 582 and lookType <= 595 then
if lookType >= 0 and lookType ~= 1 and lookType ~= 135 and lookType ~= 411 and lookType ~= 415 and lookType ~= 424 and (lookType <= 160 or lookType >= 192) and lookType ~= 439 and lookType ~= 440 and lookType ~= 468 and lookType ~= 469 and (lookType < 474 or lookType > 485) and lookType ~= 501 and lookType ~= 518 and lookType ~= 519 and lookType ~= 520 and lookType ~= 524 and lookType ~= 525 and lookType ~= 536 and lookType ~= 543 and lookType ~= 549 and lookType ~= 576 and lookType ~= 581 and lookType ~= 582 and lookType ~= 597 and lookType ~= 616 and lookType ~= 623 and lookType ~= 625 and (lookType <= 637 or lookType >= 644) and (lookType <= 644 or lookType >= 647) and (lookType <= 651 or lookType >= 664) and lookType <= 699 then
local playerOutfit = player:getOutfit()
playerOutfit.lookType = lookType
player:setOutfit(playerOutfit)
Expand Down
18 changes: 13 additions & 5 deletions src/const.h
Expand Up @@ -23,6 +23,8 @@
#define NETWORKMESSAGE_MAXSIZE 24590

enum MagicEffectClasses : uint8_t {
CONST_ME_NONE,

CONST_ME_DRAWBLOOD = 1,
CONST_ME_LOSEENERGY = 2,
CONST_ME_POFF = 3,
Expand Down Expand Up @@ -101,13 +103,16 @@ enum MagicEffectClasses : uint8_t {
CONST_ME_CONFETTI_VERTICAL = 76,
// 77-157 are empty
CONST_ME_BLACKSMOKE = 158,

//for internal use, dont send to client
CONST_ME_NONE = 0xFF,
// 159-166 are empty
CONST_ME_REDSMOKE = 167,
CONST_ME_YELLOWSMOKE = 168,
CONST_ME_GREENSMOKE = 169,
CONST_ME_PURPLESMOKE = 170,
};

enum ShootType_t : uint8_t {
CONST_ANI_NONE = 0,
CONST_ANI_NONE,

CONST_ANI_SPEAR = 1,
CONST_ANI_BOLT = 2,
CONST_ANI_ARROW = 3,
Expand Down Expand Up @@ -159,7 +164,10 @@ enum ShootType_t : uint8_t {
CONST_ANI_DRILLBOLT = 50,
CONST_ANI_ENVENOMEDARROW = 51,

//for internal use, dont send to client
CONST_ANI_GLOOTHSPEAR = 53,
CONST_ANI_SIMPLEARROW = 54,

// for internal use, don't send to client
CONST_ANI_WEAPONTYPE = 0xFE, // 254
};

Expand Down
10 changes: 8 additions & 2 deletions src/luascript.cpp
Expand Up @@ -1299,6 +1299,7 @@ void LuaScriptInterface::registerFunctions()
registerEnum(CONDITION_PARAM_SUBID)
registerEnum(CONDITION_PARAM_FIELD)

registerEnum(CONST_ME_NONE)
registerEnum(CONST_ME_DRAWBLOOD)
registerEnum(CONST_ME_LOSEENERGY)
registerEnum(CONST_ME_POFF)
Expand Down Expand Up @@ -1376,8 +1377,12 @@ void LuaScriptInterface::registerFunctions()
registerEnum(CONST_ME_CONFETTI_HORIZONTAL)
registerEnum(CONST_ME_CONFETTI_VERTICAL)
registerEnum(CONST_ME_BLACKSMOKE)
registerEnum(CONST_ME_NONE)
registerEnum(CONST_ME_REDSMOKE)
registerEnum(CONST_ME_YELLOWSMOKE)
registerEnum(CONST_ME_GREENSMOKE)
registerEnum(CONST_ME_PURPLESMOKE)

registerEnum(CONST_ANI_NONE)
registerEnum(CONST_ANI_SPEAR)
registerEnum(CONST_ANI_BOLT)
registerEnum(CONST_ANI_ARROW)
Expand Down Expand Up @@ -1426,8 +1431,9 @@ void LuaScriptInterface::registerFunctions()
registerEnum(CONST_ANI_CRYSTALLINEARROW)
registerEnum(CONST_ANI_DRILLBOLT)
registerEnum(CONST_ANI_ENVENOMEDARROW)
registerEnum(CONST_ANI_GLOOTHSPEAR)
registerEnum(CONST_ANI_SIMPLEARROW)
registerEnum(CONST_ANI_WEAPONTYPE)
registerEnum(CONST_ANI_NONE)

registerEnum(CONST_PROP_BLOCKSOLID)
registerEnum(CONST_PROP_HASHEIGHT)
Expand Down
16 changes: 11 additions & 5 deletions src/tools.cpp
Expand Up @@ -557,7 +557,11 @@ MagicEffectNames magicEffectNames[] = {
{"ferumbras", CONST_ME_FERUMBRAS},
{"confettihorizontal", CONST_ME_CONFETTI_HORIZONTAL},
{"confettivertical", CONST_ME_CONFETTI_VERTICAL},
{"blacksmoke", CONST_ME_BLACKSMOKE}
{"blacksmoke", CONST_ME_BLACKSMOKE},
{"redsmoke", CONST_ME_REDSMOKE},
{"yellowsmoke", CONST_ME_YELLOWSMOKE},
{"greensmoke", CONST_ME_GREENSMOKE},
{"purplesmoke", CONST_ME_PURPLESMOKE},
};

ShootTypeNames shootTypeNames[] = {
Expand Down Expand Up @@ -608,7 +612,9 @@ ShootTypeNames shootTypeNames[] = {
{"prismaticbolt", CONST_ANI_PRISMATICBOLT},
{"crystallinearrow", CONST_ANI_CRYSTALLINEARROW},
{"drillbolt", CONST_ANI_DRILLBOLT},
{"envenomedarrow", CONST_ANI_ENVENOMEDARROW}
{"envenomedarrow", CONST_ANI_ENVENOMEDARROW},
{"gloothspear", CONST_ANI_GLOOTHSPEAR},
{"simplearrow", CONST_ANI_SIMPLEARROW},
};

CombatTypeNames combatTypeNames[] = {
Expand All @@ -623,7 +629,7 @@ CombatTypeNames combatTypeNames[] = {
{"drown", COMBAT_DROWNDAMAGE},
{"ice", COMBAT_ICEDAMAGE},
{"holy", COMBAT_HOLYDAMAGE},
{"death", COMBAT_DEATHDAMAGE}
{"death", COMBAT_DEATHDAMAGE},
};

AmmoTypeNames ammoTypeNames[] = {
Expand All @@ -649,13 +655,13 @@ AmmoTypeNames ammoTypeNames[] = {
{"flasharrow", AMMO_ARROW},
{"flammingarrow", AMMO_ARROW},
{"shiverarrow", AMMO_ARROW},
{"eartharrow", AMMO_ARROW}
{"eartharrow", AMMO_ARROW},
};

WeaponActionNames weaponActionNames[] = {
{"move", WEAPONACTION_MOVE},
{"removecharge", WEAPONACTION_REMOVECHARGE},
{"removecount", WEAPONACTION_REMOVECOUNT}
{"removecount", WEAPONACTION_REMOVECOUNT},
};

SkullNames skullNames[] = {
Expand Down

0 comments on commit 97458df

Please sign in to comment.