Adorius Black
Advanced OT User
- Joined
- Mar 31, 2020
- Messages
- 301
- Solutions
- 3
- Reaction score
- 180
Hi today I was little bit playing with viper_star.lua script and justice seeker.lua script what I downloaded months ago. I managed to combine these 2 scripts together and here is result. Sword has normal attack but there is random chance that it will make GIANTCUT!(area attack) with additional fire curse to target.
Install:
Install:
1.
data/weapons/scripts/justice_seeker.lua
Lua:
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat1, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, CONST_ME_FIREATTACK)
setCombatFormula(combat1, COMBAT_FORMULA_SKILL , 0, 0, 2.7, 0)
local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat2, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat2, COMBAT_FORMULA_SKILL , 0, 0, 0.9, 0)
local arr = {
{0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 1, 3, 1, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0}
}
local area = createCombatArea(arr)
setCombatArea(combat1, area)
local condition = Condition(CONDITION_FIRE)
condition:setParameter(CONDITION_PARAM_DELAYED, true)
condition:addDamage(5, 4000, -20)
condition:addDamage(4, 4000, -15)
condition:addDamage(3, 4000, -10)
condition:addDamage(2, 4000, -5)
condition:addDamage(1, 4000, -1)
local combat3 = Combat()
combat3:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
combat3:addCondition(condition)
function onUseWeapon(cid, var)
pos = getPlayerPosition(cid)
swordskill = getPlayerSkill(cid,2)
rand = math.random(1,100)
if swordskill < 35 then
if rand >= 95 then
cid:say("GIANTCUT!", TALKTYPE_MONSTER_SAY)
doCombat(cid, combat3, var)
return doCombat(cid, combat1, var)
else
doCombat(cid, combat2, var)
end
elseif swordskill >= 35 and swordskill < 55 then
if rand >= 93 then
cid:say("GIANTCUT!", TALKTYPE_MONSTER_SAY)
doCombat(cid, combat3, var)
return doCombat(cid, combat1, var)
else
doCombat(cid, combat2, var)
end
elseif swordskill >= 55 and swordskill < 75 then
if rand >= 90 then
cid:say("GIANTCUT!", TALKTYPE_MONSTER_SAY)
doCombat(cid, combat3, var)
return doCombat(cid, combat1, var)
else
doCombat(cid, combat2, var)
end
elseif swordskill >= 75 then
if rand >= 85 then
cid:say("GIANTCUT!", TALKTYPE_MONSTER_SAY)
doCombat(cid, combat3, var)
return doCombat(cid, combat1, var)
else
doCombat(cid, combat2, var)
end
end
end
2.
data/weapons/weapons.xml
XML:
<melee id="7390" level="0" unproperly="1" script="justice_seeker.lua" />
3.
in data/items/items.xml search for this:
XML:
<item id="7390" article="the" name="justice seeker">
<attribute key="weight" value="5000" />
<attribute key="defense" value="24" />
<attribute key="attack" value="47" />
<attribute key="weaponType" value="sword" />
<attribute key="quicklootcategory" value="weaponsword" />
<attribute key="extradef" value="3" />
<attribute key="description" value="This sword is only granted to a warlord of the Svargrond Arena." />
</item>
if you have already added just leave it. if not then copy and paste...
4.
in data/movement/movements.xml search for this:
XML:
<movevent event="Equip" itemid="7390" slot="hand" function="onEquipItem"> <!-- Justice Seeker -->
<vocation name="Knight"/>
<vocation name="Elite Knight" showInDescription="0"/>
</movevent>
if you have already added just leave it. if not then copy and paste...
- 7390 is ID of justice seeker. You can change it into anything else you want.
If you have idea how to make this script easier just post it.