コード例 #1
0
ファイル: rodent.go プロジェクト: Xackery/eqcleanup
func Clean(args ...string) (err error) {
	db, err := eqdb.Load()
	if err != nil {
		return
	}
	config, err := eqconfig.Load()
	if err != nil {
		return
	}

	ids, err := spawngroup.GetSpawnGroupIdsByNameWildcard(db, "a_rodent")
	if err != nil {
		err = fmt.Errorf("Error getting %s Ids: %s", focus, err.Error())
		return
	}
	if len(ids) < 1 {
		fmt.Println("No", focus, "were found to delete")
		return
	}

	//Exterminators
	extids, err := spawngroup.GetSpawnGroupIdsByNameWildcard(db, "exterminator_")
	if err != nil {
		err = fmt.Errorf("Error getting exterminator Ids: %s", err.Error())
		return
	}
	if len(extids) > 1 {
		for _, extid := range extids {
			ids = append(ids, extid)
		}
	}

	totalChanged, err := spawngroup.RemoveSpawnGroupAndEntryById(db, ids)
	if err != nil {
		err = fmt.Errorf("Error removing", focus, "entries: %s", err.Error())
		return
	}
	fmt.Println("Removed", totalChanged, " DB entries related to", focus, "in spawnentry and spawngroup successfully.")

	filePaths := []string{
		"felwithea/Exterminator_Valern.pl",
		"freeporteast/Exterminator_Larkey.lua",
		"freeporteast/Exterminator_Qalantir.lua",
		"freporte/Exterminator_Larkey.lua",
		"freportw/Exterminator_Qalantir.lua",
		"kaladimb/Exterminator_Vin.pl",
		"neriakb/Exterminator_Damasi.pl",
		"neriakc/Exterminator_Gilea.pl",
		"qeynos/Exterminator_Rasmon.lua",
		"qeynos2/Exterminator_Wintloag.lua",
		"rivervale/Exterminator_Sutten.lua",
	}

	delCount, err := quest.Remove(config, filePaths)
	if err != nil {
		fmt.Println(err.Error())
	}
	fmt.Println("Deleted", delCount, focus, "related quest files")
	return
}
コード例 #2
0
ファイル: shadowrest.go プロジェクト: Xackery/eqcleanup
func Clean(args ...string) (err error) {
	db, err := eqdb.Load()
	if err != nil {
		return
	}
	//SpawnGroups
	ids := []int64{}

	mids, err := spawngroup.GetSpawnGroupIdsByLastNameWildcard(db, "Emissary of Shadowrest")
	if err != nil {
		err = fmt.Errorf("Error removing", focus, "entries: %s", err.Error())
		return
	}
	for _, id := range mids {
		ids = append(ids, id)
	}

	fmt.Println("Got", len(ids), "Npcs")

	fmt.Println("Removing spell NPC spawn points")

	totalChanged, err := spawngroup.RemoveSpawnGroupAndEntryById(db, ids)
	if err != nil {
		err = fmt.Errorf("Error removing", focus, "entries: %s", err.Error())
		return
	}

	fmt.Println("Removed", totalChanged, " DB entries related to", focus, "in all player-accessible item locations.")
	return
}
コード例 #3
0
ファイル: tribute.go プロジェクト: Xackery/eqcleanup
func Clean(args ...string) (err error) {
	db, err := eqdb.Load()
	if err != nil {
		return
	}

	//tribute master
	ids, err := spawngroup.GetSpawnGroupIdsByClass(db, 63)
	if err != nil {
		err = fmt.Errorf("Error getting %s Ids: %s", focus, err.Error())
		return
	}

	//tribute grand master
	mids, err := spawngroup.GetSpawnGroupIdsByClass(db, 64)
	for _, id := range mids {
		ids = append(ids, id)
	}

	if len(ids) < 1 {
		fmt.Println("No ", focus, "were found to delete")
		return
	}

	totalChanged, err := spawngroup.RemoveSpawnGroupAndEntryById(db, ids)
	if err != nil {
		err = fmt.Errorf("Error removing", focus, "entries: %s", err.Error())
		return
	}
	fmt.Println("Removed", totalChanged, " DB entries related to", focus, "in spawnentry and spawngroup successfully.")
	return
}
コード例 #4
0
ファイル: mainmenu.go プロジェクト: Xackery/eqcleanup
func main() {
	var err error
	fmt.Println("                         EQCleanup, v0.15")
	fmt.Println("                       Written by Shin Noir")
	fmt.Println("--------------------------------------------------------------------------")
	var option string
	_, err = eqdb.Load()
	if err != nil {
		fmt.Println(err.Error())
		fmt.Println("Press q then enter to quit.")
		fmt.Scanf(option)
		return
	}
	fmt.Println("* !!!NOTE!!! Backup your database before using this tool.")

	//var err error
	mainMenu := []menu.CommandOption{
		menu.CommandOption{"era", "Out of era edits, ex. removing items or npcs", era.Menu},
		menu.CommandOption{"zone", "Zone migration tools, ex. newer to classic zone", zone.Menu},
		menu.CommandOption{"core", "System maintainence options, ex. removing all character data", core.Menu},
		menu.CommandOption{"misc", "misc edits, ex. disabling rainfall", misc.Menu},
	}
	menuOptions := menu.NewMenuOptions("'menu' for help []> ", 0)

	menu := menu.NewMenu(mainMenu, menuOptions)
	menu.Start()
}
コード例 #5
0
ファイル: named.go プロジェクト: Xackery/eqcleanup
func Clean(args ...string) (err error) {
	db, err := eqdb.Load()
	if err != nil {
		return
	}

	spawns := []Spawndata{
		{Npcid: 37082, Spawngroupid: 2096, Chance: 5},                            //Arthikus was 50
		{Npcid: 35160, Spawngroupid: 4748, Chance: 5},                            //Ghoul of TakishHiz was 20
		{Npcid: 37121, Spawngroupid: 3271, Chance: 5},                            //A sand giant was 50
		{Npcid: 37121, Spawngroupid: 3376, Chance: 5},                            //A sand giant was 50
		{Npcid: 37157, Spawngroupid: 2095, Chance: 5},                            //cazel was 50
		{Npcid: 22187, Spawngroupid: 788, Chance: 5},                             //a griffon was 50
		{Npcid: 22187, Spawngroupid: 792, Chance: 5},                             //a griffon was 50
		{Npcid: 92159, Spawngroupid: 9825, Chance: 5},                            //Overseer_Miklek was 34%
		{Npcid: 110100, Spawngroupid: 16400, Mindelay: 50000, Despawntimer: 100}, //Stormfeather

	}

	totalRemoved := int64(0)

	for _, spawn := range spawns {
		var result sql.Result
		if spawn.Chance > 0 {
			result, err = db.Exec("UPDATE spawnentry SET chance = ? WHERE npcid = ? AND spawngroupid = ?", spawn.Chance, spawn.Npcid, spawn.Spawngroupid)
			if err != nil {
				fmt.Println("Err updating spawngroup:", err.Error())
				return
			}
			var affect int64
			affect, err = result.RowsAffected()
			if err != nil {
				fmt.Println("Error getting rows affected for", focus, err.Error())
				return
			}
			totalRemoved += affect
		}
		if spawn.Mindelay > 0 && spawn.Despawntimer > 0 {
			result, err = db.Exec("UPDATE spawngroup SET mindelay = ?, despawn_timer = ? WHERE npcid = ? AND spawngroupid = ?", spawn.Mindelay, spawn.Despawntimer, spawn.Npcid, spawn.Spawngroupid)
			if err != nil {
				fmt.Println("Err updating spawngroup:", err.Error())
				return
			}
			var affect int64
			affect, err = result.RowsAffected()
			if err != nil {
				fmt.Println("Error getting rows affected for", focus, err.Error())
				return
			}
			totalRemoved += affect
		}
	}
	fmt.Println("Updated", totalRemoved, " DB entries related to", focus, "in spawnentry and spawngroup successfully.")

	return
}
コード例 #6
0
ファイル: eraitem.go プロジェクト: Xackery/eqcleanup
func Clean(args ...string) (err error) {
	db, err := eqdb.Load()
	if err != nil {
		return
	}
	config, err := eqconfig.Load()
	if err != nil {
		return
	}

	//Mobs
	ids := []int64{
		111050, //Gellrazz Scalerunner
		25429,  //a dark spirit of nektulos
		59438,  //coldwind blackfoot
		48343,  //immug lashtail
		13138,  //frog invasion
		6251,
	}
	//#checkpoint_ten

	spawngroup.RemoveSpawnGroupAndEntryById(db, ids)

	//Items
	ids = loadIds()
	totalChanged, err := item.RemoveAllInstancesOfItems(db, ids)
	if err != nil {
		return
	}
	fmt.Println("Removed", totalChanged, " DB entries related to", focus, "in all player-accessible item locations.")

	filePaths := []string{
	//"befallen/Wraps_McGee.lua",
	}

	delCount, err := quest.Remove(config, filePaths)
	if err != nil {
		fmt.Println(err.Error())
	}
	fmt.Println("Deleted", delCount, focus, "related quest files")
	return
}
コード例 #7
0
ファイル: nexus.go プロジェクト: Xackery/eqcleanup
func Clean(args ...string) (err error) {
	db, err := eqdb.Load()
	if err != nil {
		return
	}
	config, err := eqconfig.Load()
	if err != nil {
		return
	}
	ids, err := spawngroup.GetSpawnGroupIdsByNameWildcard(db, "nexus_scion")
	if err != nil {
		err = fmt.Errorf("Error getting %s Ids: %s", focus, err.Error())
		return
	}
	vids, err := spawngroup.GetSpawnGroupIdsByNameWildcard(db, "a_mystic_voice")
	for _, id := range vids {
		ids = append(ids, id)
	}

	totalChanged, err := spawngroup.RemoveSpawnGroupAndEntryById(db, ids)
	if err != nil {
		err = fmt.Errorf("Error removing", focus, "entries: %s", err.Error())
		return
	}
	fmt.Println("Removed", totalChanged, " DB entries related to", focus, "in spawnentry and spawngroup successfully.")

	filePaths := []string{
		"dreadlands/A_Mystic_Voice.lua",
		"gfaydark/A_Mystic_Voice.pl",
		"greatdivide/A_Mystic_Voice.pl",
		"northkarana/A_Mystic_Voice.lua",
		"tox/A_Mystic_Voice.pl",
		"toxxulia/A_Mystic_Voice.pl",
	}

	delCount, err := quest.Remove(config, filePaths)
	if err != nil {
		fmt.Println(err.Error())
	}
	fmt.Println("Deleted", delCount, focus, "related quest files")
	return
}
コード例 #8
0
ファイル: wipe.go プロジェクト: Xackery/eqcleanup
func DeleteQuery(query string, value int64, focus string) (affect int64, err error) {
	db, err := eqdb.Load()
	if err != nil {
		return
	}
	var result sql.Result

	result, err = db.Exec(query, value)
	if err != nil {
		fmt.Println("Error removing ", value, "from", focus, ":", err.Error())
		return
	}

	affect, err = result.RowsAffected()
	if err != nil {
		fmt.Println("Error getting rows affected for", focus, value, err.Error())
		return
	}
	return
}
コード例 #9
0
ファイル: rain.go プロジェクト: Xackery/eqcleanup
func Clean(args ...string) (err error) {
	db, err := eqdb.Load()
	if err != nil {
		return
	}
	result, err := db.Exec("UPDATE zone SET rain_chance1 = 0, rain_chance2 = 0, rain_chance3 = 0, rain_chance4 = 0, rain_duration1 = 0, rain_duration2 = 0, rain_duration3 = 0, rain_duration4 = 0, snow_chance1 = 0, snow_chance2 = 0, snow_chance3 = 0, snow_chance4 = 0, snow_duration1 = 0, snow_duration2 = 0, snow_duration3 = 0, snow_duration4 = 0")
	if err != nil {
		fmt.Println("Error disabling rain and snow: ", err.Error())
		return
	}
	affect, err := result.RowsAffected()
	if err != nil {
		fmt.Println("Error getting rows affected for rain & snow", err.Error())
		return
	}

	fmt.Println("Updated", affect, " DB entries related to rain and snow successfully.")

	return
}
コード例 #10
0
ファイル: fabled.go プロジェクト: Xackery/eqcleanup
func Clean(args ...string) (err error) {
	db, err := eqdb.Load()
	if err != nil {
		return
	}

	//Remove Adventure Merchants
	ids, err := spawngroup.GetSpawnGroupIdsByNameWildcard(db, "the_fabled")
	if err != nil {
		err = fmt.Errorf("Error getting %s Ids: %s", focus, err.Error())
		return
	}

	totalChanged, err := spawngroup.RemoveSpawnGroupAndEntryById(db, ids)
	if err != nil {
		err = fmt.Errorf("Error removing", focus, "entries: %s", err.Error())
		return
	}
	fmt.Println("Removed", totalChanged, " DB entries related to", focus, "in spawnentry and spawngroup successfully.")

	return
}
コード例 #11
0
ファイル: priest.go プロジェクト: Xackery/eqcleanup
func Clean(args ...string) (err error) {
	db, err := eqdb.Load()
	if err != nil {
		return
	}

	config, err := eqconfig.Load()
	if err != nil {
		return
	}
	ids, err := spawngroup.GetSpawnGroupIdsByNameWildcard(db, "priest_of_discord")
	if err != nil {
		err = fmt.Errorf("Error getting %s Ids: %s", focus, err.Error())
		return
	}
	if len(ids) < 1 {
		fmt.Println("No ", focus, "were found to delete")
		return
	}
	totalChanged, err := spawngroup.RemoveSpawnGroupAndEntryById(db, ids)
	if err != nil {
		err = fmt.Errorf("Error removing", focus, "entries: %s", err.Error())
		return
	}
	fmt.Println("Removed", totalChanged, " DB entries related to", focus, "in spawnentry and spawngroup successfully.")

	filePaths := []string{
		"global/Priest_of_Discord.lua",
		"kaladima/Priest_of_Discord.pl",
	}

	delCount, err := quest.Remove(config, filePaths)
	if err != nil {
		fmt.Println(err.Error())
	}
	fmt.Println("Deleted", delCount, focus, "related quest files")
	return
}
コード例 #12
0
ファイル: aug.go プロジェクト: Xackery/eqcleanup
func Clean(args ...string) (err error) {
	db, err := eqdb.Load()
	if err != nil {
		return
	}

	totalChanged := int64(0)

	fmt.Println("Looking for augment item ids...")
	rows, err := db.Query("SELECT id FROM items WHERE augtype > 0")
	if err != nil {
		return
	}

	ids := []int64{}

	//iterate results
	for rows.Next() {
		id := int64(0)
		err = rows.Scan(&id)
		if err != nil {
			return
		}
		ids = append(ids, id)
	}
	fmt.Println("Found", len(ids), " augments, deleting their entries...")
	moreChanged, err := item.RemoveAllInstancesOfItems(db, ids)
	if err != nil {
		return
	}
	totalChanged += moreChanged

	fmt.Println("Updated", totalChanged, " DB entries related to", focus)

	return
}
コード例 #13
0
ファイル: halloween.go プロジェクト: Xackery/eqcleanup
func Clean(args ...string) (err error) {
	db, err := eqdb.Load()
	if err != nil {
		return
	}
	config, err := eqconfig.Load()
	if err != nil {
		return
	}

	//Mobs
	ids := []int64{
		19151, //Laryn lycanthrope
		202373,
		202384, //wicked winnie
		202385, //a wizeened hermit
		20255,
		20255, //booberella
		20256,
		20256,
		20257,
		20257,
		20258,
		20258,
		20259,
		20259, //Eve_Hallows
		20260, //Jack Lanturn
		20261,
		20261,
		20262,
		20262,
		20263, //tricksy_treetor
		20264,
		20264,
		20265,
		20265,
		20266,
		20266,
		20267,
		20267,
		20268,
		20268,
		20269,
		20269, //an_imp
		20270,
		20270,
		20271,
		20271,
		20272,
		20272, //a_zombie
		20273,
		20273,
		20274,
		20274,
		20275,  //Mippie Digs
		20279,  //Old man draykey
		20281,  //Syxa
		20285,  //Crazy Charlie
		20288,  //lurgh
		20289,  //a_jack_o_lantern
		25436,  //grom shives
		38178,  //marta stalwart
		394263, //aragol gloomflow
		48350,
		48352,
		48353,
		48354,
		63099,
		98641,
		98643,
		98989, //lurgh
	}
	//#checkpoint_ten

	spawngroup.RemoveSpawnGroupAndEntryById(db, ids)

	//Items
	ids = []int64{
		84084, //Gummie Kobolds
		84088, //rock candy

		84091, //sand
		84092, //chunk of coal
		84093, //pocket lint
		84094, //Draykey's Codex
		84095, //Trick or treat bag

	}
	totalChanged, err := item.RemoveAllInstancesOfItems(db, ids)
	if err != nil {
		return
	}
	fmt.Println("Removed", totalChanged, " DB entries related to", focus, "in all player-accessible item locations.")

	filePaths := []string{
		"befallen/Wraps_McGee.lua",
		"commonlands/Sergeant_Ragus.pl",
		"crescent/#Aragol_Gloomflow.pl",
		"ecommons/Sergeant_Ragus.pl",
		"fieldofbone/Immug_Lashtail.pl",
		"iceclad/Nilham_the_Chef.pl",
		"kithicor/Old_Man_Draykey.pl",
		"mistmoore/Nate.pl",
		"quests/nektulos/Grom_Shives.pl",
		"quests/netherbian/Poil_Lolp.pl",
		"poknowledge/Grand_Librarian_Maelin.pl",
		"qey2hh1/Scary_Miller.lua",
		"rivervale/Laryen_Lycanthrope.pl",
		"tox/Fuzz_Selppa.pl",
		"toxxulia/Fuzz_Selppa.pl",
		"unrest/Crabby_the_Rotten.pl",
		"nektulos/#checkpoint_ten.pl", //trick or treat stop
		"unrest/Halloween_Trigger.pl", //trick or treat stop
		"unrest/Casper.pl",
		"unrest/Candy_Man.pl",
		"unrest/Evil_Brain_Eater.pl",
		"unrest/Eviler_Brain_Eater.pl",
		"unrest/Evilerer_Brain_Eater.pl",
		"unrest/Imp-ossible.pl",
		"unrest/Jack_o_Lantern.pl",
		"unrest/Not_So_Evil_Brain_Eater.pl",
		"unrest/Super_Ghoul_of_Unlimited_Power.pl",
		"unrest/Werewolf_of_DOOOOOOOM.pl",
	}

	delCount, err := quest.Remove(config, filePaths)
	if err != nil {
		fmt.Println(err.Error())
	}
	fmt.Println("Deleted", delCount, focus, "related quest files")
	return
}
コード例 #14
0
ファイル: spell.go プロジェクト: Xackery/eqcleanup
func Clean(args ...string) (err error) {
	db, err := eqdb.Load()
	if err != nil {
		return
	}

	//SpawnGroups
	ids := []int64{
		6746, //tallik in ec
		6747, //palik in ec
		728,  //rushka in ec
		716,  //olin in ec
		717,  //wilno in ec
		718,  //almon in ec
		/*//Neriakc
		//cleric
		3162, //svlia in Neriakc
		3163, //Isshia
		3164, //trik
		3160, //lyniv
		3159, //myrish
		3165, //sol
		//wizard
		3142, //jusar
		3141, //misar
		5791, //drisi
		5792, //ash
		//SK
		3152,
		//Necro
		3154,
		//Neriakb
		//wiz
		3127, //riv
		3122, //tal
		3130,
		3129,
		3121,
		3124,
		3125,
		3132,
		3131,
		3133,
		3128,
		3119,
		3123,
		//rivervale
		7706, //ilscent
		5674, //bumpy
		//staria
		5686, //fralith
		5676, //torth
		//akanon
		48152,
		48151,
		48150,
		48158,
		7159,
		7160,
		7154,
		48136,

		//gfay
		1523,
		1522,
		//grobb
		5581,
		3480,
		5582,
		5558,
		5591,
		5615,
		5628,*/
	}

	fmt.Println("Getting all spell selling NPCs...")

	mids, err := spawngroup.GetSpawnGroupIdsByLastNameWildcard(db, "Bard Songs")
	if err != nil {
		err = fmt.Errorf("Error removing", focus, "entries: %s", err.Error())
		return
	}
	for _, id := range mids {
		ids = append(ids, id)
	}

	mids, err = spawngroup.GetSpawnGroupIdsByLastNameWildcard(db, "General Spells")
	if err != nil {
		err = fmt.Errorf("Error removing", focus, "entries: %s", err.Error())
		return
	}
	for _, id := range mids {
		ids = append(ids, id)
	}

	mids, err = spawngroup.GetSpawnGroupIdsByLastNameWildcard(db, "Berserker Tomes")
	if err != nil {
		err = fmt.Errorf("Error removing", focus, "entries: %s", err.Error())
		return
	}
	for _, id := range mids {
		ids = append(ids, id)
	}

	mids, err = spawngroup.GetSpawnGroupIdsByLastNameWildcard(db, "Cleric Spells")
	if err != nil {
		err = fmt.Errorf("Error removing", focus, "entries: %s", err.Error())
		return
	}
	for _, id := range mids {
		ids = append(ids, id)
	}

	mids, err = spawngroup.GetSpawnGroupIdsByLastNameWildcard(db, "Druid Spells")
	if err != nil {
		err = fmt.Errorf("Error removing", focus, "entries: %s", err.Error())
		return
	}
	for _, id := range mids {
		ids = append(ids, id)
	}

	mids, err = spawngroup.GetSpawnGroupIdsByLastNameWildcard(db, "Enchanter Spells")
	if err != nil {
		err = fmt.Errorf("Error removing", focus, "entries: %s", err.Error())
		return
	}
	for _, id := range mids {
		ids = append(ids, id)
	}

	mids, err = spawngroup.GetSpawnGroupIdsByLastNameWildcard(db, "Magician Spells")
	if err != nil {
		err = fmt.Errorf("Error removing", focus, "entries: %s", err.Error())
		return
	}
	for _, id := range mids {
		ids = append(ids, id)
	}

	mids, err = spawngroup.GetSpawnGroupIdsByLastNameWildcard(db, "Monk Tomes")
	if err != nil {
		err = fmt.Errorf("Error removing", focus, "entries: %s", err.Error())
		return
	}
	for _, id := range mids {
		ids = append(ids, id)
	}

	mids, err = spawngroup.GetSpawnGroupIdsByLastNameWildcard(db, "Necromancer Spells")
	if err != nil {
		err = fmt.Errorf("Error removing", focus, "entries: %s", err.Error())
		return
	}
	for _, id := range mids {
		ids = append(ids, id)
	}

	mids, err = spawngroup.GetSpawnGroupIdsByLastNameWildcard(db, "Paladin Spells")
	if err != nil {
		err = fmt.Errorf("Error removing", focus, "entries: %s", err.Error())
		return
	}
	for _, id := range mids {
		ids = append(ids, id)
	}

	mids, err = spawngroup.GetSpawnGroupIdsByLastNameWildcard(db, "Ranger Spells")
	if err != nil {
		err = fmt.Errorf("Error removing", focus, "entries: %s", err.Error())
		return
	}
	for _, id := range mids {
		ids = append(ids, id)
	}

	mids, err = spawngroup.GetSpawnGroupIdsByLastNameWildcard(db, "Rogue Tomes")
	if err != nil {
		err = fmt.Errorf("Error removing", focus, "entries: %s", err.Error())
		return
	}
	for _, id := range mids {
		ids = append(ids, id)
	}

	mids, err = spawngroup.GetSpawnGroupIdsByLastNameWildcard(db, "Shadowknight Spells")
	if err != nil {
		err = fmt.Errorf("Error removing", focus, "entries: %s", err.Error())
		return
	}
	for _, id := range mids {
		ids = append(ids, id)
	}

	mids, err = spawngroup.GetSpawnGroupIdsByLastNameWildcard(db, "Shaman Spells")
	if err != nil {
		err = fmt.Errorf("Error removing", focus, "entries: %s", err.Error())
		return
	}
	for _, id := range mids {
		ids = append(ids, id)
	}

	mids, err = spawngroup.GetSpawnGroupIdsByLastNameWildcard(db, "Warrior Tomes")
	if err != nil {
		err = fmt.Errorf("Error removing", focus, "entries: %s", err.Error())
		return
	}
	for _, id := range mids {
		ids = append(ids, id)
	}

	mids, err = spawngroup.GetSpawnGroupIdsByLastNameWildcard(db, "Wizard Spells")
	if err != nil {
		err = fmt.Errorf("Error removing", focus, "entries: %s", err.Error())
		return
	}
	for _, id := range mids {
		ids = append(ids, id)
	}

	fmt.Println("Got", len(ids), "Npcs")

	fmt.Println("Removing spell NPC spawn points, there's a lot, may take a while")

	totalChanged, err := spawngroup.RemoveSpawnGroupAndEntryById(db, ids)
	if err != nil {
		err = fmt.Errorf("Error removing", focus, "entries: %s", err.Error())
		return
	}

	//Find all item IDS
	fmt.Println("Now getting all spell item entries, there's a lot here too, expect a while")
	rows, err := db.Query("SELECT id FROM items WHERE scrolleffect > 0")
	if err != nil {
		return
	}

	//iterate results
	for rows.Next() {
		id := int64(0)
		err = rows.Scan(&id)
		if err != nil {
			return
		}
		ids = append(ids, id)
	}
	fmt.Println("Found", len(ids), " spells, deleting them...")
	moreChanged, err := item.RemoveAllInstancesOfItems(db, ids)
	if err != nil {
		return
	}
	totalChanged += moreChanged
	fmt.Println("Removed", totalChanged, " DB entries related to", focus, "in all player-accessible item locations.")
	return
}
コード例 #15
0
ファイル: soulbinder.go プロジェクト: Xackery/eqcleanup
func Clean(args ...string) (err error) {
	db, err := eqdb.Load()
	if err != nil {
		return
	}
	config, err := eqconfig.Load()
	if err != nil {
		return
	}
	ids, err := spawngroup.GetSpawnGroupIdsByNameWildcard(db, focus)
	ids = append(ids, 3199)  //Add Romi to delete list
	ids = append(ids, 54932) //And priestess aelea
	if err != nil {
		err = fmt.Errorf("Error getting %s Ids: %s", focus, err.Error())
		return
	}
	if len(ids) < 1 {
		fmt.Println("No", focus, "were found to delete")
		return
	}
	totalChanged, err := spawngroup.RemoveSpawnGroupAndEntryById(db, ids)
	if err != nil {
		err = fmt.Errorf("Error removing", focus, "entries: %s", err.Error())
		return
	}
	fmt.Println("Removed", totalChanged, " DB entries related to", focus, "in spawnentry and spawngroup successfully.")

	filePaths := []string{
		"abysmal/Soulbinder_Jerlin.pl",
		"cabeast/Soulbinder_Shakar.pl",
		"commonlands/Soulbinder_Jubbl.pl",
		"crescent/Priestess_Aelea.pl",
		"ecommons/Soulbinder_Jubbl.pl",
		"everfrost/Soulbinder_Garnog.pl",
		"firiona/Soulbinder_Tardon.pl",
		"gfaydark/Soulbinder_Oakstout.pl",
		"guildlobby/High_Priest_of_Luclin.pl",
		"guildlobby/High_Priestess_of_Luclin.pl",
		"gukta/Soulbinder_Snog.pl",
		"gukta/Soulbinder_Zlippi.pl",
		"gunthak/Soulbinder_Karyin.pl",
		"iceclad/Soulbinder_Cubnitskin.pl",
		"kaladima/Soulbinder_Torvald.pl",
		"neriaka/Soulbinder_Nola_Z-Ret.pl",
		"neriaka/Soulbinder_Novalu.pl",
		"northkarana/Romi.pl",
		"northro/Soulbinder_Ragni.pl",
		"nro/Soulbinder_Ragni.pl",
		"oggok/Soulbinder_Trurg.pl",
		"overthere/Soulbinder_Kardin.pl",
		"paineel/Soulbinder_Tomas.pl",
		//"plugins/default-actions.pl", //There is a soulbinder flag here, ignoring though
		"plugins/soulbinders.pl",
		"poknowledge/Soulbinder_Jera.pl",
		"potranquility/Soulbinder_Derith.pl",
		"rathemtn/Soulbinder_Zlippi.pl",
		"shadowhaven/Soulbinder_Nansin.pl",
		"sharvahl/Soulbinder_Ghula.pl",
		"southro/Soulbinder_Silandra.pl",
		"sro/Soulbinder_Silandra.pl",
	}

	delCount, err := quest.Remove(config, filePaths)
	if err != nil {
		fmt.Println(err.Error())
	}
	fmt.Println("Deleted", delCount, focus, "related quest files")
	return
}
コード例 #16
0
ファイル: paw.go プロジェクト: Xackery/eqcleanup
func Clean(args ...string) (err error) {
	db, err := eqdb.Load()
	if err != nil {
		return
	}
	config, err := eqconfig.Load()
	if err != nil {
		return
	}

	var totalChanged int64
	var result sql.Result
	if len(lootdrops) < 1 {
		err = fmt.Errorf("lootdrops empty! Please download a newer eqcleanup")
		return
	}
	if len(lootdropentries) < 1 {
		err = fmt.Errorf("lootdropentries empty! Please download a newer eqcleanup")
		return
	}
	if len(loottables) < 1 {
		err = fmt.Errorf("loottables empty! Please download a newer eqcleanup")
		return
	}
	if len(loottableentries) < 1 {
		err = fmt.Errorf("loottablentries empty! Please download a newer eqcleanup")
		return
	}
	if len(npctypes) < 1 {
		err = fmt.Errorf("npctypes empty! Please download a newer eqcleanup")
		return
	}
	if len(spawns) < 1 {
		err = fmt.Errorf("spawns empty! Please download a newer eqcleanup")
		return
	}
	if len(spawnentries) < 1 {
		err = fmt.Errorf("spawnentries empty! Please download a newer eqcleanup")
		return
	}
	if len(spawngroups) < 1 {
		err = fmt.Errorf("spawngroups empty! Please download a newer eqcleanup")
		return
	}
	fmt.Println("Removing old data about", focus, "...")

	if totalChanged, err = loot.RemoveLootByZone(db, zonename); err != nil {
		return
	}

	if totalChanged, err = spawngroup.RemoveGridByZone(db, zonename); err != nil {
		return
	}
	fmt.Println("Removed", totalChanged, "grid related entries")

	if totalChanged, err = spawngroup.RemoveSpawnGroupAndEntryByZone(db, zonename); err != nil {
		return
	}
	fmt.Println("Removed", totalChanged, "spawn related entries")

	if totalChanged, err = npcpkg.RemoveNPCByZone(db, zonename); err != nil {
		return
	}
	fmt.Println("Removed", totalChanged, "npcs")

	if totalChanged, err = quest.RemoveAllQuestsForZone(config, zonename); err != nil {
		return
	}
	fmt.Println("Removed", totalChanged, "quest files")

	fmt.Println("Inserting new data about", focus, "...")

	//Loot
	var q string
	if q, err = injector.PrepareInsertString(&lootdrops[0], "lootdrop"); err != nil {
		return
	}

	totalChanged = 0

	for _, l := range lootdrops {
		if result, err = db.NamedExec(q, map[string]interface{}{"name": l.Name}); err != nil {
			err = fmt.Errorf("with lootdrop insert: %s", err.Error())
			return
		}
		var lastId int64

		if lastId, err = result.LastInsertId(); err != nil {
			err = fmt.Errorf("with lootdrop last insert: %s", err.Error())
			return
		}

		//now that lootdrops has changed, sync up loottables with proper lootdrop ids
		for i := range loottableentries {
			if loottableentries[i].Lootdrop_id == int(l.Id) {
				loottableentries[i].Lootdrop_id = int(lastId)
			}
		}
		for i := range lootdropentries {
			if lootdropentries[i].Lootdrop_id == int(l.Id) {
				lootdropentries[i].Lootdrop_id = int(lastId)
			}
		}
		totalChanged++
	}

	if q, err = injector.PrepareInsertString(&lootdropentries[0], "lootdrop_entries"); err != nil {
		return
	}

	for _, l := range lootdropentries {
		if result, err = db.NamedExec(q, &l); err != nil {
			err = fmt.Errorf("with lootdropentries insert: %s", err.Error())
			return
		}

		if _, err = result.LastInsertId(); err != nil {
			err = fmt.Errorf("with lootdropentries insert: %s", err.Error())
			return
		}
		totalChanged++
	}

	if q, err = injector.PrepareInsertString(&loottables[0], "loottable"); err != nil {
		return
	}

	for _, l := range loottables {
		l.Id.Valid = false
		if result, err = db.NamedExec(q, &l); err != nil {
			err = fmt.Errorf("with loottable insert: %s", err.Error())
			return
		}
		var lastId int64

		if lastId, err = result.LastInsertId(); err != nil {
			err = fmt.Errorf("with loottable lastid insert: %s", err.Error())
			return
		}

		//now that lootable has changed, sync npc ids to use proper loot table ids
		for i := range npctypes {
			if npctypes[i].Loottable_id == int(l.Id.Int64) {
				npctypes[i].Loottable_id = int(lastId)
			}
		}

		for i := range loottableentries {
			if loottableentries[i].Loottable_id == int(l.Id.Int64) {
				loottableentries[i].Loottable_id = int(lastId)
			}
		}

		totalChanged++
	}

	if q, err = injector.PrepareInsertString(&loottableentries[0], "loottable_entries"); err != nil {
		return
	}

	for _, l := range loottableentries {
		if result, err = db.NamedExec(q, &l); err != nil {
			return
		}
		if _, err = result.LastInsertId(); err != nil {
			return
		}

		totalChanged++
	}
	fmt.Println("Inserted", totalChanged, "loot related entries")

	//GRID
	if q, err = injector.PrepareInsertString(&grids[0], "grid"); err != nil {
		return
	}
	//fmt.Println(q)
	totalChanged = 0
	for _, g := range grids {
		if _, err = db.NamedExec(q, &g); err != nil {
			return
		}
		totalChanged++
	}

	if q, err = injector.PrepareInsertString(&gridentries[0], "grid_entries"); err != nil {
		return
	}

	for _, g := range gridentries {
		if _, err = db.NamedExec(q, &g); err != nil {
			return
		}
		totalChanged++
	}
	fmt.Println("Inserted", totalChanged, "grid related entries")

	//NPCS
	if len(npctypes) < 1 {
		err = fmt.Errorf("invalid number of npcs to insert")
		return
	}
	if q, err = injector.PrepareInsertString(&npctypes[0], "npc_types"); err != nil {
		return
	}
	//fmt.Println(q)
	totalChanged = 0
	for _, npctype := range npctypes {
		if _, err = db.NamedExec(q, &npctype); err != nil {
			return
		}
		totalChanged++
	}
	fmt.Println("Inserted", totalChanged, "npcs")

	//SPAWNGROUP
	if len(spawngroups) < 1 {
		err = fmt.Errorf("invalid number of npcs to insert")
		return
	}
	if q, err = injector.PrepareInsertString(&spawngroups[0], "spawngroup"); err != nil {
		return
	}

	totalChanged = 0
	for _, sg := range spawngroups {
		sg.Id.Valid = false //disable spawngroup ids

		if result, err = db.NamedExec(q, &sg); err != nil {
			return
		}
		var lastId int64

		if lastId, err = result.LastInsertId(); err != nil {
			return
		}

		//Now that spawngroup has changed, affect other records that depend on spawngroupid.
		for i := range spawnentries {
			if spawnentries[i].Spawngroupid == int(sg.Id.Int64) {
				spawnentries[i].Spawngroupid = int(lastId)
			}
		}
		for i := range spawns {
			if spawns[i].Spawngroupid == int(sg.Id.Int64) {
				spawns[i].Spawngroupid = int(lastId)
			}
		}

		totalChanged++
	}

	if q, err = injector.PrepareInsertString(&spawns[0], "spawn2"); err != nil {
		return
	}
	for _, sg := range spawns {
		if _, err = db.NamedExec(q, &sg); err != nil {
			return
		}
		totalChanged++
	}

	if q, err = injector.PrepareInsertString(&spawnentries[0], "spawnentry"); err != nil {
		return
	}
	for _, sg := range spawnentries {
		if _, err = db.NamedExec(q, &sg); err != nil {
			return
		}
		totalChanged++
	}
	fmt.Println("Inserted", totalChanged, "spawn related entries")

	return
}
コード例 #17
0
ファイル: wipe.go プロジェクト: Xackery/eqcleanup
func DeleteCharacters() (totalRemoved int64, err error) {
	db, err := eqdb.Load()
	if err != nil {
		return
	}
	type dataStruct struct {
		tableName string
		fieldName string
		idStart   int64
	}

	tables := []dataStruct{
		{tableName: "account", fieldName: "id", idStart: 0},
		{tableName: "account_flags", fieldName: "p_accid", idStart: 0},
		{tableName: "account_ip", fieldName: "accid", idStart: 0},
		{tableName: "account_rewards", fieldName: "account_id", idStart: 0},
		{tableName: "adventure_details", fieldName: "id", idStart: 0},
		{tableName: "adventure_members", fieldName: "id", idStart: 0},
		{tableName: "adventure_stats", fieldName: "player_id", idStart: 0},
		{tableName: "buyer", fieldName: "charid", idStart: 0},
		{tableName: "char_recipe_list", fieldName: "char_id", idStart: 0},
		{tableName: "character_activities", fieldName: "charid", idStart: 0},
		{tableName: "character_alt_currency", fieldName: "char_id", idStart: 0},
		{tableName: "character_alternate_abilities", fieldName: "id", idStart: 0},
		{tableName: "character_backup", fieldName: "id", idStart: 0},
		{tableName: "character_bandolier", fieldName: "id", idStart: 0},
		{tableName: "character_bind", fieldName: "id", idStart: 0},
		{tableName: "character_buffs", fieldName: "character_id", idStart: 0},
		{tableName: "character_corpse_items", fieldName: "corpse_id", idStart: 0},
		{tableName: "character_corpses", fieldName: "id", idStart: 0},
		{tableName: "character_currency", fieldName: "id", idStart: 0},
		//dataStruct{tableName: "character_custom", fieldName: "id", idStart: 0},
		{tableName: "character_data", fieldName: "id", idStart: 0},
		{tableName: "character_disciplines", fieldName: "id", idStart: 0},
		{tableName: "character_enabledtasks", fieldName: "charid", idStart: 0},
		{tableName: "character_inspect_messages", fieldName: "id", idStart: 0},
		{tableName: "character_item_recast", fieldName: "id", idStart: 0},
		{tableName: "character_languages", fieldName: "id", idStart: 0},
		{tableName: "character_lookup", fieldName: "id", idStart: 0},
		{tableName: "character_material", fieldName: "id", idStart: 0},
		{tableName: "character_memmed_spells", fieldName: "id", idStart: 0},
		{tableName: "character_pet_buffs", fieldName: "char_id", idStart: 0},
		{tableName: "character_pet_info", fieldName: "char_id", idStart: 0},
		{tableName: "character_pet_inventory", fieldName: "char_id", idStart: 0},
		{tableName: "character_potionbelt", fieldName: "id", idStart: 0},
		{tableName: "character_skills", fieldName: "id", idStart: 0},
		{tableName: "character_spells", fieldName: "id", idStart: 0},
		{tableName: "character_tasks", fieldName: "charid", idStart: 0},
		{tableName: "character_tribute", fieldName: "id", idStart: 0},
		{tableName: "chatchannels", fieldName: "minstatus", idStart: -1},
		{tableName: "completed_tasks", fieldName: "charid", idStart: 0},
		{tableName: "discovered_items", fieldName: "item_id", idStart: 0},
		{tableName: "eventlog", fieldName: "id", idStart: 0},
		{tableName: "character_enabledtasks", fieldName: "charid", idStart: 0},
		{tableName: "faction_values", fieldName: "char_id", idStart: 0},
		{tableName: "friends", fieldName: "charid", idStart: 0},
		{tableName: "geq_character_currency", fieldName: "id", idStart: 0},
		{tableName: "character_enabledtasks", fieldName: "charid", idStart: 0},
		{tableName: "gm_ips", fieldName: "account_id", idStart: 0},
		{tableName: "group_id", fieldName: "groupid", idStart: 0},
		{tableName: "group_leaders", fieldName: "gid", idStart: 0},
		{tableName: "guild_bank", fieldName: "guildid", idStart: 0},
		{tableName: "guild_members", fieldName: "char_id", idStart: 0},
		{tableName: "guild_ranks", fieldName: "guild_id", idStart: 0},
		{tableName: "guild_relations", fieldName: "guild1", idStart: 0},
		{tableName: "guilds", fieldName: "id", idStart: 0},
		{tableName: "hackers", fieldName: "id", idStart: 0},
		{tableName: "character_enabledtasks", fieldName: "charid", idStart: 0},
		{tableName: "instance_list_player", fieldName: "id", idStart: 0},
		{tableName: "inventory", fieldName: "charid", idStart: 0},
		{tableName: "inventory_snapshots", fieldName: "charid", idStart: 0},
		{tableName: "keyring", fieldName: "char_id", idStart: 0},
		{tableName: "lfguild", fieldName: "type", idStart: -1},
		{tableName: "character_enabledtasks", fieldName: "charid", idStart: 0},
		{tableName: "mail", fieldName: "charid", idStart: 0},
		{tableName: "character_enabledtasks", fieldName: "charid", idStart: 0},
		{tableName: "petitions", fieldName: "dib", idStart: 0},
		{tableName: "player_titlesets", fieldName: "id", idStart: 0},
		{tableName: "qs_merchant_transaction_record", fieldName: "transaction_id", idStart: 0},
		{tableName: "qs_merchant_transaction_record_entries", fieldName: "event_id", idStart: 0},
		{tableName: "qs_player_aa_rate_hourly", fieldName: "char_id", idStart: 0},
		{tableName: "qs_player_delete_record", fieldName: "char_id", idStart: 0},
		{tableName: "qs_player_delete_record_entries", fieldName: "event_id", idStart: 0},
		{tableName: "qs_player_events", fieldName: "char_id", idStart: 0},
		{tableName: "qs_player_handin_record", fieldName: "handin_id", idStart: 0},
		{tableName: "qs_player_handin_record_entries", fieldName: "event_id", idStart: 0},
		{tableName: "qs_player_move_record", fieldName: "char_id", idStart: 0},
		{tableName: "qs_player_move_record_entries", fieldName: "event_id", idStart: 0},
		{tableName: "qs_player_move_record", fieldName: "char_id", idStart: 0},
		{tableName: "qs_player_npc_kill_record", fieldName: "fight_id", idStart: 0},
		{tableName: "qs_player_npc_kill_record_entries", fieldName: "char_id", idStart: 0},
		{tableName: "qs_player_speech", fieldName: "id", idStart: 0},
		{tableName: "qs_player_trade_record", fieldName: "trade_id", idStart: 0},
		{tableName: "qs_player_trade_record_entries", fieldName: "event_id", idStart: 0},
		{tableName: "quest_globals", fieldName: "charid", idStart: 0},
		{tableName: "raid_details", fieldName: "raidid", idStart: 0},
		{tableName: "raid_leaders", fieldName: "gid", idStart: 0},
		{tableName: "raid_members", fieldName: "raidid", idStart: 0},
		{tableName: "reports", fieldName: "id", idStart: 0},
		{tableName: "sharedbank", fieldName: "acctid", idStart: 0},
		{tableName: "timers", fieldName: "char_id", idStart: 0},
		{tableName: "trader", fieldName: "char_id", idStart: 0},
		{tableName: "trader_audit", fieldName: "quantity", idStart: 0},
		{tableName: "zone_flags", fieldName: "charid", idStart: 0},
	}

	var affect int64
	for _, table := range tables {
		affect, err = DeleteQuery(fmt.Sprintf("DELETE FROM %s WHERE %s > ?", table.tableName, table.fieldName), table.idStart, fmt.Sprintf("%s delete", table.tableName))
		if err != nil {
			fmt.Errorf("Error deleting %s: %s", table.tableName, err.Error())
			return
		}
		totalRemoved += affect

		_, err = db.Exec(fmt.Sprintf("ALTER TABLE %s AUTO_INCREMENT = 1", table.tableName))
		if err != nil {
			fmt.Errorf("Error resetting auto increment: %s", err.Error())
			return
		}
	}

	return
}
コード例 #18
0
ファイル: ldon.go プロジェクト: Xackery/eqcleanup
func Clean(args ...string) (err error) {
	db, err := eqdb.Load()
	if err != nil {
		return
	}
	config, err := eqconfig.Load()
	if err != nil {
		return
	}
	//Remove Adventure Merchants
	ids, err := spawngroup.GetSpawnGroupIdsByClass(db, 61)
	if err != nil {
		err = fmt.Errorf("Error getting %s Ids: %s", focus, err.Error())
		return
	}

	//Raid Recruiters
	rids := []int64{223, 222, 69987, 69988, 69989, 64252, 64440, 695, 6742, 6743, 983, 982, 67605, 67606, 67607, 50673, 50674, 68307, 4702, 4701, 4698}
	for _, id := range rids {
		ids = append(ids, id)
	}

	//Adventure Recruiters
	rids = []int64{219, 696, 979, 67608, 50677, 4695}
	for _, id := range rids {
		ids = append(ids, id)
	}

	//Teleporter (Magus)
	rids = []int64{38104, 70007, 6745, 216, 976, 46065, 39292, 39723, 67603, 54755, 4693}
	for _, id := range rids {
		ids = append(ids, id)
	}

	//Others
	rids = []int64{694, 6741, 6251, 224, 218, 225, 228}
	for _, id := range rids {
		ids = append(ids, id)
	}

	totalChanged, err := spawngroup.RemoveSpawnGroupAndEntryById(db, ids)
	if err != nil {
		err = fmt.Errorf("Error removing", focus, "entries: %s", err.Error())
		return
	}
	fmt.Println("Removed", totalChanged, " DB entries related to", focus, "in spawnentry and spawngroup successfully.")

	filePaths := []string{
		//Teleporter NPCs
		"abysmal/Magus_Pellen.lua",
		"butcher/Magus_Tira.lua",
		"commonlands/Magus_Zeir.pl",
		"ecommons/Magus_Zeir.lua",
		"everfrost/Magus_Delin.lua",
		"guildlobby/Magus_Alaria.lua",
		"natimbi/Magus_Releua.lua",
		"nedaria/Magus_Wenla.lua",
		"northro/Magus_Arindri.pl",
		"nro/Magus_Arindri.lua",
		"southro/Magus_Jerira.pl",
		"sro/Magus_Jerira.lua",

		//Mysterious Voices
		"akanon/player.lua",
		"cabeast/player.pl",
		"cabwest/player.pl",
		"corathus/player.pl",
		"crescent/player.pl",
		"erudnext/player.lua",
		"erudnint/player.lua",
		"felwithea/player.lua",
		"felwitheb/player.lua",
		"freeporteast/player.lua",
		"freeportwest/player.lua",
		"freporte/player.lua",
		"freportn/player.lua",
		"gfaydark/player.pl",
		//"global/global_player.lua",
		"grobb/player.lua",
		"halas/player.lua",
		"neriakb/player.pl",
		"neriakc/player.pl",
		"oggok/player.pl",
		"paineel/player.pl",
		"qey2hh1/player.lua",
		"qeynos/player.lua",
		"qeynos2/player.lua",
		"qrg/player.lua",
		"rathemtn/player.pl",
		"rivervale/player.lua",
		"sharvahl/player.pl",
	}

	delCount, err := quest.Remove(config, filePaths)
	if err != nil {
		fmt.Println(err.Error())
	}
	fmt.Println("Deleted", delCount, focus, "related quest files")
	fmt.Println("NOTICE: You still need to remove an entry in global/global_player.lua")
	return
}