View difference between Paste ID: 4S2Nc59A and 764NU5Y2
SHOW: | | - or go back to the newest paste.
1-
if item.itemid == usando then
1+
function doGoPokemon(cid)
2
3-
   doPlayerSendCancel(cid, '12//,hide') 
3+
4-
   doReturnPokemon(cid) -- Editei aqui
4+
local item = getPlayerSlotItem(cid, 8)	
5
--------
6
   msgunicaback =  backMSG[math.random(#backMSG)]
7-
elseif item.itemid == morto then
7+
   msgunicago = goMSG[math.random(#goMSG)]
8-
       return doPlayerSendCancel(cid, "This pokemon is fainted.")
8+
   btype = getPokeballType(item.itemid)
9
   usando = pokeballs[btype].use
10-
elseif item.itemid == online then
10+
   online = pokeballs[btype].on
11
   morto  = pokeballs[btype].off
12-
      doPlayerSendCancel(cid, '12//,show') 
12+
   if isIconeSystem(cid) then
13-
      addEvent(doUpdateMoves, 50, cid)
13+
      effect = getItemAttribute(item.uid, "effect")
14-
      doGoPokemon(cid)
14+
    else
15
      effect =  getItemAttribute(item.uid, "effect")
16
   end
17
--------
18
19
if isZumbie(cid) or isHuman(cid) then
20
return doPlayerSendCancel(cid, "Sorry, is not possible.")
21
end
22
if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_FEET).uid then
23
	doPlayerSendCancel(cid, "You must put your pokeball in the correct place!")
24
	return TRUE
25
end
26
27
28
if not canSummon(cid) then
29
return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHROOM)
30
end
31
32
if getPlayerStorageValue(cid, 63215) >= 1 then
33
return doPlayerSendCancel(cid, "You can't use pokeball while surfing.")
34
end
35
36
if getPlayerStorageValue(cid, 62314) >= 1 then
37
return doPlayerSendCancel(cid, "You can't use pokeball while flying.")
38
end
39
40
if #getCreatureSummons(cid) >= 1 then
41
return doPlayerSendCancel(cid, "You have already summoned a pokemon.")
42
end
43
44
for i,x in pairs(pokes) do
45
if i == getItemAttribute(item.uid, "poke"):sub(9, findLetter(getItemAttribute(item.uid, "poke"), "'")-1) then
46
47
if getPlayerLevel(cid) < x.level+getPokemonBoostt(item.uid) then
48
doPlayerSendCancel(cid, "You need level "..x.level+getPokemonBoostt(item.uid).." or higher to use this pokemon.")
49
return true
50
end
51
local removed = doCreateItem(1285, 1, getThingPos(cid))
52
local monster = doSummonCreature(i, farAwayPos, false)
53
54
55
--/////////////////////////////////////// Nick system
56
   if string.find(tostring(getCreatureName(monster)), "Shiny") then
57
      local newName = tostring(getCreatureName(monster)):match("Shiny (.*)")   
58
      setCreatureName(monster, newName, "a "..newName..".") 
59
   end
60
   
61
 if getItemAttribute(item.uid, "nick")  then 
62
    setCreatureName(monster, getItemAttribute(item.uid, "nick"), "a "..getItemAttribute(item.uid, "nick")..".") 
63
 end 
64
 --/////////////////////////////////////// Nick system
65
 
66
  local pk = monster
67
  doConvinceCreature(cid, pk)
68
  setPlayerStorageValue(pk, storages.pokeName, i)
69
local pokemonName = getPlayerStorageValue(pk, storages.pokeName)  
70
  
71
  
72
  doTeleportThing(pk, {x = getThingPos(cid).x, y = getThingPos(cid).y+8, z = getThingPos(cid).z})
73
  doTeleportThing(pk, getClosestFreeTile(pk, getThingPos(cid)), false)
74
  doRemoveItem(removed, 1)
75
  doCreatureSetLookDir(pk, 2)
76
  
77
local pokemon = getItemAttribute(item.uid, "nome")
78
local maxh = pokes[pokemon].vida
79
    
80
       if getItemAttribute(item.uid, "ballId") < 0 then
81
          doItemSetAttribute(item.uid, "boost", 0)
82
       end
83
       
84
    local levellife = ((getPlayerLevel(cid)) * 2 + configBoostSystem[getItemAttribute(item.uid, "boost")].hp)
85
    if pokeballStatus[getItemAttribute(item.uid, "ballId")] then
86
    
87
       tabela = {}  -- Status das novas pokebolas
88
       tabela.status = pokeballStatus[getItemAttribute(item.uid, "ballId")].status
89
       tabela.count   = pokeballStatus[getItemAttribute(item.uid, "ballId")].count
90
       tabela.type = pokeballStatus[getItemAttribute(item.uid, "ballId")].type
91
       tabela.type2 = pokeballStatus[getItemAttribute(item.uid, "ballId")].type2
92
       tabela.type3 = pokeballStatus[getItemAttribute(item.uid, "ballId")].type3
93
       levellife = levellife + doChangeStatusBall(pk, tabela)
94
       
95
    end
96
97
    local health = tonumber(getItemAttribute(item.uid, "poke"):match("%[(.-)/"))
98
    doCreatureAddHealth(pk, health-maxh)
99
    local pct = ((getCreatureHealth(pk)) / (getCreatureMaxHealth(pk)))
100
    local vidis = (getCreatureHealth(pk))
101
    setCreatureMaxHealth(pk, ((maxh) + (levellife)))
102
    doCreatureAddHealth(pk, 2)
103
    doCreatureAddHealth(pk, -vidis)
104
    doCreatureAddHealth(pk, ((getCreatureMaxHealth(pk)) * (pct)) - 2)
105
    doTransformItem(item.uid, item.itemid+1)
106
    --doPlayerSendTextMessage(cid, 27, getPokemonMin(getCreatureName(pk)))
107
    
108
local pokename = pokemonName
109
local mgo = msgunicago:gsub("doka", getCreatureName(pk))
110
doCreatureSay(cid, mgo, TALKTYPE_SAY)
111
if math.random(1,100) <= 35 then
112
  setPokemonFeed(cid, getPokemonFeed(cid)-5) -- Food system
113
end
114
doSendFeedEffect(cid)
115
if getItemAttribute(item.uid, "nome") ~= "Ditto" then
116
for i = 1, 12 do
117
if not getMoveNamee(cid, i) then
118
addEvent(doGoBackSetCooldown, 200, cid)
119
end
120
end
121
else
122
for a = 1, 12 do 
123
  setPokemonCooldown(cid, a, "Don't have this move.")
124
end
125
end 
126
doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke"):sub(1, findLetter(getItemAttribute(item.uid, "poke"), ".")))
127
doItemSetAttribute(item.uid, "pokes", ""..pokename.."")
128
doSendMagicEffect(getCreaturePosition(pk), effect)
129
setPlayerStorageValue(cid, 61204, 1)
130
registerCreatureEvent(pk, "DiePoke")
131
registerCreatureEvent(pk, "Exp")
132
doPlayerSendTextMessage(cid, 27, getItemAttribute(item.uid, "task"))
133
adjustWildPoke(pk, item.uid)
134
doSendFeedEffect(cid)
135
--------
136
137
	------------------------passiva hitmonchan------------------------------
138
	if isSummon(pk) then                                                  --alterado v1.8 \/
139
       if pokemonName == "Elite Hitmonchan" or pokemonName == "Hitmonchan" then
140
          if not getItemAttribute(item.uid, "hands") then
141
             doItemSetAttribute(item.uid, "hands", 0)
142
          end
143
          local hands = getItemAttribute(item.uid, "hands")
144
          doSetCreatureOutfit(pk, {lookType = hitmonchans[getCreatureName(pk)][hands].out}, -1)
145
       end
146
    end
147
	-------------------------------------------------------------------------
148
	    ---------movement magmar, jynx-------------
149
    if EFFECTS[pokemonName] then           
150
       markPosEff(pk, getThingPos(pk))
151
       sendMovementEffect(pk, EFFECTS[pokemonName], getThingPos(pk))  
152
    end
153
    if getItemAttribute(item.uid, "boost") >= 20 and getItemAttribute(item.uid, "auras") then
154
       sendAuraEffect(getCreatureSummons(cid)[1], auras[getItemAttribute(item.uid, "auras")]) 
155
    end
156
    --------------------------------------------------------------------------
157
    ------------- addon system ----------------------
158
     if getItemAttribute(item.uid, "addonNow") then
159
       if getItemAttribute(item.uid, "color1") then
160
        local color1, color2, color3, color4 = getItemAttribute(item.uid, "color1"), getItemAttribute(item.uid, "color2"), getItemAttribute(item.uid, "color3"), getItemAttribute(item.uid, "color4")
161
        doCreatureChangeOutfit(pk, {lookType = getItemAttribute(item.uid, "addonNow"), lookBody = color1, lookHead = color2, lookLegs = color3, lookFeet = color4})
162
       else
163
        doCreatureChangeOutfit(pk, {lookType = getItemAttribute(item.uid, "addonNow")})
164
       end 
165
     end
166
    ------------- addon system ---------------------
167
              
168
169
    if getPlayerStorageValue(cid, 6598754) >= 1 then
170
       doCreatureSetSkullType(pk, 3) -- Identificador de times, time vermelho
171
    elseif getPlayerStorageValue(cid, 6598755) >= 1 then
172
       doCreatureSetSkullType(pk, 4) -- Identificador de times, time azull
173
    end
174
    
175
176
if getPlayerStorageValue(cid, 991) >= 1 then  --- Ginasios 
177
   doSendAnimatedText(getThingPos(cid), "POKEIN", COLOR_ICE)
178
end 
179
    ------------- ditto system ----------------------     
180
     if pokemonName == "Ditto" then
181
       if getItemAttribute(item.uid, "dittoName") then
182
            doCreatureChangeOutfit(pk, {lookType = getItemAttribute(item.uid, "dittoOut")}) 
183
            setPlayerStorageValue(pk, storages.pokeName, getItemAttribute(item.uid, "dittoName"))
184
       end
185
     elseif pokemonName == "Shiny Ditto" then
186
      if not getItemAttribute(item.uid, "dittoName") or tonumber(getItemAttribute(item.uid, "dittoName")) and getItemAttribute(item.uid, "dittoName") <= 0 then
187
            local out, out1 = getCreatureOutfit(pk), getCreatureOutfit(cid)
188
            doCreatureChangeOutfit(pk, {lookType = out.lookType, lookLegs = out1.lookBody}) 
189
190
       else
191
            doCreatureChangeOutfit(pk, {lookType = getItemAttribute(item.uid, "dittoOut"), lookLegs = getCreatureOutfit(cid).lookBody}) 
192
            setPlayerStorageValue(pk, storages.pokeName, getItemAttribute(item.uid, "dittoName"))
193
            
194
       end
195
     end
196
     
197
      if getItemAttribute(item.uid, "nome") == "Smeargle" then
198
         setPlayerStorageValue(pk, storages.pokeName, getItemAttribute(item.uid, "smeargleName"))
199
      end
200
     ------------- ditto system ---------------------- 
201
      ------------- uknown system ----------------------  
202
       if pokemonName == "Uknown" then 
203
          local roupas = {721, 722, 723, 724}
204
          doCreatureChangeOutfit(pk, {lookType = roupas[math.random(#roupas)]}) 
205
          doSendMagicEffect(getThingPos(pk), 211)
206
       end
207
       
208
            
209
210
break
211
end
212
end
213
end