Skip to content
This repository has been archived by the owner on May 20, 2023. It is now read-only.

Commit

Permalink
Create familiars lib, rename from "pet" to "familiar" and others fixes (
Browse files Browse the repository at this point in the history
#366)

Somes familiars fixes and adjusts

Rename from "pet/Pet" to "familiar/Familiar"
Removed "familiar = false" from monsters, this is false by default (this change is optional)
Renamed from "mtype:isPet" to "mtype:familiar"
Fixed familiar login with god.

Co-authored-by: @beats-dh
  • Loading branch information
dudantas authored Jan 5, 2022
1 parent 6f4fddb commit e34e401
Show file tree
Hide file tree
Showing 1,432 changed files with 1,599 additions and 3,103 deletions.
2 changes: 1 addition & 1 deletion data/events/scripts/creature.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function Creature:onChangeOutfit(outfit)
local familiarLookType = self:getFamiliarLooktype()
if familiarLookType ~= 0 then
for _, summon in pairs(self:getSummons()) do
if summon:getType():isPet() then
if summon:getType():familiar() then
if summon:getOutfit().lookType ~= familiarLookType then
summon:setOutfit({lookType = familiarLookType})
end
Expand Down
4 changes: 2 additions & 2 deletions data/events/scripts/player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ function Player:onLook(thing, position, distance)
if master and table.contains({'sorcerer familiar','knight familiar','druid familiar','paladin familiar'},
thing:getName():lower()) then
description = description..' (Master: ' .. master:getName() .. '). \z
It will disappear in ' .. getTimeinWords(master:getStorageValue(Storage.PetSummon) - os.time())
It will disappear in ' .. getTimeinWords(master:getStorageValue(Storage.FamiliarSummon) - os.time())
end
end
end
Expand Down Expand Up @@ -209,7 +209,7 @@ function Player:onLookInBattleList(creature, distance)
local summons = {'sorcerer familiar','knight familiar','druid familiar','paladin familiar'}
if master and table.contains(summons, creature:getName():lower()) then
description = description..' (Master: ' .. master:getName() .. '). \z
It will disappear in ' .. getTimeinWords(master:getStorageValue(Storage.PetSummon) - os.time())
It will disappear in ' .. getTimeinWords(master:getStorageValue(Storage.FamiliarSummon) - os.time())
end
end
if self:getGroup():getAccess() then
Expand Down
6 changes: 3 additions & 3 deletions data/lib/core/storages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Storage = {
combatProtectionStorage = 30023,
Factions = 30024,
blockMovementStorage = 30025,
PetSummon = 30026,
FamiliarSummon = 30026,
TrainerRoom = 30027,
NpcSpawn = 30028,
ExerciseDummyExhaust = 30029,
Expand Down Expand Up @@ -134,8 +134,8 @@ Storage = {
StoreExaust = 30051,
LemonCupcake = 30052,
BlueberryCupcake = 30053,
PetSummonEvent10 = 30054,
PetSummonEvent60 = 30055,
FamiliarSummonEvent10 = 30054,
FamiliarSummonEvent60 = 30055,
FreeQuests = 990000,
PremiumAccount = 998899,

Expand Down
29 changes: 29 additions & 0 deletions data/lib/tables/familiar.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FAMILIAR_ID = {
[VOCATION.BASE_ID.SORCERER] = {id = 994, name = "Sorcerer familiar"},
[VOCATION.BASE_ID.DRUID] = {id = 993, name = "Druid familiar"},
[VOCATION.BASE_ID.PALADIN] = {id = 992, name = "Paladin familiar"},
[VOCATION.BASE_ID.KNIGHT] = {id = 991, name = "Knight familiar"}
}

FAMILIAR_TIMER = {
[1] = {storage=Storage.FamiliarSummonEvent10, countdown=10, message = "10 seconds"},
[2] = {storage=Storage.FamiliarSummonEvent60, countdown=60, message = "one minute"}
}

function sendMessageFunction(pid, message)
if Player(pid) then
Player(pid):sendTextMessage(MESSAGE_LOOT, "Your summon will disappear in less than " .. message)
end
end

function removeFamiliar(creatureId, playerId)
local creature = Creature(creatureId)
local player = Player(playerId)
if not creature or not player then
return true
end
creature:remove()
for sendMessage = 1, #timer do
player:setStorageValue(timer[sendMessage].storage, -1)
end
end
1 change: 1 addition & 0 deletions data/lib/tables/table.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ dofile('data/lib/tables/vocation.lua')
dofile('data/lib/tables/achievements_lib.lua')
dofile('data/lib/tables/door.lua')
dofile('data/lib/tables/exercise_training.lua')
dofile('data/lib/tables/familiar.lua')
dofile('data/lib/tables/hireling_items.lua')
dofile('data/lib/tables/teleport_item_destinations.lua')
dofile('data/lib/tables/town.lua')
Expand Down
3 changes: 1 addition & 2 deletions data/monster/amphibics/azure_frog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ monster.flags = {
isBlockable = false,
canWalkOnEnergy = false,
canWalkOnFire = false,
canWalkOnPoison = false,
pet = false
canWalkOnPoison = false
}

monster.light = {
Expand Down
3 changes: 1 addition & 2 deletions data/monster/amphibics/bog_frog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ monster.flags = {
isBlockable = false,
canWalkOnEnergy = false,
canWalkOnFire = false,
canWalkOnPoison = false,
pet = false
canWalkOnPoison = false
}

monster.light = {
Expand Down
3 changes: 1 addition & 2 deletions data/monster/amphibics/coral_frog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ monster.flags = {
isBlockable = false,
canWalkOnEnergy = false,
canWalkOnFire = false,
canWalkOnPoison = false,
pet = false
canWalkOnPoison = false
}

monster.light = {
Expand Down
3 changes: 1 addition & 2 deletions data/monster/amphibics/crimson_frog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ monster.flags = {
isBlockable = false,
canWalkOnEnergy = false,
canWalkOnFire = false,
canWalkOnPoison = true,
pet = false
canWalkOnPoison = true
}

monster.light = {
Expand Down
3 changes: 1 addition & 2 deletions data/monster/amphibics/deathspawn.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ monster.flags = {
isBlockable = false,
canWalkOnEnergy = false,
canWalkOnFire = false,
canWalkOnPoison = true,
pet = false
canWalkOnPoison = true
}

monster.light = {
Expand Down
3 changes: 1 addition & 2 deletions data/monster/amphibics/filth_toad.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ monster.flags = {
isBlockable = false,
canWalkOnEnergy = false,
canWalkOnFire = false,
canWalkOnPoison = false,
pet = false
canWalkOnPoison = false
}

monster.light = {
Expand Down
3 changes: 1 addition & 2 deletions data/monster/amphibics/green_frog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ monster.flags = {
isBlockable = false,
canWalkOnEnergy = false,
canWalkOnFire = false,
canWalkOnPoison = false,
pet = false
canWalkOnPoison = false
}

monster.light = {
Expand Down
3 changes: 1 addition & 2 deletions data/monster/amphibics/infernal_frog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ monster.flags = {
isBlockable = false,
canWalkOnEnergy = false,
canWalkOnFire = false,
canWalkOnPoison = true,
pet = false
canWalkOnPoison = true
}

monster.light = {
Expand Down
3 changes: 1 addition & 2 deletions data/monster/amphibics/orchid_frog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ monster.flags = {
isBlockable = false,
canWalkOnEnergy = false,
canWalkOnFire = false,
canWalkOnPoison = false,
pet = false
canWalkOnPoison = false
}

monster.light = {
Expand Down
3 changes: 1 addition & 2 deletions data/monster/amphibics/salamander.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ monster.flags = {
isBlockable = false,
canWalkOnEnergy = false,
canWalkOnFire = false,
canWalkOnPoison = false,
pet = false
canWalkOnPoison = false
}

monster.light = {
Expand Down
3 changes: 1 addition & 2 deletions data/monster/amphibics/toad.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ monster.flags = {
isBlockable = false,
canWalkOnEnergy = false,
canWalkOnFire = false,
canWalkOnPoison = false,
pet = false
canWalkOnPoison = false
}

monster.light = {
Expand Down
3 changes: 1 addition & 2 deletions data/monster/aquatics/abyssal_calamary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ monster.flags = {
isBlockable = false,
canWalkOnEnergy = false,
canWalkOnFire = true,
canWalkOnPoison = true,
pet = false
canWalkOnPoison = true
}

monster.light = {
Expand Down
3 changes: 1 addition & 2 deletions data/monster/aquatics/blood_crab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ monster.flags = {
isBlockable = false,
canWalkOnEnergy = false,
canWalkOnFire = false,
canWalkOnPoison = true,
pet = false
canWalkOnPoison = true
}

monster.light = {
Expand Down
3 changes: 1 addition & 2 deletions data/monster/aquatics/calamary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ monster.flags = {
isBlockable = false,
canWalkOnEnergy = false,
canWalkOnFire = true,
canWalkOnPoison = true,
pet = false
canWalkOnPoison = true
}

monster.light = {
Expand Down
3 changes: 1 addition & 2 deletions data/monster/aquatics/crab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ monster.flags = {
isBlockable = false,
canWalkOnEnergy = false,
canWalkOnFire = false,
canWalkOnPoison = true,
pet = false
canWalkOnPoison = true
}

monster.light = {
Expand Down
3 changes: 1 addition & 2 deletions data/monster/aquatics/crustacea_gigantica.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ monster.flags = {
isBlockable = false,
canWalkOnEnergy = false,
canWalkOnFire = false,
canWalkOnPoison = false,
pet = false
canWalkOnPoison = false
}

monster.light = {
Expand Down
3 changes: 1 addition & 2 deletions data/monster/aquatics/deathling_scout.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ monster.flags = {
isBlockable = false,
canWalkOnEnergy = false,
canWalkOnFire = true,
canWalkOnPoison = false,
pet = false
canWalkOnPoison = false
}

monster.light = {
Expand Down
3 changes: 1 addition & 2 deletions data/monster/aquatics/deathling_spellsinger.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ monster.flags = {
isBlockable = false,
canWalkOnEnergy = false,
canWalkOnFire = true,
canWalkOnPoison = false,
pet = false
canWalkOnPoison = false
}

monster.light = {
Expand Down
3 changes: 1 addition & 2 deletions data/monster/aquatics/deepling_brawler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ monster.flags = {
isBlockable = false,
canWalkOnEnergy = false,
canWalkOnFire = true,
canWalkOnPoison = false,
pet = false
canWalkOnPoison = false
}

monster.light = {
Expand Down
3 changes: 1 addition & 2 deletions data/monster/aquatics/deepling_elite.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ monster.flags = {
isBlockable = false,
canWalkOnEnergy = false,
canWalkOnFire = true,
canWalkOnPoison = false,
pet = false
canWalkOnPoison = false
}

monster.light = {
Expand Down
3 changes: 1 addition & 2 deletions data/monster/aquatics/deepling_guard.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ monster.flags = {
isBlockable = false,
canWalkOnEnergy = false,
canWalkOnFire = true,
canWalkOnPoison = false,
pet = false
canWalkOnPoison = false
}

monster.light = {
Expand Down
3 changes: 1 addition & 2 deletions data/monster/aquatics/deepling_master_librarian.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ monster.flags = {
isBlockable = false,
canWalkOnEnergy = false,
canWalkOnFire = true,
canWalkOnPoison = false,
pet = false
canWalkOnPoison = false
}

monster.light = {
Expand Down
3 changes: 1 addition & 2 deletions data/monster/aquatics/deepling_scout.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ monster.flags = {
isBlockable = false,
canWalkOnEnergy = false,
canWalkOnFire = true,
canWalkOnPoison = false,
pet = false
canWalkOnPoison = false
}

monster.light = {
Expand Down
3 changes: 1 addition & 2 deletions data/monster/aquatics/deepling_spellsinger.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ monster.flags = {
isBlockable = false,
canWalkOnEnergy = false,
canWalkOnFire = true,
canWalkOnPoison = false,
pet = false
canWalkOnPoison = false
}

monster.light = {
Expand Down
3 changes: 1 addition & 2 deletions data/monster/aquatics/deepling_tyrant.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ monster.flags = {
isBlockable = false,
canWalkOnEnergy = false,
canWalkOnFire = true,
canWalkOnPoison = false,
pet = false
canWalkOnPoison = false
}

monster.light = {
Expand Down
3 changes: 1 addition & 2 deletions data/monster/aquatics/deepling_warrior.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ monster.flags = {
isBlockable = false,
canWalkOnEnergy = false,
canWalkOnFire = true,
canWalkOnPoison = false,
pet = false
canWalkOnPoison = false
}

monster.light = {
Expand Down
3 changes: 1 addition & 2 deletions data/monster/aquatics/deepling_worker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ monster.flags = {
isBlockable = false,
canWalkOnEnergy = false,
canWalkOnFire = true,
canWalkOnPoison = false,
pet = false
canWalkOnPoison = false
}

monster.light = {
Expand Down
3 changes: 1 addition & 2 deletions data/monster/aquatics/deepsea_blood_crab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ monster.flags = {
isBlockable = false,
canWalkOnEnergy = false,
canWalkOnFire = true,
canWalkOnPoison = false,
pet = false
canWalkOnPoison = false
}

monster.light = {
Expand Down
3 changes: 1 addition & 2 deletions data/monster/aquatics/fish.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ monster.flags = {
isBlockable = false,
canWalkOnEnergy = false,
canWalkOnFire = true,
canWalkOnPoison = true,
pet = false
canWalkOnPoison = true
}

monster.light = {
Expand Down
3 changes: 1 addition & 2 deletions data/monster/aquatics/jellyfish.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ monster.flags = {
isBlockable = false,
canWalkOnEnergy = false,
canWalkOnFire = true,
canWalkOnPoison = true,
pet = false
canWalkOnPoison = true
}

monster.light = {
Expand Down
3 changes: 1 addition & 2 deletions data/monster/aquatics/manta_ray.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ monster.flags = {
isBlockable = false,
canWalkOnEnergy = true,
canWalkOnFire = false,
canWalkOnPoison = true,
pet = false
canWalkOnPoison = true
}

monster.light = {
Expand Down
Loading

0 comments on commit e34e401

Please sign in to comment.