TFS 1.3.10
Hello, Is it possible to give an attribute permanently with an npc and how can I do it?
invented storage = 600005
Npc.lua
If I wanted to give: critical chance, crit dmg, mana leech, mana chance leech, life leech, life leech change
This could help I think:
CONDITION_PARAM_SKILL_CRITICAL_HIT_CHANCE
CONDITION_PARAM_SKILL_CRITICAL_HIT_DAMAGE
CONDITION_PARAM_SKILL_LIFE_LEECH_CHANCE
CONDITION_PARAM_SKILL_LIFE_LEECH_AMOUNT
CONDITION_PARAM_SKILL_MANA_LEECH_CHANCE
CONDITION_PARAM_SKILL_MANA_LEECH_AMOUNT
Hello, Is it possible to give an attribute permanently with an npc and how can I do it?
invented storage = 600005
Npc.lua
Lua:
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
local function creatureSayCallback(cid, type, msg)
if not npcHandler:isFocused(cid) then
return false
end
local player = Player(cid)
if msgcontains(msg, "power") then
if player:getStorageValue(600005) < 1 then
add???
player:setStorageValue(600005, 2)
elseif player:getStorageValue(600005) > 1 then
npcHandler:say("I already gave you the power", cid)
npcHandler.topic[cid] = 0
end
end
end
npcHandler:setMessage(MESSAGE_GREET, 'Hello |PLAYERNAME|, do you want the {power}?')
npcHandler:setMessage(MESSAGE_FAREWELL, 'Bye.')
npcHandler:setMessage(MESSAGE_WALKAWAY, 'Noob!')
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
If I wanted to give: critical chance, crit dmg, mana leech, mana chance leech, life leech, life leech change
This could help I think:
CONDITION_PARAM_SKILL_CRITICAL_HIT_CHANCE
CONDITION_PARAM_SKILL_CRITICAL_HIT_DAMAGE
CONDITION_PARAM_SKILL_LIFE_LEECH_CHANCE
CONDITION_PARAM_SKILL_LIFE_LEECH_AMOUNT
CONDITION_PARAM_SKILL_MANA_LEECH_CHANCE
CONDITION_PARAM_SKILL_MANA_LEECH_AMOUNT
Last edited: