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

TFS 1.X+ [actions] leveraging items

amoxicilina

New Member
Joined
Jun 25, 2010
Messages
53
Reaction score
1
server base?
OTX ~ V12.64

Reason for the topic?
I'm having a problem that when enchanting the item by lever it is coming with 1 charge and not 1000, as configured in item.xml I made some changes but I couldn't make it work I hope someone from the community can help me.

Code?

XML:
local luky4 = Action()

function luky4.onUse(cid, item, frompos, item2, topos)

local config = {
charges = 1000,  -- Charges
}

item1pos = {x=32598, y=32436, z=7, stackpos=255} --item1pos
item2pos = {x=32599, y=32436, z=7, stackpos=255} --item2pos
item3pos = {x=32599, y=32436, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)
porcentagem = 0
porcent = math.random(1, 100)


-- War Hammer --
if item.itemid == 1945 and item1.itemid == 7868 and item2.itemid == 6548 or item1.itemid == 6548 and item2.itemid == 7868 then
if math.random(1, 100) >= 1 and math.random(1, 100) <= 15 then
doRemoveItem(item1.uid,1)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item3pos,29)
doCreateItem(7883,1, item3pos)
      
doItemSetAttribute(7883, "charges", config.charges) -- I added this in an attempt to add the cartoons on successful item creation, it didn t work.
      
doPlayerSendTextMessage(cid,22,'The weapon was successfully blessed.')
elseif item.uid == 1994 and item.itemid == 1946 then
doTransformItem(item.uid,item.itemid-1)
else
doPlayerSendTextMessage(cid,22,'The gun broke.')
doRemoveItem(item1.uid,1)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item3pos,3)
end
end
end
 
OP
amoxicilina

amoxicilina

New Member
Joined
Jun 25, 2010
Messages
53
Reaction score
1
that's simple and here I'm racking my brain, kkkkk thank you ;)

@djblah just one more question how to put so when the item is created go straight to the player's backpack?
 
Last edited:
Top