PDA

View Full Version : Query to remove summoning


Slaymore
02-15-2016, 01:31 PM
HI,

I can not wrap my head around the query I need to remove just the 1,1^ from the special_abilities entries..

running this:

SELECT * FROM npc_types WHERE special_abilities like "1,1^%";

gets me 1702 entries .. i suppose I could manually remove the 1,1^ from the front of them all.. but hoping there is a sql command that can automate it ..

Uleat
02-15-2016, 03:31 PM
It's gonna be tricky...


SELECT `id`, REPLACE(`special_abilities`, '1,1^', '[DELETED]^') FROM `npc_types` WHERE `special_abilities` LIKE '1,1^%' UNION ALL
SELECT `id`, REPLACE(`special_abilities`, '1,1', '[DELETED]') FROM `npc_types` WHERE `special_abilities` LIKE '1,1'
ORDER BY `id`


Looking at `id` 21164, you can see a false hit.

That means that the criteria has to be perfect or you will corrupt your entries.


It can be done..but, it'll take a little more thought than I can put into it atm.

Uleat
02-15-2016, 04:32 PM
This looks like the right criteria:

SELECT `id`, CONCAT('[DELETED]^', (SUBSTR(`special_abilities`, 5))) FROM `npc_types` WHERE LEFT(`special_abilities`, 4) LIKE '1,1^' UNION ALL
SELECT `id`, REPLACE(`special_abilities`, '1,1', '[DELETED]') FROM `npc_types` WHERE `special_abilities` LIKE '1,1'
ORDER BY `id`


Haven't checked for '1,1' not being at the beginning, though.


EDIT: Adding..
SELECT `id`, `special_abilities` FROM `npc_types` WHERE `special_abilities` LIKE '%^1,1'
..didn't produce any additional results.

Slaymore
02-17-2016, 03:43 PM
Thank you very much. I think this will help others as well. When I was searching for information on this I ran across a few posts regarding changing special attacks.


Little side story.. After getting rid of summoning I just so happened to go to Qvic and hit some named to see how my tweaks were working out.

Iqthinxa_Karnkvi spawns 3 adds that have to be taken down within 10% hp of each other... Needless to say I had no idea what was happening when I was slaughtered over and over lol .. looking in the script I see that it sets special attacks like summoning and rampage and other special attacks that eat me lol.

So just fyi if you happen to make some changes to special attack and it doesnt seem to be working.. check the script!! lol