Skip to content

Commit

Permalink
lasted - f8c20c7b30815d284534c5385da8156edd31f0e2 from otserv
Browse files Browse the repository at this point in the history
  • Loading branch information
mattyx14 committed Dec 19, 2019
1 parent 28a91b3 commit 19e3270
Show file tree
Hide file tree
Showing 15 changed files with 45 additions and 49 deletions.
25 changes: 12 additions & 13 deletions data/actions/lib/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -251,19 +251,18 @@ function onUsePick(player, item, fromPosition, target, toPosition, isHotkey)

-- shiny stone refining
elseif target.itemid == 11227 then
local chance = math.random(1,100)

if chance == 1 then
player:addItem(2160, 1) -- 1% chance of getting crystal coin
elseif chance <= 6 then
player:addItem(2148, 1) -- 5% chance of getting gold coin
elseif chance <= 51 then
player:addItem(2152, 1) -- 45% chance of getting platinum coin
else
player:addItem(2145, 1) -- 49% chance of getting small diamond
end
target:getPosition():sendMagicEffect(CONST_ME_BLOCKHIT)
target:remove(1)
local chance = math.random(1,100)
if chance == 1 then
player:addItem(2160, 1) -- 1% chance of getting crystal coin
elseif chance <= 6 then
player:addItem(2148, 1) -- 5% chance of getting gold coin
elseif chance <= 51 then
player:addItem(2152, 1) -- 45% chance of getting platinum coin
else
player:addItem(2145, 1) -- 49% chance of getting small diamond
end
target:getPosition():sendMagicEffect(CONST_ME_BLOCKHIT)
target:remove(1)

elseif targetId == 11227 then
target:remove(1)
Expand Down
11 changes: 2 additions & 9 deletions data/actions/scripts/tools/shovel.lua
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
local config = {
swampId = {20230, 18589, 18584, 18141}, -- ids dos tiles de swamp que pode ser usado a shovel
itemGain = {{itemId = 2818, quantGain = 1}, -- itemid que ganha, e quantidade maxima do msm.
{itemId = 2145, quantGain = 3},
{itemId = 20138, quantGain = 1}
}
}

local exhausth = 3600 --em quantos segundos podera usar denovo
local holes = {468, 481, 483, 7932, 23712}
local pools = {2016, 2017, 2018, 2019, 2020, 2021, 2025, 2026, 2027, 2028, 2029, 2030}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isInArray(pools, itemEx.itemid) then
if isInArray(pools, itemEx.itemid) then
itemEx = Tile(toPosition):getGround()
end

if targetId == 23712 then
target:transform(23713)
addEvent(revertItem, 30 * 1000, toPosition, 23713, 23712)
Expand Down
2 changes: 1 addition & 1 deletion data/creaturescripts/scripts/others/firstitems.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function onLogin(player)
player:addItem(targetVocation.items[i][1], targetVocation.items[i][2])
end

local backpack = player:getVocation():getId() == 0 and player:addItem(1987) or player:addItem(2674)
local backpack = player:getVocation():getId() == 0 and player:addItem(1987) or player:addItem(1988)
if not backpack then
return true
end
Expand Down
5 changes: 1 addition & 4 deletions data/creaturescripts/scripts/others/login.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ function onLogin(player)

player:loadSpecialStorage()

if (player:getGroup():getId() >= 4) then
player:setGhostMode(true)
end

-- Stamina
nextUseStaminaTime[playerId] = 1

Expand Down Expand Up @@ -154,5 +150,6 @@ function onLogin(player)
if player:getStorageValue(Storage.isTraining) == 1 then -- redefinir storage de exercise weapon
player:setStorageValue(Storage.isTraining,0)
end

return true
end
1 change: 1 addition & 0 deletions data/global.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
math.randomseed(os.time())
dofile('data/lib/libs.lua')

NOT_MOVEABLE_ACTION = 8000
Expand Down
1 change: 0 additions & 1 deletion data/globalevents/scripts/startup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ local startupGlobalStorages = {
}

