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

DB/Quest: Bring Em Back Alive dismounts players in intended quest area #20078

Closed
Foereaper opened this issue Jul 24, 2017 · 4 comments
Closed

Comments

@Foereaper
Copy link
Contributor

Foereaper commented Jul 24, 2017

Description:

Attached SQL fixes the issues related to this quest, see current behaviour.

Current behaviour:

Currently the Kodo vehicle dismounts the player even though the player is within the intended questing area.

Expected behaviour:

The Kodo should allow the players to be in the specific sub-zones around the questing area and not throw the player off.

Branch(es): both

TC rev. hash/commit: 21b03e7

TDB version: 335.63

Operating system: Windows

Suggested fix:

-- Fixes "Bring 'Em Back Alive" Borean quest
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=16 AND `SourceEntry`=25596 AND `ConditionTypeOrReference`=23 AND `ElseGroup` IN (0,1,2,3,4);
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(16, 0, 25596, 0, 0, 23, 0, 3537, 0, 0, 0, 0, 0, '','Bring Em Back Alive: Dismount when player outside of intended zone: Borean Tundra'),
(16, 0, 25596, 0, 1, 23, 0, 4144, 0, 0, 0, 0, 0, '','Bring Em Back Alive: Dismount when player outside of intended zone: Warsong Farms Outpost'),
(16, 0, 25596, 0, 2, 23, 0, 4143, 0, 0, 0, 0, 0, '','Bring Em Back Alive: Dismount when player outside of intended zone: Warsong Slaughterhouse'),
(16, 0, 25596, 0, 3, 23, 0, 4142, 0, 0, 0, 0, 0, '','Bring Em Back Alive: Dismount when player outside of intended zone: Warsong Grannary'),
(16, 0, 25596, 0, 4, 23, 0, 4141, 0, 0, 0, 0, 0, '','Bring Em Back Alive: Dismount when player outside of intended zone: Torps Farm');
@ghost
Copy link

ghost commented Jul 25, 2017

Thank you for posting again and in the right place,

I would also like to suggest a few improvements:

  • Use ```sql (or ~~~sql ) on top of your query for SQL syntax highlighting (cosmetic, but practical for reading the code in your post).
  • Always use DELETE FROM before any INSERT INTO commands are used in a query. This is needed to make new queries repeatable.
  • Always put back ticks ( ` ) around table names and column names in query commands (some column names can be SQL keywords).

Example:

DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=16 AND `SourceEntry`=25596 AND `ConditionTypeOrReference`=23 AND `ElseGroup` IN (1,2,3,4);
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES

I know many devs don't care much about the details in the comments, but you may want to include the area names in the comments,

Zone Name MapID AreaID
4141 Torp's Farm 571 3537
4142 Warsong Granary 571 3537
4143 Warsong Slaughterhouse 571 3537
4144 Warsong Farms Outpost 571 3537

because TDB 335.63 already contains a condition CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE (16) for creature_template.entry 25596 (Infected Kodo Beast) and CONDITION_AREAID (23) for AreaID 3537 (Borean Tundra):

SELECT * FROM `conditions` WHERE `SourceTypeOrReferenceId`=16 AND `SourceEntry`=25596;
SourceTypeOrReferenceId  SourceGroup  SourceEntry  SourceId  ElseGroup  ConditionTypeOrReference  ConditionTarget  ConditionValue1  ConditionValue2  ConditionValue3  NegativeCondition  ErrorType  ErrorTextId  ScriptName  Comment                                  
-----------------------  -----------  -----------  --------  ---------  ------------------------  ---------------  ---------------  ---------------  ---------------  -----------------  ---------  -----------  ----------  -----------------------------------------
                     16            0        25596         0          0                        23                0             3537                0                0                  0          0            0              Dismount player when not in intended zone

@Foereaper
Copy link
Contributor Author

Updated with suggestions :)

@ghost
Copy link

ghost commented Jul 25, 2017

Just a little F.Y.I. : an alternative to escape apostrophes (') with either double apostrophes ('') or backslash (\') in comment text is to use double quotation marks (" ") before and after the text when it contains contractions and "possessive form" like "Torp's Farm" to avoid breaking the comment delimiters. Example:

(16, 0, 25596, 0, 4, 23, 0, 4141, 0, 0, 0, 0, 0, '',"Bring 'Em Back Alive: Dismount when player outside of intended zone: Torp's Farm");

(this will also make it easier to use quest/item/NPC names containing apostrophes, like this quest "Bring 'Em Back Alive")

Also: unless there is more wrong data than correct data in an existing DB row, use UPDATE queries to fix the few bad data entries instead of replacing the entire row.

Example:

UPDATE `conditions` SET `Comment`= "Bring 'Em Back Alive: Dismount when player outside of intended zone: Borean Tundra"
 WHERE `SourceTypeOrReferenceId`=16 AND `SourceEntry`=25596 AND `ConditionTypeOrReference`=23 AND `ElseGroup`=0;

Lastly, if you will allow me to be nit-picky about the comment line on top, I would like to see more specific details:

--  Allow player to mount Infected Kodo Beast inside all the intended zones in Borean Tundra

@ghost ghost self-assigned this Jul 25, 2017
ghost pushed a commit that referenced this issue Jul 25, 2017
- Add conditions to allow player to stay mounted in the quest zones.
- Update comment text for existing condition, adding zone name.

By Foereaper
Closes issue #20078
@ghost
Copy link

ghost commented Jul 25, 2017

Closed in 734fab0 - @TrinityCoreBot is sleeping?

@ghost ghost closed this as completed Jul 25, 2017
Aokromes pushed a commit to Aokromes/TrinityCore that referenced this issue Jul 27, 2017
…n Tundra zones

- Add conditions to allow player to stay mounted in the quest zones.
- Update comment text for existing condition, adding zone name.

By Foereaper
Updates issue TrinityCore#20078
This issue was closed.
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

2 participants