Add string problem[solved]

For any problems with Dawn of Light website or game server, please direct questions and problems here.

Moderator: Support Team

Add string problem[solved]

Postby elcotek » Thu May 11, 2017 3:03 pm

Hello,

I need to add the "%" string to another value too.

Here is the unchanged code:
Code: Select all
list.Add(string.Format( "- {0}: {1}{2}", SkillBase.GetPropertyName((eProperty)bonusCat, client.Account.Language), bonusValue.ToString("+0 ;-0 ;0 "), //Eden ((bonusCat == (int)eProperty.PowerPool) || (bonusCat >= (int)eProperty.Resist_First && bonusCat <= (int)eProperty.Resist_Last) || (bonusCat >= (int)eProperty.ResCapBonus_First && bonusCat <= (int)eProperty.ResCapBonus_Last) || bonusCat == (int)eProperty.Conversion || bonusCat == (int)eProperty.ExtraHP || bonusCat == (int)eProperty.RealmPoints || bonusCat == (int)eProperty.StyleAbsorb || bonusCat == (int)eProperty.ArcaneSyphon || bonusCat == (int)eProperty.BountyPoints || bonusCat == (int)eProperty.XpPoints) ? ((bonusCat == (int)eProperty.PowerPool) ? LanguageMgr.GetTranslation(client.Account.Language, "DetailDisplayHandler.WriteBonusLine.PowerPool") : "%") : LanguageMgr.GetTranslation(client.Account.Language, "DetailDisplayHandler.WriteBonusLine.Points") ));


I need to add this but as, any idea ?:
Code: Select all
? ((bonusCat == (int)eProperty.PowerPoolCapBonus) ? LanguageMgr.GetTranslation(client.Account.Language, "DetailDisplayHandler.WriteBonusLine.PowerPoolCapBonus") : "%") //new to exchange string for PowerPoolCapBonus : LanguageMgr.GetTranslation(client.Account.Language, "DetailDisplayHandler.WriteBonusLine.Points")
I have trying this:

list.Add(string.Format(
"- {0}: {1}{2}",
SkillBase.GetPropertyName((eProperty)bonusCat, client.Account.Language),
bonusValue.ToString("+0 ;-0 ;0 "), //Eden
((bonusCat == (int)eProperty.PowerPool)
|| (bonusCat == (int)eProperty.PowerPoolCapBonus) //new to exchange PowerPoolCap string
|| (bonusCat >= (int)eProperty.Resist_First && bonusCat <= (int)eProperty.Resist_Last)
|| (bonusCat >= (int)eProperty.ResCapBonus_First && bonusCat <= (int)eProperty.ResCapBonus_Last)
|| bonusCat == (int)eProperty.Conversion
|| bonusCat == (int)eProperty.ExtraHP
|| bonusCat == (int)eProperty.RealmPoints
|| bonusCat == (int)eProperty.StyleAbsorb
|| bonusCat == (int)eProperty.ArcaneSyphon
|| bonusCat == (int)eProperty.BountyPoints
|| bonusCat == (int)eProperty.XpPoints)

? ((bonusCat == (int)eProperty.PowerPoolCapBonus) ? LanguageMgr.GetTranslation(client.Account.Language, "DetailDisplayHandler.WriteBonusLine.PowerPoolCapBonus") : "%") //new to exchange string for PowerPoolCapBonus
: LanguageMgr.GetTranslation(client.Account.Language, "DetailDisplayHandler.WriteBonusLine.Points")

? ((bonusCat == (int)eProperty.PowerPool) ? LanguageMgr.GetTranslation(client.Account.Language, "DetailDisplayHandler.WriteBonusLine.PowerPool") : "%")
: LanguageMgr.GetTranslation(client.Account.Language, "DetailDisplayHandler.WriteBonusLine.Points")
));[/code]

but dont work, so i need a little help here:)



I need to select this for PowerCaps to add a string at the end like this: "%" :
Code: Select all
? ((bonusCat == (int)eProperty.PowerPoolCapBonus) ? LanguageMgr.GetTranslation(client.Account.Language, "DetailDisplayHandler.WriteBonusLine.PowerPoolCapBonus") : "%") //new to exchange string for PowerPoolCapBonus : LanguageMgr.GetTranslation(client.Account.Language, "DetailDisplayHandler.WriteBonusLine.Points")
Thank you
Last edited by elcotek on Wed Jun 14, 2017 5:32 am, edited 1 time in total.
Brotherland Final RvR/PvE/ToA http://brotherland.phpbb8.de/
User avatar
elcotek
Server Representative
 
Posts: 177
Joined: Mon May 12, 2008 9:28 pm
Website: http://brotherland-2.de
Location: Germany

Re: Add string problem

Postby PlanarChaosRvrtwo » Thu May 11, 2017 4:54 pm

ahm from code:
PowerPoolCapBonus = 211,
is the item mbonus
the % value is not needed couse it add bonus to powerpool and power but on otherhand its an delve thing in package libs couse for % you could change value to -value to make it % so pretty sure if you want change to % delve you need change package libs
DOL dint only gaved me the data to start my server,
it also gaved me 16 amazing years with nice peeps,
and now its on me to return the favor.
User avatar
PlanarChaosRvrtwo
Database Team
 
Posts: 517
Joined: Thu Jul 07, 2016 6:21 am

Re: Add string problem

Postby PlanarChaosRvrtwo » Thu May 11, 2017 4:56 pm

And small thing if you want add proper delves you need change celerity and haste values melee damage style damage cast speed and magic damage delve in item stats
DOL dint only gaved me the data to start my server,
it also gaved me 16 amazing years with nice peeps,
and now its on me to return the favor.
User avatar
PlanarChaosRvrtwo
Database Team
 
Posts: 517
Joined: Thu Jul 07, 2016 6:21 am

Re: Add string problem

Postby PlanarChaosRvrtwo » Thu May 11, 2017 4:58 pm

Anyhow i cant help more need sleep
DOL dint only gaved me the data to start my server,
it also gaved me 16 amazing years with nice peeps,
and now its on me to return the favor.
User avatar
PlanarChaosRvrtwo
Database Team
 
Posts: 517
Joined: Thu Jul 07, 2016 6:21 am

Re: Add string problem

Postby elcotek » Thu May 11, 2017 8:44 pm

On the top is only an example,but your answer is ouside of my question was:)

