Skip to content

Commit

Permalink
Implementadas novas funções de script.
Browse files Browse the repository at this point in the history
- dispbottom "string", "color";
- duplicatenpc() & duplicateremove() ~ Créditos Dastgir / Kenpachi
- setunitdata() & getunitdata() ~ Créditos rAthena
  • Loading branch information
Sh1raz committed Aug 8, 2015
1 parent 14f9b3f commit 80b56c1
Show file tree
Hide file tree
Showing 3 changed files with 670 additions and 25 deletions.
22 changes: 18 additions & 4 deletions src/map/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -1908,25 +1908,37 @@ struct mob_data *map_id2md(int id) {

struct npc_data *map_id2nd(int id) {
// just a id2bl lookup because there's no npc_db
struct block_list* bl = map->id2bl(id);
struct block_list *bl = map->id2bl(id);

return BL_CAST(BL_NPC, bl);
}

struct homun_data *map_id2hd(int id) {
struct block_list* bl = map->id2bl(id);
struct block_list *bl = map->id2bl(id);

return BL_CAST(BL_HOM, bl);
}

struct mercenary_data *map_id2mc(int id) {
struct block_list* bl = map->id2bl(id);
struct block_list *bl = map->id2bl(id);

return BL_CAST(BL_MER, bl);
}

struct pet_data *map_id2pd(int id){
struct block_list *bl = map->id2bl(id);

return BL_CAST(BL_PET, bl);
}

struct elemental_data *map_id2ed(int id) {
struct block_list *bl = map->id2bl(id);

return BL_CAST(BL_ELEM, bl);
}

struct chat_data *map_id2cd(int id) {
struct block_list* bl = map->id2bl(id);
struct block_list *bl = map->id2bl(id);

return BL_CAST(BL_CHAT, bl);
}
Expand Down Expand Up @@ -6282,6 +6294,8 @@ void map_defaults(void) {
map->id2nd = map_id2nd;
map->id2hd = map_id2hd;
map->id2mc = map_id2mc;
map->id2pd = map_id2pd;
map->id2ed = map_id2ed;
map->id2cd = map_id2cd;
map->id2bl = map_id2bl;
map->blid_exists = map_blid_exists;
Expand Down
2 changes: 2 additions & 0 deletions src/map/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -1011,6 +1011,8 @@ END_ZEROED_BLOCK;
struct npc_data * (*id2nd) (int id);
struct homun_data* (*id2hd) (int id);
struct mercenary_data* (*id2mc) (int id);
struct pet_data* (*id2pd) (int id);
struct elemental_data* (*id2ed) (int id);
struct chat_data* (*id2cd) (int id);
struct block_list * (*id2bl) (int id);
bool (*blid_exists) (int id);
Expand Down
Loading

0 comments on commit 80b56c1

Please sign in to comment.