not interested in making an anti-bot system for 1.3But i have tried searching and all i can see is servers with anti-bot :/
try thisHey,
It's possible to create something like: when player kill the monster and looted rare item (rare item from list) then ppls got global/world chat msg: PlayerName looted ItemName from MonsterName?
Thanks.
local rareItems = {1111, 2222, 3333}
local function scanRareItems(name, pos)
local corpse = Tile(pos):getTopDownItem()
for i = corpse:getSize()-1, 0, -1 do
local item = corpse:getItem(i)
if isInArray(rareItems, item:getId()) then
Game.broadcastMessage(("%s has looted a %d %s!"):format(name, item:getCount(), item:getCount() > 1 and ItemType(item:getId()):getPluralName() or item:getName()))
return
end
end
end
function onKill(creature, target)
if creature:isPlayer() and target:isMonster() then
addEvent(scanRareItems, 0, creature:getName(), target:getPosition())
end
return true
end
this is a bit hard to make (i don't think it's actually possible) since toCylinder doesn't return the cylinder you're actually going to put the item inHi Xeraphus.
im triying to do a script function onMove
<event class="Player" method="onMoveItem" enabled="1" />
function PlayernMoveItem(item, count, fromPosition, toPosition, fromCylinder, toCylinder)
it's possible to make something like=
if player move items from X to Y, that items set weight to 0.
and if player move again items from Y to X that items recover their original weight.
what im triying to do?
an special backpack where you can carry items even if the player no have cap.
thanks in advance Xeraphus.
this is a bit hard to make (i don't think it's actually possible) since toCylinder doesn't return the cylinder you're actually going to put the item in
otherwise you could copy the item, remove the first one and add the copied item to the new cylinder
toCylinder will be the same as fromCylinder if you're moving it from inside a backpack to another backpackif toPosition.x == CONTAINER_POSITION and toCylinder and toCylinder:getId() == "xxxx" then
then item set cap 0?
23:47 Player has looted a 1 golden legs!
23:48 Player has looted a 1 golden legs!
23:52 Player has looted a golden legss!
23:52 Player has looted a golden legss!
untested but i think it should work fine, i added the article and item name instead of the 1It's me again, sorry = D
Can I dispose of this number '1'? I try made this by myself but got something like this now:Code:23:47 Player has looted a 1 golden legs! 23:48 Player has looted a 1 golden legs!
;oCode:23:52 Player has looted a golden legss! 23:52 Player has looted a golden legss!
Extra 's' at the end.
It's possible to add this msg to world-chat too?
local rareItems = {1111, 2222, 3333}
local WORLD_CHAT = 00000 -- channel id here
local function scanRareItems(cid, pos)
local player = Player(cid)
local name = player:getName()
local corpse = Tile(pos):getTopDownItem()
for i = corpse:getSize()-1, 0, -1 do
local item = corpse:getItem(i)
if isInArray(rareItems, item:getId()) then
local count = item:getCount()
local string = ("%s has looted %s %s!"):format(name, count > 1 and count or item:getArticle(), count > 1 and item:getPluralName() or item:getName())
Game.broadcastMessage(string)
player:sendChannelMessage(nil, string, TALKTYPE_CHANNEL_R1, WORLD_CHAT)
end
end
end
function onKill(creature, target)
if creature:isPlayer() and target:isMonster() then
addEvent(scanRareItems, 0, creature:getId(), target:getPosition())
end
return true
end
i don't think there's a solution, i can't test it either cause i don't have the same server as you (don't have a working purse or that loot box)a okk, i get you, well this is my "purse slot" called menu and there is 4 items(containers)
this is the Loot box.
here comes all the loot from the monsters (automatic when you kill something)
i can add on the script (when the corpse of the monster is scaned and move the items to the loot box)
a line to remove the "cap" of the items.
but if you move that items again from there (loot box) to the first container(inventory) these items need to have cap again.
but the inventory and the loot box are in the same place "purse slot 11", so, is not possible
any other solution?
item:setAttribute(ITEM_ATTRIBUTE_WEIGHT, 0)
item:setAttribute(ITEM_ATTRIBUTE_WEIGHT, ItemType(item:getId()):getWeight())
Wondering if you could please update functions to have the date the item was added to inventory and make a talkaction to search for items like "/scanplayer "all/Name", "ID"http://pastebin.com/jnZCUfzB
not the best code but i made it work :^)
Sneaky Stabber of Eliteness 33%chance
Squeezing Gear of Girlpower 33% chance
Whacking Driller of Fate 33% chance
Ornamented shield 25% chance
Boots of Haste 25% chance
CrystalCoins 1-5 100% chance
will work on this soon, should be easyCan you script an event that is an automated trivia?
Event would be like this.
Event starts every hour
Event is a global broadcast that asks a questions every 60 seconds, players must answer questions using "$" "#" "&" or something to
answer the broadcast script
After a player has answered 3 answers correctly, the event shall finish adding an item to the player that won the event.
are you talking about updating the addItem function to set the time it was added when the item is given?Wondering if you could please update functions to have the date the item was added to inventory and make a talkaction to search for items like "/scanplayer "all/Name", "ID"
Hello! Nice job, I would like to request a questchest that have random multiple rewards. For example rightclick chest and you get a bag or backpack with the reward like
All inside a bag/backpack.Code:Sneaky Stabber of Eliteness 33%chance Squeezing Gear of Girlpower 33% chance Whacking Driller of Fate 33% chance Ornamented shield 25% chance Boots of Haste 25% chance CrystalCoins 1-5 100% chance
Every player that opens the chest should get a random reward so that 2 players might get different rewards from it.
If possible, no limit to how many items that can be rewarded from it.
Thanks in advance, hope you understand me
local items = {
{id = xxxxx, chance = y, count = {min, max}}
}
local storage = 88888
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if player:getStorageValue(storage) == 1 then
player:sendCancelMessage("You have already done this quest.")
player:getPosition():sendMagicEffect(CONST_ME_POFF)
return true
end
local backpack = player:addItem(2000)
for i = 1, #items do
if math.random(100) <= items[i].chance then
backpack:addItem(items[i].id, math.random(items[i].count[1], items[i].count[2]))
end
end
player:setStorageValue(storage, 1)
player:sendTextMessage(MESSAGE_INFO_DESCR, "You have received a reward.")
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
return true
end
Thank you! This works like a charm changedwill work on this soon, should be easy
are you talking about updating the addItem function to set the time it was added when the item is given?
i can scan the player easy i just wanna know how you expect it to be done
if you dont know ill just use debug.sethook on addItem
Lua:local items = { {id = xxxxx, chance = y, count = {min, max}} } local storage = 88888 function onUse(player, item, fromPosition, target, toPosition, isHotkey) if player:getStorageValue(storage) == 1 then player:sendCancelMessage("You have already done this quest.") player:getPosition():sendMagicEffect(CONST_ME_POFF) return true end local backpack = player:addItem(2000) for i = 1, items do if math.random(100) <= items[i].chance then backpack:addItem(items[i].id, math.random(items[i].count[1], items[i].count[2])) end end player:setStorageValue(storage, 1) player:sendTextMessage(MESSAGE_INFO_DESCR, "You have received a reward.") player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) return true end
all you have to do is add more items to the items table, i put an example of how it should look there
for i = 1, items do
for i = 1, #items do