strychi
New Member
- Joined
- Feb 16, 2011
- Messages
- 17
- Reaction score
- 1
this is my first script with weapons and i wanne share i with otland the script i make is for the TFS 2.15 and works 100% this version and need to work fine on other TFS version
its just a fun script for people that wanne try it ;p
here are some pics how it works


here the script
data/weapons/weapons.xml
data/weapons/script/cake.lua
data/items/items.xml
thanks for your time ;p enjoy the script (sorry for bad english)
also check my server ip: titanoffibula.no-ip.org 9.80-9.86
its just a fun script for people that wanne try it ;p
here are some pics how it works


here the script
data/weapons/weapons.xml
PHP:
<distance id="6394" script="cake.lua"/>
data/weapons/script/cake.lua
PHP:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_CAKE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_CAKE)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 1.0, 0)
local xCombat = createCombatObject()
setCombatParam(xCombat, COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE)
local condition = createConditionObject(CONDITION_POISON)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 4, 2000, -2)
addDamageCondition(condition, 6, 2000, -1)
setCombatCondition(xCombat, condition)
function onUseWeapon(cid, var)
local ret = doCombat(cid, combat, var)
if(ret == LUA_ERROR) then
return LUA_ERROR
end
local target = variantToNumber(var)
if(target ~= 0) then
-- chance to poison the enemy
local chance = math.random(0, 100)
if(chance > 90) then
ret = doCombat(cid, xCombat, var)
end
end
return ret
end
data/items/items.xml
PHP:
<item id="6394" article="a" name="cream cake">
<attribute key="weight" value="500" />
<attribute key="attack" value="90" />
<attribute key="weaponType" value="distance" />
<attribute key="shootType" value="enchantedspear" />
<attribute key="range" value="11" />
<attribute key="breakChance" value="1" />
<attribute key="ammoAction" value="removecount" />
thanks for your time ;p enjoy the script (sorry for bad english)
also check my server ip: titanoffibula.no-ip.org 9.80-9.86