Code:CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() { @Override public void execute(CycleEventContainer container) { CODE_HERE } @Override public void stop() { } }, DELAY
|
So...I am trying to figure out hyperion events could somebody give me an example of how to properly use them?
aren't cycleevents like...in PI ?
I am referring to grahams event/world system for Hyperion
Code://submits event World.getWorld().submit(new Tick(1) { @Override //what happens when the even time has run through public void execute() { //code c.sendMessage("event executed"); //end event after code i s done this.stop(); } });
so...would something like this be correct?
lol ignore the items commented outCode://public void execute(CycleEventContainer container) { public void execute() { for(int j = 0; j < stalls.length;) { int random = Misc.random(60); if(random > 30) { c.getPA().addSkillXP(stalls[j][2] * Config.THIEVING_EXPERIENCE, c.playerThieving); c.sendMessage("You successfully steal from this stall."); giveItem(c, ObjId, j); return; } else { //fails //now handle the npc attacking c.sendMessage("You fail to thieve from this stall."); //TODO: make a check if npcs are around, if they are then make them attack the player return; } } } //@Override //public void stop() {} }this.stop(); } }); , 2);
ah okay...I gotcha... thanks
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |