Small changes to GameHastener

A place to submit .patch fixes for the DOL SVN

Moderator: Developer Team

Small changes to GameHastener

Postby Yay » Sun Jul 26, 2015 7:33 pm

Hello,

I made a small change to Hastener. The reason of my change was the difference to Live where you just need to click NPC and it gives out speed, just like the RvR version. I also made the text translatable in the process and cleaned up the code a bit. The translation file "GameHastener.txt" belongs in "<trunk>/GameServer/language/EN/GameObjects/CustomNPC/".

Kind Regards,

YaY
Attachments
Hastener.cs.patch
updated
(3.98 KiB) Downloaded 22 times
GameHastener.txt
belongs in <trunk>/GameServer/language/EN/GameObjects/CustomNPC/
(493 Bytes) Downloaded 23 times
Last edited by Yay on Mon Jul 27, 2015 12:30 pm, edited 1 time in total.
User avatar
Yay
Contributor
 
Posts: 174
Joined: Mon May 21, 2012 9:06 pm

Re: Small changes to GameHastener

Postby Graveen » Sun Jul 26, 2015 8:04 pm

Very good. Can you commit this patch ? For such a change, there are no problem in doing this.

If you can't commit, can you PM me your SF account name ?

/salute !
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: Small changes to GameHastener

Postby Leodagan » Mon Jul 27, 2015 7:24 am

Hello, for small comments :

at the beginning "if(base.Interact(player))" changed to "else if(base.Interact(player))" is not great for readability, and it's mandatory...

Filtering method execution conditions with "if (notOk) return;" is pretty much understandable and effective in compilation ;)

Your change offer "borderkeep" teleport to every player ? even if they are over their tenth season ?

And the Hastener won't talk anymore in most of the world ? (not even some greetings :cry: )

Appart from that it's much cleaner than before :)
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: Small changes to GameHastener

Postby Yay » Mon Jul 27, 2015 12:27 pm

Thank you for your the remarks.
at the beginning "if(base.Interact(player))" changed to "else if(base.Interact(player))" is not great for readability, and it's mandatory...
I changed it to:
Code: Select all
if (player == null || player.InCombat) return false; if (!base.Interact(player)) return false; else { <actions after requirements are met> return true; }
Your change offer "borderkeep" teleport to every player ? even if they are over their tenth season ?
That's livelike. They are offered to all players, but you can't port with level 11+ (here handled in WhisperReceive)
And the Hastener won't talk anymore in most of the world ? (not even some greetings :cry: )
That was intended, but yeah it turned out to be wrong ;D. I changed that, so that you get the movement offer and greeting in non-RvR zones.

Edit: Just saw that the beginning text is slightly different in different zones. I will adjust that as well, but not in the attachments if there are no severe errors.
User avatar
Yay
Contributor
 
Posts: 174
Joined: Mon May 21, 2012 9:06 pm

Re: Small changes to GameHastener

Postby Leodagan » Mon Jul 27, 2015 12:42 pm

Thank you for your the remarks.
at the beginning "if(base.Interact(player))" changed to "else if(base.Interact(player))" is not great for readability, and it's mandatory...
I changed it to:
Code: Select all
if (player == null || player.InCombat) return false; if (!base.Interact(player)) return false; else { <actions after requirements are met> return true; }
That's the same for me :)

I was thinking something more like this :
Code: Select all
if (player == null || player.InCombat) // <--- filter return false; // <--- exit if (!base.Interact(player)) // <--- filter return false; // <--- exit // <--- no "else" needed the method is exited anyway if filter condition is met <actions after requirements are met> return true; // <--- Now this case can act as "default" return value
Your change offer "borderkeep" teleport to every player ? even if they are over their tenth season ?
That's livelike. They are offered to all players, but you can't port with level 11+ (here handled in WhisperReceive)
That's ok for me ;)
And the Hastener won't talk anymore in most of the world ? (not even some greetings :cry: )
That was intended, but yeah it turned out to be wrong ;D. I changed that, so that you get the movement offer and greeting in non-RvR zones.
Great, that makes NPC more "alive" :)
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon


Return to “%s” DOL Code Contributions

Who is online

Users browsing this forum: No registered users and 1 guest