Forum Replies Created
-
AuthorPosts
-
Coder J
MemberInconceivable!
Coder J
Member….
that em class=”bbcode-em” crud should be…. [ i ]Stupid me trying to use a variable the corresponds to the tag emphasis. Ugh. I’m going to bed now (and evidently I reached the limit for edits… maybe PK can fix this?)
-
This reply was modified 13 years ago by
Coder J. Reason: BED, not be.... argh! Good night,
Coder J
MemberThere are client mods that do this, along with client/server combination mods.
Enchanting in SMP is handled almost exclusively by the server, however. The server does not actually assign an enchantment until after the experience cost has been paid by the player. That means until that cost is paid, it is possible with the Bukkit API to change the level costs for enchantments.
—-
Code (going to look bad because I hate code tags….)
(Keep in mind I’m tired, there’s bound to be an error in here)
—-
[sourcecode language=”java”]
public void PreppyEnchanter(PrepareItemEnchantEvent event){
int MaxLevel = event.player.getLevel();
Random r = new Random();for(int x=0; x MaxLevel; x++){
if(event.getExpLevelCostOffered()[x] > MaxLevel){
event.getExpLevelCostsOffered()[x] = r.nextInt(MaxLevel) + 1;
}
}
}
[/sourcecode]This code checks all 3 indexes of getExpLevelCostsOffered, and if that’s greater than MaxLevel, rolls a new number between 1 and MaxLevel (nextInt actually rolls between 0 and MaxLevel-1, hence the +1)
-
This reply was modified 13 years ago by
Coder J. Reason: somehow left out the if statement
-
This reply was modified 13 years ago by
Coder J. Reason: okay... lost the if and part of for.... strange
-
This reply was modified 13 years ago by
Coder J.
-
This reply was modified 13 years ago by
PseudoKnight. Reason: shouldn't be parsing shortcode in code tags =(
Coder J
MemberWell, if we made it more like the fictional Hunger Games, we can eliminate hide-n-pray strategies with random (moderator/admin triggered) events that would render such a strategy akin of lying down and dying on one’s own. Such as…
Player A finds a jungle tree they can climb pretty far up; they punch a hole in the side and cover it back up with the logs to hide. The admin/mods sweep, find this person has pretty much turtled up, set fire to the tree and surrounding trees to provoke action such as forcing the player towards others.
Player B digs a hole 5 blocks deep, covers the top up with 3 dirt. Admin/mods sweep, find the person has made their own tomb, spawn a small volcano there with minimal warning. Alternatively, earthquake occurs that opens up a passage… with monsters inside.
As for the center-deathtrap… that’s intentional, I suppose. No guts, no glory… someone has potential to get the goods without dying.
Coder J
Member… if only Mojang hadn’t decided to make a big secret of the changelog; now we’re waiting on Bukkit to drop the snapshot API so we can modify CartDispense.
For our next trick, anti-gravity. Let’s see Mojang trump us on that! 😉
Coder J
MemberWith puzzling rhymes,
I find I keep losing my time;
All this work for a block,
made of some pressurized rock.Oh man, I actually did that. Shoot me. In the face. Please.
Coder J
MemberThanks for the feedback so far; I haven’t neglected it, just working 80+ hours at work the last two weeks (and unlike usual, haven’t been able to pop on for more than a few minutes here and there). Hopefully I can post videos soon of the current project, but anyway.
I’ll update soon with setting up the test Bukkit server and actually doing the /helloworld plugin.
-
This reply was modified 13 years ago by
-
AuthorPosts