Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.3.5] Sunstrider guardian aren't attacking alliance player #14744

Closed
ikir83 opened this issue May 22, 2015 · 12 comments
Closed

[3.3.5] Sunstrider guardian aren't attacking alliance player #14744

ikir83 opened this issue May 22, 2015 · 12 comments

Comments

@ikir83
Copy link

ikir83 commented May 22, 2015

Sunstrider guardian aren't attacking alliance player

schermata 2015-05-22 alle 22 40 30

tried at sun strider isle bridge. manny npc there aren't attacking me. Instead Silvermoon guards seem ok.

for example this npc ranger sirloin aren't attacking neither
http://www.wowhead.com/npc=15940/ranger-selron

DB 335.58
rev 0148832 2015-05-21

@Rushor
Copy link
Contributor

Rushor commented May 22, 2015

at least on official server, they are attacking you

@Rushor
Copy link
Contributor

Rushor commented May 22, 2015

UPDATE `creature_template` SET `unit_flags`=4096 WHERE  `entry`=15371;

it will fix your issue, but normally we will never change these fields

@Kittnz
Copy link
Contributor

Kittnz commented May 23, 2015

According to sniffs unit_flags is 512 and unit_flags2 2048

@ikir83
Copy link
Author

ikir83 commented May 23, 2015

Ok i will query on my DB to fix this, but why not fix this on your releases?

PS: my DB is brand new, erased everything yesterday

@Aokromes
Copy link
Member

because that query is hack (incorrect fix)

@msoky
Copy link
Contributor

msoky commented May 23, 2015

why theese npcs have mana=2 ??

@ikir83
Copy link
Author

ikir83 commented May 27, 2015

Many NPC there are still acting weird. For example Evensong Ranger aren't attacking me but i appear in combat and they are staring at me lol. Sun strider guardian still aren't attacking me.

@ikir83
Copy link
Author

ikir83 commented May 27, 2015

schermata 2015-05-27 alle 14 35 16

@Killyana
Copy link
Contributor

Unit_flags updated from sniffs, but the flag UNIT_FLAG_IMMUNE_TO_NPC (512) makes npcs react def, this must be fixed in the core.

UPDATE `smart_scripts` SET `action_param1`=1, `comment`='Eversong Ranger - Out of Combat - Enable Combat Movement' WHERE `entryorguid`=15938 AND `source_type`=0 AND `id`=0;
UPDATE `smart_scripts` SET `action_param1`=1, `comment`='Eversong Ranger - Out of Combat - Start Attacking' WHERE `entryorguid`=15938 AND `source_type`=0 AND `id`=1;
UPDATE `creature_template` SET `AIName`='SmartAI', `unit_flags`=512, `flags_extra`=0 WHERE `entry`=15940;
DELETE FROM `smart_scripts` WHERE `entryorguid`=15940 AND `source_type`=0;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(15940,0,0,0,0,0,100,0,2000,3000,4000,5000,11,20811,0,0,0,0,0,2,0,0,0,0,0,0,0,'ranger selron - IC - Cast fire ball');
UPDATE `creature_template` SET  `unit_flags`=512 WHERE `entry`=15371;

@ghost
Copy link

ghost commented May 28, 2015

I just tested @joschiwald's theory in https://github.com/TrinityCore/TrinityCore/pull/14780/files#r31157384

diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index 7f00fc7..f7e32a2 100644
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -1370,9 +1370,6 @@ bool Creature::CanStartAttack(Unit const* who, bool force) const
     if (IsCivilian())
         return false;

-    if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC))
-        return false;
-
     // Do not attack non-combat pets
     if (who->GetTypeId() == TYPEID_UNIT && who->GetCreatureType() == CREATURE_TYPE_NON_COMBAT_PET)
         return false;

After making this change in my 3.3.5 source, the [Sunstrider Guardians] reacted and attacked my nightelf hunter, but stopped attacking when I switched GM ON again. .gm on did not work for the hunter's pet, though. Not sure what stopped working there.

@ikir83 : notice that [Ranger Selron] is neither a guard nor has got the PvP flag on, so he will never attack a player (unless attacked first). Any NPC without the PvP flag will normally not attack a player of the opposite faction, unless the player attacks the NPC first.

Edit: TrinityCore rev. 43ae872 2015-05-27 15:04:05 +0200 (3.3.5 branch) (Win64, Release)
Confirming this issue to be present on this commit, my modified source is based on this version.

@ghost
Copy link

ghost commented May 28, 2015

@ikir83 : I just checked with @mik1893 and he has changed his PR to look like the suggestion above from @joschiwald, so your issue will be solved as soon as PR #14780 is merged (soon™).

@Carbenium
Copy link
Contributor

e748415

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants