| @@ -0,0 +1,414 @@ | |||
| 1 | + | local SEQUEN_NUMB_1 = {} | |
| 2 | + | local SEQUEN_NUMB_2 = {} | |
| 3 | + | local SEQUEN_NUMB_3 = {} | |
| 4 | + | local QNT_SQN_1 = 0 | |
| 5 | + | local QNT_SQN_2 = 0 | |
| 6 | + | local QNT_SQN_3 = 0 | |
| 7 | + | local LOCK_STATUES_1 = false | |
| 8 | + | local LOCK_STATUES_2 = false | |
| 9 | + | local LOCK_STATUES_3 = false | |
| 10 | + | local STATUES_POS_1 = { | |
| 11 | + | [01] = {POS = {x=3954, y=1237, z=14}}; | |
| 12 | + | [02] = {POS = {x=3956, y=1237, z=14}}; | |
| 13 | + | [03] = {POS = {x=3958, y=1237, z=14}}; | |
| 14 | + | [04] = {POS = {x=3958, y=1243, z=14}}; | |
| 15 | + | [05] = {POS = {x=3956, y=1243, z=14}}; | |
| 16 | + | [06] = {POS = {x=3954, y=1243, z=14}}; | |
| 17 | + | } | |
| 18 | + | local STATUES_POS_2 = { | |
| 19 | + | [01] = {POS = {x=4062, y=1237, z=14}}; | |
| 20 | + | [02] = {POS = {x=4064, y=1237, z=14}}; | |
| 21 | + | [03] = {POS = {x=4066, y=1237, z=14}}; | |
| 22 | + | [04] = {POS = {x=4066, y=1243, z=14}}; | |
| 23 | + | [05] = {POS = {x=4064, y=1243, z=14}}; | |
| 24 | + | [06] = {POS = {x=4062, y=1243, z=14}}; | |
| 25 | + | } | |
| 26 | + | local STATUES_POS_3 = { | |
| 27 | + | [01] = {POS = {x=4170, y=1237, z=14}}; | |
| 28 | + | [02] = {POS = {x=4172, y=1237, z=14}}; | |
| 29 | + | [03] = {POS = {x=4174, y=1237, z=14}}; | |
| 30 | + | [04] = {POS = {x=4174, y=1243, z=14}}; | |
| 31 | + | [05] = {POS = {x=4172, y=1243, z=14}}; | |
| 32 | + | [06] = {POS = {x=4170, y=1243, z=14}}; | |
| 33 | + | } | |
| 34 | + | local STATUES_CLICK = { | |
| 35 | + | [10512] = {UID = 10509, ACT = 01}; | |
| 36 | + | [10513] = {UID = 10509, ACT = 02}; | |
| 37 | + | [10514] = {UID = 10509, ACT = 03}; | |
| 38 | + | [10515] = {UID = 10509, ACT = 04}; | |
| 39 | + | [10516] = {UID = 10509, ACT = 05}; | |
| 40 | + | [10517] = {UID = 10509, ACT = 06}; | |
| 41 | + | ||
| 42 | + | [10518] = {UID = 10510, ACT = 01}; | |
| 43 | + | [10519] = {UID = 10510, ACT = 02}; | |
| 44 | + | [10520] = {UID = 10510, ACT = 03}; | |
| 45 | + | [10521] = {UID = 10510, ACT = 04}; | |
| 46 | + | [10522] = {UID = 10510, ACT = 05}; | |
| 47 | + | [10523] = {UID = 10510, ACT = 06}; | |
| 48 | + | ||
| 49 | + | [10524] = {UID = 10511, ACT = 01}; | |
| 50 | + | [10525] = {UID = 10511, ACT = 02}; | |
| 51 | + | [10526] = {UID = 10511, ACT = 03}; | |
| 52 | + | [10527] = {UID = 10511, ACT = 04}; | |
| 53 | + | [10528] = {UID = 10511, ACT = 05}; | |
| 54 | + | [10529] = {UID = 10511, ACT = 06}; | |
| 55 | + | } | |
| 56 | + | ||
| 57 | + | function onUse(player, item, fromPosition, target, toPosition, isHotkey) | |
| 58 | + | local STORAGE_BONEBROOK = _SYSTEM.DANGEROUS[03][01].STORAGE | |
| 59 | + | local party = player:getParty() | |
| 60 | + | if STATUES_CLICK[item.uid] then | |
| 61 | + | if STATUES_CLICK[item.uid].UID == 10509 then | |
| 62 | + | if LOCK_STATUES_1 then | |
| 63 | + | if STATUES_CLICK[item.uid].ACT == SEQUEN_NUMB_1[01] then | |
| 64 | + | table.remove(SEQUEN_NUMB_1, 01) | |
| 65 | + | player:getPosition():sendMagicEffect(13) | |
| 66 | + | ||
| 67 | + | if #SEQUEN_NUMB_1 == 0 then | |
| 68 | + | LOCK_STATUES_1 = false | |
| 69 | + | if not party then | |
| 70 | + | player:say("Voce acertou a sequencia!", TALKTYPE_MONSTER_SAY) | |
| 71 | + | player:setStorageValue(STORAGE_BONEBROOK, (player:getStorageValue(STORAGE_BONEBROOK) + 1)) | |
| 72 | + | player:getPosition():sendMagicEffect(13) | |
| 73 | + | else | |
| 74 | + | local members = party:getMembers() | |
| 75 | + | members[#members + 1] = party:getLeader() | |
| 76 | + | for _, member in ipairs(members) do | |
| 77 | + | member:say("Voce acertou a sequencia!", TALKTYPE_MONSTER_SAY) | |
| 78 | + | member:setStorageValue(STORAGE_BONEBROOK, (member:getStorageValue(STORAGE_BONEBROOK) + 1)) | |
| 79 | + | member:getPosition():sendMagicEffect(13) | |
| 80 | + | end | |
| 81 | + | end | |
| 82 | + | end | |
| 83 | + | else | |
| 84 | + | LOCK_STATUES_1 = false | |
| 85 | + | player:say("ErroR!", TALKTYPE_MONSTER_SAY) | |
| 86 | + | player:getPosition():sendMagicEffect(03) | |
| 87 | + | end | |
| 88 | + | else | |
| 89 | + | player:getPosition():sendMagicEffect(03) | |
| 90 | + | end | |
| 91 | + | end | |
| 92 | + | if STATUES_CLICK[item.uid].UID == 10510 then | |
| 93 | + | if LOCK_STATUES_2 then | |
| 94 | + | if STATUES_CLICK[item.uid].ACT == SEQUEN_NUMB_2[01] then | |
| 95 | + | table.remove(SEQUEN_NUMB_2, 01) | |
| 96 | + | player:getPosition():sendMagicEffect(13) | |
| 97 | + | ||
| 98 | + | if #SEQUEN_NUMB_2 == 0 then | |
| 99 | + | LOCK_STATUES_2 = false | |
| 100 | + | if not party then | |
| 101 | + | player:say("Voce acertou a sequencia!", TALKTYPE_MONSTER_SAY) | |
| 102 | + | player:setStorageValue(STORAGE_BONEBROOK, (player:getStorageValue(STORAGE_BONEBROOK) + 1)) | |
| 103 | + | player:getPosition():sendMagicEffect(13) | |
| 104 | + | else | |
| 105 | + | local members = party:getMembers() | |
| 106 | + | members[#members + 1] = party:getLeader() | |
| 107 | + | for _, member in ipairs(members) do | |
| 108 | + | member:say("Voce acertou a sequencia!", TALKTYPE_MONSTER_SAY) | |
| 109 | + | member:setStorageValue(STORAGE_BONEBROOK, (member:getStorageValue(STORAGE_BONEBROOK) + 1)) | |
| 110 | + | member:getPosition():sendMagicEffect(13) | |
| 111 | + | end | |
| 112 | + | end | |
| 113 | + | end | |
| 114 | + | else | |
| 115 | + | LOCK_STATUES_2 = false | |
| 116 | + | player:say("ErroR!", TALKTYPE_MONSTER_SAY) | |
| 117 | + | player:getPosition():sendMagicEffect(03) | |
| 118 | + | end | |
| 119 | + | else | |
| 120 | + | player:getPosition():sendMagicEffect(03) | |
| 121 | + | end | |
| 122 | + | end | |
| 123 | + | if STATUES_CLICK[item.uid].UID == 10511 then | |
| 124 | + | if LOCK_STATUES_3 then | |
| 125 | + | if STATUES_CLICK[item.uid].ACT == SEQUEN_NUMB_3[01] then | |
| 126 | + | table.remove(SEQUEN_NUMB_3, 01) | |
| 127 | + | player:getPosition():sendMagicEffect(13) | |
| 128 | + | ||
| 129 | + | if #SEQUEN_NUMB_3 == 0 then | |
| 130 | + | LOCK_STATUES_3 = false | |
| 131 | + | if not party then | |
| 132 | + | player:say("Voce acertou a sequencia!", TALKTYPE_MONSTER_SAY) | |
| 133 | + | player:setStorageValue(STORAGE_BONEBROOK, (player:getStorageValue(STORAGE_BONEBROOK) + 1)) | |
| 134 | + | player:getPosition():sendMagicEffect(13) | |
| 135 | + | else | |
| 136 | + | local members = party:getMembers() | |
| 137 | + | members[#members + 1] = party:getLeader() | |
| 138 | + | for _, member in ipairs(members) do | |
| 139 | + | member:say("Voce acertou a sequencia!", TALKTYPE_MONSTER_SAY) | |
| 140 | + | member:setStorageValue(STORAGE_BONEBROOK, (member:getStorageValue(STORAGE_BONEBROOK) + 1)) | |
| 141 | + | member:getPosition():sendMagicEffect(13) | |
| 142 | + | end | |
| 143 | + | end | |
| 144 | + | end | |
| 145 | + | else | |
| 146 | + | LOCK_STATUES_3 = false | |
| 147 | + | player:say("ErroR!", TALKTYPE_MONSTER_SAY) | |
| 148 | + | player:getPosition():sendMagicEffect(03) | |
| 149 | + | end | |
| 150 | + | else | |
| 151 | + | player:getPosition():sendMagicEffect(03) | |
| 152 | + | end | |
| 153 | + | end | |
| 154 | + | end | |
| 155 | + | ||
| 156 | + | if item.uid == 10509 then | |
| 157 | + | if LOCK_STATUES_1 == false then | |
| 158 | + | if player:getStorageValue(STORAGE_BONEBROOK) == 12 then | |
| 159 | + | QNT_SQN_1 = 05 | |
| 160 | + | if not party then | |
| 161 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Gerando Sequencia Aleatoria\n[ 01/03 ].") | |
| 162 | + | else | |
| 163 | + | local members = party:getMembers() | |
| 164 | + | members[#members + 1] = party:getLeader() | |
| 165 | + | for _, member in ipairs(members) do | |
| 166 | + | member:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Gerando Sequencia Aleatoria\n[ 01/03 ].") | |
| 167 | + | end | |
| 168 | + | end | |
| 169 | + | elseif player:getStorageValue(STORAGE_BONEBROOK) == 13 then | |
| 170 | + | QNT_SQN_1 = 08 | |
| 171 | + | if not party then | |
| 172 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Gerando Sequencia Aleatoria\n[ 02/03 ].") | |
| 173 | + | else | |
| 174 | + | local members = party:getMembers() | |
| 175 | + | members[#members + 1] = party:getLeader() | |
| 176 | + | for _, member in ipairs(members) do | |
| 177 | + | member:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Gerando Sequencia Aleatoria\n[ 02/03 ].") | |
| 178 | + | end | |
| 179 | + | end | |
| 180 | + | elseif player:getStorageValue(STORAGE_BONEBROOK) == 14 then | |
| 181 | + | QNT_SQN_1 = 10 | |
| 182 | + | if not party then | |
| 183 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Gerando Sequencia Aleatoria\n[ 03/03 ].") | |
| 184 | + | else | |
| 185 | + | local members = party:getMembers() | |
| 186 | + | members[#members + 1] = party:getLeader() | |
| 187 | + | for _, member in ipairs(members) do | |
| 188 | + | member:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Gerando Sequencia Aleatoria\n[ 03/03 ].") | |
| 189 | + | end | |
| 190 | + | end | |
| 191 | + | elseif player:getStorageValue(STORAGE_BONEBROOK) == 15 then | |
| 192 | + | if not party then | |
| 193 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Estatua da Zona 04-B liberados.") | |
| 194 | + | player:setStorageValue(STORAGE_BONEBROOK, 16) | |
| 195 | + | player:getPosition():sendMagicEffect(13) | |
| 196 | + | else | |
| 197 | + | local members = party:getMembers() | |
| 198 | + | members[#members + 1] = party:getLeader() | |
| 199 | + | for _, member in ipairs(members) do | |
| 200 | + | member:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Estatua da Zona 04-B liberado.") | |
| 201 | + | member:setStorageValue(STORAGE_BONEBROOK, 16) | |
| 202 | + | member:getPosition():sendMagicEffect(13) | |
| 203 | + | end | |
| 204 | + | end | |
| 205 | + | ||
| 206 | + | LOCK_STATUES_1 = false | |
| 207 | + | return true | |
| 208 | + | else | |
| 209 | + | player:getPosition():sendMagicEffect(03) | |
| 210 | + | LOCK_STATUES_1 = false | |
| 211 | + | return true | |
| 212 | + | end | |
| 213 | + | ||
| 214 | + | LOCK_STATUES_1 = true | |
| 215 | + | if #SEQUEN_NUMB_1 > 0 then | |
| 216 | + | for k in pairs (SEQUEN_NUMB_1) do | |
| 217 | + | SEQUEN_NUMB_1 [k] = nil | |
| 218 | + | end | |
| 219 | + | end | |
| 220 | + | player:getPosition():sendMagicEffect(13) | |
| 221 | + | addEvent(effect_random, 3000, player.uid, 01) | |
| 222 | + | return true | |
| 223 | + | else | |
| 224 | + | player:getPosition():sendMagicEffect(03) | |
| 225 | + | end | |
| 226 | + | end | |
| 227 | + | if item.uid == 10510 then | |
| 228 | + | if LOCK_STATUES_2 == false then | |
| 229 | + | if player:getStorageValue(STORAGE_BONEBROOK) == 12 then | |
| 230 | + | QNT_SQN_2 = 05 | |
| 231 | + | if not party then | |
| 232 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Gerando Sequencia Aleatoria\n[ 01/03 ].") | |
| 233 | + | else | |
| 234 | + | local members = party:getMembers() | |
| 235 | + | members[#members + 1] = party:getLeader() | |
| 236 | + | for _, member in ipairs(members) do | |
| 237 | + | member:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Gerando Sequencia Aleatoria\n[ 01/03 ].") | |
| 238 | + | end | |
| 239 | + | end | |
| 240 | + | elseif player:getStorageValue(STORAGE_BONEBROOK) == 13 then | |
| 241 | + | QNT_SQN_2 = 08 | |
| 242 | + | if not party then | |
| 243 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Gerando Sequencia Aleatoria\n[ 02/03 ].") | |
| 244 | + | else | |
| 245 | + | local members = party:getMembers() | |
| 246 | + | members[#members + 1] = party:getLeader() | |
| 247 | + | for _, member in ipairs(members) do | |
| 248 | + | member:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Gerando Sequencia Aleatoria\n[ 02/03 ].") | |
| 249 | + | end | |
| 250 | + | end | |
| 251 | + | elseif player:getStorageValue(STORAGE_BONEBROOK) == 14 then | |
| 252 | + | QNT_SQN_2 = 10 | |
| 253 | + | if not party then | |
| 254 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Gerando Sequencia Aleatoria\n[ 03/03 ].") | |
| 255 | + | else | |
| 256 | + | local members = party:getMembers() | |
| 257 | + | members[#members + 1] = party:getLeader() | |
| 258 | + | for _, member in ipairs(members) do | |
| 259 | + | member:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Gerando Sequencia Aleatoria\n[ 03/03 ].") | |
| 260 | + | end | |
| 261 | + | end | |
| 262 | + | elseif player:getStorageValue(STORAGE_BONEBROOK) == 15 then | |
| 263 | + | if not party then | |
| 264 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Estatua da Zona 04-B liberados.") | |
| 265 | + | player:setStorageValue(STORAGE_BONEBROOK, 16) | |
| 266 | + | player:getPosition():sendMagicEffect(13) | |
| 267 | + | else | |
| 268 | + | local members = party:getMembers() | |
| 269 | + | members[#members + 1] = party:getLeader() | |
| 270 | + | for _, member in ipairs(members) do | |
| 271 | + | member:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Estatua da Zona 04-B liberado.") | |
| 272 | + | member:setStorageValue(STORAGE_BONEBROOK, 16) | |
| 273 | + | member:getPosition():sendMagicEffect(13) | |
| 274 | + | end | |
| 275 | + | end | |
| 276 | + | ||
| 277 | + | LOCK_STATUES_2 = false | |
| 278 | + | return true | |
| 279 | + | else | |
| 280 | + | player:getPosition():sendMagicEffect(03) | |
| 281 | + | LOCK_STATUES_2 = false | |
| 282 | + | return true | |
| 283 | + | end | |
| 284 | + | ||
| 285 | + | LOCK_STATUES_2 = true | |
| 286 | + | if #SEQUEN_NUMB_2 > 0 then | |
| 287 | + | for k in pairs (SEQUEN_NUMB_2) do | |
| 288 | + | SEQUEN_NUMB_2 [k] = nil | |
| 289 | + | end | |
| 290 | + | end | |
| 291 | + | player:getPosition():sendMagicEffect(13) | |
| 292 | + | addEvent(effect_random, 3000, player.uid, 02, QNT_SQN_2) | |
| 293 | + | return false | |
| 294 | + | else | |
| 295 | + | player:getPosition():sendMagicEffect(03) | |
| 296 | + | end | |
| 297 | + | end | |
| 298 | + | if item.uid == 10511 then | |
| 299 | + | if LOCK_STATUES_3 == false then | |
| 300 | + | if player:getStorageValue(STORAGE_BONEBROOK) == 12 then | |
| 301 | + | QNT_SQN_3 = 05 | |
| 302 | + | if not party then | |
| 303 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Gerando Sequencia Aleatoria\n[ 01/03 ].") | |
| 304 | + | else | |
| 305 | + | local members = party:getMembers() | |
| 306 | + | members[#members + 1] = party:getLeader() | |
| 307 | + | for _, member in ipairs(members) do | |
| 308 | + | member:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Gerando Sequencia Aleatoria\n[ 01/03 ].") | |
| 309 | + | end | |
| 310 | + | end | |
| 311 | + | elseif player:getStorageValue(STORAGE_BONEBROOK) == 13 then | |
| 312 | + | QNT_SQN_3 = 08 | |
| 313 | + | if not party then | |
| 314 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Gerando Sequencia Aleatoria\n[ 02/03 ].") | |
| 315 | + | else | |
| 316 | + | local members = party:getMembers() | |
| 317 | + | members[#members + 1] = party:getLeader() | |
| 318 | + | for _, member in ipairs(members) do | |
| 319 | + | member:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Gerando Sequencia Aleatoria\n[ 02/03 ].") | |
| 320 | + | end | |
| 321 | + | end | |
| 322 | + | elseif player:getStorageValue(STORAGE_BONEBROOK) == 14 then | |
| 323 | + | QNT_SQN_3 = 10 | |
| 324 | + | if not party then | |
| 325 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Gerando Sequencia Aleatoria\n[ 03/03 ].") | |
| 326 | + | else | |
| 327 | + | local members = party:getMembers() | |
| 328 | + | members[#members + 1] = party:getLeader() | |
| 329 | + | for _, member in ipairs(members) do | |
| 330 | + | member:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Gerando Sequencia Aleatoria\n[ 03/03 ].") | |
| 331 | + | end | |
| 332 | + | end | |
| 333 | + | elseif player:getStorageValue(STORAGE_BONEBROOK) == 15 then | |
| 334 | + | if not party then | |
| 335 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Estatua da Zona 04-B liberados.") | |
| 336 | + | player:setStorageValue(STORAGE_BONEBROOK, 16) | |
| 337 | + | player:getPosition():sendMagicEffect(13) | |
| 338 | + | else | |
| 339 | + | local members = party:getMembers() | |
| 340 | + | members[#members + 1] = party:getLeader() | |
| 341 | + | for _, member in ipairs(members) do | |
| 342 | + | member:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Estatua da Zona 04-B liberado.") | |
| 343 | + | member:setStorageValue(STORAGE_BONEBROOK, 16) | |
| 344 | + | member:getPosition():sendMagicEffect(13) | |
| 345 | + | end | |
| 346 | + | end | |
| 347 | + | ||
| 348 | + | LOCK_STATUES_3 = false | |
| 349 | + | return true | |
| 350 | + | else | |
| 351 | + | player:getPosition():sendMagicEffect(03) | |
| 352 | + | LOCK_STATUES_3 = false | |
| 353 | + | return true | |
| 354 | + | end | |
| 355 | + | ||
| 356 | + | LOCK_STATUES_3 = true | |
| 357 | + | if #SEQUEN_NUMB_3 > 0 then | |
| 358 | + | for k in pairs (SEQUEN_NUMB_3) do | |
| 359 | + | SEQUEN_NUMB_3 [k] = nil | |
| 360 | + | end | |
| 361 | + | end | |
| 362 | + | player:getPosition():sendMagicEffect(13) | |
| 363 | + | addEvent(effect_random, 3000, player.uid, 03, QNT_SQN_3) | |
| 364 | + | return false | |
| 365 | + | else | |
| 366 | + | player:getPosition():sendMagicEffect(03) | |
| 367 | + | end | |
| 368 | + | end | |
| 369 | + | end | |
| 370 | + | ||
| 371 | + | function effect_random(creature, id) | |
| 372 | + | local player = Player(creature) | |
| 373 | + | if id == 01 then | |
| 374 | + | if QNT_SQN_1 > 0 then | |
| 375 | + | QNT_SQN_1 = QNT_SQN_1 - 1 | |
| 376 | + | local CLICK_RANDOM = math.random(01, #STATUES_POS_1) | |
| 377 | + | local POSITION_STATUES = Position(STATUES_POS_1[CLICK_RANDOM].POS.x, STATUES_POS_1[CLICK_RANDOM].POS.y, 14) | |
| 378 | + | POSITION_STATUES:sendMagicEffect(CONST_ME_TELEPORT) | |
| 379 | + | ||
| 380 | + | table.insert(SEQUEN_NUMB_1, CLICK_RANDOM) | |
| 381 | + | addEvent(effect_random, 1000, player.uid, id) | |
| 382 | + | return true | |
| 383 | + | else | |
| 384 | + | player:say("Sequencia Finalizada.", TALKTYPE_MONSTER_SAY) | |
| 385 | + | return true | |
| 386 | + | end | |
| 387 | + | end | |
| 388 | + | if id == 02 then | |
| 389 | + | if QNT_SQN_2 > 0 then | |
| 390 | + | QNT_SQN_2 = QNT_SQN_2 - 1 | |
| 391 | + | local CLICK_RANDOM = math.random(01, #STATUES_POS_2) | |
| 392 | + | local POSITION_STATUES = Position(STATUES_POS_2[CLICK_RANDOM].POS.x, STATUES_POS_2[CLICK_RANDOM].POS.y, 14) | |
| 393 | + | POSITION_STATUES:sendMagicEffect(CONST_ME_TELEPORT) | |
| 394 | + | ||
| 395 | + | table.insert(SEQUEN_NUMB_2, CLICK_RANDOM) | |
| 396 | + | addEvent(effect_random, 1000, player.uid, id) | |
| 397 | + | else | |
| 398 | + | player:say("Sequencia Finalizada.", TALKTYPE_MONSTER_SAY) | |
| 399 | + | end | |
| 400 | + | end | |
| 401 | + | if id == 03 then | |
| 402 | + | if QNT_SQN_3 > 0 then | |
| 403 | + | QNT_SQN_3 = QNT_SQN_3 - 1 | |
| 404 | + | local CLICK_RANDOM = math.random(01, #STATUES_POS_3) | |
| 405 | + | local POSITION_STATUES = Position(STATUES_POS_3[CLICK_RANDOM].POS.x, STATUES_POS_3[CLICK_RANDOM].POS.y, 14) | |
| 406 | + | POSITION_STATUES:sendMagicEffect(CONST_ME_TELEPORT) | |
| 407 | + | ||
| 408 | + | table.insert(SEQUEN_NUMB_3, CLICK_RANDOM) | |
| 409 | + | addEvent(effect_random, 1000, player.uid, id) | |
| 410 | + | else | |
| 411 | + | player:say("Sequencia Finalizada.", TALKTYPE_MONSTER_SAY) | |
| 412 | + | end | |
| 413 | + | end | |
| 414 | + | end |
| @@ -0,0 +1,81 @@ | |||
| 1 | + | function onUse(player, item, fromPosition, target, toPosition, isHotkey) | |
| 2 | + | local DG_SUNSET = { | |
| 3 | + | [10320] = { | |
| 4 | + | [01] = {FROM = {x=3939, y=1466, z=14}, TO = {x=3950, y=1478, z=14}, MONSTER = ""}; | |
| 5 | + | [02] = {FROM = {x=3939, y=1444, z=14}, TO = {x=3956, y=1457, z=14}, MONSTER = ""}; | |
| 6 | + | [03] = {FROM = {x=3939, y=1422, z=14}, TO = {x=3951, y=1434, z=14}, MONSTER = ""}; | |
| 7 | + | [04] = {FROM = {x=3988, y=1422, z=14}, TO = {x=4000, y=1434, z=14}, MONSTER = ""}; | |
| 8 | + | [05] = {FROM = {x=3982, y=1444, z=14}, TO = {x=4000, y=1456, z=14}, MONSTER = ""}; | |
| 9 | + | [06] = {FROM = {x=3988, y=1466, z=14}, TO = {x=4001, y=1479, z=14}, MONSTER = ""}; | |
| 10 | + | }; | |
| 11 | + | [10562] = { | |
| 12 | + | [01] = {FROM = {x=4025, y=1466, z=14}, TO = {x=4036, y=1478, z=14}, MONSTER = ""}; | |
| 13 | + | [02] = {FROM = {x=4025, y=1444, z=14}, TO = {x=4042, y=1457, z=14}, MONSTER = ""}; | |
| 14 | + | [03] = {FROM = {x=4025, y=1422, z=14}, TO = {x=4037, y=1434, z=14}, MONSTER = ""}; | |
| 15 | + | [04] = {FROM = {x=4074, y=1422, z=14}, TO = {x=4086, y=1434, z=14}, MONSTER = ""}; | |
| 16 | + | [05] = {FROM = {x=4068, y=1444, z=14}, TO = {x=4086, y=1456, z=14}, MONSTER = ""}; | |
| 17 | + | [06] = {FROM = {x=4074, y=1466, z=14}, TO = {x=4087, y=1479, z=14}, MONSTER = ""}; | |
| 18 | + | }; | |
| 19 | + | [10563] = { | |
| 20 | + | [01] = {FROM = {x=4111, y=1466, z=14}, TO = {x=4122, y=1478, z=14}, MONSTER = ""}; | |
| 21 | + | [02] = {FROM = {x=4111, y=1444, z=14}, TO = {x=4128, y=1457, z=14}, MONSTER = ""}; | |
| 22 | + | [03] = {FROM = {x=4111, y=1422, z=14}, TO = {x=4123, y=1434, z=14}, MONSTER = ""}; | |
| 23 | + | [04] = {FROM = {x=4160, y=1422, z=14}, TO = {x=4172, y=1434, z=14}, MONSTER = ""}; | |
| 24 | + | [05] = {FROM = {x=4154, y=1444, z=14}, TO = {x=4172, y=1456, z=14}, MONSTER = ""}; | |
| 25 | + | [06] = {FROM = {x=4160, y=1466, z=14}, TO = {x=4173, y=1479, z=14}, MONSTER = ""}; | |
| 26 | + | }; | |
| 27 | + | } | |
| 28 | + | ||
| 29 | + | if DG_SUNSET[item.uid] then | |
| 30 | + | local checkArea = 0 | |
| 31 | + | local X = DG_SUNSET[item.uid][01] | |
| 32 | + | local ID = 01 | |
| 33 | + | for AREA = 01, #DG_SUNSET[item.uid] do | |
| 34 | + | local from = DG_SUNSET[item.uid][AREA].FROM | |
| 35 | + | local to = DG_SUNSET[item.uid][AREA].TO | |
| 36 | + | for A = from.x, to.x do | |
| 37 | + | for B = from.y, to.y do | |
| 38 | + | for C = from.z, to.z do | |
| 39 | + | local tile = Tile(A, B, C) | |
| 40 | + | local creature = tile:getTopCreature() | |
| 41 | + | if creature and creature:isMonster() then | |
| 42 | + | checkArea = 01 | |
| 43 | + | ID = AREA | |
| 44 | + | X.MONSTER = creature:getName() | |
| 45 | + | X = DG_SUNSET[item.uid][ID] | |
| 46 | + | break | |
| 47 | + | end | |
| 48 | + | end | |
| 49 | + | end | |
| 50 | + | end | |
| 51 | + | end | |
| 52 | + | if checkArea > 0 then | |
| 53 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Existe " .. X.MONSTER .. " na area 0" ..ID) | |
| 54 | + | player:getPosition():sendMagicEffect(03) | |
| 55 | + | return true | |
| 56 | + | else | |
| 57 | + | local party = player:getParty() | |
| 58 | + | if player:getStorageValue(_SYSTEM.DANGEROUS[05][01].STORAGE) < 02 then | |
| 59 | + | if not party then | |
| 60 | + | player:setStorageValue(_SYSTEM.DANGEROUS[05][01].STORAGE, 02) | |
| 61 | + | player:setStorageValue(_SYSTEM.DANGEROUS[05][01].RECOMPENSA[01], _SYSTEM.DANGEROUS[05][01].RECOMPENSA[02]) | |
| 62 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Busque sua recompensa no bau.") | |
| 63 | + | player:getPosition():sendMagicEffect(13) | |
| 64 | + | else | |
| 65 | + | local members = party:getMembers() | |
| 66 | + | members[#members + 1] = party:getLeader() | |
| 67 | + | for _, member in ipairs(members) do | |
| 68 | + | member:setStorageValue(_SYSTEM.DANGEROUS[05][01].STORAGE, 02) | |
| 69 | + | member:setStorageValue(_SYSTEM.DANGEROUS[05][01].RECOMPENSA[01], _SYSTEM.DANGEROUS[05][01].RECOMPENSA[02]) | |
| 70 | + | member:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Busque sua recompensa no bau.") | |
| 71 | + | member:getPosition():sendMagicEffect(13) | |
| 72 | + | end | |
| 73 | + | end | |
| 74 | + | else | |
| 75 | + | player:getPosition():sendMagicEffect(03) | |
| 76 | + | end | |
| 77 | + | end | |
| 78 | + | end | |
| 79 | + | ||
| 80 | + | return true | |
| 81 | + | end |
| @@ -0,0 +1,119 @@ | |||
| 1 | + | local INTERRUPT_ACTION = 0 | |
| 2 | + | local BOMB_TYPE = 0 | |
| 3 | + | local EFFECT_PILLAR = { | |
| 4 | + | [10267] = {46, "EARTH", 285}; | |
| 5 | + | [10268] = {16, "FIRE", 242}; | |
| 6 | + | [10269] = {12, "ENERGY", 290}; | |
| 7 | + | [10270] = {18, "DEATH", 300}; | |
| 8 | + | } | |
| 9 | + | function onDefinePillar(pos, effect) | |
| 10 | + | pos:sendMagicEffect(effect) | |
| 11 | + | if effect == 18 then | |
| 12 | + | addEvent(onBombAlert, 1000, 01) | |
| 13 | + | end | |
| 14 | + | end | |
| 15 | + | function onBombAlert(id) | |
| 16 | + | local from = {x=3914, y=1345, z=8} | |
| 17 | + | local to = {x=3925, y=1361, z=8} | |
| 18 | + | local countPlayer = 0 | |
| 19 | + | ||
| 20 | + | BOMB_TYPE = math.random(10267, 10270) | |
| 21 | + | for A = from.x, to.x do | |
| 22 | + | for B = from.y, to.y do | |
| 23 | + | for C = from.z, to.z do | |
| 24 | + | local tile = Tile(A, B, C) | |
| 25 | + | if tile ~= nil then | |
| 26 | + | local creature = tile:getTopCreature() | |
| 27 | + | if creature and creature:isPlayer() then | |
| 28 | + | if id >= 07 then | |
| 29 | + | creature:setStorageValue(_SYSTEM.DANGEROUS[05][01].STORAGE, 02) | |
| 30 | + | creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Acesso liberado. Clique novamente na est�tua.") | |
| 31 | + | INTERRUPT_ACTION = 00 | |
| 32 | + | else | |
| 33 | + | countPlayer = countPlayer + 1 | |
| 34 | + | creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Bomba [ 0" ..id.. " ]\n" ..EFFECT_PILLAR[BOMB_TYPE][02].. ".") | |
| 35 | + | end | |
| 36 | + | end | |
| 37 | + | end | |
| 38 | + | end | |
| 39 | + | end | |
| 40 | + | end | |
| 41 | + | ||
| 42 | + | if countPlayer > 0 then | |
| 43 | + | id = id + 1 | |
| 44 | + | addEvent(onExplosionBomb, 3000, id) | |
| 45 | + | else | |
| 46 | + | INTERRUPT_ACTION = 00 | |
| 47 | + | end | |
| 48 | + | end | |
| 49 | + | function onExplosionBomb(id) | |
| 50 | + | local from = {x=3914, y=1345, z=8} | |
| 51 | + | local to = {x=3925, y=1361, z=8} | |
| 52 | + | local countPlayer = 0 | |
| 53 | + | for A = from.x, to.x do | |
| 54 | + | for B = from.y, to.y do | |
| 55 | + | for C = from.z, to.z do | |
| 56 | + | local tile = Tile(A, B, C) | |
| 57 | + | if tile ~= nil then | |
| 58 | + | local creature = tile:getTopCreature() | |
| 59 | + | local PosiEffect = Position(A, B, C) | |
| 60 | + | PosiEffect:sendMagicEffect(EFFECT_PILLAR[BOMB_TYPE][01]) | |
| 61 | + | if creature and creature:isPlayer() then | |
| 62 | + | countPlayer = countPlayer + 1 | |
| 63 | + | if creature:getOutfit().lookType ~= EFFECT_PILLAR[BOMB_TYPE][03] then | |
| 64 | + | creature:teleportTo({x=4005, y=1337, z=8}) | |
| 65 | + | creature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) | |
| 66 | + | countPlayer = countPlayer - 1 | |
| 67 | + | end | |
| 68 | + | end | |
| 69 | + | end | |
| 70 | + | end | |
| 71 | + | end | |
| 72 | + | end | |
| 73 | + | ||
| 74 | + | if countPlayer > 0 then | |
| 75 | + | addEvent(onBombAlert, 3000, id) | |
| 76 | + | else | |
| 77 | + | INTERRUPT_ACTION = 00 | |
| 78 | + | end | |
| 79 | + | end | |
| 80 | + | function onUse(player, item, fromPosition, target, toPosition, isHotkey) | |
| 81 | + | local party = player:getParty() | |
| 82 | + | if item.uid == 10266 then | |
| 83 | + | if player:getStorageValue(_SYSTEM.DANGEROUS[05][01].STORAGE) < 02 then | |
| 84 | + | if INTERRUPT_ACTION == 00 then | |
| 85 | + | INTERRUPT_ACTION = 01 | |
| 86 | + | player:getPosition():sendMagicEffect(13) | |
| 87 | + | ||
| 88 | + | local PILAR_POS_1 = Position(3917, 1350, 8) | |
| 89 | + | local PILAR_POS_2 = Position(3917, 1352, 8) | |
| 90 | + | local PILAR_POS_3 = Position(3917, 1354, 8) | |
| 91 | + | local PILAR_POS_4 = Position(3917, 1356, 8) | |
| 92 | + | ||
| 93 | + | addEvent(onDefinePillar, 1000, PILAR_POS_1, 46) | |
| 94 | + | addEvent(onDefinePillar, 2000, PILAR_POS_2, 16) | |
| 95 | + | addEvent(onDefinePillar, 3000, PILAR_POS_3, 12) | |
| 96 | + | addEvent(onDefinePillar, 4000, PILAR_POS_4, 18) | |
| 97 | + | else | |
| 98 | + | player:getPosition():sendMagicEffect(03) | |
| 99 | + | end | |
| 100 | + | else | |
| 101 | + | player:teleportTo({x=3928, y=1352, z=8}) | |
| 102 | + | player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) | |
| 103 | + | end | |
| 104 | + | end | |
| 105 | + | ||
| 106 | + | if EFFECT_PILLAR[item.uid] then | |
| 107 | + | if player:getOutfit().lookType ~= EFFECT_PILLAR[item.uid][03] then | |
| 108 | + | player:getPosition():sendMagicEffect(EFFECT_PILLAR[item.uid][01]) | |
| 109 | + | local condition = Condition(CONDITION_OUTFIT) | |
| 110 | + | condition:setOutfit({lookType = EFFECT_PILLAR[item.uid][03]}) | |
| 111 | + | condition:setTicks(5000) | |
| 112 | + | player:addCondition(condition) | |
| 113 | + | else | |
| 114 | + | player:getPosition():sendMagicEffect(03) | |
| 115 | + | return true | |
| 116 | + | end | |
| 117 | + | end | |
| 118 | + | return true | |
| 119 | + | end |
| @@ -0,0 +1,78 @@ | |||
| 1 | + | function onUse(player, item, fromPosition, target, toPosition, isHotkey) | |
| 2 | + | local DG_KAZEMIR = { | |
| 3 | + | [10300] = {STORAGE = _SYSTEM.DANGEROUS[01][01].STORAGE, ID = 01}; | |
| 4 | + | [10343] = {STORAGE = _SYSTEM.DANGEROUS[01][01].STORAGE, ID = 01}; | |
| 5 | + | [10346] = {STORAGE = _SYSTEM.DANGEROUS[01][01].STORAGE, ID = 01}; | |
| 6 | + | [10301] = {STORAGE = _SYSTEM.DANGEROUS[01][01].STORAGE, ID = 02}; | |
| 7 | + | [10344] = {STORAGE = _SYSTEM.DANGEROUS[01][01].STORAGE, ID = 02}; | |
| 8 | + | [10347] = {STORAGE = _SYSTEM.DANGEROUS[01][01].STORAGE, ID = 02}; | |
| 9 | + | [10302] = {STORAGE = _SYSTEM.DANGEROUS[01][01].STORAGE, ID = 03}; | |
| 10 | + | [10345] = {STORAGE = _SYSTEM.DANGEROUS[01][01].STORAGE, ID = 03}; | |
| 11 | + | [10348] = {STORAGE = _SYSTEM.DANGEROUS[01][01].STORAGE, ID = 03}; | |
| 12 | + | } | |
| 13 | + | ||
| 14 | + | if DG_KAZEMIR[item.uid] then | |
| 15 | + | X = DG_KAZEMIR[item.uid] | |
| 16 | + | local party = player:getParty() | |
| 17 | + | if X.ID == 01 then | |
| 18 | + | if player:getStorageValue(X.STORAGE) == 01 then | |
| 19 | + | if not party then | |
| 20 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Estatuas Ativadas [ 01/02 ]") | |
| 21 | + | player:setStorageValue(X.STORAGE, 02) | |
| 22 | + | player:getPosition():sendMagicEffect(13) | |
| 23 | + | else | |
| 24 | + | local members = party:getMembers() | |
| 25 | + | members[#members + 1] = party:getLeader() | |
| 26 | + | for _, member in ipairs(members) do | |
| 27 | + | member:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Estatuas Ativadas [ 01/02 ]") | |
| 28 | + | member:setStorageValue(X.STORAGE, 02) | |
| 29 | + | member:getPosition():sendMagicEffect(13) | |
| 30 | + | end | |
| 31 | + | end | |
| 32 | + | else | |
| 33 | + | player:getPosition():sendMagicEffect(03) | |
| 34 | + | end | |
| 35 | + | ||
| 36 | + | elseif X.ID == 02 then | |
| 37 | + | if player:getStorageValue(X.STORAGE) == 02 then | |
| 38 | + | if not party then | |
| 39 | + | player:setStorageValue(X.STORAGE, 03) | |
| 40 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Estatuas Ativadas [ 02/02 ]\nA proxima estatua mostra a saida.") | |
| 41 | + | player:setStorageValue(_SYSTEM.DANGEROUS[01][01].RECOMPENSA[01], _SYSTEM.DANGEROUS[01][01].RECOMPENSA[02]) | |
| 42 | + | player:getPosition():sendMagicEffect(13) | |
| 43 | + | else | |
| 44 | + | local members = party:getMembers() | |
| 45 | + | members[#members + 1] = party:getLeader() | |
| 46 | + | for _, member in ipairs(members) do | |
| 47 | + | member:setStorageValue(X.STORAGE, 03) | |
| 48 | + | member:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Estatuas Ativadas [ 02/02 ]\nA proxima estatua mostra a saida.") | |
| 49 | + | member:setStorageValue(_SYSTEM.DANGEROUS[01][01].RECOMPENSA[01], _SYSTEM.DANGEROUS[01][01].RECOMPENSA[02]) | |
| 50 | + | member:getPosition():sendMagicEffect(13) | |
| 51 | + | end | |
| 52 | + | end | |
| 53 | + | else | |
| 54 | + | player:getPosition():sendMagicEffect(03) | |
| 55 | + | end | |
| 56 | + | ||
| 57 | + | elseif X.ID == 03 then | |
| 58 | + | if player:getStorageValue(X.STORAGE) == 03 then | |
| 59 | + | if item.uid == 10302 then | |
| 60 | + | player:teleportTo({x=3998, y=1058, z=14}) | |
| 61 | + | player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) | |
| 62 | + | elseif item.uid == 10345 then | |
| 63 | + | player:teleportTo({x=4083, y=1058, z=14}) | |
| 64 | + | player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) | |
| 65 | + | elseif item.uid == 10348 then | |
| 66 | + | player:teleportTo({x=4168, y=1058, z=14}) | |
| 67 | + | player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) | |
| 68 | + | end | |
| 69 | + | else | |
| 70 | + | player:getPosition():sendMagicEffect(03) | |
| 71 | + | end | |
| 72 | + | else | |
| 73 | + | player:getPosition():sendMagicEffect(03) | |
| 74 | + | end | |
| 75 | + | else | |
| 76 | + | player:getPosition():sendMagicEffect(03) | |
| 77 | + | end | |
| 78 | + | end |
| @@ -0,0 +1,432 @@ | |||
| 1 | + | function onUse(player, item, fromPosition, target, toPosition, isHotkey) | |
| 2 | + | local DG_KAZEMIR_2 = { | |
| 3 | + | [10303] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 01}; | |
| 4 | + | [10304] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 02}; | |
| 5 | + | [10305] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 03}; | |
| 6 | + | [10306] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 04}; | |
| 7 | + | [10307] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 05}; | |
| 8 | + | [10308] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 06}; | |
| 9 | + | [10309] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 07}; | |
| 10 | + | [10310] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 08}; | |
| 11 | + | [10311] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 09}; | |
| 12 | + | [10312] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 10}; | |
| 13 | + | [10313] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 11}; | |
| 14 | + | [10314] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 12}; | |
| 15 | + | [10315] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 13}; | |
| 16 | + | ||
| 17 | + | [10536] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 01}; | |
| 18 | + | [10537] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 02}; | |
| 19 | + | [10538] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 03}; | |
| 20 | + | [10539] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 04}; | |
| 21 | + | [10540] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 05}; | |
| 22 | + | [10541] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 06}; | |
| 23 | + | [10542] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 07}; | |
| 24 | + | [10543] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 08}; | |
| 25 | + | [10544] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 09}; | |
| 26 | + | [10545] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 10}; | |
| 27 | + | [10546] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 11}; | |
| 28 | + | [10547] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 12}; | |
| 29 | + | [10548] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 13}; | |
| 30 | + | ||
| 31 | + | [10549] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 01}; | |
| 32 | + | [10550] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 02}; | |
| 33 | + | [10551] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 03}; | |
| 34 | + | [10552] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 04}; | |
| 35 | + | [10553] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 05}; | |
| 36 | + | [10554] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 06}; | |
| 37 | + | [10555] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 07}; | |
| 38 | + | [10556] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 08}; | |
| 39 | + | [10557] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 09}; | |
| 40 | + | [10558] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 10}; | |
| 41 | + | [10559] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 11}; | |
| 42 | + | [10560] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 12}; | |
| 43 | + | [10561] = {STORAGE = _SYSTEM.DANGEROUS[04][01].STORAGE, ID = 13}; | |
| 44 | + | } | |
| 45 | + | ||
| 46 | + | if DG_KAZEMIR_2[item.uid] then | |
| 47 | + | X = DG_KAZEMIR_2[item.uid] | |
| 48 | + | local party = player:getParty() | |
| 49 | + | if X.ID == 01 then | |
| 50 | + | if player:getStorageValue(X.STORAGE) == 01 then | |
| 51 | + | if not party then | |
| 52 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Pendulum Ativado [ 01/12 ]") | |
| 53 | + | player:setStorageValue(X.STORAGE, 02) | |
| 54 | + | player:getPosition():sendMagicEffect(13) | |
| 55 | + | else | |
| 56 | + | local members = party:getMembers() | |
| 57 | + | members[#members + 1] = party:getLeader() | |
| 58 | + | for _, member in ipairs(members) do | |
| 59 | + | member:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Pendulum Ativado [ 01/12 ]") | |
| 60 | + | member:setStorageValue(X.STORAGE, 02) | |
| 61 | + | member:getPosition():sendMagicEffect(13) | |
| 62 | + | end | |
| 63 | + | end | |
| 64 | + | else | |
| 65 | + | player:getPosition():sendMagicEffect(03) | |
| 66 | + | end | |
| 67 | + | ||
| 68 | + | elseif X.ID == 02 then | |
| 69 | + | if player:getStorageValue(X.STORAGE) == 02 then | |
| 70 | + | if not party then | |
| 71 | + | player:setStorageValue(X.STORAGE, 03) | |
| 72 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Pendulum Ativado [ 02/12 ]") | |
| 73 | + | player:getPosition():sendMagicEffect(13) | |
| 74 | + | else | |
| 75 | + | local members = party:getMembers() | |
| 76 | + | members[#members + 1] = party:getLeader() | |
| 77 | + | for _, member in ipairs(members) do | |
| 78 | + | member:setStorageValue(X.STORAGE, 03) | |
| 79 | + | member:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Pendulum Ativado [ 02/12 ]") | |
| 80 | + | member:getPosition():sendMagicEffect(13) | |
| 81 | + | end | |
| 82 | + | end | |
| 83 | + | ||
| 84 | + | if item.uid == 10304 then | |
| 85 | + | Game.createMonster("Insectoid Worker", {x=4016, y=1303, z=14}) | |
| 86 | + | Game.createMonster("Insectoid Worker", {x=4019, y=1301, z=14}) | |
| 87 | + | Game.createMonster("Insectoid Worker", {x=4022, y=1304, z=14}) | |
| 88 | + | Game.createMonster("Insectoid Worker", {x=4025, y=1301, z=14}) | |
| 89 | + | Game.createMonster("Insectoid Worker", {x=4028, y=1304, z=14}) | |
| 90 | + | elseif item.uid == 10537 then | |
| 91 | + | Game.createMonster("Insectoid Worker", {x=4129, y=1303, z=14}) | |
| 92 | + | Game.createMonster("Insectoid Worker", {x=4132, y=1301, z=14}) | |
| 93 | + | Game.createMonster("Insectoid Worker", {x=4135, y=1304, z=14}) | |
| 94 | + | Game.createMonster("Insectoid Worker", {x=4138, y=1301, z=14}) | |
| 95 | + | Game.createMonster("Insectoid Worker", {x=4141, y=1304, z=14}) | |
| 96 | + | elseif item.uid == 10550 then | |
| 97 | + | Game.createMonster("Insectoid Worker", {x=4242, y=1303, z=14}) | |
| 98 | + | Game.createMonster("Insectoid Worker", {x=4245, y=1301, z=14}) | |
| 99 | + | Game.createMonster("Insectoid Worker", {x=4248, y=1304, z=14}) | |
| 100 | + | Game.createMonster("Insectoid Worker", {x=4251, y=1301, z=14}) | |
| 101 | + | Game.createMonster("Insectoid Worker", {x=4254, y=1304, z=14}) | |
| 102 | + | end | |
| 103 | + | else | |
| 104 | + | player:getPosition():sendMagicEffect(03) | |
| 105 | + | end | |
| 106 | + | ||
| 107 | + | elseif X.ID == 03 then | |
| 108 | + | if player:getStorageValue(X.STORAGE) == 03 then | |
| 109 | + | if not party then | |
| 110 | + | player:setStorageValue(X.STORAGE, 04) | |
| 111 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Pendulum Ativado [ 03/12 ]") | |
| 112 | + | player:getPosition():sendMagicEffect(13) | |
| 113 | + | else | |
| 114 | + | local members = party:getMembers() | |
| 115 | + | members[#members + 1] = party:getLeader() | |
| 116 | + | for _, member in ipairs(members) do | |
| 117 | + | member:setStorageValue(X.STORAGE, 04) | |
| 118 | + | member:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Pendulum Ativado [ 03/12 ]") | |
| 119 | + | member:getPosition():sendMagicEffect(13) | |
| 120 | + | end | |
| 121 | + | end | |
| 122 | + | ||
| 123 | + | if item.uid == 10305 then | |
| 124 | + | Game.createMonster("Insectoid Worker", {x=4016, y=1303, z=14}) | |
| 125 | + | Game.createMonster("Insectoid Worker", {x=4019, y=1301, z=14}) | |
| 126 | + | Game.createMonster("Insectoid Worker", {x=4022, y=1304, z=14}) | |
| 127 | + | Game.createMonster("Insectoid Worker", {x=4025, y=1301, z=14}) | |
| 128 | + | Game.createMonster("Spitter", {x=4028, y=1304, z=14}) | |
| 129 | + | elseif item.uid == 10538 then | |
| 130 | + | Game.createMonster("Insectoid Worker", {x=4129, y=1303, z=14}) | |
| 131 | + | Game.createMonster("Insectoid Worker", {x=4132, y=1301, z=14}) | |
| 132 | + | Game.createMonster("Insectoid Worker", {x=4135, y=1304, z=14}) | |
| 133 | + | Game.createMonster("Insectoid Worker", {x=4138, y=1301, z=14}) | |
| 134 | + | Game.createMonster("Spitter", {x=4141, y=1304, z=14}) | |
| 135 | + | elseif item.uid == 10551 then | |
| 136 | + | Game.createMonster("Insectoid Worker", {x=4242, y=1303, z=14}) | |
| 137 | + | Game.createMonster("Insectoid Worker", {x=4245, y=1301, z=14}) | |
| 138 | + | Game.createMonster("Insectoid Worker", {x=4248, y=1304, z=14}) | |
| 139 | + | Game.createMonster("Insectoid Worker", {x=4251, y=1301, z=14}) | |
| 140 | + | Game.createMonster("Spitter", {x=4254, y=1304, z=14}) | |
| 141 | + | end | |
| 142 | + | else | |
| 143 | + | player:getPosition():sendMagicEffect(03) | |
| 144 | + | end | |
| 145 | + | ||
| 146 | + | elseif X.ID == 04 then | |
| 147 | + | if player:getStorageValue(X.STORAGE) == 04 then | |
| 148 | + | if not party then | |
| 149 | + | player:setStorageValue(X.STORAGE, 05) | |
| 150 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Pendulum Ativado [ 04/12 ]") | |
| 151 | + | player:getPosition():sendMagicEffect(13) | |
| 152 | + | else | |
| 153 | + | local members = party:getMembers() | |
| 154 | + | members[#members + 1] = party:getLeader() | |
| 155 | + | for _, member in ipairs(members) do | |
| 156 | + | member:setStorageValue(X.STORAGE, 05) | |
| 157 | + | member:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Pendulum Ativado [ 04/12 ]") | |
| 158 | + | member:getPosition():sendMagicEffect(13) | |
| 159 | + | end | |
| 160 | + | end | |
| 161 | + | ||
| 162 | + | if item.uid == 10306 then | |
| 163 | + | Game.createMonster("Insectoid Worker", {x=4016, y=1303, z=14}) | |
| 164 | + | Game.createMonster("Insectoid Worker", {x=4019, y=1301, z=14}) | |
| 165 | + | Game.createMonster("Spitter", {x=4022, y=1304, z=14}) | |
| 166 | + | Game.createMonster("Insectoid Worker", {x=4025, y=1301, z=14}) | |
| 167 | + | Game.createMonster("Spitter", {x=4028, y=1304, z=14}) | |
| 168 | + | elseif item.uid == 10539 then | |
| 169 | + | Game.createMonster("Insectoid Worker", {x=4129, y=1303, z=14}) | |
| 170 | + | Game.createMonster("Insectoid Worker", {x=4132, y=1301, z=14}) | |
| 171 | + | Game.createMonster("Spitter", {x=4135, y=1304, z=14}) | |
| 172 | + | Game.createMonster("Insectoid Worker", {x=4138, y=1301, z=14}) | |
| 173 | + | Game.createMonster("Spitter", {x=4141, y=1304, z=14}) | |
| 174 | + | elseif item.uid == 10552 then | |
| 175 | + | Game.createMonster("Insectoid Worker", {x=4242, y=1303, z=14}) | |
| 176 | + | Game.createMonster("Insectoid Worker", {x=4245, y=1301, z=14}) | |
| 177 | + | Game.createMonster("Spitter", {x=4248, y=1304, z=14}) | |
| 178 | + | Game.createMonster("Insectoid Worker", {x=4251, y=1301, z=14}) | |
| 179 | + | Game.createMonster("Spitter", {x=4254, y=1304, z=14}) | |
| 180 | + | end | |
| 181 | + | else | |
| 182 | + | player:getPosition():sendMagicEffect(03) | |
| 183 | + | end | |
| 184 | + | ||
| 185 | + | elseif X.ID == 05 then | |
| 186 | + | if player:getStorageValue(X.STORAGE) == 05 then | |
| 187 | + | if not party then | |
| 188 | + | player:setStorageValue(X.STORAGE, 06) | |
| 189 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Pendulum Ativado [ 05/12 ]") | |
| 190 | + | player:getPosition():sendMagicEffect(13) | |
| 191 | + | else | |
| 192 | + | local members = party:getMembers() | |
| 193 | + | members[#members + 1] = party:getLeader() | |
| 194 | + | for _, member in ipairs(members) do | |
| 195 | + | member:setStorageValue(X.STORAGE, 06) | |
| 196 | + | member:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Pendulum Ativado [ 05/12 ]") | |
| 197 | + | member:getPosition():sendMagicEffect(13) | |
| 198 | + | end | |
| 199 | + | end | |
| 200 | + | ||
| 201 | + | if item.uid == 10307 then | |
| 202 | + | Game.createMonster("Spitter", {x=4016, y=1303, z=14}) | |
| 203 | + | Game.createMonster("Insectoid Worker", {x=4019, y=1301, z=14}) | |
| 204 | + | Game.createMonster("Spitter", {x=4022, y=1304, z=14}) | |
| 205 | + | Game.createMonster("Insectoid Worker", {x=4025, y=1301, z=14}) | |
| 206 | + | Game.createMonster("Spitter", {x=4028, y=1304, z=14}) | |
| 207 | + | elseif item.uid == 10540 then | |
| 208 | + | Game.createMonster("Spitter", {x=4129, y=1303, z=14}) | |
| 209 | + | Game.createMonster("Insectoid Worker", {x=4132, y=1301, z=14}) | |
| 210 | + | Game.createMonster("Spitter", {x=4135, y=1304, z=14}) | |
| 211 | + | Game.createMonster("Insectoid Worker", {x=4138, y=1301, z=14}) | |
| 212 | + | Game.createMonster("Spitter", {x=4141, y=1304, z=14}) | |
| 213 | + | elseif item.uid == 10553 then | |
| 214 | + | Game.createMonster("Spitter", {x=4242, y=1303, z=14}) | |
| 215 | + | Game.createMonster("Insectoid Worker", {x=4245, y=1301, z=14}) | |
| 216 | + | Game.createMonster("Spitter", {x=4248, y=1304, z=14}) | |
| 217 | + | Game.createMonster("Insectoid Worker", {x=4251, y=1301, z=14}) | |
| 218 | + | Game.createMonster("Spitter", {x=4254, y=1304, z=14}) | |
| 219 | + | end | |
| 220 | + | else | |
| 221 | + | player:getPosition():sendMagicEffect(03) | |
| 222 | + | end | |
| 223 | + | ||
| 224 | + | elseif X.ID == 06 then | |
| 225 | + | if player:getStorageValue(X.STORAGE) == 06 then | |
| 226 | + | if not party then | |
| 227 | + | player:setStorageValue(X.STORAGE, 07) | |
| 228 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Pendulum Ativado [ 06/12 ]") | |
| 229 | + | player:getPosition():sendMagicEffect(13) | |
| 230 | + | else | |
| 231 | + | local members = party:getMembers() | |
| 232 | + | members[#members + 1] = party:getLeader() | |
| 233 | + | for _, member in ipairs(members) do | |
| 234 | + | member:setStorageValue(X.STORAGE, 07) | |
| 235 | + | member:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Pendulum Ativado [ 06/12 ]") | |
| 236 | + | member:getPosition():sendMagicEffect(13) | |
| 237 | + | end | |
| 238 | + | end | |
| 239 | + | ||
| 240 | + | if item.uid == 10308 then | |
| 241 | + | Game.createMonster("Spitter", {x=4016, y=1303, z=14}) | |
| 242 | + | Game.createMonster("Insectoid Worker", {x=4019, y=1301, z=14}) | |
| 243 | + | Game.createMonster("Spitter", {x=4022, y=1304, z=14}) | |
| 244 | + | Game.createMonster("Spitter", {x=4025, y=1301, z=14}) | |
| 245 | + | Game.createMonster("Spitter", {x=4028, y=1304, z=14}) | |
| 246 | + | elseif item.uid == 10541 then | |
| 247 | + | Game.createMonster("Spitter", {x=4129, y=1303, z=14}) | |
| 248 | + | Game.createMonster("Insectoid Worker", {x=4132, y=1301, z=14}) | |
| 249 | + | Game.createMonster("Spitter", {x=4135, y=1304, z=14}) | |
| 250 | + | Game.createMonster("Spitter", {x=4138, y=1301, z=14}) | |
| 251 | + | Game.createMonster("Spitter", {x=4141, y=1304, z=14}) | |
| 252 | + | elseif item.uid == 10554 then | |
| 253 | + | Game.createMonster("Spitter", {x=4242, y=1303, z=14}) | |
| 254 | + | Game.createMonster("Insectoid Worker", {x=4245, y=1301, z=14}) | |
| 255 | + | Game.createMonster("Spitter", {x=4248, y=1304, z=14}) | |
| 256 | + | Game.createMonster("Spitter", {x=4251, y=1301, z=14}) | |
| 257 | + | Game.createMonster("Spitter", {x=4254, y=1304, z=14}) | |
| 258 | + | end | |
| 259 | + | else | |
| 260 | + | player:getPosition():sendMagicEffect(03) | |
| 261 | + | end | |
| 262 | + | ||
| 263 | + | elseif X.ID == 07 then | |
| 264 | + | if player:getStorageValue(X.STORAGE) == 07 then | |
| 265 | + | if not party then | |
| 266 | + | player:setStorageValue(X.STORAGE, 08) | |
| 267 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Pendulum Ativado [ 07/12 ]") | |
| 268 | + | player:getPosition():sendMagicEffect(13) | |
| 269 | + | else | |
| 270 | + | local members = party:getMembers() | |
| 271 | + | members[#members + 1] = party:getLeader() | |
| 272 | + | for _, member in ipairs(members) do | |
| 273 | + | member:setStorageValue(X.STORAGE, 08) | |
| 274 | + | member:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Pendulum Ativado [ 07/12 ]") | |
| 275 | + | member:getPosition():sendMagicEffect(13) | |
| 276 | + | end | |
| 277 | + | end | |
| 278 | + | ||
| 279 | + | if item.uid == 10309 then | |
| 280 | + | Game.createMonster("Spitter", {x=4016, y=1303, z=14}) | |
| 281 | + | Game.createMonster("Spitter", {x=4019, y=1301, z=14}) | |
| 282 | + | Game.createMonster("Spitter", {x=4022, y=1304, z=14}) | |
| 283 | + | Game.createMonster("Spitter", {x=4025, y=1301, z=14}) | |
| 284 | + | Game.createMonster("Spitter", {x=4028, y=1304, z=14}) | |
| 285 | + | elseif item.uid == 10542 then | |
| 286 | + | Game.createMonster("Spitter", {x=4129, y=1303, z=14}) | |
| 287 | + | Game.createMonster("Spitter", {x=4132, y=1301, z=14}) | |
| 288 | + | Game.createMonster("Spitter", {x=4135, y=1304, z=14}) | |
| 289 | + | Game.createMonster("Spitter", {x=4138, y=1301, z=14}) | |
| 290 | + | Game.createMonster("Spitter", {x=4141, y=1304, z=14}) | |
| 291 | + | elseif item.uid == 10555 then | |
| 292 | + | Game.createMonster("Spitter", {x=4242, y=1303, z=14}) | |
| 293 | + | Game.createMonster("Spitter", {x=4245, y=1301, z=14}) | |
| 294 | + | Game.createMonster("Spitter", {x=4248, y=1304, z=14}) | |
| 295 | + | Game.createMonster("Spitter", {x=4251, y=1301, z=14}) | |
| 296 | + | Game.createMonster("Spitter", {x=4254, y=1304, z=14}) | |
| 297 | + | end | |
| 298 | + | else | |
| 299 | + | player:getPosition():sendMagicEffect(03) | |
| 300 | + | end | |
| 301 | + | ||
| 302 | + | elseif X.ID == 08 then | |
| 303 | + | if player:getStorageValue(X.STORAGE) == 08 then | |
| 304 | + | if not party then | |
| 305 | + | player:setStorageValue(X.STORAGE, 09) | |
| 306 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Pendulum Ativado [ 08/12 ]") | |
| 307 | + | player:getPosition():sendMagicEffect(13) | |
| 308 | + | else | |
| 309 | + | local members = party:getMembers() | |
| 310 | + | members[#members + 1] = party:getLeader() | |
| 311 | + | for _, member in ipairs(members) do | |
| 312 | + | member:setStorageValue(X.STORAGE, 09) | |
| 313 | + | member:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Pendulum Ativado [ 08/12 ]") | |
| 314 | + | member:getPosition():sendMagicEffect(13) | |
| 315 | + | end | |
| 316 | + | end | |
| 317 | + | else | |
| 318 | + | player:getPosition():sendMagicEffect(03) | |
| 319 | + | end | |
| 320 | + | ||
| 321 | + | elseif X.ID == 09 then | |
| 322 | + | if player:getStorageValue(X.STORAGE) == 09 then | |
| 323 | + | if not party then | |
| 324 | + | player:setStorageValue(X.STORAGE, 10) | |
| 325 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Pendulum Ativado [ 09/12 ]") | |
| 326 | + | player:getPosition():sendMagicEffect(13) | |
| 327 | + | else | |
| 328 | + | local members = party:getMembers() | |
| 329 | + | members[#members + 1] = party:getLeader() | |
| 330 | + | for _, member in ipairs(members) do | |
| 331 | + | member:setStorageValue(X.STORAGE, 10) | |
| 332 | + | member:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Pendulum Ativado [ 09/12 ]") | |
| 333 | + | member:getPosition():sendMagicEffect(13) | |
| 334 | + | end | |
| 335 | + | end | |
| 336 | + | else | |
| 337 | + | player:getPosition():sendMagicEffect(03) | |
| 338 | + | end | |
| 339 | + | ||
| 340 | + | elseif X.ID == 10 then | |
| 341 | + | if player:getStorageValue(X.STORAGE) == 10 then | |
| 342 | + | if not party then | |
| 343 | + | player:setStorageValue(X.STORAGE, 11) | |
| 344 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Pendulum Ativado [ 10/12 ]") | |
| 345 | + | player:getPosition():sendMagicEffect(13) | |
| 346 | + | else | |
| 347 | + | local members = party:getMembers() | |
| 348 | + | members[#members + 1] = party:getLeader() | |
| 349 | + | for _, member in ipairs(members) do | |
| 350 | + | member:setStorageValue(X.STORAGE, 11) | |
| 351 | + | member:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Pendulum Ativado [ 10/12 ]") | |
| 352 | + | member:getPosition():sendMagicEffect(13) | |
| 353 | + | end | |
| 354 | + | end | |
| 355 | + | else | |
| 356 | + | player:getPosition():sendMagicEffect(03) | |
| 357 | + | end | |
| 358 | + | ||
| 359 | + | elseif X.ID == 11 then | |
| 360 | + | if player:getStorageValue(X.STORAGE) == 11 then | |
| 361 | + | if not party then | |
| 362 | + | player:setStorageValue(X.STORAGE, 12) | |
| 363 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Pendulum Ativado [ 11/12 ]") | |
| 364 | + | player:getPosition():sendMagicEffect(13) | |
| 365 | + | else | |
| 366 | + | local members = party:getMembers() | |
| 367 | + | members[#members + 1] = party:getLeader() | |
| 368 | + | for _, member in ipairs(members) do | |
| 369 | + | member:setStorageValue(X.STORAGE, 12) | |
| 370 | + | member:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Pendulum Ativado [ 11/12 ]") | |
| 371 | + | member:getPosition():sendMagicEffect(13) | |
| 372 | + | end | |
| 373 | + | end | |
| 374 | + | else | |
| 375 | + | player:getPosition():sendMagicEffect(03) | |
| 376 | + | end | |
| 377 | + | ||
| 378 | + | elseif X.ID == 12 then | |
| 379 | + | if player:getStorageValue(X.STORAGE) == 12 then | |
| 380 | + | if not party then | |
| 381 | + | player:setStorageValue(X.STORAGE, 13) | |
| 382 | + | player:setStorageValue(_SYSTEM.DANGEROUS[04][01].RECOMPENSA[01], _SYSTEM.DANGEROUS[04][01].RECOMPENSA[02]) | |
| 383 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Pendulum Ativado [ 12/12 ]\nEncontre o Pendulum para a recompensa.") | |
| 384 | + | player:getPosition():sendMagicEffect(13) | |
| 385 | + | else | |
| 386 | + | local members = party:getMembers() | |
| 387 | + | members[#members + 1] = party:getLeader() | |
| 388 | + | for _, member in ipairs(members) do | |
| 389 | + | member:setStorageValue(X.STORAGE, 13) | |
| 390 | + | member:setStorageValue(_SYSTEM.DANGEROUS[04][01].RECOMPENSA[01], _SYSTEM.DANGEROUS[04][01].RECOMPENSA[02]) | |
| 391 | + | member:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Pendulum Ativado [ 12/12 ]\nEncontre o Pendulum para a recompensa.") | |
| 392 | + | member:getPosition():sendMagicEffect(13) | |
| 393 | + | end | |
| 394 | + | end | |
| 395 | + | else | |
| 396 | + | player:getPosition():sendMagicEffect(03) | |
| 397 | + | end | |
| 398 | + | ||
| 399 | + | elseif X.ID == 13 then | |
| 400 | + | if player:getStorageValue(X.STORAGE) == 13 then | |
| 401 | + | if not party then | |
| 402 | + | if item.uid == 10315 then | |
| 403 | + | player:teleportTo({x=3989, y=1356, z=14}) | |
| 404 | + | elseif item.uid == 10548 then | |
| 405 | + | player:teleportTo({x=4102, y=1356, z=14}) | |
| 406 | + | elseif item.uid == 10561 then | |
| 407 | + | player:teleportTo({x=4215, y=1356, z=14}) | |
| 408 | + | end | |
| 409 | + | ||
| 410 | + | player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) | |
| 411 | + | else | |
| 412 | + | local members = party:getMembers() | |
| 413 | + | members[#members + 1] = party:getLeader() | |
| 414 | + | for _, member in ipairs(members) do | |
| 415 | + | if item.uid == 10315 then | |
| 416 | + | member:teleportTo({x=3989, y=1356, z=14}) | |
| 417 | + | elseif item.uid == 10548 then | |
| 418 | + | member:teleportTo({x=4102, y=1356, z=14}) | |
| 419 | + | elseif item.uid == 10561 then | |
| 420 | + | member:teleportTo({x=4215, y=1356, z=14}) | |
| 421 | + | end | |
| 422 | + | member:getPosition():sendMagicEffect(CONST_ME_TELEPORT) | |
| 423 | + | end | |
| 424 | + | end | |
| 425 | + | else | |
| 426 | + | player:getPosition():sendMagicEffect(03) | |
| 427 | + | end | |
| 428 | + | end | |
| 429 | + | else | |
| 430 | + | player:getPosition():sendMagicEffect(03) | |
| 431 | + | end | |
| 432 | + | end |
| @@ -0,0 +1,463 @@ | |||
| 1 | + | function onUse(player, item, fromPosition, target, toPosition, isHotkey) | |
| 2 | + | local DG_RECOMPENSAS = { | |
| 3 | + | [10400] = {NEXUS = 01, INDEX = 01, VALUE = 03}; -- KAZEMIR [01] | |
| 4 | + | [10401] = {NEXUS = 04, INDEX = 01, VALUE = 13}; -- KIMBOLTON [01] | |
| 5 | + | [10402] = {NEXUS = 02, INDEX = 01, VALUE = 13}; -- SUNSET [01] | |
| 6 | + | [10403] = {NEXUS = 05, INDEX = 01, VALUE = 02}; -- HUAMPALI [01] | |
| 7 | + | [10404] = {NEXUS = 03, INDEX = 01, VALUE = 17}; -- BONEBROOK [01] | |
| 8 | + | [10405] = {NEXUS = 08, INDEX = 01, VALUE = 06}; -- KOPEC [01] | |
| 9 | + | [10406] = {NEXUS = 09, INDEX = 01, VALUE = 05}; -- HAVAN [01] | |
| 10 | + | [10407] = {NEXUS = 10, INDEX = 01, VALUE = 04}; -- SODON [01] | |
| 11 | + | [10408] = {NEXUS = 06, INDEX = 01, VALUE = 06}; -- RIVERMINE [01] | |
| 12 | + | [10409] = {NEXUS = 05, INDEX = 02, VALUE = 03}; | |
| 13 | + | [10410] = {NEXUS = 06, INDEX = 01, VALUE = 06}; | |
| 14 | + | [10411] = {NEXUS = 06, INDEX = 02, VALUE = 08}; | |
| 15 | + | ||
| 16 | + | [10412] = {NEXUS = 01, INDEX = 01, VALUE = 03}; -- KAZEMIR [02] | |
| 17 | + | [10413] = {NEXUS = 01, INDEX = 01, VALUE = 03}; -- KAZEMIR [03] | |
| 18 | + | [10414] = {NEXUS = 02, INDEX = 01, VALUE = 13}; -- SUNSET [02] | |
| 19 | + | [10415] = {NEXUS = 02, INDEX = 01, VALUE = 13}; -- SUNSET [03] | |
| 20 | + | [10416] = {NEXUS = 03, INDEX = 01, VALUE = 17}; -- BONEBROOK [02] | |
| 21 | + | [10417] = {NEXUS = 03, INDEX = 01, VALUE = 17}; -- BONEBROOK [03] | |
| 22 | + | [10418] = {NEXUS = 04, INDEX = 01, VALUE = 13}; -- KIMBOLTON [02] | |
| 23 | + | [10419] = {NEXUS = 04, INDEX = 01, VALUE = 13}; -- KIMBOLTON [03] | |
| 24 | + | [10455] = {NEXUS = 05, INDEX = 01, VALUE = 02}; -- HUAMPALI [02] | |
| 25 | + | [10456] = {NEXUS = 05, INDEX = 01, VALUE = 02}; -- HUAMPALI [03] | |
| 26 | + | [10457] = {NEXUS = 06, INDEX = 01, VALUE = 06}; -- RIVERMINE [02] | |
| 27 | + | [10458] = {NEXUS = 06, INDEX = 01, VALUE = 06}; -- RIVERMINE [03] | |
| 28 | + | [10459] = {NEXUS = 08, INDEX = 01, VALUE = 06}; -- KOPEC [02] | |
| 29 | + | [10460] = {NEXUS = 08, INDEX = 01, VALUE = 06}; -- KOPEC [03] | |
| 30 | + | [10461] = {NEXUS = 09, INDEX = 01, VALUE = 05}; -- HAVAN [02] | |
| 31 | + | [10462] = {NEXUS = 09, INDEX = 01, VALUE = 05}; -- HAVAN [03] | |
| 32 | + | [10463] = {NEXUS = 10, INDEX = 01, VALUE = 04}; -- SODON [02] | |
| 33 | + | [10464] = {NEXUS = 10, INDEX = 01, VALUE = 04}; -- SODON [03] | |
| 34 | + | } | |
| 35 | + | if DG_RECOMPENSAS[item.uid] then | |
| 36 | + | local TAG = _SYSTEM.DANGEROUS[DG_RECOMPENSAS[item.uid].NEXUS][DG_RECOMPENSAS[item.uid].INDEX] | |
| 37 | + | if player:getStorageValue(TAG.STORAGE) < DG_RECOMPENSAS[item.uid].VALUE then | |
| 38 | + | player:getPosition():sendMagicEffect(03) | |
| 39 | + | return false | |
| 40 | + | end | |
| 41 | + | if player:getStorageValue(TAG.RECOMPENSA[01]) > 0 then | |
| 42 | + | local choose = math.random(01, #TAG.LOOT) | |
| 43 | + | local itemid = TAG.LOOT[choose][01] | |
| 44 | + | local CountDG = tonumber(PlayerMetas(player, 1001, 00, DG_RECOMPENSAS[item.uid].NEXUS)) | |
| 45 | + | local rareMax = 0 | |
| 46 | + | local star = 0 | |
| 47 | + | local qnt = 1 | |
| 48 | + | local ext = 0 | |
| 49 | + | local slot = _ITEMS[itemid].SLOT_EQUIP | |
| 50 | + | local DANG_C = 01 | |
| 51 | + | local DANGEROUS_MAX = { | |
| 52 | + | [01] = {005, 00}; | |
| 53 | + | [02] = {025, 01}; -- 20 | |
| 54 | + | [03] = {060, 02}; -- 35 | |
| 55 | + | [04] = {105, 03}; -- 45 | |
| 56 | + | [05] = {150, 04}; -- 00 | |
| 57 | + | } | |
| 58 | + | for DANG = 01, 05 do | |
| 59 | + | if DANG == 05 then | |
| 60 | + | rareMax = 04 | |
| 61 | + | DANG_C = DANG | |
| 62 | + | break | |
| 63 | + | else | |
| 64 | + | if CountDG < DANGEROUS_MAX[DANG][01] then | |
| 65 | + | rareMax = DANGEROUS_MAX[DANG][02] | |
| 66 | + | DANG_C = DANG | |
| 67 | + | break | |
| 68 | + | end | |
| 69 | + | end | |
| 70 | + | end | |
| 71 | + | local rare = math.random(00, rareMax) | |
| 72 | + | local Dificulty = 200 -- Quanto maior, mais dificil. | |
| 73 | + | -- DIFICULTANDO RARE | |
| 74 | + | local chancePercent = 00 | |
| 75 | + | local rareText = '' | |
| 76 | + | if rareMax > 00 then | |
| 77 | + | local PERCENT_DROP = { | |
| 78 | + | [01] = {06, 05, "Melhorado"}, | |
| 79 | + | [02] = {08, 08, "Melhorado"}, | |
| 80 | + | [03] = {10, 10, "Melhorado"}, | |
| 81 | + | [04] = {12, 12, "Melhorado"}, | |
| 82 | + | [05] = {14, 13, "Melhorado"}, | |
| 83 | + | [06] = {16, 15, "Melhorado"}, | |
| 84 | + | [07] = {18, 18, "Melhorado"}, | |
| 85 | + | [08] = {20, 20, "Melhorado"}, | |
| 86 | + | [09] = {22, 22, "Melhorado"}, | |
| 87 | + | [10] = {24, 25, "Melhorado"}, | |
| 88 | + | ||
| 89 | + | [11] = {28, 03, "Raro"}, | |
| 90 | + | [12] = {31, 05, "Raro"}, | |
| 91 | + | [13] = {35, 07, "Raro"}, | |
| 92 | + | [14] = {38, 10, "Raro"}, | |
| 93 | + | [15] = {42, 12, "Raro"}, | |
| 94 | + | [16] = {45, 15, "Raro"}, | |
| 95 | + | [17] = {49, 17, "Raro"}, | |
| 96 | + | [18] = {51, 18, "Raro"}, | |
| 97 | + | [19] = {55, 19, "Raro"}, | |
| 98 | + | [20] = {59, 20, "Raro"}, | |
| 99 | + | ||
| 100 | + | [21] = {63, 06, "�pico"}, | |
| 101 | + | [22] = {67, 07, "�pico"}, | |
| 102 | + | [23] = {72, 08, "�pico"}, | |
| 103 | + | [24] = {77, 09, "�pico"}, | |
| 104 | + | [25] = {80, 10, "�pico"}, | |
| 105 | + | [26] = {85, 11, "�pico"}, | |
| 106 | + | [27] = {89, 12, "�pico"}, | |
| 107 | + | [28] = {94, 13, "�pico"}, | |
| 108 | + | [29] = {99, 14, "�pico"}, | |
| 109 | + | [30] = {104, 15, "�pico"}, | |
| 110 | + | ||
| 111 | + | [31] = {110, 01, "Lend�rio"}, | |
| 112 | + | [32] = {115, 02, "Lend�rio"}, | |
| 113 | + | [33] = {120, 03, "Lend�rio"}, | |
| 114 | + | [34] = {125, 04, "Lend�rio"}, | |
| 115 | + | [35] = {130, 05, "Lend�rio"}, | |
| 116 | + | [36] = {135, 06, "Lend�rio"}, | |
| 117 | + | [37] = {140, 07, "Lend�rio"}, | |
| 118 | + | [38] = {145, 08, "Lend�rio"}, | |
| 119 | + | [39] = {150, 09, "Lend�rio"}, | |
| 120 | + | [40] = {154, 10, "Lend�rio"}, | |
| 121 | + | } | |
| 122 | + | for X = 01, #PERCENT_DROP do | |
| 123 | + | if CountDG <= PERCENT_DROP[X][01] then | |
| 124 | + | chancePercent = PERCENT_DROP[X][02] | |
| 125 | + | rareText = PERCENT_DROP[X][03] | |
| 126 | + | break | |
| 127 | + | elseif CountDG > 155 then | |
| 128 | + | chancePercent = 10 | |
| 129 | + | rareText = "Lend�rio" | |
| 130 | + | break | |
| 131 | + | end | |
| 132 | + | end | |
| 133 | + | if Game.getStorageValue(_GLOBAL_RANDOM.DAILY_EVENTS.STORAGE) == 07 then | |
| 134 | + | local party = player:getParty() | |
| 135 | + | if party then | |
| 136 | + | chancePercent = chancePercent + 10 | |
| 137 | + | end | |
| 138 | + | end | |
| 139 | + | player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Abrindo ba� com " ..chancePercent.. "% de chance de obter equipamentos de raridade " ..rareText.. ".") | |
| 140 | + | if math.random(00, Dificulty) < chancePercent then | |
| 141 | + | rare = DANGEROUS_MAX[DANG_C][02] | |
| 142 | + | else | |
| 143 | + | local resetRare = (DANGEROUS_MAX[DANG_C][02] - 01) | |
| 144 | + | if resetRare < 00 then | |
| 145 | + | resetRare = 00 | |
| 146 | + | end | |
| 147 | + | rare = math.random(00, resetRare) | |
| 148 | + | end | |
| 149 | + | end | |
| 150 | + | ||
| 151 | + | if _ITEMS[itemid] then | |
| 152 | + | if doBackpack(player, 00, slot, ext, 01) then | |
| 153 | + | if slot == 3 then | |
| 154 | + | doBackpack(player, 03, slot, ext, 01, itemid) -- Procurar | |
| 155 | + | if doBackpack(player, 01, slot, ext, 0, itemid, rare, star, qnt) then | |
| 156 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Voc� recebeu o item [ " .._ITEMS[itemid].NAME.. ", x" ..qnt.." ].") | |
| 157 | + | player:getPosition():sendMagicEffect(14) | |
| 158 | + | end | |
| 159 | + | else | |
| 160 | + | if doBackpack(player, 01, slot, ext, 0, itemid, rare, star, qnt) then | |
| 161 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Voc� recebeu o item [ " .._ITEMS[itemid].NAME.. " ].") | |
| 162 | + | player:getPosition():sendMagicEffect(14) | |
| 163 | + | end | |
| 164 | + | end | |
| 165 | + | else | |
| 166 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Sua Backpack esta cheia.") | |
| 167 | + | player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Sua Backpack esta cheia.") | |
| 168 | + | player:getPosition():sendMagicEffect(03) | |
| 169 | + | return false | |
| 170 | + | end | |
| 171 | + | else | |
| 172 | + | player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Erro no Loot. Contate o Administrador.") | |
| 173 | + | end | |
| 174 | + | ||
| 175 | + | player:setStorageValue(TAG.RECOMPENSA[01], (player:getStorageValue(TAG.RECOMPENSA[01]) - 1)) | |
| 176 | + | if player:getStorageValue(TAG.RECOMPENSA[01]) == 0 then | |
| 177 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Clique novamente no ba� para sair da DG.") | |
| 178 | + | player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Clique novamente no ba� para sair da DG.") | |
| 179 | + | else | |
| 180 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Voc� ainda pode usar o Bau " ..player:getStorageValue(TAG.RECOMPENSA[01]).. " vezes.") | |
| 181 | + | player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Voc� ainda pode usar o Bau " ..player:getStorageValue(TAG.RECOMPENSA[01]).. " vezes.") | |
| 182 | + | end | |
| 183 | + | else | |
| 184 | + | --player:teleportTo({x=3999, y=991, z=7}) | |
| 185 | + | player:teleportTo(_SYSTEM.NEXUS[DG_RECOMPENSAS[item.uid].NEXUS].POS) | |
| 186 | + | player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) | |
| 187 | + | Game.setStorageValue(TAG.STORAGE, nil) | |
| 188 | + | player:sendCancelMessage("@DGTime 0 " ..DG_RECOMPENSAS[item.uid].NEXUS.. " " ..DG_RECOMPENSAS[item.uid].INDEX) | |
| 189 | + | player:setTown(Town(01)) | |
| 190 | + | -- DESAFIO | |
| 191 | + | if player:getStorageValue(_DESAFIOS[00].DESAFIO_ID) > 00 then | |
| 192 | + | if DG_RECOMPENSAS[item.uid].NEXUS == 01 then | |
| 193 | + | onPlayerDesafios(player, 21, 01) | |
| 194 | + | elseif DG_RECOMPENSAS[item.uid].NEXUS == 02 then | |
| 195 | + | onPlayerDesafios(player, 22, 01) | |
| 196 | + | elseif DG_RECOMPENSAS[item.uid].NEXUS == 03 then | |
| 197 | + | onPlayerDesafios(player, 23, 01) | |
| 198 | + | elseif DG_RECOMPENSAS[item.uid].NEXUS == 04 then | |
| 199 | + | onPlayerDesafios(player, 24, 01) | |
| 200 | + | elseif DG_RECOMPENSAS[item.uid].NEXUS == 05 then | |
| 201 | + | onPlayerDesafios(player, 25, 01) | |
| 202 | + | elseif DG_RECOMPENSAS[item.uid].NEXUS == 06 then | |
| 203 | + | onPlayerDesafios(player, 26, 01) | |
| 204 | + | elseif DG_RECOMPENSAS[item.uid].NEXUS == 07 then | |
| 205 | + | onPlayerDesafios(player, 27, 01) | |
| 206 | + | elseif DG_RECOMPENSAS[item.uid].NEXUS == 08 then | |
| 207 | + | onPlayerDesafios(player, 28, 01) | |
| 208 | + | elseif DG_RECOMPENSAS[item.uid].NEXUS == 09 then | |
| 209 | + | onPlayerDesafios(player, 29, 01) | |
| 210 | + | end | |
| 211 | + | end | |
| 212 | + | ||
| 213 | + | for X = 01, #_SYSTEM.DANGEROUS do | |
| 214 | + | for Z = 01, #_SYSTEM.DANGEROUS[X] do | |
| 215 | + | player:setStorageValue(_SYSTEM.DANGEROUS[X][Z].STORAGE, nil) | |
| 216 | + | player:setStorageValue(_SYSTEM.DANGEROUS[X][Z].RECOMPENSA[01], nil) | |
| 217 | + | end | |
| 218 | + | end | |
| 219 | + | ||
| 220 | + | if DG_RECOMPENSAS[item.uid].NEXUS == 02 then | |
| 221 | + | if player:getStorageValue(_QUESTLOG[77].UID_01) == 01 then | |
| 222 | + | player:setStorageValue(_QUESTLOG[77].UID_01, 100) | |
| 223 | + | player:setStorageValue(_QUESTLOG[78].UID_01, 01) | |
| 224 | + | player:setStorageValue(10888, 00) | |
| 225 | + | player:sendCancelMessage("@LoadQuestWindows") | |
| 226 | + | ||
| 227 | + | addEvent(function() | |
| 228 | + | player:addExperience(2700, true, true) | |
| 229 | + | PlayerGoldCoins(player, 02, 1200) | |
| 230 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.") | |
| 231 | + | end, 5000) | |
| 232 | + | end | |
| 233 | + | if player:getStorageValue(_QUESTLOG[84].UID_01) == 02 then | |
| 234 | + | if player:getStorageValue(10896) == 04 then | |
| 235 | + | player:setStorageValue(_QUESTLOG[84].UID_01, 100) | |
| 236 | + | player:setStorageValue(10896, nil) | |
| 237 | + | player:sendCancelMessage("@LoadQuestWindows") | |
| 238 | + | ||
| 239 | + | addEvent(function() | |
| 240 | + | player:addExperience(15000, true, true) | |
| 241 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.") | |
| 242 | + | end, 4000) | |
| 243 | + | else | |
| 244 | + | if player:getStorageValue(10896) < 00 then | |
| 245 | + | player:setStorageValue(10896, 01) | |
| 246 | + | else | |
| 247 | + | player:setStorageValue(10896, (player:getStorageValue(10896) + 01)) | |
| 248 | + | end | |
| 249 | + | end | |
| 250 | + | end | |
| 251 | + | end | |
| 252 | + | if DG_RECOMPENSAS[item.uid].NEXUS == 01 then | |
| 253 | + | if player:getStorageValue(_QUESTLOG[29].UID_01) == 02 then | |
| 254 | + | player:setStorageValue(_QUESTLOG[29].UID_01, 03) | |
| 255 | + | player:sendCancelMessage("@LoadQuestWindows") | |
| 256 | + | ||
| 257 | + | addEvent(function() player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.") end, 5 * 1000) | |
| 258 | + | end | |
| 259 | + | if player:getStorageValue(_QUESTLOG[72].UID_01) == 02 then | |
| 260 | + | if player:getStorageValue(10880) == 04 then | |
| 261 | + | player:setStorageValue(_QUESTLOG[73].UID_01, 01) | |
| 262 | + | player:setStorageValue(_QUESTLOG[72].UID_01, 100) | |
| 263 | + | player:setStorageValue(10880, nil) | |
| 264 | + | player:sendCancelMessage("@LoadQuestWindows") | |
| 265 | + | ||
| 266 | + | addEvent(function() | |
| 267 | + | player:addExperience(5000, true, true) | |
| 268 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.") | |
| 269 | + | end, 4000) | |
| 270 | + | else | |
| 271 | + | if player:getStorageValue(10880) < 00 then | |
| 272 | + | player:setStorageValue(10880, 01) | |
| 273 | + | else | |
| 274 | + | player:setStorageValue(10880, (player:getStorageValue(10880) + 01)) | |
| 275 | + | end | |
| 276 | + | end | |
| 277 | + | end | |
| 278 | + | end | |
| 279 | + | if DG_RECOMPENSAS[item.uid].NEXUS == 04 then | |
| 280 | + | if player:getStorageValue(_QUESTLOG[89].UID_01) == 01 then | |
| 281 | + | if player:getStorageValue(10903) == 04 then | |
| 282 | + | player:setStorageValue(_QUESTLOG[89].UID_01, 100) | |
| 283 | + | player:setStorageValue(10903, nil) | |
| 284 | + | player:sendCancelMessage("@LoadQuestWindows") | |
| 285 | + | ||
| 286 | + | addEvent(function() | |
| 287 | + | player:addExperience(25000, true, true) | |
| 288 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.") | |
| 289 | + | end, 5000) | |
| 290 | + | else | |
| 291 | + | if player:getStorageValue(10903) < 00 then | |
| 292 | + | player:setStorageValue(10903, 01) | |
| 293 | + | else | |
| 294 | + | player:setStorageValue(10903, (player:getStorageValue(10903) + 01)) | |
| 295 | + | end | |
| 296 | + | end | |
| 297 | + | end | |
| 298 | + | end | |
| 299 | + | if DG_RECOMPENSAS[item.uid].NEXUS == 03 then | |
| 300 | + | if player:getStorageValue(_QUESTLOG[96].UID_01) == 02 then | |
| 301 | + | player:setStorageValue(_QUESTLOG[96].UID_01, 100) | |
| 302 | + | player:setStorageValue(_QUESTLOG[98].UID_01, 01) | |
| 303 | + | player:sendCancelMessage("@LoadQuestWindows") | |
| 304 | + | ||
| 305 | + | addEvent(function() | |
| 306 | + | player:addExperience(13000, true, true) | |
| 307 | + | PlayerGoldCoins(player, 02, 3800) | |
| 308 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.") | |
| 309 | + | end, 4000) | |
| 310 | + | end | |
| 311 | + | if player:getStorageValue(_QUESTLOG[98].UID_01) == 01 then | |
| 312 | + | if player:getStorageValue(10915) == 04 then | |
| 313 | + | player:setStorageValue(_QUESTLOG[98].UID_01, 100) | |
| 314 | + | player:setStorageValue(10915, nil) | |
| 315 | + | player:sendCancelMessage("@LoadQuestWindows") | |
| 316 | + | ||
| 317 | + | addEvent(function() | |
| 318 | + | player:addExperience(35500, true, true) | |
| 319 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.") | |
| 320 | + | end, 4000) | |
| 321 | + | else | |
| 322 | + | if player:getStorageValue(10915) < 00 then | |
| 323 | + | player:setStorageValue(10915, 01) | |
| 324 | + | else | |
| 325 | + | player:setStorageValue(10915, (player:getStorageValue(10915) + 01)) | |
| 326 | + | end | |
| 327 | + | end | |
| 328 | + | end | |
| 329 | + | end | |
| 330 | + | if DG_RECOMPENSAS[item.uid].NEXUS == 05 then | |
| 331 | + | if player:getStorageValue(_QUESTLOG[109].UID_01) == 01 then | |
| 332 | + | if player:getStorageValue(10931) == 04 then | |
| 333 | + | player:setStorageValue(_QUESTLOG[109].UID_01, 100) | |
| 334 | + | player:setStorageValue(10931, nil) | |
| 335 | + | player:sendCancelMessage("@LoadQuestWindows") | |
| 336 | + | ||
| 337 | + | addEvent(function() | |
| 338 | + | player:addExperience(45000, true, true) | |
| 339 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.") | |
| 340 | + | end, 4000) | |
| 341 | + | else | |
| 342 | + | if player:getStorageValue(10931) < 00 then | |
| 343 | + | player:setStorageValue(10931, 01) | |
| 344 | + | else | |
| 345 | + | player:setStorageValue(10931, (player:getStorageValue(10931) + 01)) | |
| 346 | + | end | |
| 347 | + | end | |
| 348 | + | end | |
| 349 | + | end | |
| 350 | + | if DG_RECOMPENSAS[item.uid].NEXUS == 06 then | |
| 351 | + | if player:getStorageValue(_QUESTLOG[119].UID_01) == 01 then | |
| 352 | + | if player:getStorageValue(10945) == 04 then | |
| 353 | + | player:setStorageValue(_QUESTLOG[119].UID_01, 100) | |
| 354 | + | player:setStorageValue(10945, nil) | |
| 355 | + | player:sendCancelMessage("@LoadQuestWindows") | |
| 356 | + | ||
| 357 | + | addEvent(function() | |
| 358 | + | player:addExperience(60000, true, true) | |
| 359 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.") | |
| 360 | + | end, 4000) | |
| 361 | + | else | |
| 362 | + | if player:getStorageValue(10945) < 00 then | |
| 363 | + | player:setStorageValue(10945, 01) | |
| 364 | + | else | |
| 365 | + | player:setStorageValue(10945, (player:getStorageValue(10945) + 01)) | |
| 366 | + | end | |
| 367 | + | end | |
| 368 | + | end | |
| 369 | + | end | |
| 370 | + | if DG_RECOMPENSAS[item.uid].NEXUS == 08 then | |
| 371 | + | if player:getStorageValue(_QUESTLOG[179].UID_01) == 01 then | |
| 372 | + | player:setStorageValue(_QUESTLOG[179].UID_01, 100) | |
| 373 | + | player:setStorageValue(_QUESTLOG[182].UID_01, 001) | |
| 374 | + | ||
| 375 | + | player:sendCancelMessage("@LoadQuestWindows") | |
| 376 | + | addEvent(function() | |
| 377 | + | player:addExperience(50000, true, true) | |
| 378 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.") | |
| 379 | + | end, 4000) | |
| 380 | + | elseif player:getStorageValue(_QUESTLOG[182].UID_01) == 01 then | |
| 381 | + | if player:getStorageValue(11015) == 04 then | |
| 382 | + | player:setStorageValue(_QUESTLOG[182].UID_01, 100) | |
| 383 | + | player:setStorageValue(11015, nil) | |
| 384 | + | player:sendCancelMessage("@LoadQuestWindows") | |
| 385 | + | ||
| 386 | + | addEvent(function() player:addExperience(90000, true, true) end, 4 * 1000) | |
| 387 | + | addEvent(function() player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.") end, 4 * 1000) | |
| 388 | + | else | |
| 389 | + | if player:getStorageValue(11015) < 00 then | |
| 390 | + | player:setStorageValue(11015, 01) | |
| 391 | + | else | |
| 392 | + | player:setStorageValue(11015, (player:getStorageValue(11015) + 01)) | |
| 393 | + | end | |
| 394 | + | end | |
| 395 | + | end | |
| 396 | + | end | |
| 397 | + | if DG_RECOMPENSAS[item.uid].NEXUS == 09 then | |
| 398 | + | if player:getStorageValue(_QUESTLOG[190].UID_01) == 02 then | |
| 399 | + | player:setStorageValue(_QUESTLOG[190].UID_01, 100) | |
| 400 | + | player:setStorageValue(_QUESTLOG[191].UID_01, 001) | |
| 401 | + | player:setStorageValue(_QUESTLOG[192].UID_01, 001) | |
| 402 | + | ||
| 403 | + | addEvent(function() | |
| 404 | + | player:sendCancelMessage("@LoadQuestWindows") | |
| 405 | + | player:addExperience(83000, true, true) | |
| 406 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.") | |
| 407 | + | end, 4000) | |
| 408 | + | elseif player:getStorageValue(_QUESTLOG[191].UID_01) == 01 then | |
| 409 | + | if player:getStorageValue(11026) == 04 then | |
| 410 | + | player:setStorageValue(_QUESTLOG[191].UID_01, 100) | |
| 411 | + | player:setStorageValue(11026, nil) | |
| 412 | + | player:sendCancelMessage("@LoadQuestWindows") | |
| 413 | + | ||
| 414 | + | addEvent(function() | |
| 415 | + | player:addExperience(100000, true, true) | |
| 416 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.") | |
| 417 | + | end, 4000) | |
| 418 | + | else | |
| 419 | + | if player:getStorageValue(11026) < 00 then | |
| 420 | + | player:setStorageValue(11026, 01) | |
| 421 | + | else | |
| 422 | + | player:setStorageValue(11026, (player:getStorageValue(11026) + 01)) | |
| 423 | + | end | |
| 424 | + | end | |
| 425 | + | end | |
| 426 | + | end | |
| 427 | + | if DG_RECOMPENSAS[item.uid].NEXUS == 10 then | |
| 428 | + | if player:getStorageValue(_QUESTLOG[199].UID_01) == 02 then | |
| 429 | + | player:setStorageValue(_QUESTLOG[199].UID_01, 03) | |
| 430 | + | ||
| 431 | + | addEvent(function() | |
| 432 | + | player:addExperience(100000, true, true) | |
| 433 | + | player:sendCancelMessage("@LoadQuestWindows") | |
| 434 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.") | |
| 435 | + | end, 4000) | |
| 436 | + | elseif player:getStorageValue(_QUESTLOG[200].UID_01) == 01 then | |
| 437 | + | if player:getStorageValue(11038) == 04 then | |
| 438 | + | player:setStorageValue(_QUESTLOG[200].UID_01, 100) | |
| 439 | + | player:setStorageValue(11038, nil) | |
| 440 | + | player:sendCancelMessage("@LoadQuestWindows") | |
| 441 | + | ||
| 442 | + | addEvent(function() | |
| 443 | + | player:addExperience(150000, true, true) | |
| 444 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.") | |
| 445 | + | end, 4000) | |
| 446 | + | else | |
| 447 | + | if player:getStorageValue(11038) < 00 then | |
| 448 | + | player:setStorageValue(11038, 01) | |
| 449 | + | else | |
| 450 | + | player:setStorageValue(11038, (player:getStorageValue(11038) + 01)) | |
| 451 | + | end | |
| 452 | + | end | |
| 453 | + | end | |
| 454 | + | end | |
| 455 | + | ||
| 456 | + | doBackpack(player, 12) | |
| 457 | + | PlayerMetas(player, 1001, 01, DG_RECOMPENSAS[item.uid].NEXUS) | |
| 458 | + | player:popupFYI("Dangerous concluida com sucesso!") | |
| 459 | + | end | |
| 460 | + | end | |
| 461 | + | ||
| 462 | + | return false | |
| 463 | + | end |
| @@ -0,0 +1,83 @@ | |||
| 1 | + | function onCheckImortalArea() | |
| 2 | + | local from = {x=3795, y=1291, z=8} | |
| 3 | + | local to = {x=3854, y=1334, z=8} | |
| 4 | + | local check = true | |
| 5 | + | for A = from.x, to.x do | |
| 6 | + | for B = from.y, to.y do | |
| 7 | + | for C = from.z, to.z do | |
| 8 | + | local tile = Tile(A, B, C) | |
| 9 | + | if tile ~= nil then | |
| 10 | + | local creature = tile:getTopCreature() | |
| 11 | + | if creature and creature:isMonster() then | |
| 12 | + | check = false | |
| 13 | + | break | |
| 14 | + | end | |
| 15 | + | end | |
| 16 | + | end | |
| 17 | + | end | |
| 18 | + | end | |
| 19 | + | ||
| 20 | + | return check | |
| 21 | + | end | |
| 22 | + | function onUse(player, item, fromPosition, target, toPosition, isHotkey) | |
| 23 | + | local party = player:getParty() | |
| 24 | + | local DG_IMORTALS = { | |
| 25 | + | [01] = {NAME = "Obujos", POS = {x=3826, y=1318, z=8}}; --33K | |
| 26 | + | [02] = {NAME = "Annihilon", POS = {x=3826, y=1318, z=8}}; --46K | |
| 27 | + | [03] = {NAME = "Ghazbaran", POS = {x=3826, y=1318, z=8}}; --60K | |
| 28 | + | [04] = {NAME = "Snake God Essence", POS = {x=3826, y=1318, z=8}}; --65K | |
| 29 | + | [05] = {NAME = "Professor Maxxen", POS = {x=3826, y=1318, z=8}}; --90K | |
| 30 | + | [06] = {NAME = "Lizard Abomination", POS = {x=3826, y=1318, z=8}}; --95K | |
| 31 | + | } | |
| 32 | + | ||
| 33 | + | local ID_IMORTAL = player:getStorageValue(_SYSTEM.DANGEROUS[06][02].STORAGE) | |
| 34 | + | if ID_IMORTAL == 07 then | |
| 35 | + | if onCheckImortalArea() then | |
| 36 | + | if not party then | |
| 37 | + | player:getPosition():sendMagicEffect(13) | |
| 38 | + | player:setStorageValue(_SYSTEM.DANGEROUS[06][02].STORAGE, 08) | |
| 39 | + | player:setStorageValue(_SYSTEM.DANGEROUS[06][02].RECOMPENSA[01], _SYSTEM.DANGEROUS[06][02].RECOMPENSA[02]) | |
| 40 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Encontre o ba� com sua recompensa.") | |
| 41 | + | else | |
| 42 | + | local members = party:getMembers() | |
| 43 | + | members[#members + 1] = party:getLeader() | |
| 44 | + | for _, member in ipairs(members) do | |
| 45 | + | member:getPosition():sendMagicEffect(13) | |
| 46 | + | member:setStorageValue(_SYSTEM.DANGEROUS[06][02].STORAGE, 08) | |
| 47 | + | member:setStorageValue(_SYSTEM.DANGEROUS[06][02].RECOMPENSA[01], _SYSTEM.DANGEROUS[06][02].RECOMPENSA[02]) | |
| 48 | + | member:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Encontre o ba� com sua recompensa.") | |
| 49 | + | end | |
| 50 | + | end | |
| 51 | + | return true | |
| 52 | + | else | |
| 53 | + | player:getPosition():sendMagicEffect(03) | |
| 54 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Limpe a �rea para continuar.") | |
| 55 | + | return true | |
| 56 | + | end | |
| 57 | + | else | |
| 58 | + | if ID_IMORTAL < 07 then | |
| 59 | + | if onCheckImortalArea() then | |
| 60 | + | if not party then | |
| 61 | + | player:getPosition():sendMagicEffect(13) | |
| 62 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Imortal 0" ..ID_IMORTAL.. ":\n[ " ..DG_IMORTALS[ID_IMORTAL].NAME.. " ].") | |
| 63 | + | player:setStorageValue(_SYSTEM.DANGEROUS[06][02].STORAGE, (ID_IMORTAL + 01)) | |
| 64 | + | else | |
| 65 | + | local members = party:getMembers() | |
| 66 | + | members[#members + 1] = party:getLeader() | |
| 67 | + | for _, member in ipairs(members) do | |
| 68 | + | member:getPosition():sendMagicEffect(13) | |
| 69 | + | member:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Imortal 0" ..ID_IMORTAL.. ":\n[ " ..DG_IMORTALS[ID_IMORTAL].NAME.. " ].") | |
| 70 | + | member:setStorageValue(_SYSTEM.DANGEROUS[06][02].STORAGE, (ID_IMORTAL + 01)) | |
| 71 | + | end | |
| 72 | + | end | |
| 73 | + | Game.createMonster(DG_IMORTALS[ID_IMORTAL].NAME, DG_IMORTALS[ID_IMORTAL].POS) | |
| 74 | + | else | |
| 75 | + | player:getPosition():sendMagicEffect(03) | |
| 76 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Limpe a �rea para continuar.") | |
| 77 | + | return true | |
| 78 | + | end | |
| 79 | + | else | |
| 80 | + | player:getPosition():sendMagicEffect(03) | |
| 81 | + | end | |
| 82 | + | end | |
| 83 | + | end |
| @@ -0,0 +1,399 @@ | |||
| 1 | + | local AngelPos_1 = Position(3974, 1842, 14) | |
| 2 | + | local AngelPos_2 = Position(4057, 1842, 14) | |
| 3 | + | local AngelPos_3 = Position(4140, 1842, 14) | |
| 4 | + | local CLEAR_AREA = { | |
| 5 | + | [10420] = {POS_X = {x=3938, y=1850, z=14}, POS_Y = {x=3964, y=1861, z=14}, toPos = {x=3953, y=1847, z=14}}; | |
| 6 | + | [10564] = {POS_X = {x=4021, y=1850, z=14}, POS_Y = {x=4047, y=1861, z=14}, toPos = {x=4036, y=1847, z=14}}; | |
| 7 | + | [10565] = {POS_X = {x=4104, y=1850, z=14}, POS_Y = {x=4130, y=1861, z=14}, toPos = {x=4119, y=1847, z=14}}; | |
| 8 | + | } | |
| 9 | + | function onUse(player, item, fromPosition, target, toPosition, isHotkey) | |
| 10 | + | local party = player:getParty() | |
| 11 | + | if CLEAR_AREA[item.uid] then | |
| 12 | + | if player:getStorageValue(_SYSTEM.DANGEROUS[10][01].STORAGE) < 02 then | |
| 13 | + | if player:getStorageValue(_SYSTEM.DANGEROUS[10][01].STORAGE) == 01 then | |
| 14 | + | local from = CLEAR_AREA[item.uid].POS_X | |
| 15 | + | local to = CLEAR_AREA[item.uid].POS_Y | |
| 16 | + | local checkArea = 0 | |
| 17 | + | for A = from.x, to.x do | |
| 18 | + | for B = from.y, to.y do | |
| 19 | + | for C = from.z, to.z do | |
| 20 | + | local tile = Tile(A, B, C) | |
| 21 | + | local creature = tile:getTopCreature() | |
| 22 | + | if creature and creature:isMonster() then | |
| 23 | + | local master = creature:getMaster() | |
| 24 | + | if master and master:isPlayer() then | |
| 25 | + | else | |
| 26 | + | checkArea = 01 | |
| 27 | + | break | |
| 28 | + | end | |
| 29 | + | end | |
| 30 | + | end | |
| 31 | + | end | |
| 32 | + | end | |
| 33 | + | if checkArea == 0 then | |
| 34 | + | if not party then | |
| 35 | + | player:setStorageValue(_SYSTEM.DANGEROUS[10][01].STORAGE, 02) | |
| 36 | + | player:getPosition():sendMagicEffect(15) | |
| 37 | + | else | |
| 38 | + | local members = party:getMembers() | |
| 39 | + | members[#members + 1] = party:getLeader() | |
| 40 | + | for _, member in ipairs(members) do | |
| 41 | + | member:setStorageValue(_SYSTEM.DANGEROUS[10][01].STORAGE, 02) | |
| 42 | + | member:getPosition():sendMagicEffect(15) | |
| 43 | + | end | |
| 44 | + | end | |
| 45 | + | ||
| 46 | + | player:sendCancelMessage("@@TutorShow 26") | |
| 47 | + | player:teleportTo(CLEAR_AREA[item.uid].toPos) | |
| 48 | + | player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) | |
| 49 | + | return true | |
| 50 | + | else | |
| 51 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Sacrif�cio necess�rio! Elimine todos os monstros dessa �rea para continuar.") | |
| 52 | + | player:getPosition():sendMagicEffect(03) | |
| 53 | + | return true | |
| 54 | + | end | |
| 55 | + | else | |
| 56 | + | player:getPosition():sendMagicEffect(03) | |
| 57 | + | return true | |
| 58 | + | end | |
| 59 | + | else | |
| 60 | + | if player:getStorageValue(_SYSTEM.DANGEROUS[10][01].STORAGE) == 02 then | |
| 61 | + | player:sendCancelMessage("@@TutorShow 26") | |
| 62 | + | end | |
| 63 | + | player:teleportTo(CLEAR_AREA[item.uid].toPos) | |
| 64 | + | player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) | |
| 65 | + | return true | |
| 66 | + | end | |
| 67 | + | end | |
| 68 | + | if item.uid == 10429 or item.uid == 10566 or item.uid == 10567 then | |
| 69 | + | if player:getStorageValue(_SYSTEM.DANGEROUS[10][01].STORAGE) >= 06 then | |
| 70 | + | if item.uid == 10429 then | |
| 71 | + | player:teleportTo({x=3958, y=1835, z=14}) | |
| 72 | + | elseif item.uid == 10566 then | |
| 73 | + | player:teleportTo({x=4041, y=1835, z=14}) | |
| 74 | + | elseif item.uid == 10567 then | |
| 75 | + | player:teleportTo({x=4124, y=1835, z=14}) | |
| 76 | + | end | |
| 77 | + | player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) | |
| 78 | + | ||
| 79 | + | if player:getStorageValue(_SYSTEM.DANGEROUS[10][01].STORAGE) == 06 then | |
| 80 | + | player:sendCancelMessage("@@TutorShow 27") | |
| 81 | + | end | |
| 82 | + | return true | |
| 83 | + | else | |
| 84 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Ative todos os crystais de acordo com sua ess�ncia.") | |
| 85 | + | player:getPosition():sendMagicEffect(03) | |
| 86 | + | return true | |
| 87 | + | end | |
| 88 | + | end | |
| 89 | + | if item.uid == 10434 or item.uid == 10568 or item.uid == 10569 then | |
| 90 | + | if player:getStorageValue(_SYSTEM.DANGEROUS[10][01].STORAGE) == 07 then | |
| 91 | + | if item.uid == 10434 then | |
| 92 | + | player:teleportTo({x=3980, y=1860, z=14}) | |
| 93 | + | STEP_1 = 00 | |
| 94 | + | elseif item.uid == 10568 then | |
| 95 | + | player:teleportTo({x=4063, y=1860, z=14}) | |
| 96 | + | STEP_2 = 00 | |
| 97 | + | elseif item.uid == 10569 then | |
| 98 | + | player:teleportTo({x=4146, y=1860, z=14}) | |
| 99 | + | STEP_3 = 00 | |
| 100 | + | end | |
| 101 | + | player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) | |
| 102 | + | if player:getStorageValue(_SYSTEM.DANGEROUS[10][01].STORAGE) == 07 then | |
| 103 | + | player:sendCancelMessage("@@TutorShow 28") | |
| 104 | + | end | |
| 105 | + | return true | |
| 106 | + | else | |
| 107 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Toque a sequ�ncia no ritmo correto para continuar.") | |
| 108 | + | player:getPosition():sendMagicEffect(03) | |
| 109 | + | return true | |
| 110 | + | end | |
| 111 | + | end | |
| 112 | + | if item.uid == 10436 or item.uid == 10570 or item.uid == 10571 then | |
| 113 | + | if player:getStorageValue(_SYSTEM.DANGEROUS[10][01].STORAGE) == 08 then | |
| 114 | + | if item.uid == 10436 then | |
| 115 | + | player:teleportTo({x=3945, y=1840, z=14}) | |
| 116 | + | elseif item.uid == 10570 then | |
| 117 | + | player:teleportTo({x=4028, y=1840, z=14}) | |
| 118 | + | elseif item.uid == 10571 then | |
| 119 | + | player:teleportTo({x=4111, y=1840, z=14}) | |
| 120 | + | end | |
| 121 | + | player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) | |
| 122 | + | return true | |
| 123 | + | else | |
| 124 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Conduza a ess�ncia at� a est�tua usando seu corpo como guia.") | |
| 125 | + | player:getPosition():sendMagicEffect(03) | |
| 126 | + | return true | |
| 127 | + | end | |
| 128 | + | end | |
| 129 | + | -- SOUND PUZZLE | |
| 130 | + | if item.uid == 10430 or item.uid == 10574 or item.uid == 10575 then | |
| 131 | + | if player:getStorageValue(_SYSTEM.DANGEROUS[10][01].STORAGE) == 06 then | |
| 132 | + | if player:getStorageValue(_SYSTEM.RECYCLER_STORAGE) < 01 then | |
| 133 | + | player:setStorageValue(_SYSTEM.RECYCLER_STORAGE, 01) | |
| 134 | + | player:getPosition():sendMagicEffect(19) | |
| 135 | + | if item.uid == 10430 then | |
| 136 | + | AngelPos_1:sendMagicEffect(36) | |
| 137 | + | elseif item.uid == 10574 then | |
| 138 | + | AngelPos_2:sendMagicEffect(36) | |
| 139 | + | elseif item.uid == 10575 then | |
| 140 | + | AngelPos_3:sendMagicEffect(36) | |
| 141 | + | end | |
| 142 | + | return true | |
| 143 | + | elseif player:getStorageValue(_SYSTEM.RECYCLER_STORAGE) == 01 then | |
| 144 | + | player:setStorageValue(_SYSTEM.RECYCLER_STORAGE, 02) | |
| 145 | + | player:getPosition():sendMagicEffect(19) | |
| 146 | + | if item.uid == 10430 then | |
| 147 | + | AngelPos_1:sendMagicEffect(36) | |
| 148 | + | elseif item.uid == 10574 then | |
| 149 | + | AngelPos_2:sendMagicEffect(36) | |
| 150 | + | elseif item.uid == 10575 then | |
| 151 | + | AngelPos_3:sendMagicEffect(36) | |
| 152 | + | end | |
| 153 | + | return true | |
| 154 | + | else | |
| 155 | + | player:setStorageValue(_SYSTEM.RECYCLER_STORAGE, nil) | |
| 156 | + | player:getPosition():sendMagicEffect(03) | |
| 157 | + | if item.uid == 10430 then | |
| 158 | + | AngelPos_1:sendMagicEffect(06) | |
| 159 | + | elseif item.uid == 10574 then | |
| 160 | + | AngelPos_2:sendMagicEffect(06) | |
| 161 | + | elseif item.uid == 10575 then | |
| 162 | + | AngelPos_3:sendMagicEffect(06) | |
| 163 | + | end | |
| 164 | + | end | |
| 165 | + | else | |
| 166 | + | player:getPosition():sendMagicEffect(03) | |
| 167 | + | return true | |
| 168 | + | end | |
| 169 | + | elseif item.uid == 10431 or item.uid == 10576 or item.uid == 10577 then | |
| 170 | + | if player:getStorageValue(_SYSTEM.DANGEROUS[10][01].STORAGE) == 06 then | |
| 171 | + | if player:getStorageValue(_SYSTEM.RECYCLER_STORAGE) == 02 then | |
| 172 | + | player:setStorageValue(_SYSTEM.RECYCLER_STORAGE, 03) | |
| 173 | + | player:getPosition():sendMagicEffect(20) | |
| 174 | + | if item.uid == 10431 then | |
| 175 | + | AngelPos_1:sendMagicEffect(36) | |
| 176 | + | elseif item.uid == 10576 then | |
| 177 | + | AngelPos_2:sendMagicEffect(36) | |
| 178 | + | elseif item.uid == 10577 then | |
| 179 | + | AngelPos_3:sendMagicEffect(36) | |
| 180 | + | end | |
| 181 | + | return true | |
| 182 | + | elseif player:getStorageValue(_SYSTEM.RECYCLER_STORAGE) == 04 then | |
| 183 | + | player:setStorageValue(_SYSTEM.RECYCLER_STORAGE, 05) | |
| 184 | + | player:getPosition():sendMagicEffect(20) | |
| 185 | + | if item.uid == 10431 then | |
| 186 | + | AngelPos_1:sendMagicEffect(36) | |
| 187 | + | elseif item.uid == 10576 then | |
| 188 | + | AngelPos_2:sendMagicEffect(36) | |
| 189 | + | elseif item.uid == 10577 then | |
| 190 | + | AngelPos_3:sendMagicEffect(36) | |
| 191 | + | end | |
| 192 | + | return true | |
| 193 | + | elseif player:getStorageValue(_SYSTEM.RECYCLER_STORAGE) == 08 then | |
| 194 | + | player:setStorageValue(_SYSTEM.RECYCLER_STORAGE, nil) | |
| 195 | + | if item.uid == 10431 then | |
| 196 | + | AngelPos_1:sendMagicEffect(36) | |
| 197 | + | elseif item.uid == 10576 then | |
| 198 | + | AngelPos_2:sendMagicEffect(36) | |
| 199 | + | elseif item.uid == 10577 then | |
| 200 | + | AngelPos_3:sendMagicEffect(36) | |
| 201 | + | end | |
| 202 | + | ||
| 203 | + | if not party then | |
| 204 | + | player:setStorageValue(_SYSTEM.DANGEROUS[10][01].STORAGE, 07) | |
| 205 | + | player:getPosition():sendMagicEffect(15) | |
| 206 | + | else | |
| 207 | + | local members = party:getMembers() | |
| 208 | + | members[#members + 1] = party:getLeader() | |
| 209 | + | for _, member in ipairs(members) do | |
| 210 | + | member:setStorageValue(_SYSTEM.DANGEROUS[10][01].STORAGE, 07) | |
| 211 | + | member:setStorageValue(_SYSTEM.RECYCLER_STORAGE, nil) | |
| 212 | + | member:getPosition():sendMagicEffect(15) | |
| 213 | + | end | |
| 214 | + | end | |
| 215 | + | ||
| 216 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Sinfonia Conclu�da! Clique na est�tua para avan�ar.") | |
| 217 | + | return true | |
| 218 | + | else | |
| 219 | + | player:setStorageValue(_SYSTEM.RECYCLER_STORAGE, nil) | |
| 220 | + | player:getPosition():sendMagicEffect(03) | |
| 221 | + | if item.uid == 10431 then | |
| 222 | + | AngelPos_1:sendMagicEffect(06) | |
| 223 | + | elseif item.uid == 10576 then | |
| 224 | + | AngelPos_2:sendMagicEffect(06) | |
| 225 | + | elseif item.uid == 10577 then | |
| 226 | + | AngelPos_3:sendMagicEffect(06) | |
| 227 | + | end | |
| 228 | + | return true | |
| 229 | + | end | |
| 230 | + | return true | |
| 231 | + | else | |
| 232 | + | player:getPosition():sendMagicEffect(03) | |
| 233 | + | return true | |
| 234 | + | end | |
| 235 | + | elseif item.uid == 10432 or item.uid == 10578 or item.uid == 10579 then | |
| 236 | + | if player:getStorageValue(_SYSTEM.DANGEROUS[10][01].STORAGE) == 06 then | |
| 237 | + | if player:getStorageValue(_SYSTEM.RECYCLER_STORAGE) == 05 then | |
| 238 | + | player:setStorageValue(_SYSTEM.RECYCLER_STORAGE, 06) | |
| 239 | + | player:getPosition():sendMagicEffect(24) | |
| 240 | + | if item.uid == 10432 then | |
| 241 | + | AngelPos_1:sendMagicEffect(36) | |
| 242 | + | elseif item.uid == 10578 then | |
| 243 | + | AngelPos_2:sendMagicEffect(36) | |
| 244 | + | elseif item.uid == 10579 then | |
| 245 | + | AngelPos_3:sendMagicEffect(36) | |
| 246 | + | end | |
| 247 | + | return true | |
| 248 | + | elseif player:getStorageValue(_SYSTEM.RECYCLER_STORAGE) == 06 then | |
| 249 | + | player:setStorageValue(_SYSTEM.RECYCLER_STORAGE, 07) | |
| 250 | + | player:getPosition():sendMagicEffect(24) | |
| 251 | + | if item.uid == 10432 then | |
| 252 | + | AngelPos_1:sendMagicEffect(36) | |
| 253 | + | elseif item.uid == 10578 then | |
| 254 | + | AngelPos_2:sendMagicEffect(36) | |
| 255 | + | elseif item.uid == 10579 then | |
| 256 | + | AngelPos_3:sendMagicEffect(36) | |
| 257 | + | end | |
| 258 | + | return true | |
| 259 | + | elseif player:getStorageValue(_SYSTEM.RECYCLER_STORAGE) == 07 then | |
| 260 | + | player:setStorageValue(_SYSTEM.RECYCLER_STORAGE, 08) | |
| 261 | + | player:getPosition():sendMagicEffect(24) | |
| 262 | + | if item.uid == 10432 then | |
| 263 | + | AngelPos_1:sendMagicEffect(36) | |
| 264 | + | elseif item.uid == 10578 then | |
| 265 | + | AngelPos_2:sendMagicEffect(36) | |
| 266 | + | elseif item.uid == 10579 then | |
| 267 | + | AngelPos_3:sendMagicEffect(36) | |
| 268 | + | end | |
| 269 | + | return true | |
| 270 | + | else | |
| 271 | + | player:setStorageValue(_SYSTEM.RECYCLER_STORAGE, nil) | |
| 272 | + | player:getPosition():sendMagicEffect(03) | |
| 273 | + | if item.uid == 10432 then | |
| 274 | + | AngelPos_1:sendMagicEffect(06) | |
| 275 | + | elseif item.uid == 10578 then | |
| 276 | + | AngelPos_2:sendMagicEffect(06) | |
| 277 | + | elseif item.uid == 10579 then | |
| 278 | + | AngelPos_3:sendMagicEffect(06) | |
| 279 | + | end | |
| 280 | + | return true | |
| 281 | + | end | |
| 282 | + | else | |
| 283 | + | player:getPosition():sendMagicEffect(03) | |
| 284 | + | return true | |
| 285 | + | end | |
| 286 | + | elseif item.uid == 10433 or item.uid == 10580 or item.uid == 10581 then | |
| 287 | + | if player:getStorageValue(_SYSTEM.DANGEROUS[10][01].STORAGE) == 06 then | |
| 288 | + | if player:getStorageValue(_SYSTEM.RECYCLER_STORAGE) == 03 then | |
| 289 | + | player:setStorageValue(_SYSTEM.RECYCLER_STORAGE, 04) | |
| 290 | + | player:getPosition():sendMagicEffect(22) | |
| 291 | + | if item.uid == 10433 then | |
| 292 | + | AngelPos_1:sendMagicEffect(36) | |
| 293 | + | elseif item.uid == 10580 then | |
| 294 | + | AngelPos_2:sendMagicEffect(36) | |
| 295 | + | elseif item.uid == 10581 then | |
| 296 | + | AngelPos_3:sendMagicEffect(36) | |
| 297 | + | end | |
| 298 | + | return true | |
| 299 | + | else | |
| 300 | + | player:setStorageValue(_SYSTEM.RECYCLER_STORAGE, nil) | |
| 301 | + | player:getPosition():sendMagicEffect(03) | |
| 302 | + | if item.uid == 10433 then | |
| 303 | + | AngelPos_1:sendMagicEffect(06) | |
| 304 | + | elseif item.uid == 10580 then | |
| 305 | + | AngelPos_2:sendMagicEffect(06) | |
| 306 | + | elseif item.uid == 10581 then | |
| 307 | + | AngelPos_3:sendMagicEffect(06) | |
| 308 | + | end | |
| 309 | + | return true | |
| 310 | + | end | |
| 311 | + | else | |
| 312 | + | player:getPosition():sendMagicEffect(03) | |
| 313 | + | return true | |
| 314 | + | end | |
| 315 | + | end | |
| 316 | + | ||
| 317 | + | local ELEMENTS = { | |
| 318 | + | [10421] = {ID = 01, EFFECT = 54, STORAGE_ID = 02, LOOKTYPE = 11}; -- WATER | |
| 319 | + | [10422] = {ID = 02, EFFECT = 54, STORAGE_ID = 02, LOOKTYPE = 11}; -- WATER CRYSTAL | |
| 320 | + | [10582] = {ID = 01, EFFECT = 54, STORAGE_ID = 02, LOOKTYPE = 11}; -- WATER | |
| 321 | + | [10583] = {ID = 02, EFFECT = 54, STORAGE_ID = 02, LOOKTYPE = 11}; -- WATER CRYSTAL | |
| 322 | + | [10584] = {ID = 01, EFFECT = 54, STORAGE_ID = 02, LOOKTYPE = 11}; -- WATER | |
| 323 | + | [10585] = {ID = 02, EFFECT = 54, STORAGE_ID = 02, LOOKTYPE = 11}; -- WATER CRYSTAL | |
| 324 | + | ||
| 325 | + | [10423] = {ID = 01, EFFECT = 46, STORAGE_ID = 03, LOOKTYPE = 285}; -- EARTH | |
| 326 | + | [10424] = {ID = 02, EFFECT = 46, STORAGE_ID = 03, LOOKTYPE = 285}; -- EARTH CRYSTAL | |
| 327 | + | [10586] = {ID = 01, EFFECT = 46, STORAGE_ID = 03, LOOKTYPE = 285}; -- EARTH | |
| 328 | + | [10587] = {ID = 02, EFFECT = 46, STORAGE_ID = 03, LOOKTYPE = 285}; -- EARTH CRYSTAL | |
| 329 | + | [10588] = {ID = 01, EFFECT = 46, STORAGE_ID = 03, LOOKTYPE = 285}; -- EARTH | |
| 330 | + | [10589] = {ID = 02, EFFECT = 46, STORAGE_ID = 03, LOOKTYPE = 285}; -- EARTH CRYSTAL | |
| 331 | + | ||
| 332 | + | [10425] = {ID = 01, EFFECT = 12, STORAGE_ID = 04, LOOKTYPE = 290}; -- ENERGY | |
| 333 | + | [10426] = {ID = 02, EFFECT = 12, STORAGE_ID = 04, LOOKTYPE = 290}; -- ENERGY CRYSTAL | |
| 334 | + | [10590] = {ID = 01, EFFECT = 12, STORAGE_ID = 04, LOOKTYPE = 290}; -- ENERGY | |
| 335 | + | [10591] = {ID = 02, EFFECT = 12, STORAGE_ID = 04, LOOKTYPE = 290}; -- ENERGY CRYSTAL | |
| 336 | + | [10592] = {ID = 01, EFFECT = 12, STORAGE_ID = 04, LOOKTYPE = 290}; -- ENERGY | |
| 337 | + | [10593] = {ID = 02, EFFECT = 12, STORAGE_ID = 04, LOOKTYPE = 290}; -- ENERGY CRYSTAL | |
| 338 | + | ||
| 339 | + | [10427] = {ID = 01, EFFECT = 16, STORAGE_ID = 05, LOOKTYPE = 242}; -- FIRE | |
| 340 | + | [10428] = {ID = 02, EFFECT = 16, STORAGE_ID = 05, LOOKTYPE = 242}; -- FIRE CRYSTAL | |
| 341 | + | [10594] = {ID = 01, EFFECT = 16, STORAGE_ID = 05, LOOKTYPE = 242}; -- FIRE | |
| 342 | + | [10595] = {ID = 02, EFFECT = 16, STORAGE_ID = 05, LOOKTYPE = 242}; -- FIRE CRYSTAL | |
| 343 | + | [10596] = {ID = 01, EFFECT = 16, STORAGE_ID = 05, LOOKTYPE = 242}; -- FIRE | |
| 344 | + | [10597] = {ID = 02, EFFECT = 16, STORAGE_ID = 05, LOOKTYPE = 242}; -- FIRE CRYSTAL | |
| 345 | + | } | |
| 346 | + | if ELEMENTS[item.uid] then | |
| 347 | + | if ELEMENTS[item.uid].ID == 01 then | |
| 348 | + | if player:getStorageValue(_SYSTEM.DANGEROUS[10][01].STORAGE) == ELEMENTS[item.uid].STORAGE_ID then | |
| 349 | + | if player:getOutfit().lookType ~= ELEMENTS[item.uid].LOOKTYPE then | |
| 350 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Voc� tem 15 segundos para clicar no crystal correspondente a esse elemento.") | |
| 351 | + | player:getPosition():sendMagicEffect(ELEMENTS[item.uid].EFFECT) | |
| 352 | + | local condition = Condition(CONDITION_OUTFIT) | |
| 353 | + | condition:setOutfit({lookType = ELEMENTS[item.uid].LOOKTYPE}) | |
| 354 | + | condition:setTicks(15000) | |
| 355 | + | player:addCondition(condition) | |
| 356 | + | else | |
| 357 | + | player:getPosition():sendMagicEffect(03) | |
| 358 | + | return true | |
| 359 | + | end | |
| 360 | + | else | |
| 361 | + | player:getPosition():sendMagicEffect(ELEMENTS[item.uid].EFFECT) | |
| 362 | + | return true | |
| 363 | + | end | |
| 364 | + | else | |
| 365 | + | if player:getStorageValue(_SYSTEM.DANGEROUS[10][01].STORAGE) == ELEMENTS[item.uid].STORAGE_ID then | |
| 366 | + | if player:getOutfit().lookType == ELEMENTS[item.uid].LOOKTYPE then | |
| 367 | + | if not party then | |
| 368 | + | if item.uid == 10428 or item.uid == 10595 or item.uid == 10597 then | |
| 369 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Todos os Crystal Energizado! Encontre a est�tua para continuar.") | |
| 370 | + | else | |
| 371 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Crystal Energizado!") | |
| 372 | + | end | |
| 373 | + | player:setStorageValue(_SYSTEM.DANGEROUS[10][01].STORAGE, (ELEMENTS[item.uid].STORAGE_ID + 1)) | |
| 374 | + | player:getPosition():sendMagicEffect(13) | |
| 375 | + | else | |
| 376 | + | local members = party:getMembers() | |
| 377 | + | members[#members + 1] = party:getLeader() | |
| 378 | + | for _, member in ipairs(members) do | |
| 379 | + | if item.uid == 10428 or item.uid == 10595 or item.uid == 10597 then | |
| 380 | + | member:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Todos os Crystal Energizado! Encontre a est�tua para continuar.") | |
| 381 | + | else | |
| 382 | + | member:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Crystal Energizado!") | |
| 383 | + | end | |
| 384 | + | member:setStorageValue(_SYSTEM.DANGEROUS[10][01].STORAGE, (ELEMENTS[item.uid].STORAGE_ID + 1)) | |
| 385 | + | member:getPosition():sendMagicEffect(13) | |
| 386 | + | end | |
| 387 | + | end | |
| 388 | + | else | |
| 389 | + | player:getPosition():sendMagicEffect(ELEMENTS[item.uid].EFFECT) | |
| 390 | + | return true | |
| 391 | + | end | |
| 392 | + | else | |
| 393 | + | player:getPosition():sendMagicEffect(ELEMENTS[item.uid].EFFECT) | |
| 394 | + | return true | |
| 395 | + | end | |
| 396 | + | end | |
| 397 | + | end | |
| 398 | + | return true | |
| 399 | + | end |
| @@ -0,0 +1,731 @@ | |||
| 1 | + | local STEP_1 = 00 | |
| 2 | + | local STEP_2 = 00 | |
| 3 | + | local STEP_3 = 00 | |
| 4 | + | local FastEffect = 400 | |
| 5 | + | local PATH_EFFECT = { | |
| 6 | + | [01] = { | |
| 7 | + | [01] = {3979, 1860, 14}, | |
| 8 | + | [02] = {4001, 1859, 14}, | |
| 9 | + | [03] = {4000, 1847, 14}, | |
| 10 | + | [04] = {3992, 1848, 14}, | |
| 11 | + | [05] = {3993, 1856, 14}, | |
| 12 | + | [06] = {3996, 1855, 14}, | |
| 13 | + | [07] = {3995, 1851, 14}, | |
| 14 | + | }; | |
| 15 | + | [02] = { | |
| 16 | + | [01] = {4062, 1860, 14}, | |
| 17 | + | [02] = {4084, 1859, 14}, | |
| 18 | + | [03] = {4083, 1847, 14}, | |
| 19 | + | [04] = {4075, 1848, 14}, | |
| 20 | + | [05] = {4076, 1856, 14}, | |
| 21 | + | [06] = {4079, 1855, 14}, | |
| 22 | + | [07] = {4078, 1851, 14}, | |
| 23 | + | }; | |
| 24 | + | [03] = { | |
| 25 | + | [01] = {4145, 1860, 14}, | |
| 26 | + | [02] = {4167, 1859, 14}, | |
| 27 | + | [03] = {4166, 1847, 14}, | |
| 28 | + | [04] = {4158, 1848, 14}, | |
| 29 | + | [05] = {4159, 1856, 14}, | |
| 30 | + | [06] = {4162, 1855, 14}, | |
| 31 | + | [07] = {4161, 1851, 14}, | |
| 32 | + | }; | |
| 33 | + | } | |
| 34 | + | local WAY_EFFECT = { | |
| 35 | + | [01] = 22; | |
| 36 | + | [02] = 12; | |
| 37 | + | [03] = 08; | |
| 38 | + | [04] = 08; | |
| 39 | + | [05] = 03; | |
| 40 | + | [06] = 04; | |
| 41 | + | [07] = 11; | |
| 42 | + | } | |
| 43 | + | function onEffectPath(pos, count, cid, idd) | |
| 44 | + | local player = Player(cid) | |
| 45 | + | if idd == 01 then | |
| 46 | + | if STEP_1 > 00 then | |
| 47 | + | if STEP_1 == 01 then | |
| 48 | + | if count == WAY_EFFECT[STEP_1] then | |
| 49 | + | local tile = Tile(pos.x + 1, pos.y, pos.z) | |
| 50 | + | local playerPosition = tile:getTopCreature() | |
| 51 | + | if playerPosition ~= nil then | |
| 52 | + | if playerPosition:isPlayer() then | |
| 53 | + | if playerPosition:getDirection() == 00 then | |
| 54 | + | STEP_1 = 02 | |
| 55 | + | local EffectPos = Position(PATH_EFFECT[idd][STEP_1][01], PATH_EFFECT[idd][STEP_1][02], PATH_EFFECT[idd][STEP_1][03]) | |
| 56 | + | local id = 01 | |
| 57 | + | EffectPos:sendMagicEffect(38) | |
| 58 | + | addEvent(onEffectPath, FastEffect, EffectPos, id, player.uid, idd) | |
| 59 | + | else | |
| 60 | + | STEP_1 = 00 | |
| 61 | + | return true | |
| 62 | + | end | |
| 63 | + | else | |
| 64 | + | STEP_1 = 00 | |
| 65 | + | return true | |
| 66 | + | end | |
| 67 | + | else | |
| 68 | + | STEP_1 = 00 | |
| 69 | + | return true | |
| 70 | + | end | |
| 71 | + | else | |
| 72 | + | local position = Position(pos.x + 1, pos.y, pos.z) | |
| 73 | + | count = count + 1 | |
| 74 | + | position:sendMagicEffect(38) | |
| 75 | + | addEvent(onEffectPath, FastEffect, position, count, player.uid, idd) | |
| 76 | + | end | |
| 77 | + | elseif STEP_1 == 02 then | |
| 78 | + | if count == WAY_EFFECT[STEP_1] then | |
| 79 | + | local tile = Tile(pos.x, pos.y - 1, pos.z) | |
| 80 | + | local playerPosition = tile:getTopCreature() | |
| 81 | + | if playerPosition ~= nil then | |
| 82 | + | if playerPosition:isPlayer() then | |
| 83 | + | if playerPosition:getDirection() == 03 then | |
| 84 | + | STEP_1 = 03 | |
| 85 | + | local EffectPos = Position(PATH_EFFECT[idd][STEP_1][01], PATH_EFFECT[idd][STEP_1][02], PATH_EFFECT[idd][STEP_1][03]) | |
| 86 | + | local id = 01 | |
| 87 | + | EffectPos:sendMagicEffect(38) | |
| 88 | + | addEvent(onEffectPath, FastEffect, EffectPos, id, player.uid, idd) | |
| 89 | + | else | |
| 90 | + | STEP_1 = 00 | |
| 91 | + | return true | |
| 92 | + | end | |
| 93 | + | else | |
| 94 | + | STEP_1 = 00 | |
| 95 | + | return true | |
| 96 | + | end | |
| 97 | + | else | |
| 98 | + | STEP_1 = 00 | |
| 99 | + | return true | |
| 100 | + | end | |
| 101 | + | else | |
| 102 | + | local position = Position(pos.x, pos.y - 1, pos.z) | |
| 103 | + | count = count + 1 | |
| 104 | + | position:sendMagicEffect(38) | |
| 105 | + | addEvent(onEffectPath, FastEffect, position, count, player.uid, idd) | |
| 106 | + | end | |
| 107 | + | elseif STEP_1 == 03 then | |
| 108 | + | if count == WAY_EFFECT[STEP_1] then | |
| 109 | + | local tile = Tile(pos.x - 1, pos.y, pos.z) | |
| 110 | + | local playerPosition = tile:getTopCreature() | |
| 111 | + | if playerPosition ~= nil then | |
| 112 | + | if playerPosition:isPlayer() then | |
| 113 | + | if playerPosition:getDirection() == 02 then | |
| 114 | + | STEP_1 = 04 | |
| 115 | + | local EffectPos = Position(PATH_EFFECT[idd][STEP_1][01], PATH_EFFECT[idd][STEP_1][02], PATH_EFFECT[idd][STEP_1][03]) | |
| 116 | + | local id = 01 | |
| 117 | + | EffectPos:sendMagicEffect(38) | |
| 118 | + | addEvent(onEffectPath, FastEffect, EffectPos, id, player.uid, idd) | |
| 119 | + | else | |
| 120 | + | STEP_1 = 00 | |
| 121 | + | return true | |
| 122 | + | end | |
| 123 | + | else | |
| 124 | + | STEP_1 = 00 | |
| 125 | + | return true | |
| 126 | + | end | |
| 127 | + | else | |
| 128 | + | STEP_1 = 00 | |
| 129 | + | return true | |
| 130 | + | end | |
| 131 | + | else | |
| 132 | + | local position = Position(pos.x - 1, pos.y, pos.z) | |
| 133 | + | count = count + 1 | |
| 134 | + | position:sendMagicEffect(38) | |
| 135 | + | addEvent(onEffectPath, FastEffect, position, count, player.uid, idd) | |
| 136 | + | end | |
| 137 | + | elseif STEP_1 == 04 then | |
| 138 | + | if count == WAY_EFFECT[STEP_1] then | |
| 139 | + | local tile = Tile(pos.x, pos.y + 1, pos.z) | |
| 140 | + | local playerPosition = tile:getTopCreature() | |
| 141 | + | if playerPosition ~= nil then | |
| 142 | + | if playerPosition:isPlayer() then | |
| 143 | + | if playerPosition:getDirection() == 01 then | |
| 144 | + | STEP_1 = 05 | |
| 145 | + | local EffectPos = Position(PATH_EFFECT[idd][STEP_1][01], PATH_EFFECT[idd][STEP_1][02], PATH_EFFECT[idd][STEP_1][03]) | |
| 146 | + | local id = 01 | |
| 147 | + | EffectPos:sendMagicEffect(38) | |
| 148 | + | addEvent(onEffectPath, FastEffect, EffectPos, id, player.uid, idd) | |
| 149 | + | else | |
| 150 | + | STEP_1 = 00 | |
| 151 | + | return true | |
| 152 | + | end | |
| 153 | + | else | |
| 154 | + | STEP_1 = 00 | |
| 155 | + | return true | |
| 156 | + | end | |
| 157 | + | else | |
| 158 | + | STEP_1 = 00 | |
| 159 | + | return true | |
| 160 | + | end | |
| 161 | + | else | |
| 162 | + | local position = Position(pos.x, pos.y + 1, pos.z) | |
| 163 | + | count = count + 1 | |
| 164 | + | position:sendMagicEffect(38) | |
| 165 | + | addEvent(onEffectPath, FastEffect, position, count, player.uid, idd) | |
| 166 | + | end | |
| 167 | + | elseif STEP_1 == 05 then | |
| 168 | + | if count == WAY_EFFECT[STEP_1] then | |
| 169 | + | local tile = Tile(pos.x + 1, pos.y, pos.z) | |
| 170 | + | local playerPosition = tile:getTopCreature() | |
| 171 | + | if playerPosition ~= nil then | |
| 172 | + | if playerPosition:isPlayer() then | |
| 173 | + | if playerPosition:getDirection() == 00 then | |
| 174 | + | STEP_1 = 06 | |
| 175 | + | local EffectPos = Position(PATH_EFFECT[idd][STEP_1][01], PATH_EFFECT[idd][STEP_1][02], PATH_EFFECT[idd][STEP_1][03]) | |
| 176 | + | local id = 01 | |
| 177 | + | EffectPos:sendMagicEffect(38) | |
| 178 | + | addEvent(onEffectPath, FastEffect, EffectPos, id, player.uid, idd) | |
| 179 | + | else | |
| 180 | + | STEP_1 = 00 | |
| 181 | + | return true | |
| 182 | + | end | |
| 183 | + | else | |
| 184 | + | STEP_1 = 00 | |
| 185 | + | return true | |
| 186 | + | end | |
| 187 | + | else | |
| 188 | + | STEP_1 = 00 | |
| 189 | + | return true | |
| 190 | + | end | |
| 191 | + | else | |
| 192 | + | local position = Position(pos.x + 1, pos.y, pos.z) | |
| 193 | + | count = count + 1 | |
| 194 | + | position:sendMagicEffect(38) | |
| 195 | + | addEvent(onEffectPath, FastEffect, position, count, player.uid, idd) | |
| 196 | + | end | |
| 197 | + | elseif STEP_1 == 06 then | |
| 198 | + | if count == WAY_EFFECT[STEP_1] then | |
| 199 | + | local tile = Tile(pos.x, pos.y - 1, pos.z) | |
| 200 | + | local playerPosition = tile:getTopCreature() | |
| 201 | + | if playerPosition ~= nil then | |
| 202 | + | if playerPosition:isPlayer() then | |
| 203 | + | if playerPosition:getDirection() == 03 then | |
| 204 | + | STEP_1 = 07 | |
| 205 | + | local EffectPos = Position(PATH_EFFECT[idd][STEP_1][01], PATH_EFFECT[idd][STEP_1][02], PATH_EFFECT[idd][STEP_1][03]) | |
| 206 | + | local id = 01 | |
| 207 | + | EffectPos:sendMagicEffect(38) | |
| 208 | + | addEvent(onEffectPath, FastEffect, EffectPos, id, player.uid, idd) | |
| 209 | + | else | |
| 210 | + | STEP_1 = 00 | |
| 211 | + | return true | |
| 212 | + | end | |
| 213 | + | else | |
| 214 | + | STEP_1 = 00 | |
| 215 | + | return true | |
| 216 | + | end | |
| 217 | + | else | |
| 218 | + | STEP_1 = 00 | |
| 219 | + | return true | |
| 220 | + | end | |
| 221 | + | else | |
| 222 | + | local position = Position(pos.x, pos.y - 1, pos.z) | |
| 223 | + | count = count + 1 | |
| 224 | + | position:sendMagicEffect(38) | |
| 225 | + | addEvent(onEffectPath, FastEffect, position, count, player.uid, idd) | |
| 226 | + | end | |
| 227 | + | elseif STEP_1 == 07 then | |
| 228 | + | if count == WAY_EFFECT[STEP_1] then | |
| 229 | + | local party = player:getParty() | |
| 230 | + | if not party then | |
| 231 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Clique na est�tua para finalizar.") | |
| 232 | + | player:setStorageValue(_SYSTEM.DANGEROUS[10][01].STORAGE, 08) | |
| 233 | + | player:setStorageValue(_SYSTEM.DANGEROUS[10][01].RECOMPENSA[01], _SYSTEM.DANGEROUS[10][01].RECOMPENSA[02]) | |
| 234 | + | player:getPosition():sendMagicEffect(15) | |
| 235 | + | else | |
| 236 | + | local members = party:getMembers() | |
| 237 | + | members[#members + 1] = party:getLeader() | |
| 238 | + | for _, member in ipairs(members) do | |
| 239 | + | member:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Clique na est�tua para finalizar.") | |
| 240 | + | member:setStorageValue(_SYSTEM.DANGEROUS[10][01].STORAGE, 08) | |
| 241 | + | member:getPosition():sendMagicEffect(15) | |
| 242 | + | end | |
| 243 | + | end | |
| 244 | + | return true | |
| 245 | + | else | |
| 246 | + | local position = Position(pos.x - 1, pos.y, pos.z) | |
| 247 | + | count = count + 1 | |
| 248 | + | position:sendMagicEffect(38) | |
| 249 | + | addEvent(onEffectPath, FastEffect, position, count, player.uid, idd) | |
| 250 | + | end | |
| 251 | + | end | |
| 252 | + | end | |
| 253 | + | end | |
| 254 | + | if idd == 02 then | |
| 255 | + | if STEP_2 > 00 then | |
| 256 | + | if STEP_2 == 01 then | |
| 257 | + | if count == WAY_EFFECT[STEP_2] then | |
| 258 | + | local tile = Tile(pos.x + 1, pos.y, pos.z) | |
| 259 | + | local playerPosition = tile:getTopCreature() | |
| 260 | + | if playerPosition ~= nil then | |
| 261 | + | if playerPosition:isPlayer() then | |
| 262 | + | if playerPosition:getDirection() == 00 then | |
| 263 | + | STEP_2 = 02 | |
| 264 | + | local EffectPos = Position(PATH_EFFECT[idd][STEP_2][01], PATH_EFFECT[idd][STEP_2][02], PATH_EFFECT[idd][STEP_2][03]) | |
| 265 | + | local id = 01 | |
| 266 | + | EffectPos:sendMagicEffect(38) | |
| 267 | + | addEvent(onEffectPath, FastEffect, EffectPos, id, player.uid, idd) | |
| 268 | + | else | |
| 269 | + | STEP_2 = 00 | |
| 270 | + | return true | |
| 271 | + | end | |
| 272 | + | else | |
| 273 | + | STEP_2 = 00 | |
| 274 | + | return true | |
| 275 | + | end | |
| 276 | + | else | |
| 277 | + | STEP_2 = 00 | |
| 278 | + | return true | |
| 279 | + | end | |
| 280 | + | else | |
| 281 | + | local position = Position(pos.x + 1, pos.y, pos.z) | |
| 282 | + | count = count + 1 | |
| 283 | + | position:sendMagicEffect(38) | |
| 284 | + | addEvent(onEffectPath, FastEffect, position, count, player.uid, idd) | |
| 285 | + | end | |
| 286 | + | elseif STEP_2 == 02 then | |
| 287 | + | if count == WAY_EFFECT[STEP_2] then | |
| 288 | + | local tile = Tile(pos.x, pos.y - 1, pos.z) | |
| 289 | + | local playerPosition = tile:getTopCreature() | |
| 290 | + | if playerPosition ~= nil then | |
| 291 | + | if playerPosition:isPlayer() then | |
| 292 | + | if playerPosition:getDirection() == 03 then | |
| 293 | + | STEP_2 = 03 | |
| 294 | + | local EffectPos = Position(PATH_EFFECT[idd][STEP_2][01], PATH_EFFECT[idd][STEP_2][02], PATH_EFFECT[idd][STEP_2][03]) | |
| 295 | + | local id = 01 | |
| 296 | + | EffectPos:sendMagicEffect(38) | |
| 297 | + | addEvent(onEffectPath, FastEffect, EffectPos, id, player.uid, idd) | |
| 298 | + | else | |
| 299 | + | STEP_2 = 00 | |
| 300 | + | return true | |
| 301 | + | end | |
| 302 | + | else | |
| 303 | + | STEP_2 = 00 | |
| 304 | + | return true | |
| 305 | + | end | |
| 306 | + | else | |
| 307 | + | STEP_2 = 00 | |
| 308 | + | return true | |
| 309 | + | end | |
| 310 | + | else | |
| 311 | + | local position = Position(pos.x, pos.y - 1, pos.z) | |
| 312 | + | count = count + 1 | |
| 313 | + | position:sendMagicEffect(38) | |
| 314 | + | addEvent(onEffectPath, FastEffect, position, count, player.uid, idd) | |
| 315 | + | end | |
| 316 | + | elseif STEP_2 == 03 then | |
| 317 | + | if count == WAY_EFFECT[STEP_2] then | |
| 318 | + | local tile = Tile(pos.x - 1, pos.y, pos.z) | |
| 319 | + | local playerPosition = tile:getTopCreature() | |
| 320 | + | if playerPosition ~= nil then | |
| 321 | + | if playerPosition:isPlayer() then | |
| 322 | + | if playerPosition:getDirection() == 02 then | |
| 323 | + | STEP_2 = 04 | |
| 324 | + | local EffectPos = Position(PATH_EFFECT[idd][STEP_2][01], PATH_EFFECT[idd][STEP_2][02], PATH_EFFECT[idd][STEP_2][03]) | |
| 325 | + | local id = 01 | |
| 326 | + | EffectPos:sendMagicEffect(38) | |
| 327 | + | addEvent(onEffectPath, FastEffect, EffectPos, id, player.uid, idd) | |
| 328 | + | else | |
| 329 | + | STEP_2 = 00 | |
| 330 | + | return true | |
| 331 | + | end | |
| 332 | + | else | |
| 333 | + | STEP_2 = 00 | |
| 334 | + | return true | |
| 335 | + | end | |
| 336 | + | else | |
| 337 | + | STEP_2 = 00 | |
| 338 | + | return true | |
| 339 | + | end | |
| 340 | + | else | |
| 341 | + | local position = Position(pos.x - 1, pos.y, pos.z) | |
| 342 | + | count = count + 1 | |
| 343 | + | position:sendMagicEffect(38) | |
| 344 | + | addEvent(onEffectPath, FastEffect, position, count, player.uid, idd) | |
| 345 | + | end | |
| 346 | + | elseif STEP_2 == 04 then | |
| 347 | + | if count == WAY_EFFECT[STEP_2] then | |
| 348 | + | local tile = Tile(pos.x, pos.y + 1, pos.z) | |
| 349 | + | local playerPosition = tile:getTopCreature() | |
| 350 | + | if playerPosition ~= nil then | |
| 351 | + | if playerPosition:isPlayer() then | |
| 352 | + | if playerPosition:getDirection() == 01 then | |
| 353 | + | STEP_2 = 05 | |
| 354 | + | local EffectPos = Position(PATH_EFFECT[idd][STEP_2][01], PATH_EFFECT[idd][STEP_2][02], PATH_EFFECT[idd][STEP_2][03]) | |
| 355 | + | local id = 01 | |
| 356 | + | EffectPos:sendMagicEffect(38) | |
| 357 | + | addEvent(onEffectPath, FastEffect, EffectPos, id, player.uid, idd) | |
| 358 | + | else | |
| 359 | + | STEP_2 = 00 | |
| 360 | + | return true | |
| 361 | + | end | |
| 362 | + | else | |
| 363 | + | STEP_2 = 00 | |
| 364 | + | return true | |
| 365 | + | end | |
| 366 | + | else | |
| 367 | + | STEP_2 = 00 | |
| 368 | + | return true | |
| 369 | + | end | |
| 370 | + | else | |
| 371 | + | local position = Position(pos.x, pos.y + 1, pos.z) | |
| 372 | + | count = count + 1 | |
| 373 | + | position:sendMagicEffect(38) | |
| 374 | + | addEvent(onEffectPath, FastEffect, position, count, player.uid, idd) | |
| 375 | + | end | |
| 376 | + | elseif STEP_2 == 05 then | |
| 377 | + | if count == WAY_EFFECT[STEP_2] then | |
| 378 | + | local tile = Tile(pos.x + 1, pos.y, pos.z) | |
| 379 | + | local playerPosition = tile:getTopCreature() | |
| 380 | + | if playerPosition ~= nil then | |
| 381 | + | if playerPosition:isPlayer() then | |
| 382 | + | if playerPosition:getDirection() == 00 then | |
| 383 | + | STEP_2 = 06 | |
| 384 | + | local EffectPos = Position(PATH_EFFECT[idd][STEP_2][01], PATH_EFFECT[idd][STEP_2][02], PATH_EFFECT[idd][STEP_2][03]) | |
| 385 | + | local id = 01 | |
| 386 | + | EffectPos:sendMagicEffect(38) | |
| 387 | + | addEvent(onEffectPath, FastEffect, EffectPos, id, player.uid, idd) | |
| 388 | + | else | |
| 389 | + | STEP_2 = 00 | |
| 390 | + | return true | |
| 391 | + | end | |
| 392 | + | else | |
| 393 | + | STEP_2 = 00 | |
| 394 | + | return true | |
| 395 | + | end | |
| 396 | + | else | |
| 397 | + | STEP_2 = 00 | |
| 398 | + | return true | |
| 399 | + | end | |
| 400 | + | else | |
| 401 | + | local position = Position(pos.x + 1, pos.y, pos.z) | |
| 402 | + | count = count + 1 | |
| 403 | + | position:sendMagicEffect(38) | |
| 404 | + | addEvent(onEffectPath, FastEffect, position, count, player.uid, idd) | |
| 405 | + | end | |
| 406 | + | elseif STEP_2 == 06 then | |
| 407 | + | if count == WAY_EFFECT[STEP_2] then | |
| 408 | + | local tile = Tile(pos.x, pos.y - 1, pos.z) | |
| 409 | + | local playerPosition = tile:getTopCreature() | |
| 410 | + | if playerPosition ~= nil then | |
| 411 | + | if playerPosition:isPlayer() then | |
| 412 | + | if playerPosition:getDirection() == 03 then | |
| 413 | + | STEP_2 = 07 | |
| 414 | + | local EffectPos = Position(PATH_EFFECT[idd][STEP_2][01], PATH_EFFECT[idd][STEP_2][02], PATH_EFFECT[idd][STEP_2][03]) | |
| 415 | + | local id = 01 | |
| 416 | + | EffectPos:sendMagicEffect(38) | |
| 417 | + | addEvent(onEffectPath, FastEffect, EffectPos, id, player.uid, idd) | |
| 418 | + | else | |
| 419 | + | STEP_2 = 00 | |
| 420 | + | return true | |
| 421 | + | end | |
| 422 | + | else | |
| 423 | + | STEP_2 = 00 | |
| 424 | + | return true | |
| 425 | + | end | |
| 426 | + | else | |
| 427 | + | STEP_2 = 00 | |
| 428 | + | return true | |
| 429 | + | end | |
| 430 | + | else | |
| 431 | + | local position = Position(pos.x, pos.y - 1, pos.z) | |
| 432 | + | count = count + 1 | |
| 433 | + | position:sendMagicEffect(38) | |
| 434 | + | addEvent(onEffectPath, FastEffect, position, count, player.uid, idd) | |
| 435 | + | end | |
| 436 | + | elseif STEP_2 == 07 then | |
| 437 | + | if count == WAY_EFFECT[STEP_2] then | |
| 438 | + | local party = player:getParty() | |
| 439 | + | if not party then | |
| 440 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Clique na est�tua para finalizar.") | |
| 441 | + | player:setStorageValue(_SYSTEM.DANGEROUS[10][01].STORAGE, 08) | |
| 442 | + | player:setStorageValue(_SYSTEM.DANGEROUS[10][01].RECOMPENSA[01], _SYSTEM.DANGEROUS[10][01].RECOMPENSA[02]) | |
| 443 | + | player:getPosition():sendMagicEffect(15) | |
| 444 | + | else | |
| 445 | + | local members = party:getMembers() | |
| 446 | + | members[#members + 1] = party:getLeader() | |
| 447 | + | for _, member in ipairs(members) do | |
| 448 | + | member:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Clique na est�tua para finalizar.") | |
| 449 | + | member:setStorageValue(_SYSTEM.DANGEROUS[10][01].STORAGE, 08) | |
| 450 | + | member:getPosition():sendMagicEffect(15) | |
| 451 | + | end | |
| 452 | + | end | |
| 453 | + | return true | |
| 454 | + | else | |
| 455 | + | local position = Position(pos.x - 1, pos.y, pos.z) | |
| 456 | + | count = count + 1 | |
| 457 | + | position:sendMagicEffect(38) | |
| 458 | + | addEvent(onEffectPath, FastEffect, position, count, player.uid, idd) | |
| 459 | + | end | |
| 460 | + | end | |
| 461 | + | end | |
| 462 | + | end | |
| 463 | + | if idd == 03 then | |
| 464 | + | if STEP_3 > 00 then | |
| 465 | + | if STEP_3 == 01 then | |
| 466 | + | if count == WAY_EFFECT[STEP_3] then | |
| 467 | + | local tile = Tile(pos.x + 1, pos.y, pos.z) | |
| 468 | + | local playerPosition = tile:getTopCreature() | |
| 469 | + | if playerPosition ~= nil then | |
| 470 | + | if playerPosition:isPlayer() then | |
| 471 | + | if playerPosition:getDirection() == 00 then | |
| 472 | + | STEP_3 = 02 | |
| 473 | + | local EffectPos = Position(PATH_EFFECT[idd][STEP_3][01], PATH_EFFECT[idd][STEP_3][02], PATH_EFFECT[idd][STEP_3][03]) | |
| 474 | + | local id = 01 | |
| 475 | + | EffectPos:sendMagicEffect(38) | |
| 476 | + | addEvent(onEffectPath, FastEffect, EffectPos, id, player.uid, idd) | |
| 477 | + | else | |
| 478 | + | STEP_3 = 00 | |
| 479 | + | return true | |
| 480 | + | end | |
| 481 | + | else | |
| 482 | + | STEP_3 = 00 | |
| 483 | + | return true | |
| 484 | + | end | |
| 485 | + | else | |
| 486 | + | STEP_3 = 00 | |
| 487 | + | return true | |
| 488 | + | end | |
| 489 | + | else | |
| 490 | + | local position = Position(pos.x + 1, pos.y, pos.z) | |
| 491 | + | count = count + 1 | |
| 492 | + | position:sendMagicEffect(38) | |
| 493 | + | addEvent(onEffectPath, FastEffect, position, count, player.uid, idd) | |
| 494 | + | end | |
| 495 | + | elseif STEP_3 == 02 then | |
| 496 | + | if count == WAY_EFFECT[STEP_3] then | |
| 497 | + | local tile = Tile(pos.x, pos.y - 1, pos.z) | |
| 498 | + | local playerPosition = tile:getTopCreature() | |
| 499 | + | if playerPosition ~= nil then | |
| 500 | + | if playerPosition:isPlayer() then | |
| 501 | + | if playerPosition:getDirection() == 03 then | |
| 502 | + | STEP_3 = 03 | |
| 503 | + | local EffectPos = Position(PATH_EFFECT[idd][STEP_3][01], PATH_EFFECT[idd][STEP_3][02], PATH_EFFECT[idd][STEP_3][03]) | |
| 504 | + | local id = 01 | |
| 505 | + | EffectPos:sendMagicEffect(38) | |
| 506 | + | addEvent(onEffectPath, FastEffect, EffectPos, id, player.uid, idd) | |
| 507 | + | else | |
| 508 | + | STEP_3 = 00 | |
| 509 | + | return true | |
| 510 | + | end | |
| 511 | + | else | |
| 512 | + | STEP_3 = 00 | |
| 513 | + | return true | |
| 514 | + | end | |
| 515 | + | else | |
| 516 | + | STEP_3 = 00 | |
| 517 | + | return true | |
| 518 | + | end | |
| 519 | + | else | |
| 520 | + | local position = Position(pos.x, pos.y - 1, pos.z) | |
| 521 | + | count = count + 1 | |
| 522 | + | position:sendMagicEffect(38) | |
| 523 | + | addEvent(onEffectPath, FastEffect, position, count, player.uid, idd) | |
| 524 | + | end | |
| 525 | + | elseif STEP_3 == 03 then | |
| 526 | + | if count == WAY_EFFECT[STEP_3] then | |
| 527 | + | local tile = Tile(pos.x - 1, pos.y, pos.z) | |
| 528 | + | local playerPosition = tile:getTopCreature() | |
| 529 | + | if playerPosition ~= nil then | |
| 530 | + | if playerPosition:isPlayer() then | |
| 531 | + | if playerPosition:getDirection() == 02 then | |
| 532 | + | STEP_3 = 04 | |
| 533 | + | local EffectPos = Position(PATH_EFFECT[idd][STEP_3][01], PATH_EFFECT[idd][STEP_3][02], PATH_EFFECT[idd][STEP_3][03]) | |
| 534 | + | local id = 01 | |
| 535 | + | EffectPos:sendMagicEffect(38) | |
| 536 | + | addEvent(onEffectPath, FastEffect, EffectPos, id, player.uid, idd) | |
| 537 | + | else | |
| 538 | + | STEP_3 = 00 | |
| 539 | + | return true | |
| 540 | + | end | |
| 541 | + | else | |
| 542 | + | STEP_3 = 00 | |
| 543 | + | return true | |
| 544 | + | end | |
| 545 | + | else | |
| 546 | + | STEP_3 = 00 | |
| 547 | + | return true | |
| 548 | + | end | |
| 549 | + | else | |
| 550 | + | local position = Position(pos.x - 1, pos.y, pos.z) | |
| 551 | + | count = count + 1 | |
| 552 | + | position:sendMagicEffect(38) | |
| 553 | + | addEvent(onEffectPath, FastEffect, position, count, player.uid, idd) | |
| 554 | + | end | |
| 555 | + | elseif STEP_3 == 04 then | |
| 556 | + | if count == WAY_EFFECT[STEP_3] then | |
| 557 | + | local tile = Tile(pos.x, pos.y + 1, pos.z) | |
| 558 | + | local playerPosition = tile:getTopCreature() | |
| 559 | + | if playerPosition ~= nil then | |
| 560 | + | if playerPosition:isPlayer() then | |
| 561 | + | if playerPosition:getDirection() == 01 then | |
| 562 | + | STEP_3 = 05 | |
| 563 | + | local EffectPos = Position(PATH_EFFECT[idd][STEP_3][01], PATH_EFFECT[idd][STEP_3][02], PATH_EFFECT[idd][STEP_3][03]) | |
| 564 | + | local id = 01 | |
| 565 | + | EffectPos:sendMagicEffect(38) | |
| 566 | + | addEvent(onEffectPath, FastEffect, EffectPos, id, player.uid, idd) | |
| 567 | + | else | |
| 568 | + | STEP_3 = 00 | |
| 569 | + | return true | |
| 570 | + | end | |
| 571 | + | else | |
| 572 | + | STEP_3 = 00 | |
| 573 | + | return true | |
| 574 | + | end | |
| 575 | + | else | |
| 576 | + | STEP_3 = 00 | |
| 577 | + | return true | |
| 578 | + | end | |
| 579 | + | else | |
| 580 | + | local position = Position(pos.x, pos.y + 1, pos.z) | |
| 581 | + | count = count + 1 | |
| 582 | + | position:sendMagicEffect(38) | |
| 583 | + | addEvent(onEffectPath, FastEffect, position, count, player.uid, idd) | |
| 584 | + | end | |
| 585 | + | elseif STEP_3 == 05 then | |
| 586 | + | if count == WAY_EFFECT[STEP_3] then | |
| 587 | + | local tile = Tile(pos.x + 1, pos.y, pos.z) | |
| 588 | + | local playerPosition = tile:getTopCreature() | |
| 589 | + | if playerPosition ~= nil then | |
| 590 | + | if playerPosition:isPlayer() then | |
| 591 | + | if playerPosition:getDirection() == 00 then | |
| 592 | + | STEP_3 = 06 | |
| 593 | + | local EffectPos = Position(PATH_EFFECT[idd][STEP_3][01], PATH_EFFECT[idd][STEP_3][02], PATH_EFFECT[idd][STEP_3][03]) | |
| 594 | + | local id = 01 | |
| 595 | + | EffectPos:sendMagicEffect(38) | |
| 596 | + | addEvent(onEffectPath, FastEffect, EffectPos, id, player.uid, idd) | |
| 597 | + | else | |
| 598 | + | STEP_3 = 00 | |
| 599 | + | return true | |
| 600 | + | end | |
| 601 | + | else | |
| 602 | + | STEP_3 = 00 | |
| 603 | + | return true | |
| 604 | + | end | |
| 605 | + | else | |
| 606 | + | STEP_3 = 00 | |
| 607 | + | return true | |
| 608 | + | end | |
| 609 | + | else | |
| 610 | + | local position = Position(pos.x + 1, pos.y, pos.z) | |
| 611 | + | count = count + 1 | |
| 612 | + | position:sendMagicEffect(38) | |
| 613 | + | addEvent(onEffectPath, FastEffect, position, count, player.uid, idd) | |
| 614 | + | end | |
| 615 | + | elseif STEP_3 == 06 then | |
| 616 | + | if count == WAY_EFFECT[STEP_3] then | |
| 617 | + | local tile = Tile(pos.x, pos.y - 1, pos.z) | |
| 618 | + | local playerPosition = tile:getTopCreature() | |
| 619 | + | if playerPosition ~= nil then | |
| 620 | + | if playerPosition:isPlayer() then | |
| 621 | + | if playerPosition:getDirection() == 03 then | |
| 622 | + | STEP_3 = 07 | |
| 623 | + | local EffectPos = Position(PATH_EFFECT[idd][STEP_3][01], PATH_EFFECT[idd][STEP_3][02], PATH_EFFECT[idd][STEP_3][03]) | |
| 624 | + | local id = 01 | |
| 625 | + | EffectPos:sendMagicEffect(38) | |
| 626 | + | addEvent(onEffectPath, FastEffect, EffectPos, id, player.uid, idd) | |
| 627 | + | else | |
| 628 | + | STEP_3 = 00 | |
| 629 | + | return true | |
| 630 | + | end | |
| 631 | + | else | |
| 632 | + | STEP_3 = 00 | |
| 633 | + | return true | |
| 634 | + | end | |
| 635 | + | else | |
| 636 | + | STEP_3 = 00 | |
| 637 | + | return true | |
| 638 | + | end | |
| 639 | + | else | |
| 640 | + | local position = Position(pos.x, pos.y - 1, pos.z) | |
| 641 | + | count = count + 1 | |
| 642 | + | position:sendMagicEffect(38) | |
| 643 | + | addEvent(onEffectPath, FastEffect, position, count, player.uid, idd) | |
| 644 | + | end | |
| 645 | + | elseif STEP_3 == 07 then | |
| 646 | + | if count == WAY_EFFECT[STEP_3] then | |
| 647 | + | local party = player:getParty() | |
| 648 | + | if not party then | |
| 649 | + | player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Clique na est�tua para finalizar.") | |
| 650 | + | player:setStorageValue(_SYSTEM.DANGEROUS[10][01].STORAGE, 08) | |
| 651 | + | player:setStorageValue(_SYSTEM.DANGEROUS[10][01].RECOMPENSA[01], _SYSTEM.DANGEROUS[10][01].RECOMPENSA[02]) | |
| 652 | + | player:getPosition():sendMagicEffect(15) | |
| 653 | + | else | |
| 654 | + | local members = party:getMembers() | |
| 655 | + | members[#members + 1] = party:getLeader() | |
| 656 | + | for _, member in ipairs(members) do | |
| 657 | + | member:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Clique na est�tua para finalizar.") | |
| 658 | + | member:setStorageValue(_SYSTEM.DANGEROUS[10][01].STORAGE, 08) | |
| 659 | + | member:getPosition():sendMagicEffect(15) | |
| 660 | + | end | |
| 661 | + | end | |
| 662 | + | return true | |
| 663 | + | else | |
| 664 | + | local position = Position(pos.x - 1, pos.y, pos.z) | |
| 665 | + | count = count + 1 | |
| 666 | + | position:sendMagicEffect(38) | |
| 667 | + | addEvent(onEffectPath, FastEffect, position, count, player.uid, idd) | |
| 668 | + | end | |
| 669 | + | end | |
| 670 | + | end | |
| 671 | + | end | |
| 672 | + | end | |
| 673 | + | function onUse(player, item, fromPosition, target, toPosition, isHotkey) | |
| 674 | + | local party = player:getParty() | |
| 675 | + | -- PATH EFFECT | |
| 676 | + | if item.uid == 10600 then | |
| 677 | + | if player:getStorageValue(_SYSTEM.DANGEROUS[10][01].STORAGE) == 07 then | |
| 678 | + | if STEP_1 == 00 then | |
| 679 | + | STEP_1 = 01 | |
| 680 | + | local id = 01 | |
| 681 | + | local EffectPos = Position(PATH_EFFECT[01][STEP_1][01], PATH_EFFECT[01][STEP_1][02], PATH_EFFECT[01][STEP_1][03]) | |
| 682 | + | EffectPos:sendMagicEffect(38) | |
| 683 | + | addEvent(onEffectPath, FastEffect, EffectPos, id, player.uid, 01) | |
| 684 | + | return true | |
| 685 | + | else | |
| 686 | + | player:getPosition():sendMagicEffect(03) | |
| 687 | + | return true | |
| 688 | + | end | |
| 689 | + | else | |
| 690 | + | player:getPosition():sendMagicEffect(03) | |
| 691 | + | return true | |
| 692 | + | end | |
| 693 | + | end | |
| 694 | + | if item.uid == 10601 then | |
| 695 | + | if player:getStorageValue(_SYSTEM.DANGEROUS[10][01].STORAGE) == 07 then | |
| 696 | + | if STEP_2 == 00 then | |
| 697 | + | STEP_2 = 01 | |
| 698 | + | local id = 01 | |
| 699 | + | local EffectPos = Position(PATH_EFFECT[02][STEP_2][01], PATH_EFFECT[02][STEP_2][02], PATH_EFFECT[02][STEP_2][03]) | |
| 700 | + | EffectPos:sendMagicEffect(38) | |
| 701 | + | addEvent(onEffectPath, FastEffect, EffectPos, id, player.uid, 02) | |
| 702 | + | return true | |
| 703 | + | else | |
| 704 | + | player:getPosition():sendMagicEffect(03) | |
| 705 | + | return true | |
| 706 | + | end | |
| 707 | + | else | |
| 708 | + | player:getPosition():sendMagicEffect(03) | |
| 709 | + | return true | |
| 710 | + | end | |
| 711 | + | end | |
| 712 | + | if item.uid == 10602 then | |
| 713 | + | if player:getStorageValue(_SYSTEM.DANGEROUS[10][01].STORAGE) == 07 then | |
| 714 | + | if STEP_3 == 00 then | |
| 715 | + | STEP_3 = 01 | |
| 716 | + | local id = 01 | |
| 717 | + | local EffectPos = Position(PATH_EFFECT[03][STEP_3][01], PATH_EFFECT[03][STEP_3][02], PATH_EFFECT[03][STEP_3][03]) | |
| 718 | + | EffectPos:sendMagicEffect(38) | |
| 719 | + | addEvent(onEffectPath, FastEffect, EffectPos, id, player.uid, 03) | |
| 720 | + | return true | |
| 721 | + | else | |
| 722 | + | player:getPosition():sendMagicEffect(03) | |
| 723 | + | return true | |
| 724 | + | end | |
| 725 | + | else | |
| 726 | + | player:getPosition():sendMagicEffect(03) | |
| 727 | + | return true | |
| 728 | + | end | |
| 729 | + | end | |
| 730 | + | return true | |
| 731 | + | end |