implement few new 781 items

This commit is contained in:
ErikasKontenis 2019-11-24 14:00:44 +02:00
parent 2911739928
commit 2a432da341
12 changed files with 128 additions and 19 deletions

View File

@ -52,7 +52,7 @@ timeBetweenExActions = 1000
-- Map
-- NOTE: set mapName WITHOUT .otbm at the end
mapName = "mymap"
mapName = "map"
mapAuthor = "CipSoft"
-- MySQL

View File

@ -94,6 +94,7 @@
<action fromid="2948" toid="2950" script="misc/instruments.lua" />
<action fromid="2952" toid="2965" script="misc/instruments.lua" />
<action itemid="3219" script="misc/instruments.lua" />
<action itemid="5786" script="misc/instruments.lua" />
<!-- Strange Levers -->
<action fromid="2566" toid="2567" script="misc/strange_lever.lua" />
@ -103,6 +104,7 @@
<action itemid="435" script="misc/teleporters.lua" />
<action itemid="1948" script="misc/teleporters.lua" />
<action itemid="1968" script="misc/teleporters.lua" />
<action itemid="5542" script="misc/teleporters.lua" />
<!-- Special Right -->
<action itemid="372" script="misc/special_rights.lua" />
@ -118,7 +120,6 @@
<!-- Fun -->
<action itemid="611" script="misc/snowheap.lua" />
<action itemid="5080" script="misc/panda_teddy.lua" />
<action itemid="2974" script="misc/water_pipe.lua" />
<action itemid="2976" script="misc/birdcage.lua" />
<action itemid="3103" script="misc/cornucopia.lua" />
@ -146,6 +147,11 @@
<action itemid="3208" script="misc/weapons.lua" />
<action itemid="3059" script="misc/spellbook.lua" />
<!-- Dolls -->
<action itemid="5080" script="misc/dolls.lua" />
<action itemid="5668" script="misc/dolls.lua" />
<action itemid="5791" script="misc/dolls.lua" />
<!-- Keys -->
<action fromid="2967" toid="2973" script="misc/key.lua" />
@ -166,6 +172,7 @@
<action itemid="4872" script="misc/ice_pick.lua" />
<action itemid="3456" script="misc/pick.lua" />
<action itemid="3457" script="misc/shovel.lua" />
<action itemid="5710" script="misc/shovel.lua" />
<action itemid="3483" allowfaruse="1" script="misc/fishing_rod.lua" />
<!-- Miscellaneous -->
@ -224,6 +231,7 @@
<action itemid="3478" script="misc/fluids.lua" />
<action itemid="3479" script="misc/fluids.lua" />
<action itemid="3480" script="misc/fluids.lua" />
<action itemid="5552" script="misc/fluids.lua" />
<!-- Food -->
<action itemid="3250" script="misc/food.lua" />
@ -266,6 +274,7 @@
<action itemid="3731" script="misc/food.lua" />
<action itemid="3732" script="misc/food.lua" />
<action itemid="5096" script="misc/food.lua" />
<action itemid="5678" script="misc/food.lua" />
<!-- Passthrough -->
<action fromid="2334" toid="2341" script="misc/doors.lua" />
@ -291,6 +300,8 @@
<action itemid="5142" script="misc/doors.lua" />
<action itemid="5277" script="misc/doors.lua" />
<action itemid="5280" script="misc/doors.lua" />
<action itemid="5732" script="misc/doors.lua" />
<action itemid="5735" script="misc/doors.lua" />
<!-- Level Doors -->
<action itemid="1646" script="misc/doors.lua" />
@ -323,6 +334,8 @@
<action itemid="5131" script="misc/doors.lua" />
<action itemid="5287" script="misc/doors.lua" />
<action itemid="5289" script="misc/doors.lua" />
<action itemid="5745" script="misc/doors.lua" />
<action itemid="5749" script="misc/doors.lua" />
<!-- Closed Normal Doors -->
<action itemid="2177" script="misc/doors.lua" />
@ -360,6 +373,10 @@
<action itemid="5281" script="misc/doors.lua" />
<action itemid="5283" script="misc/doors.lua" />
<action itemid="5285" script="misc/doors.lua" />
<action itemid="5514" script="misc/doors.lua" />
<action itemid="5516" script="misc/doors.lua" />
<action itemid="5733" script="misc/doors.lua" />
<action itemid="5736" script="misc/doors.lua" />
<!-- Open Vertical Doors -->
<action itemid="1630" script="misc/doors.lua" />
@ -394,6 +411,9 @@
<action itemid="5284" script="misc/doors.lua" />
<action itemid="5288" script="misc/doors.lua" />
<action itemid="5292" script="misc/doors.lua" />
<action itemid="5515" script="misc/doors.lua" />
<action itemid="5737" script="misc/doors.lua" />
<action itemid="5748" script="misc/doors.lua" />
<!-- Open Horizontal Doors -->
<action itemid="1633" script="misc/doors.lua" />
@ -428,4 +448,7 @@
<action itemid="5286" script="misc/doors.lua" />
<action itemid="5290" script="misc/doors.lua" />
<action itemid="5294" script="misc/doors.lua" />
<action itemid="5517" script="misc/doors.lua" />
<action itemid="5734" script="misc/doors.lua" />
<action itemid="5746" script="misc/doors.lua" />
</actions>

