Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Question (https://forums.graalonline.com/forums/showthread.php?t=53695)

DeFord 07-11-2004 06:31 AM

Question
 
Well I have a theory. (No place to test this on currently)
Could I make a database npc that is able to warp, then have it warpto a level the user inputs and aquire all the tile data from that level using an array and tiles[x,y], then warping the npc back to its home level and outputting all of the stored tiles to the home level, in esscence, making a temp. copy of the chosen level without using copylevel.

(No way to test, because my RC for my playerworld is IP protected and I'm on vacation) x_x

Edit:
Tentative Script
NPC Code:

//NPC Made By Zach
if(created) {
canwarp;
}
if(playerchats && startswith(/level,#c)) {
tokenize #c;
setarray tilearr,4096;
warpto #t(1),0,0;
this.k=0;
for(this.i=0;this.i<64;this.i++) {
for(this.j=0;this.j<64;this.j++) {
tilearr[this.k]=tiles[this.i,this,j];
this.k++;
}
}
warpto <homelevelname>,0,0;
this.k=0;
for(this.i=0;this.i<64;this.i++) {
for(this.j=0;this.j<64;this.j++) {
tiles[this.i,this,j]=tilearr[this.k];
updateterrain;
this.k++;
}
}
}


falco10291029 07-15-2004 04:13 PM

if you really wish, i may let you try it on elemental kingdoms, my server

Alexander 07-16-2004 05:32 AM

Does work, I use this in my script, also use updateboard(2) instead of updateterrain (After the fors).


All times are GMT +2. The time now is 03:35 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.