Page 1 of 1

Small changes to GameHastener

PostPosted: Sun Jul 26, 2015 7:33 pm
by Yay
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

Re: Small changes to GameHastener

PostPosted: Sun Jul 26, 2015 8:04 pm
by Graveen
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 !

Re: Small changes to GameHastener

PostPosted: Mon Jul 27, 2015 7:24 am
by Leodagan
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 :)

Re: Small changes to GameHastener

PostPosted: Mon Jul 27, 2015 12:27 pm
by Yay
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.

Re: Small changes to GameHastener

PostPosted: Mon Jul 27, 2015 12:42 pm
by Leodagan
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" :)