string translation = LanguageMgr.GetTranslation(player.Client, eTranslationKey.SystemText, "(Region) You have entered {sourcearea}");
translation = translation.Replace("{sourcearea}", LanguageMgr.GetTranslation(player.Client, eTranslationKey.AreaName, Description));
player.Out.SendMessage(translation, eChatType.CT_System, eChatLoc.CL_SystemWindow);
//Changed by Apo 9. August 2010: Areas never send an screen description, but we will support it with an server property
if (ServerProperties.Properties.DISPLAY_AREA_ENTER_SCREEN_DESC)
{
translation = LanguageMgr.GetTranslation(player.Client, eTranslationKey.AreaScreen, Description);
player.Out.SendMessage(translation, eChatType.CT_ScreenCenterSmaller, eChatLoc.CL_SystemWindow);
}
/// <summary>
/// The special column text. This column is used to differentiate between two or more objects.
/// For players we have 2 titles: Male and Female. For this, the special column is used to select the correct gender.
/// </summary>
[DataElement(AllowDbNull = false)]
public string SpecialColumn
{
get { return m_specialColumnText; }
set
{
Dirty = true;
m_specialColumnText = value;
}
}
/// <summary>
/// Pronoun of this player in case you need to refer it in 3rd person
/// http://webster.commnet.edu/grammar/cases.htm
/// </summary>
/// <param name="firstLetterUppercase"></param>
/// <param name="form">0=Subjective, 1=Possessive, 2=Objective</param>
/// <returns>pronoun of this object</returns>
public override string GetPronoun(int form, bool firstLetterUppercase)
{
if (DBCharacter.Gender == 0) // male
switch (form)
{
default:
// Subjective
if (firstLetterUppercase)
return "He";
else
return "he";
case 1:
// Possessive
if (firstLetterUppercase)
return "His";
else
return "his";
case 2:
// Objective
if (firstLetterUppercase)
return "Him";
else
return "him";
}
else
// female
switch (form)
{
default:
// Subjective
if (firstLetterUppercase)
return "She";
else
return "she";
case 1:
// Possessive
if (firstLetterUppercase)
return "Her";
else
return "her";
case 2:
// Objective
if (firstLetterUppercase)
return "Her";
else
return "her";
}
}
public string GetPronoun(GameClient Client, int form, bool capitalize)
{
if (DBCharacter.Gender == 0)
switch (form)
{
default:
return Capitalize(capitalize, LanguageMgr.GetTranslation(Client, eTranslationKey.SystemText, "he", "PronounMaleSubjective" /*Hold it unique in database*/));
case 1:
return Capitalize(capitalize, LanguageMgr.GetTranslation(Client, eTranslationKey.SystemText, "his", "PronounMalePossessive" /*Hold it unique in database*/));
case 2:
return Capitalize(capitalize, LanguageMgr.GetTranslation(Client, eTranslationKey.SystemText, "him", "PronounMaleObjective" /*Hold it unique in database*/));
}
else
switch (form)
{
default:
return Capitalize(capitalize, LanguageMgr.GetTranslation(Client, eTranslationKey.SystemText, "she", "PronounFemaleSubjective" /*Hold it unique in database*/));
case 1:
return Capitalize(capitalize, LanguageMgr.GetTranslation(Client, eTranslationKey.SystemText, "her", "PronounFemalePossessive" /*Hold it unique in database*/));
case 2:
return Capitalize(capitalize, LanguageMgr.GetTranslation(Client, eTranslationKey.SystemText, "her", "PronounFemaleObjective" /*Hold it unique in database*/));
}
}
string modmessage = "";
if (ad.Modifier > 0) modmessage = " (+" + ad.Modifier + ")";
if (ad.Modifier < 0) modmessage = " (" + ad.Modifier + ")";
string hitWeapon = LanguageMgr.GetTranslation(Client, eTranslationKey.ItemName, weapon.Name, "");
if (hitWeapon.Length > 0)
hitWeapon = LanguageMgr.GetTranslation(Client, eTranslationKey.SystemText, "with your", "AttackTypeWithYour" /*Hold it unique in database*/) + " " + hitWeapon;
string attackTypeMsg = LanguageMgr.GetTranslation(Client, eTranslationKey.SystemText, "You attack", "AttackTypeYouAttack"); //Hold it unique in database
if (ActiveWeaponSlot == eActiveWeaponSlot.Distance)
attackTypeMsg = LanguageMgr.GetTranslation(Client, eTranslationKey.SystemText, "You shot", "AttackTypeYouShot"); //Hold it unique in database
// intercept messages
if (target != null && target != ad.Target)
{
translation = LanguageMgr.GetTranslation(Client, eTranslationKey.SystemText, "{sourcename} steps in front of {sourcetarget} and takes the blow!", "");
if (ad.Target is GamePlayer)
translation = translation.Replace("{sourcename}", ad.Target.Name);
else
translation = translation.Replace("{sourcename}", ad.Target.GetName(0, true));
if (target is GamePlayer)
translation = translation.Replace("{sourcetarget}", ad.Target.Name);
else
translation = translation.Replace("{sourcetarget}", target.GetName(0, false));
Out.SendMessage(translation, eChatType.CT_YouHit, eChatLoc.CL_SystemWindow);
translation = LanguageMgr.GetTranslation(Client, eTranslationKey.SystemText, "{sourcetype} {sourcename} {sourceitem} but hit {sourcetarget} for {damagetaken}{extradamage} damage!", "");
translation = translation.Replace("{sourcetype}", attackTypeMsg);
if (target is GamePlayer)
translation = translation.Replace("{sourcename}", target.Name);
else
translation = translation.Replace("{sourcename}", target.GetName(0, false));
translation = translation.Replace("{sourceitem}", hitWeapon);
if(ad.Target is GamePlayer)
translation = translation.Replace("{sourcename}", ad.Target.Name);
else
translation = translation.Replace("{sourcename}", ad.Target.GetName(0, false));
translation = translation.Replace("{damagetaken}", ad.Damage.ToString()).Replace("{extradamage}", modmessage);
Out.SendMessage(translation, eChatType.CT_YouHit, eChatLoc.CL_SystemWindow);
}
else
{
translation = LanguageMgr.GetTranslation(Client, eTranslationKey.SystemText, "{sourcetype} {sourcetarget} {sourceitem} and hit for {damagetaken}{extradamage} damage!", "");
translation = translation.Replace("{sourcetype}", attackTypeMsg);
if (ad.Target is GamePlayer)
translation = translation.Replace("{sourcetarget}", ad.Target.Name);
else
translation = translation.Replace("{sourcetarget}", ad.Target.GetName(0, false));
translation = translation.Replace("{sourceitem}", hitWeapon).Replace("{damagetaken}", ad.Damage.ToString()).Replace("{extradamage}", modmessage);
Out.SendMessage(translation, eChatType.CT_YouHit, eChatLoc.CL_SystemWindow);
}
foreach(GamePlayer plr in this.GetPlayersInRadius(WorldMgr.INFO_DISTANCE))
{
translation = LanguageMgr.GetTranslation(plr.Client, eTranslationKey.SystemText, "{sourcename} just died. {sourcepronoun} corpse lies on the ground.", "");
translation = translation.Replace("{sourcename}", Name);
string tmp = translation;
if(tmp.Trim().IndexOf("{sourcepronoun}") == 0 || tmp.Trim().IndexOf('.') == tmp.Trim().IndexOf("{sourcepronoun") - 1)
translation = translation.Replace("{sourcepronoun}", GetPronoun(plr.Client, 1, true));
else
translation = translation.Replace("{sourcepronoun}", GetPronoun(plr.Client, 1, false));
plr.Out.SendMessage(translation, eChatType.CT_System, eChatLoc.CL_SystemWindow);
}
Return to “%s” DOL Code Contributions
Users browsing this forum: No registered users and 1 guest