Histórico de Curtidas
-
Danves recebeu reputação de kk4444 em (Resolvido){Pedido} Teleportar quando acabar a PremiumFiz um creaturescripts que talvez só ele já funcione. Crie um com o nome vip.lua e cole dentro function onLogin(cid) if getPlayerPremiumDays(cid) > 0 and getPlayerStorageValue(cid, 95498) == -1 then setPlayerStorageValue(cid, 95498, 1) end if getPlayerPremiumDays(cid) <= 0 and getPlayerStorageValue(cid, 95498) == 1 then setPlayerStorageValue(cid, 95498, -1) local temple = getTownTemplePosition(getPlayerTown(cid)) doTeleportThing(cid, temple) doPlayerPopupFYI(cid, "Sua vip acabou.") end return true end Se não quer que teleporte pro templo, edite essa parte de vermelho com as pos e tal
local temple = getTownTemplePosition(getPlayerTown(cid))
No creaturescripts.xml <event type="login" name="Vip" script="vip.lua"/> No login.lua registerCreatureEvent(cid, "Vip") -
Danves recebeu reputação de Igorzerah em Configurar SD pra palla e magelocal combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -4, -50, -2, -30) local combat2 = createCombatObject() setCombatParam(combat2, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE) setCombatParam(combat2, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA) setCombatParam(combat2, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH) setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -4.6, -50, -2, -30) function onCastSpell(cid, var) if isInArray({1,2,5,6}, getPlayerVocation(cid)) then doCombat(cid, combat, var) elseif isInArray({3,7}, getPlayerVocation(cid)) then doCombat(cid, combat2, var) end return true end
Altere aqui os danos dos mages
Altere aqui os danos dos pallys. -
Danves recebeu reputação de kjadlhsajkd em Duvida sobre Script Ot Server Pokemon ( Respawns )Abra seu config.lua, dê ctrl+f e mude onde tiver
allowBlockSpawn = false
Para
allowBlockSpawn = true
-
Danves recebeu reputação de Sematico em Qual seria um OT Server ideal na sua opinião?Votei em É a favor da venda de VIP/Donate pelo jogo? Sendo que no sentido de poder comprar pontos no site e negociá-los in-game, fazendo assim comércio in-game de donates do site(itens que valem pontos).
Se você não tem condições fora do jogo, não ficaria pra trás, basta juntar um bom gold in-game e comprar de quem quer lucrar in-game via $ externo.
-
Danves recebeu reputação de poko360 em (Resolvido)[Pedido] potions healando de acordo com o level ou ml
-
Danves recebeu reputação de poko360 em (Resolvido)[Pedido] potions healando de acordo com o level ou mlConfigure a rate que multiplica pelo level da respectiva health potion na tabela "POTIONS" onde tem "rate = x".
Aqui funcionou, mas não sei se tem algo diferente da sua versão.
-
Danves recebeu reputação de avalax em (Resolvido)[SPELL] HEALAR 2 PLAYER AO MESMO TEMPOSó ir mudando o posx e posy até ficar no local que deseja.
-
Danves recebeu reputação de avalax em (Resolvido)[SPELL] HEALAR 2 PLAYER AO MESMO TEMPOFaça bom proveito.
-
Danves recebeu reputação de avalax em (Resolvido)[Pedido] potions healando de acordo com o level ou mlConfigure a rate que multiplica pelo level da respectiva health potion na tabela "POTIONS" onde tem "rate = x".
Aqui funcionou, mas não sei se tem algo diferente da sua versão.
-
Danves recebeu reputação de ScythePhantom em (Resolvido)Efeito Vocationlocal tab = { [9] = 35, -- [vocationID] = número da cor do texto animado [10] = 10, [11] = 18, [12] = 180 } function ariseText(cid) if not isCreature(cid) then return false end local texts = {"´ . ,", ". ´ ,", "` . ,", ", ´ ."} doSendAnimatedText(getThingPos(cid), texts[math.random(1, #texts)], tab[getPlayerVocation(cid)]) if isPlayer(cid) then addEvent(ariseText, 1000, cid) end return true end function onLogin(cid) if tab[getPlayerVocation(cid)] then ariseText(cid) end return true end
-
Danves recebeu reputação de Sociopata em Mensagem de LootVai no config.lua e procura por monsterLootMessage e coloca 0.
Se não tiver isso no config, acho que só na source..
-
Danves recebeu reputação de RigBy em (Resolvido)Dano equivalente ao seu life atuallocal combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true) setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREATTACK) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE) local storage = 10002 local tempo = 2 local mana = 12 local ClearMind = 10000 function onCastSpell(cid, var) if getPlayerStorageValue(cid, storage) < os.time() then if getPlayerStorageValue(cid, ClearMind) == -1 then if getCreatureMana(cid) >= mana then doCombat(cid, combat, var) setPlayerStorageValue(cid, storage, os.time() + tempo) doCreatureAddMana(cid, -mana) else doPlayerSendCancel(cid, "É preciso de "..mana.." para usar a magia.") return false end elseif getCreatureMana(cid) >= (mana/2) then health = getCreatureHealth(cid)/10 health = math.ceil(health) doTargetCombatHealth(cid, variantToNumber(var), COMBAT_FIREDAMAGE, -health, -health, -1) doCombat(cid, combat, var) doCreatureAddMana(cid, -mana/2) setPlayerStorageValue(cid, storage, os.time() + tempo) else doPlayerSendCancel(cid, "É preciso de "..mana.." para usar a magia.") return false end else doPlayerSendCancel(cid, "Você tem que esperar "..getPlayerStorageValue(cid, storage) - os.time().." segundos para usar a magia novamente.") return false end return true end
-
Danves recebeu reputação de XirupitasFarm em Arma Ajuda!Vai balanceando nessa parte aqui deles setCombatFormula(combat4_Brush, COMBAT_FORMULA_LEVELMAGIC, -50.0, -52, -54.0, -55)
-
Danves recebeu reputação de XirupitasFarm em Arma Ajuda!Seria um atk com vários elementos de uma só vez? Ou seria um random com chance de vir um elemento por vez nesse 1x1?
Poste o script e a modificação que quer
-
Danves deu reputação a Gantz em [TFS 1.0] addCooldown(spellid, time) - getCooldown(spellid)Bom eu criei essas duas funções para usar no meu OT, elas forçam o uso do cooldown do sistema do tibia, você pode usa lo mesmo que não tenha executado nenhuma spell.
por exemplo:
player:addCooldown(87, 10000) sendo 87 o código da spell, ou seja a imagem que ira aparecer no cooldown, lembrando que estas imagens podem ser editadas no tibia.pic.
E 10000 o tempo do cooldown, lembrando a cada 1000 equivale a 1 segundo.
resultado:
e a função get ele retorna true ou false, para caso o cooldown estiver sendo executado:
player:getCooldown(87) Vamos la.
em luascript.cpp procure por:
registerMethod("Player", "getMoney", LuaScriptInterface::luaPlayerGetMoney); registerMethod("Player", "addMoney", LuaScriptInterface::luaPlayerAddMoney); registerMethod("Player", "removeMoney", LuaScriptInterface::luaPlayerRemoveMoney); e logo depois dessas linhas de códigos adicione:
registerMethod("Player", "addCooldown", LuaScriptInterface::luaPlayerAddCooldown); registerMethod("Player", "getCooldown", LuaScriptInterface::luaPlayerGetCooldown); ainda em luascript.cpp procure por:
int32_t LuaScriptInterface::luaPlayerRemoveMoney(lua_State* L) e após a ultima linha desta função adicione:
int32_t LuaScriptInterface::luaPlayerAddCooldown(lua_State* L) { // player:addCooldown(spellid, cooldown) Player* player = getUserdata<Player>(L, 1); if (player) { uint8_t spellId = getNumber<uint8_t>(L, 2); uint32_t cooldown = getNumber<uint32_t>(L, 3); Condition* condition = Condition::createCondition(CONDITIONID_DEFAULT, CONDITION_SPELLCOOLDOWN, cooldown, 0, false, spellId); player->addCondition(condition); pushBoolean(L, true); } else { lua_pushnil(L); } return 1; } int32_t LuaScriptInterface::luaPlayerGetCooldown(lua_State* L) { // player:getCooldown(spellid) Player* player = getUserdata<Player>(L, 1); if (!player) { lua_pushnil(L); return 1; } uint32_t spellid = getNumber<uint32_t>(L, 2); if (player->hasCondition(CONDITION_SPELLCOOLDOWN, spellid)) { pushBoolean(L, true); } else { pushBoolean(L, false); } return 1; } agora em luascript.h procure por:
static int32_t luaPlayerGetMoney(lua_State* L); static int32_t luaPlayerAddMoney(lua_State* L); static int32_t luaPlayerRemoveMoney(lua_State* L); e logo após estes código adicione:
static int32_t luaPlayerAddCooldown(lua_State* L); static int32_t luaPlayerGetCooldown(lua_State* L); depois é só compilar e usar !
-
Danves recebeu reputação de Frenesy em (Resolvido)SummonAttackfunction onTarget(cid, target) if isSummon(target) and isPlayer(cid) and getCreatureMaster(target) == cid then return false end return true end function onStatsChange(cid, attacker, type, combat, value) if type == STATSCHANGE_HEALTHLOSS and isSummon(cid) and isPlayer(attacker) and getCreatureMaster(cid) == attacker then return false end return true end Acredito que não precisa do Oncast, vendo que você não poderá targetar ele e nem tirar dano com AOE por causa do statschange.
-
Danves recebeu reputação de xWhiteWolf em (Resolvido)SummonAttackfunction onTarget(cid, target) if isSummon(target) and isPlayer(cid) and getCreatureMaster(target) == cid then return false end return true end function onStatsChange(cid, attacker, type, combat, value) if type == STATSCHANGE_HEALTHLOSS and isSummon(cid) and isPlayer(attacker) and getCreatureMaster(cid) == attacker then return false end return true end Acredito que não precisa do Oncast, vendo que você não poderá targetar ele e nem tirar dano com AOE por causa do statschange.
-
Danves recebeu reputação de arthurabreu em Problemas com SpellPelo que percebi essa função só pega o lado que a pessoa esta olhando..
Podia ser simplesmente substituído, mas já que usa em vários lugares, colocarei a função na spell
Deixa a spell assim:
function getPatrzJacolos(cid) return getCreatureLookDirection(cid) end local combat1 = createCombatObject() setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(combat1, COMBAT_PARAM_EFFECT, 87) setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -5.0, 0, -5.1, 0) local arr1 = { {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {1, 0, 0, 0, 0}, {1, 2, 0, 0, 0}, {1, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, } local area1 = createCombatArea(arr1) setCombatArea(combat1, area1) local combat10 = createCombatObject() setCombatParam(combat10, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(combat10, COMBAT_PARAM_EFFECT, 88) setCombatFormula(combat10, COMBAT_FORMULA_LEVELMAGIC, -5.0, 0, -5.1, 0) local arr10 = { {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 1, 1, 0, 0}, {0, 1, 1, 1, 0, 2}, {0, 0, 1, 1, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, } local area10 = createCombatArea(arr10) setCombatArea(combat10, area10) local combat100 = createCombatObject() setCombatParam(combat100, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(combat100, COMBAT_PARAM_EFFECT, 89) setCombatFormula(combat100, COMBAT_FORMULA_LEVELMAGIC, -5.0, 0, -5.1, 0) local arr100 = { {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 1, 0, 0, 0, 0}, {1, 0, 0, 0, 0, 2}, {0, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, } local area100 = createCombatArea(arr100) setCombatArea(combat100, area100) local combat2 = createCombatObject() setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(combat2, COMBAT_PARAM_EFFECT, 89) setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -5.0, 0, -5.1, 0) local arr2 = { {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 1, 0, 0, 0}, {2, 1, 0, 0, 0}, {0, 1, 0, 0, 0}, {0, 0, 0, 0, 0}, } local area2 = createCombatArea(arr2) setCombatArea(combat2, area2) local combat20 = createCombatObject() setCombatParam(combat20, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(combat20, COMBAT_PARAM_EFFECT, 88) setCombatFormula(combat20, COMBAT_FORMULA_LEVELMAGIC, -5.0, 0, -5.1, 0) local arr20 = { {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 1, 0}, {0, 2, 0, 1, 1, 1}, {0, 0, 0, 1, 1, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, } local area20 = createCombatArea(arr20) setCombatArea(combat20, area20) local combat200 = createCombatObject() setCombatParam(combat200, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(combat200, COMBAT_PARAM_EFFECT, 87) setCombatFormula(combat200, COMBAT_FORMULA_LEVELMAGIC, -5.0, 0, -5.1, 0) local arr200 = { {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 0}, {2, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 1, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, } local area200 = createCombatArea(arr200) setCombatArea(combat200, area200) local combat3 = createCombatObject() setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(combat3, COMBAT_PARAM_EFFECT, 92) setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -5.0, 0, -5.1, 0) local arr3 = { {0, 0, 0, 0, 0}, {0, 0, 0, 2, 0}, {0, 0, 1, 1, 1}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, } local area3 = createCombatArea(arr3) setCombatArea(combat3, area3) local combat30 = createCombatObject() setCombatParam(combat30, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(combat30, COMBAT_PARAM_EFFECT, 91) setCombatFormula(combat30, COMBAT_FORMULA_LEVELMAGIC, -5.0, 0, -5.1, 0) local arr30 = { {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 2, 0, 0}, {0, 0, 0, 0, 0}, {0, 1, 1, 1, 0}, {0, 1, 1, 1, 0}, {0, 0, 1, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, } local area30 = createCombatArea(arr30) setCombatArea(combat30, area30) local combat300 = createCombatObject() setCombatParam(combat300, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(combat300, COMBAT_PARAM_EFFECT, 90) setCombatFormula(combat300, COMBAT_FORMULA_LEVELMAGIC, -5.0, 0, -5.1, 0) local arr300 = { {0, 0, 2, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 1, 0, 1, 0, 0}, {0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, } local area300 = createCombatArea(arr300) setCombatArea(combat300, area300) local combat4 = createCombatObject() setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(combat4, COMBAT_PARAM_EFFECT, 90) setCombatFormula(combat4, COMBAT_FORMULA_LEVELMAGIC, -5.0, 0, -5.1, 0) local arr4 = { {0, 0, 0, 0, 0}, {0, 0, 1, 1, 1}, {0, 0, 0, 2, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, } local area4 = createCombatArea(arr4) setCombatArea(combat4, area4) local combat40 = createCombatObject() setCombatParam(combat40, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(combat40, COMBAT_PARAM_EFFECT, 91) setCombatFormula(combat40, COMBAT_FORMULA_LEVELMAGIC, -5.0, 0, -5.1, 0) local arr40 = { {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 1, 0, 0}, {0, 1, 1, 1, 0}, {0, 1, 1, 1, 0}, {0, 0, 0, 0, 0}, {0, 0, 2, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, } local area40 = createCombatArea(arr40) setCombatArea(combat40, area40) local combat400 = createCombatObject() setCombatParam(combat400, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(combat400, COMBAT_PARAM_EFFECT, 92) setCombatFormula(combat400, COMBAT_FORMULA_LEVELMAGIC, -5.0, 0, -5.1, 0) local arr400 = { {0, 0, 1, 0, 0, 0}, {0, 1, 0, 1, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 2, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, } local area400 = createCombatArea(arr400) setCombatArea(combat400, area400) function hf(cid) if getPatrzJacolos(cid) == 1 then doCombat(cid, combat1, numberToVariant(cid)) doCombat(cid, combat10, numberToVariant(cid)) doCombat(cid, combat100, numberToVariant(cid)) doPlayerSay(cid, 'Haaaa!', TALKTYPE_ORANGE_1) elseif getPatrzJacolos(cid) == 2 then doCombat(cid, combat4, numberToVariant(cid)) doCombat(cid, combat40, numberToVariant(cid)) doCombat(cid, combat400, numberToVariant(cid)) doPlayerSay(cid, 'Haaaa!', TALKTYPE_ORANGE_1) elseif getPatrzJacolos(cid) == 3 then doCombat(cid, combat2, numberToVariant(cid)) doCombat(cid, combat20, numberToVariant(cid)) doCombat(cid, combat200, numberToVariant(cid)) doPlayerSay(cid, 'Haaaa!', TALKTYPE_ORANGE_1) elseif getPatrzJacolos(cid) == 0 then doCombat(cid, combat3, numberToVariant(cid)) doCombat(cid, combat30, numberToVariant(cid)) doCombat(cid, combat300, numberToVariant(cid)) doPlayerSay(cid, 'Haaaa!', TALKTYPE_ORANGE_1) end end function mf2(cid) doPlayerSay(cid, 'Ha Me!', TALKTYPE_ORANGE_1) addEvent(hf,0,cid) end function hf2(cid) doPlayerSay(cid, 'Ka Me!', TALKTYPE_ORANGE_1) addEvent(mf2,0,cid) end function mf(cid) doPlayerSay(cid, 'Bang!', TALKTYPE_ORANGE_1) addEvent(hf2,0,cid) end function kf(cid) doPlayerSay(cid, 'Big!', TALKTYPE_ORANGE_1) addEvent(mf,0,cid) end function onCastSpell(cid, var) addEvent(kf,0,cid) end -
Danves recebeu reputação de arthurabreu em Problemas com SpellCara deixa essa spell assim que iria acertar todas as outras, eu pus uma function global nela, todas as outras spells lerão essa function.
-
Danves recebeu reputação de sdnjaks em (Resolvido)SPELL SEM MAGIC EFFECTlocal tempo = 5 -- tempo do paralyze em segundos local effect = 221 -- efeito que vai sair ao redor do player local exausted = 8 -- exhausted em segundos local storage = 13098 -- storage do exausted local condition = createConditionObject(CONDITION_PARALYZE) setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000) setConditionParam(condition, CONDITION_PARAM_SPEED, -5000) function onCastSpell(cid, var) local target = getCreatureTarget(cid) local function Efect() if not isCreature(target) then return true end local positions = { [1] = {x=getCreaturePosition(target).x+1, y=getCreaturePosition(target).y+1, z=getCreaturePosition(target).z}, [2] = {x=getCreaturePosition(target).x+1, y=getCreaturePosition(target).y, z=getCreaturePosition(target).z}, [3] = {x=getCreaturePosition(target).x+1, y=getCreaturePosition(target).y-1, z=getCreaturePosition(target).z}, [4] = {x=getCreaturePosition(target).x-1, y=getCreaturePosition(target).y+1, z=getCreaturePosition(target).z}, [5] = {x=getCreaturePosition(target).x-1, y=getCreaturePosition(target).y, z=getCreaturePosition(target).z}, [6] = {x=getCreaturePosition(target).x-1, y=getCreaturePosition(target).y-1, z=getCreaturePosition(target).z}, [7] = {x=getCreaturePosition(target).x, y=getCreaturePosition(target).y+1, z=getCreaturePosition(target).z}, [8] = {x=getCreaturePosition(target).x, y=getCreaturePosition(target).y-1, z=getCreaturePosition(target).z} } for i=1, #positions do if isWalkable(positions[i]) then end end end local function No_Move_Target() if isCreature(target) then doCreatureSetNoMove(target, 0) end return TRUE end if isPlayer(cid) and exhaustion.check(cid, storage) == TRUE then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde " .. exhaustion.get(cid, storage) .. " segundos para usar novamente.") return false end exhaustion.set(cid, storage, exausted) doCreatureSetNoMove(target, 1) doAddCondition(target, condition) local posefe = getCreaturePosition(target) posefe.x = posefe.x+3 doSendMagicEffect(posefe, effect) addEvent(No_Move_Target, tempo*1000) local t = 0 while t <= tempo*1000 do addEvent(Efect, t) t = t+300 end return true end
-
Danves deu reputação a Killua em Armazenar Tabelas em Storages (setGlobalTableStorage)Introdução:
Esses dias eu estava fazendo um sistema e senti a necessidade de armazenar várias informações (por player) em um só lugar. Porém, todos nós sabemos que não é possível colocar uma tabela como valor de um storage. Por conta disso, decidi tornar possível esse armazenamento.
Tenho certeza de que essa biblioteca será uma ferramenta extremamente útil para todos os scripters. Ela abre muitas portas e vai permitir a criação de muitos sistemas interessantes.
Instalação:
Simplesmente crie o arquivo tableStorage.lua em data/lib e coloque esse código:
Utilização:
Para armazenar uma tabela em um storage de um player, use:
setPlayerTableStorage(cid, key, tabela) Exemplo:
setPlayerTableStorage(cid, 199991, {["primeiro"] = 4, [8] = "Killua", [3] = 22}) Para armazenar uma tabela em um storage global, use:
setGlobalTableStorage(key, tabela) Exemplo:
setGlobalStorageValue(123412, {1, 55, "c", 3}) Para retornar as tabelas, use:
getGlobalTableStorage(key) ou
getPlayerTableStorage(cid, key) Esclarecimento:
As tabelas retornadas pelas funções getGlobalTableStorage e getPlayerTableStorage são tabelas normais e podem ser manipuladas como qualquer outra, por exemplo:
for t, k in pairs(getPlayerTableStorage(cid, 123444)) do print("["..t.."] "..v) end Observações:
As tabelas não armazenam valores booleanos, outras tabelas e nem funções, apenas strings e números. No entanto é claro que ela pode armazenar valores recebidos de funções, por exemplo:
setPlayerTableStorage(cid, 17271, {["level"] = getPlayerLevel(cid), ["sex"] = getPlayerSex(cid) == 1 and "female" or "male"}) Funcionará perfeitamente.
Mas:
setPlayerTableStorage(cid, 17271, {returnDouble = function(value) return value*2 end, try = 11, [2] = 10}) Não irá funcionar.
As tabelas podem ser preenchidas com ou sem index definido, de forma que os não definidos serão definidos automaticamente numa sequencia (Como qualquer tabela). Sendo assim:
setPlayerTableStorage(cid, 12344, {1,3,23,1999,"test"})setPlayerTableStorage(cid, 12344, {[5] = "hi", ["mia"] = 32, c = 18})setPlayerTableStorage(cid, 12344, {1, "c", 6, ["test"] = 18, b = "c", "hello world"}) São todas válidas.
Cuidado com com tabelas muito grandes! Elas podem acabar pesando bastante e consumindo bastante de sua database. Eu aconselho não ultrapassar 4 elementos. É claro que apenas um storage com uma tabela bem grande não vai causar problema mas, em um servidor com muitos jogadores, pode ser perigoso adicionar muitas tabelas grandes (1 por jogador).
Considerações:
Eu realmente acho que essa biblioteca vai abrir várias possibilidades para todos vocês, scripters. E espero que criem muitos sistemas legais a partir dela. Se tiverem dúvidas ou sugestões, podem dizer.
Abraços.
-
Danves deu reputação a xWhiteWolf em New Library v. 1.2Fala galera, hoje vim trazer pra vocês uma nova biblioteca de funções que eu venho desenvolvendo, pretendo ir atualizando esse tópico constantemente sempre adicionando funções novas e explicando a utilização delas. Algumas funções que eu coloquei aqui estão presentes na OTAL também, porém algumas eu fiz pequenas correções de forma que essa lib poderia facilmente substituir a OTAL sem grandes problemas (pelo menos se você utilizava apenas as funções básicas da otal)
Todas as funções que não tem -- nome do autor do lado dela foram feitas por mim, xWhiteWolf ou Night Wolf (NW). O restante delas são créditos dos devidos autores, apenas coloquei pois considero funções vitais no server de cada um. Crie um arquivo em data/lib chamado 075 - White Wolf Functions.lua e coloque o seguinte código dentro:
Agora eu vou explicar oque cada função faz porque de nada adianta lançar uma lib e não explicar oque ela faz não é mesmo? hahaha
Obs inicial: quando uma função tiver em seus parametros um [] significa que oque está dentro do colchetes não é um parâmetro obrigatório.
Como usar: doShowTimeByPos(cid, getCreaturePosition(cid), 20, 20)
Irá fazer uma contagem regressiva na posição que o player se encontra começando de 20 e mandando a mensagem na mesma cor da fala dos monstros.
Essa função é bem útil em actions/spells para fazer contagem de tempo em runas como a magic wall e ver quanto tempo falta pra magic wall sumir)
Obs: Espero que ajude bastante pessoas a entender sobre funções, eu utilizei cid como o principal uid das funções nos exemplos mas você pode muito bem utilizar outros uids, fica a critério seu.
Qualquer dúvida comentem abaixo que eu vou tentar ajudar da melhor maneira.
Ahhh, isso daí foi testado em 8.54 mas deve funcionar em quase todas as versões que tenham as funções básicas do TFS.
EDIT: Pessoal, agora é sério, essa lib tem fácil umas 600 linhas, das quais umas 500 eu devo ter codado sozinho (na mão, linha por linha). Eu tive todo o trabalho de testar cada uma delas e oque eu peço é o mínimo de gratidão e respeito. Se eu te ajudei clique em Gostei, se você tiver alguma dúvida eu to me colocando a disposição de responder qualquer coisa relacionada ao tópico, mesmo que você não saiba nem oque é uma lib apenas venha aqui e escreva sua dúvida.
EDIT 2: Duas novas funções adicionas, espero que gostem!
EDIT 3: Três novas funções adicionadas juntamente com suas respectivas explicações.
-
Danves deu reputação a buddha em Causar dano a uma PosVocê pode definir uma variável local no começo:
local pos = getCreaturePosition(cid)
local min = -((level*0.2) + (maglevel*2.653) + 16) local max = -((level*0.2) + (maglevel*4.503) + 28) addEvent(function()
doAreaCombatHealth(cid, COMBAT_PHYSICALDAMAGE, pos, area, min, max, CONST_ME_FIREAREA)
end, 1000)
addEvent(function()
doAreaCombatHealth(cid, COMBAT_PHYSICALDAMAGE, pos, area, min, max, CONST_ME_FIREAREA)
end, 2000)
addEvent(function()
doAreaCombatHealth(cid, COMBAT_PHYSICALDAMAGE, pos, area, min, max, CONST_ME_FIREAREA)
end, tempo em milisegundos)
Assim você executaria a magia e se você saísse do lugar ela continuaria executando naquele lugar. Mas lembrando que só serve quando você estiver com battle.
-
Danves recebeu reputação de ztalkerr em (Resolvido)Mensagem Quando O Char LogaVá em data/talkaction/scripts copie qualquer arquivo que seja .lua, mude o nome para talkClan e cole isso dentro
agora no talkaction.xml adicione essa tag: <talkaction words="#getSto#" event="script" value="talkClan.lua"/> -
Danves recebeu reputação de Nildson em [DUVIDA] Personagem perder todo seu level e itens após morte !Na verdade você disse pra ele colocar
<event type="death" name="reset_all" event="script" value="reset"/>
<event type="login" name="reset_all_" event="script" value="reset"/>
O que deveria ser
<event type="death" name="reset_all" event="script" value="reset.lua"/>
<event type="login" name="reset_all_" event="script" value="reset.lua"/>