Skip to content

Commit

Permalink
Fixed Child's Play Quests (#267)
Browse files Browse the repository at this point in the history
Child's Play quests were giving maulers studded armour they couldn't wear.

While there, I removed duplicate code and streamlined it a bit to skip unnecessary string comparisons.
  • Loading branch information
tegstewart authored Dec 3, 2020
1 parent 67ad316 commit 15c9674
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 99 deletions.
60 changes: 15 additions & 45 deletions GameServerScripts/quests/Albion/ChildsPlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1525,7 +1525,6 @@ protected static void TalkToCharles(DOLEvent e, object sender, EventArgs args)
if (quest == null)
{
Charles.SayTo(player, LanguageMgr.GetTranslation(player.Client, "ChildsPlay.TalkToCharles.Text1", player.CharacterClass.BaseName));

return;
}
if (quest.Step == 2)
Expand All @@ -1535,66 +1534,37 @@ protected static void TalkToCharles(DOLEvent e, object sender, EventArgs args)
//k109: Until I can get the quest dialog from live, I reward based on class, feel free to edit.
player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client, "ChildsPlay.TalkToCharles.Text3", questTitle), eChatType.CT_ScreenCenter, eChatLoc.CL_SystemWindow);

if (player.CharacterClass.BaseName == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerClass.Name.Fighter"))
if (player.CharacterClass.BaseName == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerClass.Name.AlbionRogue")
|| player.CharacterClass.BaseName == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerClass.Name.Acolyte")
|| player.CharacterClass.Name == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerClass.Name.Mauler_Alb"))
{
GiveItem(Charles, quest.m_questPlayer, daringleatherboots_alb);
GiveItem(Charles, quest.m_questPlayer, daringleathercap_alb);
GiveItem(Charles, quest.m_questPlayer, daringleathergloves_alb);
GiveItem(Charles, quest.m_questPlayer, daringleatherjerkin_alb);
GiveItem(Charles, quest.m_questPlayer, daringleatherleggings_alb);
GiveItem(Charles, quest.m_questPlayer, daringleathersleeves_alb);
}
else if (player.CharacterClass.BaseName == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerClass.Name.Fighter"))
{
GiveItem(Charles, quest.m_questPlayer, daringstuddedboots_alb);
GiveItem(Charles, quest.m_questPlayer, daringstuddedcap_alb);
GiveItem(Charles, quest.m_questPlayer, daringstuddedgloves_alb);
GiveItem(Charles, quest.m_questPlayer, daringstuddedjerkin_alb);
GiveItem(Charles, quest.m_questPlayer, daringstuddedleggings_alb);
GiveItem(Charles, quest.m_questPlayer, daringstuddedsleeves_alb);
quest.FinishQuest();
}
if (player.CharacterClass.BaseName == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerClass.Name.Mage"))
{
GiveItem(Charles, quest.m_questPlayer, daringpaddedboots_alb);
GiveItem(Charles, quest.m_questPlayer, daringpaddedcap_alb);
GiveItem(Charles, quest.m_questPlayer, daringpaddedgloves_alb);
GiveItem(Charles, quest.m_questPlayer, daringpaddedpants_alb);
GiveItem(Charles, quest.m_questPlayer, daringpaddedsleeves_alb);
GiveItem(Charles, quest.m_questPlayer, daringpaddedvest_alb);
quest.FinishQuest();
}
if (player.CharacterClass.BaseName == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerClass.Name.Disciple"))
{
GiveItem(Charles, quest.m_questPlayer, daringpaddedboots_alb);
GiveItem(Charles, quest.m_questPlayer, daringpaddedcap_alb);
GiveItem(Charles, quest.m_questPlayer, daringpaddedgloves_alb);
GiveItem(Charles, quest.m_questPlayer, daringpaddedpants_alb);
GiveItem(Charles, quest.m_questPlayer, daringpaddedsleeves_alb);
GiveItem(Charles, quest.m_questPlayer, daringpaddedvest_alb);
quest.FinishQuest();
}
if (player.CharacterClass.BaseName == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerClass.Name.Elementalist"))
else
{
GiveItem(Charles, quest.m_questPlayer, daringpaddedboots_alb);
GiveItem(Charles, quest.m_questPlayer, daringpaddedcap_alb);
GiveItem(Charles, quest.m_questPlayer, daringpaddedgloves_alb);
GiveItem(Charles, quest.m_questPlayer, daringpaddedpants_alb);
GiveItem(Charles, quest.m_questPlayer, daringpaddedsleeves_alb);
GiveItem(Charles, quest.m_questPlayer, daringpaddedvest_alb);
quest.FinishQuest();
}
if (player.CharacterClass.BaseName == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerClass.Name.AlbionRogue"))
{
GiveItem(Charles, quest.m_questPlayer, daringleatherboots_alb);
GiveItem(Charles, quest.m_questPlayer, daringleathercap_alb);
GiveItem(Charles, quest.m_questPlayer, daringleathergloves_alb);
GiveItem(Charles, quest.m_questPlayer, daringleatherjerkin_alb);
GiveItem(Charles, quest.m_questPlayer, daringleatherleggings_alb);
GiveItem(Charles, quest.m_questPlayer, daringleathersleeves_alb);
quest.FinishQuest();
}
if (player.CharacterClass.BaseName == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerClass.Name.Acolyte"))
{
GiveItem(Charles, quest.m_questPlayer, daringleatherboots_alb);
GiveItem(Charles, quest.m_questPlayer, daringleathercap_alb);
GiveItem(Charles, quest.m_questPlayer, daringleathergloves_alb);
GiveItem(Charles, quest.m_questPlayer, daringleatherjerkin_alb);
GiveItem(Charles, quest.m_questPlayer, daringleatherleggings_alb);
GiveItem(Charles, quest.m_questPlayer, daringleathersleeves_alb);
quest.FinishQuest();
}

quest.FinishQuest();
}
}
else if (e == GameLivingEvent.WhisperReceive)
Expand Down
50 changes: 16 additions & 34 deletions GameServerScripts/quests/Hibernia/ChildsPlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1532,56 +1532,38 @@ protected static void TalkToCharles(DOLEvent e, object sender, EventArgs args)

//k109: Until I can get the quest dialog from live, I reward based on class, feel free to edit.
player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client, "ChildsPlay.TalkToCharles.Text3", questTitle), eChatType.CT_ScreenCenter, eChatLoc.CL_SystemWindow);
if (player.CharacterClass.BaseName == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerClass.Name.Guardian"))

if (player.CharacterClass.BaseName == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerClass.Name.Stalker")
|| player.CharacterClass.BaseName == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerClass.Name.Naturalist")
|| player.CharacterClass.Name == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerClass.Name.Mauler_Hib"))
{
GiveItem(Charles, quest.m_questPlayer, daringleatherboots_hib);
GiveItem(Charles, quest.m_questPlayer, daringleathercap_hib);
GiveItem(Charles, quest.m_questPlayer, daringleathergloves_hib);
GiveItem(Charles, quest.m_questPlayer, daringleatherjerkin_hib);
GiveItem(Charles, quest.m_questPlayer, daringleatherleggings_hib);
GiveItem(Charles, quest.m_questPlayer, daringleathersleeves_hib);
}
else if (player.CharacterClass.BaseName == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerClass.Name.Guardian"))
{
GiveItem(Charles, quest.m_questPlayer, daringstuddedboots_hib);
GiveItem(Charles, quest.m_questPlayer, daringstuddedcap_hib);
GiveItem(Charles, quest.m_questPlayer, daringstuddedgloves_hib);
GiveItem(Charles, quest.m_questPlayer, daringstuddedjerkin_hib);
GiveItem(Charles, quest.m_questPlayer, daringstuddedleggings_hib);
GiveItem(Charles, quest.m_questPlayer, daringstuddedsleeves_hib);
quest.FinishQuest();
}
if (player.CharacterClass.BaseName == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerClass.Name.Magician"))
{
GiveItem(Charles, quest.m_questPlayer, daringpaddedboots_hib);
GiveItem(Charles, quest.m_questPlayer, daringpaddedcap_hib);
GiveItem(Charles, quest.m_questPlayer, daringpaddedgloves_hib);
GiveItem(Charles, quest.m_questPlayer, daringpaddedpants_hib);
GiveItem(Charles, quest.m_questPlayer, daringpaddedsleeves_hib);
GiveItem(Charles, quest.m_questPlayer, daringpaddedvest_hib);
quest.FinishQuest();
}
if (player.CharacterClass.BaseName == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerClass.Name.Forester"))
else
{
GiveItem(Charles, quest.m_questPlayer, daringpaddedboots_hib);
GiveItem(Charles, quest.m_questPlayer, daringpaddedcap_hib);
GiveItem(Charles, quest.m_questPlayer, daringpaddedgloves_hib);
GiveItem(Charles, quest.m_questPlayer, daringpaddedpants_hib);
GiveItem(Charles, quest.m_questPlayer, daringpaddedsleeves_hib);
GiveItem(Charles, quest.m_questPlayer, daringpaddedvest_hib);
quest.FinishQuest();
}
if (player.CharacterClass.BaseName == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerClass.Name.Stalker"))
{
GiveItem(Charles, quest.m_questPlayer, daringleatherboots_hib);
GiveItem(Charles, quest.m_questPlayer, daringleathercap_hib);
GiveItem(Charles, quest.m_questPlayer, daringleathergloves_hib);
GiveItem(Charles, quest.m_questPlayer, daringleatherjerkin_hib);
GiveItem(Charles, quest.m_questPlayer, daringleatherleggings_hib);
GiveItem(Charles, quest.m_questPlayer, daringleathersleeves_hib);
quest.FinishQuest();
}
if (player.CharacterClass.BaseName == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerClass.Name.Naturalist"))
{
GiveItem(Charles, quest.m_questPlayer, daringleatherboots_hib);
GiveItem(Charles, quest.m_questPlayer, daringleathercap_hib);
GiveItem(Charles, quest.m_questPlayer, daringleathergloves_hib);
GiveItem(Charles, quest.m_questPlayer, daringleatherjerkin_hib);
GiveItem(Charles, quest.m_questPlayer, daringleatherleggings_hib);
GiveItem(Charles, quest.m_questPlayer, daringleathersleeves_hib);
quest.FinishQuest();
}

quest.FinishQuest();
}
}
else if (e == GameLivingEvent.WhisperReceive)
Expand Down
34 changes: 14 additions & 20 deletions GameServerScripts/quests/Midgard/Childs_Play.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1538,7 +1538,18 @@ protected static void TalkToCharles(DOLEvent e, object sender, EventArgs args)
//k109: Until I can get the quest dialog from live, I reward based on class, feel free to edit.
player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client, "ChildsPlay.TalkToCharles.Text3", questTitle), eChatType.CT_ScreenCenter, eChatLoc.CL_SystemWindow);

if (player.CharacterClass.BaseName == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerClass.Name.Viking"))
if (player.CharacterClass.BaseName == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerClass.Name.MidgardRogue")
|| player.CharacterClass.BaseName == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerClass.Name.Seer")
|| player.CharacterClass.Name == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerClass.Name.Mauler_Mid"))
{
GiveItem(Charles, quest.m_questPlayer, daringleatherboots);
GiveItem(Charles, quest.m_questPlayer, daringleathercap);
GiveItem(Charles, quest.m_questPlayer, daringleathergloves);
GiveItem(Charles, quest.m_questPlayer, daringleatherjerkin);
GiveItem(Charles, quest.m_questPlayer, daringleatherleggings);
GiveItem(Charles, quest.m_questPlayer, daringleathersleeves);
}
else if (player.CharacterClass.BaseName == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerClass.Name.Viking"))
{
GiveItem(Charles, quest.m_questPlayer, daringstuddedboots);
GiveItem(Charles, quest.m_questPlayer, daringstuddedcap);
Expand All @@ -1547,7 +1558,7 @@ protected static void TalkToCharles(DOLEvent e, object sender, EventArgs args)
GiveItem(Charles, quest.m_questPlayer, daringstuddedleggings);
GiveItem(Charles, quest.m_questPlayer, daringstuddedsleeves);
}
if (player.CharacterClass.BaseName == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerClass.Name.Mystic"))
else
{
GiveItem(Charles, quest.m_questPlayer, daringpaddedboots);
GiveItem(Charles, quest.m_questPlayer, daringpaddedcap);
Expand All @@ -1556,24 +1567,7 @@ protected static void TalkToCharles(DOLEvent e, object sender, EventArgs args)
GiveItem(Charles, quest.m_questPlayer, daringpaddedsleeves);
GiveItem(Charles, quest.m_questPlayer, daringpaddedvest);
}
if (player.CharacterClass.BaseName == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerClass.Name.MidgardRogue"))
{
GiveItem(Charles, quest.m_questPlayer, daringleatherboots);
GiveItem(Charles, quest.m_questPlayer, daringleathercap);
GiveItem(Charles, quest.m_questPlayer, daringleathergloves);
GiveItem(Charles, quest.m_questPlayer, daringleatherjerkin);
GiveItem(Charles, quest.m_questPlayer, daringleatherleggings);
GiveItem(Charles, quest.m_questPlayer, daringleathersleeves);
}
if (player.CharacterClass.BaseName == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerClass.Name.Seer"))
{
GiveItem(Charles, quest.m_questPlayer, daringleatherboots);
GiveItem(Charles, quest.m_questPlayer, daringleathercap);
GiveItem(Charles, quest.m_questPlayer, daringleathergloves);
GiveItem(Charles, quest.m_questPlayer, daringleatherjerkin);
GiveItem(Charles, quest.m_questPlayer, daringleatherleggings);
GiveItem(Charles, quest.m_questPlayer, daringleathersleeves);
}

quest.FinishQuest();
}
}
Expand Down

0 comments on commit 15c9674

Please sign in to comment.