• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

throwable cake script

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

Naamloos.jpg

Naamloos2.jpg

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
 
Back
Top