Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local keywordHandler = KeywordHandler:new()
- local npcHandler = NpcHandler:new(keywordHandler)
- NpcSystem.parseParameters(npcHandler)
- function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
- function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
- function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
- function onThink() npcHandler:onThink() end
- -- Buff Config beginning --
- local vocation = getPlayerVocation(cid)
- -- Configs of buffs
- local conditionMagic = createConditionObject(CONDITION_ATTRIBUTES)
- setConditionParam(conditionMagic, CONDITION_PARAM_BUFF, true)
- setConditionParam(conditionMagic, CONDITION_PARAM_TICKS, 600*1000)
- setConditionParam(conditionMagic, CONDITION_PARAM_STAT_MAGICLEVEL, 10)
- local combatInvisible = createConditionObject(CONDITION_INVISIBLE)
- setConditionParam(combatInvisible, CONDITION_PARAM_BUFF, true)
- setConditionParam(combatInvisible, CONDITION_PARAM_TICKS, 600*1000)
- local conditionMelee = createConditionObject(CONDITION_ATTRIBUTES)
- setConditionParam(conditionMelee, CONDITION_PARAM_BUFF, true)
- setConditionParam(conditionMelee, CONDITION_PARAM_TICKS, 600*1000)
- setConditionParam(conditionMelee, CONDITION_PARAM_SKILL_FIST, 20)
- setConditionParam(conditionMelee, CONDITION_PARAM_SKILL_CLUB, 20)
- setConditionParam(conditionMelee, CONDITION_PARAM_SKILL_SWORD, 20)
- setConditionParam(conditionMelee, CONDITION_PARAM_SKILL_AXE, 20)
- local conditionDistance = createConditionObject(CONDITION_ATTRIBUTES)
- setConditionParam(conditionDistance, CONDITION_PARAM_BUFF, true)
- setConditionParam(conditionDistance, CONDITION_PARAM_TICKS, 600*1000)
- setConditionParam(conditionDistance, CONDITION_PARAM_SKILL_DISTANCE, 20)
- local conditionShield = createConditionObject(CONDITION_ATTRIBUTES)
- setConditionParam(conditionShield, CONDITION_PARAM_BUFF, true)
- setConditionParam(conditionShield, CONDITION_PARAM_TICKS, 600*1000)
- setConditionParam(conditionShield, CONDITION_PARAM_SKILL_SHIELD, 20)
- local combatUtamo = createConditionObject(CONDITION_MANASHIELD)
- setConditionParam(combatUtamo, CONDITION_PARAM_BUFF, true)
- setConditionParam(combatUtamo, CONDITION_PARAM_TICKS, 600*1000)
- local conditionRege = createConditionObject(CONDITION_REGENERATION)
- setConditionParam(conditionRege, CONDITION_PARAM_BUFF, true)
- setConditionParam(conditionRege, CONDITION_PARAM_TICKS, 600*1000)
- setConditionParam(conditionRege, CONDITION_PARAM_HEALTHGAIN, 20)
- setConditionParam(conditionRege, CONDITION_PARAM_HEALTHTICKS, 2000)
- local conditionspeed = createConditionObject(CONDITION_HASTE)
- setConditionParam(conditionspeed, CONDITION_PARAM_TICKS, 600*1000)
- setConditionFormula(conditionspeed, 1.0, -86, 1.0, -86)
- -- Configs of buffs
- function magicl(cid, message, keywords, parameters, node)
- local guid = getPlayerGUID(cid)
- if not npcHandler:isFocused(cid) then
- return false
- end
- if isDruid(cid) or isSorcerer(cid) then
- if getPlayerMoney(cid) >= 200 then
- doPlayerRemoveMoney(cid, 200)
- doAddCondition(cid, conditionMagic)
- selfSay('Your magic level has increased for ' .. 600 .. '!', cid)
- setPlayerStorageValue(cid, 77700, 1)
- addEvent(db.executeQuery, 600 * 1000, "UPDATE `player_storage` SET `key` = " .. 77700 .. ", `1` = -1 WHERE `player_id` = " .. guid .. " LIMIT 1;")
- else
- selfSay('You don\'t have such money.', cid)
- end
- else
- selfSay('You must be a druid or a sorcerer to receive this increment.', cid)
- end
- end
- function invisible(cid, message, keywords, parameters, node)
- local guid = getPlayerGUID(cid)
- if not npcHandler:isFocused(cid) then
- return false
- end
- if isDruid(cid) or isSorcerer(cid) then
- if getPlayerMoney(cid) >= 200 then
- doPlayerRemoveMoney(cid, 200)
- selfSay('You received invisibility for ".. 600.."!', cid)
- doAddCondition(cid, combatInvisible)
- setPlayerStorageValue(cid, 77700, 1)
- addEvent(db.executeQuery, 600 * 1000, "UPDATE `player_storage` SET `key` = " .. 77700 .. ", `1` = -1 WHERE `player_id` = " .. guid .. " LIMIT 1;")
- else
- selfSay('You don\'t have such money.', cid)
- end
- else
- selfSay('You must be a druid or a sorcerer to receive this increment.', cid)
- end
- end
- function melee(cid, message, keywords, parameters, node)
- local guid = getPlayerGUID(cid)
- if not npcHandler:isFocused(cid) then
- return false
- end
- if isKnight(cid) then
- if getPlayerMoney(cid) >= 200 then
- doPlayerRemoveMoney(cid, 200)
- doAddCondition(cid, conditionMelee)
- selfSay('Your Melee Skills has increased for ".. 600 .."!', cid)
- setPlayerStorageValue(cid, 77700, 1)
- addEvent(db.executeQuery, 600 * 1000, "UPDATE `player_storage` SET `key` = " .. 77700 .. ", `1` = -1 WHERE `player_id` = " .. guid .. " LIMIT 1;")
- else
- selfSay('You don\'t have such money.', cid)
- end
- else
- selfSay('You must be a knight to receive this increment.', cid)
- end
- end
- function distance(cid, message, keywords, parameters, node)
- local guid = getPlayerGUID(cid)
- if not npcHandler:isFocused(cid) then
- return false
- end
- if isPaladin(cid) then
- if getPlayerMoney(cid) >= 200 then
- doPlayerRemoveMoney(cid, 200)
- doAddCondition(cid, conditionDistance)
- selfSay('Your Distance Skill has increased for ".. 600 .."!', cid)
- setPlayerStorageValue(cid, 77700, 1)
- addEvent(db.executeQuery, 600 * 1000, "UPDATE `player_storage` SET `key` = " .. 77700 .. ", `1` = -1 WHERE `player_id` = " .. guid .. " LIMIT 1;")
- else
- selfSay('You don\'t have such money.', cid)
- end
- else
- selfSay('You must be a Paladin to receive this increment.', cid)
- end
- end
- function shield(cid, message, keywords, parameters, node)
- local guid = getPlayerGUID(cid)
- if not npcHandler:isFocused(cid) then
- return false
- end
- if isPaladin(cid) or isKnight(cid) then
- if getPlayerMoney(cid) >= 200 then
- doPlayerRemoveMoney(cid, 200)
- doAddCondition(cid, conditionShield)
- selfSay('Your Shielding Skill has increased for ".. 600 .."!', cid)
- setPlayerStorageValue(cid, 77700, 1)
- addEvent(db.executeQuery, 600 * 1000, "UPDATE `player_storage` SET `key` = " .. 77700 .. ", `1` = -1 WHERE `player_id` = " .. guid .. " LIMIT 1;")
- else
- selfSay('You don\'t have such money.', cid)
- end
- else
- selfSay('You must be a Paladin or a Knight to receive this increment.', cid)
- end
- end
- function magicshield(cid, message, keywords, parameters, node)
- local guid = getPlayerGUID(cid)
- if not npcHandler:isFocused(cid) then
- return false
- end
- if isPaladin(cid) or isDruid(cid) or isSorcerer(cid) then
- if getPlayerMoney(cid) >= 200 then
- doPlayerRemoveMoney(cid, 200)
- doAddCondition(cid, combatUtamo)
- selfSay('You received a Magic Shield for ".. 600 .."!', cid)
- setPlayerStorageValue(cid, 77700, 1)
- addEvent(db.executeQuery, 600 * 1000, "UPDATE `player_storage` SET `key` = " .. 77700 .. ", `1` = -1 WHERE `player_id` = " .. guid .. " LIMIT 1;")
- else
- selfSay('You don\'t have such money.', cid)
- end
- else
- selfSay('Knights can\'t receive this increment.', cid)
- end
- end
- function regener(cid, message, keywords, parameters, node)
- local guid = getPlayerGUID(cid)
- if not npcHandler:isFocused(cid) then
- return false
- end
- if isPlayer(cid) then
- if getPlayerMoney(cid) >= 200 then
- doPlayerRemoveMoney(cid, 200)
- doAddCondition(cid, conditionRege)
- selfSay('Your regeneration has increased for ".. 600 .."!', cid)
- setPlayerStorageValue(cid, 77700, 1)
- addEvent(db.executeQuery, 600 * 1000, "UPDATE `player_storage` SET `key` = " .. 77700 .. ", `1` = -1 WHERE `player_id` = " .. guid .. " LIMIT 1;")
- else
- selfSay('You don\'t have such money.', cid)
- end
- else
- selfSay('Something is wrong, you didn\'t received this increment.', cid)
- end
- end
- function speed(cid, message, keywords, parameters, node)
- local guid = getPlayerGUID(cid)
- if not npcHandler:isFocused(cid) then
- return false
- end
- if isPlayer(cid) then
- if getPlayerMoney(cid) >= 200 then
- doPlayerRemoveMoney(cid, 200)
- doAddCondition(cid, conditionspeed)
- selfSay('Your regeneration has increased for ".. 600 .."!', cid)
- setPlayerStorageValue(cid, 77700, 1)
- addEvent(db.executeQuery, 600 * 1000, "UPDATE `player_storage` SET `key` = " .. 77700 .. ", `1` = -1 WHERE `player_id` = " .. guid .. " LIMIT 1;")
- else
- selfSay('You don\'t have such money.', cid)
- end
- else
- selfSay('Something is wrong, you didn\'t received this increment.', cid)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement