• 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!

I can drop arrows :(

bomba

Member
Joined
Feb 26, 2008
Messages
635
Reaction score
7
Location
Brazil
I can drop arrows :(
I need the script to not drop arrows when actionid:
Code:
function onDeEquip(cid, item, slot)
    if item.aid == 11119 then
      return false -- not drop arrows when actionid is 11119
    end
  return true
end
Code:
    <movevent type="DeEquip" itemid="2544" event="script" value="arrows.lua"/>

Don't work :(
I can drop my arrows...
 
Man, players on my otserv creates new characters to take arrows... I wanna it impossible, because exists the NPC to sell arrows...
 
Try:
Code:
function onDeEquip(cid, item, slot)
if item.id == 2544 and item.aid ==  11119
then
return false -- not drop arrows when actionid is 11119
end
return true
end
 
I tryed:
Code:
function onDeEquip(cid, item, slot)
if item.id == 2544 and item.aid ==  11119
then
return false -- not drop arrows when actionid is 11119
end
return true
end

But I always can drop arrows :(
 
how about removing the arrows when deequipted?
to me it seems your .exe (sources) reads movements after the movement happened. which means you can't prevent a movement by a script because it happened before the script was read.
but it should return the item to the movement so the script can use that.

So you should be able to make a script that removes the arrows if moved from your EQ.
And another thing you can do is adding arrows to the slot they were moved from.

moved from arrow_slot = deleted -> createitem in arrow slot.
Hope you understood me.
From there you can yourself decide all the things tat could and should happen, etc create same amount that was moved, or update the amount if the player didn't move all arrows.. and so on
 
And a solution to this?
I'm thinking of another alternative to this problem.
When the player creates an archer he gets his name in arrows... And only he can use.
Is this possible?
A creaturescript...
 
events/scripts/player.lua
Code:
function Player:onMoveItem(item, count, fromPosition, toPosition)
    if toPosition:getTile() ~= nil and item:getActionId() == ACTION_ID then
        return false
    end
    return true
end
events/events.xml
Code:
<event class="Player" method="onMoveItem" enabled="1"/>

The player will be able to move it on his bacpack, but not able to drop it on the floor.
 
No, that's why you MUST tell us wich distribution version are you using.

I don't give support to old tfs version, only TFS 1.0. srry :(
 
Back
Top