View File

@ -0,0 +1,53 @@
local dolls = {
[5080] = {"Hug me."},
[5668] = {
"It's not winning that matters, but winning in style.",
"Today's your lucky day. Probably.",
"Do not meddle in the affairs of dragons, for you are crunchy and taste good with ketchup.",
"That is one stupid question.",
"You'll need more rum for that.",
"Do or do not. There is no try.",
"You should do something you always wanted to.",
"If you walk under a ladder and it falls down on you it probably means bad luck.",
"Never say 'oops'. Always say 'Ah, interesting!'",
"Five steps east, fourteen steps south, two steps north and seventeen steps west!"
},
[5791] = {
"Fchhhhhh!",
"Zchhhhhh!",
"Grooaaaaar*cough*",
"Aaa... CHOO!",
"You... will.... burn!!"
}
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local sounds = dolls[item.itemid]
if not sounds then
return false
end
if fromPosition.x == CONTAINER_POSITION then
fromPosition = player:getPosition()
end
local random = math.random(#sounds)
local sound = sounds[random]
if item.itemid == 5791 then
if random == 3 then
fromPosition:sendMagicEffect(CONST_ME_POFF)
elseif random == 4 then
fromPosition:sendMagicEffect(CONST_ME_FIREAREA)
elseif random == 5 then
doTargetCombatHealth(0, player, COMBAT_PHYSICALDAMAGE, -1, -1, CONST_ME_EXPLOSIONHIT)
end
elseif item.itemid == 5668 then
fromPosition:sendMagicEffect(CONST_ME_MAGIC_RED)
item:transform(item.itemid + 1)
item:decay()
end
sound = sound:gsub('|PLAYERNAME|', player:getName())
player:say(sound, TALKTYPE_MONSTER_SAY, false, 0, fromPosition)
return true
end

View File

@ -1,5 +1,5 @@
local lockedDoors = {
1628, 1631, 1650, 1653, 1668, 1671, 1682, 1691, 5006, 5007, 5097, 5106, 5115, 5124, 5133, 5136, 5139, 5142, 5277, 5280
1628, 1631, 1650, 1653, 1668, 1671, 1682, 1691, 5006, 5007, 5097, 5106, 5115, 5124, 5133, 5136, 5139, 5142, 5277, 5280, 5732, 5735
}
local closedNormalDoors = {
@ -39,6 +39,10 @@ local closedNormalDoors = {
[5281] = 5282,
[5283] = 5284,
[5285] = 5286,
[5514] = 5515,
[5516] = 5517,
[5733] = 5734,
[5736] = 5737,
}
local openVerticalDoors = {
@ -74,6 +78,9 @@ local openVerticalDoors = {
[5284] = 5283,
[5288] = 5287,
[5292] = 5291,
[5515] = 5514,
[5737] = 5736,
[5748] = 5749,
}
local openHorizontalDoors = {
@ -109,6 +116,9 @@ local openHorizontalDoors = {
[5286] = 5285,
[5290] = 5289,
[5294] = 5293,
[5517] = 5516,
[5734] = 5733,
[5746] = 5745,
}
local levelDoors = {
@ -143,6 +153,8 @@ local questDoors = {
[5131] = 5132,
[5287] = 5288,
[5289] = 5290,
[5745] = 5746,
[5749] = 5748,
}
local passthrough = {

View File

@ -8,6 +8,15 @@ function onUse(player, item, fromPosition, target, toPosition)
item:getPosition():sendMagicEffect(CONST_ME_SOUND_PURPLE)
elseif item:getId() == 3219 then
item:getPosition():sendMagicEffect(19)
elseif item:getId() == 5786 then
Game.createMonster("wolf", player:getPosition())
local random = math.random(1,10)
if random > 3 then -- destroy 70% chance
item:getPosition():sendMagicEffect(CONST_ME_SOUND_RED)
item:remove(1)
else
item:getPosition():sendMagicEffect(CONST_ME_SOUND_YELLOW)
end
end
return true

View File

@ -1,4 +0,0 @@
function onUse(player, item, fromPosition, target, toPosition)
player:sendCancelMessage("Hug me ^^")
return true
end

View File

@ -3,7 +3,7 @@ local downstairs = {
}
local upstairs = {
1948, 1968
1948, 1968, 5542
}
function onUse(player, item, fromPosition, target, toPosition)

View File

@ -24904,7 +24904,7 @@ TypeID = 5513
Name = "a distilling machine"
Flags = {Bottom,Unpass,Unmove,Unlay,Expire}
Attributes = {FluidSource=RUM,ExpireTarget=5469,TotalExpireTime=10}
# pradeti nuo cia
TypeID = 5514
Name = "a closed door"
Flags = {Door,Unpass,Unmove,Unthrow,Unlay}
@ -25021,7 +25021,7 @@ Attributes = {ExpireTarget=0,TotalExpireTime=600}
TypeID = 5538
Name = "a rum cask"
Flags = {Unpass,Unmove,Unlay}
Attributes = {FluidSource=WINE} # TODO: FluidSource should be RUM
Attributes = {FluidSource=RUM}
TypeID = 5539
Name = "a dead carrion worm"
@ -25081,7 +25081,7 @@ Flags = {Bottom,Unpass,Unmove,Unlay}
TypeID = 5552
Name = "a rum flask"
Flags = {MultiUse,FluidContainer,Take} # TODO: make it useable
Flags = {MultiUse,FluidContainer,Take}
Attributes = {Weight=280}
TypeID = 5553
@ -25584,14 +25584,14 @@ Attributes = {ExpireTarget=0,TotalExpireTime=600}
TypeID = 5668
Name = "a mysterious voodoo skull"
Flags = {Take}
Flags = {UseEvent,Take}
Attributes = {Weight=1400}
TypeID = 5669
Name = "a enigmatic voodoo skull"
Description = "It is not time yet"
Flags = {Take,Expire}
Attributes = {Weight=1400,ExpireTarget=5668,TotalExpireTime=72000} # TODO: make it useable like in wiki
Attributes = {Weight=1400,ExpireTarget=5668,TotalExpireTime=72000}
TypeID = 5670
Name = "a pirate statue"
@ -25628,7 +25628,7 @@ Flags = {Bottom,Unpass,Unmove,Unlay}
TypeID = 5678
Name = "a tortoise egg"
Flags = {Cumulative,Take}
Attributes = {Nutrition=6,Weight=30} # TODO: make it eatable
Attributes = {Nutrition=8,Weight=30}
TypeID = 5679
Name = "a shell"
@ -25766,7 +25766,7 @@ Flags = {Bottom,Unpass,Unmove,Unlay}
TypeID = 5710
Name = "a light shovel"
Flags = {MultiUse,UseEvent,Take} # TODO: make to work as shovel
Flags = {MultiUse,UseEvent,Take}
Attributes = {Weight=1500}
TypeID = 5711
@ -26109,8 +26109,8 @@ Attributes = {MaxLength=99,Weight=1000}
TypeID = 5786
Name = "a wooden whistle"
Flags = {Take}
Attributes = {Weight=100} # TODO: implement music like in tibia wiki says
Attributes = {Weight=100}
# pradzia nuo cia
TypeID = 5787
Name = "a training dummy"
Flags = {Unpass,Unmove,Unlay}
@ -26130,7 +26130,7 @@ Flags = {Unmove}
TypeID = 5791
Name = "a stuffed dragon"
Flags = {Take}
Attributes = {Weight=850} # TODO: implement like in tibia wiki says
Attributes = {Weight=850}
TypeID = 5792
Name = "a die"

View File

@ -71,5 +71,6 @@
<item id="3736" countmax="1" chance="90" /> <!-- a star herb -->
<item id="3012" countmax="1" chance="100" /> <!-- a wolf tooth chain -->
<item id="3037" countmax="1" chance="4" /> <!-- a yellow gem -->
<item id="5786" countmax="1" chance="13000" /> <!-- wooden whistle -->
</loot>
</monster>

View File

@ -538,6 +538,14 @@
<movevent event="AddItem" itemid="5258" tileitem="1" script="misc/floorchange.lua" />
<movevent event="StepIn" itemid="5259" script="misc/floorchange.lua" />
<movevent event="AddItem" itemid="5259" tileitem="1" script="misc/floorchange.lua" />
<movevent event="StepIn" itemid="5544" script="misc/floorchange.lua" />
<movevent event="AddItem" itemid="5544" tileitem="1" script="misc/floorchange.lua" />
<movevent event="StepIn" itemid="5691" script="misc/floorchange.lua" />
<movevent event="AddItem" itemid="5691" tileitem="1" script="misc/floorchange.lua" />
<movevent event="StepIn" itemid="5731" script="misc/floorchange.lua" />
<movevent event="AddItem" itemid="5731" tileitem="1" script="misc/floorchange.lua" />
<movevent event="StepIn" itemid="5763" script="misc/floorchange.lua" />
<movevent event="AddItem" itemid="5763" tileitem="1" script="misc/floorchange.lua" />
<!-- Damage -->
<movevent event="StepIn" itemid="2145" script="misc/damage.lua" />
@ -601,6 +609,8 @@
<movevent event="StepOut" itemid="5290" script="misc/doors.lua" />
<movevent event="StepOut" itemid="5292" script="misc/doors.lua" />
<movevent event="StepOut" itemid="5294" script="misc/doors.lua" />
<movevent event="StepOut" itemid="5746" script="misc/doors.lua" />
<movevent event="StepOut" itemid="5748" script="misc/doors.lua" />
<!-- Magic Fields -->
<movevent event="StepIn" itemid="1998" function="onStepInField" />

View File

@ -13,6 +13,7 @@ local verticalDoors = {
[5132] = 5131,
[5288] = 5287,
[5292] = 5291,
[5748] = 5749,
}
local horizontalDoors = {
@ -30,6 +31,7 @@ local horizontalDoors = {
[5123] = 5122,
[5290] = 5289,
[5294] = 5293,
[5746] = 5745,
}
function onStepOut(creature, item, fromPosition, toPosition)

View File

@ -3,7 +3,6 @@ local list = {
[294] = {x = 0, y = 0, z = 1},
[369] = {x = 0, y = 0, z = 1},
[370] = {x = 0, y = 0, z = 1},
[385] = {x = 0, y = 0, z = 1},
[394] = {x = 0, y = 0, z = 1},
[411] = {x = 0, y = 0, z = 1},
[412] = {x = 0, y = 0, z = 1},
@ -73,6 +72,10 @@ local list = {
[5257] = {x = -1, y = 0, z = -1},
[5258] = {x = 0, y = -1, z = -1},
[5259] = {x = -1, y = 0, z = -1},
[5544] = {x = 0, y = 0, z = 1},
[5691] = {x = 0, y = 0, z = 1},
[5731] = {x = 0, y = 0, z = 1},
[5763] = {x = 0, y = 0, z = 1},
}
function onStepIn(creature, item, position, fromPosition)