|
Re: RELEASE: Pet system [tutorial]
it works but how can i put more items?
14 years, 45 weeks ago
|
fruity

Joined: 12th Jun 2010
Posts: 569
Re: RELEASE: Pet system [tutorial]
I getan error on line 181 idk what to edit?
error: call of overloaded 'NPC(Map*&, short int&, unsigned char&, unsignedchar&,unsi...
14 years, 44 weeks ago
|
|
Re: RELEASE: Pet system [tutorial]
$sp doesn't work.. How do i spawn pet?
{Fixed}
$sp Debug 171
14 years, 44 weeks ago
|
Re: RELEASE: Pet system [tutorial]
Is this class constructor?
Character::~Character <--- nvm i found in Character.cpp
The pets i added attack owner.....any idea how to make them work properly?
14 years, 42 weeks ago
|
Addison

Joined: 24th Mar 2009
Posts: 1380
Re: RELEASE: Pet system [tutorial]
Character::~Character is the destructor
Character::Character is the constructor
---
http://www.addipop.com
14 years, 42 weeks ago
|
Re: RELEASE: Pet system [tutorial]
Can anyone give an idea how to make pets attack other npcs? Or just a general idea how to?
14 years, 42 weeks ago
|
Re: RELEASE: Pet system [tutorial]
How do i Set what Npc i want to be spawned using the item i choose?
14 years, 42 weeks ago
|
gustavo

Joined: 13th Jul 2010
Posts: 126
Re: RELEASE: Pet system [tutorial]
To me dont works. I say $sn and EOServ Closes!
14 years, 42 weeks ago
|
Re: RELEASE: Pet system [tutorial]
How do i make it so i can add more that 1 item to give out pets..
Example.. item id 61 = npc 88 item id 62 = npcid 255,etc
14 years, 42 weeks ago
|
AustinB

Joined: 9th Jul 2010
Posts: 1400
Re: RELEASE: Pet system [tutorial]
Charizard posted: (14th Jul 2010 12:04 pm)
How do i make it so i can add more that 1 item to give out pets..
Example.. item id 61 = npc 88 item id 62 = npcid 255,etc
Add the code again below it?!?! Seriously? This isn't rocket science.
---
Create your own destiny, don't let someone else do it for you.
14 years, 42 weeks ago
|
Miksu

Joined: 4th Jun 2009
Posts: 1457
Re: RELEASE: Pet system [tutorial]
if(id == 45)
{
this->player->character->Save(); //this may be unnessasary
this->player->character->AddItem(id, 45);//adds back the item after it's use
this->player->character->Save();
if(!this->player->character->has_pet)
{
unsigned char index = this->player->character->map->GenerateNPCIndex();
if (index > 250)
{
break;
}
this->player->character->pet = new NPC(this->player->character->map, 225, this->player->character->x + 1,this->player->character->y, 1, 1, index, true, true);
this->player->character->pet->Spawn();
this->player->character->pet->SetOwner(this->player->character);
this->player->character->has_pet = true;
this->player->character->AddItem(45, 1);
this->player->character->map->npcs.push_back(this->player->character->pet);
this->player->character->Save();
}
else if(this->player->character->has_pet = true)
{
UTIL_PTR_LIST_FOREACH(this->player->character->map->characters, Character, character)
{
if (this->player->character->InRange(*character))
{
this->player->character->pet->RemoveFromView(*character);
}
}
erase_first(this->player->character->map->npcs, this->player->character->pet);
this->player->character->pet->Release();
this->player->character->has_pet = false;
}
}
it compiled without errors and without any warnings but still when I spawn item 45 (Train Ticker) and double click it, nothing? Why? Pet system is working right :o
---
Eoserv classes: Forum ghost, test player, ex-server owner, TOP 50, mapper & an
oldbie
14 years, 41 weeks ago
|
AustinB

Joined: 9th Jul 2010
Posts: 1400
Re: RELEASE: Pet system [tutorial]
sephiroth posted: (21st Jul 2010 08:37 pm)
if(id == 45)
{
this->player->character->Save(); //this may be unnessasary
this->player->character->AddItem(id, 45);//adds back the item after it's use
this->player->character->Save();
if(!this->player->character->has_pet)
{
unsigned char index = this->player->character->map->GenerateNPCIndex();
if (index > 250)
{
break;
}
this->player->character->pet = new NPC(this->player->character->map, 225, this->player->character->x + 1,this->player->character->y, 1, 1, index, true, true);
this->player->character->pet->Spawn();
this->player->character->pet->SetOwner(this->player->character);
this->player->character->has_pet = true;
this->player->character->AddItem(45, 1);
this->player->character->map->npcs.push_back(this->player->character->pet);
this->player->character->Save();
}
else if(this->player->character->has_pet = true)
{
UTIL_PTR_LIST_FOREACH(this->player->character->map->characters, Character, character)
{
if (this->player->character->InRange(*character))
{
this->player->character->pet->RemoveFromView(*character);
}
}
erase_first(this->player->character->map->npcs, this->player->character->pet);
this->player->character->pet->Release();
this->player->character->has_pet = false;
}
}
it compiled without errors and without any warnings but still when I spawn item 45 (Train Ticker) and double click it, nothing? Why? Pet system is working right :o
Make sure item 45 is set to item type 3 (potion) or it prob wont work
---
Create your own destiny, don't let someone else do it for you.
14 years, 41 weeks ago
|
Miksu

Joined: 4th Jun 2009
Posts: 1457
Re: RELEASE: Pet system [tutorial]
AustinB posted: (21st Jul 2010 09:21 pm)
sephiroth posted: (21st Jul 2010 08:37 pm)
if(id == 45)
{
this->player->character->Save(); //this may be unnessasary
this->player->character->AddItem(id, 45);//adds back the item after it's use
this->player->character->Save();
if(!this->player->character->has_pet)
{
unsigned char index = this->player->character->map->GenerateNPCIndex();
if (index > 250)
{
break;
}
this->player->character->pet = new NPC(this->player->character->map, 225, this->player->character->x + 1,this->player->character->y, 1, 1, index, true, true);
this->player->character->pet->Spawn();
this->player->character->pet->SetOwner(this->player->character);
this->player->character->has_pet = true;
this->player->character->AddItem(45, 1);
this->player->character->map->npcs.push_back(this->player->character->pet);
this->player->character->Save();
}
else if(this->player->character->has_pet = true)
{
UTIL_PTR_LIST_FOREACH(this->player->character->map->characters, Character, character)
{
if (this->player->character->InRange(*character))
{
this->player->character->pet->RemoveFromView(*character);
}
}
erase_first(this->player->character->map->npcs, this->player->character->pet);
this->player->character->pet->Release();
this->player->character->has_pet = false;
}
}
it compiled without errors and without any warnings but still when I spawn item 45 (Train Ticker) and double click it, nothing? Why? Pet system is working right :o
Make sure item 45 is set to item type 3 (potion) or it prob wont work
Thank you very much, I didn't know that it should be potion :D
---
Eoserv classes: Forum ghost, test player, ex-server owner, TOP 50, mapper & an
oldbie
14 years, 41 weeks ago
|
Evildark

Joined: 31st Jul 2009
Posts: 485
Re: RELEASE: Pet system [tutorial]
everytime i put that code in and compile it it says ..\src\packet.hpp|73|error: expected '}' before 'PACKET_PLAYER'|
..\src\packet.hpp|73|error: invalid conversion from 'int' to 'PacketAction'|
..\src\packet.hpp|74|error: invalid conversion from 'int' to 'PacketAction'|
..\src\packet.hpp|75|error: invalid conversion from 'int' to 'PacketAction'|
..\src\packet.hpp|76|error: invalid conversion from 'int' to 'PacketAction'|
..\src\packet.hpp|77|error: invalid conversion from 'int' to 'PacketAction'|
..\src\packet.hpp|78|error: invalid conversion from 'int' to 'PacketAction'|
..\src\packet.hpp|79|error: invalid conversion from 'int' to 'PacketAction'|
..\src\packet.hpp|80|error: invalid conversion from 'int' to 'PacketAction'|
..\src\packet.hpp|81|error: invalid conversion from 'int' to 'PacketAction'|
..\src\packet.hpp|82|error: invalid conversion from 'int' to 'PacketAction'|
..\src\packet.hpp|83|error: invalid conversion from 'int' to 'PacketAction'|
..\src\packet.hpp|84|error: invalid conversion from 'int' to 'PacketAction'|
..\src\packet.hpp|85|error: invalid conversion from 'int' to 'PacketAction'|
..\src\packet.hpp|86|error: invalid conversion from 'int' to 'PacketAction'|
..\src\packet.hpp|87|error: invalid conversion from 'int' to 'PacketAction'|
..\src\packet.hpp|88|error: invalid conversion from 'int' to 'PacketAction'|
..\src\packet.hpp|89|error: invalid conversion from 'int' to 'PacketAction'|
..\src\packet.hpp|90|error: invalid conversion from 'int' to 'PacketAction'|
..\src\packet.hpp|91|error: invalid conversion from 'int' to 'PacketAction'|
..\src\packet.hpp|92|error: invalid conversion from 'int' to 'PacketAction'|
..\src\packet.hpp|93|error: invalid conversion from 'int' to 'PacketAction'|
..\src\packet.hpp|94|error: invalid conversion from 'int' to 'PacketAction'|
..\src\packet.hpp|95|error: invalid conversion from 'int' to 'PacketAction'|
..\src\packet.hpp|96|error: invalid conversion from 'int' to 'PacketAction'|
..\src\packet.hpp|98|error: invalid conversion from 'int' to 'PacketAction'|
..\src\packet.hpp|99|error: invalid conversion from 'int' to 'PacketAction'|
..\src\packet.hpp|100|error: invalid conversion from 'int' to 'PacketAction'|
..\src\packet.hpp|101|error: invalid conversion from 'int' to 'PacketAction'|
..\src\packet.hpp|102|error: expected ',' or ';' before '}' token|
..\src\packet.hpp|102|error: expected declaration before '}' token|
||=== Build finished: 31 errors, 0 warnings ===|
---
My skins dying because you're under it-
I’m done lying to myself for this.
For all the wonder in believing man it’s making me weak-
I’ll fade away & classify myself as Obsolete!
14 years, 41 weeks ago
|
Ananas
Moderator
Joined: 22nd Apr 2009
Posts: 2190
Re: RELEASE: Pet system [tutorial]
Seems like you forgot to close the code somewhere "}"
---
"Pineapples and shit."
14 years, 41 weeks ago
| | | | | | | | | | | | | |