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
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
after inserting the code above you have to type the following trigger and procedure.
this only call the procedure "proceso" when a new pj is created.
The procedure is typed below
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
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 ;
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
Code:
DELIMITER $$ DROP TRIGGER IF EXISTS espera $$ CREATE TRIGGER espera AFTER UPDATE ON player_index FOR EACH ROW BEGIN call proceso(); end $$ DELIMITER ;
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 ;
"reino1"= Shinsoo
"reino2"= Chunjo
"reino3"= Jinno
Now your new PJ is created in the new coord's.
My original post is in Universojuegos.es