function onLogin(cid)
if getPlayerStorageValue(cid, 30001) == -1 then
local backpack = doPlayerAddItem(cid, 1988, 1) -- adds a backpack
if getPlayerVocation(cid) == 1 then -- Sorc
doAddContainerItem(backpack, 2789, 100) -- backpack
doPlayerAddItem(cid, 2464, 1) -- adds a chain armor
-- here you can add more shit
elseif getPlayerVocation(cid) == 2 then -- Druid
doAddContainerItem(backpack, 2789, 100)
doPlayerAddItem(cid, 2464, 1)
-- here you can add more shit
elseif getPlayerVocation(cid) == 3 then -- Paladin
doAddContainerItem(backpack, 2789, 100)
doPlayerAddItem(cid, 2464, 1)
-- here you can add more shit
elseif getPlayerVocation(cid) == 4 then -- Knight
doAddContainerItem(backpack, 2789, 100)
doPlayerAddItem(cid, 2464, 1)
-- here you can add more shit
else
doAddContainerItem(backpack, 2789, 100)
doPlayerAddItem(cid, 2464, 1)
end
setPlayerStorageValue(cid, 30001, 1)
end
return TRUE
end
<event type="login" name="Firstitems" script="firstitems.lua" />
function onLogin(cid)
container = doPlayerAddItem(cid, 1988, 1) << ItemId(1988) is brown bp 1 = count
doAddContainerItem(container, 2268, 10) << ItemId(2268) is sd rune 10 = charges
return 1
end
container = doPlayerAddItem(cid, 1987, 1)
doAddContainerItem(container, 2006, 7, 1)
How can i do a GM or GOD?
CREATE TABLE `groups` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255) NOT NULL COMMENT 'group name',
`flags` BIGINT UNSIGNED NOT NULL DEFAULT 0,
`access` INT NOT NULL,
`maxdepotitems` INT NOT NULL,
`maxviplist` INT NOT NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB;
INSERT INTO `groups` (`id`, `name`, `flags`, `access`, `maxdepotitems`, `maxviplist`) VALUES
(1, 'player', 0, 0, 2000, 100),
(2, 'tutor', 549772591104, 0, 2000, 100),
(3, 'senior tutor', 549772591104, 0, 2000, 100),
(4, 'a gamemaster', 549739028479, 0, 2000, 100),
(5, 'a community manager', 549739012091, 3, 2000, 100),
(6, 'a god', 549739012091, 4, 2000, 100);
CREATE TABLE `accounts` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`password` VARCHAR(255) NOT NULL,
`email` VARCHAR(255) NOT NULL DEFAULT '',
`premend` INT UNSIGNED NOT NULL DEFAULT 0,
`blocked` TINYINT(1) NOT NULL DEFAULT FALSE,
`deleted` TINYINT(1) NOT NULL DEFAULT FALSE,
`warned` TINYINT(1) NOT NULL DEFAULT FALSE,
`warnings` INT NOT NULL DEFAULT 0,
PRIMARY KEY (`id`)
) ENGINE = InnoDB;
INSERT INTO `accounts` (`id`, `password`, `email`, `premend`, `blocked`, `deleted`, `warned`, `warnings`) VALUES
(111111, 'tibia', '[email protected]', 0, 0, 0, 0, 0);
CREATE TABLE `players` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255) NOT NULL,
`account_id` INT UNSIGNED NOT NULL,
`group_id` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'users group',
`sex` INT UNSIGNED NOT NULL DEFAULT 0,
`vocation` INT UNSIGNED NOT NULL DEFAULT 0,
`experience` BIGINT UNSIGNED NOT NULL DEFAULT 0,
`level` INT UNSIGNED NOT NULL DEFAULT 1,
`maglevel` INT UNSIGNED NOT NULL DEFAULT 0,
`health` INT UNSIGNED NOT NULL DEFAULT 100,
`healthmax` INT UNSIGNED NOT NULL DEFAULT 100,
`mana` INT UNSIGNED NOT NULL DEFAULT 100,
`manamax` INT UNSIGNED NOT NULL DEFAULT 100,
`manaspent` INT UNSIGNED NOT NULL DEFAULT 0,
`soul` INT UNSIGNED NOT NULL DEFAULT 100,
`direction` INT UNSIGNED NOT NULL DEFAULT 0,
`lookbody` INT UNSIGNED NOT NULL DEFAULT 69,
`lookfeet` INT UNSIGNED NOT NULL DEFAULT 95,
`lookhead` INT UNSIGNED NOT NULL DEFAULT 78,
`looklegs` INT UNSIGNED NOT NULL DEFAULT 58,
`looktype` INT UNSIGNED NOT NULL DEFAULT 128,
`posx` INT NOT NULL DEFAULT 0,
`posy` INT NOT NULL DEFAULT 0,
`posz` INT NOT NULL DEFAULT 0,
`cap` INT NOT NULL DEFAULT 0,
`lastlogin` INT UNSIGNED NOT NULL DEFAULT 0,
`lastlogout` INT UNSIGNED NOT NULL DEFAULT 0,
`lastip` INT UNSIGNED NOT NULL DEFAULT 0,
`save` TINYINT(1) NOT NULL DEFAULT TRUE,
`conditions` BLOB NOT NULL COMMENT 'drunk, poisoned etc (maybe also food and redskull)',
`redskulltime` INT UNSIGNED NOT NULL DEFAULT 0,
`redskull` TINYINT(1) NOT NULL DEFAULT FALSE,
`guildnick` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'additional nick in guild - mostly for web interfaces i think',
`loss_experience` INT NOT NULL DEFAULT 10,
`loss_mana` INT NOT NULL DEFAULT 10,
`loss_skills` INT NOT NULL DEFAULT 10,
`loss_items` INT NOT NULL DEFAULT 10,
`rank_id` INT UNSIGNED NOT NULL COMMENT 'by this field everything with guilds is done - player has a rank which belongs to certain guild',
`town_id` INT NOT NULL COMMENT 'old masterpos, temple spawn point position',
`balance` INT NOT NULL DEFAULT 0 COMMENT 'money balance of the player for houses paying',
`status` TINYINT(1) NOT NULL DEFAULT FALSE,
PRIMARY KEY (`id`),
UNIQUE (`name`),
FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`)
) ENGINE = InnoDB;
INSERT INTO `players` (`id`, `name`, `account_id`, `group_id`, `sex`, `vocation`, `experience`, `level`, `maglevel`, `health`, `healthmax`, `mana`, `manamax`, `manaspent`, `soul`, `direction`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `posx`, `posy`, `posz`, `cap`, `lastlogin`, `lastlogout`, `lastip`, `save`, `conditions`, `redskulltime`, `redskull`, `guildnick`, `loss_experience`, `loss_mana`, `loss_skills`, `loss_items`, `rank_id`, `town_id`, `balance`, `status`) VALUES
(1, 'GOD Nottinghster', 111111, 6, 1, 0, 0, 2, 0, 150, 150, 0, 0, 0, 100, 1, 110, 0, 0, 0, 75, 32316, 31945, 7, 400, 0, 0, 0, 1, '', 0, 0, '', 0, 0, 0, 0, 0, 10, 0, 0);
CREATE TABLE `guilds` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255) NOT NULL COMMENT 'guild name - nothing else needed here',
`ownerid` INT NOT NULL,
`creationdata` INT NOT NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB;
CREATE TABLE `guild_ranks` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`guild_id` INT UNSIGNED NOT NULL COMMENT 'guild',
`name` VARCHAR(255) NOT NULL COMMENT 'rank name',
`level` INT NOT NULL COMMENT 'rank level - leader, vice, member, maybe something else',
PRIMARY KEY (`id`),
FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE
) ENGINE = InnoDB;
CREATE TABLE `player_viplist` (
`player_id` INT UNSIGNED NOT NULL COMMENT 'id of player whose viplist entry it is',
`vip_id` INT UNSIGNED NOT NULL COMMENT 'id of target player of viplist entry',
FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE,
FOREIGN KEY (`vip_id`) REFERENCES `players` (`id`) ON DELETE CASCADE
) ENGINE = InnoDB;
CREATE TABLE `player_spells` (
`player_id` INT UNSIGNED NOT NULL,
`name` VARCHAR(255) NOT NULL,
FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE
) ENGINE = InnoDB;
CREATE TABLE `server_record` (
`record` INT UNSIGNED NOT NULL,
PRIMARY KEY(`record`)
) ENGINE = InnoDB;
INSERT INTO `server_record` VALUES (0);
CREATE TABLE `player_storage` (
`player_id` INT UNSIGNED NOT NULL,
`key` INT NOT NULL,
`value` INT NOT NULL,
FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE
) ENGINE = InnoDB;
CREATE TABLE `player_skills` (
`player_id` INT UNSIGNED NOT NULL,
`skillid` INT UNSIGNED NOT NULL,
`value` INT UNSIGNED NOT NULL DEFAULT 0,
`count` INT UNSIGNED NOT NULL DEFAULT 0,
FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE
) ENGINE = InnoDB;
INSERT INTO `player_skills` (`player_id`, `skillid`, `value`, `count`) VALUES
(1, 0, 10, 0),
(1, 1, 10, 0),
(1, 2, 10, 0),
(1, 3, 10, 0),
(1, 4, 10, 0),
(1, 5, 10, 0),
(1, 6, 10, 0);
CREATE TABLE `player_items` (
`player_id` INT UNSIGNED NOT NULL,
`sid` INT NOT NULL,
`pid` INT NOT NULL DEFAULT 0,
`itemtype` INT NOT NULL,
`count` INT NOT NULL DEFAULT 0,
`attributes` BLOB COMMENT 'replaces unique_id, action_id, text, special_desc',
FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE,
UNIQUE (`player_id`, `sid`)
) ENGINE = InnoDB;
CREATE TABLE `houses` (
`id` INT UNSIGNED NOT NULL,
`owner` INT NOT NULL,
`paid` INT UNSIGNED NOT NULL DEFAULT 0,
`warnings` INT NOT NULL DEFAULT 0,
`lastwarning` INT UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`)
) ENGINE = InnoDB;
CREATE TABLE `house_lists` (
`house_id` INT UNSIGNED NOT NULL,
`listid` INT NOT NULL,
`list` TEXT NOT NULL,
FOREIGN KEY (`house_id`) REFERENCES `houses` (`id`) ON DELETE CASCADE
) ENGINE = InnoDB;
CREATE TABLE `bans` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`type` INT NOT NULL COMMENT '1 - ip banishment, 2 - namelock, 3 - account banishment, 4 - notation, 5 - deletion',
`value` INT UNSIGNED NOT NULL COMMENT 'ip, player guid, account number',
`param` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'mask',
`active` TINYINT(1) NOT NULL DEFAULT TRUE,
`expires` INT UNSIGNED NOT NULL,
`added` INT UNSIGNED NOT NULL,
`admin_id` INT UNSIGNED NOT NULL DEFAULT 0,
`reason` VARCHAR(255) NOT NULL DEFAULT '',
`comment` VARCHAR(255) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY (`type`, `value`),
KEY (`expires`)
) ENGINE = InnoDB;
CREATE TABLE `tiles` (
`id` INT UNSIGNED NOT NULL,
`x` INT NOT NULL,
`y` INT NOT NULL,
`z` INT NOT NULL,
PRIMARY KEY(`id`)
) ENGINE = InnoDB;
CREATE TABLE `tile_items` (
`tile_id` INT UNSIGNED NOT NULL,
`sid` INT NOT NULL,
`pid` INT NOT NULL DEFAULT 0,
`itemtype` INT NOT NULL,
`count` INT NOT NULL DEFAULT 0,
`attributes` BLOB NOT NULL,
FOREIGN KEY (`tile_id`) REFERENCES `tiles` (`id`) ON DELETE CASCADE,
INDEX (`sid`)
) ENGINE = InnoDB;
CREATE TABLE `map_store` (
`house_id` INT UNSIGNED NOT NULL,
`data` BLOB NOT NULL,
KEY(`house_id`)
) ENGINE = InnoDB;
CREATE TABLE `player_depotitems` (
`player_id` INT UNSIGNED NOT NULL,
`depot_id` INT NOT NULL DEFAULT 0,
`sid` INT NOT NULL COMMENT 'any given range eg 0-100 will be reserved for depot lockers and all > 100 will be then normal items inside depots',
`pid` INT NOT NULL DEFAULT 0,
`itemtype` INT NOT NULL,
`count` INT NOT NULL DEFAULT 0,
`attributes` BLOB NOT NULL,
FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE,
INDEX (`player_id`, `depot_id`),
UNIQUE (`player_id`, `sid`)
) ENGINE = InnoDB;
CREATE TABLE `player_deaths` (
`player_id` INT UNSIGNED NOT NULL,
`time` BIGINT UNSIGNED NOT NULL DEFAULT 0,
`level` INT UNSIGNED NOT NULL DEFAULT 1,
`lasthit_killer` VARCHAR(255) NOT NULL,
`mostdamage_killer` VARCHAR(255) NOT NULL,
KEY (`player_id`),
FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE
) ENGINE = InnoDB;
CREATE TABLE `global_storage` (
`key` INT UNSIGNED NOT NULL,
`value` INT NOT NULL,
PRIMARY KEY(`key`)
) ENGINE = InnoDB;
CREATE TABLE `schema_info` (
`version` INT UNSIGNED NOT NULL
) ENGINE = InnoDB;
INSERT INTO `schema_info` (`version`) VALUES (2);
DELIMITER |
CREATE TRIGGER `ondelete_accounts`
BEFORE DELETE
ON `accounts`
FOR EACH ROW
BEGIN
DELETE FROM `bans` WHERE `type` = 3 AND `value` = OLD.`id`;
END|
CREATE TRIGGER `ondelete_guilds`
BEFORE DELETE
ON `guilds`
FOR EACH ROW
BEGIN
UPDATE `players` SET `guildnick` = '', `rank_id` = 0 WHERE `rank_id` IN (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = OLD.`id`);
DELETE FROM `guild_ranks` WHERE `guild_id` = OLD.`id`;
END|
CREATE TRIGGER `ondelete_players`
BEFORE DELETE
ON `players`
FOR EACH ROW
BEGIN
DELETE FROM `bans` WHERE `type` = 2 AND `value` = OLD.`id`;
UPDATE `houses` SET `owner` = 0 WHERE `owner` = OLD.`id`;
END|
CREATE TRIGGER `oncreate_guilds`
AFTER INSERT
ON `guilds`
FOR EACH ROW
BEGIN
INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('Leader', 3, NEW.`id`);
INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('Vice-Leader', 2, NEW.`id`);
INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('Member', 1, NEW.`id`);
END|
CREATE TRIGGER `oncreate_players`
AFTER INSERT
ON `players`
FOR EACH ROW
BEGIN
INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 0, 10);
INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 1, 10);
INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 2, 10);
INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 3, 10);
INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 4, 10);
INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 5, 10);
INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 6, 10);
END|
DELIMITER ;
INSERT INTO `players` (`id`, `name`, `account_id`, `group_id`, `sex`, `vocation`, `experience`, `level`, `maglevel`, `health`, `healthmax`, `mana`, `manamax`, `manaspent`, `soul`, `direction`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `posx`, `posy`, `posz`, `cap`, `lastlogin`, `lastlogout`, `lastip`, `save`, `conditions`, `redskulltime`, `redskull`, `guildnick`, `loss_experience`, `loss_mana`, `loss_skills`, `loss_items`, `rank_id`, `town_id`, `balance`, `status`) VALUES
(1, 'GOD Nottinghster', 111111, 6, 1, 0, 0, 2, 0, 150, 150, 0, 0, 0, 100, 1, 110, 0, 0, 0, 75, 32316, 31945, 7, 400, 0, 0, 0, 1, '', 0, 0, '', 0, 0, 0, 0, 0, 10, 0, 0);
1 - Player
2 - Tutor
3 - Senior Tutor
4 - Game Master
5 - Community Manager
6 - GOD
Thanks guys!
It's possible to put a mana fluid with id "2006 7" in this backpack?
Cuz it don't accept space on the id
container = doPlayerAddItem(cid, 1987, 1)
doAddContainerItem(container, 2006, 7)
Here's my example of database with GOD character
PHP:CREATE TABLE `groups` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL COMMENT 'group name', `flags` BIGINT UNSIGNED NOT NULL DEFAULT 0, `access` INT NOT NULL, `maxdepotitems` INT NOT NULL, `maxviplist` INT NOT NULL, PRIMARY KEY (`id`) ) ENGINE = InnoDB; INSERT INTO `groups` (`id`, `name`, `flags`, `access`, `maxdepotitems`, `maxviplist`) VALUES (1, 'player', 0, 0, 2000, 100), (2, 'tutor', 549772591104, 0, 2000, 100), (3, 'senior tutor', 549772591104, 0, 2000, 100), (4, 'a gamemaster', 549739028479, 0, 2000, 100), (5, 'a community manager', 549739012091, 3, 2000, 100), (6, 'a god', 549739012091, 4, 2000, 100); CREATE TABLE `accounts` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `password` VARCHAR(255) NOT NULL, `email` VARCHAR(255) NOT NULL DEFAULT '', `premend` INT UNSIGNED NOT NULL DEFAULT 0, `blocked` TINYINT(1) NOT NULL DEFAULT FALSE, `deleted` TINYINT(1) NOT NULL DEFAULT FALSE, `warned` TINYINT(1) NOT NULL DEFAULT FALSE, `warnings` INT NOT NULL DEFAULT 0, PRIMARY KEY (`id`) ) ENGINE = InnoDB; INSERT INTO `accounts` (`id`, `password`, `email`, `premend`, `blocked`, `deleted`, `warned`, `warnings`) VALUES (111111, 'tibia', '[email protected]', 0, 0, 0, 0, 0); CREATE TABLE `players` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL, `account_id` INT UNSIGNED NOT NULL, `group_id` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'users group', `sex` INT UNSIGNED NOT NULL DEFAULT 0, `vocation` INT UNSIGNED NOT NULL DEFAULT 0, `experience` BIGINT UNSIGNED NOT NULL DEFAULT 0, `level` INT UNSIGNED NOT NULL DEFAULT 1, `maglevel` INT UNSIGNED NOT NULL DEFAULT 0, `health` INT UNSIGNED NOT NULL DEFAULT 100, `healthmax` INT UNSIGNED NOT NULL DEFAULT 100, `mana` INT UNSIGNED NOT NULL DEFAULT 100, `manamax` INT UNSIGNED NOT NULL DEFAULT 100, `manaspent` INT UNSIGNED NOT NULL DEFAULT 0, `soul` INT UNSIGNED NOT NULL DEFAULT 100, `direction` INT UNSIGNED NOT NULL DEFAULT 0, `lookbody` INT UNSIGNED NOT NULL DEFAULT 69, `lookfeet` INT UNSIGNED NOT NULL DEFAULT 95, `lookhead` INT UNSIGNED NOT NULL DEFAULT 78, `looklegs` INT UNSIGNED NOT NULL DEFAULT 58, `looktype` INT UNSIGNED NOT NULL DEFAULT 128, `posx` INT NOT NULL DEFAULT 0, `posy` INT NOT NULL DEFAULT 0, `posz` INT NOT NULL DEFAULT 0, `cap` INT NOT NULL DEFAULT 0, `lastlogin` INT UNSIGNED NOT NULL DEFAULT 0, `lastlogout` INT UNSIGNED NOT NULL DEFAULT 0, `lastip` INT UNSIGNED NOT NULL DEFAULT 0, `save` TINYINT(1) NOT NULL DEFAULT TRUE, `conditions` BLOB NOT NULL COMMENT 'drunk, poisoned etc (maybe also food and redskull)', `redskulltime` INT UNSIGNED NOT NULL DEFAULT 0, `redskull` TINYINT(1) NOT NULL DEFAULT FALSE, `guildnick` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'additional nick in guild - mostly for web interfaces i think', `loss_experience` INT NOT NULL DEFAULT 10, `loss_mana` INT NOT NULL DEFAULT 10, `loss_skills` INT NOT NULL DEFAULT 10, `loss_items` INT NOT NULL DEFAULT 10, `rank_id` INT UNSIGNED NOT NULL COMMENT 'by this field everything with guilds is done - player has a rank which belongs to certain guild', `town_id` INT NOT NULL COMMENT 'old masterpos, temple spawn point position', `balance` INT NOT NULL DEFAULT 0 COMMENT 'money balance of the player for houses paying', `status` TINYINT(1) NOT NULL DEFAULT FALSE, PRIMARY KEY (`id`), UNIQUE (`name`), FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE, FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`) ) ENGINE = InnoDB; INSERT INTO `players` (`id`, `name`, `account_id`, `group_id`, `sex`, `vocation`, `experience`, `level`, `maglevel`, `health`, `healthmax`, `mana`, `manamax`, `manaspent`, `soul`, `direction`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `posx`, `posy`, `posz`, `cap`, `lastlogin`, `lastlogout`, `lastip`, `save`, `conditions`, `redskulltime`, `redskull`, `guildnick`, `loss_experience`, `loss_mana`, `loss_skills`, `loss_items`, `rank_id`, `town_id`, `balance`, `status`) VALUES (1, 'GOD Nottinghster', 111111, 6, 1, 0, 0, 2, 0, 150, 150, 0, 0, 0, 100, 1, 110, 0, 0, 0, 75, 32316, 31945, 7, 400, 0, 0, 0, 1, '', 0, 0, '', 0, 0, 0, 0, 0, 10, 0, 0); CREATE TABLE `guilds` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL COMMENT 'guild name - nothing else needed here', `ownerid` INT NOT NULL, `creationdata` INT NOT NULL, PRIMARY KEY (`id`) ) ENGINE = InnoDB; CREATE TABLE `guild_ranks` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `guild_id` INT UNSIGNED NOT NULL COMMENT 'guild', `name` VARCHAR(255) NOT NULL COMMENT 'rank name', `level` INT NOT NULL COMMENT 'rank level - leader, vice, member, maybe something else', PRIMARY KEY (`id`), FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE ) ENGINE = InnoDB; CREATE TABLE `player_viplist` ( `player_id` INT UNSIGNED NOT NULL COMMENT 'id of player whose viplist entry it is', `vip_id` INT UNSIGNED NOT NULL COMMENT 'id of target player of viplist entry', FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE, FOREIGN KEY (`vip_id`) REFERENCES `players` (`id`) ON DELETE CASCADE ) ENGINE = InnoDB; CREATE TABLE `player_spells` ( `player_id` INT UNSIGNED NOT NULL, `name` VARCHAR(255) NOT NULL, FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE ) ENGINE = InnoDB; CREATE TABLE `server_record` ( `record` INT UNSIGNED NOT NULL, PRIMARY KEY(`record`) ) ENGINE = InnoDB; INSERT INTO `server_record` VALUES (0); CREATE TABLE `player_storage` ( `player_id` INT UNSIGNED NOT NULL, `key` INT NOT NULL, `value` INT NOT NULL, FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE ) ENGINE = InnoDB; CREATE TABLE `player_skills` ( `player_id` INT UNSIGNED NOT NULL, `skillid` INT UNSIGNED NOT NULL, `value` INT UNSIGNED NOT NULL DEFAULT 0, `count` INT UNSIGNED NOT NULL DEFAULT 0, FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE ) ENGINE = InnoDB; INSERT INTO `player_skills` (`player_id`, `skillid`, `value`, `count`) VALUES (1, 0, 10, 0), (1, 1, 10, 0), (1, 2, 10, 0), (1, 3, 10, 0), (1, 4, 10, 0), (1, 5, 10, 0), (1, 6, 10, 0); CREATE TABLE `player_items` ( `player_id` INT UNSIGNED NOT NULL, `sid` INT NOT NULL, `pid` INT NOT NULL DEFAULT 0, `itemtype` INT NOT NULL, `count` INT NOT NULL DEFAULT 0, `attributes` BLOB COMMENT 'replaces unique_id, action_id, text, special_desc', FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE, UNIQUE (`player_id`, `sid`) ) ENGINE = InnoDB; CREATE TABLE `houses` ( `id` INT UNSIGNED NOT NULL, `owner` INT NOT NULL, `paid` INT UNSIGNED NOT NULL DEFAULT 0, `warnings` INT NOT NULL DEFAULT 0, `lastwarning` INT UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY (`id`) ) ENGINE = InnoDB; CREATE TABLE `house_lists` ( `house_id` INT UNSIGNED NOT NULL, `listid` INT NOT NULL, `list` TEXT NOT NULL, FOREIGN KEY (`house_id`) REFERENCES `houses` (`id`) ON DELETE CASCADE ) ENGINE = InnoDB; CREATE TABLE `bans` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `type` INT NOT NULL COMMENT '1 - ip banishment, 2 - namelock, 3 - account banishment, 4 - notation, 5 - deletion', `value` INT UNSIGNED NOT NULL COMMENT 'ip, player guid, account number', `param` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'mask', `active` TINYINT(1) NOT NULL DEFAULT TRUE, `expires` INT UNSIGNED NOT NULL, `added` INT UNSIGNED NOT NULL, `admin_id` INT UNSIGNED NOT NULL DEFAULT 0, `reason` VARCHAR(255) NOT NULL DEFAULT '', `comment` VARCHAR(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`), KEY (`type`, `value`), KEY (`expires`) ) ENGINE = InnoDB; CREATE TABLE `tiles` ( `id` INT UNSIGNED NOT NULL, `x` INT NOT NULL, `y` INT NOT NULL, `z` INT NOT NULL, PRIMARY KEY(`id`) ) ENGINE = InnoDB; CREATE TABLE `tile_items` ( `tile_id` INT UNSIGNED NOT NULL, `sid` INT NOT NULL, `pid` INT NOT NULL DEFAULT 0, `itemtype` INT NOT NULL, `count` INT NOT NULL DEFAULT 0, `attributes` BLOB NOT NULL, FOREIGN KEY (`tile_id`) REFERENCES `tiles` (`id`) ON DELETE CASCADE, INDEX (`sid`) ) ENGINE = InnoDB; CREATE TABLE `map_store` ( `house_id` INT UNSIGNED NOT NULL, `data` BLOB NOT NULL, KEY(`house_id`) ) ENGINE = InnoDB; CREATE TABLE `player_depotitems` ( `player_id` INT UNSIGNED NOT NULL, `depot_id` INT NOT NULL DEFAULT 0, `sid` INT NOT NULL COMMENT 'any given range eg 0-100 will be reserved for depot lockers and all > 100 will be then normal items inside depots', `pid` INT NOT NULL DEFAULT 0, `itemtype` INT NOT NULL, `count` INT NOT NULL DEFAULT 0, `attributes` BLOB NOT NULL, FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE, INDEX (`player_id`, `depot_id`), UNIQUE (`player_id`, `sid`) ) ENGINE = InnoDB; CREATE TABLE `player_deaths` ( `player_id` INT UNSIGNED NOT NULL, `time` BIGINT UNSIGNED NOT NULL DEFAULT 0, `level` INT UNSIGNED NOT NULL DEFAULT 1, `lasthit_killer` VARCHAR(255) NOT NULL, `mostdamage_killer` VARCHAR(255) NOT NULL, KEY (`player_id`), FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE ) ENGINE = InnoDB; CREATE TABLE `global_storage` ( `key` INT UNSIGNED NOT NULL, `value` INT NOT NULL, PRIMARY KEY(`key`) ) ENGINE = InnoDB; CREATE TABLE `schema_info` ( `version` INT UNSIGNED NOT NULL ) ENGINE = InnoDB; INSERT INTO `schema_info` (`version`) VALUES (2); DELIMITER | CREATE TRIGGER `ondelete_accounts` BEFORE DELETE ON `accounts` FOR EACH ROW BEGIN DELETE FROM `bans` WHERE `type` = 3 AND `value` = OLD.`id`; END| CREATE TRIGGER `ondelete_guilds` BEFORE DELETE ON `guilds` FOR EACH ROW BEGIN UPDATE `players` SET `guildnick` = '', `rank_id` = 0 WHERE `rank_id` IN (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = OLD.`id`); DELETE FROM `guild_ranks` WHERE `guild_id` = OLD.`id`; END| CREATE TRIGGER `ondelete_players` BEFORE DELETE ON `players` FOR EACH ROW BEGIN DELETE FROM `bans` WHERE `type` = 2 AND `value` = OLD.`id`; UPDATE `houses` SET `owner` = 0 WHERE `owner` = OLD.`id`; END| CREATE TRIGGER `oncreate_guilds` AFTER INSERT ON `guilds` FOR EACH ROW BEGIN INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('Leader', 3, NEW.`id`); INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('Vice-Leader', 2, NEW.`id`); INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('Member', 1, NEW.`id`); END| CREATE TRIGGER `oncreate_players` AFTER INSERT ON `players` FOR EACH ROW BEGIN INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 0, 10); INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 1, 10); INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 2, 10); INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 3, 10); INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 4, 10); INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 5, 10); INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 6, 10); END| DELIMITER ;
Here you change your group id (gods, gms, tutors and etc)
Group List
- - - Updated - - -
Here's the fix ;]
Lua:container = doPlayerAddItem(cid, 1987, 1) doAddContainerItem(container, 2006, 7)
Anyone have a full 7.4 RL map? not just a stupid fibula map?
Thanks Nottinghster, about the mana potion, i'm using manarune now, got a script of this, so much better cuz u don't get flask around the map.
- - - Updated - - -
Monesi, I dunno if this map works in 7,4 but i use this one for 7.6
Link: world.otbm
- - - Updated - - -
Another question, and last one i think hahaha
It's possible to make two teams, and one team mate don't attack other?
Example: Player 1 don't attack Player 2 of the same team, but can attack Player 1 of another team.
I saw in some config.lua the possibility of "NoDamagetothesamelookfeet" but in Avesta we don't have this option, what we do in this case?
You can edit the sources for the "can target creature" function.
Also, thanks for this map, this is the map Mastercores, EliteOTs and Faloria are using <3
Ezzz~ how can i do it? I'm noobzor in sources hahaha
Check game.cpp for can Attack creature function.
how do i get the file sample.sql?!??!
Very weird indeed.thing.h:121:21: error: aggregate ‘std::stringstream ret’ has incomplete type and cannot be defined
thing.h:125:2: warning: control reaches end of non-void function [-Wreturn-type]
make[1]: *** [container.o] Error 1
make[1]: Leaving directory `/home/tony/avesta'
make: *** [all] Error 2
Thanks in advance if someone know what's causing it.tony@ubuntu:~/avesta$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for stdint.h... (cached) yes
checking for stdlib.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/timeb.h usability... yes
checking sys/timeb.h presence... yes
checking for sys/timeb.h... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... no
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for int16_t... yes
checking for int32_t... yes
checking for int64_t... yes
checking for size_t... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for uint8_t... yes
checking for ptrdiff_t... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for working memcmp... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking for floor... yes
checking for ftime... yes
checking for gethostbyname... yes
checking for gethostname... yes
checking for memset... yes
checking for pow... yes
checking for sqrt... yes
checking for strcasecmp... yes
checking for strncasecmp... yes
checking for strstr... yes
checking for strtol... yes
checking for xml2-config... /usr/bin/xml2-config
checking for libxml - version >= 2.6.5... yes (version 2.7.8)
checking gmp.h usability... yes
checking gmp.h presence... yes
checking for gmp.h... yes
checking for __gmpz_init2 in -lgmp... yes
checking for main in -lboost_thread-gcc-mt... no
checking for main in -lboost_thread-mt... yes
checking for main in -lboost_regex-gcc-mt... no
checking for main in -lboost_regex-mt... yes
checking for main in -lboost_system-gcc-mt... no
checking for main in -lboost_system-mt... yes
checking for main in -lboost_date_time-gcc-mt... no
checking for main in -lboost_date_time-mt... yes
checking boost/asio.hpp usability... yes
checking boost/asio.hpp presence... yes
checking for boost/asio.hpp... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for LUA... yes
checking sqlite3.h usability... yes
checking sqlite3.h presence... yes
checking for sqlite3.h... yes
checking for main in -lsqlite3... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands