Shinmaru
エロルアー Scripter!
[UPDATE]
I have fixed some problems with the following things:
1. players can attack pzed players and pzed players can attack outside pz.
2. allowPK is fixed - when it was set to false it wouldn't let players attack at all, now it works properly.
3. added an "VocUnLock" - when set to false it lock the weapon usage only to the allowed vocations,
which can be configured in the "allowedVoc"
Well here i am again bringing a a simple script, this time is as you read "Weapon Augmentation". In which you use , in this case,
your sword on a Gem(Red, Blue, Yellow, Green and Violet)and it will receive the Augmentation(the weapons do not change in appearance)
which are: Red = Fire, Blue = Ice, Yellow = Energy, Green = Earth and Violet = Critical(Physical), so let's begin:
[HOW TO INSTALL]
Go to data/actions/scripts and create 2 files one of them name it augment.lua and the other augmentattack.lua and copy the following:
[augment.lua]
[augmentattack.lua][UPDATED & Fixed]
Now in data/actions/actions.xml copy this in it:
well that is all and i hope you enjoy if any problems arise please let me know.
Script made entirely by me.
I have fixed some problems with the following things:
1. players can attack pzed players and pzed players can attack outside pz.
2. allowPK is fixed - when it was set to false it wouldn't let players attack at all, now it works properly.
3. added an "VocUnLock" - when set to false it lock the weapon usage only to the allowed vocations,
which can be configured in the "allowedVoc"
Well here i am again bringing a a simple script, this time is as you read "Weapon Augmentation". In which you use , in this case,
your sword on a Gem(Red, Blue, Yellow, Green and Violet)and it will receive the Augmentation(the weapons do not change in appearance)
which are: Red = Fire, Blue = Ice, Yellow = Energy, Green = Earth and Violet = Critical(Physical), so let's begin:
[HOW TO INSTALL]
Go to data/actions/scripts and create 2 files one of them name it augment.lua and the other augmentattack.lua and copy the following:
[augment.lua]
Lua:
local cfg = {
weapons = {2376, 2377}
}
local augment = {
[{2156}] = {msg = "Your weapon has a Fire Augmentation.", augAid = 12001, aug = "Fire", clr = 180},
[{2158}] = {msg = "Your weapon has an Ice Augmentation.", augAid = 12002, aug = "Ice", clr = 35},
[{2155}] = {msg = "Your weapon has an Earth Augmentation.", augAid = 12003, aug = "Earth", clr = 25},
[{2154}] = {msg = "Your weapon has an Energy Augmentation.", augAid = 12004, aug = "Energy", clr = 80},
[{2153}] = {msg = "Your weapon has a 'Critical' Augmentation.", augAid = 12005, aug = "Critical", clr = 90},
[{2260}] = {runemsg = "Your weapon now has rune-like properties.", runeAid = 12000}
}
function onUse(cid, item, toPosition, itemEx, fromPosition)
for aug, inf in pairs(augment) do
if isInArray(aug, itemEx.itemid) then
if isInArray(cfg.weapons, item.itemid) then
if item.actionid == 0 and inf.runeAid then
doSetItemActionId(item.uid, inf.runeAid)
doSetItemSpecialDescription(item.uid, inf.runemsg)
doSendMagicEffect(getCreaturePosition(cid), 13)
doRemoveItem(itemEx.uid)
end
if isInArray(aug, itemEx.itemid) and isInArray(cfg.weapons, item.itemid) and item.actionid == inf.runeAid and inf.augAid then
doSetItemActionId(item.uid, inf.augAid)
doSetItemSpecialDescription(item.uid, inf.msg)
doRemoveItem(itemEx.uid)
doSendAnimatedText(toPosition, inf.aug, inf.clr)
end
end
end
end
return true
end
--Ver.3hR7Ik5lz3wF1gX1-¥P0k_TnÖD--
Lua:
local cfg = {
mana = 10, -- base mana used --
level = 10, -- requiered level --
weapons = {2376, 2377}, -- weapons that can be augmented (please make sure you add them on the augment.lua file and in actions.xml
allowPK = true, -- if you want this weapon to attack Players --
vocUnLock = true, -- set to false if you want to lock it to specific vocations --
allowedVoc = {4, 8}, -- set the vocations you want to use this --
vocCancel = "You don't have the specified Vocation.",
PKcancel = "This weapon can't be used to attack other players.",
manaCancel = "Not enough mana.",
lvlCancel = "You don't have the requiered level.",
pzCancel = "You cannot use this weapon in a protection zone."
}
local Wtype = {
[{1}] = {skill = "sword"},
[{3}] = {skill = "axe"},
[{2}] = {skill = "club"}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerLevel(cid) >= cfg.level then
if isInArray(cfg.weapons, item.itemid) then
for i, k in pairs(Wtype) do
if (isInArray(i, getItemWeaponType(item.uid))) then
local formulaMin = (getItemAttack(item.uid)*getPlayerSkillLevel(cid, k.skill)+getCreatureMaxMana(cid)/2)
local formulaMax = (getItemAttack(item.uid)*getPlayerSkillLevel(cid, k.skill)+getCreatureMaxMana(cid)*2)
local manaSpend = (cfg.mana*getCreatureMaxMana(cid)/50)
if getTilePzInfo(getCreaturePosition(cid)) == false then
if getTilePzInfo(toPosition) == false then
--[FIRE]--
local function doFire(target)
doAreaCombatHealth(target.cid, COMBAT_FIREDAMAGE, target.toPosition, 0, -formulaMin, -formulaMax, 36)
doCreatureAddMana(target.cid, -manaSpend)
end
--[FIRE/]--
--[ICE]--
local function doIce(target)
doAreaCombatHealth(target.cid, COMBAT_ICEDAMAGE, target.toPosition, 0, -formulaMin, -formulaMax, 43)
doCreatureAddMana(target.cid, -manaSpend)
end
--[ICE/]--
--[EARTH]--
local function doEarth(target)
doAreaCombatHealth(target.cid, COMBAT_EARTHDAMAGE, target.toPosition, 0, -formulaMin, -formulaMax, 44)
doCreatureAddMana(target.cid, -manaSpend)
end
--[EARTH/]--
--[ENERGY]--
local function doEnergy(target)
doAreaCombatHealth(target.cid, COMBAT_ENERGYDAMAGE, target.toPosition, 0, -formulaMin, -formulaMax, 11)
doCreatureAddMana(target.cid, -manaSpend)
end
--[ENERGY/]--
--[CRITICAL]--
local function doCritical(target)
doAreaCombatHealth(target.cid, COMBAT_PHYSICALDAMAGE, target.toPosition, 0, -formulaMin, -formulaMax, 0)
doCreatureAddMana(target.cid, -manaSpend)
doSendAnimatedText(target.toPosition, "CRITICAL", 112)
end
--[CRITICAL/]--
local target = {cid = cid, toPosition = toPosition, formulaMin = formulaMin, formulaMax = formulaMax, manaSpend = manaSpend}
local pked = getThingFromPos(toPosition)
--FIRE--
if item.actionid == 12001 then
if cfg.vocUnLock then
if cfg.allowPK then
if getCreatureMana(cid) <= manaSpend then
doPlayerSendCancel(cid, cfg.manaCancel)
else
doSendDistanceShoot(getCreaturePosition(cid), toPosition, 3)
addEvent(doFire, 300, target)
end
elseif (not(isPlayer(pked))) then
if getCreatureMana(cid) <= manaSpend then
doPlayerSendCancel(cid, cfg.manaCancel)
else
doSendDistanceShoot(getCreaturePosition(cid), toPosition, 3)
addEvent(doFire, 300, target)
end
else
doPlayerSendCancel(cid, cfg.PKcancel)
end
elseif (isInArray(cfg.allowedVoc, getPlayerVocation(cid))) then
if cfg.allowPK then
if getCreatureMana(cid) <= manaSpend then
doPlayerSendCancel(cid, cfg.manaCancel)
else
doSendDistanceShoot(getCreaturePosition(cid), toPosition, 3)
addEvent(doFire, 300, target)
end
elseif (not(isPlayer(pked))) then
if getCreatureMana(cid) <= manaSpend then
doPlayerSendCancel(cid, cfg.manaCancel)
else
doSendDistanceShoot(getCreaturePosition(cid), toPosition, 3)
addEvent(doFire, 300, target)
end
else
doPlayerSendCancel(cid, cfg.PKcancel)
end
else
doPlayerSendCancel(cid, cfg.vocCancel)
end
end
--ICE--
if item.actionid == 12002 then
if cfg.vocUnLock then
if cfg.allowPK then
if getCreatureMana(cid) <= manaSpend then
doPlayerSendCancel(cid, cfg.manaCancel)
else
doSendDistanceShoot(getCreaturePosition(cid), toPosition, 28)
addEvent(doIce, 300, target)
end
elseif (not(isPlayer(pked))) then
if getCreatureMana(cid) <= manaSpend then
doPlayerSendCancel(cid, cfg.manaCancel)
else
doSendDistanceShoot(getCreaturePosition(cid), toPosition, 28)
addEvent(doIce, 300, target)
end
else
doPlayerSendCancel(cid, cfg.PKcancel)
end
elseif (isInArray(cfg.allowedVoc, getPlayerVocation(cid))) then
if cfg.allowPK then
if getCreatureMana(cid) <= manaSpend then
doPlayerSendCancel(cid, cfg.manaCancel)
else
doSendDistanceShoot(getCreaturePosition(cid), toPosition, 28)
addEvent(doIce, 300, target)
end
elseif (not(isPlayer(pked))) then
if getCreatureMana(cid) <= manaSpend then
doPlayerSendCancel(cid, cfg.manaCancel)
else
doSendDistanceShoot(getCreaturePosition(cid), toPosition, 28)
addEvent(doIce, 300, target)
end
else
doPlayerSendCancel(cid, cfg.PKcancel)
end
else
doPlayerSendCancel(cid, cfg.vocCancel)
end
end
--Earth--
if item.actionid == 12003 then
if cfg.vocUnLock then
if cfg.allowPK then
if getCreatureMana(cid) <= manaSpend then
doPlayerSendCancel(cid, cfg.manaCancel)
else
doSendDistanceShoot(getCreaturePosition(cid), toPosition, 29)
addEvent(doEarth, 300, target)
end
elseif (not(isPlayer(pked))) then
if getCreatureMana(cid) <= manaSpend then
doPlayerSendCancel(cid, cfg.manaCancel)
else
doSendDistanceShoot(getCreaturePosition(cid), toPosition, 29)
addEvent(doEarth, 300, target)
end
else
doPlayerSendCancel(cid, cfg.PKcancel)
end
elseif (isInArray(cfg.allowedVoc, getPlayerVocation(cid))) then
if cfg.allowPK then
if getCreatureMana(cid) <= manaSpend then
doPlayerSendCancel(cid, cfg.manaCancel)
else
doSendDistanceShoot(getCreaturePosition(cid), toPosition, 29)
addEvent(doEarth, 300, target)
end
elseif (not(isPlayer(pked))) then
if getCreatureMana(cid) <= manaSpend then
doPlayerSendCancel(cid, cfg.manaCancel)
else
doSendDistanceShoot(getCreaturePosition(cid), toPosition, 29)
addEvent(doEarth, 300, target)
end
else
doPlayerSendCancel(cid, cfg.PKcancel)
end
else
doPlayerSendCancel(cid, cfg.vocCancel)
end
end
--ENERGY--
if item.actionid == 12004 then
if cfg.vocUnLock then
if cfg.allowPK then
if getCreatureMana(cid) <= manaSpend then
doPlayerSendCancel(cid, cfg.manaCancel)
else
doSendDistanceShoot(getCreaturePosition(cid), toPosition, 4)
addEvent(doEnergy, 300, target)
end
elseif (not(isPlayer(pked))) then
if getCreatureMana(cid) <= manaSpend then
doPlayerSendCancel(cid, cfg.manaCancel)
else
doSendDistanceShoot(getCreaturePosition(cid), toPosition, 4)
addEvent(doEnergy, 300, target)
end
else
doPlayerSendCancel(cid, cfg.PKcancel)
end
elseif (isInArray(cfg.allowedVoc, getPlayerVocation(cid))) then
if cfg.allowPK then
if getCreatureMana(cid) <= manaSpend then
doPlayerSendCancel(cid, cfg.manaCancel)
else
doSendDistanceShoot(getCreaturePosition(cid), toPosition, 4)
addEvent(doEnergy, 300, target)
end
elseif (not(isPlayer(pked))) then
if getCreatureMana(cid) <= manaSpend then
doPlayerSendCancel(cid, cfg.manaCancel)
else
doSendDistanceShoot(getCreaturePosition(cid), toPosition, 4)
addEvent(doEnergy, 300, target)
end
else
doPlayerSendCancel(cid, cfg.PKcancel)
end
else
doPlayerSendCancel(cid, cfg.vocCancel)
end
end
--CRITICAL--
if item.actionid == 12005 then
if cfg.vocUnLock then
if cfg.allowPK then
if getCreatureMana(cid) <= manaSpend then
doPlayerSendCancel(cid, cfg.manaCancel)
else
doSendDistanceShoot(getCreaturePosition(cid), toPosition, 24)
addEvent(doCritical, 300, target)
end
elseif (not(isPlayer(pked))) then
if getCreatureMana(cid) <= manaSpend then
doPlayerSendCancel(cid, cfg.manaCancel)
else
doSendDistanceShoot(getCreaturePosition(cid), toPosition, 24)
addEvent(doCritical, 300, target)
end
else
doPlayerSendCancel(cid, cfg.PKcancel)
end
elseif (isInArray(cfg.allowedVoc, getPlayerVocation(cid))) then
if cfg.allowPK then
if getCreatureMana(cid) <= manaSpend then
doPlayerSendCancel(cid, cfg.manaCancel)
else
doSendDistanceShoot(getCreaturePosition(cid), toPosition, 24)
addEvent(doCritical, 300, target)
end
elseif (not(isPlayer(pked))) then
if getCreatureMana(cid) <= manaSpend then
doPlayerSendCancel(cid, cfg.manaCancel)
else
doSendDistanceShoot(getCreaturePosition(cid), toPosition, 24)
addEvent(doCritical, 300, target)
end
else
doPlayerSendCancel(cid, cfg.PKcancel)
end
else
doPlayerSendCancel(cid, cfg.vocCancel)
end
end
else
doPlayerSendCancel(cid, cfg.pzCancel)
end
else
doPlayerSendCancel(cid, cfg.pzCancel)
end
end
end
end
else
doPlayerSendCancel(cid, cfg.lvlCancel)
end
return true
end
--Ver.3hR7Ik5lz3wF1gX1-¥P0k_TnÖD--
PHP:
<action actionid="12001-12005" event="script" value="augmentattack.lua" allowfaruse="1"/>
<action itemid="2376;2377" event="script" value="augment.lua" allowfaruse="1"/>
Script made entirely by me.
Last edited: