[Release SQL] Change startmap coords and map

08/04/2012 15:26 MAXIMAXCRAK#1
Hello, excuse my english.
I have just done a "Trigger" And "Procedure" for changing the startmap coords and map.

If you want to put the same map for all kingdom you can use this trigger
Code:
DELIMITER $$
DROP TRIGGER IF EXISTS esper $$

CREATE TRIGGER esper
BEFORE INSERT ON player
FOR EACH ROW
BEGIN
set new.x= 172428;
set new.y= 1220252;
set new.map_index= 73;
end $$
DELIMITER ;
changing the coords and map index.

However if you want to put a different map depending of the kingdom you can use the trigger and procedure which are below.

Remember you mustn't put these querys if you have in your sql player data any value of map_index = 0, you must put this update query

Code:
UPDATE player set map_index=1 where map_index=0
after inserting the code above you have to type the following trigger and procedure.

Code:
DELIMITER $$
DROP TRIGGER IF EXISTS espera $$

CREATE TRIGGER espera
AFTER UPDATE ON player_index
FOR EACH ROW
BEGIN
call proceso();
end $$
DELIMITER ;
this only call the procedure "proceso" when a new pj is created.

The procedure is typed below
Code:
delimiter $$

Drop procedure if exists `proceso` $$
CREATE
PROCEDURE `proceso`()
begin

declare reino integer;
declare ids integer;


select account_id into ids from player where player.map_index=0;
select empire into reino from player_index  where id=ids;

if reino=1 THEN
UPDATE player set x=1111 where map_index=0;
UPDATE player set y=1111 where map_index=0;
UPDATE player set map_index=1 where map_index=0;
end if;

if reino=2 THEN
UPDATE player set x=2222 where map_index=0;
UPDATE player set y=2222 where map_index=0;
UPDATE player set map_index=2 where map_index=0;
END if;

if reino=3 THEN
UPDATE player set x=3333 where map_index=0;
UPDATE player set y=2222 where map_index=0;
UPDATE player set map_index=3 where map_index=0;
end if;

end $$
delimiter ;
you must set the x coords, y coords and map_index which are in sql data of player.

"reino1"= Shinsoo
"reino2"= Chunjo
"reino3"= Jinno

Now your new PJ is created in the new coord's.

My original post is in Universojuegos.es
08/04/2012 18:15 .Awesoome'#2
Wer will ne Wette abschließen ? Ich sage 0,7% der Com verstehen es :awesome:
08/04/2012 18:18 Zymos#3
Dachte das wird in der Game festgelegt.. Oder irre ich mich oO
08/04/2012 18:24 iYoshix3#4
Ja, die Standard Kords sind in der Game, die werden aber nur geused wenn
Mapindex != 0 :D

Mfg
08/04/2012 18:27 xXKimariXx#5
wusst ich noch gar nicht
08/04/2012 18:30 .Nagato#6
Quote:
Originally Posted by .Awesoome' View Post
Wer will ne Wette abschließen ? Ich sage 0,7% der Com verstehen es :awesome:
Hallo,

Hierfür muss man nichtmal SQL können.
Englisch sollte ausreichen, wobei das auch wieder so eine Sache sein kann. oó
Really nice!
08/04/2012 18:30 .HC'Zeklow#7
Lol ich kapier es nicht
08/04/2012 18:37 .iDamage#8
Quote:
Originally Posted by .Awesoome' View Post
Wer will ne Wette abschließen ? Ich sage 0,7% der Com verstehen es :awesome:
Ich wette du bist einer von den 99,3% die es nicht verstehen :awesome:

Nice, btw :)
08/04/2012 18:38 bl4ckd3v1l#9
Quote:
Originally Posted by ClaayZ View Post
Lol ich kapier es nicht
Dann hättest du in der Schule im Englisch Unterricht aufpassen sollen.
Also nur mit Englisch-Kentnissen sollte das jeder vestehen!
08/04/2012 18:41 Mashkin#10
Quote:
Originally Posted by .Awesoome' View Post
Wer will ne Wette abschließen ? Ich sage 0,7% der Com verstehen es :awesome:
Quote:
Originally Posted by .Nagato View Post
Hallo,

Hierfür muss man nichtmal SQL können.
Englisch sollte ausreichen, wobei das auch wieder so eine Sache sein kann. oó
Really nice!
DEU:
Dann gehöre ich wohl zu den ~0.4% der Community, die beides können. :o

MySQL-Trigger sind zwar eine tolle Sache, aber "native" Anpassung der Startkoordinaten in der Binary wäre mir doch lieber.
Von Triggern in großen, zugriffsstarken Tabellen halte ich nicht so viel, weil das der Performance schaden könnte.

ENG:
MySQL triggers are a nice feature but I would rather "natively" modify the starting coordinates in the game binary.
I don't like the idea of adding triggers to large, access rich tables because this could harm performance.
08/04/2012 18:53 .Awesoome'#11
Das mit dem nicht verstehen war auf die Englishkenntnise bezogen und nicht auf Sql.

Quote:
Originally Posted by DamageProductions View Post
Ich wette du bist einer von den 99,3% die es nicht verstehen :awesome:

Nice, btw :)
Du bist aber nen ganz lustiger ;)
08/05/2012 18:21 MAXIMAXCRAK#12
Really this it's a good system, only uploads map_index=0 where is insert any date, no update, for this reason the speed of DB musn't be delayed (excuse for my english)
08/05/2012 18:35 xCPx#13
Hmm mal ehrlich?
Das ding hier wär mir zu doof xD
20sec in der Game suchen und man hats xD
08/05/2012 20:08 Pаylasici#14
Quote:
Originally Posted by .Awesoome' View Post
Wer will ne Wette abschließen ? Ich sage 0,7% der Com verstehen es :awesome:
Was soll man bitte an einem "TRIGGER" nicht verstehen?

Edit: Achso, die Englischkentnisse. Ja, da hast du Recht, aber wenn man "TRIGGER" schon sieht,
dann sollte man wissen was er meint. :D

Quote:
Originally Posted by Zymos View Post
Dachte das wird in der Game festgelegt.. Oder irre ich mich oO
Wird es auch, such mal im Internet was ein "TRIGGER" ist bezogen auf MySQL.
08/05/2012 20:09 Ultimate™#15
ich schätze mal das es auch nicht so schwer sein sollte wie es hier die meisten sagen natürlich haben einige ihre schwierigkeiten , jedoch sollte es keinen daran hindern :)

danke für den release :)