本文整理汇总了C++中clif_spawn函数的典型用法代码示例。如果您正苦于以下问题:C++ clif_spawn函数的具体用法?C++ clif_spawn怎么用?C++ clif_spawn使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了clif_spawn函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: hom_ressurect
/**
* Make a player resurect an homon (player must have one)
* @param sd : player pointer
* @param per : hp percentage to revive homon
* @param x : x map coordinate
* @param y : Y map coordinate
* @return 0:failure, 1:success
*/
int hom_ressurect(struct map_session_data* sd, unsigned char per, short x, short y)
{
struct homun_data* hd;
nullpo_ret(sd);
if (!sd->status.hom_id)
return 0; // no homunculus
if (!sd->hd) //Load homun data;
return intif_homunculus_requestload(sd->status.account_id, sd->status.hom_id);
hd = sd->hd;
if (hd->homunculus.vaporize == HOM_ST_REST)
return 0; // vaporized homunculi need to be 'called'
if (!status_isdead(&hd->bl))
return 0; // already alive
hom_init_timers(hd);
if (!hd->bl.prev)
{ //Add it back to the map.
hd->bl.m = sd->bl.m;
hd->bl.x = x;
hd->bl.y = y;
if(map_addblock(&hd->bl))
return 0;
clif_spawn(&hd->bl);
}
return status_revive(&hd->bl, per, 0);
}
开发者ID:Lucciola541,项目名称:rathena,代码行数:40,代码来源:homunculus.c
示例2: elemental_data_received
/**
* Inter-serv has sent us the elemental data from sql, fill it in map-serv memory
* @param ele : The elemental data received from char-serv
* @param flag : 0:not created, 1:was saved/loaded
* @return 0:failed, 1:sucess
*/
int elemental_data_received(struct s_elemental *ele, bool flag) {
struct map_session_data *sd;
struct elemental_data *ed;
struct s_elemental_db *db;
int i = elemental_search_index(ele->class_);
if( (sd = map_charid2sd(ele->char_id)) == NULL )
return 0;
if( !flag || i < 0 ) { // Not created - loaded - DB info
sd->status.ele_id = 0;
return 0;
}
db = &elemental_db[i];
if( !sd->ed ) { // Initialize it after first summon.
sd->ed = ed = (struct elemental_data*)aCalloc(1,sizeof(struct elemental_data));
ed->bl.type = BL_ELEM;
ed->bl.id = npc_get_new_npc_id();
ed->master = sd;
ed->db = db;
memcpy(&ed->elemental, ele, sizeof(struct s_elemental));
status_set_viewdata(&ed->bl, ed->elemental.class_);
ed->vd->head_mid = 10; // Why?
status_change_init(&ed->bl);
unit_dataset(&ed->bl);
ed->ud.dir = sd->ud.dir;
ed->bl.m = sd->bl.m;
ed->bl.x = sd->bl.x;
ed->bl.y = sd->bl.y;
unit_calc_pos(&ed->bl, sd->bl.x, sd->bl.y, sd->ud.dir);
ed->bl.x = ed->ud.to_x;
ed->bl.y = ed->ud.to_y;
map_addiddb(&ed->bl);
status_calc_elemental(ed,SCO_FIRST);
ed->last_spdrain_time = ed->last_thinktime = gettick();
ed->summon_timer = INVALID_TIMER;
ed->masterteleport_timer = INVALID_TIMER;
elemental_summon_init(ed);
} else {
memcpy(&sd->ed->elemental, ele, sizeof(struct s_elemental));
ed = sd->ed;
}
sd->status.ele_id = ele->elemental_id;
if( ed->bl.prev == NULL && sd->bl.prev != NULL ) {
if(map_addblock(&ed->bl))
return 0;
clif_spawn(&ed->bl);
clif_elemental_info(sd);
clif_elemental_updatestatus(sd,SP_HP);
clif_hpmeter_single(sd->fd,ed->bl.id,ed->battle_status.hp,ed->battle_status.max_hp);
clif_elemental_updatestatus(sd,SP_SP);
}
return 1;
}
开发者ID:newmessage,项目名称:rathena,代码行数:66,代码来源:elemental.c
示例3: mercenary_recv_data
/**
* Received mercenary data from char-serv
* @param merc : mercenary datas
* @param flag : if inter-serv request was sucessfull
* @return false:failure, true:sucess
*/
bool mercenary_recv_data(struct s_mercenary *merc, bool flag)
{
struct map_session_data *sd;
struct mercenary_data *md;
struct s_mercenary_db *db;
int i = mercenary_search_index(merc->class_);
if( (sd = map_charid2sd(merc->char_id)) == NULL )
return false;
if( !flag || i < 0 ) { // Not created - loaded - DB info
sd->status.mer_id = 0;
return false;
}
db = &mercenary_db[i];
if( !sd->md ) {
sd->md = md = (struct mercenary_data*)aCalloc(1,sizeof(struct mercenary_data));
md->bl.type = BL_MER;
md->bl.id = npc_get_new_npc_id();
md->devotion_flag = 0;
md->master = sd;
md->db = db;
memcpy(&md->mercenary, merc, sizeof(struct s_mercenary));
status_set_viewdata(&md->bl, md->mercenary.class_);
status_change_init(&md->bl);
unit_dataset(&md->bl);
md->ud.dir = sd->ud.dir;
md->bl.m = sd->bl.m;
md->bl.x = sd->bl.x;
md->bl.y = sd->bl.y;
unit_calc_pos(&md->bl, sd->bl.x, sd->bl.y, sd->ud.dir);
md->bl.x = md->ud.to_x;
md->bl.y = md->ud.to_y;
map_addiddb(&md->bl);
status_calc_mercenary(md, SCO_FIRST);
md->contract_timer = INVALID_TIMER;
md->masterteleport_timer = INVALID_TIMER;
merc_contract_init(md);
} else {
memcpy(&sd->md->mercenary, merc, sizeof(struct s_mercenary));
md = sd->md;
}
if( sd->status.mer_id == 0 )
mercenary_set_calls(md, 1);
sd->status.mer_id = merc->mercenary_id;
if( md && md->bl.prev == NULL && sd->bl.prev != NULL ) {
if(map_addblock(&md->bl))
return false;
clif_spawn(&md->bl);
clif_mercenary_info(sd);
clif_mercenary_skillblock(sd);
}
return true;
}
开发者ID:AlScarface,项目名称:rathena,代码行数:66,代码来源:mercenary.c
示例4: merc_resurrect_homunculus
int merc_resurrect_homunculus(struct map_session_data* sd, unsigned char per, short x, short y)
{
struct homun_data* hd;
nullpo_ret(sd);
if (!sd->status.hom_id)
return 0; // no homunculus
if( map[sd->bl.m].flag.ancient )
return 0; // Cannot revive homunculus on Ancient WoE
if (!sd->hd) //Load homun data;
return intif_homunculus_requestload(sd->status.account_id, sd->status.hom_id);
hd = sd->hd;
if (hd->homunculus.vaporize)
return 0; // vaporized homunculi need to be 'called'
if (!status_isdead(&hd->bl))
return 0; // already alive
merc_hom_init_timers(hd);
if (!hd->bl.prev)
{ //Add it back to the map.
hd->bl.m = sd->bl.m;
hd->bl.x = x;
hd->bl.y = y;
map_addblock(&hd->bl);
clif_spawn(&hd->bl);
}
status_revive(&hd->bl, per, 0);
return 1;
}
开发者ID:ranfs,项目名称:fa6d4ae1781f9a68f1a4d5,代码行数:35,代码来源:homunculus.c
示例5: merc_hom_mutation
int merc_hom_mutation(struct homun_data *hd, int class_)
{
struct s_homunculus *hom;
struct map_session_data *sd;
nullpo_ret(hd);
//Only allows mutating level 99 evolved homunculus and also prevents mutating already mutated homunculus.
if( hd->homunculus.level < 99 || !(hd->homunculus.class_ >= 6009 && hd->homunculus.class_ <= 6016) ||
hd->homunculus.class_ >= MH_CLASS_BASE && hd->homunculus.class_ <= MH_CLASS_MAX)
{
clif_emotion(&hd->bl, E_SWT);
return 0 ;
}
sd = hd->master;
if (!sd)
return 0;
if (!merc_hom_change_class(hd, class_)) {
ShowError("merc_hom_mutation: Can't mutate homunc from %d to %d", hd->homunculus.class_, class_);
return 0;
}
// Its said the player can rename the homunculus again after mutation.
// This might be true since the homunculus's form completely changes.
hd->homunculus.rename_flag = 0;
//Apply mutation bonuses.
//Bonuses are the same for all mutations.
hom = &hd->homunculus;
hom->max_hp += rand(1000, 2000);
hom->max_sp += rand(10, 200);
hom->str += 10*rand(1, 10);
hom->agi += 10*rand(1, 10);
hom->vit += 10*rand(1, 10);
hom->int_+= 10*rand(1, 10);
hom->dex += 10*rand(1, 10);
hom->luk += 10*rand(1, 10);
unit_remove_map(&hd->bl, CLR_OUTSIGHT);
map_addblock(&hd->bl);
clif_spawn(&hd->bl);
clif_emotion(&sd->bl, E_NO1);
clif_specialeffect(&hd->bl,568,AREA);
//status_Calc flag&1 will make current HP/SP be reloaded from hom structure
hom->hp = hd->battle_status.hp;
hom->sp = hd->battle_status.sp;
status_calc_homunculus(hd,1);
if (!(battle_config.hom_setting&0x2))
skill_unit_move(&sd->hd->bl,gettick(),1); // apply land skills immediately
return 1 ;
}
开发者ID:nevelis,项目名称:3CeAM,代码行数:55,代码来源:homunculus.c
示例6: merc_hom_evolution
/**
* Make an homonculus evolve, (changing in evolution class and apply bonus)
* @param hd : homonculus datas
* @return 0:failure, 1:success
*/
int merc_hom_evolution(struct homun_data *hd)
{
struct s_homunculus *hom;
struct h_stats *max, *min;
struct map_session_data *sd;
nullpo_ret(hd);
if(!hd->homunculusDB->evo_class || hd->homunculus.class_ == hd->homunculusDB->evo_class)
{
clif_emotion(&hd->bl, E_SWT);
return 0 ;
}
sd = hd->master;
if (!sd)
return 0;
if (!merc_hom_change_class(hd, hd->homunculusDB->evo_class)) {
ShowError("merc_hom_evolution: Can't evolve homunc from %d to %d", hd->homunculus.class_, hd->homunculusDB->evo_class);
return 0;
}
//Apply evolution bonuses
hom = &hd->homunculus;
max = &hd->homunculusDB->emax;
min = &hd->homunculusDB->emin;
hom->max_hp += rnd_value(min->HP, max->HP);
hom->max_sp += rnd_value(min->SP, max->SP);
hom->str += 10*rnd_value(min->str, max->str);
hom->agi += 10*rnd_value(min->agi, max->agi);
hom->vit += 10*rnd_value(min->vit, max->vit);
hom->int_+= 10*rnd_value(min->int_,max->int_);
hom->dex += 10*rnd_value(min->dex, max->dex);
hom->luk += 10*rnd_value(min->luk, max->luk);
hom->intimacy = 500;
unit_remove_map(&hd->bl, CLR_OUTSIGHT);
if(map_addblock(&hd->bl))
return 0;
clif_spawn(&hd->bl);
clif_emotion(&sd->bl, E_NO1);
clif_specialeffect(&hd->bl,568,AREA);
//status_Calc flag&1 will make current HP/SP be reloaded from hom structure
hom->hp = hd->battle_status.hp;
hom->sp = hd->battle_status.sp;
status_calc_homunculus(hd,1);
if (!(battle_config.hom_setting&0x2))
skill_unit_move(&sd->hd->bl,gettick(),1); // apply land skills immediately
return 1 ;
}
开发者ID:BlazingSpear,项目名称:rathena,代码行数:58,代码来源:homunculus.c
示例7: pet_recv_petdata
/**
* Finalize hatching process and load pet to client.
* @param account_id : account ID of owner
* @param p : pet requesting
* @param flag : 1:stop loading of pet
* @return 0:success, 1:failure
*/
int pet_recv_petdata(int account_id,struct s_pet *p,int flag)
{
struct map_session_data *sd;
sd = map_id2sd(account_id);
if(sd == NULL)
return 1;
if(flag == 1) {
sd->status.pet_id = 0;
return 1;
}
if(p->incubate == 1) {
int i;
//Delete egg from inventory. [Skotlex]
for (i = 0; i < MAX_INVENTORY; i++) {
if(sd->status.inventory[i].card[0] == CARD0_PET &&
p->pet_id == MakeDWord(sd->status.inventory[i].card[1], sd->status.inventory[i].card[2]))
break;
}
if(i >= MAX_INVENTORY) {
ShowError("pet_recv_petdata: Hatching pet (%d:%s) aborted, couldn't find egg in inventory for removal!\n",p->pet_id, p->name);
sd->status.pet_id = 0;
return 1;
}
if (!pet_birth_process(sd,p)) //Pet hatched. Delete egg.
pc_delitem(sd,i,1,0,0,LOG_TYPE_OTHER);
} else {
pet_data_init(sd,p);
if(sd->pd && sd->bl.prev != NULL) {
if(map_addblock(&sd->pd->bl))
return 1;
clif_spawn(&sd->pd->bl);
clif_send_petdata(sd,sd->pd,0,0);
clif_send_petdata(sd,sd->pd,5,battle_config.pet_hair_style);
clif_pet_equip_area(sd->pd);
clif_send_petstatus(sd);
}
}
return 0;
}
开发者ID:Chocolate31,项目名称:eamod,代码行数:58,代码来源:pet.c
示例8: hom_mutate
/**
* Make an homonculus mutate in renewal homon
* @param hd : homonculus datas
* @param homun_id : id to make it transform into (must be a valid homon class)
* @return 0:failure, 1:sucess
*/
int hom_mutate(struct homun_data *hd, int homun_id)
{
struct s_homunculus *hom;
struct map_session_data *sd;
int m_class, m_id, prev_class = 0;
nullpo_ret(hd);
m_class = hom_class2mapid(hd->homunculus.class_);
m_id = hom_class2mapid(homun_id);
if( m_class == -1 || m_id == -1 || !(m_class&HOM_EVO) || !(m_id&HOM_S) ) {
clif_emotion(&hd->bl, E_SWT);
return 0;
}
sd = hd->master;
if (!sd)
return 0;
prev_class = hd->homunculus.class_;
if (!hom_change_class(hd, homun_id)) {
ShowError("hom_mutate: Can't evolve homunc from %d to %d", hd->homunculus.class_, homun_id);
return 0;
}
unit_remove_map(&hd->bl, CLR_OUTSIGHT);
if(map_addblock(&hd->bl))
return 0;
clif_spawn(&hd->bl);
clif_emotion(&sd->bl, E_NO1);
clif_specialeffect(&hd->bl,568,AREA);
//status_Calc flag&1 will make current HP/SP be reloaded from hom structure
hom = &hd->homunculus;
hom->hp = hd->battle_status.hp;
hom->sp = hd->battle_status.sp;
hom->prev_class = prev_class;
status_calc_homunculus(hd, SCO_FIRST);
if (!(battle_config.hom_setting&0x2))
skill_unit_move(&sd->hd->bl,gettick(),1); // apply land skills immediately
return 1;
}
开发者ID:2serv,项目名称:rathena,代码行数:53,代码来源:homunculus.c
示例9: hom_recv_data
/**
* Receive homunculus data from char server
* @param account_id : owner account_id of the homon
* @param sh : homonculus data from char-serv
* @param flag : does the creation in inter-serv was a success (0:no,1:yes)
* @return 0:failure, 1:sucess
*/
int hom_recv_data(uint32 account_id, struct s_homunculus *sh, int flag)
{
struct map_session_data *sd;
struct homun_data *hd;
bool created = false;
sd = map_id2sd(account_id);
if(!sd)
return 0;
if (sd->status.char_id != sh->char_id)
{
if (sd->status.hom_id == sh->hom_id)
sh->char_id = sd->status.char_id; //Correct char id.
else
return 0;
}
if(!flag) { // Failed to load
sd->status.hom_id = 0;
return 0;
}
if (!sd->status.hom_id) { //Hom just created.
sd->status.hom_id = sh->hom_id;
created = true;
}
if (sd->hd) //uh? Overwrite the data.
memcpy(&sd->hd->homunculus, sh, sizeof(struct s_homunculus));
else
hom_alloc(sd, sh);
hd = sd->hd;
if (created)
status_percent_heal(&hd->bl, 100, 100);
if(hd && hd->homunculus.hp && !hd->homunculus.vaporize && hd->bl.prev == NULL && sd->bl.prev != NULL)
{
if(map_addblock(&hd->bl))
return 0;
clif_spawn(&hd->bl);
clif_send_homdata(sd,SP_ACK,0);
clif_hominfo(sd,hd,1);
clif_hominfo(sd,hd,0); // send this x2. dunno why, but kRO does that [blackhole89]
clif_homskillinfoblock(sd);
hom_init_timers(hd);
}
return 1;
}
开发者ID:anacondaqq,项目名称:rathena,代码行数:54,代码来源:homunculus.cpp
示例10: pet_birth_process
/**
* Begin hatching a pet.
* @param sd : player requesting
* @param pet : pet requesting
*/
int pet_birth_process(struct map_session_data *sd, struct s_pet *pet)
{
nullpo_retr(1, sd);
Assert((sd->status.pet_id == 0 || sd->pd == 0) || sd->pd->master == sd);
if(sd->status.pet_id && pet->incubate == 1) {
sd->status.pet_id = 0;
return 1;
}
pet->incubate = 0;
pet->account_id = sd->status.account_id;
pet->char_id = sd->status.char_id;
sd->status.pet_id = pet->pet_id;
if(pet_data_init(sd, pet)) {
sd->status.pet_id = 0;
return 1;
}
intif_save_petdata(sd->status.account_id,pet);
if (save_settings&8)
chrif_save(sd,0); //is it REALLY Needed to save the char for hatching a pet? [Skotlex]
if(sd->bl.prev != NULL) {
if(map_addblock(&sd->pd->bl))
return 1;
clif_spawn(&sd->pd->bl);
clif_send_petdata(sd,sd->pd, 0,0);
clif_send_petdata(sd,sd->pd, 5,battle_config.pet_hair_style);
clif_pet_equip_area(sd->pd);
clif_send_petstatus(sd);
}
Assert((sd->status.pet_id == 0 || sd->pd == 0) || sd->pd->master == sd);
return 0;
}
开发者ID:Chocolate31,项目名称:eamod,代码行数:48,代码来源:pet.c
示例11: merc_call_homunculus
int merc_call_homunculus(struct map_session_data *sd)
{
struct homun_data *hd;
if( sd->sc.data[SC__GROOMY] )
return 0;
if( map[sd->bl.m].flag.ancient )
return 0; // Cannot call homunculus on Ancient WoE
if (!sd->status.hom_id) //Create a new homun.
return merc_create_homunculus_request(sd, HM_CLASS_BASE + rand(0, 7)) ;
// If homunc not yet loaded, load it
if (!sd->hd)
return intif_homunculus_requestload(sd->status.account_id, sd->status.hom_id);
hd = sd->hd;
if (!hd->homunculus.vaporize)
return 0; //Can't use this if homun wasn't vaporized.
merc_hom_init_timers(hd);
hd->homunculus.vaporize = 0;
if (hd->bl.prev == NULL)
{ //Spawn him
hd->bl.x = sd->bl.x;
hd->bl.y = sd->bl.y;
hd->bl.m = sd->bl.m;
map_addblock(&hd->bl);
clif_spawn(&hd->bl);
clif_send_homdata(sd,SP_ACK,0);
clif_hominfo(sd,hd,1);
clif_hominfo(sd,hd,0); // send this x2. dunno why, but kRO does that [blackhole89]
clif_homskillinfoblock(sd);
if (battle_config.slaves_inherit_speed&1)
status_calc_bl(&hd->bl, SCB_SPEED);
merc_save(hd);
} else
//Warp him to master.
unit_warp(&hd->bl,sd->bl.m, sd->bl.x, sd->bl.y,CLR_OUTSIGHT);
return 1;
}
开发者ID:ranfs,项目名称:fa6d4ae1781f9a68f1a4d5,代码行数:43,代码来源:homunculus.c
示例12: pet_birth_process
int pet_birth_process(struct map_session_data *sd, struct s_pet *pet)
{
char pet_output[1024]; // Declaracion de char para Invocacion Pet's [Tab]
nullpo_retr(1, sd);
Assert((sd->status.pet_id == 0 || sd->pd == 0) || sd->pd->msd == sd);
if(sd->status.pet_id && pet->incuvate == 1) {
sd->status.pet_id = 0;
return 1;
}
pet->incuvate = 0;
pet->account_id = sd->status.account_id;
pet->char_id = sd->status.char_id;
sd->status.pet_id = pet->pet_id;
if(pet_data_init(sd, pet)) {
sd->status.pet_id = 0;
return 1;
}
intif_save_petdata(sd->status.account_id,pet);
if (save_settings&8)
chrif_save(sd,0); //is it REALLY Needed to save the char for hatching a pet? [Skotlex]
if(sd->bl.prev != NULL) {
map_addblock(&sd->pd->bl);
clif_spawn(&sd->pd->bl);
clif_send_petdata(sd,sd->pd, 0,0);
clif_send_petdata(sd,sd->pd, 5,battle_config.pet_hair_style);
clif_pet_equip_area(sd->pd);
clif_send_petstatus(sd);
}
Assert((sd->status.pet_id == 0 || sd->pd == 0) || sd->pd->msd == sd);
clif_misceffect(&sd->pd->bl, 0); // Efecto 1 de nacimiento [Tab]
clif_misceffect(&sd->pd->bl, 344); // Efecto 2 de nacimiento [Tab]
sprintf(pet_output,"Get Out %s... NOW!",pet->name); // Cuidado aca con el nombre del pet
clif_displaymessage(sd->fd, pet_output); // Frase nacimiento [Tab]
return 0;
}
开发者ID:philg666,项目名称:Latest_eAmod,代码行数:42,代码来源:pet.c
示例13: hom_call
/**
* Make a player spawn a homonculus (call)
* @param sd
* @return False:failure, True:sucess
*/
bool hom_call(struct map_session_data *sd)
{
struct homun_data *hd;
if (!sd->status.hom_id) //Create a new homun.
return hom_create_request(sd, HM_CLASS_BASE + rnd_value(0, 7)) ;
// If homunc not yet loaded, load it
if (!sd->hd)
return intif_homunculus_requestload(sd->status.account_id, sd->status.hom_id);
hd = sd->hd;
if (!hd->homunculus.vaporize)
return false; //Can't use this if homun wasn't vaporized.
if (hd->homunculus.vaporize == HOM_ST_MORPH)
return false; // Can't call homunculus (morph state).
hom_init_timers(hd);
hd->homunculus.vaporize = HOM_ST_ACTIVE;
if (hd->bl.prev == NULL)
{ //Spawn him
hd->bl.x = sd->bl.x;
hd->bl.y = sd->bl.y;
hd->bl.m = sd->bl.m;
if(map_addblock(&hd->bl))
return false;
clif_spawn(&hd->bl);
clif_send_homdata(sd,SP_ACK,0);
clif_hominfo(sd,hd,1);
clif_hominfo(sd,hd,0); // send this x2. dunno why, but kRO does that [blackhole89]
clif_homskillinfoblock(sd);
if (battle_config.slaves_inherit_speed&1)
status_calc_bl(&hd->bl, SCB_SPEED);
hom_save(hd);
} else
//Warp him to master.
unit_warp(&hd->bl,sd->bl.m, sd->bl.x, sd->bl.y,CLR_OUTSIGHT);
return true;
}
开发者ID:Lucciola541,项目名称:rathena,代码行数:46,代码来源:homunculus.c
注:本文中的clif_spawn函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论