-
-
Notifications
You must be signed in to change notification settings - Fork 652
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix/improvement-creature-events
- Loading branch information
Showing
61 changed files
with
426 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
local mType = Game.createMonsterType("Doctor Marrow") | ||
local monster = {} | ||
|
||
monster.description = "Doctor Marrow" | ||
monster.experience = 0 | ||
monster.outfit = { | ||
lookType = 1611, | ||
lookHead = 57, | ||
lookBody = 0, | ||
lookLegs = 0, | ||
lookFeet = 95, | ||
lookAddons = 0, | ||
lookMount = 0, | ||
} | ||
|
||
monster.health = 1800 | ||
monster.maxHealth = 1800 | ||
monster.race = "blood" | ||
monster.corpse = 18074 | ||
monster.speed = 125 | ||
monster.manaCost = 0 | ||
|
||
monster.changeTarget = { | ||
interval = 4000, | ||
chance = 10, | ||
} | ||
|
||
monster.strategiesTarget = { | ||
nearest = 80, | ||
health = 10, | ||
damage = 10, | ||
} | ||
|
||
monster.flags = { | ||
summonable = false, | ||
attackable = true, | ||
hostile = true, | ||
convinceable = false, | ||
pushable = false, | ||
rewardBoss = true, | ||
illusionable = false, | ||
canPushItems = true, | ||
canPushCreatures = true, | ||
critChance = 10, | ||
staticAttackChance = 90, | ||
targetDistance = 1, | ||
runHealth = 0, | ||
healthHidden = false, | ||
isBlockable = false, | ||
canWalkOnEnergy = true, | ||
canWalkOnFire = true, | ||
canWalkOnPoison = true, | ||
} | ||
|
||
monster.light = { | ||
level = 0, | ||
color = 0, | ||
} | ||
|
||
monster.voices = { | ||
interval = 5000, | ||
chance = 10, | ||
{ text = "You can't stop the future!", yell = false }, | ||
} | ||
|
||
monster.attacks = { | ||
{ name = "melee", interval = 2000, chance = 100, minDamage = 0, maxDamage = -2800 }, | ||
} | ||
|
||
monster.defenses = { | ||
defense = 54, | ||
armor = 59, | ||
mitigation = 3.7, | ||
} | ||
|
||
monster.elements = { | ||
{ type = COMBAT_PHYSICALDAMAGE, percent = 0 }, | ||
{ type = COMBAT_ENERGYDAMAGE, percent = 0 }, | ||
{ type = COMBAT_EARTHDAMAGE, percent = 0 }, | ||
{ type = COMBAT_FIREDAMAGE, percent = 0 }, | ||
{ type = COMBAT_LIFEDRAIN, percent = 0 }, | ||
{ type = COMBAT_MANADRAIN, percent = 0 }, | ||
{ type = COMBAT_DROWNDAMAGE, percent = 0 }, | ||
{ type = COMBAT_ICEDAMAGE, percent = 0 }, | ||
{ type = COMBAT_HOLYDAMAGE, percent = 0 }, | ||
{ type = COMBAT_DEATHDAMAGE, percent = 0 }, | ||
} | ||
|
||
monster.immunities = { | ||
{ type = "paralyze", condition = true }, | ||
{ type = "outfit", condition = false }, | ||
{ type = "invisible", condition = true }, | ||
{ type = "bleed", condition = false }, | ||
} | ||
|
||
mType.onThink = function(monster, interval) end | ||
|
||
mType.onAppear = function(monster, creature) | ||
if monster:getType():isRewardBoss() then | ||
monster:setReward(true) | ||
end | ||
end | ||
|
||
mType.onDisappear = function(monster, creature) end | ||
|
||
mType.onMove = function(monster, creature, fromPosition, toPosition) end | ||
|
||
mType.onSay = function(monster, creature, type, message) end | ||
|
||
mType:register(monster) |
13 changes: 13 additions & 0 deletions
13
data-otservbr-global/scripts/creaturescripts/customs/reward_exercise.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
local winReward = CreatureEvent("WinReward") | ||
|
||
function winReward.onLogin(player) | ||
if configManager.getBoolean(configKeys.TOGGLE_RECEIVE_REWARD) and player:getTown():getId() >= TOWNS_LIST.AB_DENDRIEL then | ||
-- check user won exercise weapon and send message | ||
if player:getStorageValue(tonumber(Storage.PlayerWeaponReward)) ~= 1 then | ||
player:sendTextMessage(MESSAGE_LOGIN, "You can receive an exercise weapon using command !reward") | ||
end | ||
end | ||
return true | ||
end | ||
|
||
winReward:register() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+1.61 KB
(430%)
data-otservbr-global/world/world_changes/fury_gates/abdendriel.otbm
Binary file not shown.
Binary file modified
BIN
+1.79 KB
(420%)
data-otservbr-global/world/world_changes/fury_gates/ankrahmun.otbm
Binary file not shown.
Binary file modified
BIN
+1.52 KB
(430%)
data-otservbr-global/world/world_changes/fury_gates/carlin.otbm
Binary file not shown.
Binary file modified
BIN
+1.84 KB
(380%)
data-otservbr-global/world/world_changes/fury_gates/darashia.otbm
Binary file not shown.
Binary file modified
BIN
+1.72 KB
(400%)
data-otservbr-global/world/world_changes/fury_gates/edron.otbm
Binary file not shown.
Binary file modified
BIN
+2.13 KB
(530%)
data-otservbr-global/world/world_changes/fury_gates/kazordoon.otbm
Binary file not shown.
Binary file modified
BIN
+1.86 KB
(430%)
data-otservbr-global/world/world_changes/fury_gates/libertybay.otbm
Binary file not shown.
Binary file modified
BIN
+1.69 KB
(480%)
data-otservbr-global/world/world_changes/fury_gates/porthope.otbm
Binary file not shown.
Binary file modified
BIN
+2.79 KB
(520%)
data-otservbr-global/world/world_changes/fury_gates/thais.otbm
Binary file not shown.
Binary file modified
BIN
+2.99 KB
(620%)
data-otservbr-global/world/world_changes/fury_gates/venore.otbm
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
FS = {} | ||
|
||
function FS.exists(path) | ||
local file = io.open(path, "r") | ||
if file then | ||
file:close() | ||
return true | ||
end | ||
return false | ||
end | ||
|
||
function FS.mkdir(path) | ||
if FS.exists(path) then | ||
return true | ||
end | ||
local success, err = os.execute('mkdir "' .. path .. '"') | ||
if not success then | ||
return false, err | ||
end | ||
return true | ||
end | ||
|
||
function FS.mkdir_p(path) | ||
if path == "" then | ||
return true | ||
end | ||
if FS.exists(path) then | ||
return true | ||
end | ||
FS.mkdir_p(path:match("(.*[/\\])")) | ||
return FS.mkdir(path) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
local config = { | ||
items = { | ||
{ id = 35284, charges = 64000 }, | ||
{ id = 35279, charges = 64000 }, | ||
{ id = 35281, charges = 64000 }, | ||
{ id = 35283, charges = 64000 }, | ||
{ id = 35282, charges = 64000 }, | ||
{ id = 35280, charges = 64000 }, | ||
}, | ||
storage = tonumber(Storage.PlayerWeaponReward), -- storage key, player can only win once | ||
} | ||
|
||
local function sendExerciseRewardModal(player) | ||
local window = ModalWindow({ | ||
title = "Exercise Reward", | ||
message = "choose a item", | ||
}) | ||
for _, it in pairs(config.items) do | ||
local iType = ItemType(it.id) | ||
if iType then | ||
window:addChoice(iType:getName(), function(player, button, choice) | ||
if button.name ~= "Select" then | ||
return true | ||
end | ||
|
||
local inbox = player:getSlotItem(CONST_SLOT_STORE_INBOX) | ||
if inbox and inbox:getEmptySlots() > 0 then | ||
local item = inbox:addItem(it.id, it.charges) | ||
if item then | ||
item:setAttribute(ITEM_ATTRIBUTE_STORE, systemTime()) | ||
else | ||
player:sendTextMessage(MESSAGE_LOOK, "You need to have capacity and empty slots to receive.") | ||
return | ||
end | ||
player:sendTextMessage(MESSAGE_LOOK, string.format("Congratulations, you received a %s with %i charges in your store inbox.", iType:getName(), it.charges)) | ||
player:setStorageValue(config.storage, 1) | ||
else | ||
player:sendTextMessage(MESSAGE_LOOK, "You need to have capacity and empty slots to receive.") | ||
end | ||
end) | ||
end | ||
end | ||
window:addButton("Select") | ||
window:addButton("Close") | ||
window:setDefaultEnterButton(0) | ||
window:setDefaultEscapeButton(1) | ||
window:sendToPlayer(player) | ||
end | ||
|
||
local exerciseRewardModal = TalkAction("!reward") | ||
function exerciseRewardModal.onSay(player, words, param) | ||
if not configManager.getBoolean(configKeys.TOGGLE_RECEIVE_REWARD) or player:getTown():getId() < TOWNS_LIST.AB_DENDRIEL then | ||
return true | ||
end | ||
if player:getStorageValue(config.storage) > 0 then | ||
player:sendTextMessage(MESSAGE_LOOK, "You already received your exercise weapon reward!") | ||
return true | ||
end | ||
sendExerciseRewardModal(player) | ||
return true | ||
end | ||
|
||
exerciseRewardModal:separator(" ") | ||
exerciseRewardModal:groupType("normal") | ||
exerciseRewardModal:register() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.