[Release]Automaticly safe base spawn

10/08/2013 23:37 SvHe#1
Hi Epvp,

Automaticly spawns players to safe base location when they exit the game.

Put inside PS_GameLog>Programmabilty>Stored Procedures>dbo.usp_insert_Action_Log_E

Code:
/*Automaticly PvP Base Spawn*/
IF(@ActionType=108)
BEGIN
/*LIGHT MAPS*/
/* 1-15 PvP Zone */
Update PS_GameData.dbo.Chars
SET PosX = 410,PosY = 20, PosZ = 141
Where Map = 18 and Level <=15 and Family <=1 and Job <=5 and CharID = @CharID
/* 20-30 PvP Zone */
Update PS_GameData.dbo.Chars
SET PosX = 308,PosY = 3, PosZ = 320
Where Map = 30 and Level >= 20 and Level<=30 and Family <=1 and Job <=5 and CharID = @CharID
/*  D-Water   */
Update PS_GameData.dbo.Chars
SET PosX = 225,PosY = 27, PosZ = 1838
Where Map = 0 and Family <=1 and Job <=5 and CharID = @CharID
/* DD1 */
Update PS_GameData.dbo.Chars
SET PosX = 924,PosY = 10, PosZ = 865
Where Map = 45 and Family <=1 and Job <=5  and CharID = @CharID
/* DD2 */
Update PS_GameData.dbo.Chars
SET PosX = 903,PosY = 35, PosZ = 475
Where Map = 46 and Family <=1 and Job <=5 and CharID = @CharID
/* Jungle */
Update PS_GameData.dbo.Chars
SET PosX = 126,PosY = 9, PosZ = 454
Where Map = 47 and Family <=1 and Job <=5 and CharID = @CharID
/* Kanos Illium */
Update PS_GameData.dbo.Chars
SET PosX = 1481,PosY = 33, PosZ = 163
Where Map = 70 and Family <=1 and Job <=5 and CharID = @CharID
/* Canyon of Greed */
Update PS_GameData.dbo.Chars
SET PosX = 345,PosY = 17, PosZ = 48
Where Map = 81 and Family <=1 and Job <=5 and CharID = @CharID

/* DARK MAPS */

/* 1-15 PvP Zone */
Update PS_GameData.dbo.Chars
SET PosX = 860,PosY = 3, PosZ = 642
Where Map = 18 and Level <=15 and Family >=2 and Job <=5 and CharID = @CharID
/* 20-30 PvP Zone */
Update PS_GameData.dbo.Chars
SET PosX = 820,PosY = 32, PosZ = 760
Where Map = 30 and Level >= 20 and Level <=30 and Family >=2 and Job <=5 and CharID = @CharID
/* D-Water */
Update PS_GameData.dbo.Chars
SET PosX = 1878,PosY = 15, PosZ = 380
Where Map = 0 and Family >=2 and Job <=5 and CharID = @CharID
/* DD1 */
Update PS_GameData.dbo.Chars
SET PosX = 860,PosY = 4, PosZ = 307
Where Map = 45 and Family >=2 and Job <=5 and CharID = @CharID
/* DD2 */
Update PS_GameData.dbo.Chars
SET PosX = 930,PosY = 65, PosZ = 81
Where Map = 46 and Family >=2 and Job <=5 and CharID = @CharID
/* Jungle */
Update PS_GameData.dbo.Chars
SET PosX = 572,PosY = 6, PosZ = 194
Where Map = 47 and Family >=2 and Job <=5 and CharID = @CharID
/* Kanos Illium */
Update PS_GameData.dbo.Chars
SET PosX = 155,PosY = 39, PosZ = 175
Where Map = 70 and Family >=2 and Job <=5 and CharID = @CharID
/* Canyon of Greed */
Update PS_GameData.dbo.Chars
SET PosX = 406,PosY = 17, PosZ = 42
Where Map = 81 and Family >=2 and Job <=5 and CharID = @CharID
END
Remember : This will only works when exit the game

This Script is usefull for Ultimate Mode , This will prevent players to be killed by other faction when they login without a ResRune.

Im new at SQL , so dont judge me , i am still learning and i tought it was a usefull script for some servers.
10/09/2013 07:06 Philipp_#2
Code:
Update PS_GameData.dbo.Chars
SET PosX = 860,PosY = 3, PosZ = 642
Where Map = 18 and Level <=15 and Family >=2 and Job <=5
This will update the positions of all characters meeting the conditions in your where clause. Since you want to update the row of the character that logged off only, you should check for the equality of the CharID, too.
Add the following comparsion to your where clauses:
Code:
CharID = @CharID
10/09/2013 10:03 SvHe#3
Quote:
Originally Posted by Philipp_ View Post
Code:
Update PS_GameData.dbo.Chars
SET PosX = 860,PosY = 3, PosZ = 642
Where Map = 18 and Level <=15 and Family >=2 and Job <=5
This will update the positions of all characters meeting the conditions in your where clause. Since you want to update the row of the character that logged off only, you should check for the equality of the CharID, too.
Add the following comparsion to your where clauses:
Code:
CharID = @CharID
Hi Philipp,

Thank you for your feedback , i will add it to Where clauses.
10/09/2013 10:30 Hep#4
#Added to Collective-Thread
10/12/2013 14:17 Stureplan#5
#Added to Index.