Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function getSubName(cid, target)
- if not isCreature(cid) then return "" end
- if getCreatureName(cid) == "Ditto" and pokes[getPlayerStorageValue(cid, 1010)] and getPlayerStorageValue(cid, 1010) ~= "Ditto" then
- return getPlayerStorageValue(cid, 1010)
- elseif pokeHaveReflect(cid) and isCreature(target) then
- return getCreatureName(target)
- else --alterado v1.6.1
- return getCreatureName(cid)
- end
- end
- local function getThingName(cid)
- if not isCreature(cid) then return "" end --alterado v1.6
- return getCreatureName(cid)
- end
- function getTableMove(cid, move) --alterado v1.6
- local backup = {f = 0, t = ""}
- if getThingName(cid) == "Ditto" and pokes[getPlayerStorageValue(cid, 1010)] and getPlayerStorageValue(cid, 1010) ~= "Ditto" then
- name = getPlayerStorageValue(cid, 1010)
- else
- name = getThingName(cid)
- end
- if not isCreature(cid) or name == "" or not move then return backup end
- local x = movestable[name]
- if not x then return "" end
- local z = {x.move1, x.move2, x.move3, x.move4, x.move5, x.move6, x.move7, x.move8, x.move9, x.move10, x.move11, x.move12, x.passive1, x.passive2, x.passive3}
- if getPlayerStorageValue(cid, 21103) ~= -1 then
- local sto = getPlayerStorageValue(cid, 21103)
- setPlayerStorageValue(cid, 21103, -1)
- return {f = sto, t = ""}
- end
- for j = 1, 15 do
- if z[j] and z[j].name == move then
- return z[j]
- end
- end
- return movesinfo[move]
- end
- function getMasterTarget(cid)
- if isCreature(cid) and getPlayerStorageValue(cid, 21101) ~= -1 then
- return getPlayerStorageValue(cid, 21101) --alterado v1.6
- end
- if isSummon(cid) then
- return getCreatureTarget(getCreatureMaster(cid))
- else
- return getCreatureTarget(cid)
- end
- end
- --////////////////////////////////////////////////////////////////////////////////////////////////////////--
- function docastspell(cid, spell, mina, maxa)
- local target = 0
- local getDistDelay = 0
- if not isCreature(cid) or getCreatureHealth(cid) <= 0 then return false end --alterado v1.6
- if isSleeping(cid) and getPlayerStorageValue(cid, 21100) <= -1 then return true end --alterado v1.6
- if isCreature(getMasterTarget(cid)) then
- target = getMasterTarget(cid)
- getDistDelay = getDistanceBetween(getThingPosWithDebug(cid), getThingPosWithDebug(target)) * const_distance_delay
- end
- if isMonster(cid) and not isSummon(cid) then
- if getCreatureCondition(cid, CONDITION_EXHAUST) then
- return true
- end
- doCreatureAddCondition(cid, wildexhaust)
- end
- local mydir = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
- local table = getTableMove(cid, spell) --alterado v1.6
- local min = 0
- local max = 0
- --alterado v1.7 \/\/
- if ehMonstro(cid) and isCreature(getMasterTarget(cid)) and isInArray(specialabilities["evasion"], getCreatureName(getMasterTarget(cid))) then
- local target = getMasterTarget(cid)
- if math.random(1, 100) <= passivesChances["Evasion"][getCreatureName(target)] then
- if isCreature(getMasterTarget(target)) then --alterado v1.6
- doSendMagicEffect(getThingPosWithDebug(target), 211)
- doSendAnimatedText(getThingPosWithDebug(target), "TOO BAD", 215)
- doTeleportThing(target, getClosestFreeTile(target, getThingPosWithDebug(cid)), false)
- doSendMagicEffect(getThingPosWithDebug(target), 211)
- doFaceCreature(target, getThingPosWithDebug(cid))
- return false --alterado v1.8
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement