Post by hello on Feb 4, 2019 11:07:10 GMT
Teleport scrolls to go to Aston/Exk/Brannington. Put some at the Cameron BS or at Fred etc. Would be really nice to have especially with these new powerlevel LQs.
Save me the trouble of having to walk and I'll save you the trouble of having to code.
Save me the trouble of having to walk and I'll save you the trouble of having to code.
// base.c
void teleport_scroll_driver(int in,int cn)
{
int oldx,oldy,area,type,maxlvl,newx,newy;
if (!cn) return; // no timer calls please
if (!it[in].carried) return; // can only use if item is carried
if (ch[cn].action==AC_DIE) return; // already dying, cannot use scroll...
type = it[in].drdata[0];
switch (type) {
case 1:
// cameron
//x=123, y=171, a=1
newx = 123;
newy = 171;
area = 1;
maxlvl = 10;
break;
case 2:
// aston
//x=132, y=193, a=3
newx = 138;
newy = 192;
area = 3;
maxlvl = 20;
break;
case 3:
// exkordon
//x=72, y=111, a=17
newx = 72;
newy = 111;
area = 17;
maxlvl = 50;
break;
case 4:
// brannington
if(!(ch[cn].flags&CF_ARCH)){
log_char(cn,LOG_SYSTEM,0,"This scroll is only usable by an Arch.");
return;
}
//x=195, y=225, a=29
newx = 195;
newy = 225;
area = 29;
maxlvl = 70;
break;
default: return;
}
if (ch[cn].level>maxlvl) { // above rank restriction
log_char(cn,LOG_SYSTEM,0,"This scroll is too weak to transport someone of your power.");
return;
}
log_area(ch[cn].x,ch[cn].y,LOG_INFO,cn,10,"%s uses a teleport scroll and vanishes.",ch[cn].name);
if (area!=areaID) {
if (ch[cn].flags&CF_PLAYER) dlog(cn,in,"dropped because it was used");
remove_item(in);
if (!change_area(cn,area,newx,newy)) {
log_char(cn,LOG_SYSTEM,0,"Nothing happens - target area server is down.");
// give item back to char!!
}
destroy_item(in);
return;
}
oldx=ch[cn].x; oldy=ch[cn].y;
remove_char(cn);
ch[cn].action=ch[cn].step=ch[cn].duration=0;
player_driver_stop(ch[cn].player,0);
if (!drop_char(cn,newx,newy,0)) {
log_char(cn,LOG_SYSTEM,0,"Please try again soon. Target is busy");
drop_char(cn,oldx,oldy,0);
} else {
if (ch[cn].flags&CF_PLAYER) dlog(cn,in,"dropped because it was used");
remove_item(in);
destroy_item(in);
}
}
// drvlib.h
#define IDR_TELESCROLL 149 // teleport scroll
// replace with whatever number and update the driver on the scroll items
// base.c it_driver()
case IDR_TELESCROLL : teleport_scroll_driver(in,cn); return 1;
// the items
scroll_cameron:
name="Cameron Teleport Scroll"
description="A teleport scroll. It can only be used by level 10 and below."
value=96
sprite=21098
flag=IF_TAKE
flag=IF_USE
driver=149
arg="01"
;
scroll_aston:
name="Aston Teleport Scroll"
description="A teleport scroll. It can only be used by level 20 and below."
value=217
sprite=21098
flag=IF_TAKE
flag=IF_USE
driver=149
arg="02"
;
scroll_exkordon:
name="Exkordon Teleport Scroll"
description="A teleport scroll. It can only be used by level 50 and below."
value=2479
sprite=21098
flag=IF_TAKE
flag=IF_USE
driver=149
arg="03"
;
scroll_brannington:
name="Brannington Teleport Scroll"
description="A teleport scroll. It can only be used by an Arch, level 70 and below."
value=12552
sprite=21098
flag=IF_TAKE
flag=IF_USE
driver=149
arg="04"
;