function onStartup()
math.randomseed(os.time())
print(string.format('>> Loaded %d npcs and spawned %d monsters.\n>> Loaded %d towns with %d houses in total.', Game.getNpcCount(), Game.getMonsterCount(), #Game.getTowns(), #Game.getHouses()))
for i = 1, #startupGlobalStorages do
Game.setStorageValue(startupGlobalStorages[i], 0)
Expand Down
10 changes: 8 additions & 2 deletions data/modules/scripts/gamestore/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1084,8 +1084,14 @@ function GameStore.processStackablePurchase(player, offerId, offerCount, offerNa
return ((itemId >= ITEM_KEG_START and itemId <= ITEM_KEG_END) or (itemId >= ITEM_EXERCISE_START and itemId <= ITEM_EXERCISE_END) or itemId == 32109)
end

if (isKegExerciseItem(offerId) and player:getFreeCapacity() < ItemType(offerId):getWeight(1)) then
return error({code = 0, message = "Please make sure you have free capacity to hold this item."})
if isKegExerciseItem(offerId) then
if player:getFreeCapacity() < ItemType(offerId):getWeight(1) then
return error({code = 0, message = "Please make sure you have free capacity to hold this item."})
end
else
if player:getFreeCapacity() < ItemType(offerId):getWeight(offerCount) then
return error({code = 0, message = "Please make sure you have free capacity to hold this item."})
end
end

local inbox = player:getSlotItem(CONST_SLOT_STORE_INBOX)
Expand Down
2 changes: 1 addition & 1 deletion data/monster/summons/Emberwing.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<flag illusionable="0" />
<flag convinceable="0" />
<flag pushable="1" />
<flag canpushitems="1" />
<flag canpushitems="0" />
<flag canpushcreatures="1" />
<flag staticattack="98" />
<flag targetdistance="2" />
Expand Down
2 changes: 1 addition & 1 deletion data/monster/summons/Grovebeast.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<flag illusionable="0"/>
<flag convinceable="0"/>
<flag pushable="1"/>
<flag canpushitems="1"/>
<flag canpushitems="0"/>
<flag canpushcreatures="1"/>
<flag staticattack="98"/>
<flag targetdistance="0"/>
Expand Down
2 changes: 1 addition & 1 deletion data/monster/summons/Skullfrost.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<flag illusionable="0" />
<flag convinceable="0" />
<flag pushable="1" />
<flag canpushitems="1" />
<flag canpushitems="0" />
<flag canpushcreatures="1" />
<flag staticattack="98" />
<flag targetdistance="3" />
Expand Down
2 changes: 1 addition & 1 deletion data/monster/summons/Thundergiant.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<flag illusionable="0" />
<flag convinceable="1" />
<flag pushable="1" />
<flag canpushitems="1" />
<flag canpushitems="0" />
<flag canpushcreatures="1" />
<flag staticattack="98" />
<flag targetdistance="0" />
Expand Down
8 changes: 2 additions & 6 deletions data/npc/The Oracle.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<npc name="The Oracle" script="The Oracle.lua" walkinterval="0" speechbubble="3">
<npc name="The Oracle" script="The Oracle.lua" walkinterval="0" floorchange="0">
<health now="100" max="100" />
<look typeex="1448" />
<parameters>
<parameter key="message_greet" value="|PLAYERNAME|, ARE YOU PREPARED TO FACE YOUR DESTINY?" />
<parameter key="message_walkaway" value="COME BACK WHEN YOU ARE PREPARED TO FACE YOUR DESTINY!" />
<parameter key="message_farewell" value="COME BACK WHEN YOU ARE PREPARED TO FACE YOUR DESTINY!" />
</parameters>
</npc>
2 changes: 1 addition & 1 deletion data/npc/lib/npcsystem/modules.lua
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ if Modules == nil then
cost = 0
end

local exhausts
local exhausts = 159321

if parameters.premium and not player:isPremium() then
npcHandler:say("I'm sorry, but you need a premium account in order to travel onboard our ships.", cid)
Expand Down
6 changes: 3 additions & 3 deletions data/spells/spells.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@
<vocation name="Elder Druid"/>
</instant>
<!-- under construction -->
<instant group="support" spellid="176" name="Conjure Diamond Arrow" words="exevo gran con hur" lvl="150" mana="1000" soul="0" prem="1" aggressive="0" selftarget="1" exhaustion="600000" groupcooldown="2000" needlearn="0" script="conjuring/Conjure_Diamond_Arrow.lua">
<instant group="support" spellid="192" name="Conjure Diamond Arrow" words="exevo gran con hur" lvl="150" mana="1000" soul="0" prem="1" aggressive="0" selftarget="1" exhaustion="600000" groupcooldown="2000" needlearn="0" script="conjuring/Conjure_Diamond_Arrow.lua">
<vocation name="Paladin" />
<vocation name="Royal Paladin" />
</instant>
<instant group="support" spellid="192" name="Conjure Spectral Bolt" words="exevo gran con vis" lvl="150" mana="1000" soul="0" prem="1" aggressive="0" selftarget="1" exhaustion="600000" groupcooldown="2000" needlearn="0" script="conjuring/Conjure_Spectral_Bolt.lua">
<instant group="support" spellid="193" name="Conjure Spectral Bolt" words="exevo gran con vis" lvl="150" mana="1000" soul="0" prem="1" aggressive="0" selftarget="1" exhaustion="600000" groupcooldown="2000" needlearn="0" script="conjuring/Conjure_Spectral_Bolt.lua">
<vocation name="Paladin" />
<vocation name="Royal Paladin" />
</instant>
<instant group="support" spellid="191" name="Conjure Royal Star" words="exevo gran con grav" lvl="150" mana="1000" soul="0" prem="1" aggressive="0" selftarget="1" exhaustion="600000" groupcooldown="2000" needlearn="0" script="conjuring/Conjure_Royal_Star.lua">
<vocation name="Paladin" />
<vocation name="Royal Paladin" />
</instant>
<instant group="support" spellid="193" name="Conjure Wand of Darkness" words="exevo gran mort" lvl="41" mana="250" soul="0" prem="1" aggressive="0" selftarget="1" exhaustion="180000" groupcooldown="2000" needlearn="0" script="conjuring/Conjure_Wand_of_Darkness.lua">
<instant group="support" spellid="92" name="Conjure Wand of Darkness" words="exevo gran mort" lvl="41" mana="250" soul="0" prem="1" aggressive="0" selftarget="1" exhaustion="180000" groupcooldown="2000" needlearn="0" script="conjuring/Conjure_Wand_of_Darkness.lua">
<vocation name="Sorcerer" />
<vocation name="Master Sorcerer" />
</instant>
Expand Down
15 changes: 10 additions & 5 deletions src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2129,18 +2129,23 @@ void Player::death(Creature* lastHitCreature)
}
}

if (hasBlessing(8)) {
uint8_t maxBlessing = 8;
if (hasBlessing(6)) {
if (lastHitPlayer && hasBlessing(1)) {
removeBlessing(1, 1);
} else {
for (int i = 2; i <= 8; i++) {
for (int i = 2; i <= maxBlessing; i++) {
removeBlessing(i, 1);
}
}
setDropLoot(false);
} else {
uint8_t maxBlessing = (operatingSystem == CLIENTOS_NEW_WINDOWS) ? 8 : 6;
for (int i = 1; i <= maxBlessing; i++) {
removeBlessing(i, 1);
if (lastHitPlayer && hasBlessing(1)) {
removeBlessing(1, 1);
} else {
for (int i = 2; i <= maxBlessing; i++) {
removeBlessing(i, 1);
}
}
}

Expand Down

0 comments on commit 19e3270

Please sign in to comment.