function onSay(cid, words, param, channel)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
return true
end
local t = string.explode(param, ",")
if(not t[2]) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Not enough params.")
return true
end
local pid = getPlayerByNameWildcard(t[1])
if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[1] .. " not found.")
return true
end
t[2] = t[2]:lower()
local skill = SKILL_IDS[t[2]]
if(not skill) then
local tmp = t[2]:sub(1, 1)
if(tmp == 'l' or tmp == 'e') then
skill = SKILL__LEVEL
elseif(tmp == 'm') then
skill = SKILL__MAGLEVEL
else
skill = tonumber(t[2])
if(not skill or skill < SKILL_FIRST or SKILL > SKILL__LAST) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Such skill does not exists.")
return true
end
end
end
local amount = tonumber(t[3])
if(not amount or amount == 0) then
amount = 1
end
doPlayerAddSkill(pid, skill, -amount, true)
return true
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
setCombatParam(combat, COMBAT_PARAM_USECHARGES, true)
local condition1 = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition1, CONDITION_PARAM_TICKS, 20000)
setConditionFormula(condition1, -0.9, 0, -0.9, 0)
setCombatCondition(combat, condition1)
local area = createCombatArea(AREA_SQUARE1X1)
setCombatArea(combat, area)
function onGetFormulaValues(cid, level, skill, attack, factor)
local skillTotal, levelTotal = skill + attack * 2, level / 5
return -(skillTotal * 1.1 + levelTotal), -(skillTotal * 3 + levelTotal)
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
can u give me the full script with the talkation.xml?Thanks![]()
okay but can you help me out here for script?EDIT: Sorry this was a talkaction from him I see, I then got the script fixed from my friend as a spell & not talkaction. However I do not have the script on this pc, sorry.
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
setCombatParam(combat, COMBAT_PARAM_USECHARGES, true)
local condition1 = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition1, CONDITION_PARAM_TICKS, 20000)
setConditionFormula(condition1, -0.9, 0, -0.9, 0)
setCombatCondition(combat, condition1)
local area = createCombatArea(AREA_SQUARE1X1)
setCombatArea(combat, area)
function onGetFormulaValues(cid, level, skill, attack, factor)
local skillTotal, levelTotal = skill + attack * 2, level / 5
return -(skillTotal * 1.1 + levelTotal), -(skillTotal * 3 + levelTotal)
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
<instant name="Paralyze ue" words="Exori paralyze" lvl="100000" mana="1000" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="paralyzeue.lua">
<vocation id="2"/>
<vocation id="6"/>
nono i won't spell i want demote scriptOh I'm sorry, I did misread it.
Create paralyzeue.lua in your spells scripts folder.
Code:local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA) setCombatParam(combat, COMBAT_PARAM_USECHARGES, true) local condition1 = createConditionObject(CONDITION_PARALYZE) setConditionParam(condition1, CONDITION_PARAM_TICKS, 20000) setConditionFormula(condition1, -0.9, 0, -0.9, 0) setCombatCondition(combat, condition1) local area = createCombatArea(AREA_SQUARE1X1) setCombatArea(combat, area) function onGetFormulaValues(cid, level, skill, attack, factor) local skillTotal, levelTotal = skill + attack * 2, level / 5 return -(skillTotal * 1.1 + levelTotal), -(skillTotal * 3 + levelTotal) end setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues") function onCastSpell(cid, var) return doCombat(cid, combat, var) end
Add this line to spells.xml
Code:<instant name="Paralyze ue" words="Exori paralyze" lvl="100000" mana="1000" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="paralyzeue.lua"> <vocation id="2"/> <vocation id="6"/>
<talkaction log="yes" words="/lvlplayer" access="6" event="script" value="demotelvl.lua"/>
function onSay(cid, words, param)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Command param required.")
return true
end
local pid = getPlayerByNameWildcard(param)
if(not pid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Player " .. param .. " not found.")
return true
end
local id = getPlayerGUID(pid)
if getCreatureStorage(pid, 90901) == -1 then
db.query("UPDATE `players` SET `blessings` = 0, `level` = 8, `mana` = 35, `health` = 185, `experience` = 4200, `healthmax` = 185, `manamax` = 35 WHERE `id` ='"..id.."';")
doPlayerAddExperience(pid, -getPlayerExperience(pid)+4200)
setCreatureMaxHealth(pid, 185)
setCreatureMaxMana(pid, 35)
setPlayerStorageValue(pid, 85989, 0)
setPlayerStorageValue(pid, 90901, getCreatureStorage(pid, 90901) + 2)
setPlayerStorageValue(pid, 88953, 1)
doCreatureAddMana(pid, -getCreatureMana(pid))
doCreatureAddHealth(pid, -getCreatureHealth(pid))
doCreatureSetDropLoot(pid, false)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Player " .. param .. " has been demoted.")
elseif getCreatureStorage(pid, 90901) >= 1 then
db.query("UPDATE `players` SET `blessings` = 0, `level` = 8, `mana` = 35, `health` = 185, `experience` = 4200, `healthmax` = 185, `manamax` = 35 WHERE `id` ='"..id.."';")
doPlayerAddExperience(pid, -getPlayerExperience(pid)+4200)
setCreatureMaxHealth(pid, 185)
setCreatureMaxMana(pid, 35)
setPlayerStorageValue(pid, 85989, 0)
setPlayerStorageValue(pid, 90901, getCreatureStorage(pid, 90901) + 1)
setPlayerStorageValue(pid, 88953, 1)
doCreatureAddMana(pid, -getCreatureMana(pid))
doCreatureAddHealth(pid, -getCreatureHealth(pid))
doCreatureSetDropLoot(pid, false)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Player " .. param .. " has been demoted.")
end
return true
end
i want when i say /demote player,level he will demote to level 8 and all player see message player name have been demoted on level 200 to level 1 exampleCode:<talkaction log="yes" words="/lvlplayer" access="6" event="script" value="demotelvl.lua"/>
Code:function onSay(cid, words, param) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Command param required.") return true end local pid = getPlayerByNameWildcard(param) if(not pid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Player " .. param .. " not found.") return true end local id = getPlayerGUID(pid) if getCreatureStorage(pid, 90901) == -1 then db.query("UPDATE `players` SET `blessings` = 0, `level` = 8, `mana` = 35, `health` = 185, `experience` = 4200, `healthmax` = 185, `manamax` = 35 WHERE `id` ='"..id.."';") doPlayerAddExperience(pid, -getPlayerExperience(pid)+4200) setCreatureMaxHealth(pid, 185) setCreatureMaxMana(pid, 35) setPlayerStorageValue(pid, 85989, 0) setPlayerStorageValue(pid, 90901, getCreatureStorage(pid, 90901) + 2) setPlayerStorageValue(pid, 88953, 1) doCreatureAddMana(pid, -getCreatureMana(pid)) doCreatureAddHealth(pid, -getCreatureHealth(pid)) doCreatureSetDropLoot(pid, false) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Player " .. param .. " has been demoted.") elseif getCreatureStorage(pid, 90901) >= 1 then db.query("UPDATE `players` SET `blessings` = 0, `level` = 8, `mana` = 35, `health` = 185, `experience` = 4200, `healthmax` = 185, `manamax` = 35 WHERE `id` ='"..id.."';") doPlayerAddExperience(pid, -getPlayerExperience(pid)+4200) setCreatureMaxHealth(pid, 185) setCreatureMaxMana(pid, 35) setPlayerStorageValue(pid, 85989, 0) setPlayerStorageValue(pid, 90901, getCreatureStorage(pid, 90901) + 1) setPlayerStorageValue(pid, 88953, 1) doCreatureAddMana(pid, -getCreatureMana(pid)) doCreatureAddHealth(pid, -getCreatureHealth(pid)) doCreatureSetDropLoot(pid, false) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Player " .. param .. " has been demoted.") end return true end
that u need?
<talkaction log="yes" words="/demotelvl" access="6" event="script" value="demotelvl.lua"/>
function onSay(cid, words, param)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Command param required.")
return true
end
local pid = getPlayerByNameWildcard(param)
if(not pid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Player " .. param .. " not found.")
return true
end
local id = getPlayerGUID(pid)
if getCreatureStorage(pid, 90901) == -1 then
db.query("UPDATE `players` SET `blessings` = 0, `level` = 8, `mana` = 35, `health` = 185, `experience` = 4200, `healthmax` = 185, `manamax` = 35 WHERE `id` ='"..id.."';")
doPlayerAddExperience(pid, -getPlayerExperience(pid)+4200)
setCreatureMaxHealth(pid, 185)
setCreatureMaxMana(pid, 35)
setPlayerStorageValue(pid, 85989, 0)
setPlayerStorageValue(pid, 90901, getCreatureStorage(pid, 90901) + 2)
setPlayerStorageValue(pid, 88953, 1)
doCreatureAddMana(pid, -getCreatureMana(pid))
doCreatureAddHealth(pid, -getCreatureHealth(pid))
doCreatureSetDropLoot(pid, false)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Player " .. param .. " has been demoted.")
elseif getCreatureStorage(pid, 90901) >= 1 then
db.query("UPDATE `players` SET `blessings` = 0, `level` = 8, `mana` = 35, `health` = 185, `experience` = 4200, `healthmax` = 185, `manamax` = 35 WHERE `id` ='"..id.."';")
doPlayerAddExperience(pid, -getPlayerExperience(pid)+4200)
setCreatureMaxHealth(pid, 185)
setCreatureMaxMana(pid, 35)
setPlayerStorageValue(pid, 85989, 0)
setPlayerStorageValue(pid, 90901, getCreatureStorage(pid, 90901) + 1)
setPlayerStorageValue(pid, 88953, 1)
doCreatureAddMana(pid, -getCreatureMana(pid))
doCreatureAddHealth(pid, -getCreatureHealth(pid))
doCreatureSetDropLoot(pid, false)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Player " .. param .. " has been demoted.")
doBroadcastMessage("player " .. param .. " got demot from level " .. getPlayerLevel(cid) .. " to level 7!", MESSAGE_STATUS_CONSOLE_RED)
end
return true
end
function onSay(cid, words, param)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Command param required.")
return true
end
local pid = getPlayerByNameWildcard(param)
if(not pid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Player " .. param .. " not found.")
return true
end
local id = getPlayerGUID(pid)
if getCreatureStorage(pid, 90901) == -1 then
db.query("UPDATE `players` SET `blessings` = 0, `level` = 8, `mana` = 35, `health` = 185, `experience` = 4200, `healthmax` = 185, `manamax` = 35 WHERE `id` ='"..id.."';")
doPlayerAddExperience(pid, -getPlayerExperience(pid)+4200)
setCreatureMaxHealth(pid, 185)
setCreatureMaxMana(pid, 35)
setPlayerStorageValue(pid, 85989, 0)
setPlayerStorageValue(pid, 90901, getCreatureStorage(pid, 90901) + 2)
setPlayerStorageValue(pid, 88953, 1)
doCreatureAddMana(pid, -getCreatureMana(pid))
doCreatureAddHealth(pid, -getCreatureHealth(pid))
doCreatureSetDropLoot(pid, false)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Player " .. param .. " has been demoted.")
elseif getCreatureStorage(pid, 90901) >= 1 then
doBroadcastMessage("player " .. param .. " got demot from level " .. getPlayerLevel(pid) .. " to level 7!", MESSAGE_STATUS_WARNING)
db.query("UPDATE `players` SET `blessings` = 0, `level` = 8, `mana` = 35, `health` = 185, `experience` = 4200, `healthmax` = 185, `manamax` = 35 WHERE `id` ='"..id.."';")
doPlayerAddExperience(pid, -getPlayerExperience(pid)+4200)
setCreatureMaxHealth(pid, 185)
setCreatureMaxMana(pid, 35)
setPlayerStorageValue(pid, 85989, 0)
setPlayerStorageValue(pid, 90901, getCreatureStorage(pid, 90901) + 1)
setPlayerStorageValue(pid, 88953, 1)
doCreatureAddMana(pid, -getCreatureMana(pid))
doCreatureAddHealth(pid, -getCreatureHealth(pid))
doCreatureSetDropLoot(pid, false)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Player " .. param .. " has been demoted.")
end
return true
end