Exedion
Active Member
- Joined
- Jun 11, 2007
- Messages
- 628
- Reaction score
- 30
Hello people! today i release my SlingShot Script, it work with SMALL STONES in the arrow slot and distance fighting skills!!
please enjoy!
* Create a lua file in "data/weapons/scripts" and named it slingshot.lua and add this code:
*in weapons.xml add:
*and last replace in items.xml your slingshot code with this:
(you can edit the attack speed if you whant)
Please comment and if you like it add reputation, i will return the favor...
please enjoy!
* Create a lua file in "data/weapons/scripts" and named it slingshot.lua and add this code:
PHP:
--SlingShot Script By Exedion
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, TRUE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLSTONE)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1.5, -20, 2.2, 0)
function onUseWeapon(cid, var)
local stone = getPlayerSlotItem(cid, CONST_SLOT_AMMO)
if stone.itemid == 1294 then
doCombat(cid, combat, var)
doRemoveItem(stone.uid, 1)
end
return TRUE
end
*in weapons.xml add:
PHP:
<distance id="5907" level="50" unproperly="1" event="script" value="slingshot.lua"> <!-- SlingShot by Exedion -->
<vocation name="Paladin"/>
<vocation name="Royal Paladin" showInDescription="0"/>
</distance>
*and last replace in items.xml your slingshot code with this:
PHP:
<item id="5907" article="a" name="slingshot">
<attribute key="attackSpeed" value="500"/>
<attribute key="slotType" value="two-handed"/>
<attribute key="weaponType" value="distance"/>
<attribute key="range" value="6"/>
<attribute key="hitChance" value="100"/>
<attribute key="attack" value="5"/>
<attribute key="weight" value="1200"/>
</item>
Please comment and if you like it add reputation, i will return the favor...