hi, i need talkaction
Change the colors of the characters party, but not the looktype
function onSay(player, words, param)
local party = player:getParty()
if not party then
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You are not in a party.")
return false
end
if not (party:getLeader() == player) then
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You are not the leader of the party.")
return false
end
local outfit = player:getOutfit()
local members = party:getMembers()
for i = 1, #members do
local newOutfit = members[i]:getOutfit()
newOutfit.lookHead = outfit.lookHead
newOutfit.lookBody = outfit.lookBody
newOutfit.lookLegs = outfit.lookLegs
newOutfit.lookFeet = outfit.lookFeet
members[i]:setOutfit(newOutfit)
members[i]:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
end
return false
end
<talkaction words="!poutfit" script="party outfit.lua"/>
Hey,
I need action script with an easy way to change/add sacrificedItems and rewardItems,
two of the same items will be removed and replaced by award (20% chance for rewardItem from list) or 20% chance for each trash item (4 trash items). Screen is only for example id of items can be any.
I would be very grateful!
Thanks for Help =]
local basin = Position(1022, 997, 7) -- position of the reward basin
local leftAltar = Position(1020, 1000, 7) -- position of the left altar
local rightAltar = Position(1024, 1000, 7) -- position of the right altar
local combinations = {
[2173] = {id = 2148, count = 20} -- [sacrifice id] = {id = reward id, count = reward count}
}
local trash = {2676, 2223, 2675, 2506} -- change these
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local leftItem = Tile(leftAltar):getTopDownItem()
local rightItem = Tile(rightAltar):getTopDownItem()
local reward = leftItem and combinations[leftItem:getId()]
if (not leftItem) or (not rightItem) or (not combinations[leftItem:getId()]) or (not combinations[rightItem:getId()]) then
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Invalid combination.")
return item:transform(item:getId() == 1945 and 1946 or 1945)
end
local reward = combinations[leftItem:getId()]
if math.random(100) <= 20 then
Game.createItem(reward.id, reward.count, basin)
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You have successfully sacrificed your items.")
leftAltar:sendMagicEffect(CONST_ME_MAGIC_RED)
rightAltar:sendMagicEffect(CONST_ME_MAGIC_RED)
basin:sendMagicEffect(CONST_ME_MAGIC_GREEN)
leftItem:remove()
rightItem:remove()
else
for i = 1, #trash do
if math.random(100) <= 20 then
Game.createItem(trash[i], 1, basin)
end
end
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You have failed to sacrifice your items.")
leftAltar:sendMagicEffect(CONST_ME_POFF)
rightAltar:sendMagicEffect(CONST_ME_POFF)
leftItem:remove()
rightItem:remove()
end
return item:transform(item:getId() == 1945 and 1946 or 1945)
end
<action actionid="8884" script="sacrifice.lua"/>
function onKill(player, target, mostDamageKiller)
if not player == mostDamageKiller or isSummon(target) then
return true
end
local monsters = {
[1] = { name = "rat", min_gold = 1, max_gold = 10, exp = 1000 },
[2] = { name = "cave rat", min_gold = 10, max_gold = 20, exp = 10000 },
[3] = { name = "rotworm", min_gold = 20, max_gold = 30, exp = 1000000 }
}
for i = 1, #monsters do
if monsters[i].name == target:getName():lower() then
local value = math.random(monsters[i].min_gold, monsters[i].max_gold)
local exp = (monsters[i].exp)
player:setBankBalance(player:getBankBalance() + value)
player:sendTextMessage(MESSAGE_STATUS_DEFAULT, string.format('You have gained %d coins in this battle.', value))
break
end
return true
end
php not includedOne script for sell/buy characters on gesior acc?
buy char= http://pastebin.com/Q6CaYeszOne script for sell/buy characters on gesior acc?
i think this is what you wantHello, I'm here to make a request, and thank you for the thread and the amazing work.
Map pic (just made a quick one to explain: http://prntscr.com/e595o1
The thing is a hunting arena, where there are X rooms. (8 rooms on the screenshot)
Each room type there's a monster. (4 types on the screenshot)
The teleport outside the room would bring the player to the room, once they've entered, no one else can enter, the room would auto summon the monster that it's inside (there would be no spawn on the map, just a script that summons the monster once it's dead)
If the player enters the teleport inside the room (to exit) or dies, the monster would be removed and the room would be avaliable again.
I have no idea how to keep summoning monster and check if it's alive or there's someone there, but i can help with the rest.
Hope you can help me, if you need more information, I can give you!
Thanks for your time.
edit.
If can be tables to add more rooms would be nice.
Some movement (?) that i add the actionid to each teleport, then add a globalstorage and a monster name?
just some ideas, don't know the best way it can be done.
monsters = {
[4000] = {teleportPos = Position(1, 1, 1), spawnPos = Position(1, 1, 1), name = "Dragon"}
}
function onThink(interval)
for k, v in pairs(monsters) do
local monsterSpawned = false
local playerInside = false
local specs = Game.getSpectators(v, false, false, 7, 7, 7, 7)
for s = 1, #specs do
if specs[i]:isMonster() then
monsterSpawned = specs[i]
end
if specs[i]:isPlayer() then
playerInside = true
end
end
if not playerInside and monsterSpawned then
monsterSpawned:addHealth(monsterSpawned:getMaxHealth())
end
if not monsterSpawned then
Game.createMonster(v.name, v.spawnPos)
end
end
return true
end
function onStepIn(creature, item, toPosition, fromPosition)
local player = creature:getPlayer()
if not player then
return true
end
local tp = monsters[item:getActionId()]
if not tp then
return true
end
local specs = Game.getSpectators(tp.teleportPos, false, true, 7, 7, 7, 7)
if #specs > 0 then
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "There is already a player in there.")
return addEvent(function(cid) Player(cid):teleportTo(fromPosition) end, 5, player:getId())
end
player:teleportTo(tp.teleportPos)
return true
end
Thanks so much for your time and the fast job, I'm at work right now and will test as soon as I get home, if you have some free time to optimize would be nice, because all the checks and everything with a few rooms can be really heavy, no? Anyway, will check and report anything I find. Just one thing i got doubt by reading the script, the tp to enter is the actionid on the table, what about the exit teleport?i think this is what you want
it should be self explanatory how to add more rooms, edit positions, etc
but if you need help ask
(keep in mind these are separate scripts, globalevent and movement)
there is a better solution rather than onthink, but i just whipped this up in like 5-6 mins to see if it would work, if you would like to me to create a fully optimized script let me know
also untested
[/code]
it wouldn't be really heavy, still fast (if you have doubts you can test it by saving time at the top of the function and subtract current time with the time saved using os.mtime())Thanks so much for your time and the fast job, I'm at work right now and will test as soon as I get home, if you have some free time to optimize would be nice, because all the checks and everything with a few rooms can be really heavy, no? Anyway, will check and report anything I find. Just one thing i got doubt by reading the script, the tp to enter is the actionid on the table, what about the exit teleport?
Thanks!
Lua:local basin = Position(1022, 997, 7) -- position of the reward basin local leftAltar = Position(1020, 1000, 7) -- position of the left altar local rightAltar = Position(1024, 1000, 7) -- position of the right altar local combinations = { [2173] = {id = 2148, count = 20} -- [sacrifice id] = {id = reward id, count = reward count} } local trash = {2676, 2223, 2675, 2506} -- change these function onUse(player, item, fromPosition, target, toPosition, isHotkey) local leftItem = Tile(leftAltar):getTopDownItem() local rightItem = Tile(rightAltar):getTopDownItem() local reward = leftItem and combinations[leftItem:getId()] if (not leftItem) or (not rightItem) or (not combinations[leftItem:getId()]) or (not combinations[rightItem:getId()]) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Invalid combination.") return item:transform(item:getId() == 1945 and 1946 or 1945) end local reward = combinations[leftItem:getId()] if math.random(100) <= 20 then Game.createItem(reward.id, reward.count, basin) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You have successfully sacrificed your items.") leftAltar:sendMagicEffect(CONST_ME_MAGIC_RED) rightAltar:sendMagicEffect(CONST_ME_MAGIC_RED) basin:sendMagicEffect(CONST_ME_MAGIC_GREEN) leftItem:remove() rightItem:remove() else for i = 1, #trash do if math.random(100) <= 20 then Game.createItem(trash[i], 1, basin) end end player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You have failed to sacrifice your items.") leftAltar:sendMagicEffect(CONST_ME_POFF) rightAltar:sendMagicEffect(CONST_ME_POFF) leftItem:remove() rightItem:remove() end return item:transform(item:getId() == 1945 and 1946 or 1945) end
XML:<action actionid="8884" script="sacrifice.lua"/>
it doesnt guarantee 1 trash item, each one has a 20% chance\o/ Epic! thanks! \o/
~~
Sometimes player got two trash items or nothing, weird ;o
i'll think about working on this, not really interested in working on a forest generator thoughHi!
I need a script (not sure if this should be global event or what?) that would randomize the forest. The bullet points:
-the forest is made of chunks 10x10 tiles big
-every x time if there are no players near a chunk it re-randomizes itself
-when re-randomizing chunk removes all non-ground items from itself then spawns random forest elements on itself
-items can not be spawned on or removed from non-walkable tiles
-each type of spawned item (grass tufts, bushes, trees etc) density is controllable by parameter
-please use Ab'dendriel tileset
I hope you like the challenge
i'll think about working on this, not really interested in working on a forest generator though
there are already such antibot systems, search and you´ll findHi! I am wondering if you could make an antibot system? For tfs 1.3