-
Total de itens
66 -
Registro em
-
Última visita
Tudo que romera postou
-
nossa n sabia q tinha mais, quanto a segunda duvida, cra fiquei 3h tentando faze hj, so bem noob de script, mas so consigui isso: local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.4, -30, -0.9, 0) local arr = { {1, 1, 1}, {1, 2, 1}, {1, 1, 1} } local area = createCombatArea(arr) setCombatArea(combat, area) function onCastSpell(cid, getPlayerposition, var) if getPlayerPosition(cid, 4820, 4822) then doCombat(cid, combat, var) else doPlayerSendCancel(cid, "Voce nao esta em cima da agua.") return true end end da erro que não encontra creature: Creature Not found. <instant name="enexori" words="enexori" direction="0" lvl="10" mana="0" prem="0" exhaustion="1300" needlearn="0" script="energy exori.lua"> <vocation name="Sorcerer" /> <vocation name="Druid" /> <vocation name="Paladin" /> <vocation name="Knight" /> <vocation name="Master Sorcerer" /> <vocation name="Elder Druid" /> <vocation name="Royal Paladin" /> <vocation name="Elite Knight" /> </instant>
-
me manda o script
-
Nossa sinceras desculpas, so tente ajudar de algum jeito
-
blz, melhor add eu msn, te passo por la... mr-villar@hotmail.com
-
[Pedido] Npc Que Vende 4 Vocações Novas.
tópico respondeu ao teteusinhu de romera em Lixeira Pública
uahsuahs, denovo, esse mesmo erro facil: copia esse code e passa em cima do seu function, mas primeiro faz um backup do seu, depois passa oq que ta na pasta data/lib/function: --EDIT-- Cara envez de copiar olha no seu function primeiro se tem alguma parte igual a essa: return (isInArray({1,5}, getPlayerVocation(cid)) == TRUE) n exatamente igual mas que tenha os dois numeros...? se tiver é so adicionar a ID da proxima promotion tendeu? é so colocar 9,10,11,12 porque seu promotion e igual ao meu: vai ficar assim: return (isInArray({1,5,9}, getPlayerVocation(cid)) == TRUE) -
Simples cara: E depois colocar no script "Login", data/creaturescripts/scripts: Ponha embaixo da linha 'function onLogin(cid): O que esta em negrito é o que deves mudar, a posição de onde o player vai após atingir nível 50. Credits: Eskylo, tava lendo os topicos e achei, passei pra ca, vlws Eskylo!
-
No meu pasta, tem: first item; login; login backup; monster_counter; mail; playerdeath; guildmotd; antiMC; check; kill; login2; ->> sei la Só!!
-
ja te respondi em seu novo topico!! olha la e ve se pegaa
-
Como assim? Voce queria mudar o desenho do ataque, tipo ataque de fire, poison, death, se for, tem uma lista no data/lib/constant vo posta o meu: LUA_NO_ERROR = true NORTH = 0 EAST = 1 SOUTH = 2 WEST = 3 SOUTHWEST = 4 SOUTHEAST = 5 NORTHWEST = 6 NORTHEAST = 7 COMBAT_FORMULA_UNDEFINED = 0 COMBAT_FORMULA_LEVELMAGIC = 1 COMBAT_FORMULA_SKILL = 2 COMBAT_FORMULA_DAMAGE = 3 CONDITION_PARAM_OWNER = 1 CONDITION_PARAM_TICKS = 2 CONDITION_PARAM_OUTFIT = 3 CONDITION_PARAM_HEALTHGAIN = 4 CONDITION_PARAM_HEALTHTICKS = 5 CONDITION_PARAM_MANAGAIN = 6 CONDITION_PARAM_MANATICKS = 7 CONDITION_PARAM_DELAYED = 8 CONDITION_PARAM_SPEED = 9 CONDITION_PARAM_LIGHT_LEVEL = 10 CONDITION_PARAM_LIGHT_COLOR = 11 CONDITION_PARAM_SOULGAIN = 12 CONDITION_PARAM_SOULTICKS = 13 CONDITION_PARAM_MINVALUE = 14 CONDITION_PARAM_MAXVALUE = 15 CONDITION_PARAM_STARTVALUE = 16 CONDITION_PARAM_TICKINTERVAL = 17 CONDITION_PARAM_FORCEUPDATE = 18 CONDITION_PARAM_SKILL_MELEE = 19 CONDITION_PARAM_SKILL_FIST = 20 CONDITION_PARAM_SKILL_CLUB = 21 CONDITION_PARAM_SKILL_SWORD = 22 CONDITION_PARAM_SKILL_AXE = 23 CONDITION_PARAM_SKILL_DISTANCE = 24 CONDITION_PARAM_SKILL_SHIELD = 25 CONDITION_PARAM_SKILL_FISHING = 26 CONDITION_PARAM_STAT_MAXHEALTH = 27 CONDITION_PARAM_STAT_MAXMANA = 28 CONDITION_PARAM_STAT_SOUL = 29 CONDITION_PARAM_STAT_MAGICLEVEL = 30 CONDITION_PARAM_STAT_MAXHEALTHPERCENT = 31 CONDITION_PARAM_STAT_MAXMANAPERCENT = 32 CONDITION_PARAM_STAT_SOULPERCENT = 33 CONDITION_PARAM_STAT_MAGICLEVELPERCENT = 34 CONDITION_PARAM_SKILL_MELEEPERCENT = 35 CONDITION_PARAM_SKILL_FISTPERCENT = 36 CONDITION_PARAM_SKILL_CLUBPERCENT = 37 CONDITION_PARAM_SKILL_SWORDPERCENT = 38 CONDITION_PARAM_SKILL_AXEPERCENT = 39 CONDITION_PARAM_SKILL_DISTANCEPERCENT = 40 CONDITION_PARAM_SKILL_SHIELDPERCENT = 41 CONDITION_PARAM_SKILL_FISHINGPERCENT = 42 CONDITION_PARAM_PERIODICDAMAGE = 43 CONDITION_PARAM_BUFF = 44 CONDITION_PARAM_SUBID = 45 COMBAT_PARAM_TYPE = 1 COMBAT_PARAM_EFFECT = 2 COMBAT_PARAM_DISTANCEEFFECT = 3 COMBAT_PARAM_BLOCKSHIELD = 4 COMBAT_PARAM_BLOCKARMOR = 5 COMBAT_PARAM_TARGETCASTERORTOPMOST = 6 COMBAT_PARAM_CREATEITEM = 7 COMBAT_PARAM_AGGRESSIVE = 8 COMBAT_PARAM_DISPEL = 9 COMBAT_PARAM_USECHARGES = 10 COMBAT_PARAM_TARGETPLAYERSORSUMMONS = 11 CALLBACK_PARAM_LEVELMAGICVALUE = 1 CALLBACK_PARAM_SKILLVALUE = 2 CALLBACK_PARAM_TARGETTILE = 3 CALLBACK_PARAM_TARGETCREATURE = 4 COMBAT_NONE = 0 COMBAT_PHYSICALDAMAGE = 1 COMBAT_ENERGYDAMAGE = 2 COMBAT_EARTHDAMAGE = 4 COMBAT_POISONDAMAGE = 4 COMBAT_FIREDAMAGE = 8 COMBAT_UNDEFINEDDAMAGE = 16 COMBAT_LIFEDRAIN = 32 COMBAT_MANADRAIN = 64 COMBAT_HEALING = 128 COMBAT_DROWNDAMAGE = 256 COMBAT_ICEDAMAGE = 512 COMBAT_HOLYDAMAGE = 1024 COMBAT_DEATHDAMAGE = 2048 CONDITION_NONE = 0 CONDITION_POISON = 1 CONDITION_FIRE = 2 CONDITION_ENERGY = 4 CONDITION_PHYSICAL = 8 CONDITION_HASTE = 16 CONDITION_PARALYZE = 32 CONDITION_OUTFIT = 64 CONDITION_INVISIBLE = 128 CONDITION_LIGHT = 256 CONDITION_MANASHIELD = 512 CONDITION_INFIGHT = 1024 CONDITION_DRUNK = 2048 CONDITION_EXHAUST = 4096 CONDITION_FOOD = 8192 CONDITION_REGENERATION = 8192 CONDITION_SOUL = 16384 CONDITION_DROWN = 32768 CONDITION_MUTED = 65536 CONDITION_ATTRIBUTES = 131072 CONDITION_FREEZING = 262144 CONDITION_DAZZLED = 524288 CONDITION_CURSED = 1048576 CONDITION_PACIFIED = 2097152 CONDITION_GAMEMASTER = 4194304 EXHAUST_OTHER = 0 EXHAUST_COMBAT = 1 EXHAUST_HEALING = 2 EXHAUST_WEAPON = 3 MUTED_BUFFER = 0 MUTED_YELL = 1 MUTED_TRADE = 2 MUTED_TRADE_ROOK = 3 GAMEMASTER_INVISIBLE = 0 GAMEMASTER_IGNORE = 1 GAMEMASTER_TELEPORT = 2 CONST_SLOT_HEAD = 1 CONST_SLOT_NECKLACE = 2 CONST_SLOT_BACKPACK = 3 CONST_SLOT_ARMOR = 4 CONST_SLOT_RIGHT = 5 CONST_SLOT_LEFT = 6 CONST_SLOT_LEGS = 7 CONST_SLOT_FEET = 8 CONST_SLOT_RING = 9 CONST_SLOT_AMMO = 10 CONST_ME_DRAWBLOOD = 0 CONST_ME_LOSEENERGY = 1 CONST_ME_POFF = 2 CONST_ME_BLOCKHIT = 3 CONST_ME_EXPLOSIONAREA = 4 CONST_ME_EXPLOSIONHIT = 5 CONST_ME_FIREAREA = 6 CONST_ME_YELLOW_RINGS = 7 CONST_ME_GREEN_RINGS = 8 CONST_ME_HITAREA = 9 CONST_ME_TELEPORT = 10 CONST_ME_ENERGYHIT = 11 CONST_ME_MAGIC_BLUE = 12 CONST_ME_MAGIC_RED = 13 CONST_ME_MAGIC_GREEN = 14 CONST_ME_HITBYFIRE = 15 CONST_ME_HITBYPOISON = 16 CONST_ME_MORTAREA = 17 CONST_ME_SOUND_GREEN = 18 CONST_ME_SOUND_RED = 19 CONST_ME_POISONAREA = 20 CONST_ME_SOUND_YELLOW = 21 CONST_ME_SOUND_PURPLE = 22 CONST_ME_SOUND_BLUE = 23 CONST_ME_SOUND_WHITE = 24 CONST_ME_BUBBLES = 25 CONST_ME_CRAPS = 26 CONST_ME_GIFT_WRAPS = 27 CONST_ME_FIREWORK_YELLOW = 28 CONST_ME_FIREWORK_RED = 29 CONST_ME_FIREWORK_BLUE = 30 CONST_ME_STUN = 31 CONST_ME_SLEEP = 32 CONST_ME_WATERCREATURE = 33 CONST_ME_GROUNDSHAKER = 34 CONST_ME_HEARTS = 35 CONST_ME_FIREATTACK = 36 CONST_ME_ENERGYAREA = 37 CONST_ME_SMALLCLOUDS = 38 CONST_ME_HOLYDAMAGE = 39 CONST_ME_BIGCLOUDS = 40 CONST_ME_ICEAREA = 41 CONST_ME_ICETORNADO = 42 CONST_ME_ICEATTACK = 43 CONST_ME_STONES = 44 CONST_ME_SMALLPLANTS = 45 CONST_ME_CARNIPHILA = 46 CONST_ME_PURPLEENERGY = 47 CONST_ME_YELLOWENERGY = 48 CONST_ME_HOLYAREA = 49 CONST_ME_BIGPLANTS = 50 CONST_ME_CAKE = 51 CONST_ME_GIANTICE = 52 CONST_ME_WATERSPLASH = 53 CONST_ME_PLANTATTACK = 54 CONST_ME_TUTORIALARROW = 55 CONST_ME_TUTORIALSQUARE = 56 CONST_ME_MIRRORHORIZONTAL = 57 CONST_ME_MIRRORVERTICAL = 58 CONST_ME_SKULLHORIZONTAL = 59 CONST_ME_SKULLVERTICAL = 60 CONST_ME_ASSASSIN = 61 CONST_ME_STEPSHORIZONTAL = 62 CONST_ME_BLOODYSTEPS = 63 CONST_ME_STEPSVERTICAL = 64 CONST_ME_YALAHARIGHOST = 65 CONST_ME_BATS = 66 CONST_ME_NONE = 255 CONST_ME_LAST = CONST_ME_BATS CONST_ANI_SPEAR = 0 CONST_ANI_BOLT = 1 CONST_ANI_ARROW = 2 CONST_ANI_FIRE = 3 CONST_ANI_ENERGY = 4 CONST_ANI_POISONARROW = 5 CONST_ANI_BURSTARROW = 6 CONST_ANI_THROWINGSTAR = 7 CONST_ANI_THROWINGKNIFE = 8 CONST_ANI_SMALLSTONE = 9 CONST_ANI_DEATH = 10 CONST_ANI_LARGEROCK = 11 CONST_ANI_SNOWBALL = 12 CONST_ANI_POWERBOLT = 13 CONST_ANI_POISON = 14 CONST_ANI_INFERNALBOLT = 15 CONST_ANI_HUNTINGSPEAR = 16 CONST_ANI_ENCHANTEDSPEAR = 17 CONST_ANI_REDSTAR = 18 CONST_ANI_GREENSTAR = 19 CONST_ANI_ROYALSPEAR = 20 CONST_ANI_SNIPERARROW = 21 CONST_ANI_ONYXARROW = 22 CONST_ANI_PIERCINGBOLT = 23 CONST_ANI_WHIRLWINDSWORD = 24 CONST_ANI_WHIRLWINDAXE = 25 CONST_ANI_WHIRLWINDCLUB = 26 CONST_ANI_ETHEREALSPEAR = 27 CONST_ANI_ICE = 28 CONST_ANI_EARTH = 29 CONST_ANI_HOLY = 30 CONST_ANI_SUDDENDEATH = 31 CONST_ANI_FLASHARROW = 32 CONST_ANI_FLAMMINGARROW = 33 CONST_ANI_SHIVERARROW = 34 CONST_ANI_ENERGYBALL = 35 CONST_ANI_SMALLICE = 36 CONST_ANI_SMALLHOLY = 37 CONST_ANI_SMALLEARTH = 38 CONST_ANI_EARTHARROW = 39 CONST_ANI_EXPLOSION = 40 CONST_ANI_CAKE = 41 CONST_ANI_WEAPONTYPE = 254 CONST_ANI_NONE = 255 CONST_ANI_LAST = CONST_ANI_CAKE TALKTYPE_SAY = 1 TALKTYPE_WHISPER = 2 TALKTYPE_YELL = 3 TALKTYPE_PRIVATE_PN = 4 TALKTYPE_PRIVATE_NP = 5 TALKTYPE_PRIVATE = 6 TALKTYPE_CHANNEL_Y = 7 TALKTYPE_CHANNEL_W = 8 TALKTYPE_RVR_CHANNEL = 9 TALKTYPE_RVR_ANSWER = 10 TALKTYPE_RVR_CONTINUE = 11 TALKTYPE_BROADCAST = 12 TALKTYPE_CHANNEL_R1 = 13 TALKTYPE_PRIVATE_RED = 14 TALKTYPE_CHANNEL_O = 15 TALKTYPE_CHANNEL_R2 = 17 TALKTYPE_ORANGE_1 = 19 TALKTYPE_ORANGE_2 = 20 MESSAGE_STATUS_CONSOLE_RED = 18 MESSAGE_EVENT_ORANGE = 19 MESSAGE_STATUS_CONSOLE_ORANGE = 20 MESSAGE_STATUS_WARNING = 21 MESSAGE_EVENT_ADVANCE = 22 MESSAGE_EVENT_DEFAULT = 23 MESSAGE_STATUS_DEFAULT = 24 MESSAGE_INFO_DESCR = 25 MESSAGE_STATUS_SMALL = 26 MESSAGE_STATUS_CONSOLE_BLUE = 27 MESSAGE_TYPES = { ["advance"] = MESSAGE_EVENT_ADVANCE, ["event"] = MESSAGE_EVENT_DEFAULT, ["white"] = MESSAGE_EVENT_DEFAULT, ["orange"] = MESSAGE_STATUS_CONSOLE_ORANGE, ["info"] = MESSAGE_INFO_DESCR, ["green"] = MESSAGE_INFO_DESCR, ["small"] = MESSAGE_STATUS_SMALL, ["blue"] = MESSAGE_STATUS_CONSOLE_BLUE, ["red"] = MESSAGE_STATUS_CONSOLE_RED, ["warning"] = MESSAGE_STATUS_WARNING, ["status"] = MESSAGE_STATUS_DEFAULT } TEXTCOLOR_BLUE = 5 TEXTCOLOR_GREEN = 18 TEXTCOLOR_TEAL = 35 TEXTCOLOR_LIGHTGREEN = 66 TEXTCOLOR_DARKBROWN = 78 TEXTCOLOR_LIGHTBLUE = 89 TEXTCOLOR_DARKPURPLE = 112 TEXTCOLOR_BROWN = 120 TEXTCOLOR_GREY = 129 TEXTCOLOR_DARKRED = 144 TEXTCOLOR_DARKPINK = 152 TEXTCOLOR_PURPLE = 154 TEXTCOLOR_DARKORANGE = 156 TEXTCOLOR_RED = 180 TEXTCOLOR_PINK = 190 TEXTCOLOR_ORANGE = 192 TEXTCOLOR_DARKYELLOW = 205 TEXTCOLOR_YELLOW = 210 TEXTCOLOR_WHITE = 215 TEXTCOLOR_NONE = 255 MAPMARK_TICK = 0 MAPMARK_QUESTION = 1 MAPMARK_EXCLAMATION = 2 MAPMARK_STAR = 3 MAPMARK_CROSS = 4 MAPMARK_TEMPLE = 5 MAPMARK_KISS = 6 MAPMARK_SHOVEL = 7 MAPMARK_SWORD = 8 MAPMARK_FLAG = 9 MAPMARK_LOCK = 10 MAPMARK_BAG = 11 MAPMARK_SKULL = 12 MAPMARK_DOLLAR = 13 MAPMARK_REDNORTH = 14 MAPMARK_REDSOUTH = 15 MAPMARK_REDEAST = 16 MAPMARK_REDWEST = 17 MAPMARK_GREENNORTH = 18 MAPMARK_GREENSOUTH = 19 ITEM_TYPE_DEPOT = 1 ITEM_TYPE_MAILBOX = 2 ITEM_TYPE_TRASHHOLDER = 3 ITEM_TYPE_CONTAINER = 4 ITEM_TYPE_DOOR = 5 ITEM_TYPE_MAGICFIELD = 6 ITEM_TYPE_TELEPORT = 7 ITEM_TYPE_BED = 8 ITEM_TYPE_LEVELDOOR = 9 CONST_PROP_BLOCKSOLID = 0 CONST_PROP_HASHEIGHT = 1 CONST_PROP_BLOCKPROJECTILE = 2 CONST_PROP_BLOCKPATHFIND = 3 CONST_PROP_ISVERTICAL = 4 CONST_PROP_ISHORIZONTAL = 5 CONST_PROP_MOVEABLE = 6 CONST_PROP_BLOCKINGANDNOTMOVEABLE = 7 CONST_PROP_SUPPORTHANGABLE = 8 PLAYERSEX_FEMALE = 0 PLAYERSEX_MALE = 1 PLAYERSEX_GAMEMASTER = 2 PLAYERLOSS_EXPERIENCE = 0 PLAYERLOSS_MANA = 1 PLAYERLOSS_SKILLS = 2 PLAYERLOSS_CONTAINERS = 3 PLAYERLOSS_ITEMS = 4 STATSCHANGE_HEALTHGAIN = 1 STATSCHANGE_HEALTHLOSS = 2 STATSCHANGE_MANAGAIN = 3 STATSCHANGE_MANALOSS = 4 SKILL_FIST = 0 SKILL_CLUB = 1 SKILL_SWORD = 2 SKILL_AXE = 3 SKILL_DISTANCE = 4 SKILL_SHIELD = 5 SKILL_FISHING = 6 SKILL__MAGLEVEL = 7 SKILL__LEVEL = 8 GUILDLEVEL_MEMBER = 1 GUILDLEVEL_VICE = 2 GUILDLEVEL_LEADER = 3 SKULL_NONE = 0 SKULL_YELLOW = 1 SKULL_GREEN = 2 SKULL_WHITE = 3 SKULL_RED = 4 SHIELD_NONE = 0 SHIELD_WHITEYELLOW = 1 SHIELD_WHITEBLUE = 2 SHIELD_BLUE = 3 SHIELD_YELLOW = 4 SHIELD_BLUE_SHAREDEXP = 5 SHIELD_YELLOW_SHAREDEXP = 6 SHIELD_BLUE_NOSHAREDEXP_BLINK = 7 SHIELD_YELLOW_NOSHAREDEXP_BLINK = 8 SHIELD_BLUE_NOSHAREDEXP = 9 SHIELD_YELLOW_NOSHAREDEXP = 10 WORLD_TYPE_NO_PVP = 1 WORLD_TYPE_PVP = 2 WORLD_TYPE_PVP_ENFORCED = 3 DATABASE_ENGINE_NONE = 0 DATABASE_ENGINE_MYSQL = 1 DATABASE_ENGINE_SQLITE = 2 DATABASE_ENGINE_POSTGRESQL = 3 DATABASE_ENGINE_ODBC = 4 GAMESTATE_STARTUP = 1 GAMESTATE_INIT = 2 GAMESTATE_NORMAL = 3 GAMESTATE_MAINTAIN = 4 GAMESTATE_CLOSED = 5 GAMESTATE_SHUTDOWN = 6 GAMESTATE_CLOSING = 7 RELOAD_ACTIONS = 1 RELOAD_CHAT = 2 RELOAD_CONFIG = 3 RELOAD_CREATUREEVENTS = 4 RELOAD_GAMESERVERS = 5 RELOAD_GLOBALEVENTS = 6 RELOAD_GROUPS = 7 RELOAD_HIGHSCORES = 8 RELOAD_HOUSEPRICES = 9 RELOAD_ITEMS = 10 RELOAD_MONSTERS = 11 RELOAD_MOVEEVENTS = 12 RELOAD_NPCS = 13 RELOAD_OUTFITS = 14 RELOAD_QUESTS = 15 RELOAD_RAIDS = 16 RELOAD_SPELLS = 17 RELOAD_STAGES = 18 RELOAD_TALKACTIONS = 19 RELOAD_VOCATIONS = 20 RELOAD_WEAPONS = 21 RELOAD_ALL = 22 BANTYPE_IP_BANISHMENT = 1 BANTYPE_NAMELOCK = 2 BANTYPE_BANISHMENT = 3 BANTYPE_NOTATION = 4 BANTYPE_DELETION = 5 CHANNEL_GUILD = 0 CHANNEL_STAFF = 1 CHANNEL_COUNSELOR = 2 CHANNEL_RVR = 3 CHANNEL_GAMECHAT = 4 CHANNEL_TRADE = 5 CHANNEL_RLCHAT = 6 CHANNEL_TRADEROOK = 7 CHANNEL_PARTY = 8 CHANNEL_HELP = 9 STACKPOS_GROUND = 0 STACKPOS_FIRST_ITEM_ABOVE_GROUNDTILE = 1 STACKPOS_SECOND_ITEM_ABOVE_GROUNDTILE = 2 STACKPOS_THIRD_ITEM_ABOVE_GROUNDTILE = 3 STACKPOS_FOURTH_ITEM_ABOVE_GROUNDTILE = 4 STACKPOS_FIFTH_ITEM_ABOVE_GROUNDTILE = 5 STACKPOS_TOP_CREATURE = 253 STACKPOS_TOP_FIELD = 254 STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE = 255 WEAPON_NONE = 0 WEAPON_SWORD = 1 WEAPON_CLUB = 2 WEAPON_AXE = 3 WEAPON_SHIELD = 4 WEAPON_DIST = 5 WEAPON_WAND = 6 WEAPON_AMMO = 7 WEAPON_FIST = 8 ACTION_NOTATION = 0 ACTION_NAMEREPORT = 1 ACTION_BANISHMENT = 2 ACTION_BANREPORT = 3 ACTION_BANFINAL = 4 ACTION_BANREPORTFINAL = 5 ACTION_STATEMENT = 6 ACTION_DELETION = 7 ITEM_GOLD_COIN = 2148 ITEM_PLATINUM_COIN = 2152 ITEM_CRYSTAL_COIN = 2160 ITEM_FISH = 2667 ITEM_WORM = 3976 ITEM_BLUEBERRY = 2677 ITEM_BLUEBERRYBUSH = 2785 ITEM_BUSH = 2786 ITEM_PARCEL = 2595 ITEM_LABEL = 2599 RETURNVALUE_NOERROR = 1 RETURNVALUE_NOTPOSSIBLE = 2 RETURNVALUE_NOTENOUGHROOM = 3 RETURNVALUE_PLAYERISPZLOCKED = 4 RETURNVALUE_PLAYERISNOTINVITED = 5 RETURNVALUE_CANNOTTHROW = 6 RETURNVALUE_THEREISNOWAY = 7 RETURNVALUE_DESTINATIONOUTOFREACH = 8 RETURNVALUE_CREATUREBLOCK = 9 RETURNVALUE_NOTMOVEABLE = 10 RETURNVALUE_DROPTWOHANDEDITEM = 11 RETURNVALUE_BOTHHANDSNEEDTOBEFREE = 12 RETURNVALUE_CANONLYUSEONEWEAPON = 13 RETURNVALUE_NEEDEXCHANGE = 14 RETURNVALUE_CANNOTBEDRESSED = 15 RETURNVALUE_PUTTHISOBJECTINYOURHAND = 16 RETURNVALUE_PUTTHISOBJECTINBOTHHANDS = 17 RETURNVALUE_TOOFARAWAY = 18 RETURNVALUE_FIRSTGODOWNSTAIRS = 19 RETURNVALUE_FIRSTGOUPSTAIRS = 20 RETURNVALUE_CONTAINERNOTENOUGHROOM = 21 RETURNVALUE_NOTENOUGHCAPACITY = 22 RETURNVALUE_CANNOTPICKUP = 23 RETURNVALUE_THISISIMPOSSIBLE = 24 RETURNVALUE_DEPOTISFULL = 25 RETURNVALUE_CREATUREDOESNOTEXIST = 26 RETURNVALUE_CANNOTUSETHISOBJECT = 27 RETURNVALUE_PLAYERWITHTHISNAMEISNOTONLINE = 28 RETURNVALUE_NOTREQUIREDLEVELTOUSERUNE = 29 RETURNVALUE_YOUAREALREADYTRADING = 30 RETURNVALUE_THISPLAYERISALREADYTRADING = 31 RETURNVALUE_YOUMAYNOTLOGOUTDURINGAFIGHT = 32 RETURNVALUE_DIRECTPLAYERSHOOT = 33 RETURNVALUE_NOTENOUGHLEVEL = 34 RETURNVALUE_NOTENOUGHMAGICLEVEL = 35 RETURNVALUE_NOTENOUGHMANA = 36 RETURNVALUE_NOTENOUGHSOUL = 37 RETURNVALUE_YOUAREEXHAUSTED = 38 RETURNVALUE_PLAYERISNOTREACHABLE = 39 RETURNVALUE_CANONLYUSETHISRUNEONCREATURES = 40 RETURNVALUE_ACTIONNOTPERMITTEDINPROTECTIONZONE = 41 RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER = 42 RETURNVALUE_YOUMAYNOTATTACKAPERSONINPROTECTIONZONE = 43 RETURNVALUE_YOUMAYNOTATTACKAPERSONWHILEINPROTECTIONZONE = 44 RETURNVALUE_YOUMAYNOTATTACKTHISCREATURE = 45 RETURNVALUE_YOUCANONLYUSEITONCREATURES = 46 RETURNVALUE_CREATUREISNOTREACHABLE = 47 RETURNVALUE_TURNSECUREMODETOATTACKUNMARKEDPLAYERS = 48 RETURNVALUE_YOUNEEDPREMIUMACCOUNT = 49 RETURNVALUE_YOUNEEDTOLEARNTHISSPELL = 50 RETURNVALUE_YOURVOCATIONCANNOTUSETHISSPELL = 51 RETURNVALUE_YOUNEEDAWEAPONTOUSETHISSPELL = 52 RETURNVALUE_PLAYERISPZLOCKEDLEAVEPVPZONE = 53 RETURNVALUE_PLAYERISPZLOCKEDENTERPVPZONE = 54 RETURNVALUE_ACTIONNOTPERMITTEDINANOPVPZONE = 55 RETURNVALUE_YOUCANNOTLOGOUTHERE = 56 RETURNVALUE_YOUNEEDAMAGICITEMTOCASTSPELL = 57 RETURNVALUE_CANNOTCONJUREITEMHERE = 58 RETURNVALUE_YOUNEEDTOSPLITYOURSPEARS = 59 RETURNVALUE_NAMEISTOOAMBIGUOUS = 60 RETURNVALUE_CANONLYUSEONESHIELD = 61 RETURNVALUE_YOUARENOTTHEOWNER = 62 RETURNVALUE_NOPARTYMEMBERSINRANGE = 63 BLUEBERRYBUSH_DECAY_INTERVAL = 300000 CONTAINER_POSITION = 65535 ITEMCOUNT_MAX = 100 PlayerFlag_CannotUseCombat = 0 PlayerFlag_CannotAttackPlayer = 1 PlayerFlag_CannotAttackMonster = 2 PlayerFlag_CannotBeAttacked = 3 PlayerFlag_CanConvinceAll = 4 PlayerFlag_CanSummonAll = 5 PlayerFlag_CanIllusionAll = 6 PlayerFlag_CanSenseInvisibility = 7 PlayerFlag_IgnoredByMonsters = 8 PlayerFlag_NotGainInFight = 9 PlayerFlag_HasInfiniteMana = 10 PlayerFlag_HasInfiniteSoul = 11 PlayerFlag_HasNoExhaustion = 12 PlayerFlag_CannotUseSpells = 13 PlayerFlag_CannotPickupItem = 14 PlayerFlag_CanAlwaysLogin = 15 PlayerFlag_CanBroadcast = 16 PlayerFlag_CanEditHouses = 17 PlayerFlag_CannotBeBanned = 18 PlayerFlag_CannotBePushed = 19 PlayerFlag_HasInfiniteCapacity = 20 PlayerFlag_CanPushAllCreatures = 21 PlayerFlag_CanTalkRedPrivate = 22 PlayerFlag_CanTalkRedChannel = 23 PlayerFlag_TalkOrangeHelpChannel = 24 PlayerFlag_NotGainExperience = 25 PlayerFlag_NotGainMana = 26 PlayerFlag_NotGainHealth = 27 PlayerFlag_NotGainSkill = 28 PlayerFlag_SetMaxSpeed = 29 PlayerFlag_SpecialVIP = 30 PlayerFlag_NotGenerateLoot = 31 PlayerFlag_CanTalkRedChannelAnonymous = 32 PlayerFlag_IgnoreProtectionZone = 33 PlayerFlag_IgnoreSpellCheck = 34 PlayerFlag_IgnoreWeaponCheck = 35 PlayerFlag_CannotBeMuted = 36 PlayerFlag_IsAlwaysPremium = 37 PlayerFlag_CanAnswerRuleViolations = 38 PlayerFlag_39 = 39 -- ignore PlayerFlag_ShowGroupNameInsteadOfVocation = 40 PlayerFlag_HasInfiniteStamina = 41 PlayerFlag_CannotMoveItems = 42 PlayerFlag_CannotMoveCreatures = 43 PlayerFlag_CanReportBugs = 44 PlayerFlag_45 = 45 -- ignore PlayerCustomFlag_UnusedAndToReplace = 0 PlayerCustomFlag_CanSeePosition = 1 PlayerCustomFlag_CanSeeItemDetails = 2 PlayerCustomFlag_CanSeeCreatureDetails = 3 PlayerCustomFlag_NotSearchable = 4 PlayerCustomFlag_GamemasterPrivileges = 5 PlayerCustomFlag_CanThrowAnywhere = 6 PlayerCustomFlag_CanPushAllItems = 7 PlayerCustomFlag_CanMoveAnywhere = 8 PlayerCustomFlag_CanMoveFromFar = 9 PlayerCustomFlag_CanLoginMultipleCharacters = 10 PlayerCustomFlag_HasFullLight = 11 PlayerCustomFlag_CanLogoutAnytime = 12 PlayerCustomFlag_HideLevel = 13 PlayerCustomFlag_IsProtected = 14 PlayerCustomFlag_IsImmune = 15 PlayerCustomFlag_NotGainSkull = 16 PlayerCustomFlag_NotGainUnjustified = 17 PlayerCustomFlag_HideLevel = 18 PlayerCustomFlag_IgnorePacification = 19 PlayerCustomFlag_CanStairhop = 20 PlayerCustomFlag_CanTurnhop = 21 maleOutfits = {128, 129, 130, 131, 132, 133, 134, 143, 144, 145, 146, 151, 152, 153, 154, 251, 268, 273, 278, 289, 325} femaleOutfits = {136, 137, 138, 139, 140, 141, 142, 147, 148, 149, 150, 155, 156, 157, 158, 252, 269, 270, 279, 288, 324} doors = {[1209] = 1211, [1210] = 1211, [1212] = 1214, [1213] = 1214, [1219] = 1220, [1221] = 1222, [1231] = 1233, [1232] = 1233, [1234] = 1236, [1235] = 1236, [1237] = 1238, [1239] = 1240, [1249] = 1251, [1250] = 1251, [1252] = 1254, [1253] = 1254, [1541] = 1542, [3535] = 3537, [3536] = 3537, [3538] = 3539, [3544] = 3546, [3545] = 3546, [3547] = 3548, [4913] = 4915, [4914] = 4915, [4916] = 4918, [4917] = 4918, [5082] = 5083, [5084] = 5085, [5098] = 5100, [5099] = 5100, [5101] = 5102, [5107] = 5109, [5108] = 5109, [5110] = 5111, [5116] = 5118, [5117] = 5118, [5119] = 5120, [5125] = 5127, [5126] = 5127, [5128] = 5129, [5134] = 5136, [5135] = 5136, [5137] = 5139, [5138] = 5139, [5140] = 5142, [5141] = 5142, [5143] = 5145, [5144] = 5145, [5278] = 5280, [5279] = 5280, [5281] = 5283, [5282] = 5283, [5284] = 5285, [5286] = 5287, [5515] = 5516, [5517] = 5518, [5732] = 5734, [5733] = 5734, [5735] = 5737, [5736] = 5737, [6192] = 6194, [6193] = 6194, [6195] = 6197, [6196] = 6197, [6198] = 6199, [6200] = 6201, [6249] = 6251, [6250] = 6251, [6252] = 6254, [6253] = 6254, [6255] = 6256, [6257] = 6258, [6795] = 6796, [6797] = 6798, [6799] = 6800, [6801] = 6802, [6891] = 6893, [6892] = 6893, [6894] = 6895, [6900] = 6902, [6901] = 6902, [6903] = 6904, [7033] = 7035, [7034] = 7035, [7036] = 7037, [7042] = 7044, [7043] = 7044, [7045] = 7046, [7054] = 7055, [7056] = 7057, [8541] = 8543, [8542] = 8543, [8544] = 8546, [8545] = 8546, [8547] = 8548, [8549] = 8550, [9165] = 9167, [9166] = 9167, [9168] = 9170, [9169] = 6170, [9171] = 9172, [9173] = 9174, [9267] = 9269, [9268] = 9269, [9270] = 9272, [9271] = 9272, [9273] = 9274, [9275] = 9276} closingDoors = {1224, 1226, 1228, 1230, 1242, 1244, 1246, 1248, 1256, 1258, 1260, 1262, 3541, 3543, 3550, 3552, 5104, 5106, 5113, 5115, 5122, 5124, 5131, 5133, 5289, 5291, 5293, 5295, 6203, 6205, 6207, 6209, 6260, 6262, 6264, 6266, 6897, 6899, 6906, 6908, 7039, 7041, 7048, 7050, 8552, 8554, 8556, 8558, 9176, 9178, 9180, 9182, 9278, 9280, 9282, 9284} verticalOpenDoors = {1211, 1220, 1224, 1228, 1233, 1238, 1242, 1246, 1251, 1256, 1260, 1540, 3546, 3548, 3550, 3552, 4915, 5083, 5109, 5111, 5113, 5115, 5127, 5129, 5131, 5133, 5142, 5145, 5283, 5285, 5289, 5293, 5516, 5737, 5749, 6194, 6199, 6203, 6207, 6251, 6256, 6260, 6264, 6798, 6802, 6902, 6904, 6906, 6908, 7044, 7046, 7048, 7050, 7055, 8543, 8548, 8552, 8556, 9167, 9172, 9269, 9274} horizontalOpenDoors = {1214, 1222, 1226, 1230, 1236, 1240, 1244, 1248, 1254, 1258, 1262, 1542, 3537, 3539, 3541, 3543, 4918, 5085, 5100, 5102, 5104, 5106, 5118, 5120, 5122, 5124, 5136, 5139, 5280, 5287, 5291, 5295, 5518, 5734, 5746, 6197, 6201, 6205, 6209, 6254, 6258, 6262, 6266, 6796, 6800, 6893, 6895, 6897, 6899, 7035, 7037, 7039, 7041, 7057, 8546, 8550, 8554, 8558, 9170, 9174, 9272, 9276} specialDoors = {1223, 1225, 1241, 1243, 1255, 1257, 3542, 3551, 5105, 5114, 5123, 5132, 5288, 5290, 5745, 5748, 6202, 6204, 6259, 6261, 6898, 6907, 7040, 7049, 8551, 8553, 9175, 9177, 9277, 9279} keys = {2086, 2087, 2088, 2089, 2090, 2091, 2092} enchantableGems = {2147, 2146, 2149, 2150} enchantableItems = {2383, 7383, 7384, 7406, 7402, 2429, 2430, 7389, 7380, 2454, 2423, 2445, 7415, 7392, 2391, 2544, 8905} enchantingAltars = { {7504, 7505, 7506, 7507}, {7508, 7509, 7510, 7511}, {7516, 7517, 7518, 7519}, {7512, 7513, 7514, 7515} } enchantedGems = {7760, 7759, 7761, 7762} enchantedItems = { [2383] = {7744, 7763, 7854, 7869}, [7383] = {7745, 7764, 7855, 7870}, [7384] = {7746, 7765, 7856, 7871}, [7406] = {7747, 7766, 7857, 7872}, [7402] = {7748, 7767, 7858, 7873}, [2429] = {7749, 7768, 7859, 7874}, [2430] = {7750, 7769, 7860, 7875}, [7389] = {7751, 7770, 7861, 7876}, [7380] = {7752, 7771, 7862, 7877}, [2454] = {7753, 7772, 7863, 7878}, [2423] = {7754, 7773, 7864, 7879}, [2445] = {7755, 7774, 7865, 7880}, [7415] = {7756, 7775, 7866, 7881}, [7392] = {7757, 7776, 7867, 7882}, [2391] = {7758, 7777, 7868, 7883}, [2544] = {7840, 7839, 7850, 7838}, [8905] = {8906, 8907, 8909, 8908} } SKILL_NAMES = { [sKILL_FIST] = "fist fighting", [sKILL_CLUB] = "club fighting", [sKILL_SWORD] = "sword fighting", [sKILL_AXE] = "axe fighting", [sKILL_DISTANCE] = "distance fighting", [sKILL_SHIELD] = "shielding", [sKILL_FISHING] = "fishing", [sKILL__LEVEL] = "level", [sKILL__MAGLEVEL] = "magic level" } ai tem lista, quanto a segunda duvida, realmente não sei como responder...
-
Nossa cra, nunca mecho com bless, nem sei pa q isso serve direito, mas to tentando aki se de certo vo edit o topic e te digo... ate++
-
Va em alguma pasta do seu ot, e mude o id do corpse, que nem o fodim, que pelo jeito é fod*, falou. Se não der ponha aki o erro.
-
Pera vou tentar te ajudar!! Va em data/npc/lib/npcsystem abra o modules: acho que é so muda o começo: FOCUS_GREETWORDS = {'hi', 'hello', 'hey'} poe assim: FOCUS_GREETWORDS = {'oi', 'ola', 'hey'} e: SHOP_TRADEREQUEST = {'offer', 'trade'} para: SHOP_TRADEREQUEST = {'oferta', 'troca'} mas depois acho q tem que arruma nos npcs se falarem algo "para comprar diga |trade|" ai vc poe troca, como la emcima: Vo testa aki se de certo n vo edit esse topico. -- Advanced NPC System (Created by Jiddo), -- Modified by Talaturen. -- Modified by Elf. if(Modules == nil) then -- default words for greeting and ungreeting the npc. Should be a table containing all such words. FOCUS_GREETWORDS = {'hi', 'hello', 'hey'} FOCUS_FAREWELLWORDS = {'bye', 'farewell', 'cya'} -- The words for requesting trade window. SHOP_TRADEREQUEST = {'offer', 'troca'} -- The word for accepting/declining an offer. CAN ONLY CONTAIN ONE FIELD! Should be a teble with a single string value. SHOP_YESWORD = {'yes'} SHOP_NOWORD = {'no'} -- Pattern used to get the amount of an item a player wants to buy/sell. PATTERN_COUNT = '%d+' -- Constants used to separate buying from selling. SHOPMODULE_SELL_ITEM = 1 SHOPMODULE_BUY_ITEM = 2 SHOPMODULE_BUY_ITEM_CONTAINER = 3 -- Constants used for shop mode. Notice: addBuyableItemContainer is working on all modes SHOPMODULE_MODE_TALK = 1 -- Old system used before Tibia 8.2: sell/buy item name SHOPMODULE_MODE_TRADE = 2 -- Trade window system introduced in Tibia 8.2 SHOPMODULE_MODE_BOTH = 3 -- Both working at one time -- Used shop mode SHOPMODULE_MODE = SHOPMODULE_MODE_BOTH Modules = { parseableModules = {} } StdModule = {} -- These callback function must be called with parameters.npcHandler = npcHandler in the parameters table or they will not work correctly. -- Notice: The members of StdModule have not yet been tested. If you find any bugs, please report them to me. -- Usage: -- keywordHandler:addKeyword({'offer'}, StdModule.say, {npcHandler = npcHandler, text = 'I sell many powerful melee weapons.'}) function StdModule.say(cid, message, keywords, parameters, node) local npcHandler = parameters.npcHandler if(npcHandler == nil) then error('StdModule.say called without any npcHandler instance.') end local onlyFocus = (parameters.onlyFocus == nil or parameters.onlyFocus == true) if(not npcHandler:isFocused(cid) and onlyFocus) then return false end local parseInfo = {[TAG_PLAYERNAME] = getCreatureName(cid)} npcHandler:say(npcHandler:parseMessage(parameters.text or parameters.message, parseInfo), cid, parameters.publicize and true) if(parameters.reset == true) then npcHandler:resetNpc() elseif(parameters.moveup ~= nil and type(parameters.moveup) == 'number') then npcHandler.keywordHandler:moveUp(parameters.moveup) end return true end --Usage: -- local node1 = keywordHandler:addKeyword({'promot'}, StdModule.say, {npcHandler = npcHandler, text = 'I can promote you for 20000 gold coins. Do you want me to promote you?'}) -- node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 20000, promotion = 1, level = 20}, text = 'Congratulations! You are now promoted.') -- node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, text = 'Alright then, come back when you are ready.'}, reset = true) function StdModule.promotePlayer(cid, message, keywords, parameters, node) local npcHandler = parameters.npcHandler if(npcHandler == nil) then error('StdModule.promotePlayer called without any npcHandler instance.') end if(not npcHandler:isFocused(cid)) then return false end if(isPlayerPremiumCallback(cid) or getBooleanFromString(getConfigInfo('premiumForPromotion')) ~= TRUE or not(parameters.premium)) then if(getPlayerPromotionLevel(cid) >= parameters.promotion) then npcHandler:say('You are already promoted!', cid) elseif(getPlayerLevel(cid) < parameters.level) then npcHandler:say('Me desculpe, mas eu apenas posso promove-lo quando chegar no minimo level ' .. parameters.level .. '.', cid) elseif(doPlayerRemoveMoney(cid, parameters.cost) ~= TRUE) then npcHandler:say('You do not have enough money!', cid) else setPlayerPromotionLevel(cid, parameters.promotion) npcHandler:say(parameters.text, cid) end else npcHandler:say("You need a premium account in order to get promoted.", cid) end npcHandler:resetNpc() return true end function StdModule.learnSpell(cid, message, keywords, parameters, node) local npcHandler = parameters.npcHandler if(npcHandler == nil) then error('StdModule.learnSpell called without any npcHandler instance.') end if(not npcHandler:isFocused(cid)) then return false end if(isPlayerPremiumCallback(cid) or not(parameters.premium)) then if getPlayerLearnedInstantSpell(cid, parameters.spellName) == TRUE then npcHandler:say('You already know this spell.', cid) elseif getPlayerLevel(cid) < parameters.level then npcHandler:say('You need to obtain a level of ' .. parameters.level .. ' or higher to be able to learn ' .. parameters.spellName .. '.', cid) elseif getPlayerVocation(cid) ~= parameters.vocation and getPlayerVocation(cid) ~= parameters.vocation + 4 and vocation ~= 9 then npcHandler:say('This spell is not for your vocation', cid) elseif doPlayerRemoveMoney(cid, parameters.price) == FALSE then npcHandler:say('You do not have enough money, this spell costs ' .. parameters.price .. ' gold.', cid) else npcHandler:say('You have learned ' .. parameters.spellName .. '.', cid) playerLearnInstantSpell(cid, parameters.spellName) end else npcHandler:say('You need a premium account in order to buy ' .. parameters.spellName .. '.', cid) end npcHandler:resetNpc() return true end function StdModule.bless(cid, message, keywords, parameters, node) local npcHandler = parameters.npcHandler if(npcHandler == nil) then error('StdModule.bless called without any npcHandler instance.') end if(not npcHandler:isFocused(cid)) then return false end if(isPlayerPremiumCallback(cid) or getBooleanFromString(getConfigInfo('blessingsOnlyPremium')) ~= TRUE or not(parameters.premium)) then if getPlayerBlessing(cid, parameters.bless) then npcHandler:say("Gods have already blessed you with this blessing!", cid) elseif doPlayerRemoveMoney(cid, parameters.cost) == FALSE then npcHandler:say("You don't have enough money for blessing.", cid) else npcHandler:say("You have been blessed by one of the five gods!", cid) doPlayerAddBlessing(cid, parameters.bless) end else npcHandler:say('You need a premium account in order to be blessed.', cid) end npcHandler:resetNpc() return true end function StdModule.travel(cid, message, keywords, parameters, node) local npcHandler = parameters.npcHandler if(npcHandler == nil) then error('StdModule.travel called without any npcHandler instance.') end if(not npcHandler:isFocused(cid)) then return false end if(isPlayerPremiumCallback(cid) or not(parameters.premium)) then if(parameters.level ~= nil and getPlayerLevel(cid) < parameters.level) then npcHandler:say('You must reach level ' .. parameters.level .. ' before I can let you go there.', cid) elseif(doPlayerRemoveMoney(cid, parameters.cost) ~= TRUE) then npcHandler:say('You do not have enough money!', cid) else doTeleportThing(cid, parameters.destination, 0) doSendMagicEffect(parameters.destination, 10) end else npcHandler:say('I can only allow premium players to travel with me.', cid) end npcHandler:resetNpc() return true end FocusModule = { npcHandler = nil } -- Creates a new instance of FocusModule without an associated NpcHandler. function FocusModule:new() local obj = {} setmetatable(obj, self) self.__index = self return obj end -- Inits the module and associates handler to it. function FocusModule:init(handler) self.npcHandler = handler for i, word in pairs(FOCUS_GREETWORDS) do local obj = {} table.insert(obj, word) obj.callback = FOCUS_GREETWORDS.callback or FocusModule.messageMatcher handler.keywordHandler:addKeyword(obj, FocusModule.onGreet, {module = self}) end for i, word in pairs(FOCUS_FAREWELLWORDS) do local obj = {} table.insert(obj, word) obj.callback = FOCUS_FAREWELLWORDS.callback or FocusModule.messageMatcher handler.keywordHandler:addKeyword(obj, FocusModule.onFarewell, {module = self}) end return true end -- Greeting callback function. function FocusModule.onGreet(cid, message, keywords, parameters) parameters.module.npcHandler:onGreet(cid) return true end -- UnGreeting callback function. function FocusModule.onFarewell(cid, message, keywords, parameters) if(parameters.module.npcHandler:isFocused(cid)) then parameters.module.npcHandler:onFarewell(cid) return true else return false end end -- Custom message matching callback function for greeting messages. function FocusModule.messageMatcher(keywords, message) for i, word in pairs(keywords) do if(type(word) == 'string') then if string.find(message, word) and not string.find(message, '[%w+]' .. word) and not string.find(message, word .. '[%w+]') then return true end end end return false end KeywordModule = { npcHandler = nil } -- Add it to the parseable module list. Modules.parseableModules['module_keywords'] = KeywordModule function KeywordModule:new() local obj = {} setmetatable(obj, self) self.__index = self return obj end function KeywordModule:init(handler) self.npcHandler = handler return true end -- Parses all known parameters. function KeywordModule:parseParameters() local ret = NpcSystem.getParameter('keywords') if(ret ~= nil) then self:parseKeywords(ret) end end function KeywordModule:parseKeywords(data) local n = 1 for keys in string.gmatch(data, '[^;]+') do local i = 1 local keywords = {} for temp in string.gmatch(keys, '[^,]+') do table.insert(keywords, temp) i = i+1 end if(i ~= 1) then local reply = NpcSystem.getParameter('keyword_reply' .. n) if(reply ~= nil) then self:addKeyword(keywords, reply) else print('[Warning] NpcSystem:', 'Parameter \'' .. 'keyword_reply' .. n .. '\' missing. Skipping...') end else print('[Warning] NpcSystem:', 'No keywords found for keyword set #' .. n .. '. Skipping...') end n = n+1 end end function KeywordModule:addKeyword(keywords, reply) self.npcHandler.keywordHandler:addKeyword(keywords, StdModule.say, {npcHandler = self.npcHandler, onlyFocus = true, text = reply, reset = true}) end TravelModule = { npcHandler = nil, destinations = nil, yesNode = nil, noNode = nil, } -- Add it to the parseable module list. Modules.parseableModules['module_travel'] = TravelModule function TravelModule:new() local obj = {} setmetatable(obj, self) self.__index = self return obj end function TravelModule:init(handler) self.npcHandler = handler self.yesNode = KeywordNode:new(SHOP_YESWORD, TravelModule.onConfirm, {module = self}) self.noNode = KeywordNode:new(SHOP_NOWORD, TravelModule.onDecline, {module = self}) self.destinations = {} return true end -- Parses all known parameters. function TravelModule:parseParameters() local ret = NpcSystem.getParameter('travel_destinations') if(ret ~= nil) then self:parseDestinations(ret) self.npcHandler.keywordHandler:addKeyword({'destination'}, TravelModule.listDestinations, {module = self}) self.npcHandler.keywordHandler:addKeyword({'where'}, TravelModule.listDestinations, {module = self}) self.npcHandler.keywordHandler:addKeyword({'travel'}, TravelModule.listDestinations, {module = self}) end end function TravelModule:parseDestinations(data) for destination in string.gmatch(data, '[^;]+') do local i = 1 local name = nil local x = nil local y = nil local z = nil local cost = nil local premium = false for temp in string.gmatch(destination, '[^,]+') do if(i == 1) then name = temp elseif(i == 2) then x = tonumber(temp) elseif(i == 3) then y = tonumber(temp) elseif(i == 4) then z = tonumber(temp) elseif(i == 5) then cost = tonumber(temp) elseif(i == 6) then premium = temp == 'true' else print('[Warning] NpcSystem:', 'Unknown parameter found in travel destination parameter.', temp, destination) end i = i+1 end if(name ~= nil and x ~= nil and y ~= nil and z ~= nil and cost ~= nil) then self:addDestination(name, {x=x, y=y, z=z}, cost, premium) else print('[Warning] NpcSystem:', 'Parameter(s) missing for travel destination:', name, x, y, z, cost, premium) end end end function TravelModule:addDestination(name, position, price, premium) table.insert(self.destinations, name) local parameters = { cost = price, destination = position, premium = premium, module = self } local keywords = {} table.insert(keywords, name) local keywords2 = {} table.insert(keywords2, 'bring me to ' .. name) local node = self.npcHandler.keywordHandler:addKeyword(keywords, TravelModule.travel, parameters) self.npcHandler.keywordHandler:addKeyword(keywords2, TravelModule.bringMeTo, parameters) node:addChildKeywordNode(self.yesNode) node:addChildKeywordNode(self.noNode) end function TravelModule.travel(cid, message, keywords, parameters, node) local module = parameters.module if(not module.npcHandler:isFocused(cid)) then return false end local npcHandler = module.npcHandler local cost = parameters.cost local destination = parameters.destination local premium = parameters.premium module.npcHandler:say('Do you want to travel to ' .. keywords[1] .. ' for ' .. cost .. ' gold coins?', cid) return true end function TravelModule.onConfirm(cid, message, keywords, parameters, node) local module = parameters.module if(not module.npcHandler:isFocused(cid)) then return false end local npcHandler = module.npcHandler local parentParameters = node:getParent():getParameters() local cost = parentParameters.cost local destination = parentParameters.destination local premium = parentParameters.premium if(isPlayerPremiumCallback(cid) or parameters.premium ~= true) then if(doPlayerRemoveMoney(cid, cost) ~= TRUE) then npcHandler:say('You do not have enough money!', cid) else npcHandler:say('It was a pleasure doing business with you.', cid) npcHandler:releaseFocus(cid) doTeleportThing(cid, destination, 0) doSendMagicEffect(destination, 10) end else npcHandler:say('I can only allow premium players to travel there.', cid) end npcHandler:resetNpc() return true end -- onDecline keyword callback function. Generally called when the player sais 'no' after wanting to buy an item. function TravelModule.onDecline(cid, message, keywords, parameters, node) local module = parameters.module if(not module.npcHandler:isFocused(cid)) then return false end local parentParameters = node:getParent():getParameters() local parseInfo = { [TAG_PLAYERNAME] = getCreatureName(cid), } local msg = module.npcHandler:parseMessage(module.npcHandler:getMessage(MESSAGE_DECLINE), parseInfo) module.npcHandler:say(msg, cid) module.npcHandler:resetNpc() return true end function TravelModule.bringMeTo(cid, message, keywords, parameters, node) local module = parameters.module if(not module.npcHandler:isFocused(cid)) then return false end local cost = parameters.cost local destination = parameters.destination local premium = parameters.premium if(isPlayerPremiumCallback(cid) or parameters.premium ~= true) then if(doPlayerRemoveMoney(cid, cost) == TRUE) then doTeleportThing(cid, destination, 0) doSendMagicEffect(destination, 10) end end return true end function TravelModule.listDestinations(cid, message, keywords, parameters, node) local module = parameters.module if(not module.npcHandler:isFocused(cid)) then return false end local msg = 'I can bring you to ' --local i = 1 local maxn = table.maxn(module.destinations) for i, destination in pairs(module.destinations) do msg = msg .. destination if(i == maxn -1) then msg = msg .. ' and ' elseif(i == maxn) then msg = msg .. '.' else msg = msg .. ', ' end i = i + 1 end module.npcHandler:say(msg, cid) module.npcHandler:resetNpc() return true end ShopModule = { npcHandler = nil, yesNode = nil, noNode = nil, noText = '', maxCount = 100, amount = 0 } -- Add it to the parseable module list. Modules.parseableModules['module_shop'] = ShopModule -- Creates a new instance of ShopModule function ShopModule:new() local obj = {} setmetatable(obj, self) self.__index = self return obj end -- Parses all known parameters. function ShopModule:parseParameters() local ret = NpcSystem.getParameter('shop_buyable') if(ret ~= nil) then self:parseBuyable(ret) end local ret = NpcSystem.getParameter('shop_sellable') if(ret ~= nil) then self:parseSellable(ret) end local ret = NpcSystem.getParameter('shop_buyable_containers') if(ret ~= nil) then self:parseBuyableContainers(ret) end end -- Parse a string contaning a set of buyable items. function ShopModule:parseBuyable(data) for item in string.gmatch(data, '[^;]+') do local i = 1 local name = nil local itemid = nil local cost = nil local subType = nil local realName = nil for temp in string.gmatch(item, '[^,]+') do if(i == 1) then name = temp elseif(i == 2) then itemid = tonumber(temp) elseif(i == 3) then cost = tonumber(temp) elseif(i == 4) then subType = tonumber(temp) elseif(i == 5) then realName = temp else print('[Warning] NpcSystem:', 'Unknown parameter found in buyable items parameter.', temp, item) end i = i + 1 end if(SHOPMODULE_MODE == SHOPMODULE_MODE_TRADE) then if(itemid ~= nil and cost ~= nil) then if((isItemRune(itemid) == TRUE or isItemFluidContainer(itemid) == TRUE) and subType == nil) then print('[Warning] NpcSystem:', 'SubType missing for parameter item:', item) else self:addBuyableItem(nil, itemid, cost, subType, realName) end else print('[Warning] NpcSystem:', 'Parameter(s) missing for item:', itemid, cost) end else if(name ~= nil and itemid ~= nil and cost ~= nil) then if((isItemRune(itemid) == TRUE or isItemFluidContainer(itemid) == TRUE) and subType == nil) then print('[Warning] NpcSystem:', 'SubType missing for parameter item:', item) else local names = {} table.insert(names, name) self:addBuyableItem(names, itemid, cost, subType, realName) end else print('[Warning] NpcSystem:', 'Parameter(s) missing for item:', name, itemid, cost) end end end end -- Parse a string contaning a set of sellable items. function ShopModule:parseSellable(data) for item in string.gmatch(data, '[^;]+') do local i = 1 local name = nil local itemid = nil local cost = nil local realName = nil for temp in string.gmatch(item, '[^,]+') do if(i == 1) then name = temp elseif(i == 2) then itemid = tonumber(temp) elseif(i == 3) then cost = tonumber(temp) elseif(i == 4) then realName = temp else print('[Warning] NpcSystem:', 'Unknown parameter found in sellable items parameter.', temp, item) end i = i + 1 end if(SHOPMODULE_MODE == SHOPMODULE_MODE_TRADE) then if(itemid ~= nil and cost ~= nil) then self:addSellableItem(nil, itemid, cost, realName) else print('[Warning] NpcSystem:', 'Parameter(s) missing for item:', itemid, cost) end else if(name ~= nil and itemid ~= nil and cost ~= nil) then local names = {} table.insert(names, name) self:addSellableItem(names, itemid, cost, realName) else print('[Warning] NpcSystem:', 'Parameter(s) missing for item:', name, itemid, cost) end end end end -- Parse a string contaning a set of buyable items. function ShopModule:parseBuyableContainers(data) for item in string.gmatch(data, '[^;]+') do local i = 1 local name = nil local container = nil local itemid = nil local cost = nil local subType = nil local realName = nil for temp in string.gmatch(item, '[^,]+') do if(i == 1) then name = temp elseif(i == 2) then itemid = tonumber(temp) elseif(i == 3) then itemid = tonumber(temp) elseif(i == 4) then cost = tonumber(temp) elseif(i == 5) then subType = tonumber(temp) elseif(i == 6) then realName = temp else print('[Warning] NpcSystem:', 'Unknown parameter found in buyable items parameter.', temp, item) end i = i + 1 end if(name ~= nil and container ~= nil and itemid ~= nil and cost ~= nil) then if((isItemRune(itemid) == TRUE or isItemFluidContainer(itemid) == TRUE) and subType == nil) then print('[Warning] NpcSystem:', 'SubType missing for parameter item:', item) else local names = {} table.insert(names, name) self:addBuyableItemContainer(names, container, itemid, cost, subType, realName) end else print('[Warning] NpcSystem:', 'Parameter(s) missing for item:', name, container, itemid, cost) end end end -- Initializes the module and associates handler to it. function ShopModule:init(handler) self.npcHandler = handler self.yesNode = KeywordNode:new(SHOP_YESWORD, ShopModule.onConfirm, {module = self}) self.noNode = KeywordNode:new(SHOP_NOWORD, ShopModule.onDecline, {module = self}) self.noText = handler:getMessage(MESSAGE_DECLINE) if(SHOPMODULE_MODE ~= SHOPMODULE_MODE_TALK) then for i, word in pairs(SHOP_TRADEREQUEST) do local obj = {} table.insert(obj, word) obj.callback = SHOP_TRADEREQUEST.callback or ShopModule.messageMatcher handler.keywordHandler:addKeyword(obj, ShopModule.requestTrade, {module = self}) end end return true end -- Custom message matching callback function for requesting trade messages. function ShopModule.messageMatcher(keywords, message) for i, word in pairs(keywords) do if(type(word) == 'string') then if string.find(message, word) and not string.find(message, '[%w+]' .. word) and not string.find(message, word .. '[%w+]') then return true end end end return false end -- Resets the module-specific variables. function ShopModule:reset() self.amount = 0 end -- Function used to match a number value from a string. function ShopModule:getCount(message) local ret = 1 local b, e = string.find(message, PATTERN_COUNT) if b ~= nil and e ~= nil then ret = tonumber(string.sub(message, b, e)) end if(ret <= 0) then ret = 1 elseif(ret > self.maxCount) then ret = self.maxCount end return ret end -- Adds a new buyable item. -- names = A table containing one or more strings of alternative names to this item. Used only for old buy/sell system. -- itemid = The itemid of the buyable item -- cost = The price of one single item -- subType - The subType of each rune or fluidcontainer item. Can be left out if it is not a rune/fluidcontainer. Default value is 0. -- realName - The real, full name for the item. Will be used as ITEMNAME in MESSAGE_ONBUY and MESSAGE_ONSELL if defined. Default value is nil (getItemNameById will be used) function ShopModule:addBuyableItem(names, itemid, cost, subType, realName) if(SHOPMODULE_MODE ~= SHOPMODULE_MODE_TALK) then if(self.npcHandler.shopItems[itemid] == nil) then self.npcHandler.shopItems[itemid] = {buyPrice = -1, sellPrice = -1, subType = 0, realName = ""} end self.npcHandler.shopItems[itemid].buyPrice = cost self.npcHandler.shopItems[itemid].realName = realName or getItemNameById(itemid) self.npcHandler.shopItems[itemid].subType = subType or 0 end if(names ~= nil and SHOPMODULE_MODE ~= SHOPMODULE_MODE_TRADE) then for i, name in pairs(names) do local parameters = { itemid = itemid, cost = cost, eventType = SHOPMODULE_BUY_ITEM, module = self, realName = realName or getItemNameById(itemid), subType = subType or 1 } keywords = {} table.insert(keywords, 'buy') table.insert(keywords, name) local node = self.npcHandler.keywordHandler:addKeyword(keywords, ShopModule.tradeItem, parameters) node:addChildKeywordNode(self.yesNode) node:addChildKeywordNode(self.noNode) end end end -- Adds a new buyable container of items. -- names = A table containing one or more strings of alternative names to this item. -- container = Backpack, bag or any other itemid of container where bought items will be stored -- itemid = The itemid of the buyable item -- cost = The price of one single item -- subType - The subType of each rune or fluidcontainer item. Can be left out if it is not a rune/fluidcontainer. Default value is 0. -- realName - The real, full name for the item. Will be used as ITEMNAME in MESSAGE_ONBUY and MESSAGE_ONSELL if defined. Default value is nil (getItemNameById will be used) function ShopModule:addBuyableItemContainer(names, container, itemid, cost, subType, realName) if(names ~= nil) then for i, name in pairs(names) do local parameters = { container = container, itemid = itemid, cost = cost, eventType = SHOPMODULE_BUY_ITEM_CONTAINER, module = self, realName = realName or getItemNameById(itemid), subType = subType or 1 } keywords = {} table.insert(keywords, 'buy') table.insert(keywords, name) local node = self.npcHandler.keywordHandler:addKeyword(keywords, ShopModule.tradeItem, parameters) node:addChildKeywordNode(self.yesNode) node:addChildKeywordNode(self.noNode) end end end -- Adds a new sellable item. -- names = A table containing one or more strings of alternative names to this item. Used only by old buy/sell system. -- itemid = The itemid of the sellable item -- cost = The price of one single item -- realName - The real, full name for the item. Will be used as ITEMNAME in MESSAGE_ONBUY and MESSAGE_ONSELL if defined. Default value is nil (getItemNameById will be used) function ShopModule:addSellableItem(names, itemid, cost, realName) if(SHOPMODULE_MODE ~= SHOPMODULE_MODE_TALK) then if(self.npcHandler.shopItems[itemid] == nil) then self.npcHandler.shopItems[itemid] = {buyPrice = -1, sellPrice = -1, subType = 0, realName = ""} end self.npcHandler.shopItems[itemid].sellPrice = cost self.npcHandler.shopItems[itemid].realName = realName or getItemNameById(itemid) end if(names ~= nil and SHOPMODULE_MODE ~= SHOPMODULE_MODE_TRADE) then for i, name in pairs(names) do local parameters = { itemid = itemid, cost = cost, eventType = SHOPMODULE_SELL_ITEM, module = self, realName = realName or getItemNameById(itemid) } keywords = {} table.insert(keywords, 'sell') table.insert(keywords, name) local node = self.npcHandler.keywordHandler:addKeyword(keywords, ShopModule.tradeItem, parameters) node:addChildKeywordNode(self.yesNode) node:addChildKeywordNode(self.noNode) end end end -- onModuleReset callback function. Calls ShopModule:reset() function ShopModule:callbackOnModuleReset() self:reset() return true end -- Callback onBuy() function. If you wish, you can change certain Npc to use your onBuy(). function ShopModule:callbackOnBuy(cid, itemid, subType, amount, ignoreCap, inBackpacks) if(self.npcHandler.shopItems[itemid] == nil) then error("[shopModule.onBuy]", "items[itemid] == nil") return false end if(self.npcHandler.shopItems[itemid].buyPrice == -1) then error("[shopModule.onSell]", "Attempt to buy a non-buyable item") return false end local backpack = 1988 local totalCost = amount * self.npcHandler.shopItems[itemid].buyPrice if(inBackpacks) then totalCost = totalCost + (math.max(1, math.floor(amount / getContainerCapById(backpack))) * 20) end local parseInfo = { [TAG_PLAYERNAME] = getPlayerName(cid), [TAG_ITEMCOUNT] = amount, [TAG_TOTALCOST] = totalCost, [TAG_ITEMNAME] = self.npcHandler.shopItems[itemid].realName } if(getPlayerMoney(cid) < totalCost) then local msg = self.npcHandler:getMessage(MESSAGE_NEEDMONEY) msg = self.npcHandler:parseMessage(msg, parseInfo) doPlayerSendCancel(cid, msg) return false end local a, b = doNpcSellItem(cid, itemid, amount, subType, ignoreCap, inBackpacks, backpack) if(a < amount) then local msgId = MESSAGE_NEEDMORESPACE if(a == 0) then msgId = MESSAGE_NEEDSPACE end local msg = self.npcHandler:getMessage(msgId) parseInfo[TAG_ITEMCOUNT] = a msg = self.npcHandler:parseMessage(msg, parseInfo) doPlayerSendCancel(cid, msg) if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then self.npcHandler.talkStart[cid] = os.time() else self.npcHandler.talkStart = os.time() end if(a > 0) then doPlayerRemoveMoney(cid, ((a * self.npcHandler.shopItems[itemid].buyPrice) + (b * 20))) return true end return false else local msg = self.npcHandler:getMessage(MESSAGE_BOUGHT) msg = self.npcHandler:parseMessage(msg, parseInfo) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg) doPlayerRemoveMoney(cid, totalCost) if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then self.npcHandler.talkStart[cid] = os.time() else self.npcHandler.talkStart = os.time() end return true end end -- Callback onSell() function. If you wish, you can change certain Npc to use your onSell(). function ShopModule:callbackOnSell(cid, itemid, subType, amount, ignoreCap, inBackpacks) if(self.npcHandler.shopItems[itemid] == nil) then error("[shopModule.onSell]", "items[itemid] == nil") return false end if(self.npcHandler.shopItems[itemid].sellPrice == -1) then error("[shopModule.onSell]", "Attempt to sell a non-sellable item") return false end local parseInfo = { [TAG_PLAYERNAME] = getPlayerName(cid), [TAG_ITEMCOUNT] = amount, [TAG_TOTALCOST] = amount * self.npcHandler.shopItems[itemid].sellPrice, [TAG_ITEMNAME] = self.npcHandler.shopItems[itemid].realName } if(subType < 1) then subType = -1 end if(doPlayerRemoveItem(cid, itemid, amount, subType) == TRUE) then local msg = self.npcHandler:getMessage(MESSAGE_SOLD) msg = self.npcHandler:parseMessage(msg, parseInfo) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg) doPlayerAddMoney(cid, amount * self.npcHandler.shopItems[itemid].sellPrice) if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then self.npcHandler.talkStart[cid] = os.time() else self.npcHandler.talkStart = os.time() end return true else local msg = self.npcHandler:getMessage(MESSAGE_NEEDITEM) msg = self.npcHandler:parseMessage(msg, parseInfo) doPlayerSendCancel(cid, msg) if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then self.npcHandler.talkStart[cid] = os.time() else self.npcHandler.talkStart = os.time() end return false end end -- Callback for requesting a trade window with the NPC. function ShopModule.requestTrade(cid, message, keywords, parameters, node) local module = parameters.module if(not module.npcHandler:isFocused(cid)) then return false end local itemWindow = {} for itemid, attr in pairs(module.npcHandler.shopItems) do local item = {id = itemid, buy = attr.buyPrice, sell = attr.sellPrice, subType = attr.subType, name = attr.realName} table.insert(itemWindow, item) end if(itemWindow[1] == nil) then local parseInfo = { [TAG_PLAYERNAME] = getPlayerName(cid) } local msg = module.npcHandler:parseMessage(module.npcHandler:getMessage(MESSAGE_NOSHOP), parseInfo) module.npcHandler:say(msg, cid) return true end local parseInfo = { [TAG_PLAYERNAME] = getPlayerName(cid) } local msg = module.npcHandler:parseMessage(module.npcHandler:getMessage(MESSAGE_SENDTRADE), parseInfo) openShopWindow(cid, itemWindow, function(cid, itemid, subType, amount, ignoreCap, inBackpacks) module.npcHandler:onBuy(cid, itemid, subType, amount, ignoreCap, inBackpacks) end, function(cid, itemid, subType, amount, ignoreCap, inBackpacks) module.npcHandler:onSell(cid, itemid, subType, amount, ignoreCap, inBackpacks) end) module.npcHandler:say(msg, cid) return true end -- onConfirm keyword callback function. Sells/buys the actual item. function ShopModule.onConfirm(cid, message, keywords, parameters, node) local module = parameters.module if(not module.npcHandler:isFocused(cid)) then return false end local parentParameters = node:getParent():getParameters() local parseInfo = { [TAG_PLAYERNAME] = getPlayerName(cid), [TAG_ITEMCOUNT] = module.amount, [TAG_TOTALCOST] = parentParameters.cost * module.amount, [TAG_ITEMNAME] = parentParameters.realName } if(parentParameters.eventType == SHOPMODULE_SELL_ITEM) then local ret = doPlayerSellItem(cid, parentParameters.itemid, module.amount, parentParameters.cost * module.amount) if(ret == LUA_NO_ERROR) then local msg = module.npcHandler:getMessage(MESSAGE_ONSELL) msg = module.npcHandler:parseMessage(msg, parseInfo) module.npcHandler:say(msg, cid) else local msg = module.npcHandler:getMessage(MESSAGE_MISSINGITEM) msg = module.npcHandler:parseMessage(msg, parseInfo) module.npcHandler:say(msg, cid) end elseif(parentParameters.eventType == SHOPMODULE_BUY_ITEM) then local ret = doPlayerBuyItem(cid, parentParameters.itemid, module.amount, parentParameters.cost * module.amount, parentParameters.subType) if(ret == LUA_NO_ERROR) then if parentParameters.itemid == ITEM_PARCEL then doPlayerBuyItem(cid, ITEM_LABEL, module.amount, 0, parentParameters.subType) end local msg = module.npcHandler:getMessage(MESSAGE_ONBUY) msg = module.npcHandler:parseMessage(msg, parseInfo) module.npcHandler:say(msg, cid) else local msg = module.npcHandler:getMessage(MESSAGE_MISSINGMONEY) msg = module.npcHandler:parseMessage(msg, parseInfo) module.npcHandler:say(msg, cid) end elseif(parentParameters.eventType == SHOPMODULE_BUY_ITEM_CONTAINER) then local ret = doPlayerBuyItemContainer(cid, parentParameters.container, parentParameters.itemid, module.amount, parentParameters.cost * module.amount, parentParameters.subType) if(ret == LUA_NO_ERROR) then local msg = module.npcHandler:getMessage(MESSAGE_ONBUY) msg = module.npcHandler:parseMessage(msg, parseInfo) module.npcHandler:say(msg, cid) else local msg = module.npcHandler:getMessage(MESSAGE_MISSINGMONEY) msg = module.npcHandler:parseMessage(msg, parseInfo) module.npcHandler:say(msg, cid) end end module.npcHandler:resetNpc() return true end -- onDecliune keyword callback function. Generally called when the player sais 'no' after wanting to buy an item. function ShopModule.onDecline(cid, message, keywords, parameters, node) local module = parameters.module if(not module.npcHandler:isFocused(cid)) then return false end local parentParameters = node:getParent():getParameters() local parseInfo = { [TAG_PLAYERNAME] = getPlayerName(cid), [TAG_ITEMCOUNT] = module.amount, [TAG_TOTALCOST] = parentParameters.cost * module.amount, [TAG_ITEMNAME] = parentParameters.realName } local msg = module.npcHandler:parseMessage(module.noText, parseInfo) module.npcHandler:say(msg, cid) module.npcHandler:resetNpc() return true end -- tradeItem callback function. Makes the npc say the message defined by MESSAGE_BUY or MESSAGE_SELL function ShopModule.tradeItem(cid, message, keywords, parameters, node) local module = parameters.module if(not module.npcHandler:isFocused(cid)) then return false end local count = module:getCount(message) module.amount = count local parseInfo = { [TAG_PLAYERNAME] = getPlayerName(cid), [TAG_ITEMCOUNT] = module.amount, [TAG_TOTALCOST] = parameters.cost * module.amount, [TAG_ITEMNAME] = parameters.realName } if(parameters.eventType == SHOPMODULE_SELL_ITEM) then local msg = module.npcHandler:getMessage(MESSAGE_SELL) msg = module.npcHandler:parseMessage(msg, parseInfo) module.npcHandler:say(msg, cid) elseif(parameters.eventType == SHOPMODULE_BUY_ITEM) then local msg = module.npcHandler:getMessage(MESSAGE_BUY) msg = module.npcHandler:parseMessage(msg, parseInfo) module.npcHandler:say(msg, cid) elseif(parameters.eventType == SHOPMODULE_BUY_ITEM_CONTAINER) then local msg = module.npcHandler:getMessage(MESSAGE_BUY) msg = module.npcHandler:parseMessage(msg, parseInfo) module.npcHandler:say(msg, cid) end return true end end --EDIT-- Para realmente pegar, tive que mudar outra coisa na mesma pasta chama-se npcsystem: aperta ctrl+f: trade, depois quando achar essa linha: SHOP_TRADEREQUEST = {'offer', 'trade'} troca para: SHOP_TRADEREQUEST = {'oferta', 'troca'} Com isso se pode mudar muitas coisas, Ex: SHOP_YESWORD = {'yes'} SHOP_NOWORD = {'no'} para isso: SHOP_YESWORD = {'sim'} SHOP_NOWORD = {'nao'} -- Advanced NPC System (Created by Jiddo), -- Modified by Talaturen. if(NpcSystem == nil) then -- Loads the underlying classes of the npcsystem. dofile('data/npc/lib/npcsystem/keywordhandler.lua') dofile('data/npc/lib/npcsystem/queue.lua') dofile('data/npc/lib/npcsystem/npchandler.lua') dofile('data/npc/lib/npcsystem/modules.lua') -- Global npc constants: -- Keyword nestling behavior. For more information look at the top of keywordhandler.lua KEYWORD_BEHAVIOR = BEHAVIOR_NORMAL_EXTENDED -- Greeting and unGreeting keywords. For more information look at the top of modules.lua FOCUS_GREETWORDS = {'hi', 'hello', 'hey'} FOCUS_FAREWELLWORDS = {'bye', 'farewell', 'cya'} -- The word for requesting trade window. For more information look at the top of modules.lua SHOP_TRADEREQUEST = {'offer', 'troca'} -- The word for accepting/declining an offer. CAN ONLY CONTAIN ONE FIELD! For more information look at the top of modules.lua SHOP_YESWORD = {'yes'} SHOP_NOWORD = {'no'} -- Pattern used to get the amount of an item a player wants to buy/sell. PATTERN_COUNT = '%d+' -- Talkdelay behavior. For more information, look at the top of npchandler.lua. NPCHANDLER_TALKDELAY = TALKDELAY_ONTHINK -- Conversation behavior. For more information, look at the top of npchandler.lua. NPCHANDLER_CONVBEHAVIOR = CONVERSATION_PRIVATE -- Constant strings defining the keywords to replace in the default messages. -- For more information, look at the top of npchandler.lua... TAG_PLAYERNAME = '|PLAYERNAME|' TAG_ITEMCOUNT = '|ITEMCOUNT|' TAG_TOTALCOST = '|TOTALCOST|' TAG_ITEMNAME = '|ITEMNAME|' TAG_QUEUESIZE = '|QUEUESIZE|' NpcSystem = {} -- Gets an npcparameter with the specified key. Returns nil if no such parameter is found. function NpcSystem.getParameter(key) local ret = getNpcParameter(tostring(key)) if((type(ret) == 'number' and ret == 0) or ret == nil) then return nil else return ret end end -- Parses all known parameters for the npc. Also parses parseable modules. function NpcSystem.parseParameters(npcHandler) local ret = NpcSystem.getParameter('idletime') if(ret ~= nil) then npcHandler.idleTime = tonumber(ret) end local ret = NpcSystem.getParameter('talkradius') if(ret ~= nil) then npcHandler.talkRadius = tonumber(ret) end local ret = NpcSystem.getParameter('message_greet') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_GREET, ret) end local ret = NpcSystem.getParameter('message_farewell') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_FAREWELL, ret) end local ret = NpcSystem.getParameter('message_decline') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_DECLINE, ret) end local ret = NpcSystem.getParameter('message_needmorespace') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_NEEDMORESPACE, ret) end local ret = NpcSystem.getParameter('message_needspace') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_NEEDSPACE, ret) end local ret = NpcSystem.getParameter('message_sendtrade') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_SENDTRADE, ret) end local ret = NpcSystem.getParameter('message_noshop') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_NOSHOP, ret) end local ret = NpcSystem.getParameter('message_oncloseshop') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_ONCLOSESHOP, ret) end local ret = NpcSystem.getParameter('message_onbuy') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_ONBUY, ret) end local ret = NpcSystem.getParameter('message_onsell') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_ONSELL, ret) end local ret = NpcSystem.getParameter('message_missingmoney') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_MISSINGMONEY, ret) end local ret = NpcSystem.getParameter('message_needmoney') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_NEEDMONEY, ret) end local ret = NpcSystem.getParameter('message_missingitem') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_MISSINGITEM, ret) end local ret = NpcSystem.getParameter('message_needitem') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_NEEDITEM, ret) end local ret = NpcSystem.getParameter('message_idletimeout') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_IDLETIMEOUT, ret) end local ret = NpcSystem.getParameter('message_walkaway') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_WALKAWAY, ret) end local ret = NpcSystem.getParameter('message_alreadyfocused') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_ALREADYFOCUSED, ret) end local ret = NpcSystem.getParameter('message_placedinqueue') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_PLACEDINQUEUE, ret) end local ret = NpcSystem.getParameter('message_buy') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_BUY, ret) end local ret = NpcSystem.getParameter('message_sell') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_SELL, ret) end local ret = NpcSystem.getParameter('message_bought') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_BOUGHT, ret) end local ret = NpcSystem.getParameter('message_sold') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_SOLD, ret) end -- Parse modules. for parameter, module in pairs(Modules.parseableModules) do local ret = NpcSystem.getParameter(parameter) if(ret ~= nil) then local number = tonumber(ret) if(number ~= 0 and module.parseParameters ~= nil) then local instance = module:new() npcHandler:addModule(instance) instance:parseParameters() end end end end end Testei aki 8.50, pego certinho!!! Ate++
-
Cara ja aconteceu isso comigo. Com certeza teras que mudar isso no function: Se for igual ao meu: Copie e passe por cima do seu: Quando voce ve as partes assim: return (isInArray({1,5}, getPlayerVocation(cid)) == TRUE) Falto algo ali, adivinhe, a vocação nova, o id dela: fica assim: return (isInArray({1,5,9}, getPlayerVocation(cid)) == TRUE) No caso se o 9 for a promoção do ID 1, e do ID 5. ID=1 sorcerer ID=5 Master sorcerer ID=9 Epic Sorcerer - tendeu!!?? function doPlayerGiveItem(cid, itemid, amount, subType) local item = 0 if(isItemStackable(itemid) == TRUE) then item = doCreateItemEx(itemid, amount) if(doPlayerAddItemEx(cid, item, TRUE) ~= RETURNVALUE_NOERROR) then return LUA_ERROR end else for i = 1, amount do item = doCreateItemEx(itemid, subType) if(doPlayerAddItemEx(cid, item, TRUE) ~= RETURNVALUE_NOERROR) then return LUA_ERROR end end end return LUA_NO_ERROR end function doPlayerTakeItem(cid, itemid, amount) if(getPlayerItemCount(cid, itemid) < amount or doPlayerRemoveItem(cid, itemid, amount) ~= TRUE) then return LUA_ERROR end return LUA_NO_ERROR end function doPlayerBuyItem(cid, itemid, count, cost, charges) if(doPlayerRemoveMoney(cid, cost) ~= TRUE) then return LUA_ERROR end return doPlayerGiveItem(cid, itemid, count, charges) end function doPlayerBuyItemContainer(cid, containerid, itemid, count, cost, charges) if(doPlayerRemoveMoney(cid, cost) ~= TRUE) then return LUA_ERROR end for i = 1, count do local container = doCreateItemEx(containerid, 1) for x = 1, getContainerCapById(containerid) do doAddContainerItem(container, itemid, charges) end if(doPlayerAddItemEx(cid, container, TRUE) ~= RETURNVALUE_NOERROR) then return LUA_ERROR end end return LUA_NO_ERROR end function doPlayerSellItem(cid, itemid, count, cost) if(doPlayerTakeItem(cid, itemid, count) ~= LUA_NO_ERROR) then return LUA_ERROR end if(doPlayerAddMoney(cid, cost) ~= TRUE) then error('Could not add money to: ' .. getPlayerName(cid) .. ' (' .. cost .. 'gp).') end return LUA_NO_ERROR end function isInRange(pos, fromPos, toPos) return (pos.x >= fromPos.x and pos.y >= fromPos.y and pos.z >= fromPos.z and pos.x <= toPos.x and pos.y <= toPos.y and pos.z <= toPos.z) and TRUE or FALSE end function isPremium(cid) return (isPlayer(cid) == TRUE and (getPlayerPremiumDays(cid) > 0 or getConfigInfo('freePremium') == "yes")) and TRUE or FALSE end function getMonthDayEnding(day) if day == "01" or day == "21" or day == "31" then return "st" elseif day == "02" or day == "22" then return "nd" elseif day == "03" or day == "23" then return "rd" else return "th" end end function getMonthString(m) return os.date("%B", os.time{year = 1970, month = m, day = 1}) end function getArticle(str) return str:find("[AaEeIiOoUuYy]") == 1 and "an" or "a" end function isNumber(str) return tonumber(str) ~= nil and TRUE or FALSE end function getDistanceBetween(firstPosition, secondPosition) local xDif = math.abs(firstPosition.x - secondPosition.x) local yDif = math.abs(firstPosition.y - secondPosition.y) local posDif = math.max(xDif, yDif) if(firstPosition.z ~= secondPosition.z) then posDif = posDif + 9 + 6 end return posDif end function doPlayerAddAddons(cid, addon) for i = 0, table.maxn(maleOutfits) do doPlayerAddOutfit(cid, maleOutfits[i], addon) end for i = 0, table.maxn(femaleOutfits) do doPlayerAddOutfit(cid, femaleOutfits[i], addon) end end function isSorcerer(cid) if(isPlayer(cid) == FALSE) then debugPrint("isSorcerer: Jogador nao encontrado.") return false end return (isInArray({1,5,9}, getPlayerVocation(cid)) == TRUE) end function isDruid(cid) if(isPlayer(cid) == FALSE) then debugPrint("isDruid: Jogador nao encontrado.") return false end return (isInArray({2,6,10}, getPlayerVocation(cid)) == TRUE) end function isPaladin(cid) if(isPlayer(cid) == FALSE) then debugPrint("isPaladin: Jogador nao encontrado.") return false end return (isInArray({3,7,11}, getPlayerVocation(cid)) == TRUE) end function isKnight(cid) if(isPlayer(cid) == FALSE) then debugPrint("isKnight: Jogador nao encontrado.") return false end return (isInArray({4,8,12}, getPlayerVocation(cid)) == TRUE) end function isRookie(cid) if(isPlayer(cid) == FALSE) then debugPrint("isRookie: Jogador nao encontrado.") return false end return (isInArray({0}, getPlayerVocation(cid)) == TRUE) end function getDirectionTo(pos1, pos2) local dir = NORTH if(pos1.x > pos2.x) then dir = WEST if(pos1.y > pos2.y) then dir = NORTHWEST elseif(pos1.y < pos2.y) then dir = SOUTHWEST end elseif(pos1.x < pos2.x) then dir = EAST if(pos1.y > pos2.y) then dir = NORTHEAST elseif(pos1.y < pos2.y) then dir = SOUTHEAST end else if(pos1.y > pos2.y) then dir = NORTH elseif(pos1.y < pos2.y) then dir = SOUTH end end return dir end function getPlayerLookPos(cid) return getPosByDir(getThingPos(cid), getPlayerLookDir(cid)) end function getPosByDir(fromPosition, direction, size) local n = size or 1 local pos = fromPosition if(direction == NORTH) then pos.y = pos.y - n elseif(direction == SOUTH) then pos.y = pos.y + n elseif(direction == WEST) then pos.x = pos.x - n elseif(direction == EAST) then pos.x = pos.x + n elseif(direction == NORTHWEST) then pos.y = pos.y - n pos.x = pos.x - n elseif(direction == NORTHEAST) then pos.y = pos.y - n pos.x = pos.x + n elseif(direction == SOUTHWEST) then pos.y = pos.y + n pos.x = pos.x - n elseif(direction == SOUTHEAST) then pos.y = pos.y + n pos.x = pos.x + n end return pos end function getPlayerMoney(cid) return ((getPlayerItemCount(cid, ITEM_CRYSTAL_COIN) * 10000) + (getPlayerItemCount(cid, ITEM_PLATINUM_COIN) * 100) + getPlayerItemCount(cid, ITEM_GOLD_COIN)) end function doPlayerWithdrawAllMoney(cid) return doPlayerWithdrawMoney(cid, getPlayerBalance(cid)) end function doPlayerDepositAllMoney(cid) return doPlayerDepositMoney(cid, getPlayerMoney(cid)) end function doPlayerTransferAllMoneyTo(cid, target) return doPlayerTransferMoneyTo(cid, target, getPlayerBalance(cid)) end function playerExists(name) return getPlayerGUIDByName(name) ~= 0 end function getTibiaTime() local minutes = getWorldTime() local hours = 0 while (minutes > 60) do hours = hours + 1 minutes = minutes - 60 end return {hours = hours, minutes = minutes} end function doWriteLogFile(file, text) local file = io.open(file, "a+") file:write("[" .. os.date("%d/%m/%Y %H:%M:%S") .. "] " .. text .. "\n") file:close() end function getExperienceForLevel(lv) lv = lv - 1 return ((50 * lv * lv * lv) - (150 * lv * lv) + (400 * lv)) / 3 end function doMutePlayer(cid, time) local condition = createConditionObject(CONDITION_MUTED) setConditionParam(condition, CONDITION_PARAM_TICKS, time * 1000) return doAddCondition(cid, condition) end function getPlayerVocationName(cid) return getVocationInfo(getPlayerVocation(cid)).name end function getPromotedVocation(vid) return getVocationInfo(vid).promotedVocation end function doPlayerRemovePremiumDays(cid, days) return doPlayerAddPremiumDays(cid, -days) end function getPlayerMasterPos(cid) return getTownTemplePosition(getPlayerTown(cid)) end function getItemNameById(itemid) return getItemDescriptionsById(itemid).name end function getItemPluralNameById(itemid) return getItemDescriptionsById(itemid).plural end function getItemArticleById(itemid) return getItemDescriptionsById(itemid).article end function getItemName(uid) return getItemDescriptions(uid).name end function getItemPluralName(uid) return getItemDescriptions(uid).plural end function getItemArticle(uid) return getItemDescriptions(uid).article end function getItemText(uid) return getItemDescriptions(uid).text end function getItemWriter(uid) return getItemDescriptions(uid).writer end function getItemDate(uid) return getItemDescriptions(uid).date end function getTilePzInfo(pos) return getTileInfo(pos).protection and TRUE or FALSE end function getTileZoneInfo(pos) local tmp = getTileInfo(pos) if(tmp.pvp) then return 2 end if(tmp.nopvp) then return 1 end return 0 end function debugPrint(text) return io.stdout:write(text) end function doShutdown() return doSetGameState(GAMESTATE_SHUTDOWN) end function doSummonCreature(name, pos) local cid = doCreateMonster(name, pos) if(cid ~= LUA_ERROR) then return cid end cid = doCreateNpc(name, pos) return cid end function getOnlinePlayers() local tmp = getPlayersOnline() local players = {} for i, cid in ipairs(tmp) do table.insert(players, getCreatureName(cid)) end return players end function getPlayerByName(name) local cid = getCreatureByName(name) return isPlayer(cid) == TRUE and cid or nil end function isPlayerGhost(cid) return isPlayer(cid) == TRUE and getCreatureCondition(cid, CONDITION_GAMEMASTER, GAMEMASTER_INVISIBLE) or FALSE end function doPlayerSetExperienceRate(cid, value) return doPlayerSetRate(cid, SKILL__LEVEL, value) end function doPlayerSetMagicRate(cid, value) return doPlayerSetRate(cid, SKILL__MAGLEVEL, value) end function getPlayerFrags(cid) return math.ceil((getPlayerRedSkullTicks(cid) / getConfigInfo('timeToDecreaseFrags')) + 1) end function getPartyLeader(cid) local party = getPartyMembers(cid) if(type(party) ~= 'table') then return 0 end return party[1] end function isInParty(cid) return type(getPartyMembers(cid)) == 'table' and TRUE or FALSE end function isPrivateChannel(channelId) for i = CHANNEL_GUILD, CHANNEL_HELP do if(channelId == i) then return FALSE end end return TRUE end function doConvertIntegerToIp(int, mask) local b4 = bit.urshift(bit.uband(int, 4278190080), 24) local b3 = bit.urshift(bit.uband(int, 16711680), 16) local b2 = bit.urshift(bit.uband(int, 65280), 8) local b1 = bit.urshift(bit.uband(int, 255), 0) if(mask ~= nil) then local m4 = bit.urshift(bit.uband(mask, 4278190080), 24) local m3 = bit.urshift(bit.uband(mask, 16711680), 16) local m2 = bit.urshift(bit.uband(mask, 65280), 8) local m1 = bit.urshift(bit.uband(mask, 255), 0) if((m1 == 255 or m1 == 0) and (m2 == 255 or m2 == 0) and (m3 == 255 or m3 == 0) and (m4 == 255 or m4 == 0)) then if m1 == 0 then b1 = "x" end if m2 == 0 then b2 = "x" end if m3 == 0 then b3 = "x" end if m4 == 0 then b4 = "x" end elseif(m1 ~= 255 or m2 ~= 255 or m3 ~= 255 or m4 ~= 255) then return b1 .. "." .. b2 .. "." .. b3 .. "." .. b4 .. " : " .. m1 .. "." .. m2 .. "." .. m3 .. "." .. m4 end end return b1 .. "." .. b2 .. "." .. b3 .. "." .. b4 end function doConvertIpToInteger(str) local maskindex = str:find(":") if(maskindex == nil) then local ipint = 0 local maskint = 0 local index = 24 for b in str:gmatch("([x%d]+)%.?") do if(b ~= "x") then if(b:find("x") ~= nil) then return 0, 0 end if(tonumber(b) > 255 or tonumber(b) < 0) then return 0, 0 end maskint = bit.ubor(maskint, bit.ulshift(255, index)) ipint = bit.ubor(ipint, bit.ulshift(b, index)) end index = index - 8 if(index < 0) then break end end if(index ~= -8) then return 0, 0 end return ipint, maskint end if(maskindex <= 1) then return 0, 0 end local ipstring = str:sub(1, maskindex - 1) local maskstring = str:sub(maskindex) local ipint = 0 local maskint = 0 local index = 0 for b in ipstring:gmatch("(%d+).?") do if(tonumber(b) > 255 or tonumber(b) < 0) then return 0, 0 end ipint = bit.ubor(ipint, bit.ulshift(b, index)) index = index + 8 if(index > 24) then break end end if(index ~= 32) then return 0, 0 end index = 0 for b in maskstring:gmatch("(%d+)%.?") do if(tonumber(b) > 255 or tonumber(b) < 0) then return 0, 0 end maskint = bit.ubor(maskint, bit.ulshift(b, index)) index = index + 8 if(index > 24) then break end end if(index ~= 32) then return 0, 0 end return ipint, maskint end function getBooleanFromString(str) return (str:lower() == "yes" or str:lower() == "true" or (tonumber(str) and tonumber(str) > 0)) and TRUE or FALSE end function doCopyItem(item, attributes) local attributes = attributes or FALSE local ret = doCreateItemEx(item.itemid, item.type) if(attributes == TRUE) then if(item.actionid > 0) then doSetItemActionId(ret, item.actionid) end end if(isContainer(item.uid) == TRUE) then for i = (getContainerSize(item.uid) - 1), 0, -1 do local tmp = getContainerItem(item.uid, i) if(tmp.itemid > 0) then doAddContainerItemEx(ret, doCopyItem(tmp, TRUE).uid) end end end return getThing(ret) end table.find = function (table, value) for i, v in pairs(table) do if(v == value) then return i end end return nil end table.isStrIn = function (txt, str) for i, v in pairs(str) do if(txt:find(v) and not txt:find('(%w+)' .. v) and not txt:find(v .. '(%w+)')) then return true end end return false end table.countElements = function (table, item) local count = 0 for i, n in pairs(table) do if(item == n) then count = count + 1 end end return count end table.getCombinations = function (table, num) local a, number, select, newlist = {}, #table, num, {} for i = 1, select do a[#a + 1] = i end local newthing = {} while(true) do local newrow = {} for i = 1, select do newrow[#newrow + 1] = table[a[i]] end newlist[#newlist + 1] = newrow i = select while(a[i] == (number - select + i)) do i = i - 1 end if(i < 1) then break end a[i] = a[i] + 1 for j = i, select do a[j] = a[i] + j - i end end return newlist end string.split = function (str) local t = {} local function helper(word) table.insert(t, word) return "" end if(not str:gsub("%w+", helper):find("%S")) then return t end end string.trim = function (str) return (string.gsub(str, "^%s*(.-)%s*$", "%1")) end string.explode = function (str, sep) local pos, t = 1, {} if #sep == 0 or #str == 0 then return end for s, e in function() return str:find(sep, pos) end do table.insert(t, str:sub(pos, s - 1):trim()) pos = e + 1 end table.insert(t, str:sub(pos):trim()) return t end E o meu second promotion: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end local node1 = keywordHandler:addKeyword({'promot'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Posso promove-lo para Primeira Promotion por 20k. Voce quer?'}) node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 20000, level = 20, promotion = 1, text = 'Agora voce tem a primeira promotion.'}) node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Tudo bem, volte quando estiver pronto.', reset = true}) local node2 = keywordHandler:addKeyword({'vip'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Posso promove-lo para Promotion VIP por 500k. Voce quer?'}) node2:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 500000, level = 10, promotion = 2, text = 'Agora voce tem a VIP promotion.'}) node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Tudo bem, volte quando estiver pronto.', reset = true}) npcHandler:addModule(FocusModule:new())
-
[Pedido] Npc Que Vende 4 Vocações Novas.
tópico respondeu ao teteusinhu de romera em Lixeira Pública
Vo te manda o script de NPC que vende as 4 promotions novas: 1º - Va na pasta data/npc/scripts/ Cria um arquivo chamado promotion, se ja tiver so colocar o code abaixo por cima: OBS: Arrumar Preço, leias as linhas: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end local node1 = keywordHandler:addKeyword({'promot'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Posso promove-lo para Primeira Promotion por 20k. Voce quer?'}) node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 20000, level = 20, promotion = 1, text = 'Agora voce tem a primeira promotion.'}) node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Tudo bem, volte quando estiver pronto.', reset = true}) local node2 = keywordHandler:addKeyword({'vip'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Posso promove-lo para Promotion VIP por 500k. Voce quer?'}) node2:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 500000, level = 10, promotion = 2, text = 'Agora voce tem a VIP promotion.'}) node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Tudo bem, volte quando estiver pronto.', reset = true}) npcHandler:addModule(FocusModule:new()) Credits ----- É muito bom para ser meu! NPC agora: 2º - Va data/npc Copie um arquivo Xml, apague tudo e cole isso: Para mudar nome: Para mudar roupa: <?xml version="1.0"?> <npc name="Grand johnny" script="data/npc/scripts/promotion.lua" access="3" lookdir="2"> <mana now="800" max="800"/> <health now="200" max="200"/> <look type="133" head="114" body="119" legs="132" feet="114"/> </npc> Boa, se não der me avisa aqui mesmo!! Ou me reporte o erro! -
Hmm Legal, mas é muito igual pra um tópico novo não acha? Para fazer uma magia nova, tente fazer com vários elementos, que realmente intriguem o player. Ate+ Exemplo: local combat1 = createCombatObject() setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat1, COMBAT_PARAM_EFFECT, CONST_ME_EXPLOSIONAREA) setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -3.0, -100, -20, -10) local combat2 = createCombatObject() setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(combat2, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT) setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -3.0, -100, -20, -10) local combat3 = createCombatObject() setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(combat3, COMBAT_PARAM_EFFECT, CONST_ME_ICEATTACK) setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -3.0, -100, -20, -10) local combat4 = createCombatObject() setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE) setCombatParam(combat4, COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE) setCombatFormula(combat4, COMBAT_FORMULA_LEVELMAGIC, -3.0, -100, -20, -10) local combat5 = createCombatObject() setCombatParam(combat5, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE) setCombatParam(combat5, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA) setCombatFormula(combat5, COMBAT_FORMULA_LEVELMAGIC, -3.0, -100, -20, -10) local combat6 = createCombatObject() setCombatParam(combat6, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat6, COMBAT_PARAM_EFFECT, CONST_ME_EXPLOSIONAREA) setCombatFormula(combat6, COMBAT_FORMULA_LEVELMAGIC, -3.0, -100, -20, -10) local combat7 = createCombatObject() setCombatParam(combat7, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(combat7, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT) setCombatFormula(combat7, COMBAT_FORMULA_LEVELMAGIC, -3.0, -100, -20, -10) local combat8 = createCombatObject() setCombatParam(combat8, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(combat8, COMBAT_PARAM_EFFECT, CONST_ME_ICEATTACK) setCombatFormula(combat8, COMBAT_FORMULA_LEVELMAGIC, -3.0, -100, -20, -10) local combat9 = createCombatObject() setCombatParam(combat9, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE) setCombatParam(combat9, COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE) setCombatFormula(combat9, COMBAT_FORMULA_LEVELMAGIC, -3.0, -100, -20, -10) local combat10 = createCombatObject() setCombatParam(combat10, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE) setCombatParam(combat10, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA) setCombatFormula(combat10, COMBAT_FORMULA_LEVELMAGIC, -3.0, -100, -20, -10) local combat11 = createCombatObject() setCombatParam(combat11, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat1, COMBAT_PARAM_EFFECT, CONST_ME_EXPLOSIONAREA) setCombatFormula(combat11, COMBAT_FORMULA_LEVELMAGIC, -3.0, -100, -20, -10) local combat12 = createCombatObject() setCombatParam(combat12, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(combat12, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT) setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -3.0, -100, -20, -10) local combat13 = createCombatObject() setCombatParam(combat13, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(combat13, COMBAT_PARAM_EFFECT, CONST_ME_ICEATTACK) setCombatFormula(combat13, COMBAT_FORMULA_LEVELMAGIC, -3.0, -100, -20, -10) local combat14 = createCombatObject() setCombatParam(combat14, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE) setCombatParam(combat14, COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE) setCombatFormula(combat14, COMBAT_FORMULA_LEVELMAGIC, -3.0, -100, -20, -10) local combat15 = createCombatObject() setCombatParam(combat15, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE) setCombatParam(combat15, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA) setCombatFormula(combat15, COMBAT_FORMULA_LEVELMAGIC, -3.0, -100, -20, -10) local combat16 = createCombatObject() setCombatParam(combat16, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat16, COMBAT_PARAM_EFFECT, CONST_ME_EXPLOSIONAREA) setCombatFormula(combat16, COMBAT_FORMULA_LEVELMAGIC, -3.0, -100, -20, -10) local combat17 = createCombatObject() setCombatParam(combat17, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(combat17, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT) setCombatFormula(combat17, COMBAT_FORMULA_LEVELMAGIC, -3.0, -100, -20, -10) local combat18 = createCombatObject() setCombatParam(combat18, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(combat18, COMBAT_PARAM_EFFECT, CONST_ME_ICEATTACK) setCombatFormula(combat18, COMBAT_FORMULA_LEVELMAGIC, -3.0, -100, -20, -10) local combat19 = createCombatObject() setCombatParam(combat19, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE) setCombatParam(combat19, COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE) setCombatFormula(combat19, COMBAT_FORMULA_LEVELMAGIC, -3.0, -100, -20, -10) local combat20 = createCombatObject() setCombatParam(combat20, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE) setCombatParam(combat20, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA) setCombatFormula(combat20, COMBAT_FORMULA_LEVELMAGIC, -3.0, -100, -20, -10) arr1 = { {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, 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, 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, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 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0, 0, 0, 1}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, } local area1 = createCombatArea(arr1) local area2 = createCombatArea(arr2) local area3 = createCombatArea(arr3) local area4 = createCombatArea(arr4) local area5 = createCombatArea(arr5) local area6 = createCombatArea(arr6) local area7 = createCombatArea(arr7) local area8 = createCombatArea(arr8) local area9 = createCombatArea(arr9) local area10 = createCombatArea(arr10) local area11 = createCombatArea(arr11) local area12 = createCombatArea(arr12) local area13 = createCombatArea(arr13) local area14 = createCombatArea(arr14) local area15 = createCombatArea(arr15) local area16 = createCombatArea(arr16) local area17 = createCombatArea(arr17) local area18 = createCombatArea(arr18) local area19 = createCombatArea(arr19) local area20 = createCombatArea(arr20) setCombatArea(combat1, area1) setCombatArea(combat2, area2) setCombatArea(combat3, area3) setCombatArea(combat4, area4) setCombatArea(combat5, area5) setCombatArea(combat6, area6) setCombatArea(combat7, area7) setCombatArea(combat8, area8) setCombatArea(combat9, area9) setCombatArea(combat10, area10) setCombatArea(combat11, area11) setCombatArea(combat12, area12) setCombatArea(combat13, area13) setCombatArea(combat14, area14) setCombatArea(combat15, area15) setCombatArea(combat16, area16) setCombatArea(combat17, area17) setCombatArea(combat18, area18) setCombatArea(combat19, area19) setCombatArea(combat20, area20) local function onCastSpell1(parameters) doCombat(parameters.cid, parameters.combat1, parameters.var) end local function onCastSpell2(parameters) doCombat(parameters.cid, parameters.combat2, parameters.var) end local function onCastSpell3(parameters) doCombat(parameters.cid, parameters.combat3, parameters.var) end local function onCastSpell4(parameters) doCombat(parameters.cid, parameters.combat4, parameters.var) end local function onCastSpell5(parameters) doCombat(parameters.cid, parameters.combat5, parameters.var) end local function onCastSpell6(parameters) doCombat(parameters.cid, parameters.combat6, parameters.var) end local function onCastSpell7(parameters) doCombat(parameters.cid, parameters.combat7, parameters.var) end local function onCastSpell8(parameters) doCombat(parameters.cid, parameters.combat8, parameters.var) end local function onCastSpell9(parameters) doCombat(parameters.cid, parameters.combat9, parameters.var) end local function onCastSpell10(parameters) doCombat(parameters.cid, parameters.combat10, parameters.var) end local function onCastSpell11(parameters) doCombat(parameters.cid, parameters.combat11, parameters.var) end local function onCastSpell12(parameters) doCombat(parameters.cid, parameters.combat12, parameters.var) end local function onCastSpell13(parameters) doCombat(parameters.cid, parameters.combat13, parameters.var) end local function onCastSpell14(parameters) doCombat(parameters.cid, parameters.combat14, parameters.var) end local function onCastSpell15(parameters) doCombat(parameters.cid, parameters.combat15, parameters.var) end local function onCastSpell16(parameters) doCombat(parameters.cid, parameters.combat16, parameters.var) end local function onCastSpell17(parameters) doCombat(parameters.cid, parameters.combat17, parameters.var) end local function onCastSpell18(parameters) doCombat(parameters.cid, parameters.combat18, parameters.var) end local function onCastSpell19(parameters) doCombat(parameters.cid, parameters.combat19, parameters.var) end local function onCastSpell20(parameters) doCombat(parameters.cid, parameters.combat20, parameters.var) end function onCastSpell(cid, var) doSendAnimatedText(getPlayerPosition(cid), "Just GOD", TEXTCOLOR_GREEN) local parameters = { cid = cid, var = var, combat1 = combat1, combat2 = combat2, combat3 = combat3, combat4 = combat4, combat5 = combat5, combat6 = combat6, combat7 = combat7, combat8 = combat8, combat9 = combat9, combat10 = combat10, combat11 = combat11, combat12 = combat12, combat13 = combat13, combat14 = combat14, combat15 = combat15, combat16 = combat16, combat17 = combat17, combat18 = combat18, combat19 = combat19, combat20 = combat20 } addEvent(onCastSpell1, 0, parameters) addEvent(onCastSpell2, 100, parameters) addEvent(onCastSpell3, 200, parameters) addEvent(onCastSpell4, 300, parameters) addEvent(onCastSpell5, 400, parameters) addEvent(onCastSpell6, 300, parameters) addEvent(onCastSpell7, 400, parameters) addEvent(onCastSpell8, 500, parameters) addEvent(onCastSpell9, 600, parameters) addEvent(onCastSpell10, 700, parameters) addEvent(onCastSpell11, 600, parameters) addEvent(onCastSpell12, 700, parameters) addEvent(onCastSpell13, 800, parameters) addEvent(onCastSpell14, 900, parameters) addEvent(onCastSpell15, 1000, parameters) addEvent(onCastSpell16, 900, parameters) addEvent(onCastSpell17, 1000, parameters) addEvent(onCastSpell18, 1100, parameters) addEvent(onCastSpell19, 1200, parameters) addEvent(onCastSpell20, 1300, parameters) end
-
Cara, n vi nem uma mudança do 8.50 para esse 8.54, pra falar averdade, chego uma epoca que todo mundo usava esse mapa, mapa de avanço, se quize ir no banheiro va no teleport, meu, nem a decoração mudo direito. Agora ja enjuo esse mapa de TP's! e alem do mais, e editado... Cara seria legal se tu fizesse um mapa estilo do alissow, MASSSS, como Youruts, que pegue em computadores que não aguentam muito. So oq peço Flws
-
affz meo tdo mundo da certo n meu n da, mudei 30 coisas q vc disseram, nada melhorrou preciso de ajuda, e quando consigo em algum forum o cra escreve, "sanei a duvida pelo msn", pqp q raiva o cra n podia ter dito EDITED___--- descobri o meu erro haleluia!!! OT - Sql: é assim vai em data/functions -->Bloco de notas apaga tudo e poe isso: function doPlayerGiveItem(cid, itemid, amount, subType) local item = 0 if(isItemStackable(itemid) == TRUE) then item = doCreateItemEx(itemid, amount) if(doPlayerAddItemEx(cid, item, TRUE) ~= RETURNVALUE_NOERROR) then return LUA_ERROR end else for i = 1, amount do item = doCreateItemEx(itemid, subType) if(doPlayerAddItemEx(cid, item, TRUE) ~= RETURNVALUE_NOERROR) then return LUA_ERROR end end end return LUA_NO_ERROR end function doPlayerTakeItem(cid, itemid, amount) if(getPlayerItemCount(cid, itemid) < amount or doPlayerRemoveItem(cid, itemid, amount) ~= TRUE) then return LUA_ERROR end return LUA_NO_ERROR end function doPlayerBuyItem(cid, itemid, count, cost, charges) if(doPlayerRemoveMoney(cid, cost) ~= TRUE) then return LUA_ERROR end return doPlayerGiveItem(cid, itemid, count, charges) end function doPlayerBuyItemContainer(cid, containerid, itemid, count, cost, charges) if(doPlayerRemoveMoney(cid, cost) ~= TRUE) then return LUA_ERROR end for i = 1, count do local container = doCreateItemEx(containerid, 1) for x = 1, getContainerCapById(containerid) do doAddContainerItem(container, itemid, charges) end if(doPlayerAddItemEx(cid, container, TRUE) ~= RETURNVALUE_NOERROR) then return LUA_ERROR end end return LUA_NO_ERROR end function doPlayerSellItem(cid, itemid, count, cost) if(doPlayerTakeItem(cid, itemid, count) ~= LUA_NO_ERROR) then return LUA_ERROR end if(doPlayerAddMoney(cid, cost) ~= TRUE) then error('Could not add money to: ' .. getPlayerName(cid) .. ' (' .. cost .. 'gp).') end return LUA_NO_ERROR end function isInRange(pos, fromPos, toPos) return (pos.x >= fromPos.x and pos.y >= fromPos.y and pos.z >= fromPos.z and pos.x <= toPos.x and pos.y <= toPos.y and pos.z <= toPos.z) and TRUE or FALSE end function isPremium(cid) return (isPlayer(cid) == TRUE and (getPlayerPremiumDays(cid) > 0 or getConfigInfo('freePremium') == "yes")) and TRUE or FALSE end function getMonthDayEnding(day) if day == "01" or day == "21" or day == "31" then return "st" elseif day == "02" or day == "22" then return "nd" elseif day == "03" or day == "23" then return "rd" else return "th" end end function getMonthString(m) return os.date("%B", os.time{year = 1970, month = m, day = 1}) end function getArticle(str) return str:find("[AaEeIiOoUuYy]") == 1 and "an" or "a" end function isNumber(str) return tonumber(str) ~= nil and TRUE or FALSE end function getDistanceBetween(firstPosition, secondPosition) local xDif = math.abs(firstPosition.x - secondPosition.x) local yDif = math.abs(firstPosition.y - secondPosition.y) local posDif = math.max(xDif, yDif) if(firstPosition.z ~= secondPosition.z) then posDif = posDif + 9 + 6 end return posDif end function doPlayerAddAddons(cid, addon) for i = 0, table.maxn(maleOutfits) do doPlayerAddOutfit(cid, maleOutfits[i], addon) end for i = 0, table.maxn(femaleOutfits) do doPlayerAddOutfit(cid, femaleOutfits[i], addon) end end function isSorcerer(cid) if(isPlayer(cid) == FALSE) then debugPrint("isSorcerer: Jogador nao encontrado.") return false end return (isInArray({1,5,9}, getPlayerVocation(cid)) == TRUE) end function isDruid(cid) if(isPlayer(cid) == FALSE) then debugPrint("isDruid: Jogador nao encontrado.") return false end return (isInArray({2,6,10}, getPlayerVocation(cid)) == TRUE) end function isPaladin(cid) if(isPlayer(cid) == FALSE) then debugPrint("isPaladin: Jogador nao encontrado.") return false end return (isInArray({3,7,11}, getPlayerVocation(cid)) == TRUE) end function isKnight(cid) if(isPlayer(cid) == FALSE) then debugPrint("isKnight: Jogador nao encontrado.") return false end return (isInArray({4,8,12}, getPlayerVocation(cid)) == TRUE) end function isRookie(cid) if(isPlayer(cid) == FALSE) then debugPrint("isRookie: Jogador nao encontrado.") return false end return (isInArray({0}, getPlayerVocation(cid)) == TRUE) end function getDirectionTo(pos1, pos2) local dir = NORTH if(pos1.x > pos2.x) then dir = WEST if(pos1.y > pos2.y) then dir = NORTHWEST elseif(pos1.y < pos2.y) then dir = SOUTHWEST end elseif(pos1.x < pos2.x) then dir = EAST if(pos1.y > pos2.y) then dir = NORTHEAST elseif(pos1.y < pos2.y) then dir = SOUTHEAST end else if(pos1.y > pos2.y) then dir = NORTH elseif(pos1.y < pos2.y) then dir = SOUTH end end return dir end function getPlayerLookPos(cid) return getPosByDir(getThingPos(cid), getPlayerLookDir(cid)) end function getPosByDir(fromPosition, direction, size) local n = size or 1 local pos = fromPosition if(direction == NORTH) then pos.y = pos.y - n elseif(direction == SOUTH) then pos.y = pos.y + n elseif(direction == WEST) then pos.x = pos.x - n elseif(direction == EAST) then pos.x = pos.x + n elseif(direction == NORTHWEST) then pos.y = pos.y - n pos.x = pos.x - n elseif(direction == NORTHEAST) then pos.y = pos.y - n pos.x = pos.x + n elseif(direction == SOUTHWEST) then pos.y = pos.y + n pos.x = pos.x - n elseif(direction == SOUTHEAST) then pos.y = pos.y + n pos.x = pos.x + n end return pos end function getPlayerMoney(cid) return ((getPlayerItemCount(cid, ITEM_CRYSTAL_COIN) * 10000) + (getPlayerItemCount(cid, ITEM_PLATINUM_COIN) * 100) + getPlayerItemCount(cid, ITEM_GOLD_COIN)) end function doPlayerWithdrawAllMoney(cid) return doPlayerWithdrawMoney(cid, getPlayerBalance(cid)) end function doPlayerDepositAllMoney(cid) return doPlayerDepositMoney(cid, getPlayerMoney(cid)) end function doPlayerTransferAllMoneyTo(cid, target) return doPlayerTransferMoneyTo(cid, target, getPlayerBalance(cid)) end function playerExists(name) return getPlayerGUIDByName(name) ~= 0 end function getTibiaTime() local minutes = getWorldTime() local hours = 0 while (minutes > 60) do hours = hours + 1 minutes = minutes - 60 end return {hours = hours, minutes = minutes} end function doWriteLogFile(file, text) local file = io.open(file, "a+") file:write("[" .. os.date("%d/%m/%Y %H:%M:%S") .. "] " .. text .. "\n") file:close() end function getExperienceForLevel(lv) lv = lv - 1 return ((50 * lv * lv * lv) - (150 * lv * lv) + (400 * lv)) / 3 end function doMutePlayer(cid, time) local condition = createConditionObject(CONDITION_MUTED) setConditionParam(condition, CONDITION_PARAM_TICKS, time * 1000) return doAddCondition(cid, condition) end function getPlayerVocationName(cid) return getVocationInfo(getPlayerVocation(cid)).name end function getPromotedVocation(vid) return getVocationInfo(vid).promotedVocation end function doPlayerRemovePremiumDays(cid, days) return doPlayerAddPremiumDays(cid, -days) end function getPlayerMasterPos(cid) return getTownTemplePosition(getPlayerTown(cid)) end function getItemNameById(itemid) return getItemDescriptionsById(itemid).name end function getItemPluralNameById(itemid) return getItemDescriptionsById(itemid).plural end function getItemArticleById(itemid) return getItemDescriptionsById(itemid).article end function getItemName(uid) return getItemDescriptions(uid).name end function getItemPluralName(uid) return getItemDescriptions(uid).plural end function getItemArticle(uid) return getItemDescriptions(uid).article end function getItemText(uid) return getItemDescriptions(uid).text end function getItemWriter(uid) return getItemDescriptions(uid).writer end function getItemDate(uid) return getItemDescriptions(uid).date end function getTilePzInfo(pos) return getTileInfo(pos).protection and TRUE or FALSE end function getTileZoneInfo(pos) local tmp = getTileInfo(pos) if(tmp.pvp) then return 2 end if(tmp.nopvp) then return 1 end return 0 end function debugPrint(text) return io.stdout:write(text) end function doShutdown() return doSetGameState(GAMESTATE_SHUTDOWN) end function doSummonCreature(name, pos) local cid = doCreateMonster(name, pos) if(cid ~= LUA_ERROR) then return cid end cid = doCreateNpc(name, pos) return cid end function getOnlinePlayers() local tmp = getPlayersOnline() local players = {} for i, cid in ipairs(tmp) do table.insert(players, getCreatureName(cid)) end return players end function getPlayerByName(name) local cid = getCreatureByName(name) return isPlayer(cid) == TRUE and cid or nil end function isPlayerGhost(cid) return isPlayer(cid) == TRUE and getCreatureCondition(cid, CONDITION_GAMEMASTER, GAMEMASTER_INVISIBLE) or FALSE end function doPlayerSetExperienceRate(cid, value) return doPlayerSetRate(cid, SKILL__LEVEL, value) end function doPlayerSetMagicRate(cid, value) return doPlayerSetRate(cid, SKILL__MAGLEVEL, value) end function getPlayerFrags(cid) return math.ceil((getPlayerRedSkullTicks(cid) / getConfigInfo('timeToDecreaseFrags')) + 1) end function getPartyLeader(cid) local party = getPartyMembers(cid) if(type(party) ~= 'table') then return 0 end return party[1] end function isInParty(cid) return type(getPartyMembers(cid)) == 'table' and TRUE or FALSE end function isPrivateChannel(channelId) for i = CHANNEL_GUILD, CHANNEL_HELP do if(channelId == i) then return FALSE end end return TRUE end function doConvertIntegerToIp(int, mask) local b4 = bit.urshift(bit.uband(int, 4278190080), 24) local b3 = bit.urshift(bit.uband(int, 16711680), 16) local b2 = bit.urshift(bit.uband(int, 65280), 8) local b1 = bit.urshift(bit.uband(int, 255), 0) if(mask ~= nil) then local m4 = bit.urshift(bit.uband(mask, 4278190080), 24) local m3 = bit.urshift(bit.uband(mask, 16711680), 16) local m2 = bit.urshift(bit.uband(mask, 65280), 8) local m1 = bit.urshift(bit.uband(mask, 255), 0) if((m1 == 255 or m1 == 0) and (m2 == 255 or m2 == 0) and (m3 == 255 or m3 == 0) and (m4 == 255 or m4 == 0)) then if m1 == 0 then b1 = "x" end if m2 == 0 then b2 = "x" end if m3 == 0 then b3 = "x" end if m4 == 0 then b4 = "x" end elseif(m1 ~= 255 or m2 ~= 255 or m3 ~= 255 or m4 ~= 255) then return b1 .. "." .. b2 .. "." .. b3 .. "." .. b4 .. " : " .. m1 .. "." .. m2 .. "." .. m3 .. "." .. m4 end end return b1 .. "." .. b2 .. "." .. b3 .. "." .. b4 end function doConvertIpToInteger(str) local maskindex = str:find(":") if(maskindex == nil) then local ipint = 0 local maskint = 0 local index = 24 for b in str:gmatch("([x%d]+)%.?") do if(b ~= "x") then if(b:find("x") ~= nil) then return 0, 0 end if(tonumber(b) > 255 or tonumber(b) < 0) then return 0, 0 end maskint = bit.ubor(maskint, bit.ulshift(255, index)) ipint = bit.ubor(ipint, bit.ulshift(b, index)) end index = index - 8 if(index < 0) then break end end if(index ~= -8) then return 0, 0 end return ipint, maskint end if(maskindex <= 1) then return 0, 0 end local ipstring = str:sub(1, maskindex - 1) local maskstring = str:sub(maskindex) local ipint = 0 local maskint = 0 local index = 0 for b in ipstring:gmatch("(%d+).?") do if(tonumber(b) > 255 or tonumber(b) < 0) then return 0, 0 end ipint = bit.ubor(ipint, bit.ulshift(b, index)) index = index + 8 if(index > 24) then break end end if(index ~= 32) then return 0, 0 end index = 0 for b in maskstring:gmatch("(%d+)%.?") do if(tonumber(b) > 255 or tonumber(b) < 0) then return 0, 0 end maskint = bit.ubor(maskint, bit.ulshift(b, index)) index = index + 8 if(index > 24) then break end end if(index ~= 32) then return 0, 0 end return ipint, maskint end function getBooleanFromString(str) return (str:lower() == "yes" or str:lower() == "true" or (tonumber(str) and tonumber(str) > 0)) and TRUE or FALSE end function doCopyItem(item, attributes) local attributes = attributes or FALSE local ret = doCreateItemEx(item.itemid, item.type) if(attributes == TRUE) then if(item.actionid > 0) then doSetItemActionId(ret, item.actionid) end end if(isContainer(item.uid) == TRUE) then for i = (getContainerSize(item.uid) - 1), 0, -1 do local tmp = getContainerItem(item.uid, i) if(tmp.itemid > 0) then doAddContainerItemEx(ret, doCopyItem(tmp, TRUE).uid) end end end return getThing(ret) end table.find = function (table, value) for i, v in pairs(table) do if(v == value) then return i end end return nil end table.isStrIn = function (txt, str) for i, v in pairs(str) do if(txt:find(v) and not txt:find('(%w+)' .. v) and not txt:find(v .. '(%w+)')) then return true end end return false end table.countElements = function (table, item) local count = 0 for i, n in pairs(table) do if(item == n) then count = count + 1 end end return count end table.getCombinations = function (table, num) local a, number, select, newlist = {}, #table, num, {} for i = 1, select do a[#a + 1] = i end local newthing = {} while(true) do local newrow = {} for i = 1, select do newrow[#newrow + 1] = table[a[i]] end newlist[#newlist + 1] = newrow i = select while(a[i] == (number - select + i)) do i = i - 1 end if(i < 1) then break end a[i] = a[i] + 1 for j = i, select do a[j] = a[i] + j - i end end return newlist end string.split = function (str) local t = {} local function helper(word) table.insert(t, word) return "" end if(not str:gsub("%w+", helper):find("%S")) then return t end end string.trim = function (str) return (string.gsub(str, "^%s*(.-)%s*$", "%1")) end string.explode = function (str, sep) local pos, t = 1, {} if #sep == 0 or #str == 0 then return end for s, e in function() return str:find(sep, pos) end do table.insert(t, str:sub(pos, s - 1):trim()) pos = e + 1 end table.insert(t, str:sub(pos):trim()) return t end Tinha que por as ID's das vocaçoes, (1,5,9)... Não agradeça, so no botao! kkkk
-
Quem Está Navegando 0 membros estão online
- Nenhum usuário registrado visualizando esta página.