• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved How to add skills with script in movements?

whitevo

Feeling good, thats what I do.
Joined
Jan 2, 2015
Messages
3,454
Solutions
1
Reaction score
627
Location
Estonia
Working Script

movements.xml:

Code:
  <movevent event="Equip"  itemid="8707"  slot="shield"  script="Shields/thunder book ON.lua"  />
  <movevent event="DeEquip"  itemid="8707"  slot="shield"  script="Shields/thunder book OFF.lua"  />
thunder book ON.lua:
Code:
local attributes = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(attributes, CONDITION_PARAM_BUFF_SPELL, 1)
setConditionParam(attributes, CONDITION_PARAM_TICKS, 24*60*60*1000)
setConditionParam(attributes, CONDITION_PARAM_SKILL_SHIELD, 2)
setConditionParam(attributes, CONDITION_PARAM_STAT_MAGICPOINTS, 1)
setConditionParam(attributes, CONDITION_PARAM_SUBID, 10)

function onEquip(cid, item, slot)
  if getPlayerSlotItem(cid, slot).itemid == item.itemid then
  local player = Player(cid)
  doAddCondition(cid, attributes)
  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "wuzu wuzu")
  end
  return true
end
thunder book OFF.lua:
Code:
function onDeEquip(cid, item, slot)
local player = Player(cid)
    doRemoveCondition(cid, CONDITION_ATTRIBUTES, 10)
    return true
end
 
Last edited:
haven't come up with any alternative ideas either :|
Would be so much cooler if i could change the item attributes alongside with script though.

Currently no attribute changing items in game.
 
You you post the script ill add the shielding to it
Code:
function onEquip(cid, item, slot)
    if getPlayerSlotItem(cid, slot).itemid == item.itemid then
        local player = Player(cid)
        player:setStorageValue(10703, 1)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "wuzu wuzu")
    end
    return true
end
Im using TFS 1.0
 
tfs 1.0 hmm moment
edit.
Im not even sure about tfs 1.0 but here is a try if not you can see what i was doing :| sorry lol im a 0.3.6 noobie xD
Code:
local shielding = Combat()
shielding:setParameter(CONDITION_PARAM_SKILL_SHIELD, 1)
shielding:setParameter(CONDITION_PARAM_SUBID, 99)

function onEquip(cid, item, slot)
if getPlayerSlotItem(cid, slot).itemid == item.itemid then
local player = Player(cid)
player:addCondition(shielding)
player:setStorageValue(10703, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "wuzu wuzu")
end
return true
end

function onDeEquip(cid, item, slot)
local player = Player(cid)
player:removeCondition(shielding)
player:setStorageValue(10703, -1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "wuzu wuzu")
return true
end
 
Last edited:
Back
Top