• 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!

Spell [Weapon] Spell for Knights "Rune Blade"

Shinmaru

エロルアー Scripter!
Joined
Aug 20, 2007
Messages
1,988
Reaction score
88
Location
Puerto Rico
[Creator Details = Start]
Creator Name: 375311
Creator URL:
OtLand - View Profile: 375311
Creator E-mail: N/A
Creator's Script Full Name: Rune Blade
[Creator Details = End]

First create a folder in 'data/spells/scripts/' and name it 'rune_blade', that done now
we commence. And I want to give thanks to my Guinea Pig:
THIS GUY-------->
testsubjectorc.png

for taking the beating of his life time. :p

[Install [Fire Blade] = Start]
Script Name: fire_blade.lua
Type: Spell
Lua Location: data/spells/scripts/rune_blade/
Lua Code:
Lua:
function onCastSpell(cid, var)
local left = getPlayerSlotItem(cid, 6)
local right = getPlayerSlotItem(cid, 5)
	if left.itemid == 7417 then
		doSetItemActionId(left.uid, 12001)
		doSetItemSpecialDescription(left.uid, "It is enhanced with fire magic.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREATTACK)
	elseif right.itemid == 7417 then
		doSetItemActionId(right.uid, 12001)
		doSetItemSpecialDescription(right.uid, "It is enhanced with fire magic.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREATTACK)
	else
		doPlayerSendCancel(cid, "Runed Sword must be on your hands to cast this spell.")
	end
return true
end
XML Location: data/spells/spells.xml
XML Code:
PHP:
	<instant name="Hi Kirikizu" words="fire blade" lvl="10" mana="40" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="rune_blade/fire_blade.lua">
		<vocation id="4"/>
		<vocation id="8"/>
	</instant>
Extra Details:
blademagic.png

Description: This spell lets you empower the Runed Sword(7417) with fire magic.
[Install [Fire Blade] = End]


[Install [Ice Blade] = Start]
Script Name: ice
_blade.lua
Type: Spell
Lua Location: data/spells/scripts/rune_blade/
Lua Code:
Lua:
function onCastSpell(cid, var)
local left = getPlayerSlotItem(cid, 6)
local right = getPlayerSlotItem(cid, 5)
	if left.itemid == 7417 then
		doSetItemActionId(left.uid, 12002)
		doSetItemSpecialDescription(left.uid, "It is enhanced with ice magic.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIANTICE)
	elseif right.itemid == 7417 then
		doSetItemActionId(right.uid, 12002)
		doSetItemSpecialDescription(right.uid, "It is enhanced with ice magic.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIANTICE)
	else
		doPlayerSendCancel(cid, "Runed Sword must be on your hands to cast this spell.")
	end
return true
end
XML Location:
data/spells/spells.xml
XML Code:
PHP:
	<instant name="Hyouga Bakuhatsu" words="ice blade" lvl="15" mana="60" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="rune_blade/ice_blade.lua">
		<vocation id="4"/>
		<vocation id="8"/>
	</instant>
Extra Details:
blademagic2.png

Description:
This spell lets you empower the Runed Sword(7417) with ice magic.
[Install [Ice Blade] = End]

[Install [Earth Blade] = Start]
Script Name: earth
_blade.lua
Type: Spell
Lua Location: data/spells/scripts/rune_blade/
Lua Code:
Lua:
function onCastSpell(cid, var)
local left = getPlayerSlotItem(cid, 6)
local right = getPlayerSlotItem(cid, 5)
	if left.itemid == 7417 then
		doSetItemActionId(left.uid, 12003)
		doSetItemSpecialDescription(left.uid, "It is enhanced with earth magic.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_STONES)
	elseif right.itemid == 7417 then
		doSetItemActionId(right.uid, 12003)
		doSetItemSpecialDescription(right.uid, "It is enhanced with earth magic.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_STONES)
	else
		doPlayerSendCancel(cid, "Runed Sword must be on your hands to cast this spell.")
	end
return true
end
XML Location:
data/spells/spells.xml
XML Code:
PHP:
	<instant name="Jimen no Hitsugi" words="earth blade" lvl="20" mana="80" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="rune_blade/earth_blade.lua">
		<vocation id="4"/>
		<vocation id="8"/>
	</instant>
Extra Details:
blademagic3.png

Description:
This spell lets you empower the Runed Sword(7417) with earth magic.
[Install [Earth Blade] = End]

[Install [Lightning Blade] = Start]
Script Name:
lightning_blade.lua
Type: Spell
Lua Location: data/spells/scripts/rune_blade/
Lua Code:
Lua:
function onCastSpell(cid, var)
local left = getPlayerSlotItem(cid, 6)
local right = getPlayerSlotItem(cid, 5)
	if left.itemid == 7417 then
		doSetItemActionId(left.uid, 12004)
		doSetItemSpecialDescription(left.uid, "It is enhanced with lightning magic.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_BIGCLOUDS)
	elseif right.itemid == 7417 then
		doSetItemActionId(right.uid, 12004)
		doSetItemSpecialDescription(right.uid, "It is enhanced with lightning magic.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_BIGCLOUDS)
	else
		doPlayerSendCancel(cid, "Runed Sword must be on your hands to cast this spell.")
	end
return true
end
XML Location:
data/spells/spells.xml
XML Code:
PHP:
	<instant name="Inazuma Sashikizu" words="lightning blade" lvl="25" mana="100" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="rune_blade/lightning_blade.lua">
		<vocation id="4"/>
		<vocation id="8"/>
	</instant>
Extra Details:
blademagic4.png

Description:
This spell lets you empower the Runed Sword(7417) with lightning magic.
[Install [Lightning Blade] = End]

[Install [Force Blade] = Start]
Script Name:
force_blade.lua
Type: Spell
Lua Location: data/spells/scripts/rune_blade/
Lua Code:
Lua:
function onCastSpell(cid, var)
local left = getPlayerSlotItem(cid, 6)
local right = getPlayerSlotItem(cid, 5)
	if left.itemid == 7417 then
		doSetItemActionId(left.uid, 12005)
		doSetItemSpecialDescription(left.uid, "It is enhanced with force magic.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GROUNDSHAKER)
	elseif right.itemid == 7417 then
		doSetItemActionId(right.uid, 12005)
		doSetItemSpecialDescription(right.uid, "It is enhanced with force magic.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GROUNDSHAKER)
	else
		doPlayerSendCancel(cid, "Runed Sword must be on your hands to cast this spell.")
	end
return true
end
XML Location:
data/spells/spells.xml
XML Code:
PHP:
	<instant name="Oukii Kirikizu" words="force blade" lvl="30" mana="120" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="rune_blade/force_blade.lua">
		<vocation id="4"/>
		<vocation id="8"/>
	</instant>
Extra Details:
blademagic5.png

Description:
This spell lets you empower the Runed Sword(7417) with force magic.
[Install [Force Blade] = End]

[Install [Rune Blade] = Start]
Script Name: RuneBlade
Type: Weapon
Lua Location: data/weapons/scripts/
Lua Code:
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_DRAWBLOOD)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_NONE)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0.5, 0, 0.5, 0)

local area = createCombatArea({
	{0, 0, 0, 0, 0, 0, 0},
	{0, 0, 0, 0, 0, 0, 0},
	{0, 0, 0, 0, 0, 0, 0},
	{0, 0, 0, 3, 0, 0, 0},
	{0, 0, 0, 0, 0, 0, 0},
	{0, 0, 0, 0, 0, 0, 0},
	{0, 0, 0, 0, 0, 0, 0}
})

setCombatArea(combat, area)

local combat_fire = createCombatObject()
setCombatParam(combat_fire, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat_fire, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat_fire, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat_fire, COMBAT_PARAM_EFFECT, CONST_ME_FIREATTACK)
setCombatParam(combat_fire, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE)
setCombatFormula(combat_fire, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

local area_fire = createCombatArea({
	{0, 0, 0, 0, 0, 0, 0},
	{0, 0, 0, 0, 0, 1, 0},
	{0, 0, 0, 0, 1, 0, 0},
	{0, 0, 0, 3, 0, 0, 0},
	{0, 0, 1, 0, 0, 0, 0},
	{0, 1, 0, 0, 0, 0, 0},
	{0, 0, 0, 0, 0, 0, 0}
})

setCombatArea(combat_fire, area_fire)

local combat_ice = createCombatObject()
setCombatParam(combat_ice, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat_ice, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat_ice, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat_ice, COMBAT_PARAM_EFFECT, CONST_ME_GIANTICE)
setCombatParam(combat_ice, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ICE)
setCombatFormula(combat_ice, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

local area_ice = createCombatArea({
	{0, 0, 0, 0, 0, 0, 0},
	{0, 0, 1, 0, 1, 0, 0},
	{0, 1, 0, 1, 0, 1, 0},
	{0, 0, 1, 3, 1, 0, 0},
	{0, 1, 0, 1, 0, 1, 0},
	{0, 0, 1, 0, 1, 0, 0},
	{0, 0, 0, 0, 0, 0, 0}
})

setCombatArea(combat_ice, area_ice)

local combat_earth = createCombatObject()
setCombatParam(combat_earth, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat_earth, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat_earth, COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE)
setCombatParam(combat_earth, COMBAT_PARAM_EFFECT, CONST_ME_STONES)
setCombatParam(combat_earth, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLEARTH)
setCombatFormula(combat_earth, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

local area_earth = createCombatArea({
	{0, 0, 1, 1, 1, 0, 0},
	{0, 1, 0, 0, 0, 1, 0},
	{1, 0, 1, 1, 1, 0, 1},
	{1, 0, 1, 3, 1, 0, 1},
	{1, 0, 1, 1, 1, 0, 1},
	{0, 1, 0, 0, 0, 1, 0},
	{0, 0, 1, 1, 1, 0, 0}
})

setCombatArea(combat_earth, area_earth)

local combat_energy = createCombatObject()
setCombatParam(combat_energy, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat_energy, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat_energy, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat_energy, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT)
setCombatParam(combat_energy, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatFormula(combat_energy, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

local area_energy = createCombatArea({
	{0, 0, 0, 1, 0, 0, 0},
	{0, 0, 1, 1, 1, 0, 0},
	{0, 0, 1, 1, 1, 0, 0},
	{0, 0, 1, 3, 1, 0, 0},
	{0, 0, 1, 0, 1, 0, 0},
	{0, 0, 1, 0, 1, 0, 0},
	{0, 0, 0, 0, 0, 0, 0}
})

setCombatArea(combat_energy, area_energy)

local combat_critical = createCombatObject()
setCombatParam(combat_critical, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat_critical, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat_critical, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat_critical, COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE)
setCombatParam(combat_critical, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_HOLY)
setCombatFormula(combat_critical, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

local area_critical = createCombatArea({
	{0, 0, 0, 0, 0, 0, 1},
	{0, 0, 0, 0, 1, 1, 0},
	{0, 0, 0, 1, 1, 1, 0},
	{0, 0, 1, 3, 1, 0, 0},
	{0, 1, 1, 1, 0, 0, 0},
	{0, 1, 1, 0, 0, 0, 0},
	{1, 0, 0, 0, 0, 0, 0}
})

setCombatArea(combat_critical, area_critical)

local t = {
	[12001] = {say = "Hi Kirikizu!", spend = 7, level = 10, combat = combat_fire, combatDflt = combat},
	[12002] = {say = "Hyouga Bakuhatsu!", spend = 10, level = 15, combat = combat_ice, combatDflt = combat},
	[12003] = {say = "Jimen no Hitsugi!", spend = 12, level = 20, combat = combat_earth, combatDflt = combat},
	[12004] = {say = "Inazuma Sashikizu!", spend = 14, level = 25, combat = combat_energy, combatDflt = combat},
	[12005] = {say = "Oukii Kirikizu!", spend = 16, level = 30, combat = combat_critical, combatDflt = combat}
	}

function onUseWeapon(cid, var)
local left = getPlayerSlotItem(cid, 6)
local right = getPlayerSlotItem(cid, 5)
	if getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 8 then	
		for aid, action in pairs(t) do
		local manaSpend = action.spend
			if getCreatureMana(cid) >= manaSpend then		
				if left.actionid == aid then
					if getPlayerLevel(cid) >= action.level then		
						if action.combat then
							doCreatureSay(cid, action.say, TALKTYPE_MONSTER_YELL)
							doPlayerAddSpentMana(cid, manaSpend)
							doCreatureAddMana(cid, -manaSpend)
							doCombat(cid, action.combat, var)
						end	
					end	
				elseif right.actionid == aid then
					if getPlayerLevel(cid) >= action.level then		
						if action.combat then	
							doCreatureSay(cid, action.say, TALKTYPE_MONSTER_YELL)
							doPlayerAddSpentMana(cid, manaSpend)
							doCreatureAddMana(cid, -manaSpend)
							doCombat(cid, action.combat, var)
						end	
					end
				end	
			elseif getCreatureMana(cid) < manaSpend then
				if action.combatDflt then	
					if left.actionid == aid then
						doCreatureSay(cid, "Kirikizu!", TALKTYPE_MONSTER_YELL)
						doCombat(cid, action.combatDflt, var)
					elseif right.actionid == aid then
						doCreatureSay(cid, "Kirikizu!", TALKTYPE_MONSTER_YELL)
						doCombat(cid, action.combatDflt, var)
					end	
				end
			end
		end	
	elseif getPlayerVocation(cid) ~= 4 or getPlayerVocation(cid) ~= 8 then
		if left.itemid == 7417 then
			doCreatureSay(cid, "Kirikizu!", TALKTYPE_MONSTER_YELL)
			doCombat(cid, combat, var)
		elseif right.itemid == 7417 then
			doCreatureSay(cid, "Kirikizu!", TALKTYPE_MONSTER_YELL)
			doCombat(cid, combat, var)
		end
	end		
return true	
end
XML Location: data/weapons/weapons.xml
XML Code:
PHP:
<melee id="7417" event="script" value="RuneBlade.lua"/>
Extra Details: find the other registry that has the same id as the one just posted
and delete it.
Description: This is where the action happens, when you attack
a creature the magic powers that where placed on the Runed Sword
will be released and it will harm your enemies.

[Install [Rune Blade] = End]

And just in case you may want to know:
Hi Kirikizu = Fire Slash
Hyouga Bakuhatsu = Glacier Explosion
Jimen no Hitsugi = Terra Coffin
Inazuma Sashikizu = Lightning Stab
Oukii Kirikizu = Grand Slash
Kirikizu = Slash

Well I hope you enjoy this and REP if you really liked it.
 
Thanks! and about your siggy:
Lua:
function onLove(cid, girlfriend)
	if getPlayerTrueLove(cid, girlfriend) then
		doPlayerBeHappy(cid, true)
		doRemoveVirginity(cid, true)
		doPlayerSay(cid, "I'm Happy, how about you?.", TALKTYPE_SAY) 
	else
		doPlayerSendCancel(cid,"You do not know how good it feels to be loved.")
	end
return true	
end
the last one didn't work, so here you go :p
 
Last edited:
you should make all the spell in 1
its moar easy and thats not really cool, just edited spellls from TFS.
 
the spells should have the same area effect. and on each hit it cycles to the next AOE. also add a spell to set the weapon back to normal physical damage

edit: im not sure if cycling the aoe is possible if not an effect can be randomly selected each time.
 
it does return to its physical damage when the player is:
1.out of mana
2.is not a knight.(even a God can't use this weapon)
 
Thanks! and about your siggy:
Lua:
function onLove(cid, girlfriend)
	if getPlayerTrueLove(cid, girlfriend) then
		doPlayerBeHappy(cid, true)
		doRemoveVirginity(cid, true)
		doPlayerSay(cid, "I'm Happy, how about you?.", TALKTYPE_SAY) 
	else
		doPlayerSendCancel(cid,"You do not know how good it feels to be loved.")
	end
return true	
end
the last one didn't work, so here you go :p



Who is Siggy and what is that for lua?

doPlayerSay?
function onLove(cid, girlfriend)
if getPlayerTrueLove(cid, girlfriend) then
doPlayerBeHappy(cid, true)
doRemoveVirginity(cid, true)

??????????????????????????????????
 
i update it to 0.3.6 and tried remaking it a little this is what i have

fire_blade: anyone who needs to can easily remake the others using this as the base.
PHP:
function  onCastSpell(cid, var)
	local playerWeapon =  getPlayerWeapon(cid, TRUE)
    if playerWeapon.itemid == 7405 then
        doItemSetAttribute(playerWeapon.uid, "aid", 12001)
        doItemSetAttribute(playerWeapon.uid, "description", "It is enhanced with fire magic.")
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREATTACK)
    else
        doPlayerSendCancel(cid, "Elemental blade must be in your hands to cast this spell.")
    end
	return true
end

put this in weapons/scripts
PHP:
local  combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_DRAWBLOOD)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_NONE)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

local area = createCombatArea({
        {0, 0, 0, 0, 0, 0, 0},
        {0, 0, 0, 0, 0, 0, 0},
        {0, 0, 0, 0, 0, 0, 0},
        {0, 0, 0, 3, 0, 0, 0},
        {0, 0, 0, 0, 0, 0, 0},
        {0, 0, 0, 0, 0, 0, 0},
        {0, 0, 0, 0, 0, 0, 0}
})

setCombatArea(combat, area)

local combat_fire = createCombatObject()
setCombatParam(combat_fire, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat_fire, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat_fire, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat_fire, COMBAT_PARAM_EFFECT, CONST_ME_FIREATTACK)
setCombatParam(combat_fire, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE)
setCombatFormula(combat_fire, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

local area_fire = createCombatArea({
        {0, 0, 0, 0, 0, 0, 1},
        {0, 0, 0, 0, 1, 1, 0},
        {0, 0, 0, 1, 1, 1, 0},
        {0, 0, 1, 3, 1, 0, 0},
        {0, 1, 1, 1, 0, 0, 0},
        {0, 1, 1, 0, 0, 0, 0},
        {1, 0, 0, 0, 0, 0, 0}
})

setCombatArea(combat_fire, area_fire)

local combat_ice = createCombatObject()
setCombatParam(combat_ice, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat_ice, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat_ice, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat_ice, COMBAT_PARAM_EFFECT, CONST_ME_GIANTICE)
setCombatParam(combat_ice, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ICE)
setCombatFormula(combat_ice, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

local area_ice = createCombatArea({
        {0, 0, 0, 0, 0, 0, 0},
        {0, 0, 1, 0, 1, 0, 0},
        {0, 1, 0, 1, 0, 1, 0},
        {0, 0, 1, 3, 1, 0, 0},
        {0, 1, 0, 1, 0, 1, 0},
        {0, 0, 1, 0, 1, 0, 0},
        {0, 0, 0, 0, 0, 0, 0}
})

setCombatArea(combat_ice, area_ice)

local combat_earth = createCombatObject()
setCombatParam(combat_earth, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat_earth, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat_earth, COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE)
setCombatParam(combat_earth, COMBAT_PARAM_EFFECT, CONST_ME_STONES)
setCombatParam(combat_earth, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLEARTH)
setCombatFormula(combat_earth, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

local area_earth = createCombatArea({
        {0, 0, 1, 1, 1, 0, 0},
        {0, 1, 0, 0, 0, 1, 0},
        {1, 0, 1, 1, 1, 0, 1},
        {1, 0, 1, 3, 1, 0, 1},
        {1, 0, 1, 1, 1, 0, 1},
        {0, 1, 0, 0, 0, 1, 0},
        {0, 0, 1, 1, 1, 0, 0}
})

setCombatArea(combat_earth, area_earth)

local combat_energy = createCombatObject()
setCombatParam(combat_energy, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat_energy, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat_energy, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat_energy, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT)
setCombatParam(combat_energy, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatFormula(combat_energy, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

local area_energy = createCombatArea({
        {0, 0, 0, 1, 0, 0, 0},
        {0, 0, 0, 1, 0, 0, 0},
        {0, 0, 1, 1, 1, 0, 0},
        {0, 0, 1, 3, 1, 0, 0},
        {0, 0, 1, 1, 1, 0, 0},
        {0, 0, 0, 1, 0, 0, 0},
        {0, 0, 0, 1, 0, 0, 0}
})

setCombatArea(combat_energy, area_energy)

local t = {
        [12001] = {say = "Hi Kirikizu!", spend = 7, level = 10, combat = combat_fire},
        [12002] = {say = "Hyouga Bakuhatsu!", spend = 10, level = 15, combat = combat_ice},
        [12003] = {say = "Jimen no Hitsugi!", spend = 12, level = 20, combat = combat_earth},
        [12004] = {say = "Inazuma Sashikizu!", spend = 14, level = 25, combat = combat_energy}
        }

function onUseWeapon(cid, var)
	local playerWeapon =  getPlayerWeapon(cid, TRUE)
    if getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 8 and playerWeapon.actionid ~= 0 then     
		local weapon = t[getItemAttribute(playerWeapon.uid, "aid")]
		local manaSpend = weapon.spend
		if getCreatureMana(cid) >= manaSpend and getPlayerLevel(cid) >= weapon.level then          
			doCreatureSay(cid, weapon.say, TALKTYPE_MONSTER_YELL)
			doPlayerAddSpentMana(cid, manaSpend)
			doCreatureAddMana(cid, -manaSpend)
			doCombat(cid, weapon.combat, var)     
        else
			doPlayerSendCancel(cid, "You are to weak to control the elements.")
            doCombat(cid, combat, var)  
        end
    else
            doCreatureSay(cid, "Kirikizu!", TALKTYPE_MONSTER_YELL)
            doCombat(cid, combat, var)
    end            
	return true    
end
 
Thanks! and about your siggy:
Lua:
function onLove(cid, girlfriend)
	if getPlayerTrueLove(cid, girlfriend) then
		doPlayerBeHappy(cid, true)
		doRemoveVirginity(cid, true)
		doPlayerSay(cid, "I'm Happy, how about you?.", TALKTYPE_SAY) 
	else
		doPlayerSendCancel(cid,"You do not know how good it feels to be loved.")
	end
return true	
end
the last one didn't work, so here you go :p
Lua:
function onLove(cid, girlfriend) return getPlayerTrueLove(cid, girlfriend) and doPlayerBeHappy(cid, true) and doRemoveVirginity(cid, true) and doPlayerSay(cid, "I'm Happy, how about you?.", TALKTYPE_SAY) or doPlayerSendCancel(cid,"You do not know how good it feels to be loved.") and true end
 
nice screens /b/ro
lua code looks bettar at bold
 
i tried turning the spells into a talkaction b/c i wanted this effect on two weapons and didnt want so many little spells around on my server.

Code:
function onSay(cid, words, param)
local elements =  {
            ["fire"] = {12001, CONST_ME_FIREATTACK},
            ["ice"] = {12002, CONST_ME_GIANTICE},
            ["earth"] = {12003, CONST_ME_STONES},
            ["lightning"] = {12004, CONST_ME_BIGCLOUDS}
        }
	param = string.lower(param)
	
	local playerWeapon =  getPlayerWeapon(cid, TRUE)
	if isKnight(cid) == true then
		if getCreatureMana(cid) >= 100 and (param ~= "" and elements[param]) then
			if playerWeapon.itemid == 7405 or playerWeapon.itemid == 7456 then
				doItemSetAttribute(playerWeapon.uid, "aid", elements[param][1])
				doItemSetAttribute(playerWeapon.uid, "description", "It is enhanced with " ..elements[param].. " magic.")
				doSendMagicEffect(getCreaturePosition(cid), elements[param][2])
				doPlayerAddSpentMana(p.cid, 100)
				doCreatureAddMana(p.cid, -100)
			else
				doPlayerSendCancel(cid, "You need to be holding an Elemental weapon to enchant it.")
			end
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You do not have enough mana.")
		end
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your vocation cannot use this spell.")
	end
	return true
end

it works but not 100% i still get this error
[11/08/2010 13:37:46] [Error - TalkAction Interface]
[11/08/2010 13:37:46] buffer:eek:nSay
[11/08/2010 13:37:46] Description:
[11/08/2010 13:37:46] [string "loadBuffer"]:15: attempt to concatenate field '?' (a table value)
[11/08/2010 13:37:46] stack traceback:
[11/08/2010 13:37:46] [string "loadBuffer"]:15: in function <[string "loadBuffer"]:1>

can anybody fix that?
 
Back
Top