Ir para conteúdo

luanluciano93

Héroi
  • Registro em

  • Última visita

Tudo que luanluciano93 postou

  1. local config = { positionStone = Position(947, 1102, 9), stoneId = 1355, } function onUse(player, item, fromPosition, target, toPosition, isHotkey) if player:getGuildLevel() ~= 3 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "[Castle] Somente o Leader! ") return true end local position = config.positionStone if not position then return true end local tile = position:getTile() if tile then local stone = tile:getItemById(config.stoneId) if stone then stone:remove() else Game.createItem(config.stoneId, 1, position) end end item:transform(item.itemid == 1945 and 1946 or 1945) return true end
  2. Se você usar gesior, existe uma função que verifica se é premium ... Website::getVocationName($player->getVocation()) https://github.com/gesior/Gesior2012/blob/master/pages/characters.php#L39
  3. @LeoTK a titulo de conhecimento ... • o evento onLogin não precisa ser registrado. • TRUE em maiúscula é gambiarra do TFS. não use-o • Se o personagem for premium você não precisa da variável "pos", portanto pode declarar ela depois da segunda verificação ... function onLogin(cid) if isPremium(cid) then setPlayerStorageValue(cid, 6787656, 1) elseif getPlayerStorageValue(cid, 6787656) == 1 and not isPremium(cid) then doPlayerSetTown(cid, 1) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doSendMagicEffect(getPlayerPosition(cid), 240) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua Premium expirou!\nNao deixe de visitar nosso SHOP.") setPlayerStorageValue(cid, 6787656, 0) end return true end
  4. Em data/events/scripts/player.lua na função: Player:onGainExperience -- Extra xp to use client 11 if self:getClient().version == 1100 then exp = exp * 0.05 end
  5. -- <event type="target" name="onTarget" script="onTarget.lua"/> local level = 450 function onTarget(cid, target) if not isPlayer(cid) or not isPlayer(target) then return true end if getPlayerLevel(cid) >= level and getPlayerLevel(target) < level then return false elseif getPlayerLevel(target) >= level and getPlayerLevel(cid) < level then return false end return true end NAO TESTADO
  6. Em data/events/scripts/creature.lua na função Creature:onTargetCombat(target): if self:isPlayer() and target:isPlayer() then local level = self:getLevel() / 2 if target:getLevel() < level and not table.contains({SKULL_RED, SKULL_BLACK, SKULL_YELLOW, SKULL_GREEN, SKULL_WHITE}, target:getSkull()) then return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER end end Não testado
  7. tfs OU otx? VERSÃO?
  8. date_default_timezone_set("America/Sao_Paulo");
  9. versão da engine? TFS ou OTX?
  10. Qual o script que vocÊ tem?
  11. local config = { redTeam = 1, blueTeam = 2, gametime = 2000, redTeamStorage = 2001, blueTeamStorage = 2002, outfitRed = {lookType = 128, lookHead = 94, lookAddons = 2, lookLegs = 94, lookBody = 94, lookFeet = 94}, outfitBlue = {lookType = 128, lookHead = 88, lookAddons = 2, lookLegs = 88, lookBody = 88, lookFeet = 88}, war = { fromPos = {x=638, y=711, z=7, stackpos=253}, toPos = {x=751, y=780, z=7, stackpos=253}, rewardRoom = {x=636,y=662,z=7,stackpos=1}, removePlayer = {x=518, y=840, z=7, stackpos=253} } } local function TpWinners(cid) for _, pid in ipairs(getPlayersOnline()) do if isInArea(getPlayerPosition(pid), config.war.fromPos, config.war.toPos) then doTeleportThing(pid, config.war.rewardRoom, false) end end end local function winKill(cid, team) addEvent(TpWinners, 5000, cid) setGlobalStorageValue(config.redTeamStorage, 0) setGlobalStorageValue(config.blueTeamStorage, 0) doTeleportThing(cid, config.war.removePlayer) if team == 1 then doBroadcastMessage("Red Team has won the event!") elseif team == 2 then doBroadcastMessage("Blue Team has won the event!") end end local function arenaDeath(cid, team) doTeleportThing(cid, config.war.removePlayer) doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have died, you are eliminated from the event') setPlayerStorageValue(cid, 1001, 0) setPlayerStorageValue(cid, 1002, 1) doRemoveCondition(cid,CONDITION_INFIGHT) doRemoveCondition(cid, CONDITION_OUTFIT) if team == 1 then setGlobalStorageValue(config.redTeamStorage, getGlobalStorageValue(2001) - 1) elseif team == 2 then setGlobalStorageValue(config.blueTeamStorage, getGlobalStorageValue(2002) - 1) end if getGlobalStorageValue(2001) == 1 then -- redStorage winKill(cid, 2) elseif getGlobalStorageValue(2002) == 1 then -- blueStorage winKill(cid, 1) end end function onPrepareDeath(cid, lastHitKiller, mostDamageKiller) if isPlayer(cid) == true and getPlayerStorageValue(cid, 1001) > 0 then arenaDeath(cid, team) return false end return true end
  12. @Thornes local storage = 9999 function onUse(player, item, fromPosition, target, toPosition, isHotkey) local resultId = db.storeQuery("SELECT `player_id` FROM `player_storage` WHERE `key` = " .. storage .. " AND `value` = 1;") if resultId ~= false then local message = "Em memória de:\n\n" repeat local resultId2 = db.storeQuery("SELECT `name` FROM `players` WHERE `id` = " .. result.getDataInt(resultId, "player_id") .. ";") if resultId2 ~= false then local playerName = result.getString(resultId2, "name") message = ""..message.."".. playerName ..".\n" result.free(resultId2) end until not result.next(resultId) result.free(resultId) player:popupFYI(message) else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Não existe nenhum nome gravado.") end return true end
  13. -- Town Portal Scroll System based in Dota 2 local config = { portalId = 11796, -- change to portal item id portalTime = 30, -- portal duration in seconds scrollId = 14324, -- change to scroll item id effect = CONST_ME_POFF -- effect id or CONST that appears at the end of time } local function checkPortal(uid, pos) local position = Position(pos) if position then local tile = Tile(position) if tile then local item = tile:getItemById(config.portalId) if item then item:remove() item:getPosition():sendMagicEffect(config.effect) else local playerId = Player(uid) if playerId then local portal = Game.createItem(config.portalId, 1, position) if portal then if playerId:getParty() then portal:setAttribute(ITEM_ATTRIBUTE_TEXT, playerId:getParty()) end portal:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, playerId:getName()) end addEvent(checkPortal, config.portalTime * 1000, uid, pos) end end end end end function onUse(player, item, fromPosition, target, toPosition, isHotkey) if item:getId() == config.scrollId then checkPortal(player:getGuid(), player:getPosition()) else if not player:isPzLocked() and not player:getCondition(CONDITION_INFIGHT, CONDITIONID_DEFAULT) then local itemParty = item:getAttribute(ITEM_ATTRIBUTE_TEXT) local itemDescription = item:getAttribute(ITEM_ATTRIBUTE_DESCRIPTION) if itemParty then local party = player:getParty() if party then if party == itemParty then player:teleportTo(player:getTown():getTemplePosition(), true) return true else player:popupFYI("You do not participate in the portal creator's party.") end end elseif itemDescription then if player:getName() == itemDescription then player:teleportTo(player:getTown():getTemplePosition(), true) else player:popupFYI("You isn't the owner.") return true end end else player:popupFYI("You are PZ locked or in battle.") end end return true end
  14. @Vinni012 substitui o arquivo star.lua
  15. war_death local config = { redTeam = 1, blueTeam = 2, gametime = 2000, redTeamStorage = 2001, blueTeamStorage = 2002, outfitRed = {lookType = 128, lookHead = 94, lookAddons = 2, lookLegs = 94, lookBody = 94, lookFeet = 94}, outfitBlue = {lookType = 128, lookHead = 88, lookAddons = 2, lookLegs = 88, lookBody = 88, lookFeet = 88}, war = { fromPos = {x=638, y=711, z=7, stackpos=253}, toPos = {x=751, y=780, z=7, stackpos=253}, rewardRoom = {x=636,y=662,z=7,stackpos=1}, removePlayer = {x=518, y=840, z=7, stackpos=253} } } local function TpWinners(cid) for _, pid in ipairs(getPlayersOnline()) do if isInArea(getPlayerPosition(pid), config.war.fromPos, config.war.toPos) then doTeleportThing(pid, config.war.rewardRoom, false) end end end local function winKill(cid, team) addEvent(TpWinners, 5000, cid) setGlobalStorageValue(config.redTeamStorage, 0) setGlobalStorageValue(config.blueTeamStorage, 0) doTeleportThing(cid, config.war.removePlayer) if team == 1 then doBroadcastMessage("Red Team has won the event!") elseif team == 2 doBroadcastMessage("Blue Team has won the event!") end end local function arenaDeath(cid, team) doTeleportThing(cid, config.war.removePlayer) doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have died, you are eliminated from the event') setPlayerStorageValue(cid, 1001, 0) setPlayerStorageValue(cid, 1002, 1) doRemoveCondition(cid,CONDITION_INFIGHT) doRemoveCondition(cid, CONDITION_OUTFIT) if team == 1 then setGlobalStorageValue(config.redTeamStorage, getGlobalStorageValue(2001) - 1) elseif team == 2 then setGlobalStorageValue(config.blueTeamStorage, getGlobalStorageValue(2002) - 1) end if getGlobalStorageValue(2001) == 1 then -- redStorage winKill(cid, 2) elseif getGlobalStorageValue(2002) == 1 then -- blueStorage winKill(cid, 1) end end function onPrepareDeath(cid, lastHitKiller, mostDamageKiller) if isPlayer(cid) == true and getPlayerStorageValue(cid, 1001) > 0 then arenaDeath(cid, team) return false end return true end ctf_death local config = { redTeam = 3, blueTeam = 4, redSide = {x=676, y=499, z=7, stackpos=253}, blueSide = {x=744, y=520, z=7, stackpos=253}, flagDropRed = 'Red Team has dropped the flag.', flagDropBlue = 'Blue Team has dropped the flag.' } function onPrepareDeath(cid, deathList) if not isPlayer(cid) and getPlayerStorageValue(cid, 1001) < 1 then return true end local flagPosRed = {x=676,y=503,z=7,stackpos=0} local flagPosBlue = {x=744,y=523,z=7,stackpos=0} local hasFlag = getPlayerStorageValue(cid, 2015) local killer = 1 local assister = 2 local kills = 65530 local deaths = 65529 local getDeaths = getPlayerStorageValue(cid,deaths) local getKills = getPlayerStorageValue(deathList[killer],kills) if getPlayerStorageValue(cid, 1001) == config.redTeam or getPlayerStorageValue(cid, 1001) == config.blueTeam then if getPlayerStorageValue(cid, 1001) == config.redTeam then setPlayerStorageValue(cid, 1003, 1) doTeleportThing(cid, config.redSide) elseif getPlayerStorageValue(cid, 1001) == config.blueTeam then setPlayerStorageValue(cid, 1004, 1) doTeleportThing(cid, config.blueSide) end doRemoveCondition(cid,CONDITION_INFIGHT) if getPlayerStorageValue(deathList[killer],kills) < 1 then setPlayerStorageValue(deathList[killer], kills, 1) else setPlayerStorageValue(deathList[killer], kills, getKills + 1) end if getPlayerStorageValue(cid,deaths) < 1 then setPlayerStorageValue(cid,deaths, 1) else setPlayerStorageValue(cid,deaths, getDeaths + 1) end if hasFlag >= 1 then if getPlayerStorageValue(cid,1001) == config.redTeam then doSetItemActionId(getThingFromPos(flagPosBlue).uid, 100) doBroadcastMessage(config.flagDropRed) elseif getPlayerStorageValue(cid, 1001) == config.blueTeam then doSetItemActionId(getThingFromPos(flagPosRed).uid, 100) doBroadcastMessage(config.flagDropBlue) end doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You dropped the flag!') setPlayerStorageValue(cid,2015, 0) if getPlayerStorageValue(deathList[killer],65532) < 1 then setPlayerStorageValue(deathList[killer], 65532, 1) else setPlayerStorageValue(deathList[killer], 65532, getPlayerStorageValue(deathList[killer],65532) + 1) end if isPlayer(deathList[assister]) == true then if getPlayerStorageValue(deathList[assister],65531) < 1 then setPlayerStorageValue(deathList[assister], 65531, 1) else setPlayerStorageValue(deathList[assister], 65531, getPlayerStorageValue(deathList[assister],65531) + 1) end end end return false end return true end
  16. @Lisbeky war_death local config = { redTeam = 1, blueTeam = 2, gametime = 2000, redTeamStorage = 2001, blueTeamStorage = 2002, outfitRed = {lookType = 128, lookHead = 94, lookAddons = 2, lookLegs = 94, lookBody = 94, lookFeet = 94}, outfitBlue = {lookType = 128, lookHead = 88, lookAddons = 2, lookLegs = 88, lookBody = 88, lookFeet = 88}, war = { fromPos = {x=638, y=711, z=7, stackpos=253}, toPos = {x=751, y=780, z=7, stackpos=253}, rewardRoom = {x=636,y=662,z=7,stackpos=1}, removePlayer = {x=518, y=840, z=7, stackpos=253} } } local function TpWinners(cid) for _, pid in ipairs(getPlayersOnline()) do if isInArea(getPlayerPosition(pid), config.war.fromPos, config.war.toPos) then doTeleportThing(pid, config.war.rewardRoom, false) end end end local function winKill(cid, team) addEvent(TpWinners, 5000, cid) setGlobalStorageValue(config.redTeamStorage, 0) setGlobalStorageValue(config.blueTeamStorage, 0) doTeleportThing(cid, config.war.removePlayer) if team = 1 then doBroadcastMessage("Red Team has won the event!") elseif team == 2 doBroadcastMessage("Blue Team has won the event!") end end local function arenaDeath(cid, team) doTeleportThing(cid, config.war.removePlayer) doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have died, you are eliminated from the event') setPlayerStorageValue(cid, 1001, 0) setPlayerStorageValue(cid, 1002, 1) doRemoveCondition(cid,CONDITION_INFIGHT) doRemoveCondition(cid, CONDITION_OUTFIT) if team == 1 then setGlobalStorageValue(config.redTeamStorage, getGlobalStorageValue(2001) - 1) elseif team == 2 then setGlobalStorageValue(config.blueTeamStorage, getGlobalStorageValue(2002) - 1) end if getGlobalStorageValue(2001) == 1 then -- redStorage winKill(cid, 2) elseif getGlobalStorageValue(2002) == 1 then -- blueStorage winKill(cid, 1) end end function onPrepareDeath(cid, lastHitKiller, mostDamageKiller) if isPlayer(cid) == true and getPlayerStorageValue(cid, 1001) > 0 then arenaDeath(cid, team) return false end return true end
  17. Com isso talvez !? doRemoveCondition(cid, CONDITION_INFIGHT)
  18. Isso não é bem vindo aqui. @Lisbeky poste o seu creaturescript.xml e seu login.lua do creaturescript
  19. Poste os dois scripts aqui ...
  20. @Vinni012 local config = { monsterName = "star", countKillMonster = 3, storageKillMonster = 6665, storagePoints = 7775 } function onDeath(cid, corpse, deathList) local killer = deathList[1] local pos = getCreaturePosition(killer) if not isMonster(cid) or not isPlayer(killer) then return true end if getPlayerStorageValue(killer, config.storageKillMonster) == -1 then setPlayerStorageValue(killer, config.storageKillMonster, 0) end setPlayerStorageValue(killer, config.storageKillMonster, getPlayerStorageValue(killer, config.storageKillMonster) + 1) if getPlayerStorageValue(killer, config.storageKillMonster) == config.countKillMonster then doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE) if getPlayerStorageValue(killer, config.storagePoints) == -1 then setPlayerStorageValue(killer, config.storagePoints, 0) end setPlayerStorageValue(killer, storagePoints, getPlayerStorageValue(killer, config.storagePoints) + 1) setPlayerStorageValue(killer, config.storageKillMonster, 0) doPlayerSendTextMessage(killer, MESSAGE_STATUS_CONSOLE_RED, "You receive 1 vip point by kill ".. config.countKillMonster .."x the monster ".. config.monsterName ..".") else doPlayerSendTextMessage(killer, MESSAGE_STATUS_CONSOLE_BLUE, "You killed ".. getPlayerStorageValue(killer, config.storageKillMonster) .." of ".. config.countKillMonster .." ".. config.monsterName ..", There are still ".. config.countKillMonster - (getPlayerStorageValue(killer, config.storageKillMonster)) .." ".. config.monsterName .." left to receive the reward.") end return true end Mas eu recomendaria fazer por onKill ao invés de onDeath
  21. Amigo já está anotado para futuras atualizações (não vai demorar muito) ... Você pode dar ideias de como ele pode ser, o que poderia ter de diferente dos outros ... Isso que quero, ideias, ideias, ideias ....
  22. -- Town Portal Scroll System based in Dota 2 local config = { portalId = 11796, -- change to portal item id portalTime = 30, -- portal duration in seconds scrollId = 14324, -- change to scroll item id effect = CONST_ME_POFF -- effect id or CONST that appears at the end of time } local function checkPortal(uid, pos) local position = Position(pos) if position then local tile = Tile(position) if tile then local item = tile:getItemById(config.portalId) if item then item:remove() item:getPosition():sendMagicEffect(config.effect) else local playerId = Player(uid) if playerId then local portal = Game.createItem(config.portalId, 1, position) if portal then if playerId:getParty() then portal:setCustomAttribute("party", playerId:getParty()) else portal:setCustomAttribute("owner", playerId:getName()) end end addEvent(checkPortal, config.portalTime * 1000, uid, pos) end end end end end function onUse(player, item, fromPosition, target, toPosition, isHotkey) if item:getId() == config.scrollId then checkPortal(player:getGuid(), player:getPosition()) else if not player:isPzLocked() and not player:getCondition(CONDITION_INFIGHT, CONDITIONID_DEFAULT) then local itemParty = item:getCustomAttribute("party") local itemName = item:getCustomAttribute("name") if itemParty then if player:getParty() == itemParty then player:teleportTo(player:getTown():getTemplePosition(), true) else player:popupFYI("You do not participate in the portal creator's party.") end elseif itemName then if player:getName() == itemName then player:teleportTo(player:getTown():getTemplePosition(), true) else player:popupFYI("You isn't the owner.") end else player:popupFYI("You isn't the owner.") end else player:popupFYI("You are PZ locked or in battle.") end end return true end
  23. local storage = 9999 function onUse(cid, item, frompos, item2, topos) local result = db.getResult("SELECT `player_id` FROM `player_storage` WHERE `key` = " .. storage .. " AND `value` = 1;") if(result:getID() ~= -1) then local message = "Em memória de:\n\n" repeat local playerId = result:getDataInt("player_id") local database = db.getResult("SELECT `name` FROM `players` WHERE `id` = " .. db.escapeString(playerId) .. ";") if(database:getID() ~= -1) then local playerName = database:getDataString("name") message = ""..message.."".. playerName ..".\n" database:free() end until not(result:next()) result:free() doPlayerPopupFYI(cid, message) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Não existe nenhum nome gravado.") end return true end
  24. function onKill(cid, target) if isPlayer(cid) and isPlayer(target) then if getPlayerIp(cid) ~= getPlayerIp(target) then if getPlayerLevel(target) >= 80 then local heart = doPlayerAddItem(cid, 5943, 1) if heart then doItemSetAttribute(heart, "name", "" .. getPlayerName(target) .. " Heart's") doItemSetAttribute(heart, "description", "Killed at Level ".. getPlayerLevel(target) .." by ".. getPlayerName(cid) ..". " .. (getCreatureSkullType(cid) <= SKULL_GREEN and "(Unjustified)" or "(Justified)")) end end elseif getPlayerIp(cid) == getPlayerIp(target) then doPlayerAddExp(cid, -10000) end end return true end

Informação Importante

Confirmação de Termo