Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void Summon(Client c, int npcType, int x, int y, int heightLevel, int WalkingType, int HP, int maxHit, boolean attackPlayer, int attack, int defence) {
- // first, search for a free slot
- int slot = -1;
- for (int i = 1; i < maxNPCs; i++) {
- if (npcs[i] == null) {
- slot = i;
- break;
- }
- }
- if(slot == -1) {
- //Misc.println("No Free Slot");
- return; // no free slot found
- }
- NPC newNPC = new NPC(slot, npcType);
- newNPC.absX = x;
- newNPC.absY = y;
- newNPC.makeX = x;
- newNPC.makeY = y;
- newNPC.heightLevel = heightLevel;
- newNPC.walkingType = WalkingType;
- newNPC.HP = HP;
- newNPC.MaxHP = HP;
- newNPC.maxHit = maxHit;
- newNPC.attack = attack;
- newNPC.defence = defence;
- newNPC.spawnedBy = c.getId();
- newNPC.followPlayer = c.getId();
- // followPlayer(npcType, c.getId());
- newNPC.summon = true;
- c.lastsummon = npcType;
- c.summon = true;
- newNPC.gfx0(1315);
- c.summoningnpcid = slot;
- newNPC.npcslot = slot;
Add Comment
Please, Sign In to add comment