i have not tested it, but you could simply delete function(procedure):
p_createOutpostLandAndClaim
- Code: Select all
BEGIN
declare myLandID INT UNSIGNED default NULL;
declare myClaimID INT UNSIGNED default NULL;
insert into guild_lands
(`GuildID`, `CenterGeoID`, `Radius`, `LandType`)
values
(inGuildID, inCenterGeoID, inRadius, 4/*outpost*/);
set myLandID = LAST_INSERT_ID();
-- insert claim for each land
insert into claims
(GuildLandID)
values (myLandID);
set myClaimID = LAST_INSERT_ID();
-- insert default rules
insert into claim_rules (ClaimID, ClaimSubjectID, CanEnter, CanBuild , CanClaim, CanUse, CanDestroy)
values
(myClaimID, f_getSubjectIDByRole(1/*Leader*/), 1,1,1,1,1),
(myClaimID, f_getSubjectIDByRole(2/*Minor leader*/), 1,1,0,1,0),
(myClaimID, f_getSubjectIDByRole(3/*1st tier member*/), 1,1,0,0,0),
(myClaimID, f_getSubjectIDByRole(4/*2nd tier member*/), 1,1,0,0,0),
(myClaimID, f_getSubjectIDByRole(5/*3rd tier member*/), 1,1,0,0,0),
(myClaimID, f_getSubjectIDByRole(6/*Normal member*/), 1,1,0,0,0),
(myClaimID, f_getSubjectIDByRole(7/*Recruit*/), 1,0,0,0,0),
(myClaimID, f_getSubjectIDByStanding(5/*Ally*/), 1,0,0,0,0);
-- result
select LandType, myClaimID as ClaimID, myLandID as GuildLandID
from guild_lands where ID = myLandID;
END
when building an outpost, it should not found another claim land as result.
if it does not work and messes something up, just run this script in query:- Code: Select all
CREATE DEFINER=`root`@`localhost` PROCEDURE `p_createOutpostLandAndClaim`(
IN `inGuildID` INT UNSIGNED,
IN `inCenterGeoID` INT UNSIGNED,
IN `inRadius` INT UNSIGNED
,
IN `inGuildID` INT UNSIGNED,
IN `inCenterGeoID` INT UNSIGNED,
IN `inRadius` INT UNSIGNED
)
LANGUAGE SQL
NOT DETERMINISTIC
CONTAINS SQL
SQL SECURITY DEFINER
COMMENT ''
BEGIN
declare myLandID INT UNSIGNED default NULL;
declare myClaimID INT UNSIGNED default NULL;
insert into guild_lands
(`GuildID`, `CenterGeoID`, `Radius`, `LandType`)
values
(inGuildID, inCenterGeoID, inRadius, 4/*outpost*/);
set myLandID = LAST_INSERT_ID();
-- insert claim for each land
insert into claims
(GuildLandID)
values (myLandID);
set myClaimID = LAST_INSERT_ID();
-- insert default rules
insert into claim_rules (ClaimID, ClaimSubjectID, CanEnter, CanBuild , CanClaim, CanUse, CanDestroy)
values
(myClaimID, f_getSubjectIDByRole(1/*Leader*/), 1,1,1,1,1),
(myClaimID, f_getSubjectIDByRole(2/*Minor leader*/), 1,1,0,1,0),
(myClaimID, f_getSubjectIDByRole(3/*1st tier member*/), 1,1,0,0,0),
(myClaimID, f_getSubjectIDByRole(4/*2nd tier member*/), 1,1,0,0,0),
(myClaimID, f_getSubjectIDByRole(5/*3rd tier member*/), 1,1,0,0,0),
(myClaimID, f_getSubjectIDByRole(6/*Normal member*/), 1,1,0,0,0),
(myClaimID, f_getSubjectIDByRole(7/*Recruit*/), 1,0,0,0,0),
(myClaimID, f_getSubjectIDByStanding(5/*Ally*/), 1,0,0,0,0);
-- result
select LandType, myClaimID as ClaimID, myLandID as GuildLandID
from guild_lands where ID = myLandID;
END