implement few new 781 items

This commit is contained in:
ErikasKontenis
2019-11-22 18:27:42 +02:00
parent c58e72523a
commit c96b7af52b
9 changed files with 281 additions and 100 deletions

View File

@@ -1,5 +1,5 @@
local lockedDoors = {
1628, 1631, 1650, 1653, 1668, 1671, 1682, 1691, 5006, 5007, 5097
1628, 1631, 1650, 1653, 1668, 1671, 1682, 1691, 5006, 5007, 5097, 5106, 5115, 5124, 5133, 5136, 5139, 5142, 5277, 5280
}
local closedNormalDoors = {
@@ -24,6 +24,21 @@ local closedNormalDoors = {
[2177] = 2178,
[2179] = 2180,
[5098] = 5099,
[5100] = 5101,
[5107] = 5108,
[5109] = 5110,
[5116] = 5117,
[5118] = 5119,
[5125] = 5126,
[5127] = 5128,
[5134] = 5135,
[5137] = 5138,
[5140] = 5141,
[5143] = 5144,
[5278] = 5279,
[5281] = 5282,
[5283] = 5284,
[5285] = 5286,
}
local openVerticalDoors = {
@@ -45,6 +60,20 @@ local openVerticalDoors = {
[4914] = 4913,
[5083] = 5082,
[2178] = 2177,
[5108] = 5107,
[5110] = 5109,
[5112] = 5111,
[5114] = 5113,
[5126] = 5125,
[5128] = 5127,
[5130] = 5129,
[5132] = 5131,
[5141] = 5140,
[5144] = 5143,
[5282] = 5281,
[5284] = 5283,
[5288] = 5287,
[5292] = 5291,
}
local openHorizontalDoors = {
@@ -67,6 +96,19 @@ local openHorizontalDoors = {
[5085] = 5084,
[2180] = 2179,
[5099] = 5098,
[5101] = 5100,
[5103] = 5102,
[5105] = 5104,
[5117] = 5116,
[5119] = 5118,
[5121] = 5120,
[5123] = 5122,
[5135] = 5134,
[5138] = 5137,
[5279] = 5278,
[5286] = 5285,
[5290] = 5289,
[5294] = 5293,
}
local levelDoors = {
@@ -78,6 +120,13 @@ local levelDoors = {
[1680] = 1681,
[1687] = 1688,
[1696] = 1697,
[5102] = 5103,
[5104] = 5105,
[5111] = 5112,
[5120] = 5121,
[5129] = 5130,
[5291] = 5292,
[5293] = 5294,
}
local questDoors = {
@@ -89,6 +138,11 @@ local questDoors = {
[1676] = 1677,
[1689] = 1690,
[1698] = 1699,
[5113] = 5114,
[5122] = 5123,
[5131] = 5132,
[5287] = 5288,
[5289] = 5290,
}
local passthrough = {

View File

@@ -0,0 +1,26 @@
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local random = math.random(10)
if random >= 4 then --success 6% chance
if target.itemid == 5465 then --Burn Sugar Cane
toPosition:sendMagicEffect(CONST_ME_FIREAREA)
target:transform(5464)
target:decay()
elseif target.itemid == 3514 then --Light Up empty coal basins
toPosition:sendMagicEffect(CONST_ME_HITBYFIRE)
target:transform(3513)
elseif target.itemid == 2114 then --Light Up empty coal basins
toPosition:sendMagicEffect(CONST_ME_HITBYFIRE)
target:transform(2113)
end
elseif random == 2 then --it remove the fire bug 2% chance
item:remove(1)
toPosition:sendMagicEffect(CONST_ME_POFF)
elseif random == 1 then --it explode on the user 1% chance
doTargetCombatHealth(0, player, COMBAT_FIREDAMAGE, -5, -5, CONST_ME_HITBYFIRE)
player:say('OUCH!', TALKTYPE_MONSTER_SAY)
item:remove(1)
else
toPosition:sendMagicEffect(CONST_ME_POFF) --it fails, but dont get removed 3% chance
end
return true
end

View File

@@ -11,6 +11,11 @@ function onUse(player, item, fromPosition, target, toPosition)
target:decay()
Game.createItem(3605, 1, target:getPosition())
return true
elseif target:getId() == 5463 then
target:transform(5462, 1)
target:decay()
Game.createItem(5466, 1, target:getPosition())
return true
end
return doDestroyItem(target)
end