Jump to content
  • 0

[Request] Xriazome Ena sql command


`Rοmeο

Question

Paideia xriazome ena sql command pou na mpwrei na kanei olla ta monsters sto game na kanoun drop kapoia sigkekrimena farm items pou 8elw egw :) mpwrei kapoios na boi8isi? einai epigon...

Link to comment
Share on other sites

Recommended Posts

  • 0

δοκίμασε αυτό

 

UPDATE droplist SET mobId = 22215, itemId = 6619, min = 1, max = 1, category = 1, chance = 7000

 

δν ξέρω τι client χρησιμοποιείς ίσως τα ονόματα των column να μην είναι ακριβώς ίδια προσάρμοσε τα εσύ ανάλογα !

Link to comment
Share on other sites

  • 0

η μια λύση είναι να το κάνεις έτσι,

DELETE FROM droplist WHERE itemId NOT IN (x,y);

 

δηλαδή να κάνεις delete όλα τα items που πετάνε τα mobs εκτός απο ADENA π.χ

 


 

και ο άλλος,ο τρόπος που ζήτησες.

insert into droplist (mobId, itemid, chance, min, max,category) select id, 4037, 1000000, 1, 1, 52 from npc where type='L2Monster';

 

αυτά

Link to comment
Share on other sites

  • 0

Oxi 8elw na minoun ola ta drops apla den ginete na balw se ola ta monsters mesa sto game to sigekrimenw item pou 8elw na petaei? afto to sql command zitaw diladi oti kai na skwtoso na rixnei afto to item eno ta droplist na minoun etc opos htan

Link to comment
Share on other sites

  • 0

ε ναι,με το δεύτερο sql στην ουσία αυτό κάνεις,διαλέγεις ένα δικό σου mob και βάζεις id/chance/amount etc.

 

αυτό δεν θες;

Link to comment
Share on other sites

  • 0

το δεύτερο που σου έδωσε ο φάνκυ κάνει αυτό που θες !

 

από εδώ το πήρε θα βρεις και άλλα χρήσιμα ;)

 

http://maxcheaters.com/forum/index.php?topic=98212.0

Link to comment
Share on other sites

  • 0

το δεύτερο που σου έδωσε ο φάνκυ κάνει αυτό που θες !

 

από εδώ το πήρε θα βρεις και άλλα χρήσιμα ;)

 

http://maxcheaters.com/forum/index.php?topic=98212.0

αυτό που έδωσα εγώ είναι για 1 συγκεκριμένο mob,εκείνος το θέλει για όλα.
Link to comment
Share on other sites

  • 0

αυτό που έδωσα εγώ είναι για 1 συγκεκριμένο mob,εκείνος το θέλει για όλα.

κάτι έχεις καταλάβει λάθος

 

from npc where type='L2Monster';

Link to comment
Share on other sites

  • 0

κάτι έχεις καταλάβει λάθος

 

from npc where type='L2Monster';

όπα,έχεις δίκιο.

μπερδεύτηκα απο το πρώτο μέρος.

 

ρομεο,έχει δίκιο ο nevermore.

Link to comment
Share on other sites

  • 0

κάντο μέσω java καλύτερα, μην επιβαρύνεις πολύ τη βάση δεδομένων.

to sigekrimeno ine xirotera me java giati tha checkarei gia kathe mob pou troei o pektis to sigekrimeno drop. episis den epivarinete katholou ma katholou i vasi dedomenon giati apla einai mono 1 connection :D

 

 

 

/*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
* 
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
* 
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.sf.l2j.gameserver.handler.admincommandhandlers;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.StringTokenizer;

import net.sf.l2j.L2DatabaseFactory;
import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
import net.sf.l2j.gameserver.model.L2Object;
import net.sf.l2j.gameserver.model.L2World;
import net.sf.l2j.gameserver.model.actor.instance.L2MonsterInstance;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;

/**
* @author irat
*
*/
public class AdminAllDrop implements IAdminCommandHandler
{

private String[] command = {"admin_all_drop"};

private boolean canContinue(int a, int b, int g, int d , int e, int z){
	if(a == 0 || b == 0 || g == 0 || d == 0 || e == 0 || z ==0)
		return false;
	return true;	
}

public boolean useAdminCommand(String command, L2PcInstance activeChar)
{
	if(activeChar == null)
		return false;

	if(command.startsWith("admin_all_drop"))
	{
		//type : mobId itemId chance min max category

		int mobId , itemId , chance , min , max , category;

		StringTokenizer st = new StringTokenizer(command);

	if(!st.hasMoreTokens()){
		activeChar.sendMessage("nothing happened");
		return false;
	}
		mobId = Integer.parseInt(st.nextToken());
		itemId = Integer.parseInt(st.nextToken());
		chance = Integer.parseInt(st.nextToken());
		min = Integer.parseInt(st.nextToken());
		max = Integer.parseInt(st.nextToken());
		category = Integer.parseInt(st.nextToken());

		if(canContinue(mobId,itemId,chance,min,max,category))
		{
			Connection con = null;
			PreparedStatement state = null;
			try
			{
				con = L2DatabaseFactory.getInstance().getConnection();
				state = con.prepareStatement("UPDATE droplist SET mobId = ?, itemId = ?, min = ?, max = ?, category = ?, chance = ? ");
				state.setInt(1, mobId);
				state.setInt(2, itemId);
				state.setInt(3, chance);
				state.setInt(4, min);
				state.setInt(5, max);
				state.setInt(6, category);
				state.execute();

				state.close();

				for(L2Object monster : L2World.getInstance().getAllVisibleObjects()){
					  if(monster != null && monster instanceof L2MonsterInstance){
						  monster.decayMe();
						  monster.spawnMe();
					  }
				}
			}
			catch(Exception ie){
				ie.printStackTrace();
			}
			finally{
				try
				{
					con.close();
				}
				catch (SQLException e)
				{

				}
			}
		}
		else{
			activeChar.sendMessage("something not loaded");
			return false;
		}

	}

	return true;
}


public String[] getAdminCommandList()
{
	return command;
}

}

 

//all_drop mobId itemId chance min max category

 

Link to comment
Share on other sites

  • 0

-- ############## START ##############

-- INSERT DATA
INSERT INTO droplist 
(
mobId,
itemId,
min,
max,
category,
chance)

-- SELECT ALL entries FROM npc TABLE AND INSERT INTO another TABLE
SELECT
id , '41000', '1', '1', '15', '1000000' FROM npc WHERE type = "L2Monster";


-- ############## END ##############

kane afto kai ksemperdepses, ekei pou leei to 41000 einai to id apo to item oi asoi einai to min kai to max kai to 1000000 einai to chance, vale ta dika sou kai eisai etoimos, oute java oute tpt

P.S tested and worked.

Link to comment
Share on other sites

  • 0

Diladi dn yparxei tropos na ginei me sql? giati kapote eixa to command ala ekana to pc m format apo 7 se xp k exasa polla arxeia p htan xrisima gia mena :P gia na ksemperdeuoume kai na min sas prizw allo twra diladi afto to deutero sql p estile o fanky editari automata ola ta droplist sto paixnidi? giati afto akribos 8elw oxi ena sigekrimenw mob apla egw na grapsw mono to id kai to chance apo to item kai molis to perasw stn db kai loggaro ksana mesa ola ta mobs p skotonw na rixnoun afta ta item :)

Link to comment
Share on other sites

  • 0

yparxei.........

-- ############## START ##############

-- INSERT DATA
INSERT INTO droplist 
(
mobId,
itemId,
min,
max,
category,
chance)

-- SELECT ALL entries FROM npc TABLE AND INSERT INTO another TABLE
SELECT
id , '41000', '1', '1', '15', '1000000' FROM npc WHERE type = "L2Monster";


-- ############## END ##############

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...