Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ALUA(dungeon_warp_local)
- {
- if (!lua_isnumber(L, 1))
- {
- sys_err("no map index argument");
- return 0;
- }
- if (!lua_isnumber(L, 2) || !lua_isnumber(L, 3))
- {
- sys_err("no coodinate argument");
- return 0;
- }
- long lMapIndex = (long) lua_tonumber(L, 1);
- const TMapRegion * region = SECTREE_MANAGER::instance().GetMapRegion(lMapIndex);
- if (!region)
- {
- sys_err("invalid map index %d", lMapIndex);
- return 0;
- }
- int x = (int) lua_tonumber(L, 2);
- int y = (int) lua_tonumber(L, 3);
- if (x > region->ex - region->sx)
- {
- sys_err("x coordinate overflow max: %d input: %d", region->ex - region->sx, x);
- return 0;
- }
- if (y > region->ey - region->sy)
- {
- sys_err("y coordinate overflow max: %d input: %d", region->ey - region->sy, y);
- return 0;
- }
- CQuestManager::instance().GetCurrentCharacterPtr()->WarpSet(region->sx + x, region->sy + y);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement