Postado Agosto 2, 2014 10 anos boa tarde... Uso TFS1.0 (eu sei q é porisso q esta dando problema....) + eu queria resolver... o meu script: -- &a = weapon attack -- &d = weapon defense -- &s = shield defense -- &p = armor defense -- # = nivel do item -- @ = max level local gain = { gainArmor='&p+(1)',loseArmor='&p-(1)', gainShield='&s+(1)',loseShield='&s-(1)', gainAttack='&a+(2)',loseAttack='&a-(2)', gainDefense='&d+(1)',loseDefense='&d-(1)', chance='(100/math.sqrt((((@/2)+(#*2))/@)*#))', maxlvl = 10, blocked_ids = {2379} } local it = { --[itemid] = [percent] [8301] = 0, -- 0% additional [8302] = 100, -- 50% } if not setItemName then function setItemName(uid,name) return doItemSetAttribute(uid,'name',name) end function setItemArmor(uid,name) return doItemSetAttribute(uid,'armor',name) end function setItemDefense(uid,name) return doItemSetAttribute(uid,'defense',name) end function setItemAttack(uid,name) return doItemSetAttribute(uid,'attack',name) end function getItemAttack(uid) return getItemAttribute(uid,'attack') end function getItemDefense(uid) return getItemAttribute(uid,'defense') end function getItemArmor(uid) if type(uid) == 'number' then return getItemAttribute(uid,'armor') else return getItemInfo(uid.itemid).armor end end end local function isArmor(uid) if (getItemInfo(uid.itemid).armor ~= 0) and (getItemWeaponType(uid.uid) == 0) then return true end return false end local function isWeapon(uid) uid = uid or 0 local f = getItemWeaponType(uid) if f == 1 or f == 2 or f == 3 then return true end return false end local function isShield(uid) uid = uid or 0 if getItemWeaponType(uid) == 5 then return true end return false end local function isBow(uid) uid = uid or 0 if getItemWeaponType(uid) == 4 then return true end return false end local function getWeaponLevel(uid) uid = uid or 0 local name = getItemName(uid.uid) or getItemInfo(uid.itemid).name or '' local lvl = string.match(name,'%s%+(%d+)%s*') return tonumber(lvl) or 0 end local function doTransform(s,i) -- Function by Mock the bear. local c = string.gsub(s,'@',gain.maxlvl) local c = string.gsub(c,'&a',(getItemAttack(i.uid) ~= 0 and getItemAttack(i.uid) or getItemInfo(i.itemid).attack)) local c = string.gsub(c,'&d',(getItemDefense(i.uid) ~= 0 and getItemDefense(i.uid) or getItemInfo(i.itemid).defense)) local c = string.gsub(c,'&s',(getItemDefense(i.uid) ~= 0 and getItemDefense(i.uid) or getItemInfo(i.itemid).defense)) local c = string.gsub(c,'&p',(getItemArmor(i.uid) ~= 0 and getItemArmor(i.uid) or getItemInfo(i.itemid).armor)) local c = string.gsub(c,'#',getWeaponLevel(i)) local q = assert(loadstring('return '..c)) return math.floor(assert(q())) end function onUse(cid, item, fromPosition, itemEx, toPosition) if item.uid == 0 or item.itemid == 0 then return false end toPosition.stackpos = 255 if isInArray(gain.blocked_ids, itemEx.itemid) or (not getItemWeaponType(itemEx.uid) or getItemWeaponType(itemEx.uid) > 5) or (getItemWeaponType(itemEx.uid) == 0 and not isArmor(itemEx)) or itemEx.itemid == 0 or itemEx.type > 1 or isItemStackable(itemEx.uid) then doPlayerSendCancel(cid, "You cant refine this item.") return TRUE end if isCreature(itemEx.uid) == TRUE then return FALSE end local level = getWeaponLevel(itemEx) local chance = doTransform(gain.chance,itemEx) if level == gain.maxlvl then doSendMagicEffect(toPosition, 2) return doPlayerSendCancel(cid, "Your item is on max level, you can't upgrade it.") end doPlayerSendCancel(cid,"Trying refine with "..(chance+it[item.itemid] > 100 and 100 or chance+it[item.itemid]).."% of sucess!") if chance+it[item.itemid] >= math.random(0,100) then local nm = getItemName(itemEx.uid) local slot = nm:match('(%[.+%])') or '' ---If you server use slot system dont change it slot = slot~='' and ' '..slot or slot setItemName(itemEx.uid, getItemNameById(itemEx.itemid)..' +'..(level+1)..slot) addEvent(doPlayerSendCancel,2000,cid, "Your item has been upgrated to +"..(level+1)..slot..".") doSendMagicEffect(toPosition, 28) if isArmor(itemEx) then local get = doTransform(gain.gainArmor,itemEx) setItemArmor(itemEx.uid,get) elseif isBow(itemEx.uid) then setItemAttack(itemEx.uid, doTransform(gain.gainAttack,itemEx)) elseif isWeapon(itemEx.uid) then setItemAttack(itemEx.uid, doTransform(gain.gainAttack,itemEx)) setItemDefense(itemEx.uid, doTransform(gain.gainDefense,itemEx)) elseif isShield(itemEx.uid) then setItemDefense(itemEx.uid, doTransform(gain.gainShield,itemEx)) end else if level == 0 then addEvent(doPlayerSendCancel,500,cid, "No effect.") doSendMagicEffect(toPosition, 2) elseif level > 0 then local nm = getItemName(itemEx.uid) local slot = nm:match('(%[.+%])') or '' ---If you server use slot system dont change it slot = slot~='' and ' '..slot or slot if level == 1 then setItemName(itemEx.uid, getItemNameById(itemEx.itemid)..slot) addEvent(doPlayerSendCancel,2000,cid, "Your item back to normal.") else setItemName(itemEx.uid, getItemNameById(itemEx.itemid)..' +'..(level-1)..slot) addEvent(doPlayerSendCancel,2000,cid, "Your item back to +"..(level-1)..slot..".") end if isArmor(itemEx) then setItemArmor(itemEx.uid,doTransform(gain.loseArmor ,itemEx)) elseif isWeapon(itemEx.uid) then setItemAttack(itemEx.uid, doTransform(gain.loseAttack,itemEx)) setItemDefense(itemEx.uid, doTransform(gain.loseDefense,itemEx)) elseif isBow(itemEx.uid) then setItemAttack(itemEx.uid, doTransform(gain.loseAttack,itemEx)) elseif isShield(itemEx.uid) then setItemDefense(itemEx.uid, doTransform(gain.loseShield,itemEx)) end end doSendMagicEffect(toPosition, 9) end doRemoveItem(item.uid,1) return true end e o erro q aparece... http://prntscr.com/48w6wr (eu uso o light shot + rapido pra tirar e upar a print) se alguem poder me ajudar ficarei grato e darei Rep++ VLW..
Postado Agosto 2, 2014 10 anos seu server não tem a função getItemWeaponType.. verifica o novo nome da função pra TFS 1.0 em alguma lista de funções ou para de usar o script Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá! "Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda (obg ao @Beeny por fazer essa linda sign <3)
Postado Agosto 2, 2014 10 anos Autor seu server não tem a função getItemWeaponType.. verifica o novo nome da função pra TFS 1.0 em alguma lista de funções ou para de usar o script vlw... eu n manjo muito de script.... eu achei essa lista pode me ajudar ??? (reputado da 1ª ajuda) //do* doAddCondition(cid, condition) doAddContainerItem(uid, itemid, count/subtype) doAddContainerItemEx(uid, virtualId) doAddMapMark(cid, pos, type, description) doAreaCombatCondition(cid, pos, area, condition, effect) doAreaCombatDispel(cid, pos, area, type, effect) doAreaCombatHealth(cid, type, pos, area, min, max, effect) doAreaCombatMana(cid, pos, area, min, max, effect) doChallengeCreature(cid, target) doChangeSpeed(cid, delta) doChangeTypeItem(uid, newtype) doCombat(cid, combat, param) doConvinceCreature(cid, target) doCreateItem(itemid, type/count, pos) doCreateItemEx(itemid, count/subtype) doCreateNpc(name, pos) doCreateTeleport(itemid, topos, createpos) doCreatureAddHealth(cid, health) doCreatureChangeOutfit(cid, outfit) doCreatureSay(cid, text, type, ...) doCreatureSayWithRadius(cid, text, type, radiusx, radiusy, position) doCreatureSetLookDir(cid, direction) doDecayItem(uid) doForceSummonCreature(name, pos) doMonsterChangeTarget(cid) doMoveCreature(cid, direction) doPlayerAddBlessing(cid, blessing) doPlayerAddExp(cid, exp, useMult, ...) doPlayerAddItem(cid, itemid, count, canDropOnMap, subtype) doPlayerAddItem(uid, itemid, count/subtype) doPlayerAddItemEx(cid, uid, ...) doPlayerAddMana(cid, mana, ...) doPlayerAddManaSpent(cid, mana) doPlayerAddMoney(cid, money) doPlayerAddMount(cid, mountId) doPlayerAddOutfit(cid, lookType, addons) doPlayerAddPremiumDays(cid, days) doPlayerAddSkillTry(cid, skillid, n) doPlayerAddSoul(cid, soul) doPlayerFeed(cid, food) doPlayerJoinParty(cid, leaderId) doPlayerPopupFYI(cid, message) doPlayerRemOutfit(cid, lookType, addons) doPlayerRemoveItem(cid, itemid, count, subtype, ignoreEquipped) doPlayerRemoveMoney(cid, money) doPlayerRemoveMount(cid, mountId) doPlayerRemovePremiumDays(cid, days) doPlayerSendCancel(cid, text) doPlayerSendTextMessage(cid, type, text, ...) doPlayerSetBalance(cid, balance) doPlayerSetGuildLevel(cid, level) doPlayerSetGuildNick(cid, nick) doPlayerSetOfflineTrainingSkill(cid, skill) doPlayerSetSex(cid, sex) doPlayerSetTown(cid, town) doPlayerSetVocation(cid, vocation) doRelocate(pos, posTo) doRemoveCondition(cid, type[, subId]) doRemoveCreature(cid) doRemoveItem(uid, ...) doSendDistanceShoot(fromPos, toPos, distanceEffect, ...) doSendMagicEffect(pos, magicEffect, ...) doSendTutorial(cid, tutorialId) doSetCreatureDropLoot(cid, doDrop) doSetCreatureLight(cid, lightLevel, lightColor, time) doSetCreatureOutfit(cid, outfit, time) doSetItemActionId(uid, actionId) doSetItemOutfit(cid, item, time) doSetItemSpecialDescription(uid, desc) doSetItemText(uid, text) doSetMonsterOutfit(cid, name, time) doSetMonsterTarget(cid, target) doShowTextDialog(cid, itemId, text) doSummonCreature(name, pos) doTargetCombatCondition(cid, target, condition, effect) doTargetCombatDispel(cid, target, type, effect) doTargetCombatHealth(cid, target, type, min, max, effect) doTargetCombatMana(cid, target, min, max, effect) doTeleportThing(uid, dest, pushMovement) doTileAddItemEx(pos, uid) doTransformItem(uid, newItemId, ...) //get* getAccountNumberByPlayerName(name) getBlessingsCost(level) getConfigInfo(info) getContainerCap(uid) getContainerCapById(itemId) getContainerItem(uid, slot) getContainerSize(uid) getCreatureBaseSpeed(cid) getCreatureCondition(cid, condition[, subId]) getCreatureHealth(cid) getCreatureMaster(cid) getCreatureMaxHealth(cid) getCreatureName(cid) getCreatureOutfit(cid) getCreaturePosition(cid) getCreatureSpeed(cid) getCreatureSummons(cid) getCreatureTarget(cid) getDepotId(uid) getDistanceBetween(firstPosition, secondPosition) getFluidSourceType(itemId) getGlobalStorageValue(key) getGuildId(guildName) getHouseAccessList(id, listId) getHouseByPlayerGUID(playerGUID) getHouseEntry(houseId) getHouseName(houseId) getHouseOwner(houseId) getHouseRent(id) getHouseTilesSize(houseId) getHouseTown(houseId) getInstantSpellInfoByName(cid, name) getInstantSpellWords(name) getIPByPlayerName(name) getItemDescriptions(itemId) getItemIdByName(name) getItemName(itemId) getItemRWInfo(uid) getItemWeight(itemId, ...) getItemWeightByUID(uid, ...) getMonsterFriendList(cid) getMonsterTargetList(cid) getOnlinePlayers() getPartyMembers(cid) getPlayerAccess(cid) getPlayerAccountType(cid) getPlayerBalance(cid) getPlayerBlessing(cid, blessing) getPlayerByName(name) getPlayerDepotItems(cid, depotId) getPlayerFlagValue(cid, flag) getPlayerFood(cid) getPlayerFreeCap(cid) getPlayerGroupId(cid) getPlayerGUID(cid) getPlayerGUIDByName(name) getPlayerGuildId(cid) getPlayerGuildLevel(cid) getPlayerGuildName(cid) getPlayerGuildNick(cid) getPlayerGuildRank(cid) getPlayerInstantSpellCount(cid) getPlayerInstantSpellInfo(cid, index) getPlayerIp(cid) getPlayerItemById(cid, deepSearch, itemId, ...) getPlayerItemCount(cid, itemId, ...) getPlayerLastLoginSaved(cid) getPlayerLearnedInstantSpell(cid, name) getPlayerLevel(cid) getPlayerLight(cid) getPlayerLookDir(cid) getPlayerLossPercent(cid) getPlayerMagLevel(cid) getPlayerMana(cid) getPlayerMasterPos(cid) getPlayerMaxMana(cid) getPlayerMoney(cid) getPlayerMount(cid, mountId) getPlayerName(cid) getPlayerParty(cid) getPlayerPosition(cid) getPlayerPremiumDays(cid) getPlayersByAccountNumber(accountNumber) getPlayersByIPAddress(ip, mask) getPlayerSex(cid) getPlayerSkill(cid, skillId) getPlayerSkullType(cid) getPlayerSlotItem(cid, slot) getPlayerSoul(cid) getPlayerStorageValue(cid, key) getPlayerTown(cid) getPlayerVocation(cid) getPromotedVocation(vocationId) getPvpBlessingCost(level) getSpectators(centerPos, rangex, rangey, multifloor, onlyPlayers) getThing(uid) getThingfromPos(pos) getThingPos(uid) getTibianTime() getTileHouseInfo(pos) getTileInfo(position) getTileItemById(position, itemId, ...) getTileItemByType(position, itemType) getTilePzInfo(position) getTileThingByPos(position) getTileThingByTopOrder(position, topOrder) getTopCreature(position) getTownId(townName) getTownName(townId) getTownTemplePosition(townId) getWaypointPosition(name) getWorldCreatures(type) getWorldLight() getWorldTime() getWorldUpTime() //set* setCombatArea(combat, area) setCombatCallBack(combat, key, function_name) setCombatCondition(combat, condition) setCombatFormula(combat, type, mina, minb, maxa, maxb) setCombatParam(combat, key, value) setConditionFormula(combat, mina, minb, maxa, maxb) setConditionParam(condition, key, value) setGlobalStorageValue(key, value) setHouseAccessList(id, listId, listText) setHouseOwner(id, guid) setPlayerGroupId(cid, groupId) setPlayerStorageValue(cid, key, value) //is* isContainer(uid) isCorpse(uid) isCreature(cid) isDepot(uid) isDruid(cid) isInArray(array, value) isInRange(pos, fromPos, toPos) isInWar(cid, target) isItem(uid) isItemContainer(itemId) isItemDoor(itemId) isItemFluidContainer(itemId) isItemMovable(itemId) isItemRune(itemId) isItemStackable(itemId) isKnight(cid) isMonster(cid) isMovable(uid) isNpc(cid) isNumber(str) isPaladin(cid) isPlayer(cid) isPlayerGhost(cid) isPlayerPzLocked(cid) isPremium(cid) isSightClear(fromPos, toPos, floorCheck) isSorcerer(cid) isSummon(cid) isValidUID(uid) mayNotMove(cid, value) numberToVariant(number) positionToVariant(pos) variantToNumber(var) variantToPosition(var) variantToString(var) pushThing(thing) queryTileAddThing(thing, position, ...) saveServer() sendChannelMessage(channelId, type, message) sendGuildChannelMessage(guildId, type, message) stopEvent(eventid) string.split(str, sep) stringToVariant(string) targetPositionToVariant(pos) unregisterCreatureEvent(cid, name) hasProperty(uid, prop) addDamageCondition(condition, rounds, time, value) addEvent(callback, delay, ...) addOutfitCondition(condition, lookTypeEx, lookType, lookHead, lookBody, lookLegs, lookFeet) broadcastMessage(message, type) canPlayerLearnInstantSpell(cid, name) canPlayerWearOutfit(cid, lookType, addons) cleanMap() createCombatArea( {area}, {extArea} ) createCombatObject() createConditionObject(type) debugPrint(text) Player.feed(self, food) Player.isUsingOtClient(self) Player.sendCancelMessage(self, message) Player.sendExtendedOpcode(self, opcode, buffer) playerLearnInstantSpell(cid, name) Position.getNextPosition(self, direction, steps) Game.convertIpToString(ip) Game.getStorageValue(key) Game.setStorageValue(key, value) Creature.getClosestFreePosition(self, position, extended) registerClass(className, baseClass, newFunction) registerCreatureEvent(cid, name) registerEnum(value) registerEnumIn(tableName, value) registerGlobalMethod(functionName, function) registerGlobalVariable(name, value) registerMetaMethod(className, functionName, function) registerMethod(className, functionName, function) registerTable(tableName) registerVariable(tableName, name, value) Ou você conhece algum sistema de refinamento pra tfs 1.0 ?? ja ia me ajudar... xD vlw Editado Agosto 2, 2014 10 anos por maper007 (veja o histórico de edições)
Postado Agosto 2, 2014 10 anos não conheço pq nunca mexi com 1.0 e nenhuma dessas funções dá pra substituir a do getItemWeaponType :/ Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá! "Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda (obg ao @Beeny por fazer essa linda sign <3)
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.