walking method. loop through all barricades. if barricade, dont walk. put an object barricade there too so the client can navigate around it.
|
Hey guys.
I'm trying to add barricades to my minigame, but i don't know how to make them not able to walk through them
Any help is appreciated.
This is how I spawn the Barricades
ClickItem class
I've tried looking through a released barricades to see how they did it, but didn't get it to work.Code:switch(itemId) { case 4053: c.getItems().deleteItem(4053,c.getItems().getItemSlot(4053),1); Server.npcHandler.spawnNpc2(1532, c.absX, c.absY, 0, 0,200,0,0,100); c.sendMessage("You setup a barricade."); break; }
walking method. loop through all barricades. if barricade, dont walk. put an object barricade there too so the client can navigate around it.
Not sure if something like this would work, unsure as to how PI's walking is actually handled:
Code:if (MinigameClassHere.inGame(c)) { //if player is in the minigame, so it doesnt loop through this everytime they walk. for (NPC n : NPCHandler.npcs) { if (n != null && n.npcType == ### && c.walkToX == n.absX && c.walkToY == n.absY) //### = barricade npc return; } }
http://www.rune-server.org/runescape...s-updated.html
Take a look at that snippet.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |