• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

New Ammo Type

Brudny

New Member
Joined
Jul 15, 2010
Messages
6
Reaction score
0
Location
Chorzów, Poland
Hello. I would be nice if someone helped me add a new type of ammunition.

Currently I have added M4A1 and M4A1 Ammo to spirte, tibia.dat, items.otb and
items.xml

<item id="10546" article="an" name="M4A1 Ammo" plural="M4A1 Ammo">
<attribute key="weight" value="90"/>
<attribute key="attack" value="43"/>
<attribute key="weaponType" value="ammunition"/>
<attribute key="ammoType" value="m4a1ammo"/>
<attribute key="shootType" value="infernalbolt"/>
<attribute key="ammoAction" value="removecount"/>
<attribute key="range" value="7"/>
</item>
<item id="10545" article="the" name="M4A1">
<attribute key="weight" value="12000"/>
<attribute key="slotType" value="two-handed"/>
<attribute key="weaponType" value="distance"/>
<attribute key="ammoType" value="m4a1ammo"/>
<attribute key="range" value="7"/>
<attribute key="hitChance" value="20"/>
<attribute key="attack" value="350"/>
</item>

but server says of course "Warning: [Items::loadFromXml] Unknown ammoType m4a1ammo
Warning: [Items::loadFromXml] Unknown ammoType m4a1ammo"

so how i can create new type of ammo?
 
tools.cpp
[cpp]AmmoTypeNames ammoTypeNames[] =
{
{"spear", AMMO_SPEAR},
{"arrow", AMMO_ARROW},
{"poisonarrow", AMMO_ARROW},
{"burstarrow", AMMO_ARROW},
{"bolt", AMMO_BOLT},
{"powerbolt", AMMO_BOLT},
{"smallstone", AMMO_STONE},
{"largerock", AMMO_STONE},
{"throwingstar", AMMO_THROWINGSTAR},
{"throwingknife", AMMO_THROWINGKNIFE},
{"snowball", AMMO_SNOWBALL},
{"huntingspear", AMMO_SPEAR},
{"royalspear", AMMO_SPEAR},
{"enchantedspear", AMMO_SPEAR},
{"sniperarrow", AMMO_ARROW},
{"onyxarrow", AMMO_ARROW},
{"piercingbolt", AMMO_BOLT},
{"infernalbolt", AMMO_BOLT},
{"flasharrow", AMMO_ARROW},
{"flammingarrow", AMMO_ARROW},
{"flamingarrow", AMMO_ARROW},
{"shiverarrow", AMMO_ARROW},
{"eartharrow", AMMO_ARROW},
{"etherealspear", AMMO_SPEAR}
};[/cpp]
const.h
[cpp]enum Ammo_t
{
AMMO_NONE = 0,
AMMO_BOLT = 1,
AMMO_ARROW = 2,
AMMO_SPEAR = 3,
AMMO_THROWINGSTAR = 4,
AMMO_THROWINGKNIFE = 5,
AMMO_STONE = 6,
AMMO_SNOWBALL = 7
};[/cpp]
add new at end
 
Back
Top