Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dudantas/feat-soul-war-quest' …
Browse files Browse the repository at this point in the history
…into dudantas/feat-soul-war-quest
  • Loading branch information
s2leandro155 committed Sep 7, 2024
2 parents 26bef0c + f4a8e54 commit a5d2470
Show file tree
Hide file tree
Showing 24 changed files with 352 additions and 239 deletions.
6 changes: 3 additions & 3 deletions data-otservbr-global/lib/quests/soul_war.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ SoulWarQuest = {

timeToReturnImmuneMegalomania = 70, -- In seconds

baseBagYouDesireChance = 1, -- 1% base chance
baseBagYouDesireChance = 500, -- 1000 = 1% chance, 500 = 0.5% chance
bagYouDesireChancePerTaint = 1, -- Increases 1% per taint
bagYouDesireMonsters = {
"Bony Sea Devil",
"Brachiodemon",
"Branchy Crawler",
"Capricious Phantom",
"Cloak Of Terror",
"Cloak of Terror",
"Courage Leech",
"Distorted Phantom",
"Druid's Apparition",
Expand Down Expand Up @@ -1092,7 +1092,7 @@ function Monster:generateBagYouDesireLoot(player)

logger.trace("Player {} killed {} with {} taints, loot chance {}", player:getName(), monsterName, playerTaintLevel, totalChance)

if math.random(1, 100) <= totalChance then
if math.random(1, 100000) <= totalChance then
local itemType = ItemType(SoulWarQuest.bagYouDesireItemId)
if itemType then
loot[itemType:getId()] = { count = 1 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ monster.light = {

monster.summon = {
maxSummons = 1,
summons = {
{ name = "dreadful harvester", chance = 10, interval = 1000, count = 1 },
},
}

monster.voices = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ local monster = {}
monster.description = "a powerful soul"
monster.experience = 0
monster.outfit = {
lookType = 48,
lookType = 568,
lookHead = 0,
lookBody = 0,
lookLegs = 0,
Expand Down Expand Up @@ -101,7 +101,7 @@ mType.onThink = function(monster, interval)
boss:addReflectElement(elementType, reflectPercent)
end
boss:addDefense(10)
boss:setMaxHealth(boss:getHealth() + 10000)
boss:setMaxHealth(boss:getMaxHealth() + 10000)
boss:addHealth(10000)
end
transformTimeCount = 0
Expand Down
41 changes: 27 additions & 14 deletions data-otservbr-global/monster/quests/soul_war/soul_sphere.lua
Original file line number Diff line number Diff line change
Expand Up @@ -84,26 +84,39 @@ monster.immunities = {
}

local moveTimeCount = 0
local stop = false
mType.onThink = function(monster, interval)
if stop then
return
end

moveTimeCount = moveTimeCount + interval
if moveTimeCount == 3000 then
monster:move(DIRECTION_WEST)
moveTimeCount = 0
local monsterPos = monster:getPosition()
local nextPos = Position(monsterPos.x - 1, monsterPos.y, monsterPos.z)
local tile = Tile(nextPos)
if not tile then
return
end
if moveTimeCount >= 3000 then
local currentPos = monster:getPosition()
local newPos = Position(currentPos.x - 1, currentPos.y, currentPos.z)

for _, creatureId in pairs(tile:getCreatures()) do
local monster = Monster(creatureId)
if monster and monster:getName() == "Goshnar's Greed" then
monster:setHealth(monster:getMaxHealth())
break
local nextTile = Tile(newPos)
if nextTile then
for _, creatureId in pairs(nextTile:getCreatures()) do
local greedMonster = Monster(creatureId)
if greedMonster and greedMonster:getName() == "Goshnar's Greed" then
greedMonster:setHealth(greedMonster:getMaxHealth())
stop = true
return
end
end
end

if not stop then
monster:teleportTo(newPos, true)
moveTimeCount = 0
end
end
end

mType.onSpawn = function(monster)
moveTimeCount = 0
stop = false
end

mType:register(monster)
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ local monster = {}
monster.description = "a strong soul"
monster.experience = 0
monster.outfit = {
lookType = 48,
lookType = 566,
lookHead = 0,
lookBody = 0,
lookLegs = 0,
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/world/otservbr-house.xml
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@
<house name="Mill Avenue 4" houseid="2953" entryx="32413" entryy="32189" entryz="6" rent="100000" townid="8" size="33" clientid="0" beds="2" />
<house name="Mill Avenue 5" houseid="2954" entryx="32422" entryy="32178" entryz="7" rent="300000" townid="8" size="69" clientid="0" beds="4" />
<house name="Open-Air Theatre" houseid="2955" entryx="32262" entryy="32238" entryz="7" rent="150000" townid="8" size="81" clientid="0" beds="1" />
<house name="Smuggler's Den" houseid="2956" entryx="32419" entryy="32262" entryz="9" rent="400000" townid="8" size="227" clientid="0" beds="7" />
<house name="Smuggler's Den" houseid="2956" entryx="32419" entryy="32262" entryz="9" rent="400000" townid="8" size="226" clientid="0" beds="7" />
<house name="Sorcerer's Avenue 1a" houseid="2957" entryx="32300" entryy="32254" entryz="7" rent="100000" townid="8" size="24" clientid="0" beds="2" />
<house name="Sorcerer's Avenue 5 (Shop)" houseid="2958" entryx="32284" entryy="32256" entryz="7" rent="150000" townid="8" size="54" clientid="0" beds="1" />
<house name="Sorcerer's Avenue 1b" houseid="2959" entryx="32300" entryy="32251" entryz="6" rent="80000" townid="8" size="19" clientid="0" beds="2" />
Expand Down
Loading

0 comments on commit a5d2470

Please sign in to comment.