Thanks :wink:
Brotherland Final RvR/PvE/ToA http://brotherland.phpbb8.de/
User avatar
elcotek
Server Representative
 
Posts: 177
Joined: Mon May 12, 2008 9:28 pm
Website: http://brotherland-2.de
Location: Germany

Re: Add string problem

Postby Sharp » Fri May 12, 2017 7:31 am

Hey,
Not sure if i understand you correctly, but if you need add string message I do like this way:
Code: Select all
string message1 = "Your string message to display"; message1 = "[Broadcast] " + message1 + "";
Regards
User avatar
Sharp
DOL Initiate
 
Posts: 17
Joined: Tue Sep 20, 2016 8:33 am

Re: Add string problem

Postby Graveen » Fri May 12, 2017 9:15 am

in c#:

condition? do_this_if_true:do_that_if_false;

example:
Code: Select all
string name="toto"; bool isItToto; name=="toto"?isItToto=true:isItToto=false;
In the above code there are multiples operations done, but the important part is you need to supply 3 arguments (string.format [0],[1], [2] means you are waiting 3 inputs which are):
* bonus designation( SkillBase.GetPropertyName((eProperty)bonusCat, client.Account.Language) )
* value ( bonusValue.ToString("+0 ;-0 ;0 ") )
* bonus name (all the remaining)

and of course Bonus Name is issuing a single Bonus Name through tests structured as my 1st example:

a) check if the bonuscat match one of theses - REMEMBER: this 'll end up in a true or false check, simply.
Code: Select all
(bonusCat == (int)eProperty.PowerPool) || (bonusCat >= (int)eProperty.Resist_First && bonusCat <= (int)eProperty.Resist_Last) || (bonusCat >= (int)eProperty.ResCapBonus_First && bonusCat <= (int)eProperty.ResCapBonus_Last) || bonusCat == (int)eProperty.Conversion || bonusCat == (int)eProperty.ExtraHP || bonusCat == (int)eProperty.RealmPoints || bonusCat == (int)eProperty.StyleAbsorb || bonusCat == (int)eProperty.ArcaneSyphon || bonusCat == (int)eProperty.BountyPoints || bonusCat == (int)eProperty.XpPoints)
b) do this if ok
LanguageMgr.GetTranslation(client.Account.Language, "DetailDisplayHandler.WriteBonusLine.PowerPool") : "%")

c) do that if not
LanguageMgr.GetTranslation(client.Account.Language, "DetailDisplayHandler.WriteBonusLine.Points")

So basically you just need to insert an
Code: Select all
|| bonusCat == (int)eProperty.PowerPoolCapBonus
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: Add string problem

Postby elcotek » Sat May 13, 2017 9:26 pm

Ah good ok, i try this:)


Tanks :wink:
Brotherland Final RvR/PvE/ToA http://brotherland.phpbb8.de/
User avatar
elcotek
Server Representative
 
Posts: 177
Joined: Mon May 12, 2008 9:28 pm
Website: http://brotherland-2.de
Location: Germany


Return to “%s” Support

Who is online

Users browsing this forum: No registered users and 1 guest