Gå til innhold

Hva skjuler det seg bak din Ctrl+v?


Anbefalte innlegg

Videoannonse
Annonse

/*

2

* ShellfishHarvesterMenuComponent.cpp

3

*

4

* Created on: 3/18/2012

5

* Author: Ez

6

*/

7

8

#include "server/zone/objects/creature/CreatureObject.h"

9

#include "server/zone/objects/player/PlayerObject.h"

10

#include "ShellfishHarvesterMenuComponent.h"

11

#include "server/zone/objects/scene/components/ObjectMenuComponent.h"

12

#include "server/zone/packets/object/ObjectMenuResponse.h"

13

#include "server/zone/managers/objectcontroller/ObjectController.h"

14

#include "server/zone/managers/minigames/ForageManager.h"

15

16

17

18

void ShellfishHarvesterMenuComponent::fillObjectMenuResponse(SceneObject* sceneObject, ObjectMenuResponse* menuResponse, CreatureObject* player) {

19

20

if (!sceneObject-&--#62;isTangibleObject())

21

return;

22

23

TangibleObject* tano = cast&--#60;TangibleObject*&--#62;(sceneObject);

24

if(tano == NULL)

25

return;

26

27

TangibleObjectMenuComponent::fillObjectMenuResponse(sceneObject, menuResponse, player);

28

29

}

30

31

int ShellfishHarvesterMenuComponent::handleObjectMenuSelect(SceneObject* sceneObject, CreatureObject* player, byte selectedID) {

32

//ManagedReference&--#60;ZoneServer*&--#62; server = player-&--#62;getZoneServer();

33

//StringBuffer success;

34

//int amountHarvested;

35

//int mindCost = 200;

36

37

if (!sceneObject-&--#62;isTangibleObject())

38

return 0;

39

40

if(selectedID == 20) {

41

42

43

//if(server == NULL)

44

// return 0;

45

46

ForageManager* forageManager = player-&--#62;getZoneProcessServer()-&--#62;getForageManager();

47

forageManager-&--#62;startForaging(player, ForageManager::SHELLFISH);

48

return 0;

49

50

/*

51

if (player-&--#62;isInWater() && !player-&--#62;isSwimming()){

52

53

if (player-&--#62;getHAM(CreatureAttribute::MIND) &--#62;= mindCost + 1)

54

player-&--#62;inflictDamage(player, CreatureAttribute::MIND, mindCost, false, true);

55

56

else {

57

player-&--#62;sendSystemMessage("You need to rest before you can harvest again"); //"You need to rest before you can forage again."

58

return 1;

59

}

60

61

62

if (System::random(100) &--#62; 50){

63

64

ManagedReference&--#60;Zone*&--#62; zone = player-&--#62;getZone();

65

ManagedReference&--#60;ResourceManager*&--#62; resourceManager = server-&--#62;getResourceManager();

66

67

if (System::random(100) &--#62; 50) {

68

69

ManagedReference&--#60;ResourceSpawn*&--#62; molluskSpawn = resourceManager-&--#62;getCurrentSpawn("seafood_mollusk",zone-&--#62;getZoneName());

70

amountHarvested = System::random(25)+ 5;

71

resourceManager-&--#62;harvestResourceToPlayer(player,molluskSpawn,amountHarvested);

72

success &--#60;&--#60; "You successfully harvest " &--#60;&--#60; amountHarvested &--#60;&--#60; " units of mollusk meat";

73

player-&--#62;sendSystemMessage(success.toString());

74

}

75

else {

76

ManagedReference&--#60;ResourceSpawn*&--#62; crustaceanSpawn = resourceManager-&--#62;getCurrentSpawn("seafood_crustacean",zone-&--#62;getZoneName());

77

amountHarvested = System::random(25)+ 5;

78

resourceManager-&--#62;harvestResourceToPlayer(player,crustaceanSpawn,System::random(25)+ 5);

79

success &--#60;&--#60; "You successfully harvest " &--#60;&--#60; amountHarvested &--#60;&--#60; " units of crustacean meat";

80

player-&--#62;sendSystemMessage(success.toString());

81

}

82

}

83

84

else

85

player-&--#62;sendSystemMessage("You failed to harvest any shellfish");

86

87

}

88

89

else

90

player-&--#62;sendSystemMessage("You must be standing in water to use this tool");

91

92

return 1; */

93

}

94

95

return TangibleObjectMenuComponent::handleObjectMenuSelect(sceneObject, player, selectedID);

Endret av -EZ
Lenke til kommentar

Opprett en konto eller logg inn for å kommentere

Du må være et medlem for å kunne skrive en kommentar

Opprett konto

Det er enkelt å melde seg inn for å starte en ny konto!

Start en konto

Logg inn

Har du allerede en konto? Logg inn her.

Logg inn nå
  • Hvem er aktive   0 medlemmer

    • Ingen innloggede medlemmer aktive
×
×
  • Opprett ny...