Jump to content

malyfanek

Campones
  • Content Count

    6
  • Joined

  • Last visited

  • xPoints

    0 [ Donate ]

About malyfanek

Informações

  • Forma que conheci o xTibia
    Sites de Busca
  • Sou
    Player

Recent Profile Visitors

56 profile views
  1. Hello as the title sais i need small(? for sure not small for me) help with the talkaction, ok here's the script: local config = { rate = 2, storage = 10000, expstorage = 10100, register = 10200, exh = 10300, time = 120, -- sekundy } function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerStorageValue(cid, config.storage) <= 0 then local rates = getPlayerRates(cid) setPlayerStorageValue(cid, config.expstorage, rates[SKILL__LEVEL]) setPlayerStorageValue(cid, config.register, 1) itemEx=itemid == 12289 doCreatureSay(cid, "Your extra experience rate has been activated! It now is: " .. config.rate .. "x added to your former experience rate.", TALKTYPE_ORANGE_1, true, cid) setPlayerStorageValue(cid, config.storage, os.time()+config.time) doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]*config.rate) doRemoveItem(item.uid,1) registerCreatureEvent(cid, "ExpStage") else doCreatureSay(cid, "You must finish first exp condition to start other exp condition !", TALKTYPE_ORANGE_1, true, cid) end return true end function onThink(cid, interval) if getPlayerStorageValue(cid, config.register) == 1 then if getPlayerStorageValue(cid, config.storage) <= os.time() then doCreatureSay(cid, "Your extra experience rate has finished! It is now normaly experience rate.", TALKTYPE_ORANGE_1, true, cid) setPlayerStorageValue(cid, config.storage, 0) setPlayerStorageValue(cid, config.register, 0) local oldexp = getPlayerStorageValue(cid, config.expstorage) doPlayerSetExperienceRate(cid, oldexp) unregisterCreatureEvent(cid, "ExpStage") end end return true end function onLogin(cid) if getPlayerStorageValue(cid, config.register) == 1 then registerCreatureEvent(cid, "ExpStage") local rates = getPlayerRates(cid) doCreatureSay(cid, "Your extra experience rate is still here! It is: " .. config.rate .. "x added to your former experience rate.", TALKTYPE_ORANGE_1, true, cid) if getPlayerStorageValue(cid, config.storage) > os.time() then local oldexp = getPlayerStorageValue(cid, config.expstorage) doPlayerSetExperienceRate(cid, oldexp+config.rate) end end return true end function onSay(cid) local last = math.floor((getPlayerStorageValue(cid, 10000) - os.time())/60) -- minuty local last2 = ((getPlayerStorageValue(cid, 10000) - os.time())) -- sekundy if isPlayer then if getPlayerStorageValue(cid, config.register) == 1 then doPlayerSendCancel(cid, 'Your bonus experience time : '.. (last2).. ' seconds.') end if getPlayerStorageValue(cid, config.register) == 0 then doPlayerSendCancel(cid, 'You dont have any exp bonus!') end end return true end And the thing is as i wrote i need talkaction for players to check how much time of exp booster/exp potion, name it as u want the player got left of time. Well all is fine but it shows only in senconds, so here's my request, how to make it show hh:mm:ss? Please help ;x TFS 0,4 tibia 8,6 rev 3777
  2. I know its pretty old topic, but is there possibility to make it few winners like top3? winner, 2nd place with less stor etc?
  3. Hello, as the title sais im trying to do monster hunt event which should work like that, if i kill monster1, i get + 1 point, monster2 +2 points, monster 3 + 3points etc. For now all i have made is: <?xml version="1.0" encoding="ISO-8859-1"?> <mod name="Bad Saiyans Hunt Event" version="8.6" author="Vodkart" contact="" enabled="yes"> <config name="hunt_config"><![CDATA[ Hunt = { storages = {171421, 181921}, -- storage Count players = {min = 1, max = 50}, -- min, max players no evento minLevel = 20, -- level minimo para entrar no event rewards = {{2160,10},{2494,1}}, -- premios que vai receber timeToStartEvent = 30, -- segundos para começar o evento CheckTime = 5, -- time to check event teleport = {{x=646, y=391, z=7}, {x=1020 , y=1041, z=7}}, --teleport position, position the player goes to arena = {{x=988,y=1011,z=7},{x=1053,y=1057,z=7}} -- start and end position of the area } Hunt_Days = { ["Monday"] = {"09:00","21:00"}, ["Tuesday"] = {"09:00","21:00"}, ["Wednesday"] = {"09:00","21:00"}, ["Thursday"] = {"09:00","21:00"}, ["Friday"] = {"09:00","21:00"}, ["Saturday"] = {"09:00",'21:00'}, ["Sunday"] = {"09:00","15:00"} } function removeHuntTp() local t = getTileItemById(Hunt.teleport[1], 1387).uid return t > 0 and doRemoveItem(t) and doSendMagicEffect(Hunt.teleport[1], CONST_ME_POFF) end function ZerarStorHunt() setGlobalStorageValue(Hunt.storages[1], 0) setGlobalStorageValue(Hunt.storages[2], 0) end function getPlayersInHuntEvent() local t = {} for _, pid in pairs(getPlayersOnline()) do if isInRange(getPlayerPosition(pid), Hunt.arena[1], Hunt.arena[2]) then t[#t+1] = pid end end return t end function getHuntRewards(cid, items) local backpack = doPlayerAddItem(cid, 1999, 1) -- backpackID for _, i_i in ipairs(items) do local item, amount = i_i[1],i_i[2] if isItemStackable(item) or amount == 1 then doAddContainerItem(backpack, item, amount) else for i = 1, amount do doAddContainerItem(backpack, item, 1) end end end end function winMonsterEvent() local max_sto, winner = 0, 0 local monster = getGlobalStorageValue(1819211) for _, pid in pairs(getPlayersOnline()) do local sto = getGlobalStorageValue(pid, 1714210) if sto > max_sto then max_sto = sto winner = cid end end if isPlayer(winner) then temple = getPlayerMasterPos(cid) local artigo = getPlayerSex(winner) == 0 and "The player" or "The player" doBroadcastMessage(artigo.." "..getCreatureName(winner).." gained "..getGlobalStorageValue(winner, 1714210).." points and won the event!") for _, prize in pairs(premios) do doPlayerAddItem(winner, prize[1], prize[2]) end doPlayerAddMoney(winner, gold) for _, cid in pairs(getPlayersInHuntEvent()) do doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) end else doBroadcastMessage("[Monster Hunter Event] The event ended and there was no winner.") setGlobalStorageValue(1819211, 0) for _, cid in pairs(getPlayersInHuntEvent()) do doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) end ZerarStorHunt() end end function CheckHuntEvent(delay) local time = 5 if getGlobalStorageValue(Hunt.storages[1]) ~= (Hunt.players.max+1) then if delay > 0 and getGlobalStorageValue(Hunt.storages[1]) < Hunt.players.max then doBroadcastMessage("[Bad Saiyans Hunt Event] Starting in " .. delay .. " minutes! The teleport will be closed when the event start!", MESSAGE_STATUS_WARNING) elseif delay == 0 and getGlobalStorageValue(Hunt.storages[1]) < Hunt.players.min then for _, cid in pairs(getPlayersInHuntEvent()) do doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) end removeHuntTp() doBroadcastMessage("The Bad Saiyans Hunt event could not start because of to few players participating.\n At least " .. Hunt.players.min .. " players is needed!", MESSAGE_STATUS_WARNING) ZerarStorHunt() elseif delay == 0 and getGlobalStorageValue(Hunt.storages[1]) >= Hunt.players.min then removeHuntTp() doBroadcastMessage("Good Lucky! The event will start on "..Hunt.timeToStartEvent.." seconds. get ready!") addEvent(winMonsterEvent, time*1000*60) end addEvent(CheckHuntEvent, 60000, delay-1) end end ]]></config> <globalevent name="Hunt_Start" interval="60000" event="script"><![CDATA[ domodlib('hunt_config') function onThink(interval, lastExecution) if Hunt_Days[os.date("%A")] then local hrs = tostring(os.date("%X")):sub(1, 5) if isInArray(Hunt_Days[os.date("%A")], hrs) and getGlobalStorageValue(Hunt.storages[2]) <= 0 then local tp = doCreateItem(1387, 1, Hunt.teleport[1]) doItemSetAttribute(tp, "aid", 46111) CheckHuntEvent(Hunt.CheckTime) setGlobalStorageValue(Hunt.storages[1], 0) end end return true end]]></globalevent> <event type="login" name="Hunt_Login" event="script"><![CDATA[ domodlib('hunt_config') function onLogin(cid) registerCreatureEvent(cid, "HuntBatle") if isInRange(getPlayerPosition(cid), Hunt.arena[1], Hunt.arena[2]) then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) end return true end]]></event> <event type="combat" name="HuntBatle" event="script"><![CDATA[ domodlib('hunt_config') if isPlayer(cid) and isPlayer(target) and isInRange(getPlayerPosition(cid), Hunt.arena[1], Hunt.arena[2]) then doPlayerSendCancel(cid, "You may not attack this player.") return false end return true ]]></event> <movevent type="StepIn" actionid ="46111" event="script"><![CDATA[ domodlib('hunt_config') function onStepIn(cid, item, position, fromPosition) local time = 5 if not isPlayer(cid) then return true end if getPlayerAccess(cid) > 3 then return doTeleportThing(cid, Hunt.teleport[2]) end if getPlayerLevel(cid) < Hunt.minLevel then doTeleportThing(cid, fromPosition, true) doPlayerSendCancel(cid, "You need to be at least level " .. Hunt.minLevel .. ".") doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) return true end if getGlobalStorageValue(Hunt.storages[1]) <= Hunt.players.max then doTeleportThing(cid, Hunt.teleport[2]) setGlobalStorageValue(Hunt.storages[1], getGlobalStorageValue(Hunt.storages[1])+1) doBroadcastMessage(getPlayerName(cid) .. " entered the Bad Saiyans Hunt Event! Currently " .. getGlobalStorageValue(Hunt.storages[1]) .. " players have joined!", MESSAGE_STATUS_CONSOLE_RED) if getGlobalStorageValue(Hunt.storages[1]) == Hunt.players.max then setGlobalStorageValue(Hunt.storages[1], getGlobalStorageValue(Hunt.storages[1])+1) removeHuntTp() doBroadcastMessage("The event will start on "..Hunt.timeToStartEvent.." seconds. get ready!") addEvent(winMonsterEvent, time*1000*60) end end return true end]]></movevent> <talkaction words="/huntstart;!huntstart" access="5" event="buffer"><![CDATA[ domodlib('hunt_config') if getGlobalStorageValue(Hunt.storages[2]) > 0 then doPlayerSendCancel(cid, "The event is already starting.") return true elseif not param or not tonumber(param) then doPlayerSendCancel(cid, "Use only numbers.") return true end local param = tonumber(param) <= 0 and 1 or tonumber(param) local tp = doCreateItem(1387, 1, Hunt.teleport[1]) doItemSetAttribute(tp, "aid", 46111) CheckHuntEvent(tonumber(param)) setGlobalStorageValue(Hunt.storages[1], 0) setGlobalStorageValue(Hunt.storages[2], 1) ]]></talkaction> <globalevent name="HuntDebug-Start" type="start" event="buffer"><![CDATA[ domodlib('hunt_config') ZerarStorHunt() return true]]></globalevent> </mod> And its all works fine, it runs on days, talkaction works too but the problem is with function winMonsterEvent() Because it always give a winner to the admin even if he got storage -1 or no winner ; / I also added monster with script: function onKill(cid, target, lastHit) if isMonster ( target ) and getCreatureName ( target ) == 'Bad Raditz [EVENT]' and getGlobalStorageValue ( cid ,1714210) > 0 then doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'You have killd 1 of event monster.') setGlobalStorageValue(cid,1714210, getGlobalStorageValue(cid, 1714210) + 1) end return true end wanned to add later more monsters that give more than +1 stor value but ... first need to finish this, what am i doing wrong? no error in console, nothing, any tips / help or maybe better ideas? And the 2nd thing, how to make it 3 winners? / edit I try to compare the event with this one (not sure can i add link if not please delete this edit) but atleast it might be helpfull Its edited fire storm event + this one from link if it might help Im using tibia 8.6 tfs 0,4 rev 3777
  4. malyfanek

    EQ bonus from SET

    I have a small problem, Im using tfs 0,4 rev 3777, well i have made a script local IDFEET = 13499 local IDARMOR = 13497 local IDLEGS = 13498 function onDeEquip(cid, item, slot) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You just lost bonus from set.") end function onEquip(cid, item, slot) if getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == IDFEET and getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid == IDARMOR and getPlayerSlotItem(cid, CONST_SLOT_LEGS).itemid == IDLEGS then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Bonus activated.") end return true end And it works, but there's another problem, i have registered it into movements.xml as: <movevent type="Equip" itemid="13499" slot="feet" event="script" value="bills set.lua"/> <movevent type="DeEquip" itemid="13499" slot="feet" event="script" value="bills set.lua"/> and the problem is the event is duplicated cuz of: <movevent type="Equip" itemid="13499" slot="feet" event="function" value="onEquipItem"/> <movevent type="DeEquip" itemid="13499" slot="feet" event="function" value="onDeEquipItem"/> And because of that "THE SET BONUS" works but the boots doesnt add their bonus stats thats are made at items.xml How can i fix that? Any idea/tips/help? Ok i just noticed that it gives bonus when i wear boots even without full set so Im still doing something wrong
  5. malyfanek

    PZ tile?

    Well that was just example, tried with cid etc like: function onThink(cid, interval) if (getTilePzInfo(getCreaturePosition(cid))) then if isPlayer(cid) and (getTilePzInfo(getCreaturePosition(cid)) and getCreatureCondition(cid, CONDITION_INFIGHT)) then doTeleportThing(cid, fromPosition, false) doPlayerSendTextMessage(cid, 25, "You cant enter protection zone while in fight.") end end return true end and about "Also the variable fromPosition in function doTeleportThing is not declared so it doesn't have a value." I though thats how works Pushback And to be honest, as I wrote i also think its something in distro but i see thats i got same tile/player/combat/game.cpp same as the distro u gave when i search for "PROTECTIONZONE" So i already have no idea whats wrong ;x Maybe some tips where to search for those function exacly at source or something? Cuz i rly dont wanna do it in LUA to dont make server too laggy but atleast i think i gonna need to make onmove ;x
  6. malyfanek

    PZ tile?

    I have a problem with PZ, players can enter PZ with fight on and they get PZ, when they left fight is back .... I though about making walkon event with pz tile but ... im not sure is it good idea, wouldnt it slow down server very much? Maybe i got something wrong in source? (where to search for it? i checked tile.h, tile.cpp, players.cpp didnt see anything wrong there i guess) Making script with pz pushback if in fight condition ?? But also have no idea how it shall look ... Strange is cuz though that if i add PZ at mapeditor, it shoudlnt let players enter there if in fight etc but it does .... Tfs 0.4 rev 3777 client 8.6 Tried: function onThink (interval) if isPlayer (cid) and (getTilePzInfo (getCreaturePosition (cid)) and getCreatureCondition (cid, CONDITION_INFIGHT)) then doTeleportThing (cid, fromPosition, false) doPlayerSendTextMessage (cid, 25, "while you can't enter . ") end return true end No errors at console, tried with true / false but not works; x
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...