need sql query , help

08/11/2010 22:09 pizdolcea#1
hello epvp ,
well i open this topic , coz i want a sql code .
to set all my players ( dekaron players )
tables :
wPosX , wPoxY , wRetPosX , wRetPosY , wMapIndex , wRetMapIndex

to this postion
wPosX : 415
wPoxY : 133
wRetPosX : 415
wRetPosY : 133
wMapIndex : 7
wRetMapIndex : 7

can some one make that for me ?
i want to write this sql query so all my dekaron players will changed and spawn on this location
08/11/2010 22:55 naruto820#2
Well if I remember correctly here is how I would do it. Now im no sql pro. But I did learn some queries as you need to know some basic queries to run a server. But I havent used sql in ages so Im not totally sure lol. Anyway before you try this I suggest you backup your database.

Code:
Update character.dbo.user_character
Set wPosX = '415' and WPosY = '133' and wRetPosX = '415' and wRetPosY ='133' and wMapIndex = '7' and WRetMapIndex = '7'
Where character_name = '%'
and character_name <> '[DEV]KNIGHT'
and character_name <> '[DEV]SEGNALLE'
and character_name <> '[DEV]WARRIOR' 
and character_name <> '[DEV]SUMMONER'
and character_name <> '[DEV]HUNTER'
and character_name <> '[DEV]MAGICIAN'
as you can see I used the character name to exclude dev characters as its best not to touch the values in dev characters. But if the query shows an error just take the last 7 lines off.

Again Im not too sure about this query because I might have forgotten some stuff as I havent worked with teh query analyzer in a while. So I suggest you do a full character backup before you try this. As I do not want to be responsible for your data loss.
08/12/2010 14:05 pieter#3
it doesnt matter if u change the coords on the dev chars, new chars get their possitions from the char_mappos table :)

just make sure u dont move players u've put in jail :P

this sets all characters in parca exept for characters with a [] tag and except characters in map 65 (on my server thats the jail map)

Code:
UPDATE character..user_character 
SET wMapIndex = 6, wPosX = 416, wPosY = 333, wRetMapIndex = 6, wRetPosX = 416, wRetPosY = 333
WHERE     (wMapIndex <> 65) AND character_name > ']'
08/12/2010 14:09 pizdolcea#4
Quote:
Originally Posted by pieter View Post
it doesnt matter if u change the coords on the dev chars, new chars get their possitions from the char_mappos table :)

just make sure u dont move players u've put in jail :P

this sets all characters in parca exept for characters with a [] tag and except characters in map 65 (on my server thats the jail map)

Code:
UPDATE character..user_character 
SET wMapIndex = 6, wPosX = 416, wPosY = 333, wRetMapIndex = 6, wRetPosX = 416, wRetPosY = 333
WHERE     (wMapIndex <> 65) AND character_name > ']'
thanks , that's what i meant .