Junior Spellweaver
- Joined
- Oct 4, 2006
- Messages
- 148
- Reaction score
- 3
Hello all i have a question. is somebody ever succeed to add new teleport scrolls in game?
without editing the existing 1? ore made teleports to maps with different index??
just asking.
THX
namespace CItem
{
int __fastcall Use(int* ItemPointer, void* edx, int* PlayerPointer)
{
int ret = (1);
int ItemIndex = ((int*)((int*)ItemPointer)[10])[16];
int TeleportScroll = (6000);
int Coordinates[2];
int nMap = map;
Coordinates[0] = (x);
Coordinates[1] = (y);
if (ItemIndex == TeleportScroll)
{
if (CPlayer::RemoveItem(PlayerPointer, 9, ItemIndex, 1))
{
CPlayer::Teleport(PlayerPointer, nMap, (int)Coordinates, 0, 0);
}
}
else{ret = (CItem::Use(ItemPointer, PlayerPointer));}
return ret;
}
}
indeedIt's better to take care about 0x004d7900 (X), 0x004d7904 (Y) arrays and extend it, so you can use native inititem structure: (specialty (teleport 0 666))