Base: TFS 0.3.6, Version 8.60
Hello guys, this is my first topic so I apologize if I made somemistake.
I have a problem adding a new shoottype to my server. I modified the sprites with Object Builder (in this case I added a few more shoottypes), modified the source (Tools.cpp and Const.h), compiled and included it in the \ lib \000-constant file, following the protocol.
I run the server and it goes normally, even when I use the command / x or / z (I don't remember which one is related to shoottype now) it informs me that I have 46 shoottypes, since it is the correct one. However, when I attack with the new weapon and, consequently, the new shoottype, it gives debugging on the client and no error on the distro. And the most iconic thing is that when I relog, the monster took the hits normally. Because I see him low life.
Remembering that I only use 46 shoottypes and the normal one (which already comes on the standard tibia 8.60 server) is 42. My last shoottype is number 46 in the object builder and 45 in the sources and 000-constant.lua.
I put this in the items.lua:
<attribute key = "shootType" value = "prismaticarrow" />
Which is consistent with what I added in the sources and compiled. When I replace the new sprites in place of others, for example: I put the prismatic arrow in place of the normal cake (id 42) it works fine. The problem is with the new shoottypes (id 43, 44, 45 and 46) it is not with the sprites, it seems to me.
Thanks.
My tools.cpp:
My 000-constant.lua:
My const.h:
Hello guys, this is my first topic so I apologize if I made somemistake.
I have a problem adding a new shoottype to my server. I modified the sprites with Object Builder (in this case I added a few more shoottypes), modified the source (Tools.cpp and Const.h), compiled and included it in the \ lib \000-constant file, following the protocol.
I run the server and it goes normally, even when I use the command / x or / z (I don't remember which one is related to shoottype now) it informs me that I have 46 shoottypes, since it is the correct one. However, when I attack with the new weapon and, consequently, the new shoottype, it gives debugging on the client and no error on the distro. And the most iconic thing is that when I relog, the monster took the hits normally. Because I see him low life.
Remembering that I only use 46 shoottypes and the normal one (which already comes on the standard tibia 8.60 server) is 42. My last shoottype is number 46 in the object builder and 45 in the sources and 000-constant.lua.
I put this in the items.lua:
<attribute key = "shootType" value = "prismaticarrow" />
Which is consistent with what I added in the sources and compiled. When I replace the new sprites in place of others, for example: I put the prismatic arrow in place of the normal cake (id 42) it works fine. The problem is with the new shoottypes (id 43, 44, 45 and 46) it is not with the sprites, it seems to me.
Thanks.
My tools.cpp:
Lua:
ShootTypeNames shootTypeNames[] =
{
{"spear", SHOOT_EFFECT_SPEAR},
{"bolt", SHOOT_EFFECT_BOLT},
{"arrow", SHOOT_EFFECT_ARROW},
{"fire", SHOOT_EFFECT_FIRE},
{"energy", SHOOT_EFFECT_ENERGY},
{"poisonarrow", SHOOT_EFFECT_POISONARROW},
{"burstarrow", SHOOT_EFFECT_BURSTARROW},
{"throwingstar", SHOOT_EFFECT_THROWINGSTAR},
{"throwingknife", SHOOT_EFFECT_THROWINGKNIFE},
{"smallstone", SHOOT_EFFECT_SMALLSTONE},
{"death", SHOOT_EFFECT_DEATH},
{"largerock", SHOOT_EFFECT_LARGEROCK},
{"snowball", SHOOT_EFFECT_SNOWBALL},
{"powerbolt", SHOOT_EFFECT_POWERBOLT},
{"poison", SHOOT_EFFECT_POISONFIELD},
{"infernalbolt", SHOOT_EFFECT_INFERNALBOLT},
{"huntingspear", SHOOT_EFFECT_HUNTINGSPEAR},
{"enchantedspear", SHOOT_EFFECT_ENCHANTEDSPEAR},
{"redstar", SHOOT_EFFECT_REDSTAR},
{"greenstar", SHOOT_EFFECT_GREENSTAR},
{"royalspear", SHOOT_EFFECT_ROYALSPEAR},
{"sniperarrow", SHOOT_EFFECT_SNIPERARROW},
{"onyxarrow", SHOOT_EFFECT_ONYXARROW},
{"piercingbolt", SHOOT_EFFECT_PIERCINGBOLT},
{"whirlwindsword", SHOOT_EFFECT_WHIRLWINDSWORD},
{"whirlwindaxe", SHOOT_EFFECT_WHIRLWINDAXE},
{"whirlwindclub", SHOOT_EFFECT_WHIRLWINDCLUB},
{"etherealspear", SHOOT_EFFECT_ETHEREALSPEAR},
{"ice", SHOOT_EFFECT_ICE},
{"earth", SHOOT_EFFECT_EARTH},
{"holy", SHOOT_EFFECT_HOLY},
{"suddendeath", SHOOT_EFFECT_SUDDENDEATH},
{"flasharrow", SHOOT_EFFECT_FLASHARROW},
{"flammingarrow", SHOOT_EFFECT_FLAMMINGARROW},
{"flamingarrow", SHOOT_EFFECT_FLAMMINGARROW},
{"shiverarrow", SHOOT_EFFECT_SHIVERARROW},
{"energyball", SHOOT_EFFECT_ENERGYBALL},
{"smallice", SHOOT_EFFECT_SMALLICE},
{"smallholy", SHOOT_EFFECT_SMALLHOLY},
{"smallearth", SHOOT_EFFECT_SMALLEARTH},
{"eartharrow", SHOOT_EFFECT_EARTHARROW},
{"explosion", SHOOT_EFFECT_EXPLOSION},
{"cake", SHOOT_EFFECT_CAKE},
{"prismaticarrow", SHOOT_EFFECT_PRISMATICARROW},
{"prismaticbolt", SHOOT_EFFECT_PRISMATICBOLT},
{"diamondarrow", SHOOT_EFFECT_DIAMONDARROW},
{"naturespear", SHOOT_EFFECT_NATURESPEAR}
};
My 000-constant.lua:
Code:
CONST_ANI_SPEAR = 0
CONST_ANI_BOLT = 1
CONST_ANI_ARROW = 2
CONST_ANI_FIRE = 3
CONST_ANI_ENERGY = 4
CONST_ANI_POISONARROW = 5
CONST_ANI_BURSTARROW = 6
CONST_ANI_THROWINGSTAR = 7
CONST_ANI_THROWINGKNIFE = 8
CONST_ANI_SMALLSTONE = 9
CONST_ANI_DEATH = 10
CONST_ANI_LARGEROCK = 11
CONST_ANI_SNOWBALL = 12
CONST_ANI_POWERBOLT = 13
CONST_ANI_POISON = 14
CONST_ANI_INFERNALBOLT = 15
CONST_ANI_HUNTINGSPEAR = 16
CONST_ANI_ENCHANTEDSPEAR = 17
CONST_ANI_REDSTAR = 18
CONST_ANI_GREENSTAR = 19
CONST_ANI_ROYALSPEAR = 20
CONST_ANI_SNIPERARROW = 21
CONST_ANI_ONYXARROW = 22
CONST_ANI_PIERCINGBOLT = 23
CONST_ANI_WHIRLWINDSWORD = 24
CONST_ANI_WHIRLWINDAXE = 25
CONST_ANI_WHIRLWINDCLUB = 26
CONST_ANI_ETHEREALSPEAR = 27
CONST_ANI_ICE = 28
CONST_ANI_EARTH = 29
CONST_ANI_HOLY = 30
CONST_ANI_SUDDENDEATH = 31
CONST_ANI_FLASHARROW = 32
CONST_ANI_FLAMMINGARROW = 33
CONST_ANI_SHIVERARROW = 34
CONST_ANI_ENERGYBALL = 35
CONST_ANI_SMALLICE = 36
CONST_ANI_SMALLHOLY = 37
CONST_ANI_SMALLEARTH = 38
CONST_ANI_EARTHARROW = 39
CONST_ANI_EXPLOSION = 40
CONST_ANI_CAKE = 41
CONST_ANI_PRISMATICARROW = 42
CONST_ANI_PRISMATICBOLT = 43
CONST_ANI_DIAMONDARROW = 44
CONST_ANI_NATURESPEAR = 45
CONST_ANI_WEAPONTYPE = 254
CONST_ANI_NONE = 255
CONST_ANI_LAST = CONST_ANI_NATURESPEAR
My const.h:
Code:
enum ShootEffect_t
{
SHOOT_EFFECT_SPEAR = 0x00,
SHOOT_EFFECT_BOLT = 0x01,
SHOOT_EFFECT_ARROW = 0x02,
SHOOT_EFFECT_FIRE = 0x03,
SHOOT_EFFECT_ENERGY = 0x04,
SHOOT_EFFECT_POISONARROW = 0x05,
SHOOT_EFFECT_BURSTARROW = 0x06,
SHOOT_EFFECT_THROWINGSTAR = 0x07,
SHOOT_EFFECT_THROWINGKNIFE = 0x08,
SHOOT_EFFECT_SMALLSTONE = 0x09,
SHOOT_EFFECT_DEATH = 0x0A, //10
SHOOT_EFFECT_LARGEROCK = 0x0B, //11
SHOOT_EFFECT_SNOWBALL = 0x0C, //12
SHOOT_EFFECT_POWERBOLT = 0x0D, //13
SHOOT_EFFECT_POISONFIELD = 0x0E, //14
SHOOT_EFFECT_INFERNALBOLT = 0x0F, //15
SHOOT_EFFECT_HUNTINGSPEAR = 0x10, //16
SHOOT_EFFECT_ENCHANTEDSPEAR = 0x11, //17
SHOOT_EFFECT_REDSTAR = 0x12, //18
SHOOT_EFFECT_GREENSTAR = 0x13, //19
SHOOT_EFFECT_ROYALSPEAR = 0x14, //20
SHOOT_EFFECT_SNIPERARROW = 0x15, //21
SHOOT_EFFECT_ONYXARROW = 0x16, //22
SHOOT_EFFECT_PIERCINGBOLT = 0x17, //23
SHOOT_EFFECT_WHIRLWINDSWORD = 0x18, //24
SHOOT_EFFECT_WHIRLWINDAXE = 0x19, //25
SHOOT_EFFECT_WHIRLWINDCLUB = 0x1A, //26
SHOOT_EFFECT_ETHEREALSPEAR = 0x1B, //27
SHOOT_EFFECT_ICE = 0x1C, //28
SHOOT_EFFECT_EARTH = 0x1D, //29
SHOOT_EFFECT_HOLY = 0x1E, //30
SHOOT_EFFECT_SUDDENDEATH = 0x1F, //31
SHOOT_EFFECT_FLASHARROW = 0x20, //32
SHOOT_EFFECT_FLAMMINGARROW = 0x21, //33
SHOOT_EFFECT_SHIVERARROW = 0x22, //34
SHOOT_EFFECT_ENERGYBALL = 0x23, //35
SHOOT_EFFECT_SMALLICE = 0x24, //36
SHOOT_EFFECT_SMALLHOLY = 0x25, //37
SHOOT_EFFECT_SMALLEARTH = 0x26, //38
SHOOT_EFFECT_EARTHARROW = 0x27, //39
SHOOT_EFFECT_EXPLOSION = 0x28, //40
SHOOT_EFFECT_CAKE = 0x29, //41
SHOOT_EFFECT_PRISMATICARROW = 0x30, //42
SHOOT_EFFECT_PRISMATICBOLT = 0x31, //43
SHOOT_EFFECT_DIAMONDARROW = 0x32, //44
SHOOT_EFFECT_NATURESPEAR = 0x33, //45
SHOOT_EFFECT_LAST = SHOOT_EFFECT_NATURESPEAR,
//for internal use, dont send to client
SHOOT_EFFECT_WEAPONTYPE = 0xFE, //254
SHOOT_EFFECT_NONE = 0xFF,
SHOOT_EFFECT_UNKNOWN = 0xFFFF
};